diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 1a2803bf0af9..0171fc485b15 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -1297,10 +1297,6 @@ packages: resolution: {integrity: sha512-Ue4ocP8qCsFDeBZ/MjMNyVt4e9QhU3UgrRfZSw6kWiMzdrCgDePnZvjzZs9PQpjAsXbHGd9HlEIXg9Dl6Y/uww==} engines: {node: '>=14.0.0'} - '@azure/arm-eventhub@5.2.0': - resolution: {integrity: sha512-bWWIYQ4GWHh65DYxnQgNVu2qniC8UqBWR8ZQF5kBDkcF6/0iCirgnIu9G8dzYW2XVlgjh6E1tygcAKUZpOZ8HA==} - engines: {node: '>=18.0.0'} - '@azure/arm-network@32.2.0': resolution: {integrity: sha512-6QmZ9aGdiz+9u7jPhQEg2zY/Tn8hwJrmjAMuHlWpnqE2kHvSDnKCE3BiNLZsENfi/IeLKBuW0QIdZ5UhbSSA0A==} engines: {node: '>=14.0.0'} @@ -2540,7 +2536,7 @@ packages: version: 0.0.0 '@rush-temp/ai-inference@file:projects/ai-inference.tgz': - resolution: {integrity: sha512-jy3iCFAJq8qZFdMN0GEK8XNPi3lTfEIQEOM4jNCqE850gODahI+XXRqHMbrGUJd2tjmZMm0cKc6CQbjVxFsi/Q==, tarball: file:projects/ai-inference.tgz} + resolution: {integrity: sha512-3F/JVas1qHmWihXHHGxX6EUigHTNsftXBjspS6BMU6/lu/xDNMxKAY30DJMK90KyhH5UxZ+ZRwWlWbhKWW+2ow==, tarball: file:projects/ai-inference.tgz} version: 0.0.0 '@rush-temp/ai-language-conversations@file:projects/ai-language-conversations.tgz': @@ -2560,7 +2556,7 @@ packages: version: 0.0.0 '@rush-temp/ai-projects@file:projects/ai-projects.tgz': - resolution: {integrity: sha512-olWaOR+lScYd4KfOBFDagJ6zLA728vt+08hSgNDsM182EdAAAYN2c5dqJ7BsN/1rv7I6rb6lywdCSQ5gK9pABQ==, tarball: file:projects/ai-projects.tgz} + resolution: {integrity: sha512-rbzbhwz+05oHf7CC83pshBtWypNW2LVlSpfOOwkX3BmqB4MiHah+CmjehPDEKqpnn0vgU4GzdM0BeD4HoI9J1w==, tarball: file:projects/ai-projects.tgz} version: 0.0.0 '@rush-temp/ai-text-analytics@file:projects/ai-text-analytics.tgz': @@ -3196,7 +3192,7 @@ packages: version: 0.0.0 '@rush-temp/arm-monitor@file:projects/arm-monitor.tgz': - resolution: {integrity: sha512-LgN2yW/Lf0Ja7/h/vOn7XIpi5hXihM0tEGxr+LDMTvqfgKUaCVOqv3Z3i9g4lI2h0iGAoYDALK9pzm6iCmdbZQ==, tarball: file:projects/arm-monitor.tgz} + resolution: {integrity: sha512-Nlk5XEHwII76KOCZmRmALk2SUdDgnmR6wA48UR7Zn4gFnaKTvb9PkiHmkVOoAvAHpRSZyN97/jfF1X5GWzpnXA==, tarball: file:projects/arm-monitor.tgz} version: 0.0.0 '@rush-temp/arm-msi@file:projects/arm-msi.tgz': @@ -3884,7 +3880,7 @@ packages: version: 0.0.0 '@rush-temp/mixed-reality-remote-rendering@file:projects/mixed-reality-remote-rendering.tgz': - resolution: {integrity: sha512-4Wx6KxuTYKmgYWfmzLs2BW2MkwATk98Fdx88WL7/sa632gevVbfOCT5WWUUsqW2OtLN36jpr8Vi6UfKrxEON0g==, tarball: file:projects/mixed-reality-remote-rendering.tgz} + resolution: {integrity: sha512-TN6cq8PIrYAy/tJ4mQIkcRn1Wkr5lBxnDY8UeSvQP9D61ZN0iESKb4j+wnXPJp2RNKa9tBpg8NcOt5Jc7qhwaQ==, tarball: file:projects/mixed-reality-remote-rendering.tgz} version: 0.0.0 '@rush-temp/mock-hub@file:projects/mock-hub.tgz': @@ -3900,11 +3896,11 @@ packages: version: 0.0.0 '@rush-temp/monitor-opentelemetry@file:projects/monitor-opentelemetry.tgz': - resolution: {integrity: sha512-1K08pDS3mRgyqyPHPU/PS/Kwhn10bdtrh9sU9itLgfy+cj+Rn/KkMG0Y0ZIAqhPRYc1/LUdXBVR1LZ/l3gx0Iw==, tarball: file:projects/monitor-opentelemetry.tgz} + resolution: {integrity: sha512-HH9DSuPu9Flo0w2YXzGUnayl/lDLcTwcGEhht0VdjPe7ZwhakhOH8/VoxrZKQTdgseCZMpYDmWgB2BaKkUr/Mg==, tarball: file:projects/monitor-opentelemetry.tgz} version: 0.0.0 '@rush-temp/monitor-query@file:projects/monitor-query.tgz': - resolution: {integrity: sha512-FfDHQlhugBYGKJAG+Qvo0eA9RxpyaY0LHrPOjcmIyF8gy3hxeJf0+Z9/XSfi3jDrCdv+l1K3as1cbuiY48Or4Q==, tarball: file:projects/monitor-query.tgz} + resolution: {integrity: sha512-bQ0lyAnF/GBcL7pwA66f/U6sjezndhPmHkMCjdmz1MD93PYpaQvasNEGspFvjrnt8Xwcg0CmdnzeWbHE6obY1w==, tarball: file:projects/monitor-query.tgz} version: 0.0.0 '@rush-temp/notification-hubs@file:projects/notification-hubs.tgz': @@ -3912,7 +3908,7 @@ packages: version: 0.0.0 '@rush-temp/openai@file:projects/openai.tgz': - resolution: {integrity: sha512-QnN8rZhPnF3/GYsh3cLlyCb6JgnWdpPVrjGoau5jvxZQWcBIWb108P7yNZwXptJcPti/jGYJPFQuwRWW7CxgvA==, tarball: file:projects/openai.tgz} + resolution: {integrity: sha512-EB6z+wWho8coz2hCDFUcYTJ+Jw5CfJ20yzKpIZeNk4OxpglGY7XTSiWxsuCHa++eVGTTXRHMwG/gdOtAv9mZkw==, tarball: file:projects/openai.tgz} version: 0.0.0 '@rush-temp/opentelemetry-instrumentation-azure-sdk@file:projects/opentelemetry-instrumentation-azure-sdk.tgz': @@ -3980,7 +3976,7 @@ packages: version: 0.0.0 '@rush-temp/perf-monitor-opentelemetry@file:projects/perf-monitor-opentelemetry.tgz': - resolution: {integrity: sha512-dwzpNIZPU6i3RcqjhLVipjyiz3ZZMtjs7dOuCSH4TtaOyj5vgqVvQC61FbEsnQrI5coVWW0NEOmbNYbzkih1Yw==, tarball: file:projects/perf-monitor-opentelemetry.tgz} + resolution: {integrity: sha512-B6GNjGVtP+BWESkV/d2t2Kg4FhgyWAibL4khmjnhduwd14Cjtqf/Aoz7B71usfgEXEUE9KvkL3VUg2IVm+MLSw==, tarball: file:projects/perf-monitor-opentelemetry.tgz} version: 0.0.0 '@rush-temp/perf-monitor-query@file:projects/perf-monitor-query.tgz': @@ -4056,7 +4052,7 @@ packages: version: 0.0.0 '@rush-temp/service-bus@file:projects/service-bus.tgz': - resolution: {integrity: sha512-ICttr5Vkcza3Jpy5WP+rciaUvO8NRkplh7TEOk7RWExZR9GFF0hXTNbH11Id8/OSZ17v/vuWtwt+9GFLBeDsZw==, tarball: file:projects/service-bus.tgz} + resolution: {integrity: sha512-CEMwNWHdlbtYASoZFKNN3dzVF8Uno0LED5f7xmGV7kjawCq6iJuwxz4UhBDpDDdYYdG+cAIIcMZfUEj+cdcQsA==, tarball: file:projects/service-bus.tgz} version: 0.0.0 '@rush-temp/storage-blob-changefeed@file:projects/storage-blob-changefeed.tgz': @@ -8319,18 +8315,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@azure/arm-eventhub@5.2.0': - dependencies: - '@azure/abort-controller': 1.1.0 - '@azure/core-auth': 1.9.0 - '@azure/core-client': 1.9.2 - '@azure/core-lro': 2.7.2 - '@azure/core-paging': 1.6.2 - '@azure/core-rest-pipeline': 1.19.0 - tslib: 2.8.1 - transitivePeerDependencies: - - supports-color - '@azure/arm-network@32.2.0': dependencies: '@azure/abort-controller': 1.1.0 @@ -15693,15 +15677,14 @@ snapshots: '@rush-temp/arm-monitor@file:projects/arm-monitor.tgz(@types/debug@4.1.12)(msw@2.7.2(@types/node@22.7.9)(typescript@5.8.2))(tsx@4.19.3)(vite@6.1.1(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(yaml@2.7.0)': dependencies: - '@azure/arm-eventhub': 5.2.0 '@azure/core-lro': 2.7.2 '@types/node': 18.19.76 - '@vitest/browser': 3.0.6(@types/node@18.19.76)(playwright@1.50.1)(typescript@5.7.3)(vite@6.1.1(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.6) + '@vitest/browser': 3.0.6(@types/node@18.19.76)(playwright@1.50.1)(typescript@5.6.3)(vite@6.1.1(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.6) '@vitest/coverage-istanbul': 3.0.6(vitest@3.0.6) dotenv: 16.4.7 playwright: 1.50.1 tslib: 2.8.1 - typescript: 5.7.3 + typescript: 5.6.3 vitest: 3.0.6(@types/debug@4.1.12)(@types/node@18.19.76)(@vitest/browser@3.0.6)(msw@2.7.2(@types/node@22.7.9)(typescript@5.8.2))(tsx@4.19.3)(yaml@2.7.0) transitivePeerDependencies: - '@edge-runtime/vm' @@ -27933,7 +27916,7 @@ snapshots: resolve-import: 1.4.6 rimraf: 5.0.10 sync-content: 1.0.2 - typescript: 5.7.3 + typescript: 5.8.2 walk-up-path: 3.0.1 tslib@2.8.1: {} diff --git a/sdk/monitor/arm-monitor/CHANGELOG.md b/sdk/monitor/arm-monitor/CHANGELOG.md index 5245bfa35b4b..9e158949adc8 100644 --- a/sdk/monitor/arm-monitor/CHANGELOG.md +++ b/sdk/monitor/arm-monitor/CHANGELOG.md @@ -1,15 +1,156 @@ # Release History - -## 8.0.0-beta.6 (Unreleased) - + +## 8.0.0-beta.6 (2025-03-04) +Compared with version 7.0.0 + ### Features Added -### Breaking Changes - -### Bugs Fixed + - Added operation ActionGroups.beginCreateNotificationsAtActionGroupResourceLevel + - Added operation ActionGroups.beginCreateNotificationsAtActionGroupResourceLevelAndWait + - Added operation ActionGroups.getTestNotificationsAtActionGroupResourceLevel + - Added Interface ActionGroupResource + - Added Interface ActionGroupsCreateNotificationsAtActionGroupResourceLevelHeaders + - Added Interface ActionGroupsCreateNotificationsAtActionGroupResourceLevelOptionalParams + - Added Interface ActionGroupsGetTestNotificationsAtActionGroupResourceLevelOptionalParams + - Added Interface Actions + - Added Interface Condition + - Added Interface ConditionFailingPeriods + - Added Interface ErrorResponseAutoGenerated + - Added Interface Identity + - Added Interface IncidentReceiver + - Added Interface IncidentServiceConnection + - Added Interface ManagedServiceIdentity + - Added Interface RuleResolveConfiguration + - Added Interface ScheduledQueryRuleCriteria + - Added Interface ScheduledQueryRuleResource + - Added Interface ScheduledQueryRuleResourceCollection + - Added Interface ScheduledQueryRuleResourcePatch + - Added Interface ScheduledQueryRulesListByResourceGroupNextOptionalParams + - Added Interface ScheduledQueryRulesListBySubscriptionNextOptionalParams + - Added Interface UserAssignedIdentity + - Added Interface UserIdentityProperties + - Added Type Alias ActionGroupsCreateNotificationsAtActionGroupResourceLevelResponse + - Added Type Alias ActionGroupsGetTestNotificationsAtActionGroupResourceLevelResponse + - Added Type Alias DimensionOperator + - Added Type Alias IdentityType + - Added Type Alias IncidentManagementService + - Added Type Alias Kind + - Added Type Alias ManagedServiceIdentityType + - Added Type Alias ScheduledQueryRulesListByResourceGroupNextResponse + - Added Type Alias ScheduledQueryRulesListBySubscriptionNextResponse + - Added Type Alias TimeAggregation + - Interface ActionGroupPatchBody has a new optional parameter identity + - Interface AutomationRunbookReceiver has a new optional parameter managedIdentity + - Interface AzureFunctionReceiver has a new optional parameter managedIdentity + - Interface EventHubReceiver has a new optional parameter managedIdentity + - Interface LogicAppReceiver has a new optional parameter managedIdentity + - Interface NotificationRequestBody has a new optional parameter incidentReceivers + - Interface WebhookReceiver has a new optional parameter managedIdentity + - Added Enum KnownConditionOperator + - Added Enum KnownDimensionOperator + - Added Enum KnownIncidentManagementService + - Added Enum KnownKind + - Added Enum KnownManagedServiceIdentityType + - Added Enum KnownTimeAggregation + - Added function getContinuationToken -### Other Changes +### Breaking Changes + - Removed operation group ActivityLogAlerts + - Removed operation group ActivityLogs + - Removed operation group AlertRuleIncidents + - Removed operation group AlertRules + - Removed operation group AutoscaleSettings + - Removed operation group Baselines + - Removed operation group DataCollectionEndpoints + - Removed operation group DataCollectionRuleAssociations + - Removed operation group DataCollectionRules + - Removed operation group DiagnosticSettings + - Removed operation group DiagnosticSettingsCategory + - Removed operation group EventCategories + - Removed operation group LogProfiles + - Removed operation group MetricAlerts + - Removed operation group MetricAlertsStatus + - Removed operation group MetricDefinitions + - Removed operation group MetricNamespaces + - Removed operation group Metrics + - Removed operation group Operations + - Removed operation group PrivateEndpointConnections + - Removed operation group PrivateLinkResources + - Removed operation group PrivateLinkScopedResources + - Removed operation group PrivateLinkScopeOperationStatus + - Removed operation group PrivateLinkScopes + - Removed operation group TenantActivityLogs + - Removed operation group VMInsights + - Removed operation ActionGroups.beginPostTestNotifications + - Removed operation ActionGroups.beginPostTestNotificationsAndWait + - Removed operation ActionGroups.getTestNotifications + - Operation ScheduledQueryRules.createOrUpdate has a new signature + - Operation ScheduledQueryRules.update has a new signature + - Interface AzureResource no longer has parameter kind + - Interface ScheduledQueryRulesListByResourceGroupOptionalParams no longer has parameter filter + - Interface ScheduledQueryRulesListBySubscriptionOptionalParams no longer has parameter filter + - Type of parameter identity of interface AzureResource is changed from string to ManagedServiceIdentity + - 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 ErrorResponseAutoGenerated + - Class MonitorClient no longer has parameter activityLogAlerts + - Class MonitorClient no longer has parameter activityLogs + - Class MonitorClient no longer has parameter alertRuleIncidents + - Class MonitorClient no longer has parameter alertRules + - Class MonitorClient no longer has parameter autoscaleSettings + - Class MonitorClient no longer has parameter baselines + - Class MonitorClient no longer has parameter dataCollectionEndpoints + - Class MonitorClient no longer has parameter dataCollectionRuleAssociations + - Class MonitorClient no longer has parameter dataCollectionRules + - Class MonitorClient no longer has parameter diagnosticSettings + - Class MonitorClient no longer has parameter diagnosticSettingsCategory + - Class MonitorClient no longer has parameter eventCategories + - Class MonitorClient no longer has parameter logProfiles + - Class MonitorClient no longer has parameter metricAlerts + - Class MonitorClient no longer has parameter metricAlertsStatus + - Class MonitorClient no longer has parameter metricDefinitions + - Class MonitorClient no longer has parameter metricNamespaces + - Class MonitorClient no longer has parameter metrics + - Class MonitorClient no longer has parameter operations + - Class MonitorClient no longer has parameter privateEndpointConnections + - Class MonitorClient no longer has parameter privateLinkResources + - Class MonitorClient no longer has parameter privateLinkScopedResources + - Class MonitorClient no longer has parameter privateLinkScopeOperationStatus + - Class MonitorClient no longer has parameter privateLinkScopes + - Class MonitorClient no longer has parameter tenantActivityLogs + - Class MonitorClient no longer has parameter vMInsights + - Removed Enum KnownAggregationTypeEnum + - Removed Enum KnownBaselineSensitivity + - Removed Enum KnownConditionalOperator + - Removed Enum KnownDataStatus + - Removed Enum KnownDynamicThresholdOperator + - Removed Enum KnownDynamicThresholdSensitivity + - Removed Enum KnownEnabled + - Removed Enum KnownKnownDataCollectionEndpointProvisioningState + - Removed Enum KnownKnownDataCollectionEndpointResourceKind + - Removed Enum KnownKnownDataCollectionRuleAssociationProvisioningState + - Removed Enum KnownKnownDataCollectionRuleProvisioningState + - Removed Enum KnownKnownDataCollectionRuleResourceKind + - Removed Enum KnownKnownDataFlowStreams + - Removed Enum KnownKnownExtensionDataSourceStreams + - Removed Enum KnownKnownPerfCounterDataSourceStreams + - Removed Enum KnownKnownPublicNetworkAccessOptions + - Removed Enum KnownKnownSyslogDataSourceFacilityNames + - Removed Enum KnownKnownSyslogDataSourceLogLevels + - Removed Enum KnownKnownSyslogDataSourceStreams + - Removed Enum KnownKnownWindowsEventLogDataSourceStreams + - Removed Enum KnownMetricClass + - Removed Enum KnownMetricTriggerType + - Removed Enum KnownMetricUnit + - Removed Enum KnownNamespaceClassification + - Removed Enum KnownOdatatype + - Removed Enum KnownOnboardingStatus + - Removed Enum KnownOperator + - Removed Enum KnownProvisioningState + - Removed Enum KnownQueryType + - Removed Enum KnownScaleRuleMetricDimensionOperationType + + ## 8.0.0-beta.5 (2024-03-28) ### Features Added diff --git a/sdk/monitor/arm-monitor/LICENSE b/sdk/monitor/arm-monitor/LICENSE index b2f52a2bad4e..63447fd8bbbf 100644 --- a/sdk/monitor/arm-monitor/LICENSE +++ b/sdk/monitor/arm-monitor/LICENSE @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/sdk/monitor/arm-monitor/README.md b/sdk/monitor/arm-monitor/README.md index 8a987b681e84..85bc5bd2d8e5 100644 --- a/sdk/monitor/arm-monitor/README.md +++ b/sdk/monitor/arm-monitor/README.md @@ -44,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure Monitor** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). @@ -64,16 +63,14 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur import { InteractiveBrowserCredential } from "@azure/identity"; import { MonitorClient } from "@azure/arm-monitor"; -const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", - clientId: "", -}); + clientId: "" + }); const client = new MonitorClient(credential, subscriptionId); ``` ### JavaScript Bundle - To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). ## Key concepts @@ -108,6 +105,8 @@ If you'd like to contribute to this library, please read the [contributing guide - [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fmonitor%2Farm-monitor%2FREADME.png) + [azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/ [azure_sub]: https://azure.microsoft.com/free/ diff --git a/sdk/monitor/arm-monitor/_meta.json b/sdk/monitor/arm-monitor/_meta.json index 73a8f1930d4e..d572977f7466 100644 --- a/sdk/monitor/arm-monitor/_meta.json +++ b/sdk/monitor/arm-monitor/_meta.json @@ -1,8 +1,8 @@ { - "commit": "6fc313ed7a6e926d4409d4ddb435f6532922652f", + "commit": "1e3132c2f308fd63ab800ce351d34851ada174fe", "readme": "specification/monitor/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.7 --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.18 --generate-sample=true", + "autorest_command": "autorest --version=3.9.7 --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.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.4", - "use": "@autorest/typescript@6.0.18" -} + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.21", + "use": "@autorest/typescript@^6.0.12" +} \ No newline at end of file diff --git a/sdk/monitor/arm-monitor/api-extractor.json b/sdk/monitor/arm-monitor/api-extractor.json index 812a042da059..f0fcd2b2eb69 100644 --- a/sdk/monitor/arm-monitor/api-extractor.json +++ b/sdk/monitor/arm-monitor/api-extractor.json @@ -1,6 +1,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "dist/esm/index.d.ts", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", "docModel": { "enabled": true }, @@ -11,7 +11,7 @@ "dtsRollup": { "enabled": true, "untrimmedFilePath": "", - "publicTrimmedFilePath": "dist/arm-monitor.d.ts" + "publicTrimmedFilePath": "./types/arm-monitor.d.ts" }, "messages": { "tsdocMessageReporting": { @@ -28,4 +28,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/monitor/arm-monitor/assets.json b/sdk/monitor/arm-monitor/assets.json deleted file mode 100644 index fc96d4919d56..000000000000 --- a/sdk/monitor/arm-monitor/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "js", - "TagPrefix": "js/monitor/arm-monitor", - "Tag": "js/monitor/arm-monitor_86ac674e4d" -} diff --git a/sdk/monitor/arm-monitor/package.json b/sdk/monitor/arm-monitor/package.json index d6ac902bd5d2..7a3b5f88a41c 100644 --- a/sdk/monitor/arm-monitor/package.json +++ b/sdk/monitor/arm-monitor/package.json @@ -21,33 +21,31 @@ "azure", "typescript", "browser", - "isomorphic", - "cloud" + "isomorphic" ], "license": "MIT", "main": "./dist/commonjs/index.js", - "module": "./dist/esm/index.js", + "module": "./dist-esm/src/index.js", "types": "./dist/commonjs/index.d.ts", "devDependencies": { "@azure-tools/test-credential": "^2.0.0", "@azure-tools/test-recorder": "^4.1.0", "@azure-tools/test-utils-vitest": "^1.0.0", - "@azure/arm-eventhub": "5.2.0", - "@azure/arm-logic": "^8.0.0", - "@azure/arm-operationalinsights": "^9.0.0", - "@azure/arm-storage": "^18.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.6.0", + "@azure/identity": "^4.7.0", "@azure/logger": "^1.1.4", "@types/node": "^18.0.0", - "@vitest/browser": "^3.0.5", - "@vitest/coverage-istanbul": "^3.0.5", + "@vitest/browser": "^3.0.6", + "@vitest/coverage-istanbul": "^3.0.6", "dotenv": "^16.0.0", "playwright": "^1.50.1", - "typescript": "~5.7.2", - "vitest": "^3.0.5" + "typescript": "~5.6.2", + "vitest": "^3.0.6" + }, + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" }, - "repository": "github:Azure/azure-sdk-for-js", "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, @@ -95,14 +93,6 @@ }, "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://learn.microsoft.com/javascript/api/@azure/arm-monitor?view=azure-node-preview" - }, "type": "module", "tshy": { "project": "./tsconfig.src.json", @@ -143,4 +133,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/monitor/arm-monitor/review/arm-monitor.api.md b/sdk/monitor/arm-monitor/review/arm-monitor.api.md index b01ec96a346b..501a956d0c69 100644 --- a/sdk/monitor/arm-monitor/review/arm-monitor.api.md +++ b/sdk/monitor/arm-monitor/review/arm-monitor.api.md @@ -10,23 +10,6 @@ import { OperationState } from '@azure/core-lro'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; import { SimplePollerLike } from '@azure/core-lro'; -// @public -export type AccessMode = string; - -// @public -export interface AccessModeSettings { - exclusions?: AccessModeSettingsExclusion[]; - ingestionAccessMode: AccessMode; - queryAccessMode: AccessMode; -} - -// @public -export interface AccessModeSettingsExclusion { - ingestionAccessMode?: AccessMode; - privateEndpointConnectionName?: string; - queryAccessMode?: AccessMode; -} - // @public export interface ActionDetail { detail?: string; @@ -37,24 +20,6 @@ export interface ActionDetail { subState?: string; } -// @public -export interface ActionDetailAutoGenerated { - mechanismType?: string; - message?: string; - name?: string; - sendTime?: string; - status?: string; - subState?: string; -} - -// @public -export interface ActionGroup { - actionGroupId: string; - webhookProperties?: { - [propertyName: string]: string; - }; -} - // @public export interface ActionGroupList { nextLink?: string; @@ -64,14 +29,7 @@ export interface ActionGroupList { // @public export interface ActionGroupPatchBody { enabled?: boolean; - tags?: { - [propertyName: string]: string; - }; -} - -// @public -export interface ActionGroupPatchBodyAutoGenerated { - enabled?: boolean; + identity?: ManagedServiceIdentity; tags?: { [propertyName: string]: string; }; @@ -87,6 +45,7 @@ export interface ActionGroupResource extends AzureResource { enabled?: boolean; eventHubReceivers?: EventHubReceiver[]; groupShortName?: string; + incidentReceivers?: IncidentReceiver[]; itsmReceivers?: ItsmReceiver[]; logicAppReceivers?: LogicAppReceiver[]; smsReceivers?: SmsReceiver[]; @@ -172,11 +131,6 @@ export interface ActionGroupsUpdateOptionalParams extends coreClient.OperationOp // @public export type ActionGroupsUpdateResponse = ActionGroupResource; -// @public -export interface ActionList { - actionGroups?: ActionGroup[]; -} - // @public export interface Actions { actionGroups?: string[]; @@ -189,3331 +143,339 @@ export interface Actions { } // @public -export type ActionType = string; +export type AlertSeverity = number; // @public -export interface ActivityLogAlertResource extends AzureResourceAutoGenerated { - actions?: ActionList; - condition?: AlertRuleAllOfCondition; - description?: string; - enabled?: boolean; - scopes?: string[]; +export interface ArmRoleReceiver { + name: string; + roleId: string; + useCommonAlertSchema?: boolean; } // @public -export interface ActivityLogAlerts { - createOrUpdate(resourceGroupName: string, activityLogAlertName: string, activityLogAlertRule: ActivityLogAlertResource, options?: ActivityLogAlertsCreateOrUpdateOptionalParams): Promise; - delete(resourceGroupName: string, activityLogAlertName: string, options?: ActivityLogAlertsDeleteOptionalParams): Promise; - get(resourceGroupName: string, activityLogAlertName: string, options?: ActivityLogAlertsGetOptionalParams): Promise; - listByResourceGroup(resourceGroupName: string, options?: ActivityLogAlertsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - listBySubscriptionId(options?: ActivityLogAlertsListBySubscriptionIdOptionalParams): PagedAsyncIterableIterator; - update(resourceGroupName: string, activityLogAlertName: string, activityLogAlertRulePatch: AlertRulePatchObject, options?: ActivityLogAlertsUpdateOptionalParams): Promise; +export interface AutomationRunbookReceiver { + automationAccountId: string; + isGlobalRunbook: boolean; + managedIdentity?: string; + name?: string; + runbookName: string; + serviceUri?: string; + useCommonAlertSchema?: boolean; + webhookResourceId: string; } // @public -export interface ActivityLogAlertsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +export interface AzureAppPushReceiver { + emailAddress: string; + name: string; } // @public -export type ActivityLogAlertsCreateOrUpdateResponse = ActivityLogAlertResource; - -// @public -export interface ActivityLogAlertsDeleteOptionalParams extends coreClient.OperationOptions { +export interface AzureFunctionReceiver { + functionAppResourceId: string; + functionName: string; + httpTriggerUrl: string; + managedIdentity?: string; + name: string; + useCommonAlertSchema?: boolean; } // @public -export interface ActivityLogAlertsGetOptionalParams extends coreClient.OperationOptions { +export interface AzureResource { + readonly id?: string; + identity?: ManagedServiceIdentity; + location: string; + readonly name?: string; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; } // @public -export type ActivityLogAlertsGetResponse = ActivityLogAlertResource; +export interface Condition { + alertSensitivity?: string; + criterionType?: CriterionType; + dimensions?: Dimension[]; + failingPeriods?: ConditionFailingPeriods; + ignoreDataBefore?: Date; + metricMeasureColumn?: string; + metricName?: string; + minRecurrenceCount?: number; + operator?: ConditionOperator; + query?: string; + resourceIdColumn?: string; + threshold?: number; + timeAggregation?: TimeAggregation; +} // @public -export interface ActivityLogAlertsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +export interface ConditionFailingPeriods { + minFailingPeriodsToAlert?: number; + numberOfEvaluationPeriods?: number; } // @public -export type ActivityLogAlertsListByResourceGroupNextResponse = AlertRuleList; +export type ConditionOperator = string; // @public -export interface ActivityLogAlertsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +export interface Context { + contextType?: string; + notificationSource?: string; } // @public -export type ActivityLogAlertsListByResourceGroupResponse = AlertRuleList; - -// @public -export interface ActivityLogAlertsListBySubscriptionIdNextOptionalParams extends coreClient.OperationOptions { -} +export type CreatedByType = string; // @public -export type ActivityLogAlertsListBySubscriptionIdNextResponse = AlertRuleList; +export type CriterionType = string; // @public -export interface ActivityLogAlertsListBySubscriptionIdOptionalParams extends coreClient.OperationOptions { +export interface Dimension { + name: string; + operator: DimensionOperator; + values: string[]; } // @public -export type ActivityLogAlertsListBySubscriptionIdResponse = AlertRuleList; +export type DimensionOperator = string; // @public -export interface ActivityLogAlertsUpdateOptionalParams extends coreClient.OperationOptions { +export interface EmailReceiver { + emailAddress: string; + name: string; + readonly status?: ReceiverStatus; + useCommonAlertSchema?: boolean; } // @public -export type ActivityLogAlertsUpdateResponse = ActivityLogAlertResource; - -// @public -export interface ActivityLogs { - list(filter: string, options?: ActivityLogsListOptionalParams): PagedAsyncIterableIterator; +export interface EnableRequest { + receiverName: string; } // @public -export interface ActivityLogsListNextOptionalParams extends coreClient.OperationOptions { +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; } // @public -export type ActivityLogsListNextResponse = EventDataCollection; +export interface ErrorContract { + error?: ErrorResponseAutoGenerated; +} // @public -export interface ActivityLogsListOptionalParams extends coreClient.OperationOptions { - select?: string; +export interface ErrorResponse { + code?: string; + message?: string; } // @public -export type ActivityLogsListResponse = EventDataCollection; +export interface ErrorResponseAutoGenerated { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorResponseAutoGenerated[]; + readonly message?: string; + readonly target?: string; +} // @public -export type AggregationType = "None" | "Average" | "Count" | "Minimum" | "Maximum" | "Total"; +export interface EventHubReceiver { + eventHubName: string; + eventHubNameSpace: string; + managedIdentity?: string; + name: string; + subscriptionId: string; + tenantId?: string; + useCommonAlertSchema?: boolean; +} // @public -export type AggregationTypeEnum = string; +export function getContinuationToken(page: unknown): string | undefined; // @public -export interface AlertRuleAllOfCondition { - allOf: AlertRuleAnyOfOrLeafCondition[]; +export interface Identity { + readonly principalId?: string; + readonly tenantId?: string; + type: IdentityType; + userAssignedIdentities?: { + [propertyName: string]: UserIdentityProperties; + }; } // @public -export interface AlertRuleAnyOfOrLeafCondition extends AlertRuleLeafCondition { - anyOf?: AlertRuleLeafCondition[]; -} +export type IdentityType = "SystemAssigned" | "UserAssigned" | "None"; // @public -export interface AlertRuleIncidents { - get(resourceGroupName: string, ruleName: string, incidentName: string, options?: AlertRuleIncidentsGetOptionalParams): Promise; - listByAlertRule(resourceGroupName: string, ruleName: string, options?: AlertRuleIncidentsListByAlertRuleOptionalParams): PagedAsyncIterableIterator; -} +export type IncidentManagementService = string; // @public -export interface AlertRuleIncidentsGetOptionalParams extends coreClient.OperationOptions { +export interface IncidentReceiver { + connection: IncidentServiceConnection; + incidentManagementService: IncidentManagementService; + mappings: { + [propertyName: string]: string; + }; + name: string; } // @public -export type AlertRuleIncidentsGetResponse = Incident; +export interface IncidentServiceConnection { + id: string; + name: string; +} // @public -export interface AlertRuleIncidentsListByAlertRuleOptionalParams extends coreClient.OperationOptions { +export interface ItsmReceiver { + connectionId: string; + name: string; + region: string; + ticketConfiguration: string; + workspaceId: string; } // @public -export type AlertRuleIncidentsListByAlertRuleResponse = IncidentListResult; +export type Kind = string; // @public -export interface AlertRuleLeafCondition { - containsAny?: string[]; - equals?: string; - field?: string; +export enum KnownAlertSeverity { + Four = 4, + One = 1, + Three = 3, + Two = 2, + Zero = 0 } // @public -export interface AlertRuleList { - nextLink?: string; - value?: ActivityLogAlertResource[]; +export enum KnownConditionOperator { + Equals = "Equals", + GreaterOrLessThan = "GreaterOrLessThan", + GreaterThan = "GreaterThan", + GreaterThanOrEqual = "GreaterThanOrEqual", + LessThan = "LessThan", + LessThanOrEqual = "LessThanOrEqual" } // @public -export interface AlertRulePatchObject { - enabled?: boolean; - tags?: { - [propertyName: string]: string; - }; +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" } // @public -export interface AlertRuleResource extends ResourceAutoGenerated3 { - action?: RuleActionUnion; - actions?: RuleActionUnion[]; - condition: RuleConditionUnion; - description?: string; - isEnabled: boolean; - readonly lastUpdatedTime?: Date; - namePropertiesName: string; - provisioningState?: string; +export enum KnownCriterionType { + DynamicThresholdCriterion = "DynamicThresholdCriterion", + StaticThresholdCriterion = "StaticThresholdCriterion" } // @public -export interface AlertRuleResourceCollection { - value?: AlertRuleResource[]; +export enum KnownDimensionOperator { + Exclude = "Exclude", + Include = "Include" } // @public -export interface AlertRuleResourcePatch { - action?: RuleActionUnion; - actions?: RuleActionUnion[]; - condition?: RuleConditionUnion; - description?: string; - isEnabled?: boolean; - readonly lastUpdatedTime?: Date; - name?: string; - provisioningState?: string; - tags?: { - [propertyName: string]: string; - }; +export enum KnownIncidentManagementService { + Icm = "Icm" } // @public -export interface AlertRules { - createOrUpdate(resourceGroupName: string, ruleName: string, parameters: AlertRuleResource, options?: AlertRulesCreateOrUpdateOptionalParams): Promise; - delete(resourceGroupName: string, ruleName: string, options?: AlertRulesDeleteOptionalParams): Promise; - get(resourceGroupName: string, ruleName: string, options?: AlertRulesGetOptionalParams): Promise; - listByResourceGroup(resourceGroupName: string, options?: AlertRulesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - listBySubscription(options?: AlertRulesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; - update(resourceGroupName: string, ruleName: string, alertRulesResource: AlertRuleResourcePatch, options?: AlertRulesUpdateOptionalParams): Promise; +export enum KnownKind { + LogAlert = "LogAlert", + LogToMetric = "LogToMetric", + SimpleLogAlert = "SimpleLogAlert" } // @public -export interface AlertRulesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +export enum KnownManagedServiceIdentityType { + None = "None", + SystemAssigned = "SystemAssigned", + SystemAssignedUserAssigned = "SystemAssigned,UserAssigned", + UserAssigned = "UserAssigned" } // @public -export type AlertRulesCreateOrUpdateResponse = AlertRuleResource; +export enum KnownTimeAggregation { + Average = "Average", + Count = "Count", + Maximum = "Maximum", + Minimum = "Minimum", + Total = "Total" +} // @public -export interface AlertRulesDeleteOptionalParams extends coreClient.OperationOptions { +export interface LogicAppReceiver { + callbackUrl: string; + managedIdentity?: string; + name: string; + resourceId: string; + useCommonAlertSchema?: boolean; } // @public -export interface AlertRulesGetOptionalParams extends coreClient.OperationOptions { +export interface ManagedServiceIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type: ManagedServiceIdentityType; + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentity | null; + }; } // @public -export type AlertRulesGetResponse = AlertRuleResource; +export type ManagedServiceIdentityType = string; -// @public -export interface AlertRulesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +// @public (undocumented) +export class MonitorClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: MonitorClientOptionalParams); + // (undocumented) + actionGroups: ActionGroups; + // (undocumented) + scheduledQueryRules: ScheduledQueryRules; + // (undocumented) + subscriptionId: string; } // @public -export type AlertRulesListByResourceGroupResponse = AlertRuleResourceCollection; +export interface MonitorClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + endpoint?: string; +} // @public -export interface AlertRulesListBySubscriptionOptionalParams extends coreClient.OperationOptions { +export interface NotificationRequestBody { + alertType: string; + armRoleReceivers?: ArmRoleReceiver[]; + automationRunbookReceivers?: AutomationRunbookReceiver[]; + azureAppPushReceivers?: AzureAppPushReceiver[]; + azureFunctionReceivers?: AzureFunctionReceiver[]; + emailReceivers?: EmailReceiver[]; + eventHubReceivers?: EventHubReceiver[]; + incidentReceivers?: IncidentReceiver[]; + itsmReceivers?: ItsmReceiver[]; + logicAppReceivers?: LogicAppReceiver[]; + smsReceivers?: SmsReceiver[]; + voiceReceivers?: VoiceReceiver[]; + webhookReceivers?: WebhookReceiver[]; } // @public -export type AlertRulesListBySubscriptionResponse = AlertRuleResourceCollection; +export type ReceiverStatus = "NotSpecified" | "Enabled" | "Disabled"; // @public -export interface AlertRulesUpdateOptionalParams extends coreClient.OperationOptions { +export interface RuleResolveConfiguration { + autoResolved?: boolean; + timeToResolve?: string; } // @public -export type AlertRulesUpdateResponse = AlertRuleResource; - -// @public -export type AlertSeverity = number; - -// @public -export interface ArmRoleReceiver { - name: string; - roleId: string; - useCommonAlertSchema?: boolean; -} - -// @public -export interface AutomationRunbookReceiver { - automationAccountId: string; - isGlobalRunbook: boolean; - name?: string; - runbookName: string; - serviceUri?: string; - useCommonAlertSchema?: boolean; - webhookResourceId: string; -} - -// @public -export interface AutoscaleErrorResponse { - error?: AutoscaleErrorResponseError; - readonly systemData?: SystemData; -} - -// @public -export interface AutoscaleErrorResponseError { - code?: string; - details?: string; - message?: string; - target?: string; -} - -// @public -export interface AutoscaleNotification { - email?: EmailNotification; - operation: "Scale"; - webhooks?: WebhookNotification[]; -} - -// @public -export interface AutoscaleProfile { - capacity: ScaleCapacity; - fixedDate?: TimeWindow; - name: string; - recurrence?: Recurrence; - rules: ScaleRule[]; -} - -// @public -export interface AutoscaleSettingResource extends ResourceAutoGenerated2 { - enabled?: boolean; - namePropertiesName?: string; - notifications?: AutoscaleNotification[]; - predictiveAutoscalePolicy?: PredictiveAutoscalePolicy; - profiles: AutoscaleProfile[]; - targetResourceLocation?: string; - targetResourceUri?: string; -} - -// @public -export interface AutoscaleSettingResourceCollection { - nextLink?: string; - value: AutoscaleSettingResource[]; -} - -// @public -export interface AutoscaleSettingResourcePatch { - enabled?: boolean; - name?: string; - notifications?: AutoscaleNotification[]; - predictiveAutoscalePolicy?: PredictiveAutoscalePolicy; - profiles?: AutoscaleProfile[]; - tags?: { - [propertyName: string]: string; - }; - targetResourceLocation?: string; - targetResourceUri?: string; -} - -// @public -export interface AutoscaleSettings { - createOrUpdate(resourceGroupName: string, autoscaleSettingName: string, parameters: AutoscaleSettingResource, options?: AutoscaleSettingsCreateOrUpdateOptionalParams): Promise; - delete(resourceGroupName: string, autoscaleSettingName: string, options?: AutoscaleSettingsDeleteOptionalParams): Promise; - get(resourceGroupName: string, autoscaleSettingName: string, options?: AutoscaleSettingsGetOptionalParams): Promise; - listByResourceGroup(resourceGroupName: string, options?: AutoscaleSettingsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - listBySubscription(options?: AutoscaleSettingsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; - update(resourceGroupName: string, autoscaleSettingName: string, autoscaleSettingResource: AutoscaleSettingResourcePatch, options?: AutoscaleSettingsUpdateOptionalParams): Promise; -} - -// @public -export interface AutoscaleSettingsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type AutoscaleSettingsCreateOrUpdateResponse = AutoscaleSettingResource; - -// @public -export interface AutoscaleSettingsDeleteOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface AutoscaleSettingsGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type AutoscaleSettingsGetResponse = AutoscaleSettingResource; - -// @public -export interface AutoscaleSettingsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type AutoscaleSettingsListByResourceGroupNextResponse = AutoscaleSettingResourceCollection; - -// @public -export interface AutoscaleSettingsListByResourceGroupOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type AutoscaleSettingsListByResourceGroupResponse = AutoscaleSettingResourceCollection; - -// @public -export interface AutoscaleSettingsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type AutoscaleSettingsListBySubscriptionNextResponse = AutoscaleSettingResourceCollection; - -// @public -export interface AutoscaleSettingsListBySubscriptionOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type AutoscaleSettingsListBySubscriptionResponse = AutoscaleSettingResourceCollection; - -// @public -export interface AutoscaleSettingsUpdateOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type AutoscaleSettingsUpdateResponse = AutoscaleSettingResource; - -// @public -export interface AzureAppPushReceiver { - emailAddress: string; - name: string; -} - -// @public -export interface AzureAppPushReceiverAutoGenerated { - emailAddress: string; - name: string; -} - -// @public -export interface AzureFunctionReceiver { - functionAppResourceId: string; - functionName: string; - httpTriggerUrl: string; - name: string; - useCommonAlertSchema?: boolean; -} - -// @public -export interface AzureMonitorMetricsDestination { - name?: string; -} - -// @public -export interface AzureMonitorPrivateLinkScope extends TrackedResourceAutoGenerated { - accessModeSettings: AccessModeSettings; - readonly privateEndpointConnections?: PrivateEndpointConnectionAutoGenerated[]; - readonly provisioningState?: string; - readonly systemData?: SystemData; -} - -// @public -export interface AzureMonitorPrivateLinkScopeListResult { - nextLink?: string; - value: AzureMonitorPrivateLinkScope[]; -} - -// @public -export interface AzureMonitorWorkspace { - readonly accountId?: string; - readonly defaultIngestionSettings?: AzureMonitorWorkspaceDefaultIngestionSettings; - readonly metrics?: AzureMonitorWorkspaceMetrics; - readonly privateEndpointConnections?: PrivateEndpointConnection[]; - readonly provisioningState?: ProvisioningState; - readonly publicNetworkAccess?: PublicNetworkAccess; -} - -// @public -export interface AzureMonitorWorkspaceDefaultIngestionSettings extends IngestionSettings { -} - -// @public -export interface AzureMonitorWorkspaceMetrics extends Metrics { -} - -// @public -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 -export interface AzureMonitorWorkspaceResourceForUpdate { - tags?: { - [propertyName: string]: string; - }; -} - -// @public -export interface AzureMonitorWorkspaceResourceListResult { - nextLink?: string; - value: AzureMonitorWorkspaceResource[]; -} - -// @public -export interface AzureMonitorWorkspaceResourceProperties extends AzureMonitorWorkspace { -} - -// @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; - get(resourceGroupName: string, azureMonitorWorkspaceName: string, options?: AzureMonitorWorkspacesGetOptionalParams): Promise; - listByResourceGroup(resourceGroupName: string, options?: AzureMonitorWorkspacesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - listBySubscription(options?: AzureMonitorWorkspacesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; - update(resourceGroupName: string, azureMonitorWorkspaceName: string, options?: AzureMonitorWorkspacesUpdateOptionalParams): Promise; -} - -// @public -export interface AzureMonitorWorkspacesCreateOptionalParams extends coreClient.OperationOptions { -} - -// @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 { -} - -// @public -export type AzureMonitorWorkspacesGetResponse = AzureMonitorWorkspaceResource; - -// @public -export interface AzureMonitorWorkspacesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type AzureMonitorWorkspacesListByResourceGroupNextResponse = AzureMonitorWorkspaceResourceListResult; - -// @public -export interface AzureMonitorWorkspacesListByResourceGroupOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type AzureMonitorWorkspacesListByResourceGroupResponse = AzureMonitorWorkspaceResourceListResult; - -// @public -export interface AzureMonitorWorkspacesListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type AzureMonitorWorkspacesListBySubscriptionNextResponse = AzureMonitorWorkspaceResourceListResult; - -// @public -export interface AzureMonitorWorkspacesListBySubscriptionOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type AzureMonitorWorkspacesListBySubscriptionResponse = AzureMonitorWorkspaceResourceListResult; - -// @public -export interface AzureMonitorWorkspacesUpdateOptionalParams extends coreClient.OperationOptions { - azureMonitorWorkspaceProperties?: AzureMonitorWorkspaceResourceForUpdate; -} - -// @public -export type AzureMonitorWorkspacesUpdateResponse = AzureMonitorWorkspaceResource; - -// @public -export interface AzureResource { - readonly id?: string; - location: string; - readonly name?: string; - tags?: { - [propertyName: string]: string; - }; - readonly type?: string; -} - -// @public -export interface AzureResourceAutoGenerated { - readonly id?: string; - location?: string; - readonly name?: string; - tags?: { - [propertyName: string]: string; - }; - readonly type?: string; -} - -// @public -export interface BaselineMetadata { - name: string; - value: string; -} - -// @public -export interface Baselines { - list(resourceUri: string, options?: BaselinesListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export type BaselineSensitivity = string; - -// @public -export interface BaselinesListOptionalParams extends coreClient.OperationOptions { - aggregation?: string; - filter?: string; - interval?: string; - metricnames?: string; - metricnamespace?: string; - resultType?: ResultType; - sensitivities?: string; - timespan?: string; -} - -// @public -export type BaselinesListResponse = MetricBaselinesResponse; - -// @public -export type CategoryType = string; - -// @public -export interface ColumnDefinition { - name?: string; - type?: KnownColumnDefinitionType; -} - -// @public -export type ComparisonOperationType = "Equals" | "NotEquals" | "GreaterThan" | "GreaterThanOrEqual" | "LessThan" | "LessThanOrEqual"; - -// @public -export interface Condition { - dimensions?: Dimension[]; - failingPeriods?: ConditionFailingPeriods; - metricMeasureColumn?: string; - metricName?: string; - operator?: ConditionOperator; - query?: string; - resourceIdColumn?: string; - threshold?: number; - timeAggregation?: TimeAggregation; -} - -// @public -export interface ConditionFailingPeriods { - minFailingPeriodsToAlert?: number; - numberOfEvaluationPeriods?: number; -} - -// @public -export type ConditionOperator = "GreaterThan" | "GreaterThanOrEqual" | "LessThan" | "LessThanOrEqual" | "Equals"; - -// @public -export interface ConfigurationAccessEndpointSpec { - readonly endpoint?: string; -} - -// @public -export interface Context { - contextType?: string; - notificationSource?: string; -} - -// @public -export type CreatedByType = string; - -// @public -export interface CreateNotificationsAtTenantActionGroupResourceLevelOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type CreateNotificationsAtTenantActionGroupResourceLevelResponse = TestNotificationDetailsResponseAutoGenerated; - -// @public -export type CriterionType = string; - -// @public -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; -} - -// @public -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 { -} - -// @public -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?: { - [propertyName: string]: string; - }; - readonly type?: string; -} - -// @public -export interface DataCollectionEndpointResourceIdentity extends ManagedServiceIdentity { -} - -// @public -export interface DataCollectionEndpointResourceListResult { - nextLink?: string; - value: DataCollectionEndpointResource[]; -} - -// @public -export interface DataCollectionEndpointResourceProperties extends DataCollectionEndpoint { -} - -// @public -export interface DataCollectionEndpointResourceSystemData extends SystemData { -} - -// @public -export interface DataCollectionEndpoints { - create(resourceGroupName: string, dataCollectionEndpointName: string, options?: DataCollectionEndpointsCreateOptionalParams): Promise; - delete(resourceGroupName: string, dataCollectionEndpointName: string, options?: DataCollectionEndpointsDeleteOptionalParams): Promise; - get(resourceGroupName: string, dataCollectionEndpointName: string, options?: DataCollectionEndpointsGetOptionalParams): Promise; - listByResourceGroup(resourceGroupName: string, options?: DataCollectionEndpointsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - listBySubscription(options?: DataCollectionEndpointsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; - update(resourceGroupName: string, dataCollectionEndpointName: string, options?: DataCollectionEndpointsUpdateOptionalParams): Promise; -} - -// @public -export interface DataCollectionEndpointsCreateOptionalParams extends coreClient.OperationOptions { - body?: DataCollectionEndpointResource; -} - -// @public -export type DataCollectionEndpointsCreateResponse = DataCollectionEndpointResource; - -// @public -export interface DataCollectionEndpointsDeleteOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface DataCollectionEndpointsGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DataCollectionEndpointsGetResponse = DataCollectionEndpointResource; - -// @public -export interface DataCollectionEndpointsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DataCollectionEndpointsListByResourceGroupNextResponse = DataCollectionEndpointResourceListResult; - -// @public -export interface DataCollectionEndpointsListByResourceGroupOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DataCollectionEndpointsListByResourceGroupResponse = DataCollectionEndpointResourceListResult; - -// @public -export interface DataCollectionEndpointsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DataCollectionEndpointsListBySubscriptionNextResponse = DataCollectionEndpointResourceListResult; - -// @public -export interface DataCollectionEndpointsListBySubscriptionOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DataCollectionEndpointsListBySubscriptionResponse = DataCollectionEndpointResourceListResult; - -// @public -export interface DataCollectionEndpointsUpdateOptionalParams extends coreClient.OperationOptions { - body?: ResourceForUpdate; -} - -// @public -export type DataCollectionEndpointsUpdateResponse = DataCollectionEndpointResource; - -// @public -export interface DataCollectionRule { - dataCollectionEndpointId?: string; - dataFlows?: DataFlow[]; - dataSources?: DataCollectionRuleDataSources; - description?: string; - destinations?: DataCollectionRuleDestinations; - readonly immutableId?: string; - readonly metadata?: DataCollectionRuleMetadata; - readonly provisioningState?: KnownDataCollectionRuleProvisioningState; - streamDeclarations?: { - [propertyName: string]: StreamDeclaration; - }; -} - -// @public -export interface DataCollectionRuleAssociation { - dataCollectionEndpointId?: string; - dataCollectionRuleId?: string; - description?: string; - readonly metadata?: DataCollectionRuleAssociationMetadata; - readonly provisioningState?: KnownDataCollectionRuleAssociationProvisioningState; -} - -// @public -export interface DataCollectionRuleAssociationMetadata extends Metadata { -} - -// @public -export interface DataCollectionRuleAssociationProxyOnlyResource { - dataCollectionEndpointId?: string; - dataCollectionRuleId?: string; - description?: string; - readonly etag?: string; - readonly id?: string; - readonly metadata?: DataCollectionRuleAssociationMetadata; - readonly name?: string; - readonly provisioningState?: KnownDataCollectionRuleAssociationProvisioningState; - readonly systemData?: DataCollectionRuleAssociationProxyOnlyResourceSystemData; - readonly type?: string; -} - -// @public -export interface DataCollectionRuleAssociationProxyOnlyResourceListResult { - nextLink?: string; - value: DataCollectionRuleAssociationProxyOnlyResource[]; -} - -// @public -export interface DataCollectionRuleAssociationProxyOnlyResourceProperties extends DataCollectionRuleAssociation { -} - -// @public -export interface DataCollectionRuleAssociationProxyOnlyResourceSystemData extends SystemData { -} - -// @public -export interface DataCollectionRuleAssociations { - create(resourceUri: string, associationName: string, options?: DataCollectionRuleAssociationsCreateOptionalParams): Promise; - delete(resourceUri: string, associationName: string, options?: DataCollectionRuleAssociationsDeleteOptionalParams): Promise; - get(resourceUri: string, associationName: string, options?: DataCollectionRuleAssociationsGetOptionalParams): Promise; - listByDataCollectionEndpoint(resourceGroupName: string, dataCollectionEndpointName: string, options?: DataCollectionRuleAssociationsListByDataCollectionEndpointOptionalParams): PagedAsyncIterableIterator; - listByResource(resourceUri: string, options?: DataCollectionRuleAssociationsListByResourceOptionalParams): PagedAsyncIterableIterator; - listByRule(resourceGroupName: string, dataCollectionRuleName: string, options?: DataCollectionRuleAssociationsListByRuleOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface DataCollectionRuleAssociationsCreateOptionalParams extends coreClient.OperationOptions { - body?: DataCollectionRuleAssociationProxyOnlyResource; -} - -// @public -export type DataCollectionRuleAssociationsCreateResponse = DataCollectionRuleAssociationProxyOnlyResource; - -// @public -export interface DataCollectionRuleAssociationsDeleteOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface DataCollectionRuleAssociationsGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DataCollectionRuleAssociationsGetResponse = DataCollectionRuleAssociationProxyOnlyResource; - -// @public -export interface DataCollectionRuleAssociationsListByDataCollectionEndpointNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DataCollectionRuleAssociationsListByDataCollectionEndpointNextResponse = DataCollectionRuleAssociationProxyOnlyResourceListResult; - -// @public -export interface DataCollectionRuleAssociationsListByDataCollectionEndpointOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DataCollectionRuleAssociationsListByDataCollectionEndpointResponse = DataCollectionRuleAssociationProxyOnlyResourceListResult; - -// @public -export interface DataCollectionRuleAssociationsListByResourceNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DataCollectionRuleAssociationsListByResourceNextResponse = DataCollectionRuleAssociationProxyOnlyResourceListResult; - -// @public -export interface DataCollectionRuleAssociationsListByResourceOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DataCollectionRuleAssociationsListByResourceResponse = DataCollectionRuleAssociationProxyOnlyResourceListResult; - -// @public -export interface DataCollectionRuleAssociationsListByRuleNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DataCollectionRuleAssociationsListByRuleNextResponse = DataCollectionRuleAssociationProxyOnlyResourceListResult; - -// @public -export interface DataCollectionRuleAssociationsListByRuleOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DataCollectionRuleAssociationsListByRuleResponse = DataCollectionRuleAssociationProxyOnlyResourceListResult; - -// @public -export interface DataCollectionRuleDataSources extends DataSourcesSpec { -} - -// @public -export interface DataCollectionRuleDestinations extends DestinationsSpec { -} - -// @public -export interface DataCollectionRuleMetadata extends Metadata { -} - -// @public -export interface DataCollectionRuleResource { - dataCollectionEndpointId?: string; - dataFlows?: DataFlow[]; - dataSources?: DataCollectionRuleDataSources; - description?: string; - destinations?: DataCollectionRuleDestinations; - readonly etag?: string; - readonly id?: string; - identity?: DataCollectionRuleResourceIdentity; - readonly immutableId?: string; - kind?: KnownDataCollectionRuleResourceKind; - location: string; - readonly metadata?: DataCollectionRuleMetadata; - readonly name?: string; - readonly provisioningState?: KnownDataCollectionRuleProvisioningState; - streamDeclarations?: { - [propertyName: string]: StreamDeclaration; - }; - readonly systemData?: DataCollectionRuleResourceSystemData; - tags?: { - [propertyName: string]: string; - }; - readonly type?: string; -} - -// @public -export interface DataCollectionRuleResourceIdentity extends ManagedServiceIdentity { -} - -// @public -export interface DataCollectionRuleResourceListResult { - nextLink?: string; - value: DataCollectionRuleResource[]; -} - -// @public -export interface DataCollectionRuleResourceProperties extends DataCollectionRule { -} - -// @public -export interface DataCollectionRuleResourceSystemData extends SystemData { -} - -// @public -export interface DataCollectionRules { - create(resourceGroupName: string, dataCollectionRuleName: string, options?: DataCollectionRulesCreateOptionalParams): Promise; - delete(resourceGroupName: string, dataCollectionRuleName: string, options?: DataCollectionRulesDeleteOptionalParams): Promise; - get(resourceGroupName: string, dataCollectionRuleName: string, options?: DataCollectionRulesGetOptionalParams): Promise; - listByResourceGroup(resourceGroupName: string, options?: DataCollectionRulesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - listBySubscription(options?: DataCollectionRulesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; - update(resourceGroupName: string, dataCollectionRuleName: string, options?: DataCollectionRulesUpdateOptionalParams): Promise; -} - -// @public -export interface DataCollectionRulesCreateOptionalParams extends coreClient.OperationOptions { - body?: DataCollectionRuleResource; -} - -// @public -export type DataCollectionRulesCreateResponse = DataCollectionRuleResource; - -// @public -export interface DataCollectionRulesDeleteOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface DataCollectionRulesGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DataCollectionRulesGetResponse = DataCollectionRuleResource; - -// @public -export interface DataCollectionRulesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DataCollectionRulesListByResourceGroupNextResponse = DataCollectionRuleResourceListResult; - -// @public -export interface DataCollectionRulesListByResourceGroupOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DataCollectionRulesListByResourceGroupResponse = DataCollectionRuleResourceListResult; - -// @public -export interface DataCollectionRulesListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DataCollectionRulesListBySubscriptionNextResponse = DataCollectionRuleResourceListResult; - -// @public -export interface DataCollectionRulesListBySubscriptionOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DataCollectionRulesListBySubscriptionResponse = DataCollectionRuleResourceListResult; - -// @public -export interface DataCollectionRulesUpdateOptionalParams extends coreClient.OperationOptions { - body?: ResourceForUpdate; -} - -// @public -export type DataCollectionRulesUpdateResponse = DataCollectionRuleResource; - -// @public -export interface DataContainer { - workspace: WorkspaceInfo; -} - -// @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 -export type DataStatus = string; - -// @public -export interface DefaultErrorResponse { - error?: ErrorDetailAutoGenerated; -} - -// @public -export interface DestinationsSpec { - azureMonitorMetrics?: DestinationsSpecAzureMonitorMetrics; - eventHubs?: EventHubDestination[]; - eventHubsDirect?: EventHubDirectDestination[]; - logAnalytics?: LogAnalyticsDestination[]; - monitoringAccounts?: MonitoringAccountDestination[]; - storageAccounts?: StorageBlobDestination[]; - storageBlobsDirect?: StorageBlobDestination[]; - storageTablesDirect?: StorageTableDestination[]; -} - -// @public -export interface DestinationsSpecAzureMonitorMetrics extends AzureMonitorMetricsDestination { -} - -// @public -export interface DiagnosticSettings { - createOrUpdate(resourceUri: string, name: string, parameters: DiagnosticSettingsResource, options?: DiagnosticSettingsCreateOrUpdateOptionalParams): Promise; - delete(resourceUri: string, name: string, options?: DiagnosticSettingsDeleteOptionalParams): Promise; - get(resourceUri: string, name: string, options?: DiagnosticSettingsGetOptionalParams): Promise; - list(resourceUri: string, options?: DiagnosticSettingsListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface DiagnosticSettingsCategory { - get(resourceUri: string, name: string, options?: DiagnosticSettingsCategoryGetOptionalParams): Promise; - list(resourceUri: string, options?: DiagnosticSettingsCategoryListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface DiagnosticSettingsCategoryGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DiagnosticSettingsCategoryGetResponse = DiagnosticSettingsCategoryResource; - -// @public -export interface DiagnosticSettingsCategoryListOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DiagnosticSettingsCategoryListResponse = DiagnosticSettingsCategoryResourceCollection; - -// @public -export interface DiagnosticSettingsCategoryResource extends ResourceAutoGenerated5 { - categoryGroups?: string[]; - categoryType?: CategoryType; - readonly systemData?: SystemData; -} - -// @public -export interface DiagnosticSettingsCategoryResourceCollection { - value?: DiagnosticSettingsCategoryResource[]; -} - -// @public -export interface DiagnosticSettingsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DiagnosticSettingsCreateOrUpdateResponse = DiagnosticSettingsResource; - -// @public -export interface DiagnosticSettingsDeleteOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface DiagnosticSettingsGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DiagnosticSettingsGetResponse = DiagnosticSettingsResource; - -// @public -export interface DiagnosticSettingsListOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DiagnosticSettingsListResponse = DiagnosticSettingsResourceCollection; - -// @public -export interface DiagnosticSettingsResource extends ResourceAutoGenerated5 { - eventHubAuthorizationRuleId?: string; - eventHubName?: string; - logAnalyticsDestinationType?: string; - logs?: LogSettings[]; - marketplacePartnerId?: string; - metrics?: MetricSettings[]; - serviceBusRuleId?: string; - storageAccountId?: string; - readonly systemData?: SystemData; - workspaceId?: string; -} - -// @public -export interface DiagnosticSettingsResourceCollection { - value?: DiagnosticSettingsResource[]; -} - -// @public -export interface Dimension { - name: string; - operator: DimensionOperator; - values: string[]; -} - -// @public -export type DimensionOperator = string; - -// @public -export interface DynamicMetricCriteria extends MultiMetricCriteria { - alertSensitivity: DynamicThresholdSensitivity; - criterionType: "DynamicThresholdCriterion"; - failingPeriods: DynamicThresholdFailingPeriods; - ignoreDataBefore?: Date; - operator: DynamicThresholdOperator; -} - -// @public -export interface DynamicThresholdFailingPeriods { - minFailingPeriodsToAlert: number; - numberOfEvaluationPeriods: number; -} - -// @public -export type DynamicThresholdOperator = string; - -// @public -export type DynamicThresholdSensitivity = string; - -// @public -export interface EmailNotification { - customEmails?: string[]; - sendToSubscriptionAdministrator?: boolean; - sendToSubscriptionCoAdministrators?: boolean; -} - -// @public -export interface EmailReceiver { - emailAddress: string; - name: string; - readonly status?: ReceiverStatus; - useCommonAlertSchema?: boolean; -} - -// @public -export interface EmailReceiverAutoGenerated { - emailAddress: string; - name: string; - readonly status?: ReceiverStatus; - useCommonAlertSchema?: boolean; -} - -// @public -export interface EnableRequest { - receiverName: string; -} - -// @public -export interface ErrorAdditionalInfo { - readonly info?: Record; - readonly type?: string; -} - -// @public -export interface ErrorContract { - error?: ErrorResponseAutoGenerated; -} - -// @public -export interface ErrorDetail { - readonly additionalInfo?: ErrorAdditionalInfo[]; - readonly code?: string; - readonly details?: ErrorDetail[]; - readonly message?: string; - readonly target?: string; -} - -// @public -export interface ErrorDetailAutoGenerated { - readonly additionalInfo?: ErrorAdditionalInfo[]; - readonly code?: string; - readonly details?: ErrorDetailAutoGenerated[]; - readonly message?: string; - readonly target?: string; -} - -// @public -export interface ErrorModel { - code: string; - message?: string; -} - -// @public -export interface ErrorResponse { - code?: string; - message?: string; -} - -// @public -export interface ErrorResponseAutoGenerated { - readonly additionalInfo?: ErrorAdditionalInfo[]; - readonly code?: string; - readonly details?: ErrorResponseAutoGenerated[]; - readonly message?: string; - readonly target?: string; -} - -// @public -export interface ErrorResponseAutoGenerated2 { - error?: ErrorDetail; -} - -// @public -export interface ErrorResponseAutoGenerated3 { - error?: ErrorDetailAutoGenerated; -} - -// @public -export interface ErrorResponseAutoGenerated4 { - readonly code?: string; - readonly message?: string; -} - -// @public -export interface ErrorResponseCommonV2 { - error?: ErrorDetailAutoGenerated; -} - -// @public -export interface EventCategories { - list(options?: EventCategoriesListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface EventCategoriesListOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type EventCategoriesListResponse = EventCategoryCollection; - -// @public -export interface EventCategoryCollection { - value: LocalizableStringAutoGenerated[]; -} - -// @public -export interface EventData { - readonly authorization?: SenderAuthorization; - readonly caller?: string; - readonly category?: LocalizableStringAutoGenerated; - readonly claims?: { - [propertyName: string]: string; - }; - readonly correlationId?: string; - readonly description?: string; - readonly eventDataId?: string; - readonly eventName?: LocalizableStringAutoGenerated; - readonly eventTimestamp?: Date; - readonly httpRequest?: HttpRequestInfo; - readonly id?: string; - readonly level?: EventLevel; - readonly operationId?: string; - readonly operationName?: LocalizableStringAutoGenerated; - readonly properties?: { - [propertyName: string]: string; - }; - readonly resourceGroupName?: string; - readonly resourceId?: string; - readonly resourceProviderName?: LocalizableStringAutoGenerated; - readonly resourceType?: LocalizableStringAutoGenerated; - readonly status?: LocalizableStringAutoGenerated; - readonly submissionTimestamp?: Date; - readonly subscriptionId?: string; - readonly subStatus?: LocalizableStringAutoGenerated; - readonly tenantId?: string; -} - -// @public -export interface EventDataCollection { - nextLink?: string; - 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; - eventHubNameSpace: string; - name: string; - subscriptionId: string; - tenantId?: string; - useCommonAlertSchema?: boolean; -} - -// @public -export type EventLevel = "Critical" | "Error" | "Warning" | "Informational" | "Verbose"; - -// @public -export interface ExtensionDataSource { - extensionName: string; - extensionSettings?: Record; - inputDataSources?: string[]; - name?: string; - streams?: KnownExtensionDataSourceStreams[]; -} - -// @public (undocumented) -export interface FailoverConfigurationSpec { - activeLocation?: string; - locations?: LocationSpec[]; -} - -// @public -export function getContinuationToken(page: unknown): string | undefined; - -// @public -export interface GetTestNotificationsAtTenantActionGroupResourceLevelOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type GetTestNotificationsAtTenantActionGroupResourceLevelResponse = TestNotificationDetailsResponseAutoGenerated; - -// @public -export interface HttpRequestInfo { - clientIpAddress?: string; - clientRequestId?: string; - method?: string; - uri?: string; -} - -// @public -export interface Identity { - readonly principalId?: string; - readonly tenantId?: string; - type: IdentityType; - userAssignedIdentities?: { - [propertyName: string]: UserIdentityProperties; - }; -} - -// @public -export type IdentityType = "SystemAssigned" | "UserAssigned" | "None"; - -// @public -export interface IisLogsDataSource { - logDirectories?: string[]; - name?: string; - streams: string[]; -} - -// @public -export interface Incident { - readonly activatedTime?: Date; - readonly isActive?: boolean; - readonly name?: string; - readonly resolvedTime?: Date; - readonly ruleName?: string; -} - -// @public -export interface IncidentListResult { - value?: Incident[]; -} - -// @public -export interface IngestionSettings { - readonly dataCollectionEndpointResourceId?: string; - readonly dataCollectionRuleResourceId?: string; -} - -// @public -export interface ItsmReceiver { - connectionId: string; - name: string; - region: string; - ticketConfiguration: string; - workspaceId: string; -} - -// @public -export type Kind = string; - -// @public -export enum KnownAccessMode { - Open = "Open", - PrivateOnly = "PrivateOnly" -} - -// @public -export enum KnownActionType { - Internal = "Internal" -} - -// @public -export enum KnownAggregationTypeEnum { - Average = "Average", - Count = "Count", - Maximum = "Maximum", - Minimum = "Minimum", - Total = "Total" -} - -// @public -export enum KnownAlertSeverity { - Four = 4, - One = 1, - Three = 3, - Two = 2, - Zero = 0 -} - -// @public -export enum KnownBaselineSensitivity { - High = "High", - Low = "Low", - Medium = "Medium" -} - -// @public -export enum KnownCategoryType { - Logs = "Logs", - Metrics = "Metrics" -} - -// @public -export type KnownColumnDefinitionType = string; - -// @public -export enum KnownCreatedByType { - Application = "Application", - Key = "Key", - ManagedIdentity = "ManagedIdentity", - User = "User" -} - -// @public -export enum KnownCriterionType { - DynamicThresholdCriterion = "DynamicThresholdCriterion", - StaticThresholdCriterion = "StaticThresholdCriterion" -} - -// @public -export type KnownDataCollectionEndpointProvisioningState = string; - -// @public -export type KnownDataCollectionEndpointResourceKind = string; - -// @public -export type KnownDataCollectionRuleAssociationProvisioningState = string; - -// @public -export type KnownDataCollectionRuleProvisioningState = string; - -// @public -export type KnownDataCollectionRuleResourceKind = string; - -// @public -export type KnownDataFlowStreams = string; - -// @public -export enum KnownDataStatus { - NotPresent = "notPresent", - Present = "present" -} - -// @public -export enum KnownDimensionOperator { - Exclude = "Exclude", - Include = "Include" -} - -// @public -export enum KnownDynamicThresholdOperator { - GreaterOrLessThan = "GreaterOrLessThan", - GreaterThan = "GreaterThan", - LessThan = "LessThan" -} - -// @public -export enum KnownDynamicThresholdSensitivity { - High = "High", - Low = "Low", - Medium = "Medium" -} - -// @public -export type KnownExtensionDataSourceStreams = string; - -// @public -export enum KnownKind { - LogAlert = "LogAlert", - LogToMetric = "LogToMetric" -} - -// @public -export enum KnownKnownColumnDefinitionType { - Boolean = "boolean", - Datetime = "datetime", - Dynamic = "dynamic", - Int = "int", - Long = "long", - Real = "real", - String = "string" -} - -// @public -export enum KnownKnownDataCollectionEndpointProvisioningState { - Canceled = "Canceled", - Creating = "Creating", - Deleting = "Deleting", - Failed = "Failed", - Succeeded = "Succeeded", - Updating = "Updating" -} - -// @public -export enum KnownKnownDataCollectionEndpointResourceKind { - Linux = "Linux", - Windows = "Windows" -} - -// @public -export enum KnownKnownDataCollectionRuleAssociationProvisioningState { - Canceled = "Canceled", - Creating = "Creating", - Deleting = "Deleting", - Failed = "Failed", - Succeeded = "Succeeded", - Updating = "Updating" -} - -// @public -export enum KnownKnownDataCollectionRuleProvisioningState { - Canceled = "Canceled", - Creating = "Creating", - Deleting = "Deleting", - Failed = "Failed", - Succeeded = "Succeeded", - Updating = "Updating" -} - -// @public -export enum KnownKnownDataCollectionRuleResourceKind { - Linux = "Linux", - Windows = "Windows" -} - -// @public -export enum KnownKnownDataFlowStreams { - MicrosoftEvent = "Microsoft-Event", - MicrosoftInsightsMetrics = "Microsoft-InsightsMetrics", - MicrosoftPerf = "Microsoft-Perf", - MicrosoftSyslog = "Microsoft-Syslog", - MicrosoftWindowsEvent = "Microsoft-WindowsEvent" -} - -// @public -export enum KnownKnownExtensionDataSourceStreams { - MicrosoftEvent = "Microsoft-Event", - MicrosoftInsightsMetrics = "Microsoft-InsightsMetrics", - MicrosoftPerf = "Microsoft-Perf", - MicrosoftSyslog = "Microsoft-Syslog", - 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" -} - -// @public -export enum KnownKnownLogFileTextSettingsRecordStartTimestampFormat { - DdMMMYyyyHHMmSsZzz = "dd/MMM/yyyy:HH:mm:ss zzz", - DdMMyyHHMmSs = "ddMMyy HH:mm:ss", - ISO8601 = "ISO 8601", - MDYyyyHHMMSSAMPM = "M/D/YYYY HH:MM:SS AM/PM", - MMMDHhMmSs = "MMM d hh:mm:ss", - MonDDYyyyHHMMSS = "Mon DD, YYYY HH:MM:SS", - YyMMddHHMmSs = "yyMMdd HH:mm:ss", - YyyyMMDDHHMMSS = "YYYY-MM-DD HH:MM:SS", - YyyyMMDdTHHMmSsK = "yyyy-MM-ddTHH:mm:ssK" -} - -// @public -export enum KnownKnownPerfCounterDataSourceStreams { - MicrosoftInsightsMetrics = "Microsoft-InsightsMetrics", - MicrosoftPerf = "Microsoft-Perf" -} - -// @public -export enum KnownKnownPrometheusForwarderDataSourceStreams { - MicrosoftPrometheusMetrics = "Microsoft-PrometheusMetrics" -} - -// @public -export enum KnownKnownPublicNetworkAccessOptions { - Disabled = "Disabled", - Enabled = "Enabled", - SecuredByPerimeter = "SecuredByPerimeter" -} - -// @public -export enum KnownKnownSyslogDataSourceFacilityNames { - Alert = "alert", - Asterisk = "*", - Audit = "audit", - Auth = "auth", - Authpriv = "authpriv", - Clock = "clock", - Cron = "cron", - Daemon = "daemon", - Ftp = "ftp", - Kern = "kern", - Local0 = "local0", - Local1 = "local1", - Local2 = "local2", - Local3 = "local3", - Local4 = "local4", - Local5 = "local5", - Local6 = "local6", - Local7 = "local7", - Lpr = "lpr", - Mail = "mail", - Mark = "mark", - News = "news", - Nopri = "nopri", - Ntp = "ntp", - Syslog = "syslog", - User = "user", - Uucp = "uucp" -} - -// @public -export enum KnownKnownSyslogDataSourceLogLevels { - Alert = "Alert", - Asterisk = "*", - Critical = "Critical", - Debug = "Debug", - Emergency = "Emergency", - Error = "Error", - Info = "Info", - Notice = "Notice", - Warning = "Warning" -} - -// @public -export enum KnownKnownSyslogDataSourceStreams { - MicrosoftSyslog = "Microsoft-Syslog" -} - -// @public -export enum KnownKnownWindowsEventLogDataSourceStreams { - MicrosoftEvent = "Microsoft-Event", - 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", - Errors = "Errors", - Latency = "Latency", - Saturation = "Saturation", - Transactions = "Transactions" -} - -// @public -export enum KnownMetricResultType { - Data = "Data", - Metadata = "Metadata" -} - -// @public -export enum KnownMetricUnit { - BitsPerSecond = "BitsPerSecond", - Bytes = "Bytes", - ByteSeconds = "ByteSeconds", - BytesPerSecond = "BytesPerSecond", - Cores = "Cores", - Count = "Count", - CountPerSecond = "CountPerSecond", - MilliCores = "MilliCores", - MilliSeconds = "MilliSeconds", - NanoCores = "NanoCores", - Percent = "Percent", - Seconds = "Seconds", - Unspecified = "Unspecified" -} - -// @public -export enum KnownNamespaceClassification { - Custom = "Custom", - Platform = "Platform", - Qos = "Qos" -} - -// @public -export enum KnownOdatatype { - MicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria", - MicrosoftAzureMonitorSingleResourceMultipleMetricCriteria = "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", - MicrosoftAzureMonitorWebtestLocationAvailabilityCriteria = "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria" -} - -// @public -export enum KnownOnboardingStatus { - NotOnboarded = "notOnboarded", - Onboarded = "onboarded", - Unknown = "unknown" -} - -// @public -export enum KnownOperator { - Equals = "Equals", - GreaterThan = "GreaterThan", - GreaterThanOrEqual = "GreaterThanOrEqual", - LessThan = "LessThan", - LessThanOrEqual = "LessThanOrEqual" -} - -// @public -export enum KnownOrigin { - System = "system", - User = "user", - UserSystem = "user,system" -} - -// @public -export type KnownPerfCounterDataSourceStreams = string; - -// @public -export enum KnownPrivateEndpointConnectionProvisioningState { - Creating = "Creating", - Deleting = "Deleting", - Failed = "Failed", - Succeeded = "Succeeded" -} - -// @public -export enum KnownPrivateEndpointServiceConnectionStatus { - Approved = "Approved", - Pending = "Pending", - Rejected = "Rejected" -} - -// @public -export type KnownPrometheusForwarderDataSourceStreams = string; - -// @public -export enum KnownProvisioningState { - Canceled = "Canceled", - Creating = "Creating", - Deleting = "Deleting", - Failed = "Failed", - Succeeded = "Succeeded" -} - -// @public -export enum KnownPublicNetworkAccess { - Disabled = "Disabled", - Enabled = "Enabled" -} - -// @public -export type KnownPublicNetworkAccessOptions = string; - -// @public -export enum KnownScaleRuleMetricDimensionOperationType { - Equals = "Equals", - NotEquals = "NotEquals" -} - -// @public -export type KnownSyslogDataSourceFacilityNames = string; - -// @public -export type KnownSyslogDataSourceLogLevels = string; - -// @public -export type KnownSyslogDataSourceStreams = string; - -// @public -export enum KnownTimeAggregation { - Average = "Average", - Count = "Count", - Maximum = "Maximum", - Minimum = "Minimum", - Total = "Total" -} - -// @public -export type KnownWindowsEventLogDataSourceStreams = string; - -// @public -export interface LocalizableString { - localizedValue?: string; - value: string; -} - -// @public -export interface LocalizableStringAutoGenerated { - localizedValue?: string; - value: string; -} - -// @public (undocumented) -export interface LocationSpec { - location?: string; - provisioningStatus?: KnownLocationSpecProvisioningStatus; -} - -// @public -export interface LocationThresholdRuleCondition extends RuleCondition { - failedLocationCount: number; - odataType: "Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition"; - windowSize?: string; -} - -// @public -export interface LogAnalyticsDestination { - name?: string; - readonly workspaceId?: string; - workspaceResourceId?: string; -} - -// @public -export interface LogFilesDataSource { - filePatterns: string[]; - format: KnownLogFilesDataSourceFormat; - name?: string; - settings?: LogFilesDataSourceSettings; - streams: string[]; -} - -// @public -export interface LogFilesDataSourceSettings extends LogFileSettings { -} - -// @public -export interface LogFileSettings { - text?: LogFileSettingsText; -} - -// @public -export interface LogFileSettingsText extends LogFileTextSettings { -} - -// @public -export interface LogFileTextSettings { - recordStartTimestampFormat: KnownLogFileTextSettingsRecordStartTimestampFormat; -} - -// @public -export interface LogicAppReceiver { - callbackUrl: string; - name: string; - resourceId: string; - useCommonAlertSchema?: boolean; -} - -// @public -export interface LogProfileCollection { - value: LogProfileResource[]; -} - -// @public -export interface LogProfileResource extends ResourceAutoGenerated4 { - categories: string[]; - locations: string[]; - retentionPolicy: RetentionPolicy; - serviceBusRuleId?: string; - storageAccountId?: string; -} - -// @public -export interface LogProfileResourcePatch { - categories?: string[]; - locations?: string[]; - retentionPolicy?: RetentionPolicy; - serviceBusRuleId?: string; - storageAccountId?: string; - tags?: { - [propertyName: string]: string; - }; -} - -// @public -export interface LogProfiles { - createOrUpdate(logProfileName: string, parameters: LogProfileResource, options?: LogProfilesCreateOrUpdateOptionalParams): Promise; - delete(logProfileName: string, options?: LogProfilesDeleteOptionalParams): Promise; - get(logProfileName: string, options?: LogProfilesGetOptionalParams): Promise; - list(options?: LogProfilesListOptionalParams): PagedAsyncIterableIterator; - update(logProfileName: string, logProfilesResource: LogProfileResourcePatch, options?: LogProfilesUpdateOptionalParams): Promise; -} - -// @public -export interface LogProfilesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type LogProfilesCreateOrUpdateResponse = LogProfileResource; - -// @public -export interface LogProfilesDeleteOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface LogProfilesGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type LogProfilesGetResponse = LogProfileResource; - -// @public -export interface LogProfilesListOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type LogProfilesListResponse = LogProfileCollection; - -// @public -export interface LogProfilesUpdateOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type LogProfilesUpdateResponse = LogProfileResource; - -// @public -export interface LogSettings { - category?: string; - categoryGroup?: string; - enabled: boolean; - retentionPolicy?: RetentionPolicy; -} - -// @public -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; - threshold?: number; - windowSize?: string; -} - -// @public -export interface ManagementEventRuleCondition extends RuleCondition { - aggregation?: ManagementEventAggregationCondition; - odataType: "Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition"; -} - -// @public -export interface Metadata { - readonly provisionedBy?: string; - readonly provisionedByResourceId?: string; -} - -// @public -export interface MetadataValue { - name?: LocalizableString; - value?: string; -} - -// @public -export interface Metric { - displayDescription?: string; - errorCode?: string; - errorMessage?: string; - id: string; - name: LocalizableString; - timeseries: TimeSeriesElement[]; - type: string; - unit: MetricUnit; -} - -// @public -export type MetricAggregationType = string; - -// @public -export interface MetricAlertAction { - actionGroupId?: string; - webHookProperties?: { - [propertyName: string]: string; - }; -} - -// @public -export interface MetricAlertCriteria { - [property: string]: any; - odataType: "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria" | "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria" | "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria"; -} - -// @public (undocumented) -export type MetricAlertCriteriaUnion = MetricAlertCriteria | MetricAlertSingleResourceMultipleMetricCriteria | WebtestLocationAvailabilityCriteria | MetricAlertMultipleResourceMultipleMetricCriteria; - -// @public -export interface MetricAlertMultipleResourceMultipleMetricCriteria extends MetricAlertCriteria { - allOf?: MultiMetricCriteriaUnion[]; - odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria"; -} - -// @public -export interface MetricAlertResource extends ResourceAutoGenerated6 { - actions?: MetricAlertAction[]; - autoMitigate?: boolean; - criteria: MetricAlertCriteriaUnion; - description?: string; - enabled: boolean; - evaluationFrequency: string; - readonly isMigrated?: boolean; - readonly lastUpdatedTime?: Date; - scopes: string[]; - severity: number; - targetResourceRegion?: string; - targetResourceType?: string; - windowSize: string; -} - -// @public -export interface MetricAlertResourceCollection { - value?: MetricAlertResource[]; -} - -// @public -export interface MetricAlertResourcePatch { - actions?: MetricAlertAction[]; - autoMitigate?: boolean; - criteria?: MetricAlertCriteriaUnion; - description?: string; - enabled?: boolean; - evaluationFrequency?: string; - readonly isMigrated?: boolean; - readonly lastUpdatedTime?: Date; - scopes?: string[]; - severity?: number; - tags?: { - [propertyName: string]: string; - }; - targetResourceRegion?: string; - targetResourceType?: string; - windowSize?: string; -} - -// @public -export interface MetricAlerts { - createOrUpdate(resourceGroupName: string, ruleName: string, parameters: MetricAlertResource, options?: MetricAlertsCreateOrUpdateOptionalParams): Promise; - delete(resourceGroupName: string, ruleName: string, options?: MetricAlertsDeleteOptionalParams): Promise; - get(resourceGroupName: string, ruleName: string, options?: MetricAlertsGetOptionalParams): Promise; - listByResourceGroup(resourceGroupName: string, options?: MetricAlertsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - listBySubscription(options?: MetricAlertsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; - update(resourceGroupName: string, ruleName: string, parameters: MetricAlertResourcePatch, options?: MetricAlertsUpdateOptionalParams): Promise; -} - -// @public -export interface MetricAlertsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type MetricAlertsCreateOrUpdateResponse = MetricAlertResource; - -// @public -export interface MetricAlertsDeleteOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface MetricAlertsGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type MetricAlertsGetResponse = MetricAlertResource; - -// @public -export interface MetricAlertSingleResourceMultipleMetricCriteria extends MetricAlertCriteria { - allOf?: MetricCriteria[]; - odataType: "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria"; -} - -// @public -export interface MetricAlertsListByResourceGroupOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type MetricAlertsListByResourceGroupResponse = MetricAlertResourceCollection; - -// @public -export interface MetricAlertsListBySubscriptionOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type MetricAlertsListBySubscriptionResponse = MetricAlertResourceCollection; - -// @public -export interface MetricAlertsStatus { - list(resourceGroupName: string, ruleName: string, options?: MetricAlertsStatusListOptionalParams): Promise; - listByName(resourceGroupName: string, ruleName: string, statusName: string, options?: MetricAlertsStatusListByNameOptionalParams): Promise; -} - -// @public -export interface MetricAlertsStatusListByNameOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type MetricAlertsStatusListByNameResponse = MetricAlertStatusCollection; - -// @public -export interface MetricAlertsStatusListOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type MetricAlertsStatusListResponse = MetricAlertStatusCollection; - -// @public -export interface MetricAlertStatus { - id?: string; - name?: string; - properties?: MetricAlertStatusProperties; - type?: string; -} - -// @public -export interface MetricAlertStatusCollection { - value?: MetricAlertStatus[]; -} - -// @public -export interface MetricAlertStatusProperties { - dimensions?: { - [propertyName: string]: string; - }; - status?: string; - timestamp?: Date; -} - -// @public -export interface MetricAlertsUpdateOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type MetricAlertsUpdateResponse = MetricAlertResource; - -// @public -export interface MetricAvailability { - retention?: string; - timeGrain?: string; -} - -// @public -export interface MetricBaselinesResponse { - value?: SingleMetricBaseline[]; -} - -// @public -export type MetricClass = string; - -// @public -export interface MetricCriteria extends MultiMetricCriteria { - criterionType: "StaticThresholdCriterion"; - operator: Operator; - threshold: number; -} - -// @public -export interface MetricDefinition { - category?: string; - dimensions?: LocalizableString[]; - displayDescription?: string; - id?: string; - isDimensionRequired?: boolean; - metricAvailabilities?: MetricAvailability[]; - metricClass?: MetricClass; - name?: LocalizableString; - namespace?: string; - primaryAggregationType?: AggregationType; - resourceId?: string; - supportedAggregationTypes?: AggregationType[]; - unit?: MetricUnit; -} - -// @public -export interface MetricDefinitionCollection { - value: MetricDefinition[]; -} - -// @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; -} - -// @public -export type MetricDefinitionsListResponse = MetricDefinitionCollection; - -// @public -export interface MetricDimension { - name: string; - operator: string; - values: string[]; -} - -// @public -export interface MetricNamespace { - classification?: NamespaceClassification; - id?: string; - name?: string; - properties?: MetricNamespaceName; - type?: string; -} - -// @public -export interface MetricNamespaceCollection { - value: MetricNamespace[]; -} - -// @public -export interface MetricNamespaceName { - metricNamespaceName?: string; -} - -// @public -export interface MetricNamespaces { - list(resourceUri: string, options?: MetricNamespacesListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface MetricNamespacesListOptionalParams extends coreClient.OperationOptions { - startTime?: string; -} - -// @public -export type MetricNamespacesListResponse = MetricNamespaceCollection; - -// @public -export type MetricResultType = string; - -// @public -export interface Metrics { - readonly internalId?: string; - readonly prometheusQueryEndpoint?: string; -} - -// @public -export interface MetricSettings { - category?: string; - enabled: boolean; - retentionPolicy?: RetentionPolicy; - 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; - rollupby?: string; - 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; - rollupby?: string; - timespan?: string; - top?: number; - validateDimensions?: boolean; -} - -// @public -export type MetricsListAtSubscriptionScopePostResponse = Response_2; - -// @public -export type MetricsListAtSubscriptionScopeResponse = Response_2; - -// @public -export interface MetricsListOptionalParams extends coreClient.OperationOptions { - aggregation?: string; - autoAdjustTimegrain?: boolean; - filter?: string; - interval?: string; - metricnames?: string; - metricnamespace?: string; - orderby?: string; - resultType?: ResultType; - rollupby?: string; - timespan?: string; - top?: number; - validateDimensions?: boolean; -} - -// @public -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 -export type MetricStatisticType = "Average" | "Min" | "Max" | "Sum" | "Count"; - -// @public -export interface MetricTrigger { - dimensions?: ScaleRuleMetricDimension[]; - dividePerInstance?: boolean; - metricName: string; - metricNamespace?: string; - metricResourceLocation?: string; - metricResourceUri: string; - operator: ComparisonOperationType; - statistic: MetricStatisticType; - threshold: number; - timeAggregation: TimeAggregationType; - timeGrain: string; - timeWindow: string; -} - -// @public -export type MetricUnit = string; - -// @public -export interface MetricValue { - average?: number; - count?: number; - maximum?: number; - minimum?: number; - timeStamp: Date; - total?: number; -} - -// @public (undocumented) -export class MonitorClient extends coreClient.ServiceClient { - // (undocumented) - $host: string; - constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: MonitorClientOptionalParams); - constructor(credentials: coreAuth.TokenCredential, options?: MonitorClientOptionalParams); - // (undocumented) - actionGroups: ActionGroups; - // (undocumented) - activityLogAlerts: ActivityLogAlerts; - // (undocumented) - activityLogs: ActivityLogs; - // (undocumented) - alertRuleIncidents: AlertRuleIncidents; - // (undocumented) - alertRules: AlertRules; - // (undocumented) - autoscaleSettings: AutoscaleSettings; - // (undocumented) - azureMonitorWorkspaces: AzureMonitorWorkspaces; - // (undocumented) - baselines: Baselines; - beginCreateNotificationsAtTenantActionGroupResourceLevel(managementGroupId: string, tenantActionGroupName: string, xMsClientTenantId: string, notificationRequest: TenantNotificationRequestBody, options?: CreateNotificationsAtTenantActionGroupResourceLevelOptionalParams): Promise, CreateNotificationsAtTenantActionGroupResourceLevelResponse>>; - beginCreateNotificationsAtTenantActionGroupResourceLevelAndWait(managementGroupId: string, tenantActionGroupName: string, xMsClientTenantId: string, notificationRequest: TenantNotificationRequestBody, options?: CreateNotificationsAtTenantActionGroupResourceLevelOptionalParams): Promise; - // (undocumented) - dataCollectionEndpoints: DataCollectionEndpoints; - // (undocumented) - dataCollectionRuleAssociations: DataCollectionRuleAssociations; - // (undocumented) - dataCollectionRules: DataCollectionRules; - // (undocumented) - diagnosticSettings: DiagnosticSettings; - // (undocumented) - diagnosticSettingsCategory: DiagnosticSettingsCategory; - // (undocumented) - eventCategories: EventCategories; - getTestNotificationsAtTenantActionGroupResourceLevel(managementGroupId: string, tenantActionGroupName: string, xMsClientTenantId: string, notificationId: string, options?: GetTestNotificationsAtTenantActionGroupResourceLevelOptionalParams): Promise; - // (undocumented) - logProfiles: LogProfiles; - // (undocumented) - metricAlerts: MetricAlerts; - // (undocumented) - metricAlertsStatus: MetricAlertsStatus; - // (undocumented) - metricDefinitions: MetricDefinitions; - // (undocumented) - metricNamespaces: MetricNamespaces; - // (undocumented) - metricsOperations: MetricsOperations; - // (undocumented) - monitorOperations: MonitorOperations; - // (undocumented) - operations: Operations; - // (undocumented) - predictiveMetric: PredictiveMetric; - // (undocumented) - privateEndpointConnections: PrivateEndpointConnections; - // (undocumented) - privateLinkResources: PrivateLinkResources; - // (undocumented) - privateLinkScopedResources: PrivateLinkScopedResources; - // (undocumented) - privateLinkScopeOperationStatus: PrivateLinkScopeOperationStatus; - // (undocumented) - privateLinkScopes: PrivateLinkScopes; - // (undocumented) - scheduledQueryRules: ScheduledQueryRules; - // (undocumented) - subscriptionId?: string; - // (undocumented) - tenantActionGroups: TenantActionGroups; - // (undocumented) - tenantActivityLogs: TenantActivityLogs; - // (undocumented) - vMInsights: VMInsights; -} - -// @public -export interface MonitorClientCreateNotificationsAtTenantActionGroupResourceLevelHeaders { - location?: string; -} - -// @public -export interface MonitorClientOptionalParams extends coreClient.ServiceClientOptions { - $host?: string; - endpoint?: string; -} - -// @public -export interface MonitoringAccountDestination { - readonly accountId?: string; - accountResourceId?: string; - name?: string; -} - -// @public -export interface MonitorOperations { - list(options?: MonitorOperationsListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface MonitorOperationsListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type MonitorOperationsListNextResponse = OperationListResult; - -// @public -export interface MonitorOperationsListOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type MonitorOperationsListResponse = OperationListResult; - -// @public -export interface MultiMetricCriteria { - [property: string]: any; - criterionType: "StaticThresholdCriterion" | "DynamicThresholdCriterion"; - dimensions?: MetricDimension[]; - metricName: string; - metricNamespace?: string; - name: string; - skipMetricValidation?: boolean; - timeAggregation: AggregationTypeEnum; -} - -// @public (undocumented) -export type MultiMetricCriteriaUnion = MultiMetricCriteria | MetricCriteria | DynamicMetricCriteria; - -// @public -export type NamespaceClassification = string; - -// @public -export interface NetworkRuleSet { - publicNetworkAccess?: KnownPublicNetworkAccessOptions; -} - -// @public -export interface NotificationRequestBody { - alertType: string; - armRoleReceivers?: ArmRoleReceiver[]; - automationRunbookReceivers?: AutomationRunbookReceiver[]; - azureAppPushReceivers?: AzureAppPushReceiver[]; - azureFunctionReceivers?: AzureFunctionReceiver[]; - emailReceivers?: EmailReceiver[]; - eventHubReceivers?: EventHubReceiver[]; - itsmReceivers?: ItsmReceiver[]; - logicAppReceivers?: LogicAppReceiver[]; - smsReceivers?: SmsReceiver[]; - voiceReceivers?: VoiceReceiver[]; - webhookReceivers?: WebhookReceiver[]; -} - -// @public -export type Odatatype = string; - -// @public -export type OnboardingStatus = string; - -// @public -export interface Operation { - readonly actionType?: ActionType; - display?: OperationDisplay; - readonly isDataAction?: boolean; - readonly name?: string; - readonly origin?: Origin; -} - -// @public -export interface OperationAutoGenerated { - display?: OperationDisplayAutoGenerated; - name?: string; -} - -// @public -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 { - readonly nextLink?: string; - readonly value?: Operation[]; -} - -// @public -export interface OperationListResultAutoGenerated { - nextLink?: string; - value?: OperationAutoGenerated[]; -} - -// @public -export interface Operations { - list(options?: OperationsListOptionalParams): Promise; -} - -// @public -export interface OperationsListOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type OperationsListResponse = OperationListResultAutoGenerated; - -// @public -export interface OperationStatus { - endTime?: Date; - error?: ErrorDetailAutoGenerated; - id?: string; - name?: string; - startTime?: Date; - status?: string; -} - -// @public -export type Operator = string; - -// @public -export type Origin = string; - -// @public -export interface PerfCounterDataSource { - counterSpecifiers?: string[]; - name?: string; - samplingFrequencyInSeconds?: number; - streams?: KnownPerfCounterDataSourceStreams[]; -} - -// @public -export interface PlatformTelemetryDataSource { - name?: string; - streams: string[]; -} - -// @public -export interface PredictiveAutoscalePolicy { - scaleLookAheadTime?: string; - scaleMode: PredictiveAutoscalePolicyScaleMode; -} - -// @public -export type PredictiveAutoscalePolicyScaleMode = "Disabled" | "ForecastOnly" | "Enabled"; - -// @public -export interface PredictiveMetric { - get(resourceGroupName: string, autoscaleSettingName: string, timespan: string, interval: string, metricNamespace: string, metricName: string, aggregation: string, options?: PredictiveMetricGetOptionalParams): Promise; -} - -// @public -export interface PredictiveMetricGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PredictiveMetricGetResponse = PredictiveResponse; - -// @public -export interface PredictiveResponse { - data?: PredictiveValue[]; - interval?: string; - metricName?: string; - targetResourceId?: string; - timespan?: string; -} - -// @public -export interface PredictiveValue { - timeStamp: Date; - value: number; -} - -// @public -export interface PrivateEndpoint { - readonly id?: string; -} - -// @public -export interface PrivateEndpointAutoGenerated { - readonly id?: string; -} - -// @public -export interface PrivateEndpointConnection extends Resource { - readonly groupIds?: string[]; - privateEndpoint?: PrivateEndpoint; - privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; - provisioningState?: PrivateEndpointConnectionProvisioningState; -} - -// @public -export interface PrivateEndpointConnectionAutoGenerated extends ResourceAutoGenerated5 { - privateEndpoint?: PrivateEndpointAutoGenerated; - privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; - provisioningState?: PrivateEndpointConnectionProvisioningState; -} - -// @public -export interface PrivateEndpointConnectionListResult { - value?: PrivateEndpointConnectionAutoGenerated[]; -} - -// @public -export type PrivateEndpointConnectionProvisioningState = string; - -// @public -export interface PrivateEndpointConnections { - 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; - listByPrivateLinkScope(resourceGroupName: string, scopeName: string, options?: PrivateEndpointConnectionsListByPrivateLinkScopeOptionalParams): Promise; -} - -// @public -export interface PrivateEndpointConnectionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnectionAutoGenerated; - -// @public -export interface PrivateEndpointConnectionsDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export interface PrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnectionAutoGenerated; - -// @public -export interface PrivateEndpointConnectionsListByPrivateLinkScopeOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PrivateEndpointConnectionsListByPrivateLinkScopeResponse = PrivateEndpointConnectionListResult; - -// @public -export type PrivateEndpointServiceConnectionStatus = string; - -// @public -export interface PrivateLinkResource extends ResourceAutoGenerated5 { - readonly groupId?: string; - readonly requiredMembers?: string[]; - requiredZoneNames?: string[]; -} - -// @public -export interface PrivateLinkResourceListResult { - value?: PrivateLinkResource[]; -} - -// @public -export interface PrivateLinkResources { - get(resourceGroupName: string, scopeName: string, groupName: string, options?: PrivateLinkResourcesGetOptionalParams): Promise; - listByPrivateLinkScope(resourceGroupName: string, scopeName: string, options?: PrivateLinkResourcesListByPrivateLinkScopeOptionalParams): Promise; -} - -// @public -export interface PrivateLinkResourcesGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PrivateLinkResourcesGetResponse = PrivateLinkResource; - -// @public -export interface PrivateLinkResourcesListByPrivateLinkScopeOptionalParams extends coreClient.OperationOptions { -} - -// @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>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, scopeName: string, name: string, parameters: ScopedResource, options?: PrivateLinkScopedResourcesCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, scopeName: string, name: string, options?: PrivateLinkScopedResourcesDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, scopeName: string, name: string, options?: PrivateLinkScopedResourcesDeleteOptionalParams): Promise; - get(resourceGroupName: string, scopeName: string, name: string, options?: PrivateLinkScopedResourcesGetOptionalParams): Promise; - listByPrivateLinkScope(resourceGroupName: string, scopeName: string, options?: PrivateLinkScopedResourcesListByPrivateLinkScopeOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface PrivateLinkScopedResourcesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type PrivateLinkScopedResourcesCreateOrUpdateResponse = ScopedResource; - -// @public -export interface PrivateLinkScopedResourcesDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export interface PrivateLinkScopedResourcesGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PrivateLinkScopedResourcesGetResponse = ScopedResource; - -// @public -export interface PrivateLinkScopedResourcesListByPrivateLinkScopeNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PrivateLinkScopedResourcesListByPrivateLinkScopeNextResponse = ScopedResourceListResult; - -// @public -export interface PrivateLinkScopedResourcesListByPrivateLinkScopeOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PrivateLinkScopedResourcesListByPrivateLinkScopeResponse = ScopedResourceListResult; - -// @public -export interface PrivateLinkScopeOperationStatus { - get(asyncOperationId: string, resourceGroupName: string, options?: PrivateLinkScopeOperationStatusGetOptionalParams): Promise; -} - -// @public -export interface PrivateLinkScopeOperationStatusGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PrivateLinkScopeOperationStatusGetResponse = OperationStatus; - -// @public -export interface PrivateLinkScopes { - beginDelete(resourceGroupName: string, scopeName: string, options?: PrivateLinkScopesDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, scopeName: string, options?: PrivateLinkScopesDeleteOptionalParams): Promise; - createOrUpdate(resourceGroupName: string, scopeName: string, azureMonitorPrivateLinkScopePayload: AzureMonitorPrivateLinkScope, options?: PrivateLinkScopesCreateOrUpdateOptionalParams): Promise; - get(resourceGroupName: string, scopeName: string, options?: PrivateLinkScopesGetOptionalParams): Promise; - list(options?: PrivateLinkScopesListOptionalParams): PagedAsyncIterableIterator; - listByResourceGroup(resourceGroupName: string, options?: PrivateLinkScopesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - updateTags(resourceGroupName: string, scopeName: string, privateLinkScopeTags: TagsResource, options?: PrivateLinkScopesUpdateTagsOptionalParams): Promise; -} - -// @public -export interface PrivateLinkScopesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PrivateLinkScopesCreateOrUpdateResponse = AzureMonitorPrivateLinkScope; - -// @public -export interface PrivateLinkScopesDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export interface PrivateLinkScopesGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PrivateLinkScopesGetResponse = AzureMonitorPrivateLinkScope; - -// @public -export interface PrivateLinkScopesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PrivateLinkScopesListByResourceGroupNextResponse = AzureMonitorPrivateLinkScopeListResult; - -// @public -export interface PrivateLinkScopesListByResourceGroupOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PrivateLinkScopesListByResourceGroupResponse = AzureMonitorPrivateLinkScopeListResult; - -// @public -export interface PrivateLinkScopesListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PrivateLinkScopesListNextResponse = AzureMonitorPrivateLinkScopeListResult; - -// @public -export interface PrivateLinkScopesListOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PrivateLinkScopesListResponse = AzureMonitorPrivateLinkScopeListResult; - -// @public -export interface PrivateLinkScopesUpdateTagsOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PrivateLinkScopesUpdateTagsResponse = AzureMonitorPrivateLinkScope; - -// @public -export interface PrivateLinkServiceConnectionState { - actionsRequired?: string; - description?: string; - status?: PrivateEndpointServiceConnectionStatus; -} - -// @public -export interface PrometheusForwarderDataSource { - labelIncludeFilter?: { - [propertyName: string]: string; - }; - name?: string; - streams?: KnownPrometheusForwarderDataSourceStreams[]; -} - -// @public -export type ProvisioningState = string; - -// @public -export interface ProxyResource { - readonly id?: string; - readonly name?: string; - readonly type?: string; -} - -// @public -export interface ProxyResourceAutoGenerated extends ResourceAutoGenerated5 { -} - -// @public -export type PublicNetworkAccess = string; - -// @public -export type ReceiverStatus = "NotSpecified" | "Enabled" | "Disabled"; - -// @public -export interface Recurrence { - frequency: RecurrenceFrequency; - schedule: RecurrentSchedule; -} - -// @public -export type RecurrenceFrequency = "None" | "Second" | "Minute" | "Hour" | "Day" | "Week" | "Month" | "Year"; - -// @public -export interface RecurrentSchedule { - days: string[]; - hours: number[]; - minutes: number[]; - timeZone: string; -} - -// @public -export interface Resource { - readonly id?: string; - readonly name?: string; - readonly systemData?: SystemData; - readonly type?: string; -} - -// @public -export interface ResourceAutoGenerated { - readonly id?: string; - readonly name?: string; - readonly systemData?: SystemData; - readonly type?: string; -} - -// @public -export interface ResourceAutoGenerated2 { - readonly id?: string; - location: string; - readonly name?: string; - readonly systemData?: SystemData; - tags?: { - [propertyName: string]: string; - }; - readonly type?: string; -} - -// @public -export interface ResourceAutoGenerated3 { - readonly id?: string; - location: string; - readonly name?: string; - tags?: { - [propertyName: string]: string; - }; - readonly type?: string; -} - -// @public -export interface ResourceAutoGenerated4 { - readonly id?: string; - location: string; - readonly name?: string; - tags?: { - [propertyName: string]: string; - }; - readonly type?: string; -} - -// @public -export interface ResourceAutoGenerated5 { - readonly id?: string; - readonly name?: string; - 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; - interval?: string; - namespace?: string; - resourceregion?: string; - timespan: string; - value: Metric[]; -} -export { Response_2 as Response } - -// @public -export interface ResponseWithError { - error: ErrorModel; -} - -// @public -export type ResultType = "Data" | "Metadata"; - -// @public -export interface RetentionPolicy { - days: number; - enabled: boolean; -} - -// @public -export interface RuleAction { - odataType: "Microsoft.Azure.Management.Insights.Models.RuleEmailAction" | "Microsoft.Azure.Management.Insights.Models.RuleWebhookAction"; -} - -// @public (undocumented) -export type RuleActionUnion = RuleAction | RuleEmailAction | RuleWebhookAction; - -// @public -export interface RuleCondition { - dataSource?: RuleDataSourceUnion; - odataType: "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition" | "Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition" | "Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition"; -} - -// @public (undocumented) -export type RuleConditionUnion = RuleCondition | ThresholdRuleCondition | LocationThresholdRuleCondition | ManagementEventRuleCondition; - -// @public -export interface RuleDataSource { - legacyResourceId?: string; - metricNamespace?: string; - odataType: "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource" | "Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource"; - resourceLocation?: string; - resourceUri?: string; -} - -// @public (undocumented) -export type RuleDataSourceUnion = RuleDataSource | RuleMetricDataSource | RuleManagementEventDataSource; - -// @public -export interface RuleEmailAction extends RuleAction { - customEmails?: string[]; - odataType: "Microsoft.Azure.Management.Insights.Models.RuleEmailAction"; - sendToServiceOwners?: boolean; -} - -// @public -export interface RuleManagementEventClaimsDataSource { - emailAddress?: string; -} - -// @public -export interface RuleManagementEventDataSource extends RuleDataSource { - claims?: RuleManagementEventClaimsDataSource; - eventName?: string; - eventSource?: string; - level?: string; - odataType: "Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource"; - operationName?: string; - resourceGroupName?: string; - resourceProviderName?: string; - status?: string; - subStatus?: string; -} - -// @public -export interface RuleMetricDataSource extends RuleDataSource { - metricName?: string; - odataType: "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource"; -} - -// @public -export interface RuleResolveConfiguration { - autoResolved?: boolean; - timeToResolve?: string; -} - -// @public -export interface RuleWebhookAction extends RuleAction { - odataType: "Microsoft.Azure.Management.Insights.Models.RuleWebhookAction"; - properties?: { - [propertyName: string]: string; - }; - serviceUri?: string; -} - -// @public -export interface ScaleAction { - cooldown: string; - direction: ScaleDirection; - type: ScaleType; - value?: string; -} - -// @public -export interface ScaleCapacity { - default: string; - maximum: string; - minimum: string; -} - -// @public -export type ScaleDirection = "None" | "Increase" | "Decrease"; - -// @public -export interface ScaleRule { - metricTrigger: MetricTrigger; - scaleAction: ScaleAction; -} - -// @public -export interface ScaleRuleMetricDimension { - dimensionName: string; - operator: ScaleRuleMetricDimensionOperationType; - values: string[]; -} - -// @public -export type ScaleRuleMetricDimensionOperationType = string; - -// @public -export type ScaleType = "ChangeCount" | "PercentChangeCount" | "ExactCount" | "ServiceAllowedNextValue"; - -// @public -export interface ScheduledQueryRuleCriteria { - allOf?: Condition[]; -} +export interface ScheduledQueryRuleCriteria { + allOf?: Condition[]; +} // @public export interface ScheduledQueryRuleResource { @@ -3536,7 +498,7 @@ export interface ScheduledQueryRuleResource { muteActionsDuration?: string; readonly name?: string; overrideQueryTimeRange?: string; - ruleResolveConfiguration?: RuleResolveConfiguration; + resolveConfiguration?: RuleResolveConfiguration; scopes?: string[]; severity?: AlertSeverity; skipQueryValidation?: boolean; @@ -3571,7 +533,7 @@ export interface ScheduledQueryRuleResourcePatch { readonly isWorkspaceAlertsStorageConfigured?: boolean; muteActionsDuration?: string; overrideQueryTimeRange?: string; - ruleResolveConfiguration?: RuleResolveConfiguration; + resolveConfiguration?: RuleResolveConfiguration; scopes?: string[]; severity?: AlertSeverity; skipQueryValidation?: boolean; @@ -3645,44 +607,6 @@ export interface ScheduledQueryRulesUpdateOptionalParams extends coreClient.Oper // @public export type ScheduledQueryRulesUpdateResponse = ScheduledQueryRuleResource; -// @public -export interface ScopedResource extends ProxyResourceAutoGenerated { - linkedResourceId?: string; - readonly provisioningState?: string; - readonly systemData?: SystemData; -} - -// @public -export interface ScopedResourceListResult { - readonly nextLink?: string; - readonly value?: ScopedResource[]; -} - -// @public -export interface SenderAuthorization { - action?: string; - role?: string; - scope?: string; -} - -// @public -export interface SingleBaseline { - highThresholds: number[]; - lowThresholds: number[]; - sensitivity: BaselineSensitivity; -} - -// @public -export interface SingleMetricBaseline { - baselines: TimeSeriesBaseline[]; - id: string; - interval: string; - name: string; - namespace?: string; - timespan: string; - type: string; -} - // @public export interface SmsReceiver { countryCode: string; @@ -3691,79 +615,6 @@ 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 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 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[]; - logLevels?: KnownSyslogDataSourceLogLevels[]; - name?: string; - streams?: KnownSyslogDataSourceStreams[]; -} - // @public export interface SystemData { createdAt?: Date; @@ -3774,102 +625,6 @@ export interface SystemData { lastModifiedByType?: CreatedByType; } -// @public -export interface TagsResource { - tags?: { - [propertyName: string]: string; - }; -} - -// @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; -} - -// @public -export interface TenantActivityLogsListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type TenantActivityLogsListNextResponse = EventDataCollection; - -// @public -export interface TenantActivityLogsListOptionalParams extends coreClient.OperationOptions { - filter?: string; - select?: string; -} - -// @public -export type TenantActivityLogsListResponse = EventDataCollection; - -// @public -export interface TenantNotificationRequestBody { - alertType: string; - azureAppPushReceivers?: AzureAppPushReceiverAutoGenerated[]; - emailReceivers?: EmailReceiverAutoGenerated[]; - smsReceivers?: SmsReceiverAutoGenerated[]; - voiceReceivers?: VoiceReceiverAutoGenerated[]; - webhookReceivers?: WebhookReceiverAutoGenerated[]; -} - // @public export interface TestNotificationDetailsResponse { actionDetails?: ActionDetail[]; @@ -3879,71 +634,9 @@ export interface TestNotificationDetailsResponse { state: string; } -// @public -export interface TestNotificationDetailsResponseAutoGenerated { - actionDetails?: ActionDetailAutoGenerated[]; - completedTime?: string; - context?: Context; - createdTime?: string; - state: string; -} - -// @public -export interface ThresholdRuleCondition extends RuleCondition { - odataType: "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition"; - operator: ConditionOperator; - threshold: number; - timeAggregation?: TimeAggregationOperator; - windowSize?: string; -} - // @public export type TimeAggregation = string; -// @public -export type TimeAggregationOperator = "Average" | "Minimum" | "Maximum" | "Total" | "Last"; - -// @public -export type TimeAggregationType = "Average" | "Minimum" | "Maximum" | "Total" | "Count" | "Last"; - -// @public -export interface TimeSeriesBaseline { - aggregation: string; - data: SingleBaseline[]; - dimensions?: MetricSingleDimension[]; - metadataValues?: BaselineMetadata[]; - timestamps: Date[]; -} - -// @public -export interface TimeSeriesElement { - data?: MetricValue[]; - metadatavalues?: MetadataValue[]; -} - -// @public -export interface TimeWindow { - end: Date; - start: Date; - timeZone?: string; -} - -// @public -export interface TrackedResource extends ResourceAutoGenerated { - location: string; - tags?: { - [propertyName: string]: string; - }; -} - -// @public -export interface TrackedResourceAutoGenerated extends ResourceAutoGenerated5 { - location: string; - tags?: { - [propertyName: string]: string; - }; -} - // @public export interface UserAssignedIdentity { readonly clientId?: string; @@ -3956,26 +649,6 @@ export interface UserIdentityProperties { readonly principalId?: string; } -// @public -export interface VMInsights { - getOnboardingStatus(resourceUri: string, options?: VMInsightsGetOnboardingStatusOptionalParams): Promise; -} - -// @public -export interface VMInsightsGetOnboardingStatusOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VMInsightsGetOnboardingStatusResponse = VMInsightsOnboardingStatus; - -// @public -export interface VMInsightsOnboardingStatus extends ProxyResource { - data?: DataContainer[]; - dataStatus?: DataStatus; - onboardingStatus?: OnboardingStatus; - resourceId?: string; -} - // @public export interface VoiceReceiver { countryCode: string; @@ -3983,24 +656,10 @@ export interface VoiceReceiver { phoneNumber: string; } -// @public -export interface VoiceReceiverAutoGenerated { - countryCode: string; - name: string; - phoneNumber: string; -} - -// @public -export interface WebhookNotification { - properties?: { - [propertyName: string]: string; - }; - serviceUri?: string; -} - // @public export interface WebhookReceiver { identifierUri?: string; + managedIdentity?: string; name: string; objectId?: string; serviceUri: string; @@ -4009,45 +668,6 @@ 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; - failedLocationCount: number; - odataType: "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria"; - webTestId: string; -} - -// @public -export interface WindowsEventLogDataSource { - name?: string; - streams?: KnownWindowsEventLogDataSourceStreams[]; - xPathQueries?: string[]; -} - -// @public -export interface WindowsFirewallLogsDataSource { - name?: string; - streams: string[]; -} - -// @public -export interface WorkspaceInfo { - customerId: string; - id: string; - location: string; -} - // (No @packageDocumentation comment for this package) ``` diff --git a/sdk/monitor/arm-monitor/sample.env b/sdk/monitor/arm-monitor/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/monitor/arm-monitor/sample.env +++ b/sdk/monitor/arm-monitor/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file 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 9045a159d55f..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.ts +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import type { NotificationRequestBody } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2023-01-01/examples/postTestNotificationsAtActionGroupResourceLevel.json - */ -async function createNotificationsAtResourceGroupLevel(): Promise { - 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(): Promise { - await 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 a50c22a4cd7d..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateOrUpdateSample.ts +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 type { ActionGroupResource } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2023-01-01/examples/createOrUpdateActionGroup.json - */ -async function createOrUpdateAnActionGroup(): Promise { - 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(): Promise { - await 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 4358aeb6da6e..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsDeleteSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2023-01-01/examples/deleteActionGroup.json - */ -async function deleteAnActionGroup(): Promise { - 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(): Promise { - await 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 18f3242ab8c6..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsEnableReceiverSample.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. - */ -import type { EnableRequest } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2023-01-01/examples/enableReceiver.json - */ -async function enableTheReceiver(): Promise { - 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(): Promise { - await 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 457c66976da0..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2023-01-01/examples/getActionGroup.json - */ -async function getAnActionGroup(): Promise { - 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(): Promise { - await 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 851052e4a670..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.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. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2023-01-01/examples/getTestNotificationsAtActionGroupResourceLevel.json - */ -async function getNotificationDetailsAtResourceGroupLevel(): Promise { - 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(): Promise { - await getNotificationDetailsAtResourceGroupLevel(); -} - -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 40962a137a10..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsListByResourceGroupSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2023-01-01/examples/listActionGroups.json - */ -async function listActionGroupsAtResourceGroupLevel(): Promise { - 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 (const item of client.actionGroups.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 aac65246eb55..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsListBySubscriptionIdSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2023-01-01/examples/listActionGroups.json - */ -async function listActionGroupsAtSubscriptionLevel(): Promise { - 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 (const item of client.actionGroups.listBySubscriptionId()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listActionGroupsAtSubscriptionLevel(); -} - -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 b53abad32fb4..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsUpdateSample.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. - */ -import type { ActionGroupPatchBody } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2023-01-01/examples/patchActionGroup.json - */ -async function patchAnActionGroup(): Promise { - 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(): Promise { - await 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 fb75d31f58cc..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsCreateOrUpdateSample.ts +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 type { ActivityLogAlertResource } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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(): Promise { - 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(): Promise { - await createOrUpdateAnActivityLogAlertRule(); - await createOrUpdateAnActivityLogAlertRuleWithAnyOfCondition(); - await 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 52597cb5d6f3..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsDeleteSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 47fc08b0e2d2..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 d9e1007e294a..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsListByResourceGroupSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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 (const item of client.activityLogAlerts.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 fa13b338b59a..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsListBySubscriptionIdSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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 (const item of client.activityLogAlerts.listBySubscriptionId()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 13e56be2e157..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsUpdateSample.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. - */ -import type { AlertRulePatchObject } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 0ecf7d99e623..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/activityLogsListSample.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 type { ActivityLogsListOptionalParams } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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 (const 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(): Promise { - 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 (const item of client.activityLogs.list(filter, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await getActivityLogsWithFilter(); - await 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 bc4ab677fa09..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRuleIncidentsGetSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 4f2ce4d796b8..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRuleIncidentsListByAlertRuleSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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 (const item of client.alertRuleIncidents.listByAlertRule(resourceGroupName, ruleName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 031c3ec1d355..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRulesCreateOrUpdateSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 type { AlertRuleResource } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 9030dbe418b1..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRulesDeleteSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 66420a8a5d67..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRulesGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 328998c243c5..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRulesListByResourceGroupSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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 (const item of client.alertRules.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 764bcaa7c745..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRulesListBySubscriptionSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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 (const item of client.alertRules.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 24cb4380c8e6..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRulesUpdateSample.ts +++ /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. - */ -import type { AlertRuleResourcePatch } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 89d8380837ed..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsCreateOrUpdateSample.ts +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 type { AutoscaleSettingResource } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 245b5ad17e73..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsDeleteSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 97d95ceae189..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 263b1a177ae0..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsListByResourceGroupSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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 (const item of client.autoscaleSettings.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 102601bdc778..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsListBySubscriptionSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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 (const item of client.autoscaleSettings.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 34d91740f657..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsUpdateSample.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. - */ -import type { AutoscaleSettingResourcePatch } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 b869982d804c..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesCreateSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import type { AzureMonitorWorkspaceResource } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Creates or updates an Azure Monitor Workspace - * - * @summary Creates or updates an Azure Monitor Workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesCreate.json - */ -async function createOrUpdateAnAzureMonitorWorkspace(): Promise { - 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(): Promise { - await createOrUpdateAnAzureMonitorWorkspace(); -} - -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 700d5727503c..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesDeleteSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes an Azure Monitor Workspace - * - * @summary Deletes an Azure Monitor Workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesDelete.json - */ -async function deleteAnAzureMonitorWorkspace(): Promise { - 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.beginDeleteAndWait( - resourceGroupName, - azureMonitorWorkspaceName, - ); - console.log(result); -} - -async function main(): Promise { - await deleteAnAzureMonitorWorkspace(); -} - -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 3602c3cbdb02..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesGetSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Returns the specified Azure Monitor Workspace - * - * @summary Returns the specified Azure Monitor Workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesGet.json - */ -async function getAzureMonitorWorkspace(): Promise { - 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(): Promise { - await getAzureMonitorWorkspace(); -} - -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 9ae8c79e13c2..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesListByResourceGroupSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Lists all Azure Monitor Workspaces in the specified resource group - * - * @summary Lists all Azure Monitor Workspaces in the specified resource group - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesListByResourceGroup.json - */ -async function listAzureMonitorWorkspacesByResourceGroup(): Promise { - 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 (const item of client.azureMonitorWorkspaces.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listAzureMonitorWorkspacesByResourceGroup(); -} - -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 fe9c66a6417c..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesListBySubscriptionSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Lists all Azure Monitor Workspaces in the specified subscription - * - * @summary Lists all Azure Monitor Workspaces in the specified subscription - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesListBySubscription.json - */ -async function listAzureMonitorWorkspacesBySubscription(): Promise { - 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 (const item of client.azureMonitorWorkspaces.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listAzureMonitorWorkspacesBySubscription(); -} - -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 a3028eefe90e..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesUpdateSample.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. - */ -import type { - AzureMonitorWorkspaceResourceForUpdate, - AzureMonitorWorkspacesUpdateOptionalParams, -} from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Updates part of an Azure Monitor Workspace - * - * @summary Updates part of an Azure Monitor Workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesUpdate.json - */ -async function updateAnAzureMonitorWorkspace(): Promise { - 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(): Promise { - await updateAnAzureMonitorWorkspace(); -} - -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 762c353dfe7a..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/baselinesListSample.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. - */ -import type { BaselinesListOptionalParams } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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); - const resArray = new Array(); - for await (const item of client.baselines.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await getMetricBaselines(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/createNotificationsAtTenantActionGroupResourceLevelSample.ts b/sdk/monitor/arm-monitor/samples-dev/createNotificationsAtTenantActionGroupResourceLevelSample.ts deleted file mode 100644 index de14b30d15ce..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/createNotificationsAtTenantActionGroupResourceLevelSample.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 type { TenantNotificationRequestBody } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/preview/2023-05-01-preview/examples/postTestNotificationsAtTenantActionGroupResourceLevel.json - */ -async function createNotificationsAtTenantActionGroupLevel(): Promise { - const managementGroupId = "11111111-1111-1111-1111-111111111111"; - const tenantActionGroupName = "testTenantActionGroup"; - const xMsClientTenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const notificationRequest: TenantNotificationRequestBody = { - alertType: "servicehealth", - azureAppPushReceivers: [{ name: "Sample azureAppPush", emailAddress: "johndoe@email.com" }], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false, - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true, - }, - ], - 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); - const result = await client.beginCreateNotificationsAtTenantActionGroupResourceLevelAndWait( - managementGroupId, - tenantActionGroupName, - xMsClientTenantId, - notificationRequest, - ); - console.log(result); -} - -async function main(): Promise { - await createNotificationsAtTenantActionGroupLevel(); -} - -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 7b211e400f06..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsCreateSample.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. - */ -import type { - DataCollectionEndpointResource, - DataCollectionEndpointsCreateOptionalParams, -} from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2022-06-01/examples/DataCollectionEndpointsCreate.json - */ -async function createOrUpdateDataCollectionEndpoint(): Promise { - 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(): Promise { - await 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 1fe4482c5f62..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsDeleteSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2022-06-01/examples/DataCollectionEndpointsDelete.json - */ -async function deleteDataCollectionEndpoint(): Promise { - 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(): Promise { - await 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 46a0c11064f9..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsGetSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2022-06-01/examples/DataCollectionEndpointsGet.json - */ -async function getDataCollectionEndpoint(): Promise { - 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(): Promise { - await 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 3b98cd7e5f0c..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsListByResourceGroupSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2022-06-01/examples/DataCollectionEndpointsListByResourceGroup.json - */ -async function listDataCollectionEndpointsByResourceGroup(): Promise { - 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 (const item of client.dataCollectionEndpoints.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 43c148c0fdd9..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsListBySubscriptionSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2022-06-01/examples/DataCollectionEndpointsListBySubscription.json - */ -async function listDataCollectionEndpointsBySubscription(): Promise { - 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 (const item of client.dataCollectionEndpoints.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 1d4e6da63e16..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsUpdateSample.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. - */ -import type { - ResourceForUpdate, - DataCollectionEndpointsUpdateOptionalParams, -} from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2022-06-01/examples/DataCollectionEndpointsUpdate.json - */ -async function updateDataCollectionEndpoint(): Promise { - 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(): Promise { - await 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 6809d86298ce..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsCreateSample.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. - */ -import type { - DataCollectionRuleAssociationProxyOnlyResource, - DataCollectionRuleAssociationsCreateOptionalParams, -} from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2022-06-01/examples/DataCollectionRuleAssociationsCreate.json - */ -async function createOrUpdateAssociation(): Promise { - 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); - const result = await client.dataCollectionRuleAssociations.create( - resourceUri, - associationName, - options, - ); - console.log(result); -} - -async function main(): Promise { - await 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 584572a03306..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsDeleteSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes an association. - * - * @summary Deletes an association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRuleAssociationsDelete.json - */ -async function deleteAssociation(): Promise { - 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); - const result = await client.dataCollectionRuleAssociations.delete(resourceUri, associationName); - console.log(result); -} - -async function main(): Promise { - await 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 6733041c6c27..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsGetSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2022-06-01/examples/DataCollectionRuleAssociationsGet.json - */ -async function getAssociation(): Promise { - 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); - const result = await client.dataCollectionRuleAssociations.get(resourceUri, associationName); - console.log(result); -} - -async function main(): Promise { - await 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 d834e67d9db4..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.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. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2022-06-01/examples/DataCollectionRuleAssociationsListByDataCollectionEndpoint.json - */ -async function listAssociationsForSpecifiedDataCollectionEndpoint(): Promise { - 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 (const item of client.dataCollectionRuleAssociations.listByDataCollectionEndpoint( - resourceGroupName, - dataCollectionEndpointName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 40330eac4b0b..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsListByResourceSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2022-06-01/examples/DataCollectionRuleAssociationsListByResource.json - */ -async function listAssociationsForSpecifiedResource(): Promise { - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const resArray = new Array(); - for await (const item of client.dataCollectionRuleAssociations.listByResource(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 40638030c360..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsListByRuleSample.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. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2022-06-01/examples/DataCollectionRuleAssociationsListByRule.json - */ -async function listAssociationsForSpecifiedDataCollectionRule(): Promise { - 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 (const item of client.dataCollectionRuleAssociations.listByRule( - resourceGroupName, - dataCollectionRuleName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 a01850650fc9..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesCreateSample.ts +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 type { - DataCollectionRuleResource, - DataCollectionRulesCreateOptionalParams, -} from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2022-06-01/examples/DataCollectionRulesCreate.json - */ -async function createOrUpdateDataCollectionRule(): Promise { - 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(): Promise { - await 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 15d9ce626c39..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesDeleteSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2022-06-01/examples/DataCollectionRulesDelete.json - */ -async function deleteDataCollectionRule(): Promise { - 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(): Promise { - await 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 9ad3b275f69a..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2022-06-01/examples/DataCollectionRulesGet.json - */ -async function getDataCollectionRule(): Promise { - 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(): Promise { - await 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 d5c67259c5f2..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesListByResourceGroupSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2022-06-01/examples/DataCollectionRulesListByResourceGroup.json - */ -async function listDataCollectionRulesByResourceGroup(): Promise { - 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 (const item of client.dataCollectionRules.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 730cafda92ee..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesListBySubscriptionSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2022-06-01/examples/DataCollectionRulesListBySubscription.json - */ -async function listDataCollectionRulesBySubscription(): Promise { - 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 (const item of client.dataCollectionRules.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 28207d509c52..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesUpdateSample.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. - */ -import type { - ResourceForUpdate, - DataCollectionRulesUpdateOptionalParams, -} from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2022-06-01/examples/DataCollectionRulesUpdate.json - */ -async function updateDataCollectionRule(): Promise { - 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(): Promise { - await 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 1802cd12d78b..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCategoryGetSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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); - const result = await client.diagnosticSettingsCategory.get(resourceUri, name); - console.log(result); -} - -async function main(): Promise { - await 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 ee09496da73d..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCategoryListSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const resArray = new Array(); - for await (const item of client.diagnosticSettingsCategory.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 921d179824f4..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCreateOrUpdateSample.ts +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 type { DiagnosticSettingsResource } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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); - 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(): Promise { - 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); - const result = await client.diagnosticSettings.createOrUpdate(resourceUri, name, parameters); - console.log(result); -} - -async function main(): Promise { - await createsOrUpdatesTheDiagnosticSetting(); - await 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 0eac77ad4404..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsDeleteSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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); - const result = await client.diagnosticSettings.delete(resourceUri, name); - console.log(result); -} - -async function main(): Promise { - await 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 b84ef5b702e2..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsGetSample.ts +++ /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. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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); - 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(): Promise { - 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); - const result = await client.diagnosticSettings.get(resourceUri, name); - console.log(result); -} - -async function main(): Promise { - await getsTheDiagnosticSetting(); - await 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 0570c6d43c22..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsListSample.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. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const resArray = new Array(); - for await (const 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(): Promise { - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const resArray = new Array(); - for await (const item of client.diagnosticSettings.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await getsTheDiagnosticSetting(); - await 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 fdf67b67320d..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/eventCategoriesListSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const resArray = new Array(); - for await (const item of client.eventCategories.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await getEventCategories(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/getTestNotificationsAtTenantActionGroupResourceLevelSample.ts b/sdk/monitor/arm-monitor/samples-dev/getTestNotificationsAtTenantActionGroupResourceLevelSample.ts deleted file mode 100644 index ab1d922bbd8c..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/getTestNotificationsAtTenantActionGroupResourceLevelSample.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. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/preview/2023-05-01-preview/examples/getTestNotificationsAtTenantActionGroupResourceLevel.json - */ -async function getNotificationDetailsAtTenantActionGroupLevel(): Promise { - const managementGroupId = "11111111-1111-1111-1111-111111111111"; - const tenantActionGroupName = "testTenantActionGroup"; - const xMsClientTenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const notificationId = "11000222191287"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const result = await client.getTestNotificationsAtTenantActionGroupResourceLevel( - managementGroupId, - tenantActionGroupName, - xMsClientTenantId, - notificationId, - ); - console.log(result); -} - -async function main(): Promise { - await getNotificationDetailsAtTenantActionGroupLevel(); -} - -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 a97396bf8455..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/logProfilesCreateOrUpdateSample.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. - */ -import type { LogProfileResource } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 7e0cc261a2c1..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/logProfilesDeleteSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 fee40f66757c..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/logProfilesGetSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 81dbcd83c4b3..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/logProfilesListSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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 (const item of client.logProfiles.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 01c25a8b71e5..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/logProfilesUpdateSample.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. - */ -import type { LogProfileResourcePatch } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 ae6d85fb7755..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsCreateOrUpdateSample.ts +++ /dev/null @@ -1,452 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 type { MetricAlertResource } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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(): Promise { - 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(): Promise { - 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(): Promise { - 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(): Promise { - 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(): Promise { - 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(): Promise { - 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(): Promise { - await createOrUpdateADynamicAlertRuleForMultipleResources(); - await createOrUpdateADynamicAlertRuleForSingleResource(); - await createOrUpdateAWebTestAlertRule(); - await createOrUpdateAnAlertRuleForMultipleResource(); - await createOrUpdateAnAlertRuleForSingleResource(); - await createOrUpdateAnAlertRuleOnResourceGroupS(); - await createOrUpdateAnAlertRuleOnSubscription(); - await 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 f51ce724b906..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsDeleteSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 9946b3a40f91..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsGetSample.ts +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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(): Promise { - 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(): Promise { - 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(): Promise { - 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(): Promise { - 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(): Promise { - 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(): Promise { - await getADynamicAlertRuleForMultipleResources(); - await getADynamicAlertRuleForSingleResource(); - await getAWebTestAlertRule(); - await getAnAlertRuleForMultipleResources(); - await getAnAlertRuleForSingleResource(); - await getAnAlertRuleOnResourceGroupS(); - await 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 57c829b55af9..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsListByResourceGroupSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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 (const item of client.metricAlerts.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 759bf111d7ba..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsListBySubscriptionSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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 (const item of client.metricAlerts.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 af0191ff2654..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsStatusListByNameSample.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. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 ef34c20ca7f7..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsStatusListSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 1511270d2089..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsUpdateSample.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. - */ -import type { MetricAlertResourcePatch } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await createOrUpdateAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/metricDefinitionsListAtSubscriptionScopeSample.ts b/sdk/monitor/arm-monitor/samples-dev/metricDefinitionsListAtSubscriptionScopeSample.ts deleted file mode 100644 index f970d9b2675b..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricDefinitionsListAtSubscriptionScopeSample.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. - */ -import type { MetricDefinitionsListAtSubscriptionScopeOptionalParams } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Lists the metric definitions for the subscription. - * - * @summary Lists the metric definitions for the subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMultiResourceMetricDefinitions.json - */ -async function getSubscriptionLevelMetricDefinitionsWithoutFilter(): Promise { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "92d2a2d8-b514-432d-8cc9-a5f9272630d5"; - const region = "westus2"; - const metricnamespace = "microsoft.compute/virtualmachines"; - const options: MetricDefinitionsListAtSubscriptionScopeOptionalParams = { - metricnamespace, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.metricDefinitions.listAtSubscriptionScope(region, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await getSubscriptionLevelMetricDefinitionsWithoutFilter(); -} - -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 0f00bbfe1efd..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricDefinitionsListSample.ts +++ /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. - */ -import type { MetricDefinitionsListOptionalParams } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-02-01/examples/GetMetricDefinitionsApplicationInsights.json - */ -async function getApplicationInsightsMetricDefinitionsWithoutFilter(): Promise { - 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); - const resArray = new Array(); - for await (const 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/2024-02-01/examples/GetMetricDefinitions.json - */ -async function getMetricDefinitionsWithoutFilter(): Promise { - 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); - const resArray = new Array(); - for await (const 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/2024-02-01/examples/GetMetricDefinitionsMetricClass.json - */ -async function getStorageCacheMetricDefinitionsWithMetricClass(): Promise { - 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); - const resArray = new Array(); - for await (const item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await getApplicationInsightsMetricDefinitionsWithoutFilter(); - await getMetricDefinitionsWithoutFilter(); - await 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 3c7d604b7892..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricNamespacesListSample.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. - */ -import type { MetricNamespacesListOptionalParams } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2024-02-01/examples/GetMetricNamespaces.json - */ -async function getMetricNamespacesWithoutFilter(): Promise { - 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); - const resArray = new Array(); - for await (const item of client.metricNamespaces.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await getMetricNamespacesWithoutFilter(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/metricsListAtSubscriptionScopePostSample.ts b/sdk/monitor/arm-monitor/samples-dev/metricsListAtSubscriptionScopePostSample.ts deleted file mode 100644 index 2c2e07d6cbe0..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricsListAtSubscriptionScopePostSample.ts +++ /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. - */ -import type { - MetricsListAtSubscriptionScopePostOptionalParams, - SubscriptionScopeMetricsRequestBodyParameters, -} from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. - * - * @summary **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMultiResourceMetric.json - */ -async function postRequestForSubscriptionLevelMetricData(): Promise { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "92d2a2d8-b514-432d-8cc9-a5f9272630d5"; - const region = "westus2"; - const timespan = "2021-06-08T19:00:00Z/2021-06-12T01:00:00Z"; - const interval = "PT6H"; - const metricnames = "Data Disk Max Burst IOPS"; - const aggregation = "count"; - const top = 10; - const orderby = "count desc"; - const filter = "LUN eq '0' and Microsoft.ResourceId eq '*'"; - const metricnamespace = "microsoft.compute/virtualmachines"; - const autoAdjustTimegrain = true; - const validateDimensions = false; - const options: MetricsListAtSubscriptionScopePostOptionalParams = { - timespan, - interval, - metricnames, - aggregation, - top, - orderby, - filter, - metricnamespace, - autoAdjustTimegrain, - validateDimensions, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.listAtSubscriptionScopePost(region, options); - console.log(result); -} - -/** - * This sample demonstrates how to **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. - * - * @summary **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/PostMultiResourceMetricBody.json - */ -async function postRequestForSubscriptionLevelMetricDataUsingBodyParams(): Promise { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "92d2a2d8-b514-432d-8cc9-a5f9272630d5"; - const region = "westus2"; - const body: SubscriptionScopeMetricsRequestBodyParameters = { - aggregation: "count", - autoAdjustTimegrain: true, - filter: "LUN eq '0' and Microsoft.ResourceId eq '*'", - interval: "PT6H", - metricNames: "Data Disk Max Burst IOPS", - metricNamespace: "microsoft.compute/virtualmachines", - orderBy: "count desc", - rollUpBy: "LUN", - timespan: "2021-06-08T19:00:00Z/2021-06-12T01:00:00Z", - top: 10, - validateDimensions: false, - }; - const options: MetricsListAtSubscriptionScopePostOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.listAtSubscriptionScopePost(region, options); - console.log(result); -} - -/** - * This sample demonstrates how to **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. - * - * @summary **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMultiResourceMetricMetadata.json - */ -async function postRequestForSubscriptionLevelMetricMetadata(): Promise { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "92d2a2d8-b514-432d-8cc9-a5f9272630d5"; - const region = "westus2"; - const timespan = "2021-06-10T02:23:16.129Z/2021-06-12T02:23:16.129Z"; - const metricnames = "Data Disk Max Burst IOPS"; - const filter = "LUN eq '0'"; - const metricnamespace = "microsoft.compute/virtualmachines"; - const options: MetricsListAtSubscriptionScopePostOptionalParams = { - timespan, - metricnames, - filter, - metricnamespace, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.listAtSubscriptionScopePost(region, options); - console.log(result); -} - -async function main(): Promise { - await postRequestForSubscriptionLevelMetricData(); - await postRequestForSubscriptionLevelMetricDataUsingBodyParams(); - await postRequestForSubscriptionLevelMetricMetadata(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/metricsListAtSubscriptionScopeSample.ts b/sdk/monitor/arm-monitor/samples-dev/metricsListAtSubscriptionScopeSample.ts deleted file mode 100644 index 98a9febceb96..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricsListAtSubscriptionScopeSample.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 type { MetricsListAtSubscriptionScopeOptionalParams } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to **Lists the metric data for a subscription**. - * - * @summary **Lists the metric data for a subscription**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMultiResourceMetric.json - */ -async function getSubscriptionLevelMetricData(): Promise { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "92d2a2d8-b514-432d-8cc9-a5f9272630d5"; - const region = "westus2"; - const timespan = "2021-06-08T19:00:00Z/2021-06-12T01:00:00Z"; - const interval = "PT6H"; - const metricnames = "Data Disk Max Burst IOPS"; - const aggregation = "count"; - const top = 10; - const orderby = "count desc"; - const filter = "LUN eq '0' and Microsoft.ResourceId eq '*'"; - const metricnamespace = "microsoft.compute/virtualmachines"; - const autoAdjustTimegrain = true; - const validateDimensions = false; - const options: MetricsListAtSubscriptionScopeOptionalParams = { - timespan, - interval, - metricnames, - aggregation, - top, - orderby, - filter, - metricnamespace, - autoAdjustTimegrain, - validateDimensions, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.listAtSubscriptionScope(region, options); - console.log(result); -} - -/** - * This sample demonstrates how to **Lists the metric data for a subscription**. - * - * @summary **Lists the metric data for a subscription**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMultiResourceMetricMetadata.json - */ -async function getSubscriptionLevelMetricMetadata(): Promise { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "92d2a2d8-b514-432d-8cc9-a5f9272630d5"; - const region = "westus2"; - const timespan = "2021-06-10T02:23:16.129Z/2021-06-12T02:23:16.129Z"; - const metricnames = "Data Disk Max Burst IOPS"; - const filter = "LUN eq '0'"; - const metricnamespace = "microsoft.compute/virtualmachines"; - const options: MetricsListAtSubscriptionScopeOptionalParams = { - timespan, - metricnames, - filter, - metricnamespace, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.listAtSubscriptionScope(region, options); - console.log(result); -} - -async function main(): Promise { - await getSubscriptionLevelMetricData(); - await getSubscriptionLevelMetricMetadata(); -} - -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 8556e36913f7..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricsListSample.ts +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 type { MetricsListOptionalParams } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-02-01/examples/GetMetric.json - */ -async function getMetricForData(): Promise { - const resourceUri = - "subscriptions/1f3fa6d2-851c-4a91-9087-1a050f3a9c38/resourceGroups/todking/providers/Microsoft.Storage/storageAccounts/tkfileserv/blobServices/default"; - const timespan = "2021-04-20T09:00:00.000Z/2021-04-20T14:00:00.000Z"; - const interval = "PT6H"; - const metricnames = "BlobCount,BlobCapacity"; - const aggregation = "average,minimum,maximum"; - const top = 5; - const orderby = "average asc"; - const filter = "Tier eq '*'"; - const metricnamespace = "Microsoft.Storage/storageAccounts/blobServices"; - const autoAdjustTimegrain = true; - const validateDimensions = false; - const options: MetricsListOptionalParams = { - timespan, - interval, - metricnames, - aggregation, - top, - orderby, - filter, - metricnamespace, - autoAdjustTimegrain, - validateDimensions, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - 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/2024-02-01/examples/GetMetricMetadata.json - */ -async function getMetricForMetadata(): Promise { - const resourceUri = - "subscriptions/1f3fa6d2-851c-4a91-9087-1a050f3a9c38/resourceGroups/todking/providers/Microsoft.Storage/storageAccounts/tkfileserv/blobServices/default"; - const timespan = "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z"; - const filter = "Tier eq '*'"; - const metricnamespace = "Microsoft.Storage/storageAccounts/blobServices"; - const options: MetricsListOptionalParams = { - timespan, - filter, - metricnamespace, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - 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/2024-02-01/examples/GetMetricError.json - */ -async function getMetricWithError(): Promise { - 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 autoAdjustTimegrain = true; - const validateDimensions = false; - const options: MetricsListOptionalParams = { - timespan, - interval, - metricnames, - aggregation, - metricnamespace, - autoAdjustTimegrain, - validateDimensions, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const result = await client.metricsOperations.list(resourceUri, options); - console.log(result); -} - -async function main(): Promise { - await getMetricForData(); - await getMetricForMetadata(); - await 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 75656ba1bffd..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/monitorOperationsListSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2023-04-03/examples/OperationsGet.json - */ -async function getOperationsList(): Promise { - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const resArray = new Array(); - for await (const item of client.monitorOperations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 f1947b4c468e..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/operationsListSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 3c092c49b149..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/predictiveMetricGetSample.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. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 df6a29c3e664..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.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. - */ -import type { PrivateEndpointConnectionAutoGenerated } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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: PrivateEndpointConnectionAutoGenerated = { - 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(): Promise { - await 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 307e5a1c216d..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsDeleteSample.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. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 092f390778d9..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsGetSample.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. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 10fa884dc4d8..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsListByPrivateLinkScopeSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 9d9c76d2ed5d..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkResourcesGetSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 16fca9918392..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkResourcesListByPrivateLinkScopeSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 a07514daf73a..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopeOperationStatusGetSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 59aa59d30574..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesCreateOrUpdateSample.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. - */ -import type { ScopedResource } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 d2e2418edc13..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesDeleteSample.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. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 faf32cc2d339..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesGetSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 6f5fe15459f9..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesListByPrivateLinkScopeSample.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. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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 (const item of client.privateLinkScopedResources.listByPrivateLinkScope( - resourceGroupName, - scopeName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 070e9407a2a5..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesCreateOrUpdateSample.ts +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 type { AzureMonitorPrivateLinkScope } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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(): Promise { - await privateLinkScopeCreate(); - await 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 307736fec9a7..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesDeleteSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 e963c87795e0..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 7c65945d6abf..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesListByResourceGroupSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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 (const item of client.privateLinkScopes.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 2f581e93ba48..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesListSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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 (const item of client.privateLinkScopes.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 797d77fa4ec4..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesUpdateTagsSample.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. - */ -import type { TagsResource } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - await 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 023ec41bc154..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesCreateOrUpdateSample.ts +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 type { ScheduledQueryRuleResource } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2023-12-01/examples/createOrUpdateScheduledQueryRule.json - */ -async function createOrUpdateAScheduledQueryRuleForSingleResource(): Promise { - 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", - ], - actionProperties: { - icmTitle: "Custom title in ICM", - icmTsgId: "https://tsg.url", - }, - 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/stable/2023-12-01/examples/createOrUpdateScheduledQueryRuleResourceGroup.json - */ -async function createOrUpdateAScheduledQueryRuleOnResourceGroupS(): Promise { - 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", - ], - actionProperties: { - icmTitle: "Custom title in ICM", - icmTsgId: "https://tsg.url", - }, - 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/stable/2023-12-01/examples/createOrUpdateScheduledQueryRuleSubscription.json - */ -async function createOrUpdateAScheduledQueryRuleOnSubscription(): Promise { - 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", - ], - actionProperties: { - icmTitle: "Custom title in ICM", - icmTsgId: "https://tsg.url", - }, - 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(): Promise { - await createOrUpdateAScheduledQueryRuleForSingleResource(); - await createOrUpdateAScheduledQueryRuleOnResourceGroupS(); - await 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 905dbf2ac75d..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesDeleteSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2023-12-01/examples/deleteScheduledQueryRule.json - */ -async function deleteAScheduledQueryRule(): Promise { - 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(): Promise { - await 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 29a447e9240f..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2023-12-01/examples/getScheduledQueryRule.json - */ -async function getAScheduledQueryRuleForSingleResource(): Promise { - 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(): Promise { - await 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 a83acb14bb01..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesListByResourceGroupSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2023-12-01/examples/listScheduledQueryRulesByResourceGroup.json - */ -async function listScheduledQueryRulesByResourceGroup(): Promise { - 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 (const item of client.scheduledQueryRules.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 b5e097ab1ae0..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesListBySubscriptionSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2023-12-01/examples/listScheduledQueryRulesBySubscription.json - */ -async function listScheduledQueryRulesBySubscription(): Promise { - 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 (const item of client.scheduledQueryRules.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await 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 d9b2aa46ae85..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesUpdateSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import type { ScheduledQueryRuleResourcePatch } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2023-12-01/examples/patchScheduledQueryRule.json - */ -async function createOrUpdateAScheduledQueryRule(): Promise { - 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(): Promise { - await createOrUpdateAScheduledQueryRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/tenantActionGroupsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/tenantActionGroupsCreateOrUpdateSample.ts deleted file mode 100644 index 7f5abad94118..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/tenantActionGroupsCreateOrUpdateSample.ts +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 type { TenantActionGroupResource } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create a new tenant action group or update an existing one. - * - * @summary Create a new tenant action group or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/createOrUpdateTenantActionGroup.json - */ -async function createOrUpdateATenantActionGroup(): Promise { - const managementGroupId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const tenantActionGroupName = "testTenantActionGroup"; - const xMsClientTenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const actionGroup: TenantActionGroupResource = { - azureAppPushReceivers: [{ name: "Sample azureAppPush", emailAddress: "johndoe@email.com" }], - 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, - groupShortName: "sample", - location: "Global", - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "2062022299", - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321", - }, - ], - tags: {}, - voiceReceivers: [{ name: "Sample voice", countryCode: "1", phoneNumber: "2062022299" }], - 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); - const result = await client.tenantActionGroups.createOrUpdate( - managementGroupId, - tenantActionGroupName, - xMsClientTenantId, - actionGroup, - ); - console.log(result); -} - -async function main(): Promise { - await createOrUpdateATenantActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/tenantActionGroupsDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/tenantActionGroupsDeleteSample.ts deleted file mode 100644 index 9a207dabb24a..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/tenantActionGroupsDeleteSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Delete a tenant action group. - * - * @summary Delete a tenant action group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/deleteTenantActionGroup.json - */ -async function deleteATenantActionGroup(): Promise { - const managementGroupId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const tenantActionGroupName = "testTenantActionGroup"; - const xMsClientTenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const result = await client.tenantActionGroups.delete( - managementGroupId, - tenantActionGroupName, - xMsClientTenantId, - ); - console.log(result); -} - -async function main(): Promise { - await deleteATenantActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/tenantActionGroupsGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/tenantActionGroupsGetSample.ts deleted file mode 100644 index 406c8d929fe8..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/tenantActionGroupsGetSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get a tenant action group. - * - * @summary Get a tenant action group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/getTenantActionGroup.json - */ -async function getAnActionGroup(): Promise { - const managementGroupId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const tenantActionGroupName = "testTenantActionGroup"; - const xMsClientTenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const result = await client.tenantActionGroups.get( - managementGroupId, - tenantActionGroupName, - xMsClientTenantId, - ); - console.log(result); -} - -async function main(): Promise { - await getAnActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/tenantActionGroupsListByManagementGroupIdSample.ts b/sdk/monitor/arm-monitor/samples-dev/tenantActionGroupsListByManagementGroupIdSample.ts deleted file mode 100644 index 06805ab07dc9..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/tenantActionGroupsListByManagementGroupIdSample.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. - */ -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get a list of all tenant action groups in a management group. - * - * @summary Get a list of all tenant action groups in a management group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/listTenantActionGroups.json - */ -async function listTenantActionGroupsAtManagementGroupLevel(): Promise { - const managementGroupId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const xMsClientTenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const resArray = new Array(); - for await (const item of client.tenantActionGroups.listByManagementGroupId( - managementGroupId, - xMsClientTenantId, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listTenantActionGroupsAtManagementGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/tenantActionGroupsUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/tenantActionGroupsUpdateSample.ts deleted file mode 100644 index 4b18e57cf63b..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/tenantActionGroupsUpdateSample.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. - */ -import type { ActionGroupPatchBodyAutoGenerated } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Updates an existing tenant action group's tags. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing tenant action group's tags. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/patchTenantActionGroup.json - */ -async function patchATenantActionGroup(): Promise { - const managementGroupId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const tenantActionGroupName = "testTenantActionGroup"; - const xMsClientTenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const tenantActionGroupPatch: ActionGroupPatchBodyAutoGenerated = { - enabled: false, - tags: { key1: "value1", key2: "value2" }, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const result = await client.tenantActionGroups.update( - managementGroupId, - tenantActionGroupName, - xMsClientTenantId, - tenantActionGroupPatch, - ); - console.log(result); -} - -async function main(): Promise { - await patchATenantActionGroup(); -} - -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 cbbda77db320..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/tenantActivityLogsListSample.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. - */ -import type { TenantActivityLogsListOptionalParams } from "@azure/arm-monitor"; -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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); - const resArray = new Array(); - for await (const 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(): Promise { - 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); - const resArray = new Array(); - for await (const 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(): Promise { - 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); - const resArray = new Array(); - for await (const 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(): Promise { - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const resArray = new Array(); - for await (const item of client.tenantActivityLogs.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await getTenantActivityLogsWithFilter(); - await getTenantActivityLogsWithFilterAndSelect(); - await getTenantActivityLogsWithSelect(); - await 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 fa59294544aa..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/vmInsightsGetOnboardingStatusSample.ts +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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); - 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(): Promise { - 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); - 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(): Promise { - 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); - 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(): Promise { - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/resource-group-with-vms"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - 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(): Promise { - const resourceUri = "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -async function main(): Promise { - await getStatusForAVMScaleSetThatIsActivelyReportingData(); - await getStatusForAVMThatHasNotYetReportedData(); - await getStatusForAVMThatIsActivelyReportingData(); - await getStatusForAResourceGroupThatHasAtLeastOneVMThatIsActivelyReportingData(); - await 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 97ae9b925445..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/README.md +++ /dev/null @@ -1,280 +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/2023-01-01/examples/postTestNotificationsAtActionGroupResourceLevel.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/2023-01-01/examples/createOrUpdateActionGroup.json | -| [actionGroupsDeleteSample.js][actiongroupsdeletesample] | Delete an action group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-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/2023-01-01/examples/enableReceiver.json | -| [actionGroupsGetSample.js][actiongroupsgetsample] | Get an action group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-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/2023-01-01/examples/getTestNotificationsAtActionGroupResourceLevel.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/2023-01-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/2023-01-01/examples/listActionGroups.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/2023-01-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] | Creates or updates an Azure Monitor Workspace x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesCreate.json | -| [azureMonitorWorkspacesDeleteSample.js][azuremonitorworkspacesdeletesample] | Deletes an Azure Monitor Workspace x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesDelete.json | -| [azureMonitorWorkspacesGetSample.js][azuremonitorworkspacesgetsample] | Returns the specified Azure Monitor Workspace x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesGet.json | -| [azureMonitorWorkspacesListByResourceGroupSample.js][azuremonitorworkspaceslistbyresourcegroupsample] | Lists all Azure Monitor Workspaces in the specified resource group x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesListByResourceGroup.json | -| [azureMonitorWorkspacesListBySubscriptionSample.js][azuremonitorworkspaceslistbysubscriptionsample] | Lists all Azure Monitor Workspaces in the specified subscription x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesListBySubscription.json | -| [azureMonitorWorkspacesUpdateSample.js][azuremonitorworkspacesupdatesample] | Updates part of an Azure Monitor Workspace x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/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 | -| [createNotificationsAtTenantActionGroupResourceLevelSample.js][createnotificationsattenantactiongroupresourcelevelsample] | Send test notifications to a set of provided receivers x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/postTestNotificationsAtTenantActionGroupResourceLevel.json | -| [dataCollectionEndpointsCreateSample.js][datacollectionendpointscreatesample] | Creates or updates a data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionEndpointsCreate.json | -| [dataCollectionEndpointsDeleteSample.js][datacollectionendpointsdeletesample] | Deletes a data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionEndpointsDelete.json | -| [dataCollectionEndpointsGetSample.js][datacollectionendpointsgetsample] | Returns the specified data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/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/stable/2022-06-01/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/stable/2022-06-01/examples/DataCollectionEndpointsListBySubscription.json | -| [dataCollectionEndpointsUpdateSample.js][datacollectionendpointsupdatesample] | Updates part of a data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionEndpointsUpdate.json | -| [dataCollectionRuleAssociationsCreateSample.js][datacollectionruleassociationscreatesample] | Creates or updates an association. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRuleAssociationsCreate.json | -| [dataCollectionRuleAssociationsDeleteSample.js][datacollectionruleassociationsdeletesample] | Deletes an association. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRuleAssociationsDelete.json | -| [dataCollectionRuleAssociationsGetSample.js][datacollectionruleassociationsgetsample] | Returns the specified association. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRuleAssociationsGet.json | -| [dataCollectionRuleAssociationsListByDataCollectionEndpointSample.js][datacollectionruleassociationslistbydatacollectionendpointsample] | Lists associations for the specified data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRuleAssociationsListByDataCollectionEndpoint.json | -| [dataCollectionRuleAssociationsListByResourceSample.js][datacollectionruleassociationslistbyresourcesample] | Lists associations for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRuleAssociationsListByResource.json | -| [dataCollectionRuleAssociationsListByRuleSample.js][datacollectionruleassociationslistbyrulesample] | Lists associations for the specified data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRuleAssociationsListByRule.json | -| [dataCollectionRulesCreateSample.js][datacollectionrulescreatesample] | Creates or updates a data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRulesCreate.json | -| [dataCollectionRulesDeleteSample.js][datacollectionrulesdeletesample] | Deletes a data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRulesDelete.json | -| [dataCollectionRulesGetSample.js][datacollectionrulesgetsample] | Returns the specified data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/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/stable/2022-06-01/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/stable/2022-06-01/examples/DataCollectionRulesListBySubscription.json | -| [dataCollectionRulesUpdateSample.js][datacollectionrulesupdatesample] | Updates part of a data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/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 | -| [getTestNotificationsAtTenantActionGroupResourceLevelSample.js][gettestnotificationsattenantactiongroupresourcelevelsample] | Get the test notifications by the notification id x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/getTestNotificationsAtTenantActionGroupResourceLevel.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 | -| [metricDefinitionsListAtSubscriptionScopeSample.js][metricdefinitionslistatsubscriptionscopesample] | Lists the metric definitions for the subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMultiResourceMetricDefinitions.json | -| [metricDefinitionsListSample.js][metricdefinitionslistsample] | Lists the metric definitions for the resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMetricDefinitionsApplicationInsights.json | -| [metricNamespacesListSample.js][metricnamespaceslistsample] | Lists the metric namespaces for the resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMetricNamespaces.json | -| [metricsListAtSubscriptionScopePostSample.js][metricslistatsubscriptionscopepostsample] | **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMultiResourceMetric.json | -| [metricsListAtSubscriptionScopeSample.js][metricslistatsubscriptionscopesample] | **Lists the metric data for a subscription**. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMultiResourceMetric.json | -| [metricsListSample.js][metricslistsample] | **Lists the metric values for a resource**. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMetric.json | -| [monitorOperationsListSample.js][monitoroperationslistsample] | Lists available Operations for this Resource Provider x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/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/stable/2023-12-01/examples/createOrUpdateScheduledQueryRule.json | -| [scheduledQueryRulesDeleteSample.js][scheduledqueryrulesdeletesample] | Deletes a scheduled query rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2023-12-01/examples/deleteScheduledQueryRule.json | -| [scheduledQueryRulesGetSample.js][scheduledqueryrulesgetsample] | Retrieve an scheduled query rule definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2023-12-01/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/stable/2023-12-01/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/stable/2023-12-01/examples/listScheduledQueryRulesBySubscription.json | -| [scheduledQueryRulesUpdateSample.js][scheduledqueryrulesupdatesample] | Update a scheduled query rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2023-12-01/examples/patchScheduledQueryRule.json | -| [tenantActionGroupsCreateOrUpdateSample.js][tenantactiongroupscreateorupdatesample] | Create a new tenant action group or update an existing one. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/createOrUpdateTenantActionGroup.json | -| [tenantActionGroupsDeleteSample.js][tenantactiongroupsdeletesample] | Delete a tenant action group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/deleteTenantActionGroup.json | -| [tenantActionGroupsGetSample.js][tenantactiongroupsgetsample] | Get a tenant action group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/getTenantActionGroup.json | -| [tenantActionGroupsListByManagementGroupIdSample.js][tenantactiongroupslistbymanagementgroupidsample] | Get a list of all tenant action groups in a management group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/listTenantActionGroups.json | -| [tenantActionGroupsUpdateSample.js][tenantactiongroupsupdatesample] | Updates an existing tenant action group's tags. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/patchTenantActionGroup.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 dev-tool run vendored 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 -[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 -[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 -[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 -[createnotificationsattenantactiongroupresourcelevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/createNotificationsAtTenantActionGroupResourceLevelSample.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 -[gettestnotificationsattenantactiongroupresourcelevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/getTestNotificationsAtTenantActionGroupResourceLevelSample.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 -[metricdefinitionslistatsubscriptionscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricDefinitionsListAtSubscriptionScopeSample.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 -[metricslistatsubscriptionscopepostsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricsListAtSubscriptionScopePostSample.js -[metricslistatsubscriptionscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricsListAtSubscriptionScopeSample.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 -[tenantactiongroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActionGroupsCreateOrUpdateSample.js -[tenantactiongroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActionGroupsDeleteSample.js -[tenantactiongroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActionGroupsGetSample.js -[tenantactiongroupslistbymanagementgroupidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActionGroupsListByManagementGroupIdSample.js -[tenantactiongroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActionGroupsUpdateSample.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://learn.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 30f3c9e59fbd..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/2023-01-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/actionGroupsCreateOrUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateOrUpdateSample.js deleted file mode 100644 index 701282e7405e..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/2023-01-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 1478024ac15e..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/2023-01-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 b231aba0ca17..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/2023-01-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 d0ac366f2e25..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/2023-01-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 321eedfbcb28..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/2023-01-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/actionGroupsListByResourceGroupSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsListByResourceGroupSample.js deleted file mode 100644 index 942281948cde..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/2023-01-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 9cd397c38cda..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/2023-01-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/actionGroupsUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsUpdateSample.js deleted file mode 100644 index 31697e898d78..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/2023-01-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 6edb0f0ea947..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 81fb45369df4..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 38a4441fd49e..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 191c3d2455d6..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 5443281c62cb..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 Creates or updates an Azure Monitor Workspace - * - * @summary Creates or updates an Azure Monitor Workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesCreate.json - */ -async function createOrUpdateAnAzureMonitorWorkspace() { - 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() { - createOrUpdateAnAzureMonitorWorkspace(); -} - -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 dd4c63df7d6c..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 Deletes an Azure Monitor Workspace - * - * @summary Deletes an Azure Monitor Workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesDelete.json - */ -async function deleteAnAzureMonitorWorkspace() { - 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.beginDeleteAndWait( - resourceGroupName, - azureMonitorWorkspaceName, - ); - console.log(result); -} - -async function main() { - deleteAnAzureMonitorWorkspace(); -} - -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 8683e000b218..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 specified Azure Monitor Workspace - * - * @summary Returns the specified Azure Monitor Workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesGet.json - */ -async function getAzureMonitorWorkspace() { - 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() { - getAzureMonitorWorkspace(); -} - -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 ec3b1854ce02..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 Azure Monitor Workspaces in the specified resource group - * - * @summary Lists all Azure Monitor Workspaces in the specified resource group - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesListByResourceGroup.json - */ -async function listAzureMonitorWorkspacesByResourceGroup() { - 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() { - listAzureMonitorWorkspacesByResourceGroup(); -} - -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 e9aabd7e0a69..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 Azure Monitor Workspaces in the specified subscription - * - * @summary Lists all Azure Monitor Workspaces in the specified subscription - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesListBySubscription.json - */ -async function listAzureMonitorWorkspacesBySubscription() { - 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() { - listAzureMonitorWorkspacesBySubscription(); -} - -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 ffe2deba98d0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesUpdateSample.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 part of an Azure Monitor Workspace - * - * @summary Updates part of an Azure Monitor Workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesUpdate.json - */ -async function updateAnAzureMonitorWorkspace() { - 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() { - updateAnAzureMonitorWorkspace(); -} - -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 7dbac1894478..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/baselinesListSample.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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 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); - 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/createNotificationsAtTenantActionGroupResourceLevelSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/createNotificationsAtTenantActionGroupResourceLevelSample.js deleted file mode 100644 index e99d62fb4cd2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/createNotificationsAtTenantActionGroupResourceLevelSample.js +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code 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/preview/2023-05-01-preview/examples/postTestNotificationsAtTenantActionGroupResourceLevel.json - */ -async function createNotificationsAtTenantActionGroupLevel() { - const managementGroupId = "11111111-1111-1111-1111-111111111111"; - const tenantActionGroupName = "testTenantActionGroup"; - const xMsClientTenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const notificationRequest = { - alertType: "servicehealth", - azureAppPushReceivers: [{ name: "Sample azureAppPush", emailAddress: "johndoe@email.com" }], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false, - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true, - }, - ], - 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); - const result = await client.beginCreateNotificationsAtTenantActionGroupResourceLevelAndWait( - managementGroupId, - tenantActionGroupName, - xMsClientTenantId, - notificationRequest, - ); - console.log(result); -} - -async function main() { - createNotificationsAtTenantActionGroupLevel(); -} - -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 73a6a0db7324..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/stable/2022-06-01/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 e7bbbbbf5dec..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/stable/2022-06-01/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 207d87c5cd89..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/stable/2022-06-01/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 55d074567239..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/stable/2022-06-01/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 f0dc4d4e15d9..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/stable/2022-06-01/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 5f5cd8be8a3c..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/stable/2022-06-01/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 927e3acedb8c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsCreateSample.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 Creates or updates an association. - * - * @summary Creates or updates an association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRuleAssociationsCreate.json - */ -async function createOrUpdateAssociation() { - 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); - 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 345e3e9bb462..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsDeleteSample.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 an association. - * - * @summary Deletes an association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRuleAssociationsDelete.json - */ -async function deleteAssociation() { - 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); - 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 79a587893252..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsGetSample.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 Returns the specified association. - * - * @summary Returns the specified association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRuleAssociationsGet.json - */ -async function getAssociation() { - 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); - 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 d0c68337bb1b..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/stable/2022-06-01/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 f5427090fb1c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByResourceSample.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 associations for the specified resource. - * - * @summary Lists associations for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRuleAssociationsListByResource.json - */ -async function listAssociationsForSpecifiedResource() { - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - 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 560fc8657123..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/stable/2022-06-01/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 3559cca666db..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/stable/2022-06-01/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 3043400178de..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/stable/2022-06-01/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 96f83ff8328f..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/stable/2022-06-01/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 b8d4295fc008..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/stable/2022-06-01/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 ead72d221a06..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/stable/2022-06-01/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 2caad22b25a2..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/stable/2022-06-01/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 52da3029a81a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCategoryGetSample.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 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 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); - 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 ecbcc5204041..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCategoryListSample.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 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 resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - 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 e618542a2348..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCreateOrUpdateSample.js +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code 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 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); - 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 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); - 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 c6b2fda4e8cc..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsDeleteSample.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 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 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); - 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 8b705f78b567..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsGetSample.js +++ /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. -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 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); - 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 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); - 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 2d1ba971a6c1..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsListSample.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 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 resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - 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 resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - 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 49ffa2422a44..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/eventCategoriesListSample.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 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 credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - 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/getTestNotificationsAtTenantActionGroupResourceLevelSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/getTestNotificationsAtTenantActionGroupResourceLevelSample.js deleted file mode 100644 index 2751aac4d9e1..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/getTestNotificationsAtTenantActionGroupResourceLevelSample.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/preview/2023-05-01-preview/examples/getTestNotificationsAtTenantActionGroupResourceLevel.json - */ -async function getNotificationDetailsAtTenantActionGroupLevel() { - const managementGroupId = "11111111-1111-1111-1111-111111111111"; - const tenantActionGroupName = "testTenantActionGroup"; - const xMsClientTenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const notificationId = "11000222191287"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const result = await client.getTestNotificationsAtTenantActionGroupResourceLevel( - managementGroupId, - tenantActionGroupName, - xMsClientTenantId, - notificationId, - ); - console.log(result); -} - -async function main() { - getNotificationDetailsAtTenantActionGroupLevel(); -} - -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 7997ebbc287c..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/metricDefinitionsListAtSubscriptionScopeSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricDefinitionsListAtSubscriptionScopeSample.js deleted file mode 100644 index 56979aedccab..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricDefinitionsListAtSubscriptionScopeSample.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 the metric definitions for the subscription. - * - * @summary Lists the metric definitions for the subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMultiResourceMetricDefinitions.json - */ -async function getSubscriptionLevelMetricDefinitionsWithoutFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "92d2a2d8-b514-432d-8cc9-a5f9272630d5"; - const region = "westus2"; - const metricnamespace = "microsoft.compute/virtualmachines"; - const options = { - metricnamespace, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.listAtSubscriptionScope(region, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getSubscriptionLevelMetricDefinitionsWithoutFilter(); -} - -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 7426fe654e46..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricDefinitionsListSample.js +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code 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/2024-02-01/examples/GetMetricDefinitionsApplicationInsights.json - */ -async function getApplicationInsightsMetricDefinitionsWithoutFilter() { - 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); - 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/2024-02-01/examples/GetMetricDefinitions.json - */ -async function getMetricDefinitionsWithoutFilter() { - 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); - 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/2024-02-01/examples/GetMetricDefinitionsMetricClass.json - */ -async function getStorageCacheMetricDefinitionsWithMetricClass() { - 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); - 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 cf9bf35e8c22..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricNamespacesListSample.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 metric namespaces for the resource. - * - * @summary Lists the metric namespaces for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMetricNamespaces.json - */ -async function getMetricNamespacesWithoutFilter() { - 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); - 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/metricsListAtSubscriptionScopePostSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricsListAtSubscriptionScopePostSample.js deleted file mode 100644 index b4f5ac23c7c7..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricsListAtSubscriptionScopePostSample.js +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code 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 data for a subscription**. Parameters can be specified on either query params or the body. - * - * @summary **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMultiResourceMetric.json - */ -async function postRequestForSubscriptionLevelMetricData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "92d2a2d8-b514-432d-8cc9-a5f9272630d5"; - const region = "westus2"; - const timespan = "2021-06-08T19:00:00Z/2021-06-12T01:00:00Z"; - const interval = "PT6H"; - const metricnames = "Data Disk Max Burst IOPS"; - const aggregation = "count"; - const top = 10; - const orderby = "count desc"; - const filter = "LUN eq '0' and Microsoft.ResourceId eq '*'"; - const metricnamespace = "microsoft.compute/virtualmachines"; - const autoAdjustTimegrain = true; - const validateDimensions = false; - const options = { - timespan, - interval, - metricnames, - aggregation, - top, - orderby, - filter, - metricnamespace, - autoAdjustTimegrain, - validateDimensions, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.listAtSubscriptionScopePost(region, options); - console.log(result); -} - -/** - * This sample demonstrates how to **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. - * - * @summary **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/PostMultiResourceMetricBody.json - */ -async function postRequestForSubscriptionLevelMetricDataUsingBodyParams() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "92d2a2d8-b514-432d-8cc9-a5f9272630d5"; - const region = "westus2"; - const body = { - aggregation: "count", - autoAdjustTimegrain: true, - filter: "LUN eq '0' and Microsoft.ResourceId eq '*'", - interval: "PT6H", - metricNames: "Data Disk Max Burst IOPS", - metricNamespace: "microsoft.compute/virtualmachines", - orderBy: "count desc", - rollUpBy: "LUN", - timespan: "2021-06-08T19:00:00Z/2021-06-12T01:00:00Z", - top: 10, - validateDimensions: false, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.listAtSubscriptionScopePost(region, options); - console.log(result); -} - -/** - * This sample demonstrates how to **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. - * - * @summary **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMultiResourceMetricMetadata.json - */ -async function postRequestForSubscriptionLevelMetricMetadata() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "92d2a2d8-b514-432d-8cc9-a5f9272630d5"; - const region = "westus2"; - const timespan = "2021-06-10T02:23:16.129Z/2021-06-12T02:23:16.129Z"; - const metricnames = "Data Disk Max Burst IOPS"; - const filter = "LUN eq '0'"; - const metricnamespace = "microsoft.compute/virtualmachines"; - const options = { - timespan, - metricnames, - filter, - metricnamespace, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.listAtSubscriptionScopePost(region, options); - console.log(result); -} - -async function main() { - postRequestForSubscriptionLevelMetricData(); - postRequestForSubscriptionLevelMetricDataUsingBodyParams(); - postRequestForSubscriptionLevelMetricMetadata(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricsListAtSubscriptionScopeSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricsListAtSubscriptionScopeSample.js deleted file mode 100644 index 8b749a9ed6f3..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricsListAtSubscriptionScopeSample.js +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code 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 data for a subscription**. - * - * @summary **Lists the metric data for a subscription**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMultiResourceMetric.json - */ -async function getSubscriptionLevelMetricData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "92d2a2d8-b514-432d-8cc9-a5f9272630d5"; - const region = "westus2"; - const timespan = "2021-06-08T19:00:00Z/2021-06-12T01:00:00Z"; - const interval = "PT6H"; - const metricnames = "Data Disk Max Burst IOPS"; - const aggregation = "count"; - const top = 10; - const orderby = "count desc"; - const filter = "LUN eq '0' and Microsoft.ResourceId eq '*'"; - const metricnamespace = "microsoft.compute/virtualmachines"; - const autoAdjustTimegrain = true; - const validateDimensions = false; - const options = { - timespan, - interval, - metricnames, - aggregation, - top, - orderby, - filter, - metricnamespace, - autoAdjustTimegrain, - validateDimensions, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.listAtSubscriptionScope(region, options); - console.log(result); -} - -/** - * This sample demonstrates how to **Lists the metric data for a subscription**. - * - * @summary **Lists the metric data for a subscription**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMultiResourceMetricMetadata.json - */ -async function getSubscriptionLevelMetricMetadata() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "92d2a2d8-b514-432d-8cc9-a5f9272630d5"; - const region = "westus2"; - const timespan = "2021-06-10T02:23:16.129Z/2021-06-12T02:23:16.129Z"; - const metricnames = "Data Disk Max Burst IOPS"; - const filter = "LUN eq '0'"; - const metricnamespace = "microsoft.compute/virtualmachines"; - const options = { - timespan, - metricnames, - filter, - metricnamespace, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.listAtSubscriptionScope(region, options); - console.log(result); -} - -async function main() { - getSubscriptionLevelMetricData(); - getSubscriptionLevelMetricMetadata(); -} - -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 6b78c601f453..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricsListSample.js +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code 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/2024-02-01/examples/GetMetric.json - */ -async function getMetricForData() { - const resourceUri = - "subscriptions/1f3fa6d2-851c-4a91-9087-1a050f3a9c38/resourceGroups/todking/providers/Microsoft.Storage/storageAccounts/tkfileserv/blobServices/default"; - const timespan = "2021-04-20T09:00:00.000Z/2021-04-20T14:00:00.000Z"; - const interval = "PT6H"; - const metricnames = "BlobCount,BlobCapacity"; - const aggregation = "average,minimum,maximum"; - const top = 5; - const orderby = "average asc"; - const filter = "Tier eq '*'"; - const metricnamespace = "Microsoft.Storage/storageAccounts/blobServices"; - const autoAdjustTimegrain = true; - const validateDimensions = false; - const options = { - timespan, - interval, - metricnames, - aggregation, - top, - orderby, - filter, - metricnamespace, - autoAdjustTimegrain, - validateDimensions, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - 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/2024-02-01/examples/GetMetricMetadata.json - */ -async function getMetricForMetadata() { - const resourceUri = - "subscriptions/1f3fa6d2-851c-4a91-9087-1a050f3a9c38/resourceGroups/todking/providers/Microsoft.Storage/storageAccounts/tkfileserv/blobServices/default"; - const timespan = "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z"; - const filter = "Tier eq '*'"; - const metricnamespace = "Microsoft.Storage/storageAccounts/blobServices"; - const options = { - timespan, - filter, - metricnamespace, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - 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/2024-02-01/examples/GetMetricError.json - */ -async function getMetricWithError() { - 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 autoAdjustTimegrain = true; - const validateDimensions = false; - const options = { - timespan, - interval, - metricnames, - aggregation, - metricnamespace, - autoAdjustTimegrain, - validateDimensions, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - 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 f4b64b8da330..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/monitorOperationsListSample.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 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/stable/2023-04-03/examples/OperationsGet.json - */ -async function getOperationsList() { - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - 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 451ba61175e4..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": ">=18.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": "^4.2.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 f399f6c755f2..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 627960f0372d..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 b780ae5aa30c..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 19ce5f87079c..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 c17d142804a1..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 069dafc10c1c..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 fcc06c1a237e..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 3ea42f1e4034..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 491ed9277685..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 953cd8e27cc1..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 751b570ee2a9..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 bf58d53655e2..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 2786f96fedf5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesCreateOrUpdateSample.js +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code 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/stable/2023-12-01/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", - ], - actionProperties: { - icmTitle: "Custom title in ICM", - icmTsgId: "https://tsg.url", - }, - 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/stable/2023-12-01/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", - ], - actionProperties: { - icmTitle: "Custom title in ICM", - icmTsgId: "https://tsg.url", - }, - 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/stable/2023-12-01/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", - ], - actionProperties: { - icmTitle: "Custom title in ICM", - icmTsgId: "https://tsg.url", - }, - 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 3427024c3bc5..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/stable/2023-12-01/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 4c5069ebccf8..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/stable/2023-12-01/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 e73b2876a9bf..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/stable/2023-12-01/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 86a2f57d90b4..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/stable/2023-12-01/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 2d5071e911f2..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/stable/2023-12-01/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/tenantActionGroupsCreateOrUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActionGroupsCreateOrUpdateSample.js deleted file mode 100644 index 55b6110929de..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActionGroupsCreateOrUpdateSample.js +++ /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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create a new tenant action group or update an existing one. - * - * @summary Create a new tenant action group or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/createOrUpdateTenantActionGroup.json - */ -async function createOrUpdateATenantActionGroup() { - const managementGroupId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const tenantActionGroupName = "testTenantActionGroup"; - const xMsClientTenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const actionGroup = { - azureAppPushReceivers: [{ name: "Sample azureAppPush", emailAddress: "johndoe@email.com" }], - 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, - groupShortName: "sample", - location: "Global", - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "2062022299", - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321", - }, - ], - tags: {}, - voiceReceivers: [{ name: "Sample voice", countryCode: "1", phoneNumber: "2062022299" }], - 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); - const result = await client.tenantActionGroups.createOrUpdate( - managementGroupId, - tenantActionGroupName, - xMsClientTenantId, - actionGroup, - ); - console.log(result); -} - -async function main() { - createOrUpdateATenantActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActionGroupsDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActionGroupsDeleteSample.js deleted file mode 100644 index fa252cf0af0c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActionGroupsDeleteSample.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 tenant action group. - * - * @summary Delete a tenant action group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/deleteTenantActionGroup.json - */ -async function deleteATenantActionGroup() { - const managementGroupId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const tenantActionGroupName = "testTenantActionGroup"; - const xMsClientTenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const result = await client.tenantActionGroups.delete( - managementGroupId, - tenantActionGroupName, - xMsClientTenantId, - ); - console.log(result); -} - -async function main() { - deleteATenantActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActionGroupsGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActionGroupsGetSample.js deleted file mode 100644 index 027d8eec732c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActionGroupsGetSample.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 a tenant action group. - * - * @summary Get a tenant action group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/getTenantActionGroup.json - */ -async function getAnActionGroup() { - const managementGroupId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const tenantActionGroupName = "testTenantActionGroup"; - const xMsClientTenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const result = await client.tenantActionGroups.get( - managementGroupId, - tenantActionGroupName, - xMsClientTenantId, - ); - console.log(result); -} - -async function main() { - getAnActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActionGroupsListByManagementGroupIdSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActionGroupsListByManagementGroupIdSample.js deleted file mode 100644 index c2cba70d6032..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActionGroupsListByManagementGroupIdSample.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a list of all tenant action groups in a management group. - * - * @summary Get a list of all tenant action groups in a management group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/listTenantActionGroups.json - */ -async function listTenantActionGroupsAtManagementGroupLevel() { - const managementGroupId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const xMsClientTenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const resArray = new Array(); - for await (let item of client.tenantActionGroups.listByManagementGroupId( - managementGroupId, - xMsClientTenantId, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listTenantActionGroupsAtManagementGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActionGroupsUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActionGroupsUpdateSample.js deleted file mode 100644 index 8e487623e6a9..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActionGroupsUpdateSample.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 tenant action group's tags. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing tenant action group's tags. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/patchTenantActionGroup.json - */ -async function patchATenantActionGroup() { - const managementGroupId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const tenantActionGroupName = "testTenantActionGroup"; - const xMsClientTenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const tenantActionGroupPatch = { - enabled: false, - tags: { key1: "value1", key2: "value2" }, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const result = await client.tenantActionGroups.update( - managementGroupId, - tenantActionGroupName, - xMsClientTenantId, - tenantActionGroupPatch, - ); - console.log(result); -} - -async function main() { - patchATenantActionGroup(); -} - -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 b64adaa416d2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActivityLogsListSample.js +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code 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 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); - 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 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); - 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 select = - "eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level"; - const options = { select }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - 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 credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - 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 9e1bcae63920..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/vmInsightsGetOnboardingStatusSample.js +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code 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 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); - 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 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); - 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 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); - 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 resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/resource-group-with-vms"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - 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 resourceUri = "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - 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 8015345fec98..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/README.md +++ /dev/null @@ -1,293 +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/2023-01-01/examples/postTestNotificationsAtActionGroupResourceLevel.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/2023-01-01/examples/createOrUpdateActionGroup.json | -| [actionGroupsDeleteSample.ts][actiongroupsdeletesample] | Delete an action group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-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/2023-01-01/examples/enableReceiver.json | -| [actionGroupsGetSample.ts][actiongroupsgetsample] | Get an action group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-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/2023-01-01/examples/getTestNotificationsAtActionGroupResourceLevel.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/2023-01-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/2023-01-01/examples/listActionGroups.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/2023-01-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] | Creates or updates an Azure Monitor Workspace x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesCreate.json | -| [azureMonitorWorkspacesDeleteSample.ts][azuremonitorworkspacesdeletesample] | Deletes an Azure Monitor Workspace x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesDelete.json | -| [azureMonitorWorkspacesGetSample.ts][azuremonitorworkspacesgetsample] | Returns the specified Azure Monitor Workspace x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesGet.json | -| [azureMonitorWorkspacesListByResourceGroupSample.ts][azuremonitorworkspaceslistbyresourcegroupsample] | Lists all Azure Monitor Workspaces in the specified resource group x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesListByResourceGroup.json | -| [azureMonitorWorkspacesListBySubscriptionSample.ts][azuremonitorworkspaceslistbysubscriptionsample] | Lists all Azure Monitor Workspaces in the specified subscription x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesListBySubscription.json | -| [azureMonitorWorkspacesUpdateSample.ts][azuremonitorworkspacesupdatesample] | Updates part of an Azure Monitor Workspace x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/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 | -| [createNotificationsAtTenantActionGroupResourceLevelSample.ts][createnotificationsattenantactiongroupresourcelevelsample] | Send test notifications to a set of provided receivers x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/postTestNotificationsAtTenantActionGroupResourceLevel.json | -| [dataCollectionEndpointsCreateSample.ts][datacollectionendpointscreatesample] | Creates or updates a data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionEndpointsCreate.json | -| [dataCollectionEndpointsDeleteSample.ts][datacollectionendpointsdeletesample] | Deletes a data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionEndpointsDelete.json | -| [dataCollectionEndpointsGetSample.ts][datacollectionendpointsgetsample] | Returns the specified data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/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/stable/2022-06-01/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/stable/2022-06-01/examples/DataCollectionEndpointsListBySubscription.json | -| [dataCollectionEndpointsUpdateSample.ts][datacollectionendpointsupdatesample] | Updates part of a data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionEndpointsUpdate.json | -| [dataCollectionRuleAssociationsCreateSample.ts][datacollectionruleassociationscreatesample] | Creates or updates an association. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRuleAssociationsCreate.json | -| [dataCollectionRuleAssociationsDeleteSample.ts][datacollectionruleassociationsdeletesample] | Deletes an association. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRuleAssociationsDelete.json | -| [dataCollectionRuleAssociationsGetSample.ts][datacollectionruleassociationsgetsample] | Returns the specified association. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRuleAssociationsGet.json | -| [dataCollectionRuleAssociationsListByDataCollectionEndpointSample.ts][datacollectionruleassociationslistbydatacollectionendpointsample] | Lists associations for the specified data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRuleAssociationsListByDataCollectionEndpoint.json | -| [dataCollectionRuleAssociationsListByResourceSample.ts][datacollectionruleassociationslistbyresourcesample] | Lists associations for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRuleAssociationsListByResource.json | -| [dataCollectionRuleAssociationsListByRuleSample.ts][datacollectionruleassociationslistbyrulesample] | Lists associations for the specified data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRuleAssociationsListByRule.json | -| [dataCollectionRulesCreateSample.ts][datacollectionrulescreatesample] | Creates or updates a data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRulesCreate.json | -| [dataCollectionRulesDeleteSample.ts][datacollectionrulesdeletesample] | Deletes a data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRulesDelete.json | -| [dataCollectionRulesGetSample.ts][datacollectionrulesgetsample] | Returns the specified data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/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/stable/2022-06-01/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/stable/2022-06-01/examples/DataCollectionRulesListBySubscription.json | -| [dataCollectionRulesUpdateSample.ts][datacollectionrulesupdatesample] | Updates part of a data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/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 | -| [getTestNotificationsAtTenantActionGroupResourceLevelSample.ts][gettestnotificationsattenantactiongroupresourcelevelsample] | Get the test notifications by the notification id x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/getTestNotificationsAtTenantActionGroupResourceLevel.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 | -| [metricDefinitionsListAtSubscriptionScopeSample.ts][metricdefinitionslistatsubscriptionscopesample] | Lists the metric definitions for the subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMultiResourceMetricDefinitions.json | -| [metricDefinitionsListSample.ts][metricdefinitionslistsample] | Lists the metric definitions for the resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMetricDefinitionsApplicationInsights.json | -| [metricNamespacesListSample.ts][metricnamespaceslistsample] | Lists the metric namespaces for the resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMetricNamespaces.json | -| [metricsListAtSubscriptionScopePostSample.ts][metricslistatsubscriptionscopepostsample] | **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMultiResourceMetric.json | -| [metricsListAtSubscriptionScopeSample.ts][metricslistatsubscriptionscopesample] | **Lists the metric data for a subscription**. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMultiResourceMetric.json | -| [metricsListSample.ts][metricslistsample] | **Lists the metric values for a resource**. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMetric.json | -| [monitorOperationsListSample.ts][monitoroperationslistsample] | Lists available Operations for this Resource Provider x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/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/stable/2023-12-01/examples/createOrUpdateScheduledQueryRule.json | -| [scheduledQueryRulesDeleteSample.ts][scheduledqueryrulesdeletesample] | Deletes a scheduled query rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2023-12-01/examples/deleteScheduledQueryRule.json | -| [scheduledQueryRulesGetSample.ts][scheduledqueryrulesgetsample] | Retrieve an scheduled query rule definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2023-12-01/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/stable/2023-12-01/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/stable/2023-12-01/examples/listScheduledQueryRulesBySubscription.json | -| [scheduledQueryRulesUpdateSample.ts][scheduledqueryrulesupdatesample] | Update a scheduled query rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2023-12-01/examples/patchScheduledQueryRule.json | -| [tenantActionGroupsCreateOrUpdateSample.ts][tenantactiongroupscreateorupdatesample] | Create a new tenant action group or update an existing one. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/createOrUpdateTenantActionGroup.json | -| [tenantActionGroupsDeleteSample.ts][tenantactiongroupsdeletesample] | Delete a tenant action group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/deleteTenantActionGroup.json | -| [tenantActionGroupsGetSample.ts][tenantactiongroupsgetsample] | Get a tenant action group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/getTenantActionGroup.json | -| [tenantActionGroupsListByManagementGroupIdSample.ts][tenantactiongroupslistbymanagementgroupidsample] | Get a list of all tenant action groups in a management group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/listTenantActionGroups.json | -| [tenantActionGroupsUpdateSample.ts][tenantactiongroupsupdatesample] | Updates an existing tenant action group's tags. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/patchTenantActionGroup.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 dev-tool run vendored 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 -[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 -[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 -[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 -[createnotificationsattenantactiongroupresourcelevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/createNotificationsAtTenantActionGroupResourceLevelSample.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 -[gettestnotificationsattenantactiongroupresourcelevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/getTestNotificationsAtTenantActionGroupResourceLevelSample.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 -[metricdefinitionslistatsubscriptionscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricDefinitionsListAtSubscriptionScopeSample.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 -[metricslistatsubscriptionscopepostsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricsListAtSubscriptionScopePostSample.ts -[metricslistatsubscriptionscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricsListAtSubscriptionScopeSample.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 -[tenantactiongroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActionGroupsCreateOrUpdateSample.ts -[tenantactiongroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActionGroupsDeleteSample.ts -[tenantactiongroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActionGroupsGetSample.ts -[tenantactiongroupslistbymanagementgroupidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActionGroupsListByManagementGroupIdSample.ts -[tenantactiongroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActionGroupsUpdateSample.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://learn.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 da19f1fed971..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": ">=18.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": "^4.2.1" - }, - "devDependencies": { - "@types/node": "^18.0.0", - "typescript": "~5.7.2", - "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 8e3547d88ac2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.ts +++ /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. -import { NotificationRequestBody, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2023-01-01/examples/postTestNotificationsAtActionGroupResourceLevel.json - */ -async function createNotificationsAtResourceGroupLevel(): Promise { - 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(): Promise { - 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 fe14746bea1e..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateOrUpdateSample.ts +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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 "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/2023-01-01/examples/createOrUpdateActionGroup.json - */ -async function createOrUpdateAnActionGroup(): Promise { - 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(): Promise { - 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 7dbb785c844d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsDeleteSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2023-01-01/examples/deleteActionGroup.json - */ -async function deleteAnActionGroup(): Promise { - 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(): Promise { - 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 1fdea453f5d5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsEnableReceiverSample.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 { EnableRequest, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2023-01-01/examples/enableReceiver.json - */ -async function enableTheReceiver(): Promise { - 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(): Promise { - 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 6f005367bb3a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2023-01-01/examples/getActionGroup.json - */ -async function getAnActionGroup(): Promise { - 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(): Promise { - 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 073b0d9a5f7f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.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 "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/2023-01-01/examples/getTestNotificationsAtActionGroupResourceLevel.json - */ -async function getNotificationDetailsAtResourceGroupLevel(): Promise { - 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(): Promise { - getNotificationDetailsAtResourceGroupLevel(); -} - -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 376276a26fff..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsListByResourceGroupSample.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 "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/2023-01-01/examples/listActionGroups.json - */ -async function listActionGroupsAtResourceGroupLevel(): Promise { - 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(): Promise { - 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 62a12ffeccae..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsListBySubscriptionIdSample.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 "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/2023-01-01/examples/listActionGroups.json - */ -async function listActionGroupsAtSubscriptionLevel(): Promise { - 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(): Promise { - listActionGroupsAtSubscriptionLevel(); -} - -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 af3d6ba2e4e2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsUpdateSample.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 { ActionGroupPatchBody, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2023-01-01/examples/patchActionGroup.json - */ -async function patchAnActionGroup(): Promise { - 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(): Promise { - 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 d155cf31ae1b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsCreateOrUpdateSample.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 { ActivityLogAlertResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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(): Promise { - 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(): Promise { - 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 bfb62ad8d203..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsDeleteSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 e922fbc30767..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsGetSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 137db023079f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsListByResourceGroupSample.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 "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(): Promise { - 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(): Promise { - 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 158e6db65ae5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsListBySubscriptionIdSample.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 "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(): Promise { - 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(): Promise { - 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 b8cd487ab27e..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsUpdateSample.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 { AlertRulePatchObject, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 e45d397688a6..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogsListSample.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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 "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(): Promise { - 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(): Promise { - 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(): Promise { - 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 3587fc4b5015..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRuleIncidentsGetSample.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 "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(): Promise { - 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(): Promise { - 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 d77742bce014..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRuleIncidentsListByAlertRuleSample.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 "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(): Promise { - 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(): Promise { - 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 ba8859164264..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesCreateOrUpdateSample.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AlertRuleResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 2b8d3401c709..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesDeleteSample.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 "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(): Promise { - 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(): Promise { - 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 2bb50cb603e2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesGetSample.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 "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(): Promise { - 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(): Promise { - 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 e86a4ec69747..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesListByResourceGroupSample.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 "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(): Promise { - 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(): Promise { - 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 a717337d69ab..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesListBySubscriptionSample.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 "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(): Promise { - 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(): Promise { - 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 85b920deadba..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesUpdateSample.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 { AlertRuleResourcePatch, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 1fb52383de21..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsCreateOrUpdateSample.ts +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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 "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(): Promise { - 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(): Promise { - 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 23d0a576e43f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsDeleteSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 fd7adf0c0c7d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsGetSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 76c8eb470c5e..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsListByResourceGroupSample.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 "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(): Promise { - 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(): Promise { - 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 9d0eb5dd0934..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsListBySubscriptionSample.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 "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(): Promise { - 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(): Promise { - 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 7bf77c9cf382..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsUpdateSample.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 { - AutoscaleSettingResourcePatch, - MonitorClient, -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 299e453fb183..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesCreateSample.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 { - AzureMonitorWorkspaceResource, - MonitorClient, -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Creates or updates an Azure Monitor Workspace - * - * @summary Creates or updates an Azure Monitor Workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesCreate.json - */ -async function createOrUpdateAnAzureMonitorWorkspace(): Promise { - 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(): Promise { - createOrUpdateAnAzureMonitorWorkspace(); -} - -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 46a9082736d6..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesDeleteSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes an Azure Monitor Workspace - * - * @summary Deletes an Azure Monitor Workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesDelete.json - */ -async function deleteAnAzureMonitorWorkspace(): Promise { - 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.beginDeleteAndWait( - resourceGroupName, - azureMonitorWorkspaceName, - ); - console.log(result); -} - -async function main(): Promise { - deleteAnAzureMonitorWorkspace(); -} - -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 d5e2fa86ca46..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesGetSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Returns the specified Azure Monitor Workspace - * - * @summary Returns the specified Azure Monitor Workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesGet.json - */ -async function getAzureMonitorWorkspace(): Promise { - 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(): Promise { - getAzureMonitorWorkspace(); -} - -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 c6f203805c79..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesListByResourceGroupSample.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 "dotenv/config"; - -/** - * This sample demonstrates how to Lists all Azure Monitor Workspaces in the specified resource group - * - * @summary Lists all Azure Monitor Workspaces in the specified resource group - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesListByResourceGroup.json - */ -async function listAzureMonitorWorkspacesByResourceGroup(): Promise { - 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(): Promise { - listAzureMonitorWorkspacesByResourceGroup(); -} - -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 45abd5d7c680..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesListBySubscriptionSample.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 "dotenv/config"; - -/** - * This sample demonstrates how to Lists all Azure Monitor Workspaces in the specified subscription - * - * @summary Lists all Azure Monitor Workspaces in the specified subscription - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesListBySubscription.json - */ -async function listAzureMonitorWorkspacesBySubscription(): Promise { - 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(): Promise { - listAzureMonitorWorkspacesBySubscription(); -} - -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 6cd8fdccf73f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesUpdateSample.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 { - AzureMonitorWorkspaceResourceForUpdate, - AzureMonitorWorkspacesUpdateOptionalParams, - MonitorClient, -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Updates part of an Azure Monitor Workspace - * - * @summary Updates part of an Azure Monitor Workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesUpdate.json - */ -async function updateAnAzureMonitorWorkspace(): Promise { - 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(): Promise { - updateAnAzureMonitorWorkspace(); -} - -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 1c3846cb5e92..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/baselinesListSample.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 { BaselinesListOptionalParams, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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); - const resArray = new Array(); - for await (let item of client.baselines.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - getMetricBaselines(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/createNotificationsAtTenantActionGroupResourceLevelSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/createNotificationsAtTenantActionGroupResourceLevelSample.ts deleted file mode 100644 index 904a9d3d6e1f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/createNotificationsAtTenantActionGroupResourceLevelSample.ts +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - TenantNotificationRequestBody, - MonitorClient, -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/preview/2023-05-01-preview/examples/postTestNotificationsAtTenantActionGroupResourceLevel.json - */ -async function createNotificationsAtTenantActionGroupLevel(): Promise { - const managementGroupId = "11111111-1111-1111-1111-111111111111"; - const tenantActionGroupName = "testTenantActionGroup"; - const xMsClientTenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const notificationRequest: TenantNotificationRequestBody = { - alertType: "servicehealth", - azureAppPushReceivers: [ - { name: "Sample azureAppPush", emailAddress: "johndoe@email.com" }, - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false, - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true, - }, - ], - 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); - const result = - await client.beginCreateNotificationsAtTenantActionGroupResourceLevelAndWait( - managementGroupId, - tenantActionGroupName, - xMsClientTenantId, - notificationRequest, - ); - console.log(result); -} - -async function main(): Promise { - createNotificationsAtTenantActionGroupLevel(); -} - -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 4b6418c687d7..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsCreateSample.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 { - DataCollectionEndpointResource, - DataCollectionEndpointsCreateOptionalParams, - MonitorClient, -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2022-06-01/examples/DataCollectionEndpointsCreate.json - */ -async function createOrUpdateDataCollectionEndpoint(): Promise { - 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(): Promise { - 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 b868cee57725..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsDeleteSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2022-06-01/examples/DataCollectionEndpointsDelete.json - */ -async function deleteDataCollectionEndpoint(): Promise { - 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(): Promise { - 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 b9b3c3dee2ab..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsGetSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2022-06-01/examples/DataCollectionEndpointsGet.json - */ -async function getDataCollectionEndpoint(): Promise { - 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(): Promise { - 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 db75deb6a62c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsListByResourceGroupSample.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 "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/stable/2022-06-01/examples/DataCollectionEndpointsListByResourceGroup.json - */ -async function listDataCollectionEndpointsByResourceGroup(): Promise { - 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(): Promise { - 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 1e95fab0a362..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsListBySubscriptionSample.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 "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/stable/2022-06-01/examples/DataCollectionEndpointsListBySubscription.json - */ -async function listDataCollectionEndpointsBySubscription(): Promise { - 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(): Promise { - 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 d08664f0b093..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsUpdateSample.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 { - ResourceForUpdate, - DataCollectionEndpointsUpdateOptionalParams, - MonitorClient, -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2022-06-01/examples/DataCollectionEndpointsUpdate.json - */ -async function updateDataCollectionEndpoint(): Promise { - 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(): Promise { - 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 f05ea86940de..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsCreateSample.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 { - DataCollectionRuleAssociationProxyOnlyResource, - DataCollectionRuleAssociationsCreateOptionalParams, - MonitorClient, -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2022-06-01/examples/DataCollectionRuleAssociationsCreate.json - */ -async function createOrUpdateAssociation(): Promise { - 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); - const result = await client.dataCollectionRuleAssociations.create( - resourceUri, - associationName, - options, - ); - console.log(result); -} - -async function main(): Promise { - 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 2d12db3e60ac..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsDeleteSample.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 "dotenv/config"; - -/** - * This sample demonstrates how to Deletes an association. - * - * @summary Deletes an association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRuleAssociationsDelete.json - */ -async function deleteAssociation(): Promise { - 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); - const result = await client.dataCollectionRuleAssociations.delete( - resourceUri, - associationName, - ); - console.log(result); -} - -async function main(): Promise { - 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 f5c99f7245c4..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsGetSample.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 "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/stable/2022-06-01/examples/DataCollectionRuleAssociationsGet.json - */ -async function getAssociation(): Promise { - 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); - const result = await client.dataCollectionRuleAssociations.get( - resourceUri, - associationName, - ); - console.log(result); -} - -async function main(): Promise { - 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 d9ffaadf6bf5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.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 "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/stable/2022-06-01/examples/DataCollectionRuleAssociationsListByDataCollectionEndpoint.json - */ -async function listAssociationsForSpecifiedDataCollectionEndpoint(): Promise { - 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(): Promise { - 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 e983c58a884a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByResourceSample.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 "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/stable/2022-06-01/examples/DataCollectionRuleAssociationsListByResource.json - */ -async function listAssociationsForSpecifiedResource(): Promise { - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const resArray = new Array(); - for await (let item of client.dataCollectionRuleAssociations.listByResource( - resourceUri, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - 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 21db68ddf200..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByRuleSample.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 "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/stable/2022-06-01/examples/DataCollectionRuleAssociationsListByRule.json - */ -async function listAssociationsForSpecifiedDataCollectionRule(): Promise { - 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(): Promise { - 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 965048a3e8fc..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesCreateSample.ts +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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 "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/stable/2022-06-01/examples/DataCollectionRulesCreate.json - */ -async function createOrUpdateDataCollectionRule(): Promise { - 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(): Promise { - 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 8778fd4e83a1..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesDeleteSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2022-06-01/examples/DataCollectionRulesDelete.json - */ -async function deleteDataCollectionRule(): Promise { - 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(): Promise { - 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 1464f59bbcff..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesGetSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2022-06-01/examples/DataCollectionRulesGet.json - */ -async function getDataCollectionRule(): Promise { - 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(): Promise { - 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 c37f9a6e1766..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesListByResourceGroupSample.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 "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/stable/2022-06-01/examples/DataCollectionRulesListByResourceGroup.json - */ -async function listDataCollectionRulesByResourceGroup(): Promise { - 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(): Promise { - 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 9d7e81abca8e..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesListBySubscriptionSample.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 "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/stable/2022-06-01/examples/DataCollectionRulesListBySubscription.json - */ -async function listDataCollectionRulesBySubscription(): Promise { - 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(): Promise { - 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 4dd084718a52..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesUpdateSample.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 { - ResourceForUpdate, - DataCollectionRulesUpdateOptionalParams, - MonitorClient, -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2022-06-01/examples/DataCollectionRulesUpdate.json - */ -async function updateDataCollectionRule(): Promise { - 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(): Promise { - 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 70797a5cc2ed..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCategoryGetSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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); - const result = await client.diagnosticSettingsCategory.get(resourceUri, name); - console.log(result); -} - -async function main(): Promise { - 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 9c9a0cb42d9d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCategoryListSample.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 "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(): Promise { - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const resArray = new Array(); - for await (let item of client.diagnosticSettingsCategory.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - 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 9f81e11b394b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCreateOrUpdateSample.ts +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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 "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(): Promise { - 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); - 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(): Promise { - 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); - const result = await client.diagnosticSettings.createOrUpdate( - resourceUri, - name, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - 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 5de54684c10e..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsDeleteSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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); - const result = await client.diagnosticSettings.delete(resourceUri, name); - console.log(result); -} - -async function main(): Promise { - 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 d5773f6a158e..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsGetSample.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 "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(): Promise { - 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); - 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(): Promise { - 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); - const result = await client.diagnosticSettings.get(resourceUri, name); - console.log(result); -} - -async function main(): Promise { - 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 d3287bb78153..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsListSample.ts +++ /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. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - 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(): Promise { - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const resArray = new Array(); - for await (let item of client.diagnosticSettings.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - 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 899014030be8..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/eventCategoriesListSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const resArray = new Array(); - for await (let item of client.eventCategories.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - getEventCategories(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/getTestNotificationsAtTenantActionGroupResourceLevelSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/getTestNotificationsAtTenantActionGroupResourceLevelSample.ts deleted file mode 100644 index 690b850202b8..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/getTestNotificationsAtTenantActionGroupResourceLevelSample.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 "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/preview/2023-05-01-preview/examples/getTestNotificationsAtTenantActionGroupResourceLevel.json - */ -async function getNotificationDetailsAtTenantActionGroupLevel(): Promise { - const managementGroupId = "11111111-1111-1111-1111-111111111111"; - const tenantActionGroupName = "testTenantActionGroup"; - const xMsClientTenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const notificationId = "11000222191287"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const result = - await client.getTestNotificationsAtTenantActionGroupResourceLevel( - managementGroupId, - tenantActionGroupName, - xMsClientTenantId, - notificationId, - ); - console.log(result); -} - -async function main(): Promise { - getNotificationDetailsAtTenantActionGroupLevel(); -} - -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 369dd1db99bd..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesCreateOrUpdateSample.ts +++ /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. -import { LogProfileResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 45c6c878c935..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesDeleteSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 94559e4c1306..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesGetSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 7e34648f70be..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesListSample.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 "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(): Promise { - 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(): Promise { - 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 54b2fbc23b2a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesUpdateSample.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 { LogProfileResourcePatch, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 047ef86cd4b1..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsCreateOrUpdateSample.ts +++ /dev/null @@ -1,502 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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 "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(): Promise { - 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(): Promise { - 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(): Promise { - 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(): Promise { - 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(): Promise { - 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(): Promise { - 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(): Promise { - 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(): Promise { - 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(): Promise { - 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 976aa2d4e7db..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsDeleteSample.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 "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(): Promise { - 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(): Promise { - 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 ddd7e5b1e300..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsGetSample.ts +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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 "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(): Promise { - 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(): Promise { - 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(): Promise { - 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(): Promise { - 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(): Promise { - 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(): Promise { - 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(): Promise { - 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(): Promise { - 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 c4505b989be8..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsListByResourceGroupSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 65e084e21b8d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsListBySubscriptionSample.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 "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(): Promise { - 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(): Promise { - 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 b31432d3920a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsStatusListByNameSample.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 "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(): Promise { - 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(): Promise { - 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 b0149bb11604..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsStatusListSample.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 "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(): Promise { - 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(): Promise { - 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 3adb325d2b40..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsUpdateSample.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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 "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(): Promise { - 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(): Promise { - createOrUpdateAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricDefinitionsListAtSubscriptionScopeSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricDefinitionsListAtSubscriptionScopeSample.ts deleted file mode 100644 index 2fd221688c8a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricDefinitionsListAtSubscriptionScopeSample.ts +++ /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. -import { - MetricDefinitionsListAtSubscriptionScopeOptionalParams, - MonitorClient, -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Lists the metric definitions for the subscription. - * - * @summary Lists the metric definitions for the subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMultiResourceMetricDefinitions.json - */ -async function getSubscriptionLevelMetricDefinitionsWithoutFilter(): Promise { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "92d2a2d8-b514-432d-8cc9-a5f9272630d5"; - const region = "westus2"; - const metricnamespace = "microsoft.compute/virtualmachines"; - const options: MetricDefinitionsListAtSubscriptionScopeOptionalParams = { - metricnamespace, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.listAtSubscriptionScope( - region, - options, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - getSubscriptionLevelMetricDefinitionsWithoutFilter(); -} - -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 f81b34bb43cd..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricDefinitionsListSample.ts +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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 "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/2024-02-01/examples/GetMetricDefinitionsApplicationInsights.json - */ -async function getApplicationInsightsMetricDefinitionsWithoutFilter(): Promise { - 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); - 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/2024-02-01/examples/GetMetricDefinitions.json - */ -async function getMetricDefinitionsWithoutFilter(): Promise { - 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); - 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/2024-02-01/examples/GetMetricDefinitionsMetricClass.json - */ -async function getStorageCacheMetricDefinitionsWithMetricClass(): Promise { - 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); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - 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 83481b8a05ea..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricNamespacesListSample.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 { - MetricNamespacesListOptionalParams, - MonitorClient, -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2024-02-01/examples/GetMetricNamespaces.json - */ -async function getMetricNamespacesWithoutFilter(): Promise { - 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); - const resArray = new Array(); - for await (let item of client.metricNamespaces.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - getMetricNamespacesWithoutFilter(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricsListAtSubscriptionScopePostSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricsListAtSubscriptionScopePostSample.ts deleted file mode 100644 index 6fe80a5ed90f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricsListAtSubscriptionScopePostSample.ts +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - MetricsListAtSubscriptionScopePostOptionalParams, - SubscriptionScopeMetricsRequestBodyParameters, - MonitorClient, -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. - * - * @summary **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMultiResourceMetric.json - */ -async function postRequestForSubscriptionLevelMetricData(): Promise { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "92d2a2d8-b514-432d-8cc9-a5f9272630d5"; - const region = "westus2"; - const timespan = "2021-06-08T19:00:00Z/2021-06-12T01:00:00Z"; - const interval = "PT6H"; - const metricnames = "Data Disk Max Burst IOPS"; - const aggregation = "count"; - const top = 10; - const orderby = "count desc"; - const filter = "LUN eq '0' and Microsoft.ResourceId eq '*'"; - const metricnamespace = "microsoft.compute/virtualmachines"; - const autoAdjustTimegrain = true; - const validateDimensions = false; - const options: MetricsListAtSubscriptionScopePostOptionalParams = { - timespan, - interval, - metricnames, - aggregation, - top, - orderby, - filter, - metricnamespace, - autoAdjustTimegrain, - validateDimensions, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.listAtSubscriptionScopePost( - region, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. - * - * @summary **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/PostMultiResourceMetricBody.json - */ -async function postRequestForSubscriptionLevelMetricDataUsingBodyParams(): Promise { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "92d2a2d8-b514-432d-8cc9-a5f9272630d5"; - const region = "westus2"; - const body: SubscriptionScopeMetricsRequestBodyParameters = { - aggregation: "count", - autoAdjustTimegrain: true, - filter: "LUN eq '0' and Microsoft.ResourceId eq '*'", - interval: "PT6H", - metricNames: "Data Disk Max Burst IOPS", - metricNamespace: "microsoft.compute/virtualmachines", - orderBy: "count desc", - rollUpBy: "LUN", - timespan: "2021-06-08T19:00:00Z/2021-06-12T01:00:00Z", - top: 10, - validateDimensions: false, - }; - const options: MetricsListAtSubscriptionScopePostOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.listAtSubscriptionScopePost( - region, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. - * - * @summary **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMultiResourceMetricMetadata.json - */ -async function postRequestForSubscriptionLevelMetricMetadata(): Promise { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "92d2a2d8-b514-432d-8cc9-a5f9272630d5"; - const region = "westus2"; - const timespan = "2021-06-10T02:23:16.129Z/2021-06-12T02:23:16.129Z"; - const metricnames = "Data Disk Max Burst IOPS"; - const filter = "LUN eq '0'"; - const metricnamespace = "microsoft.compute/virtualmachines"; - const options: MetricsListAtSubscriptionScopePostOptionalParams = { - timespan, - metricnames, - filter, - metricnamespace, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.listAtSubscriptionScopePost( - region, - options, - ); - console.log(result); -} - -async function main(): Promise { - postRequestForSubscriptionLevelMetricData(); - postRequestForSubscriptionLevelMetricDataUsingBodyParams(); - postRequestForSubscriptionLevelMetricMetadata(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricsListAtSubscriptionScopeSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricsListAtSubscriptionScopeSample.ts deleted file mode 100644 index ece4906ce2e1..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricsListAtSubscriptionScopeSample.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 { - MetricsListAtSubscriptionScopeOptionalParams, - MonitorClient, -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to **Lists the metric data for a subscription**. - * - * @summary **Lists the metric data for a subscription**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMultiResourceMetric.json - */ -async function getSubscriptionLevelMetricData(): Promise { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "92d2a2d8-b514-432d-8cc9-a5f9272630d5"; - const region = "westus2"; - const timespan = "2021-06-08T19:00:00Z/2021-06-12T01:00:00Z"; - const interval = "PT6H"; - const metricnames = "Data Disk Max Burst IOPS"; - const aggregation = "count"; - const top = 10; - const orderby = "count desc"; - const filter = "LUN eq '0' and Microsoft.ResourceId eq '*'"; - const metricnamespace = "microsoft.compute/virtualmachines"; - const autoAdjustTimegrain = true; - const validateDimensions = false; - const options: MetricsListAtSubscriptionScopeOptionalParams = { - timespan, - interval, - metricnames, - aggregation, - top, - orderby, - filter, - metricnamespace, - autoAdjustTimegrain, - validateDimensions, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.listAtSubscriptionScope( - region, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to **Lists the metric data for a subscription**. - * - * @summary **Lists the metric data for a subscription**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/examples/GetMultiResourceMetricMetadata.json - */ -async function getSubscriptionLevelMetricMetadata(): Promise { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "92d2a2d8-b514-432d-8cc9-a5f9272630d5"; - const region = "westus2"; - const timespan = "2021-06-10T02:23:16.129Z/2021-06-12T02:23:16.129Z"; - const metricnames = "Data Disk Max Burst IOPS"; - const filter = "LUN eq '0'"; - const metricnamespace = "microsoft.compute/virtualmachines"; - const options: MetricsListAtSubscriptionScopeOptionalParams = { - timespan, - metricnames, - filter, - metricnamespace, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.listAtSubscriptionScope( - region, - options, - ); - console.log(result); -} - -async function main(): Promise { - getSubscriptionLevelMetricData(); - getSubscriptionLevelMetricMetadata(); -} - -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 d4631b3b41b9..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricsListSample.ts +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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 "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/2024-02-01/examples/GetMetric.json - */ -async function getMetricForData(): Promise { - const resourceUri = - "subscriptions/1f3fa6d2-851c-4a91-9087-1a050f3a9c38/resourceGroups/todking/providers/Microsoft.Storage/storageAccounts/tkfileserv/blobServices/default"; - const timespan = "2021-04-20T09:00:00.000Z/2021-04-20T14:00:00.000Z"; - const interval = "PT6H"; - const metricnames = "BlobCount,BlobCapacity"; - const aggregation = "average,minimum,maximum"; - const top = 5; - const orderby = "average asc"; - const filter = "Tier eq '*'"; - const metricnamespace = "Microsoft.Storage/storageAccounts/blobServices"; - const autoAdjustTimegrain = true; - const validateDimensions = false; - const options: MetricsListOptionalParams = { - timespan, - interval, - metricnames, - aggregation, - top, - orderby, - filter, - metricnamespace, - autoAdjustTimegrain, - validateDimensions, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - 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/2024-02-01/examples/GetMetricMetadata.json - */ -async function getMetricForMetadata(): Promise { - const resourceUri = - "subscriptions/1f3fa6d2-851c-4a91-9087-1a050f3a9c38/resourceGroups/todking/providers/Microsoft.Storage/storageAccounts/tkfileserv/blobServices/default"; - const timespan = "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z"; - const filter = "Tier eq '*'"; - const metricnamespace = "Microsoft.Storage/storageAccounts/blobServices"; - const options: MetricsListOptionalParams = { - timespan, - filter, - metricnamespace, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - 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/2024-02-01/examples/GetMetricError.json - */ -async function getMetricWithError(): Promise { - 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 autoAdjustTimegrain = true; - const validateDimensions = false; - const options: MetricsListOptionalParams = { - timespan, - interval, - metricnames, - aggregation, - metricnamespace, - autoAdjustTimegrain, - validateDimensions, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const result = await client.metricsOperations.list(resourceUri, options); - console.log(result); -} - -async function main(): Promise { - 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 995a66e5dcda..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/monitorOperationsListSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2023-04-03/examples/OperationsGet.json - */ -async function getOperationsList(): Promise { - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const resArray = new Array(); - for await (let item of client.monitorOperations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - 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 780b5a6c5825..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 30283cd054e3..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/predictiveMetricGetSample.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 { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 56e43f5c8ab8..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.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 { - PrivateEndpointConnectionAutoGenerated, - MonitorClient, -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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: PrivateEndpointConnectionAutoGenerated = { - 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(): Promise { - 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 a30ce9b1066c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsDeleteSample.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 "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(): Promise { - 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(): Promise { - 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 099a406fb2d8..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsGetSample.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 "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(): Promise { - 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(): Promise { - 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 9116c731843f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsListByPrivateLinkScopeSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 d012ad6d293a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkResourcesGetSample.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 "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(): Promise { - 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(): Promise { - 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 ab4ca9d604dd..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkResourcesListByPrivateLinkScopeSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 027084789fab..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopeOperationStatusGetSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 6380d845fa34..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesCreateOrUpdateSample.ts +++ /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. -import { ScopedResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 8774808c7e32..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesDeleteSample.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 "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(): Promise { - 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(): Promise { - 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 6bdf66df8f34..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesGetSample.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 "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(): Promise { - 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(): Promise { - 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 910e283e5a71..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesListByPrivateLinkScopeSample.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 "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(): Promise { - 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(): Promise { - 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 85f113f4b9a8..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesCreateOrUpdateSample.ts +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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 "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(): Promise { - 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(): Promise { - 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(): Promise { - 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 f52c623157aa..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesDeleteSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 cb25293aec01..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesGetSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 1e84a1062d7e..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesListByResourceGroupSample.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 "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(): Promise { - 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(): Promise { - 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 5d165bd1ff5d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesListSample.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 "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(): Promise { - 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(): Promise { - 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 fa6ae414c8af..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesUpdateTagsSample.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 { TagsResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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(): Promise { - 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(): Promise { - 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 1e1f2929ffa6..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesCreateOrUpdateSample.ts +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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 "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/stable/2023-12-01/examples/createOrUpdateScheduledQueryRule.json - */ -async function createOrUpdateAScheduledQueryRuleForSingleResource(): Promise { - 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", - ], - actionProperties: { - icmTitle: "Custom title in ICM", - icmTsgId: "https://tsg.url", - }, - 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/stable/2023-12-01/examples/createOrUpdateScheduledQueryRuleResourceGroup.json - */ -async function createOrUpdateAScheduledQueryRuleOnResourceGroupS(): Promise { - 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", - ], - actionProperties: { - icmTitle: "Custom title in ICM", - icmTsgId: "https://tsg.url", - }, - 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/stable/2023-12-01/examples/createOrUpdateScheduledQueryRuleSubscription.json - */ -async function createOrUpdateAScheduledQueryRuleOnSubscription(): Promise { - 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", - ], - actionProperties: { - icmTitle: "Custom title in ICM", - icmTsgId: "https://tsg.url", - }, - 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(): Promise { - 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 d064650ac30c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesDeleteSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2023-12-01/examples/deleteScheduledQueryRule.json - */ -async function deleteAScheduledQueryRule(): Promise { - 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(): Promise { - 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 6f5862ee8969..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesGetSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2023-12-01/examples/getScheduledQueryRule.json - */ -async function getAScheduledQueryRuleForSingleResource(): Promise { - 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(): Promise { - 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 f24540551449..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesListByResourceGroupSample.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 "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/stable/2023-12-01/examples/listScheduledQueryRulesByResourceGroup.json - */ -async function listScheduledQueryRulesByResourceGroup(): Promise { - 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(): Promise { - 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 8ca97a9f41bc..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesListBySubscriptionSample.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 "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/stable/2023-12-01/examples/listScheduledQueryRulesBySubscription.json - */ -async function listScheduledQueryRulesBySubscription(): Promise { - 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(): Promise { - 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 f3cb80afc597..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesUpdateSample.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 { - ScheduledQueryRuleResourcePatch, - MonitorClient, -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/stable/2023-12-01/examples/patchScheduledQueryRule.json - */ -async function createOrUpdateAScheduledQueryRule(): Promise { - 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(): Promise { - createOrUpdateAScheduledQueryRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActionGroupsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActionGroupsCreateOrUpdateSample.ts deleted file mode 100644 index ccc35fd2160d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActionGroupsCreateOrUpdateSample.ts +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { TenantActionGroupResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create a new tenant action group or update an existing one. - * - * @summary Create a new tenant action group or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/createOrUpdateTenantActionGroup.json - */ -async function createOrUpdateATenantActionGroup(): Promise { - const managementGroupId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const tenantActionGroupName = "testTenantActionGroup"; - const xMsClientTenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const actionGroup: TenantActionGroupResource = { - azureAppPushReceivers: [ - { name: "Sample azureAppPush", emailAddress: "johndoe@email.com" }, - ], - 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, - groupShortName: "sample", - location: "Global", - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "2062022299", - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321", - }, - ], - tags: {}, - voiceReceivers: [ - { name: "Sample voice", countryCode: "1", phoneNumber: "2062022299" }, - ], - 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); - const result = await client.tenantActionGroups.createOrUpdate( - managementGroupId, - tenantActionGroupName, - xMsClientTenantId, - actionGroup, - ); - console.log(result); -} - -async function main(): Promise { - createOrUpdateATenantActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActionGroupsDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActionGroupsDeleteSample.ts deleted file mode 100644 index a26ceca59133..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActionGroupsDeleteSample.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 "dotenv/config"; - -/** - * This sample demonstrates how to Delete a tenant action group. - * - * @summary Delete a tenant action group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/deleteTenantActionGroup.json - */ -async function deleteATenantActionGroup(): Promise { - const managementGroupId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const tenantActionGroupName = "testTenantActionGroup"; - const xMsClientTenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const result = await client.tenantActionGroups.delete( - managementGroupId, - tenantActionGroupName, - xMsClientTenantId, - ); - console.log(result); -} - -async function main(): Promise { - deleteATenantActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActionGroupsGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActionGroupsGetSample.ts deleted file mode 100644 index ffac64405a40..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActionGroupsGetSample.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 "dotenv/config"; - -/** - * This sample demonstrates how to Get a tenant action group. - * - * @summary Get a tenant action group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/getTenantActionGroup.json - */ -async function getAnActionGroup(): Promise { - const managementGroupId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const tenantActionGroupName = "testTenantActionGroup"; - const xMsClientTenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const result = await client.tenantActionGroups.get( - managementGroupId, - tenantActionGroupName, - xMsClientTenantId, - ); - console.log(result); -} - -async function main(): Promise { - getAnActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActionGroupsListByManagementGroupIdSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActionGroupsListByManagementGroupIdSample.ts deleted file mode 100644 index a37cb9158e0f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActionGroupsListByManagementGroupIdSample.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 "dotenv/config"; - -/** - * This sample demonstrates how to Get a list of all tenant action groups in a management group. - * - * @summary Get a list of all tenant action groups in a management group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/listTenantActionGroups.json - */ -async function listTenantActionGroupsAtManagementGroupLevel(): Promise { - const managementGroupId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const xMsClientTenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const resArray = new Array(); - for await (let item of client.tenantActionGroups.listByManagementGroupId( - managementGroupId, - xMsClientTenantId, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - listTenantActionGroupsAtManagementGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActionGroupsUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActionGroupsUpdateSample.ts deleted file mode 100644 index f51a807234cf..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActionGroupsUpdateSample.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 { - ActionGroupPatchBodyAutoGenerated, - MonitorClient, -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Updates an existing tenant action group's tags. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing tenant action group's tags. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2023-05-01-preview/examples/patchTenantActionGroup.json - */ -async function patchATenantActionGroup(): Promise { - const managementGroupId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const tenantActionGroupName = "testTenantActionGroup"; - const xMsClientTenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47"; - const tenantActionGroupPatch: ActionGroupPatchBodyAutoGenerated = { - enabled: false, - tags: { key1: "value1", key2: "value2" }, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const result = await client.tenantActionGroups.update( - managementGroupId, - tenantActionGroupName, - xMsClientTenantId, - tenantActionGroupPatch, - ); - console.log(result); -} - -async function main(): Promise { - patchATenantActionGroup(); -} - -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 2e9036e74504..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActivityLogsListSample.ts +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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 "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(): Promise { - 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); - 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(): Promise { - 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); - 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(): Promise { - 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); - 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(): Promise { - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - 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 866978452ffa..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/vmInsightsGetOnboardingStatusSample.ts +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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 "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(): Promise { - 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); - 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(): Promise { - 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); - 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(): Promise { - 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); - 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(): Promise { - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/resource-group-with-vms"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - 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(): Promise { - const resourceUri = "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -async function main(): Promise { - 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 984eed535aa8..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/lroImpl.ts b/sdk/monitor/arm-monitor/src/lroImpl.ts index d8bc98987053..5f88efab981b 100644 --- a/sdk/monitor/arm-monitor/src/lroImpl.ts +++ b/sdk/monitor/arm-monitor/src/lroImpl.ts @@ -5,6 +5,10 @@ * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + import { AbortSignalLike } from "@azure/abort-controller"; import { LongRunningOperation, LroResponse } from "@azure/core-lro"; diff --git a/sdk/monitor/arm-monitor/src/models/index.ts b/sdk/monitor/arm-monitor/src/models/index.ts index 10c4defa49d4..771647c87efe 100644 --- a/sdk/monitor/arm-monitor/src/models/index.ts +++ b/sdk/monitor/arm-monitor/src/models/index.ts @@ -8,438 +8,358 @@ import * as coreClient from "@azure/core-client"; -export type RuleConditionUnion = - | RuleCondition - | ThresholdRuleCondition - | LocationThresholdRuleCondition - | ManagementEventRuleCondition; -export type RuleDataSourceUnion = - | RuleDataSource - | RuleMetricDataSource - | RuleManagementEventDataSource; -export type RuleActionUnion = RuleAction | RuleEmailAction | RuleWebhookAction; -export type MetricAlertCriteriaUnion = - | MetricAlertCriteria - | MetricAlertSingleResourceMultipleMetricCriteria - | WebtestLocationAvailabilityCriteria - | MetricAlertMultipleResourceMultipleMetricCriteria; -export type MultiMetricCriteriaUnion = - | MultiMetricCriteria - | MetricCriteria - | DynamicMetricCriteria; - -/** Represents collection of metric namespaces. */ -export interface MetricNamespaceCollection { - /** The values for the metric namespaces. */ - value: MetricNamespace[]; -} - -/** Metric namespace class specifies the metadata for a metric namespace. */ -export interface MetricNamespace { - /** The ID of the metric namespace. */ - id?: string; - /** The type of the namespace. */ - type?: string; - /** The escaped name of the namespace. */ - name?: string; - /** Kind of namespace */ - classification?: NamespaceClassification; - /** Properties which include the fully qualified namespace name. */ - properties?: MetricNamespaceName; -} - -/** The fully qualified metric namespace name. */ -export interface MetricNamespaceName { - /** The metric namespace name. */ - metricNamespaceName?: string; -} - -/** Describes the format of Error response. */ -export interface ErrorResponse { - /** Error code */ - code?: string; - /** Error message indicating why the operation failed. */ - message?: string; -} - -/** 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[]; -} - -/** The localizable string class. */ -export interface LocalizableString { - /** The invariant value. */ - value: string; - /** The display name. */ - localizedValue?: string; -} - -/** 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 a supported 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; -} - -/** 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; -} - -/** 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 ErrorResponseAutoGenerated { - /** - * 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?: ErrorResponseAutoGenerated[]; +/** An email receiver. */ +export interface EmailReceiver { + /** The name of the email receiver. Names must be unique across all receivers within an action group. */ + name: string; + /** The email address of this receiver. */ + emailAddress: string; + /** Indicates whether to use common alert schema. */ + useCommonAlertSchema?: boolean; /** - * The error additional info. + * The receiver status of the e-mail. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly status?: ReceiverStatus; } -/** 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; +/** An SMS receiver. */ +export interface SmsReceiver { + /** The name of the SMS receiver. Names must be unique across all receivers within an action group. */ + name: string; + /** The country code of the SMS receiver. */ + countryCode: string; + /** The phone number of the SMS receiver. */ + phoneNumber: string; /** - * The additional info. + * The status of the receiver. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly info?: Record; + readonly status?: ReceiverStatus; } -/** Represents collection of metric definitions. */ -export interface MetricDefinitionCollection { - /** The values for the metric definitions. */ - value: MetricDefinition[]; +/** A webhook receiver. */ +export interface WebhookReceiver { + /** The name of the webhook receiver. Names must be unique across all receivers within an 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 principal id of the managed identity. The value can be "None", "SystemAssigned" */ + managedIdentity?: string; } -/** Metric definition class specifies the metadata for a metric. */ -export interface MetricDefinition { - /** 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?: AggregationType; - /** The collection of what aggregation types are supported. */ - supportedAggregationTypes?: AggregationType[]; - /** 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[]; +/** An Itsm receiver. */ +export interface ItsmReceiver { + /** The name of the Itsm receiver. Names must be unique across all receivers within an action group. */ + name: string; + /** OMS LA instance identifier. */ + workspaceId: string; + /** Unique identification of ITSM connection among multiple defined in above workspace. */ + connectionId: string; + /** JSON blob for the configurations of the ITSM action. CreateMultipleWorkItems option will be part of this blob as well. */ + ticketConfiguration: string; + /** Region in which workspace resides. Supported values:'centralindia','japaneast','southeastasia','australiasoutheast','uksouth','westcentralus','canadacentral','eastus','westeurope' */ + region: string; } -/** 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 ISO 8601 duration format with a special case for 'FULL' value that returns single datapoint for entire time span requested (*Examples: PT15M, PT1H, P1D, FULL*). - * This may be adjusted and different from what was originally requested if AutoAdjustTimegrain=true is specified. 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 Azure mobile App push notification receiver. */ +export interface AzureAppPushReceiver { + /** The name of the Azure mobile app push receiver. Names must be unique across all receivers within an action group. */ + name: string; + /** The email address registered for the Azure mobile app. */ + emailAddress: string; } -/** 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: MetricUnit; - /** The time series returned when a data query is performed. */ - timeseries: TimeSeriesElement[]; +/** The Azure Automation Runbook notification receiver. */ +export interface AutomationRunbookReceiver { + /** The Azure automation account Id which holds this runbook and authenticate to Azure resource. */ + automationAccountId: string; + /** The name for this runbook. */ + runbookName: string; + /** The resource id for webhook linked to this runbook. */ + webhookResourceId: string; + /** Indicates whether this instance is global runbook. */ + isGlobalRunbook: boolean; + /** Indicates name of the webhook. */ + name?: string; + /** The URI where webhooks should be sent. */ + serviceUri?: string; + /** Indicates whether to use common alert schema. */ + useCommonAlertSchema?: boolean; + /** The principal id of the managed identity. The value can be "None", "SystemAssigned" */ + managedIdentity?: string; } -/** A time series result type. The discriminator value is always TimeSeries in this case. */ -export interface TimeSeriesElement { - /** The metadata values returned if $filter was specified in the call. */ - metadatavalues?: MetadataValue[]; - /** An array of data points representing the metric values. This is only returned if a result type of data is specified. */ - data?: MetricValue[]; +/** A voice receiver. */ +export interface VoiceReceiver { + /** The name of the voice receiver. Names must be unique across all receivers within an action group. */ + name: string; + /** The country code of the voice receiver. */ + countryCode: string; + /** The phone number of the voice receiver. */ + phoneNumber: string; } -/** Represents a metric metadata value. */ -export interface MetadataValue { - /** The name of the metadata. */ - name?: LocalizableString; - /** The value of the metadata. */ - value?: string; +/** A logic app receiver. */ +export interface LogicAppReceiver { + /** The name of the logic app receiver. Names must be unique across all receivers within an action group. */ + name: string; + /** The azure resource id of the logic app receiver. */ + resourceId: string; + /** The callback url where http request sent to. */ + callbackUrl: string; + /** Indicates whether to use common alert schema. */ + useCommonAlertSchema?: boolean; + /** The principal id of the managed identity. The value can be "None", "SystemAssigned" */ + managedIdentity?: string; } -/** Represents a metric value. */ -export interface MetricValue { - /** The timestamp for the metric value in ISO 8601 format. */ - timeStamp: Date; - /** The average value in the time range. */ - average?: number; - /** The least value in the time range. */ - minimum?: number; - /** The greatest value in the time range. */ - maximum?: number; - /** The sum of all of the values in the time range. */ - total?: number; - /** The number of samples in the time range. Can be used to determine the number of values that contributed to the average value. */ - count?: number; +/** An azure function receiver. */ +export interface AzureFunctionReceiver { + /** The name of the azure function receiver. Names must be unique across all receivers within an action group. */ + name: string; + /** The azure resource id of the function app. */ + functionAppResourceId: string; + /** The function name in the function app. */ + functionName: string; + /** The http trigger url where http request sent to. */ + httpTriggerUrl: string; + /** Indicates whether to use common alert schema. */ + useCommonAlertSchema?: boolean; + /** The principal id of the managed identity. The value can be "None", "SystemAssigned" */ + managedIdentity?: string; } -/** 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'. */ - timespan?: string; - /** - * The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special case for 'FULL' value that returns single datapoint for entire time span requested. - * *Examples: PT15M, PT1H, P1D, FULL* - */ - 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; +/** An arm role receiver. */ +export interface ArmRoleReceiver { + /** The name of the arm role receiver. Names must be unique across all receivers within an action group. */ + name: string; + /** The arm role id. */ + roleId: string; + /** Indicates whether to use common alert schema. */ + useCommonAlertSchema?: boolean; } -/** 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; +/** An Event hub receiver. */ +export interface EventHubReceiver { + /** The name of the Event hub receiver. Names must be unique across all receivers within an action group. */ + name: string; + /** The Event Hub namespace */ + eventHubNameSpace: string; + /** The name of the specific Event Hub queue */ + eventHubName: string; + /** Indicates whether to use common alert schema. */ + useCommonAlertSchema?: boolean; + /** The tenant Id for the subscription containing this event hub */ + tenantId?: string; + /** The Id for the subscription containing this event hub */ + subscriptionId: string; + /** The principal id of the managed identity. The value can be "None", "SystemAssigned" */ + managedIdentity?: 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; - /** - * Properties related to the metrics container in 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; +/** An Incident receiver. */ +export interface IncidentReceiver { + /** The name of the Incident receiver. Names must be unique across all receivers within an action group. */ + name: string; + /** The incident service connection */ + connection: IncidentServiceConnection; + /** The incident management service type */ + incidentManagementService: IncidentManagementService; + /** Field mappings for the incident service */ + mappings: { [propertyName: string]: string }; +} + +/** The connection info for Incident Receiver. */ +export interface IncidentServiceConnection { + /** The name of the connection. */ + name: string; + /** GUID value representing the connection ID for the incident management service. */ + id: string; +} + +/** An azure resource object */ +export interface AzureResource { /** - * The Data Collection Rule and Endpoint used for ingestion by default. + * Azure resource Id * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly defaultIngestionSettings?: AzureMonitorWorkspaceDefaultIngestionSettings; + readonly id?: string; /** - * List of private endpoint connections + * Azure resource name * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly privateEndpointConnections?: PrivateEndpointConnection[]; + readonly name?: string; /** - * Gets or sets allow or disallow public network access to Azure Monitor Workspace + * Azure resource type * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly publicNetworkAccess?: PublicNetworkAccess; + readonly type?: string; + /** Resource location */ + location: string; + /** Resource tags */ + tags?: { [propertyName: string]: string }; + /** Managed service identity (system assigned and/or user assigned identities) */ + identity?: ManagedServiceIdentity; } -/** Properties related to the metrics container in the Azure Monitor Workspace */ -export interface Metrics { +/** Managed service identity (system assigned and/or user assigned identities) */ +export interface ManagedServiceIdentity { /** - * The Prometheus query endpoint for the Azure Monitor Workspace + * 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 prometheusQueryEndpoint?: string; + readonly principalId?: string; /** - * An internal identifier for the metrics container. Only to be used by the system + * 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 internalId?: string; + 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; + }; } -/** Settings for data ingestion */ -export interface IngestionSettings { - /** - * The Azure resource Id of the default data collection rule for this Azure Monitor Workspace. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly dataCollectionRuleResourceId?: string; +/** User assigned identity properties */ +export interface UserAssignedIdentity { /** - * The Azure resource Id of the default data collection endpoint for this Azure Monitor Workspace. + * The principal ID of the assigned identity. * 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 { + readonly principalId?: string; /** - * The ARM identifier for private endpoint. + * The client ID of the assigned identity. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly clientId?: 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; +/** Describes the format of Error response. */ +export interface ErrorResponse { + /** Error code */ + code?: string; + /** Error message indicating why the operation failed. */ + message?: 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; +/** An action group object for the body of patch operations. */ +export interface ActionGroupPatchBody { + /** Resource tags */ + tags?: { [propertyName: string]: string }; + /** Managed service identity (system assigned and/or user assigned identities) */ + identity?: ManagedServiceIdentity; + /** Indicates whether this action group is enabled. If an action group is not enabled, then none of its actions will be activated. */ + enabled?: boolean; +} + +/** The request body which contain contact detail metadata */ +export interface NotificationRequestBody { + /** The value of the supported alert type. Supported alert type values are: servicehealth, metricstaticthreshold, metricsdynamicthreshold, logalertv2, smartalert, webtestalert, logalertv1numresult, logalertv1metricmeasurement, resourcehealth, activitylog, actualcostbudget, forecastedbudget */ + alertType: string; + /** The list of email receivers that are part of this action group. */ + emailReceivers?: EmailReceiver[]; + /** The list of SMS receivers that are part of this action group. */ + smsReceivers?: SmsReceiver[]; + /** The list of webhook receivers that are part of this action group. */ + webhookReceivers?: WebhookReceiver[]; + /** The list of ITSM receivers that are part of this action group. */ + itsmReceivers?: ItsmReceiver[]; + /** The list of AzureAppPush receivers that are part of this action group. */ + azureAppPushReceivers?: AzureAppPushReceiver[]; + /** The list of AutomationRunbook receivers that are part of this action group. */ + automationRunbookReceivers?: AutomationRunbookReceiver[]; + /** The list of voice receivers that are part of this action group. */ + voiceReceivers?: VoiceReceiver[]; + /** The list of logic app receivers that are part of this action group. */ + logicAppReceivers?: LogicAppReceiver[]; + /** The list of azure function receivers that are part of this action group. */ + azureFunctionReceivers?: AzureFunctionReceiver[]; + /** The list of ARM role receivers that are part of this action group. Roles are Azure RBAC roles and only built-in roles are supported. */ + armRoleReceivers?: ArmRoleReceiver[]; + /** The list of event hub receivers that are part of this action group. */ + eventHubReceivers?: EventHubReceiver[]; + /** The list of incident receivers that are part of this action group. */ + incidentReceivers?: IncidentReceiver[]; +} + +/** The details of the test notification results. */ +export interface TestNotificationDetailsResponse { + /** The context info */ + context?: Context; + /** The overall state */ + state: string; + /** The completed time */ + completedTime?: string; + /** The created time */ + createdTime?: string; + /** The list of action detail */ + actionDetails?: ActionDetail[]; +} + +/** The context info */ +export interface Context { + /** The source of the notification request */ + notificationSource?: string; + /** The context id type */ + contextType?: string; +} + +/** The action detail */ +export interface ActionDetail { + /** The mechanism type */ + mechanismType?: string; + /** The name of the action */ + name?: string; + /** The status of the action */ + status?: string; + /** The substatus of the action */ + subState?: string; + /** The send time */ + sendTime?: string; + /** The detail of the friendly error message */ + detail?: string; +} + +/** A list of action groups. */ +export interface ActionGroupList { + /** The list of action groups. */ + value?: ActionGroupResource[]; + /** Provides the link to retrieve the next set of elements. */ + nextLink?: string; +} + +/** Describes a receiver that should be resubscribed. */ +export interface EnableRequest { + /** The name of the receiver to resubscribe. */ + receiverName: string; +} + +/** Represents a collection of scheduled query rule resources. */ +export interface ScheduledQueryRuleResourceCollection { + /** The values for the scheduled query rule resources. */ + value?: ScheduledQueryRuleResource[]; /** - * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Provides the link to retrieve the next set of elements. * 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; + readonly nextLink?: string; } -/** Common fields that are returned in the response for all Azure Resource Manager resources */ -export interface ResourceAutoGenerated { +/** The scheduled query rule resource. */ +export interface ScheduledQueryRuleResource { /** * 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. @@ -455,5724 +375,664 @@ export interface ResourceAutoGenerated { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; + /** The identity of the resource. */ + identity?: Identity; + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; + /** Indicates the type of scheduled query rule. The default is LogAlert. */ + kind?: Kind; /** - * 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 ErrorResponseAutoGenerated2 { - /** 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. + * The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly target?: string; + readonly etag?: string; /** - * The error details. + * SystemData of ScheduledQueryRule. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly details?: ErrorDetail[]; + readonly systemData?: SystemData; /** - * The error additional info. + * The api-version used when creating this alert rule * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly additionalInfo?: ErrorAdditionalInfo[]; -} - -/** Definition of ARM tracked top level resource properties for the 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 { + readonly createdWithApiVersion?: string; /** - * List of operations supported by the resource provider + * True if alert rule is legacy Log Analytic rule * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: Operation[]; + readonly isLegacyLogAnalyticsRule?: boolean; + /** The description of the scheduled query rule. */ + description?: string; + /** The display name of the alert rule */ + displayName?: string; + /** Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules of the kind LogAlert. */ + severity?: AlertSeverity; + /** The flag which indicates whether this scheduled query rule is enabled. Value should be true or false */ + enabled?: boolean; + /** The list of resource id's that this scheduled query rule is scoped to. */ + scopes?: string[]; + /** How often the scheduled query rule is evaluated represented in ISO 8601 duration format. Relevant and required only for rules of the kind LogAlert. */ + evaluationFrequency?: string; + /** The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required only for rules of the kind LogAlert. */ + windowSize?: string; + /** If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert. */ + overrideQueryTimeRange?: string; + /** List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual machine in the resource group which meet the alert criteria. Relevant only for rules of the kind LogAlert */ + targetResourceTypes?: string[]; + /** The rule criteria that defines the conditions of the scheduled query rule. */ + criteria?: ScheduledQueryRuleCriteria; + /** Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. Relevant only for rules of the kind LogAlert. */ + muteActionsDuration?: string; + /** Actions to invoke when the alert fires. */ + actions?: Actions; /** - * URL to get the next set of operation list results (if there are any). + * The flag which indicates whether this scheduled query rule has been configured to be stored in the customer's storage. The default is false. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; + readonly isWorkspaceAlertsStorageConfigured?: boolean; + /** The flag which indicates whether this scheduled query rule should be stored in the customer's storage. The default is false. Relevant only for rules of the kind LogAlert. */ + checkWorkspaceAlertsStorageConfigured?: boolean; + /** The flag which indicates whether the provided query should be validated or not. The default is false. Relevant only for rules of the kind LogAlert. */ + skipQueryValidation?: boolean; + /** The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only for rules of kinds LogAlert and SimpleLogAlert. */ + autoMitigate?: boolean; + /** Defines the configuration for resolving fired alerts. Relevant only for rules of kinds LogAlert and SimpleLogAlert. */ + resolveConfiguration?: RuleResolveConfiguration; } -/** 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; +/** Identity for the resource. */ +export interface Identity { /** - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" + * The principal ID of resource identity. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly origin?: Origin; + readonly principalId?: string; /** - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * The tenant ID of resource. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly actionType?: ActionType; + readonly tenantId?: string; + /** Type of managed service identity. */ + type: IdentityType; + /** The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ + userAssignedIdentities?: { [propertyName: string]: UserIdentityProperties }; } -/** 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; +/** User assigned identity properties. */ +export interface UserIdentityProperties { /** - * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + * The principal id of user assigned identity. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly operation?: string; + readonly principalId?: string; /** - * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + * The client id of user assigned identity. * 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. */ - value: AutoscaleSettingResource[]; - /** URL to get the next set of results. */ - nextLink?: string; -} - -/** Autoscale profile. */ -export interface AutoscaleProfile { - /** the name of the profile. */ - name: string; - /** the number of instances that can be used during this profile. */ - capacity: ScaleCapacity; - /** the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified. */ - rules: ScaleRule[]; - /** the specific date-time for the profile. This element is not used if the Recurrence element is used. */ - fixedDate?: TimeWindow; - /** the repeating times at which this profile begins. This element is not used if the FixedDate element is used. */ - recurrence?: Recurrence; + readonly clientId?: string; } -/** The number of instances that can be used during this profile. */ -export interface ScaleCapacity { - /** the minimum number of instances for the resource. */ - minimum: string; - /** the maximum number of instances for the resource. The actual maximum number of instances is limited by the cores that are available in the subscription. */ - maximum: string; - /** the number of instances that will be set if metrics are not available for evaluation. The default is only used if the current instance count is lower than the default. */ - default: string; +/** 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; } -/** A rule that provide the triggers and parameters for the scaling action. */ -export interface ScaleRule { - /** the trigger that results in a scaling action. */ - metricTrigger: MetricTrigger; - /** the parameters for the scaling action. */ - scaleAction: ScaleAction; +/** The rule criteria that defines the conditions of the scheduled query rule. */ +export interface ScheduledQueryRuleCriteria { + /** A list of conditions to evaluate against the specified scopes */ + allOf?: Condition[]; } -/** The trigger that results in a scaling action. */ -export interface MetricTrigger { - /** the name of the metric that defines what the rule monitors. */ - metricName: string; - /** the namespace of the metric that defines what the rule monitors. */ - metricNamespace?: string; - /** the resource identifier of the resource the rule monitors. */ - metricResourceUri: string; - /** the location of the resource the rule monitors. */ - metricResourceLocation?: string; - /** the granularity of metrics the rule monitors. Must be one of the predefined values returned from metric definitions for the metric. Must be between 12 hours and 1 minute. */ - timeGrain: string; - /** the metric statistic type. How the metrics from multiple instances are combined. */ - statistic: MetricStatisticType; - /** the range of time in which instance data is collected. This value must be greater than the delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours and 5 minutes. */ - timeWindow: string; - /** time aggregation type. How the data that is collected should be combined over time. The default value is Average. */ - timeAggregation: TimeAggregationType; - /** the operator that is used to compare the metric data and the threshold. */ - operator: ComparisonOperationType; - /** the threshold of the metric that triggers the scale action. */ - threshold: number; - /** List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. */ - dimensions?: ScaleRuleMetricDimension[]; - /** a value indicating whether metric should divide per instance. */ - dividePerInstance?: boolean; +/** A condition of the scheduled query rule. */ +export interface Condition { + /** Specifies the type of threshold criteria */ + criterionType?: CriterionType; + /** Log query alert */ + query?: string; + /** Aggregation type. Relevant and required only for rules of the kind LogAlert. */ + timeAggregation?: TimeAggregation; + /** The column containing the metric measure number. Relevant only for rules of the kind LogAlert. */ + metricMeasureColumn?: string; + /** The column containing the resource id. The content of the column must be a uri formatted as resource id. Relevant only for rules of the kind LogAlert. */ + resourceIdColumn?: string; + /** List of Dimensions conditions */ + dimensions?: Dimension[]; + /** The criteria operator. Relevant and required only for rules of the kind LogAlert. */ + operator?: ConditionOperator; + /** the criteria threshold value that activates the alert. Relevant and required only for static threshold rules of the kind LogAlert. */ + threshold?: number; + /** The extent of deviation required to trigger an alert. Allowed values are 'Low', 'Medium' and 'High'. This will affect how tight the threshold is to the metric series pattern. Relevant only for dynamic threshold rules of the kind LogAlert. */ + alertSensitivity?: string; + /** Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format). Relevant only for dynamic threshold rules of the kind LogAlert. */ + ignoreDataBefore?: Date; + /** The minimum number of violations required within the selected lookback time window required to raise an alert. Relevant only for rules of the kind LogAlert. */ + failingPeriods?: ConditionFailingPeriods; + /** The name of the metric to be sent. Relevant and required only for rules of the kind LogToMetric. */ + metricName?: string; + /** The minimum results count that should be found for triggering an alert. Relevant only for rules of the kind SimpleLogAlert. */ + minRecurrenceCount?: number; } -/** Specifies an auto scale rule metric dimension. */ -export interface ScaleRuleMetricDimension { - /** Name of the dimension. */ - dimensionName: string; - /** the dimension operator. Only 'Equals' and 'NotEquals' are supported. 'Equals' being equal to any of the values. 'NotEquals' being not equal to all of the values */ - operator: ScaleRuleMetricDimensionOperationType; - /** list of dimension values. For example: ["App1","App2"]. */ +/** Dimension splitting and filtering definition */ +export interface Dimension { + /** Name of the dimension */ + name: string; + /** Operator for dimension values */ + operator: DimensionOperator; + /** List of dimension values */ values: string[]; } -/** The parameters for the scaling action. */ -export interface ScaleAction { - /** the scale direction. Whether the scaling action increases or decreases the number of instances. */ - direction: ScaleDirection; - /** the type of action that should occur when the scale rule fires. */ - type: ScaleType; - /** the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is 1. */ - value?: string; - /** the amount of time to wait since the last scaling action before this action occurs. It must be between 1 week and 1 minute in ISO 8601 format. */ - cooldown: string; -} - -/** A specific date-time for the profile. */ -export interface TimeWindow { - /** the timezone of the start and end times for the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time */ - timeZone?: string; - /** the start time for the profile in ISO 8601 format. */ - start: Date; - /** the end time for the profile in ISO 8601 format. */ - end: Date; -} - -/** The repeating times at which this profile begins. This element is not used if the FixedDate element is used. */ -export interface Recurrence { - /** the recurrence frequency. How often the schedule profile should take effect. This value must be Week, meaning each week will have the same set of profiles. For example, to set a daily schedule, set **schedule** to every day of the week. The frequency property specifies that the schedule is repeated weekly. */ - frequency: RecurrenceFrequency; - /** the scheduling constraints for when the profile begins. */ - schedule: RecurrentSchedule; -} - -/** The scheduling constraints for when the profile begins. */ -export interface RecurrentSchedule { - /** the timezone for the hours of the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time */ - timeZone: string; - /** the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. */ - days: string[]; - /** A collection of hours that the profile takes effect on. Values supported are 0 to 23 on the 24-hour clock (AM/PM times are not supported). */ - hours: number[]; - /** A collection of minutes at which the profile takes effect at. */ - minutes: number[]; -} - -/** Autoscale notification. */ -export interface AutoscaleNotification { - /** the operation associated with the notification and its value must be "scale" */ - operation: "Scale"; - /** the email notification. */ - email?: EmailNotification; - /** the collection of webhook notifications. */ - webhooks?: WebhookNotification[]; -} - -/** Email notification of an autoscale event. */ -export interface EmailNotification { - /** a value indicating whether to send email to subscription administrator. */ - sendToSubscriptionAdministrator?: boolean; - /** a value indicating whether to send email to subscription co-administrators. */ - sendToSubscriptionCoAdministrators?: boolean; - /** the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. */ - customEmails?: string[]; -} - -/** Webhook notification of an autoscale event. */ -export interface WebhookNotification { - /** the service address to receive the notification. */ - serviceUri?: string; - /** a property bag of settings. This value can be empty. */ - properties?: { [propertyName: string]: string }; +/** The minimum number of violations required within the selected lookback time window required to raise an alert. Relevant only for rules of the kind LogAlert. */ +export interface ConditionFailingPeriods { + /** The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points. Default value is 1 */ + numberOfEvaluationPeriods?: number; + /** The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. Default value is 1 */ + minFailingPeriodsToAlert?: number; } -/** The parameters for enabling predictive autoscale. */ -export interface PredictiveAutoscalePolicy { - /** the predictive autoscale mode */ - scaleMode: PredictiveAutoscalePolicyScaleMode; - /** the amount of time to specify by which instances are launched in advance. It must be between 1 minute and 60 minutes in ISO 8601 format. */ - scaleLookAheadTime?: string; +/** Actions to invoke when the alert fires. */ +export interface Actions { + /** Action Group resource Ids to invoke when the alert fires. */ + actionGroups?: string[]; + /** The properties of an alert payload. */ + customProperties?: { [propertyName: string]: string }; + /** The properties of an action properties. */ + actionProperties?: { [propertyName: string]: string }; } -/** The autoscale setting resource. */ -export interface ResourceAutoGenerated2 { - /** - * Azure resource Id - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * Azure resource name - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Azure resource type - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** Resource location */ - location: string; - /** Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. */ - tags?: { [propertyName: string]: string }; - /** - * The system metadata related to the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; +/** TBD. Relevant only for rules of the kind LogAlert. */ +export interface RuleResolveConfiguration { + /** The flag that indicates whether or not to auto resolve a fired alert. */ + autoResolved?: boolean; + /** The duration a rule must evaluate as healthy before the fired alert is automatically resolved represented in ISO 8601 duration format. */ + timeToResolve?: string; } -/** Describes the format of Error response. */ -export interface AutoscaleErrorResponse { +/** 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?: AutoscaleErrorResponseError; - /** - * The system metadata related to the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; -} - -/** The error object. */ -export interface AutoscaleErrorResponseError { - /** One of a server-defined set of error codes. */ - code?: string; - /** A human-readable representation of the error. */ - message?: string; - /** The target of the particular error. */ - target?: string; - /** A human-readable representation of the error's details. */ - details?: string; -} - -/** The autoscale setting object for patch operations. */ -export interface AutoscaleSettingResourcePatch { - /** Resource tags */ - tags?: { [propertyName: string]: string }; - /** 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. */ - notifications?: AutoscaleNotification[]; - /** the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default value is 'false'. */ - enabled?: boolean; - /** the predictive autoscale policy mode. */ - predictiveAutoscalePolicy?: PredictiveAutoscalePolicy; - /** the name of the autoscale setting. */ - name?: string; - /** the resource identifier of the resource that the autoscale setting should be added to. */ - targetResourceUri?: string; - /** the location of the resource that the autoscale setting should be added to. */ - targetResourceLocation?: string; -} - -/** The response to a metrics query. */ -export interface PredictiveResponse { - /** 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 metrics being queried */ - metricName?: string; - /** resource of the predictive metric. */ - targetResourceId?: string; - /** the value of the collection. */ - data?: PredictiveValue[]; -} - -/** Represents a predictive metric value in the given bucket. */ -export interface PredictiveValue { - /** the timestamp for the metric value in ISO 8601 format. */ - timeStamp: Date; - /** Predictive value in this time bucket. */ - value: number; -} - -/** 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 OperationListResultAutoGenerated { - /** List of operations supported by the Microsoft.Insights provider. */ - 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 OperationAutoGenerated { - /** Operation name: {provider}/{resource}/{operation} */ - name?: string; - /** Display metadata associated with the operation. */ - display?: OperationDisplayAutoGenerated; -} - -/** Display metadata associated with the operation. */ -export interface OperationDisplayAutoGenerated { - /** Service provider: Microsoft.Insights */ - provider?: string; - /** Resource on which the operation is performed: AlertRules, Autoscale, etc. */ - resource?: string; - /** Operation type: Read, write, delete, etc. */ - operation?: string; + error?: ErrorResponseAutoGenerated; } -/** An alert incident indicates the activation status of an alert rule. */ -export interface Incident { +/** 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 ErrorResponseAutoGenerated { /** - * Incident name. + * The error code. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly code?: string; /** - * Rule name that is associated with the incident. + * The error message. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly ruleName?: string; + readonly message?: string; /** - * A boolean to indicate whether the incident is active or resolved. + * The error target. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly isActive?: boolean; + readonly target?: string; /** - * The time at which the incident was activated in ISO8601 format. + * The error details. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly activatedTime?: Date; + readonly details?: ErrorResponseAutoGenerated[]; /** - * The time at which the incident was resolved in ISO8601 format. If null, it means the incident is still active. + * The error additional info. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly resolvedTime?: Date; -} - -/** The List incidents operation response. */ -export interface IncidentListResult { - /** the incident collection. */ - value?: Incident[]; -} - -/** The condition that results in the alert rule being activated. */ -export interface RuleCondition { - /** Polymorphic discriminator, which specifies the different types this object can be */ - odataType: - | "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition" - | "Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition" - | "Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition"; - /** the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource. */ - dataSource?: RuleDataSourceUnion; -} - -/** The resource from which the rule collects its data. */ -export interface RuleDataSource { - /** Polymorphic discriminator, which specifies the different types this object can be */ - odataType: - | "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource" - | "Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource"; - /** the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule. */ - resourceUri?: string; - /** the legacy resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule. */ - legacyResourceId?: string; - /** the location of the resource. */ - resourceLocation?: string; - /** the namespace of the metric. */ - metricNamespace?: string; -} - -/** The action that is performed when the alert rule becomes active, and when an alert condition is resolved. */ -export interface RuleAction { - /** Polymorphic discriminator, which specifies the different types this object can be */ - odataType: - | "Microsoft.Azure.Management.Insights.Models.RuleEmailAction" - | "Microsoft.Azure.Management.Insights.Models.RuleWebhookAction"; + readonly additionalInfo?: ErrorAdditionalInfo[]; } -/** An azure resource object */ -export interface ResourceAutoGenerated3 { - /** - * Azure resource Id - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { /** - * Azure resource name + * The additional info type. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly type?: string; /** - * Azure resource type + * The additional info. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; - /** Resource location */ - location: string; - /** Resource tags */ - tags?: { [propertyName: string]: string }; + readonly info?: Record; } -/** The alert rule object for patch operations. */ -export interface AlertRuleResourcePatch { +/** The scheduled query rule resource for patch operations. */ +export interface ScheduledQueryRuleResourcePatch { + /** The identity of the resource. */ + identity?: Identity; /** Resource tags */ tags?: { [propertyName: string]: string }; - /** the name of the alert rule. */ - name?: string; - /** the description of the alert rule that will be included in the alert email. */ - description?: string; - /** the provisioning state. */ - provisioningState?: string; - /** the flag that indicates whether the alert rule is enabled. */ - isEnabled?: boolean; - /** the condition that results in the alert rule being activated. */ - condition?: RuleConditionUnion; - /** action that is performed when the alert rule becomes active, and when an alert condition is resolved. */ - action?: RuleActionUnion; - /** the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. */ - actions?: RuleActionUnion[]; /** - * Last time the rule was updated in ISO8601 format. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly lastUpdatedTime?: Date; -} - -/** Represents a collection of alert rule resources. */ -export interface AlertRuleResourceCollection { - /** the values for the alert rule resources. */ - value?: AlertRuleResource[]; -} - -/** Specifies the retention policy for the log. */ -export interface RetentionPolicy { - /** a value indicating whether the retention policy is enabled. */ - enabled: boolean; - /** the number of days for the retention in days. A value of 0 will retain the events indefinitely. */ - days: number; -} - -/** An azure resource object */ -export interface ResourceAutoGenerated4 { - /** - * Azure resource Id + * The api-version used when creating this alert rule * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly createdWithApiVersion?: string; /** - * Azure resource name + * True if alert rule is legacy Log Analytic rule * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly isLegacyLogAnalyticsRule?: boolean; + /** The description of the scheduled query rule. */ + description?: string; + /** The display name of the alert rule */ + displayName?: string; + /** Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules of the kind LogAlert. */ + severity?: AlertSeverity; + /** The flag which indicates whether this scheduled query rule is enabled. Value should be true or false */ + enabled?: boolean; + /** The list of resource id's that this scheduled query rule is scoped to. */ + scopes?: string[]; + /** How often the scheduled query rule is evaluated represented in ISO 8601 duration format. Relevant and required only for rules of the kind LogAlert. */ + evaluationFrequency?: string; + /** The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required only for rules of the kind LogAlert. */ + windowSize?: string; + /** If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert. */ + overrideQueryTimeRange?: string; + /** List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual machine in the resource group which meet the alert criteria. Relevant only for rules of the kind LogAlert */ + targetResourceTypes?: string[]; + /** The rule criteria that defines the conditions of the scheduled query rule. */ + criteria?: ScheduledQueryRuleCriteria; + /** Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. Relevant only for rules of the kind LogAlert. */ + muteActionsDuration?: string; + /** Actions to invoke when the alert fires. */ + actions?: Actions; /** - * Azure resource type + * The flag which indicates whether this scheduled query rule has been configured to be stored in the customer's storage. The default is false. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; - /** Resource location */ - location: string; - /** Resource tags */ - tags?: { [propertyName: string]: string }; + readonly isWorkspaceAlertsStorageConfigured?: boolean; + /** The flag which indicates whether this scheduled query rule should be stored in the customer's storage. The default is false. Relevant only for rules of the kind LogAlert. */ + checkWorkspaceAlertsStorageConfigured?: boolean; + /** The flag which indicates whether the provided query should be validated or not. The default is false. Relevant only for rules of the kind LogAlert. */ + skipQueryValidation?: boolean; + /** The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only for rules of kinds LogAlert and SimpleLogAlert. */ + autoMitigate?: boolean; + /** Defines the configuration for resolving fired alerts. Relevant only for rules of kinds LogAlert and SimpleLogAlert. */ + resolveConfiguration?: RuleResolveConfiguration; } -/** The log profile resource for patch operations. */ -export interface LogProfileResourcePatch { - /** Resource tags */ - tags?: { [propertyName: string]: string }; - /** 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}'. */ - serviceBusRuleId?: string; - /** List of regions for which Activity Log events should be stored or streamed. It is a comma separated list of valid ARM locations including the 'global' location. */ - locations?: string[]; - /** the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.' */ - categories?: string[]; - /** the retention policy for the events in the log. */ - retentionPolicy?: RetentionPolicy; +/** An action group resource. */ +export interface ActionGroupResource extends AzureResource { + /** The short name of the action group. This will be used in SMS messages. */ + groupShortName?: string; + /** Indicates whether this action group is enabled. If an 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 action group. */ + emailReceivers?: EmailReceiver[]; + /** The list of SMS receivers that are part of this action group. */ + smsReceivers?: SmsReceiver[]; + /** The list of webhook receivers that are part of this action group. */ + webhookReceivers?: WebhookReceiver[]; + /** The list of ITSM receivers that are part of this action group. */ + itsmReceivers?: ItsmReceiver[]; + /** The list of AzureAppPush receivers that are part of this action group. */ + azureAppPushReceivers?: AzureAppPushReceiver[]; + /** The list of AutomationRunbook receivers that are part of this action group. */ + automationRunbookReceivers?: AutomationRunbookReceiver[]; + /** The list of voice receivers that are part of this action group. */ + voiceReceivers?: VoiceReceiver[]; + /** The list of logic app receivers that are part of this action group. */ + logicAppReceivers?: LogicAppReceiver[]; + /** The list of azure function receivers that are part of this action group. */ + azureFunctionReceivers?: AzureFunctionReceiver[]; + /** The list of ARM role receivers that are part of this action group. Roles are Azure RBAC roles and only built-in roles are supported. */ + armRoleReceivers?: ArmRoleReceiver[]; + /** The list of event hub receivers that are part of this action group. */ + eventHubReceivers?: EventHubReceiver[]; + /** The list of incident receivers that are part of this action group. */ + incidentReceivers?: IncidentReceiver[]; } -/** Represents a collection of log profiles. */ -export interface LogProfileCollection { - /** the values of the log profiles. */ - value: LogProfileResource[]; +/** Defines headers for ActionGroups_createNotificationsAtActionGroupResourceLevel operation. */ +export interface ActionGroupsCreateNotificationsAtActionGroupResourceLevelHeaders { + /** The location header that has the polling uri. */ + location?: string; } -/** Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular metric. */ -export interface MetricSettings { - /** the timegrain of the metric in ISO8601 format. */ - timeGrain?: string; - /** Name of a Diagnostic Metric category for a resource type this setting is applied to. To obtain the list of Diagnostic metric categories for a resource, first perform a GET diagnostic settings operation. */ - category?: string; - /** a value indicating whether this category is enabled. */ - enabled: boolean; - /** the retention policy for this category. */ - retentionPolicy?: RetentionPolicy; +/** Known values of {@link IncidentManagementService} that the service accepts. */ +export enum KnownIncidentManagementService { + /** Icm */ + Icm = "Icm", } -/** Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular log. */ -export interface LogSettings { - /** Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation. */ - category?: string; - /** Name of a Diagnostic Log category group for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation. */ - categoryGroup?: string; - /** a value indicating whether this log is enabled. */ - enabled: boolean; - /** the retention policy for this log. */ - retentionPolicy?: RetentionPolicy; -} +/** + * Defines values for IncidentManagementService. \ + * {@link KnownIncidentManagementService} can be used interchangeably with IncidentManagementService, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Icm** + */ +export type IncidentManagementService = 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; -} - -/** Represents a collection of alert rule resources. */ -export interface DiagnosticSettingsResourceCollection { - /** The collection of diagnostic settings resources;. */ - value?: DiagnosticSettingsResource[]; -} - -/** Represents a collection of diagnostic setting category resources. */ -export interface DiagnosticSettingsCategoryResourceCollection { - /** The collection of diagnostic settings category resources. */ - value?: DiagnosticSettingsCategoryResource[]; -} - -/** An email receiver. */ -export interface EmailReceiver { - /** The name of the email receiver. Names must be unique across all receivers within an 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 SmsReceiver { - /** The name of the SMS receiver. Names must be unique across all receivers within an 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 WebhookReceiver { - /** The name of the webhook receiver. Names must be unique across all receivers within an 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; -} - -/** An Itsm receiver. */ -export interface ItsmReceiver { - /** The name of the Itsm receiver. Names must be unique across all receivers within an action group. */ - name: string; - /** OMS LA instance identifier. */ - workspaceId: string; - /** Unique identification of ITSM connection among multiple defined in above workspace. */ - connectionId: string; - /** JSON blob for the configurations of the ITSM action. CreateMultipleWorkItems option will be part of this blob as well. */ - ticketConfiguration: string; - /** Region in which workspace resides. Supported values:'centralindia','japaneast','southeastasia','australiasoutheast','uksouth','westcentralus','canadacentral','eastus','westeurope' */ - region: string; -} - -/** The Azure mobile App push notification receiver. */ -export interface AzureAppPushReceiver { - /** The name of the Azure mobile app push receiver. Names must be unique across all receivers within an action group. */ - name: string; - /** The email address registered for the Azure mobile app. */ - emailAddress: string; -} - -/** The Azure Automation Runbook notification receiver. */ -export interface AutomationRunbookReceiver { - /** The Azure automation account Id which holds this runbook and authenticate to Azure resource. */ - automationAccountId: string; - /** The name for this runbook. */ - runbookName: string; - /** The resource id for webhook linked to this runbook. */ - webhookResourceId: string; - /** Indicates whether this instance is global runbook. */ - isGlobalRunbook: boolean; - /** Indicates name of the webhook. */ - name?: string; - /** The URI where webhooks should be sent. */ - serviceUri?: string; - /** Indicates whether to use common alert schema. */ - useCommonAlertSchema?: boolean; -} - -/** A voice receiver. */ -export interface VoiceReceiver { - /** The name of the voice receiver. Names must be unique across all receivers within an action group. */ - name: string; - /** The country code of the voice receiver. */ - countryCode: string; - /** The phone number of the voice receiver. */ - phoneNumber: string; -} - -/** A logic app receiver. */ -export interface LogicAppReceiver { - /** The name of the logic app receiver. Names must be unique across all receivers within an action group. */ - name: string; - /** The azure resource id of the logic app receiver. */ - resourceId: string; - /** The callback url where http request sent to. */ - callbackUrl: string; - /** Indicates whether to use common alert schema. */ - useCommonAlertSchema?: boolean; -} - -/** An azure function receiver. */ -export interface AzureFunctionReceiver { - /** The name of the azure function receiver. Names must be unique across all receivers within an action group. */ - name: string; - /** The azure resource id of the function app. */ - functionAppResourceId: string; - /** The function name in the function app. */ - functionName: string; - /** The http trigger url where http request sent to. */ - httpTriggerUrl: string; - /** Indicates whether to use common alert schema. */ - useCommonAlertSchema?: boolean; -} - -/** An arm role receiver. */ -export interface ArmRoleReceiver { - /** The name of the arm role receiver. Names must be unique across all receivers within an action group. */ - name: string; - /** The arm role id. */ - roleId: string; - /** Indicates whether to use common alert schema. */ - useCommonAlertSchema?: boolean; -} - -/** An Event hub receiver. */ -export interface EventHubReceiver { - /** The name of the Event hub receiver. Names must be unique across all receivers within an action group. */ - name: string; - /** The Event Hub namespace */ - eventHubNameSpace: string; - /** The name of the specific Event Hub queue */ - eventHubName: string; - /** Indicates whether to use common alert schema. */ - useCommonAlertSchema?: boolean; - /** The tenant Id for the subscription containing this event hub */ - tenantId?: string; - /** The Id for the subscription containing this event hub */ - subscriptionId: string; -} - -/** An azure resource object */ -export interface AzureResource { - /** - * Azure resource Id - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * Azure resource name - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Azure resource type - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** Resource location */ - location: string; - /** Resource tags */ - tags?: { [propertyName: string]: string }; -} - -/** An action group object for the body of patch operations. */ -export interface ActionGroupPatchBody { - /** Resource tags */ - tags?: { [propertyName: string]: string }; - /** Indicates whether this action group is enabled. If an action group is not enabled, then none of its actions will be activated. */ - enabled?: boolean; -} - -/** The request body which contain contact detail metadata */ -export interface NotificationRequestBody { - /** The value of the supported alert type. Supported alert type values are: servicehealth, metricstaticthreshold, metricsdynamicthreshold, logalertv2, smartalert, webtestalert, logalertv1numresult, logalertv1metricmeasurement, resourcehealth, activitylog, actualcostbudget, forecastedbudget */ - alertType: string; - /** The list of email receivers that are part of this action group. */ - emailReceivers?: EmailReceiver[]; - /** The list of SMS receivers that are part of this action group. */ - smsReceivers?: SmsReceiver[]; - /** The list of webhook receivers that are part of this action group. */ - webhookReceivers?: WebhookReceiver[]; - /** The list of ITSM receivers that are part of this action group. */ - itsmReceivers?: ItsmReceiver[]; - /** The list of AzureAppPush receivers that are part of this action group. */ - azureAppPushReceivers?: AzureAppPushReceiver[]; - /** The list of AutomationRunbook receivers that are part of this action group. */ - automationRunbookReceivers?: AutomationRunbookReceiver[]; - /** The list of voice receivers that are part of this action group. */ - voiceReceivers?: VoiceReceiver[]; - /** The list of logic app receivers that are part of this action group. */ - logicAppReceivers?: LogicAppReceiver[]; - /** The list of azure function receivers that are part of this action group. */ - azureFunctionReceivers?: AzureFunctionReceiver[]; - /** The list of ARM role receivers that are part of this action group. Roles are Azure RBAC roles and only built-in roles are supported. */ - armRoleReceivers?: ArmRoleReceiver[]; - /** The list of event hub receivers that are part of this action group. */ - eventHubReceivers?: EventHubReceiver[]; -} - -/** The details of the test notification results. */ -export interface TestNotificationDetailsResponse { - /** The context info */ - context?: Context; - /** The overall state */ - state: string; - /** The completed time */ - completedTime?: string; - /** The created time */ - createdTime?: string; - /** The list of action detail */ - actionDetails?: ActionDetail[]; -} - -/** The context info */ -export interface Context { - /** The source of the notification request */ - notificationSource?: string; - /** The context id type */ - contextType?: string; -} - -/** The action detail */ -export interface ActionDetail { - /** The mechanism type */ - mechanismType?: string; - /** The name of the action */ - name?: string; - /** The status of the action */ - status?: string; - /** The substatus of the action */ - subState?: string; - /** The send time */ - sendTime?: string; - /** The detail of the friendly error message */ - detail?: string; -} - -/** A list of action groups. */ -export interface ActionGroupList { - /** The list of action groups. */ - value?: ActionGroupResource[]; - /** Provides the link to retrieve the next set of elements. */ - nextLink?: string; -} - -/** Describes a receiver that should be resubscribed. */ -export interface EnableRequest { - /** The name of the receiver to resubscribe. */ - 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; -} - -/** The request body which contain contact detail metadata */ -export interface TenantNotificationRequestBody { - /** The value of the supported alert type. Supported alert type value is: servicehealth */ - alertType: string; - /** The list of email receivers that are part of this action group. */ - emailReceivers?: EmailReceiverAutoGenerated[]; - /** The list of SMS receivers that are part of this action group. */ - smsReceivers?: SmsReceiverAutoGenerated[]; - /** The list of webhook receivers that are part of this action group. */ - webhookReceivers?: WebhookReceiverAutoGenerated[]; - /** The list of AzureAppPush receivers that are part of this action group. */ - azureAppPushReceivers?: AzureAppPushReceiverAutoGenerated[]; - /** The list of voice receivers that are part of this action group. */ - voiceReceivers?: VoiceReceiverAutoGenerated[]; -} - -/** The details of the test notification results. */ -export interface TestNotificationDetailsResponseAutoGenerated { - /** The context info */ - context?: Context; - /** The overall state */ - state: string; - /** The completed time */ - completedTime?: string; - /** The created time */ - createdTime?: string; - /** The list of action detail */ - actionDetails?: ActionDetailAutoGenerated[]; -} - -/** The action detail */ -export interface ActionDetailAutoGenerated { - /** The mechanism type */ - mechanismType?: string; - /** The name of the action */ - name?: string; - /** The status of the action */ - status?: string; - /** The substatus of the action */ - subState?: string; - /** The send time */ - sendTime?: string; - /** The detail of the friendly error message */ - message?: 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 ErrorResponseAutoGenerated3 { - /** The error object. */ - error?: ErrorDetailAutoGenerated; -} - -/** The error detail. */ -export interface ErrorDetailAutoGenerated { - /** - * 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. - */ - readonly additionalInfo?: ErrorAdditionalInfo[]; -} - -/** Represents collection of events. */ -export interface EventDataCollection { - /** this list that includes the Azure audit logs. */ - value: EventData[]; - /** Provides the link to retrieve the next set of events. */ - nextLink?: string; -} - -/** The Azure event log entries are of type EventData */ -export interface EventData { - /** - * The sender authorization information. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly authorization?: SenderAuthorization; - /** - * key value pairs to identify ARM permissions. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly claims?: { [propertyName: string]: string }; - /** - * the email address of the user who has performed the operation, the UPN claim or SPN claim based on availability. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly caller?: string; - /** - * the description of the event. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly description?: string; - /** - * the Id of this event as required by ARM for RBAC. It contains the EventDataID and a timestamp information. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * the event data Id. This is a unique identifier for an event. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly eventDataId?: string; - /** - * the correlation Id, usually a GUID in the string format. The correlation Id is shared among the events that belong to the same uber operation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly correlationId?: string; - /** - * the event name. This value should not be confused with OperationName. For practical purposes, OperationName might be more appealing to end users. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly eventName?: LocalizableStringAutoGenerated; - /** - * the event category. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly category?: LocalizableStringAutoGenerated; - /** - * the HTTP request info. Usually includes the 'clientRequestId', 'clientIpAddress' (IP address of the user who initiated the event) and 'method' (HTTP method e.g. PUT). - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly httpRequest?: HttpRequestInfo; - /** - * the event level - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly level?: EventLevel; - /** - * the resource group name of the impacted resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resourceGroupName?: string; - /** - * the resource provider name of the impacted resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resourceProviderName?: LocalizableStringAutoGenerated; - /** - * the resource uri that uniquely identifies the resource that caused this event. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resourceId?: string; - /** - * the resource type - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resourceType?: LocalizableStringAutoGenerated; - /** - * It is usually a GUID shared among the events corresponding to single operation. This value should not be confused with EventName. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly operationId?: string; - /** - * the operation name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly operationName?: LocalizableStringAutoGenerated; - /** - * the set of pairs (usually a Dictionary) that includes details about the event. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly properties?: { [propertyName: string]: string }; - /** - * a string describing the status of the operation. Some typical values are: Started, In progress, Succeeded, Failed, Resolved. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly status?: LocalizableStringAutoGenerated; - /** - * the event sub status. Most of the time, when included, this captures the HTTP status code of the REST call. Common values are: OK (HTTP Status Code: 200), Created (HTTP Status Code: 201), Accepted (HTTP Status Code: 202), No Content (HTTP Status Code: 204), Bad Request(HTTP Status Code: 400), Not Found (HTTP Status Code: 404), Conflict (HTTP Status Code: 409), Internal Server Error (HTTP Status Code: 500), Service Unavailable (HTTP Status Code:503), Gateway Timeout (HTTP Status Code: 504) - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly subStatus?: LocalizableStringAutoGenerated; - /** - * the timestamp of when the event was generated by the Azure service processing the request corresponding the event. It in ISO 8601 format. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly eventTimestamp?: Date; - /** - * the timestamp of when the event became available for querying via this API. It is in ISO 8601 format. This value should not be confused eventTimestamp. As there might be a delay between the occurrence time of the event, and the time that the event is submitted to the Azure logging infrastructure. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly submissionTimestamp?: Date; - /** - * the Azure subscription Id usually a GUID. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly subscriptionId?: string; - /** - * the Azure tenant Id - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly tenantId?: string; -} - -/** the authorization used by the user who has performed the operation that led to this event. This captures the RBAC properties of the event. These usually include the 'action', 'role' and the 'scope' */ -export interface SenderAuthorization { - /** the permissible actions. For instance: microsoft.support/supporttickets/write */ - action?: string; - /** the role of the user. For instance: Subscription Admin */ - role?: string; - /** the scope. */ - scope?: string; -} - -/** The localizable string class. */ -export interface LocalizableStringAutoGenerated { - /** the invariant value. */ - value: string; - /** the locale specific value. */ - 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; -} - -/** 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: LocalizableStringAutoGenerated[]; -} - -/** A list of metric baselines. */ -export interface MetricBaselinesResponse { - /** The list of metric baselines. */ - value?: SingleMetricBaseline[]; -} - -/** The baseline results of a single metric. */ -export interface SingleMetricBaseline { - /** The metric baseline Id. */ - id: string; - /** The resource type of the metric baseline resource. */ - type: string; - /** The name of the metric for which the baselines were retrieved. */ - name: string; - /** 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 been queried. */ - namespace?: string; - /** The baseline for each time series that was queried. */ - baselines: TimeSeriesBaseline[]; -} - -/** The baseline values for a single time series. */ -export interface TimeSeriesBaseline { - /** The aggregation type of the metric. */ - aggregation: string; - /** The dimensions of this time series. */ - dimensions?: MetricSingleDimension[]; - /** The list of timestamps of the baselines. */ - timestamps: Date[]; - /** The baseline values for each sensitivity. */ - data: SingleBaseline[]; - /** The baseline metadata values. */ - metadataValues?: BaselineMetadata[]; -} - -/** The metric dimension name and value. */ -export interface MetricSingleDimension { - /** Name of the dimension. */ - name: string; - /** Value of the dimension. */ - value: string; -} - -/** The baseline values for a single sensitivity value. */ -export interface SingleBaseline { - /** the sensitivity of the baseline. */ - sensitivity: BaselineSensitivity; - /** The low thresholds of the baseline. */ - lowThresholds: number[]; - /** The high thresholds of the baseline. */ - highThresholds: number[]; -} - -/** Represents a baseline metadata value. */ -export interface BaselineMetadata { - /** Name of the baseline metadata. */ - name: string; - /** Value of the baseline metadata. */ - value: string; -} - -/** Represents a collection of alert rule resources. */ -export interface MetricAlertResourceCollection { - /** the values for the alert rule resources. */ - value?: MetricAlertResource[]; -} - -/** The rule criteria that defines the conditions of the alert rule. */ -export interface MetricAlertCriteria { - /** Polymorphic discriminator, which specifies the different types this object can be */ - odataType: - | "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria" - | "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria" - | "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria"; - /** Describes unknown properties. The value of an unknown property can be of "any" type. */ - [property: string]: any; -} - -/** An alert action. */ -export interface MetricAlertAction { - /** the id of the action group to use. */ - actionGroupId?: string; - /** This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook. */ - webHookProperties?: { [propertyName: string]: string }; -} - -/** An azure resource object */ -export interface ResourceAutoGenerated6 { - /** - * Azure resource Id - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * Azure resource name - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Azure resource type - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** Resource location */ - location: string; - /** Resource tags */ - tags?: { [propertyName: string]: string }; -} - -/** The metric alert resource for patch operations. */ -export interface MetricAlertResourcePatch { - /** Resource tags */ - tags?: { [propertyName: string]: string }; - /** the description of the metric alert that will be included in the alert email. */ - description?: string; - /** Alert severity {0, 1, 2, 3, 4} */ - severity?: number; - /** the flag that indicates whether the metric alert is enabled. */ - enabled?: boolean; - /** the list of resource id's that this metric alert is scoped to. */ - scopes?: string[]; - /** how often the metric alert is evaluated represented in ISO 8601 duration format. */ - evaluationFrequency?: string; - /** the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. */ - windowSize?: string; - /** the resource type of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. */ - targetResourceType?: string; - /** the region of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. */ - targetResourceRegion?: string; - /** defines the specific alert criteria information. */ - criteria?: MetricAlertCriteriaUnion; - /** the flag that indicates whether the alert should be auto resolved or not. The default is true. */ - autoMitigate?: boolean; - /** the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. */ - actions?: MetricAlertAction[]; - /** - * Last time the rule was updated in ISO8601 format. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly lastUpdatedTime?: Date; - /** - * the value indicating whether this alert rule is migrated. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isMigrated?: boolean; -} - -/** Represents a collection of alert rule resources. */ -export interface MetricAlertStatusCollection { - /** the values for the alert rule resources. */ - value?: MetricAlertStatus[]; -} - -/** An alert status. */ -export interface MetricAlertStatus { - /** The status name. */ - name?: string; - /** The alert rule arm id. */ - id?: string; - /** The extended resource type name. */ - type?: string; - /** The alert status properties of the metric alert status. */ - properties?: MetricAlertStatusProperties; -} - -/** An alert status properties. */ -export interface MetricAlertStatusProperties { - /** An object describing the type of the dimensions. */ - dimensions?: { [propertyName: string]: string }; - /** status value */ - status?: string; - /** UTC time when the status was checked. */ - timestamp?: Date; -} - -/** Represents a collection of scheduled query rule resources. */ -export interface ScheduledQueryRuleResourceCollection { - /** The values for the scheduled query rule resources. */ - value?: ScheduledQueryRuleResource[]; - /** - * Provides the link to retrieve the next set of elements. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** The scheduled query rule resource. */ -export interface ScheduledQueryRuleResource { - /** - * 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; - /** The identity of the resource. */ - identity?: Identity; - /** Resource tags. */ - tags?: { [propertyName: string]: string }; - /** The geo-location where the resource lives */ - location: string; - /** Indicates the type of scheduled query rule. The default is LogAlert. */ - kind?: Kind; - /** - * The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly etag?: string; - /** - * SystemData of ScheduledQueryRule. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; - /** - * The api-version used when creating this alert rule - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly createdWithApiVersion?: string; - /** - * True if alert rule is legacy Log Analytic rule - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isLegacyLogAnalyticsRule?: boolean; - /** The description of the scheduled query rule. */ - description?: string; - /** The display name of the alert rule */ - displayName?: string; - /** Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules of the kind LogAlert. */ - severity?: AlertSeverity; - /** The flag which indicates whether this scheduled query rule is enabled. Value should be true or false */ - enabled?: boolean; - /** The list of resource id's that this scheduled query rule is scoped to. */ - scopes?: string[]; - /** How often the scheduled query rule is evaluated represented in ISO 8601 duration format. Relevant and required only for rules of the kind LogAlert. */ - evaluationFrequency?: string; - /** The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required only for rules of the kind LogAlert. */ - windowSize?: string; - /** If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert. */ - overrideQueryTimeRange?: string; - /** List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual machine in the resource group which meet the alert criteria. Relevant only for rules of the kind LogAlert */ - targetResourceTypes?: string[]; - /** The rule criteria that defines the conditions of the scheduled query rule. */ - criteria?: ScheduledQueryRuleCriteria; - /** Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. Relevant only for rules of the kind LogAlert. */ - muteActionsDuration?: string; - /** Actions to invoke when the alert fires. */ - actions?: Actions; - /** - * The flag which indicates whether this scheduled query rule has been configured to be stored in the customer's storage. The default is false. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isWorkspaceAlertsStorageConfigured?: boolean; - /** The flag which indicates whether this scheduled query rule should be stored in the customer's storage. The default is false. Relevant only for rules of the kind LogAlert. */ - checkWorkspaceAlertsStorageConfigured?: boolean; - /** The flag which indicates whether the provided query should be validated or not. The default is false. Relevant only for rules of the kind LogAlert. */ - skipQueryValidation?: boolean; - /** The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only for rules of the kind LogAlert. */ - autoMitigate?: boolean; - /** Defines the configuration for resolving fired alerts. Relevant only for rules of the kind LogAlert. */ - ruleResolveConfiguration?: RuleResolveConfiguration; -} - -/** Identity for the resource. */ -export interface Identity { - /** - * The principal ID of resource identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The tenant ID of resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly tenantId?: string; - /** Type of managed service identity. */ - type: IdentityType; - /** The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ - userAssignedIdentities?: { [propertyName: string]: UserIdentityProperties }; -} - -/** User assigned identity properties. */ -export interface UserIdentityProperties { - /** - * The principal id of user assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The client id of user assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly clientId?: string; -} - -/** The rule criteria that defines the conditions of the scheduled query rule. */ -export interface ScheduledQueryRuleCriteria { - /** A list of conditions to evaluate against the specified scopes */ - allOf?: Condition[]; -} - -/** A condition of the scheduled query rule. */ -export interface Condition { - /** Log query alert */ - query?: string; - /** Aggregation type. Relevant and required only for rules of the kind LogAlert. */ - timeAggregation?: TimeAggregation; - /** The column containing the metric measure number. Relevant only for rules of the kind LogAlert. */ - metricMeasureColumn?: string; - /** The column containing the resource id. The content of the column must be a uri formatted as resource id. Relevant only for rules of the kind LogAlert. */ - resourceIdColumn?: string; - /** List of Dimensions conditions */ - dimensions?: Dimension[]; - /** The criteria operator. Relevant and required only for rules of the kind LogAlert. */ - operator?: ConditionOperator; - /** the criteria threshold value that activates the alert. Relevant and required only for rules of the kind LogAlert. */ - threshold?: number; - /** The minimum number of violations required within the selected lookback time window required to raise an alert. Relevant only for rules of the kind LogAlert. */ - failingPeriods?: ConditionFailingPeriods; - /** The name of the metric to be sent. Relevant and required only for rules of the kind LogToMetric. */ - metricName?: string; -} - -/** Dimension splitting and filtering definition */ -export interface Dimension { - /** Name of the dimension */ - name: string; - /** Operator for dimension values */ - operator: DimensionOperator; - /** List of dimension values */ - values: string[]; -} - -/** The minimum number of violations required within the selected lookback time window required to raise an alert. Relevant only for rules of the kind LogAlert. */ -export interface ConditionFailingPeriods { - /** The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points. Default value is 1 */ - numberOfEvaluationPeriods?: number; - /** The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. Default value is 1 */ - minFailingPeriodsToAlert?: number; -} - -/** Actions to invoke when the alert fires. */ -export interface Actions { - /** Action Group resource Ids to invoke when the alert fires. */ - actionGroups?: string[]; - /** The properties of an alert payload. */ - customProperties?: { [propertyName: string]: string }; - /** The properties of an action properties. */ - actionProperties?: { [propertyName: string]: string }; -} - -/** TBD. Relevant only for rules of the kind LogAlert. */ -export interface RuleResolveConfiguration { - /** The flag that indicates whether or not to auto resolve a fired alert. */ - autoResolved?: boolean; - /** The duration a rule must evaluate as healthy before the fired alert is automatically resolved represented in ISO 8601 duration format. */ - timeToResolve?: string; -} - -/** The scheduled query rule resource for patch operations. */ -export interface ScheduledQueryRuleResourcePatch { - /** The identity of the resource. */ - identity?: Identity; - /** Resource tags */ - tags?: { [propertyName: string]: string }; - /** - * The api-version used when creating this alert rule - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly createdWithApiVersion?: string; - /** - * True if alert rule is legacy Log Analytic rule - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isLegacyLogAnalyticsRule?: boolean; - /** The description of the scheduled query rule. */ - description?: string; - /** The display name of the alert rule */ - displayName?: string; - /** Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules of the kind LogAlert. */ - severity?: AlertSeverity; - /** The flag which indicates whether this scheduled query rule is enabled. Value should be true or false */ - enabled?: boolean; - /** The list of resource id's that this scheduled query rule is scoped to. */ - scopes?: string[]; - /** How often the scheduled query rule is evaluated represented in ISO 8601 duration format. Relevant and required only for rules of the kind LogAlert. */ - evaluationFrequency?: string; - /** The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required only for rules of the kind LogAlert. */ - windowSize?: string; - /** If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert. */ - overrideQueryTimeRange?: string; - /** List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual machine in the resource group which meet the alert criteria. Relevant only for rules of the kind LogAlert */ - targetResourceTypes?: string[]; - /** The rule criteria that defines the conditions of the scheduled query rule. */ - criteria?: ScheduledQueryRuleCriteria; - /** Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. Relevant only for rules of the kind LogAlert. */ - muteActionsDuration?: string; - /** Actions to invoke when the alert fires. */ - actions?: Actions; - /** - * The flag which indicates whether this scheduled query rule has been configured to be stored in the customer's storage. The default is false. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isWorkspaceAlertsStorageConfigured?: boolean; - /** The flag which indicates whether this scheduled query rule should be stored in the customer's storage. The default is false. Relevant only for rules of the kind LogAlert. */ - checkWorkspaceAlertsStorageConfigured?: boolean; - /** The flag which indicates whether the provided query should be validated or not. The default is false. Relevant only for rules of the kind LogAlert. */ - skipQueryValidation?: boolean; - /** The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only for rules of the kind LogAlert. */ - autoMitigate?: boolean; - /** Defines the configuration for resolving fired alerts. Relevant only for rules of the kind LogAlert. */ - ruleResolveConfiguration?: RuleResolveConfiguration; -} - -/** Information about a container with data for a given resource. */ -export interface DataContainer { - /** Log Analytics workspace information. */ - workspace: WorkspaceInfo; -} - -/** Information about a Log Analytics Workspace. */ -export interface WorkspaceInfo { - /** Azure Resource Manager identifier of the Log Analytics Workspace. */ - id: string; - /** Location of the Log Analytics workspace. */ - location: string; - /** Log Analytics workspace identifier. */ - customerId: string; -} - -/** An azure resource object */ -export interface ProxyResource { - /** - * Azure resource Id - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * Azure resource name - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Azure resource type - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; -} - -/** An error response from the API. */ -export interface ResponseWithError { - /** Error information. */ - error: ErrorModel; -} - -/** Error details. */ -export interface ErrorModel { - /** Error code identifying the specific error. */ - code: string; - /** Error message in the caller's locale. */ - message?: string; -} - -/** Describes the list of Azure Monitor PrivateLinkScope resources. */ -export interface AzureMonitorPrivateLinkScopeListResult { - /** List of Azure Monitor PrivateLinkScope definitions. */ - value: AzureMonitorPrivateLinkScope[]; - /** The URI to get the next set of Azure Monitor PrivateLinkScope definitions if too many PrivateLinkScopes where returned in the result set. */ - nextLink?: string; -} - -/** The Private Endpoint resource. */ -export interface PrivateEndpointAutoGenerated { - /** - * The ARM identifier for Private Endpoint - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: 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. */ - queryAccessMode: AccessMode; - /** Specifies the default access mode of ingestion 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. */ - ingestionAccessMode: AccessMode; - /** List of exclusions that override the default access mode settings for specific private endpoint connections. */ - exclusions?: AccessModeSettingsExclusion[]; -} - -/** Properties that define the scope private link mode settings exclusion item. This setting applies to a specific private endpoint connection and overrides the default settings for that private endpoint connection. */ -export interface AccessModeSettingsExclusion { - /** The private endpoint connection name associated to the private endpoint on which we want to apply the specific access mode settings. */ - privateEndpointConnectionName?: string; - /** Specifies the access mode of queries through the specified private endpoint connection in the exclusion. */ - queryAccessMode?: AccessMode; - /** Specifies the access mode of ingestion through the specified private endpoint connection in the exclusion. */ - ingestionAccessMode?: AccessMode; -} - -/** 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?: ErrorDetailAutoGenerated; -} - -/** 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 */ - tags?: { [propertyName: string]: string }; -} - -/** The status of operation. */ -export interface OperationStatus { - /** The operation Id. */ - id?: string; - /** The operation name. */ - name?: string; - /** Start time of the job in standard ISO8601 format. */ - startTime?: Date; - /** End time of the job in standard ISO8601 format. */ - endTime?: Date; - /** The status of the operation. */ - status?: string; - /** The error detail of the operation if any. */ - error?: ErrorDetailAutoGenerated; -} - -/** A list of private link resources */ -export interface PrivateLinkResourceListResult { - /** Array of private link resources */ - value?: PrivateLinkResource[]; -} - -/** List of private endpoint connection associated with the specified storage account */ -export interface PrivateEndpointConnectionListResult { - /** Array of private endpoint connections */ - value?: PrivateEndpointConnectionAutoGenerated[]; -} - -/** A list of scoped resources in a private link scope. */ -export interface ScopedResourceListResult { - /** - * Array of results. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: ScopedResource[]; - /** - * Link to retrieve next page of results. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** An Activity Log Alert rule condition that is met when all its member conditions are met. */ -export interface AlertRuleAllOfCondition { - /** The list of Activity Log Alert rule conditions. */ - allOf: AlertRuleAnyOfOrLeafCondition[]; -} - -/** - * An Activity Log Alert rule condition that is met by comparing the field and value of an Activity Log event. - * This condition must contain 'field' and either 'equals' or 'containsAny'. - */ -export interface AlertRuleLeafCondition { - /** - * The name of the Activity Log event's field that this condition will examine. - * The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. - */ - field?: string; - /** The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. */ - equals?: string; - /** The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. */ - containsAny?: string[]; -} - -/** A list of Activity Log Alert rule actions. */ -export interface ActionList { - /** The list of the Action Groups. */ - actionGroups?: ActionGroup[]; -} - -/** A pointer to an Azure Action Group. */ -export interface ActionGroup { - /** The resource ID of the Action Group. This cannot be null or empty. */ - actionGroupId: string; - /** the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. */ - webhookProperties?: { [propertyName: string]: string }; -} - -/** An Azure resource object. */ -export interface AzureResourceAutoGenerated { - /** - * The resource Id. - * 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. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** The location of the resource. Azure Activity Log Alert rules are supported on Global, West Europe and North Europe regions. */ - location?: string; - /** The tags of the resource. */ - tags?: { [propertyName: string]: string }; -} - -/** The error response. */ -export interface ErrorResponseAutoGenerated4 { - /** - * The error code. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly code?: string; - /** - * The error message indicating why the operation failed. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly message?: string; -} - -/** An Activity Log Alert rule object for the body of patch operations. */ -export interface AlertRulePatchObject { - /** The resource tags */ - tags?: { [propertyName: string]: string }; - /** Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its actions will be activated. */ - enabled?: boolean; -} - -/** A list of Activity Log Alert rules. */ -export interface AlertRuleList { - /** The list of Activity Log Alert rules. */ - value?: ActivityLogAlertResource[]; - /** Provides the link to retrieve the next set of elements. */ - nextLink?: string; -} - -/** A pageable list of resources. */ -export interface DataCollectionEndpointResourceListResult { - /** A list of resources. */ - value: DataCollectionEndpointResource[]; - /** The URL to use for getting the next set of results. */ - nextLink?: string; -} - -/** Definition of ARM tracked top level resource. */ -export interface DataCollectionEndpointResource { - /** The geo-location where the resource lives. */ - location: string; - /** Resource tags. */ - 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. - */ - 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. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * Resource entity tag (ETag). - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly etag?: string; - /** - * Metadata pertaining to creation and last modification of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: DataCollectionEndpointResourceSystemData; - /** Description of the data collection endpoint. */ - description?: string; - /** The immutable ID of this data collection endpoint resource. This property is READ-ONLY. */ - immutableId?: string; - /** The endpoint used by clients to access their configuration. */ - 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; - /** - * The resource provisioning state. This property is READ-ONLY. - * 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. */ -export interface DataCollectionEndpoint { - /** Description of the data collection endpoint. */ - description?: string; - /** The immutable ID of this data collection endpoint resource. This property is READ-ONLY. */ - immutableId?: string; - /** The endpoint used by clients to access their configuration. */ - 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; - /** - * The resource provisioning state. This property is READ-ONLY. - * 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. */ -export interface ConfigurationAccessEndpointSpec { - /** - * 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 endpoint used for ingesting logs. */ -export interface LogsIngestionEndpointSpec { - /** - * 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 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?: 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. */ -export interface DataCollectionRuleAssociationProxyOnlyResourceListResult { - /** A list of resources. */ - value: DataCollectionRuleAssociationProxyOnlyResource[]; - /** The URL to use for getting the next set of results. */ - nextLink?: string; -} - -/** Definition of generic ARM proxy resource. */ -export interface DataCollectionRuleAssociationProxyOnlyResource { - /** - * Fully qualified ID of the resource. - * 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. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * Resource entity tag (ETag). - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly etag?: string; - /** - * Metadata pertaining to creation and last modification of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: DataCollectionRuleAssociationProxyOnlyResourceSystemData; - /** Description of the association. */ - description?: string; - /** The resource ID of the data collection rule that is to be associated. */ - dataCollectionRuleId?: string; - /** The resource ID of the data collection endpoint that is to be associated. */ - dataCollectionEndpointId?: string; - /** - * The resource provisioning state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: KnownDataCollectionRuleAssociationProvisioningState; - /** - * Metadata about the resource - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly metadata?: DataCollectionRuleAssociationMetadata; -} - -/** Definition of association of a data collection rule with a monitored Azure resource. */ -export interface DataCollectionRuleAssociation { - /** Description of the association. */ - description?: string; - /** The resource ID of the data collection rule that is to be associated. */ - dataCollectionRuleId?: string; - /** The resource ID of the data collection endpoint that is to be associated. */ - dataCollectionEndpointId?: string; - /** - * The resource provisioning state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: KnownDataCollectionRuleAssociationProvisioningState; - /** - * Metadata about the resource - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly metadata?: DataCollectionRuleAssociationMetadata; -} - -/** A pageable list of resources. */ -export interface DataCollectionRuleResourceListResult { - /** A list of resources. */ - value: DataCollectionRuleResource[]; - /** The URL to use for getting the next set of results. */ - nextLink?: string; -} - -/** Definition of ARM tracked top level resource. */ -export interface DataCollectionRuleResource { - /** The geo-location where the resource lives. */ - location: string; - /** Resource tags. */ - 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. - */ - 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. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * Resource entity tag (ETag). - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly etag?: string; - /** - * Metadata pertaining to creation and last modification of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: DataCollectionRuleResourceSystemData; - /** Description of the data collection rule. */ - description?: string; - /** - * The immutable ID of this data collection rule. This property is READ-ONLY. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly immutableId?: string; - /** The resource ID of the data collection endpoint that this rule can be used with. */ - dataCollectionEndpointId?: string; - /** - * Metadata about the resource - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly metadata?: DataCollectionRuleMetadata; - /** Declaration of custom streams used in this rule. */ - streamDeclarations?: { [propertyName: string]: StreamDeclaration }; - /** - * The specification of data sources. - * This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint. - */ - dataSources?: DataCollectionRuleDataSources; - /** The specification of destinations. */ - destinations?: DataCollectionRuleDestinations; - /** The specification of data flows. */ - dataFlows?: DataFlow[]; - /** - * The resource provisioning state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: KnownDataCollectionRuleProvisioningState; -} - -/** Definition of what monitoring data to collect and where that data should be sent. */ -export interface DataCollectionRule { - /** Description of the data collection rule. */ - description?: string; - /** - * The immutable ID of this data collection rule. This property is READ-ONLY. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly immutableId?: string; - /** The resource ID of the data collection endpoint that this rule can be used with. */ - dataCollectionEndpointId?: string; - /** - * Metadata about the resource - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly metadata?: DataCollectionRuleMetadata; - /** Declaration of custom streams used in this rule. */ - streamDeclarations?: { [propertyName: string]: StreamDeclaration }; - /** - * The specification of data sources. - * This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint. - */ - dataSources?: DataCollectionRuleDataSources; - /** The specification of destinations. */ - destinations?: DataCollectionRuleDestinations; - /** The specification of data flows. */ - dataFlows?: DataFlow[]; - /** - * The resource provisioning state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: KnownDataCollectionRuleProvisioningState; -} - -/** Declaration of a custom stream. */ -export interface StreamDeclaration { - /** List of columns used by data in this stream. */ - columns?: ColumnDefinition[]; -} - -/** Definition of custom data column. */ -export interface ColumnDefinition { - /** The name of the column. */ - name?: string; - /** The type of the column data. */ - type?: KnownColumnDefinitionType; -} - -/** Specification of data sources that will be collected. */ -export interface DataSourcesSpec { - /** The list of performance counter data source configurations. */ - performanceCounters?: PerfCounterDataSource[]; - /** The list of Windows Event Log data source configurations. */ - windowsEventLogs?: WindowsEventLogDataSource[]; - /** The list of Syslog data source configurations. */ - syslog?: SyslogDataSource[]; - /** The list of Azure VM extension data source configurations. */ - extensions?: ExtensionDataSource[]; - /** The list of Log files source configurations. */ - 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; -} - -/** - * Definition of which performance counters will be collected and how they will be collected by this data collection rule. - * Collected from both Windows and Linux machines where the counter is present. - */ -export interface PerfCounterDataSource { - /** - * List of streams that this data source will be sent to. - * A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will be sent to. - */ - streams?: KnownPerfCounterDataSourceStreams[]; - /** The number of seconds between consecutive counter measurements (samples). */ - samplingFrequencyInSeconds?: number; - /** - * A list of specifier names of the performance counters you want to collect. - * Use a wildcard (*) to collect a counter for all instances. - * To get a list of performance counters on Windows, run the command 'typeperf'. - */ - counterSpecifiers?: 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 which Windows Event Log events will be collected and how they will be collected. - * Only collected from Windows machines. - */ -export interface WindowsEventLogDataSource { - /** - * List of streams that this data source will be sent to. - * A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will be sent to. - */ - streams?: KnownWindowsEventLogDataSourceStreams[]; - /** A list of Windows Event Log queries in XPATH format. */ - xPathQueries?: 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 which syslog data will be collected and how it will be collected. - * Only collected from Linux machines. - */ -export interface SyslogDataSource { - /** - * List of streams that this data source will be sent to. - * A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will be sent to. - */ - streams?: KnownSyslogDataSourceStreams[]; - /** The list of facility names. */ - facilityNames?: KnownSyslogDataSourceFacilityNames[]; - /** The log levels to collect. */ - logLevels?: KnownSyslogDataSourceLogLevels[]; - /** - * 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 which data will be collected from a separate VM extension that integrates with the Azure Monitor Agent. - * Collected from either Windows and Linux machines, depending on which extension is defined. - */ -export interface ExtensionDataSource { - /** - * List of streams that this data source will be sent to. - * A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will be sent to. - */ - streams?: KnownExtensionDataSourceStreams[]; - /** The name of the VM extension. */ - extensionName: string; - /** The extension settings. The format is specific for particular extension. */ - extensionSettings?: Record; - /** The list of data sources this extension needs data from. */ - inputDataSources?: 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 which custom log files will be collected by this data collection rule */ -export interface LogFilesDataSource { - /** - * List of streams that this data source will be sent to. - * A stream indicates what schema will be used for this data source - */ - streams: string[]; - /** File Patterns where the log files are located */ - filePatterns: string[]; - /** The data format of the log files */ - format: KnownLogFilesDataSourceFormat; - /** The log files specific settings. */ - settings?: LogFilesDataSourceSettings; - /** - * 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 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; -} - -export interface DataImportSources { - /** Definition of Event Hub configuration. */ - eventHub?: DataImportSourcesEventHub; -} - -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. */ -export interface LogAnalyticsDestination { - /** The resource ID of the Log Analytics workspace. */ - workspaceResourceId?: string; - /** - * The Customer ID of the Log Analytics workspace. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly workspaceId?: string; - /** - * A friendly name for the destination. - * This name should be unique across all destinations (regardless of type) within the data collection rule. - */ - name?: string; -} - -/** Monitoring account destination. */ -export interface MonitoringAccountDestination { - /** The resource ID of the monitoring account. */ - accountResourceId?: string; - /** - * The immutable ID of the account. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly accountId?: string; - /** - * A friendly name for the destination. - * This name should be unique across all destinations (regardless of type) within the data collection rule. - */ - 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; -} - -export interface EventHubDestination { - /** The resource ID of the event hub. */ - eventHubResourceId?: string; - /** - * A friendly name for the destination. - * This name should be unique across all destinations (regardless of type) within the data collection rule. - */ - name?: string; -} - -export interface EventHubDirectDestination { - /** The resource ID of the event hub. */ - eventHubResourceId?: string; - /** - * A friendly name for the destination. - * This name should be unique across all destinations (regardless of type) within the data collection rule. - */ - name?: string; -} - -export interface StorageBlobDestination { - /** The container name of the Storage Blob. */ - containerName?: string; - /** The resource ID of the storage account. */ - storageAccountResourceId?: string; - /** - * A friendly name for the destination. - * This name should be unique across all destinations (regardless of type) within the data collection rule. - */ - name?: string; -} - -export interface StorageTableDestination { - /** The name of the Storage Table. */ - tableName?: string; - /** The resource ID of the storage account. */ - storageAccountResourceId?: string; - /** - * 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; - /** The builtIn transform to transform stream data */ - builtInTransform?: string; -} - -/** The claims for a rule management event data source. */ -export interface RuleManagementEventClaimsDataSource { - /** the email address. */ - emailAddress?: string; -} - -/** How the data that is collected should be combined over time. */ -export interface ManagementEventAggregationCondition { - /** the condition operator. */ - operator?: ConditionOperator; - /** The threshold value that activates the alert. */ - threshold?: number; - /** the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. If specified then it must be between 5 minutes and 1 day. */ - windowSize?: string; -} - -/** The types of conditions for a multi resource alert. */ -export interface MultiMetricCriteria { - /** Polymorphic discriminator, which specifies the different types this object can be */ - criterionType: "StaticThresholdCriterion" | "DynamicThresholdCriterion"; - /** Describes unknown properties. The value of an unknown property can be of "any" type. */ - [property: string]: any; - /** Name of the criteria. */ - name: string; - /** Name of the metric. */ - metricName: string; - /** Namespace of the metric. */ - metricNamespace?: string; - /** the criteria time aggregation types. */ - timeAggregation: AggregationTypeEnum; - /** List of dimension conditions. */ - dimensions?: MetricDimension[]; - /** Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped. */ - skipMetricValidation?: boolean; -} - -/** Specifies a metric dimension. */ -export interface MetricDimension { - /** Name of the dimension. */ - name: string; - /** the dimension operator. Only 'Include' and 'Exclude' are supported */ - operator: string; - /** list of dimension values. */ - values: string[]; -} - -/** The minimum number of violations required within the selected lookback time window required to raise an alert. */ -export interface DynamicThresholdFailingPeriods { - /** The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points. */ - numberOfEvaluationPeriods: number; - /** The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. */ - minFailingPeriodsToAlert: number; -} - -/** Resource properties */ -export interface AzureMonitorWorkspaceResourceProperties - extends AzureMonitorWorkspace {} - -/** Properties related to the metrics container in 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 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. */ - notifications?: AutoscaleNotification[]; - /** the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default value is 'false'. */ - enabled?: boolean; - /** the predictive autoscale policy mode. */ - predictiveAutoscalePolicy?: PredictiveAutoscalePolicy; - /** the name of the autoscale setting. */ - namePropertiesName?: string; - /** the resource identifier of the resource that the autoscale setting should be added to. */ - targetResourceUri?: string; - /** the location of the resource that the autoscale setting should be added to. */ - targetResourceLocation?: string; -} - -/** 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 */ - odataType: "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition"; - /** the operator used to compare the data and the threshold. */ - operator: ConditionOperator; - /** the threshold value that activates the alert. */ - threshold: number; - /** the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. If specified then it must be between 5 minutes and 1 day. */ - windowSize?: string; - /** the time aggregation operator. How the data that are collected should be combined over time. The default value is the PrimaryAggregationType of the Metric. */ - timeAggregation?: TimeAggregationOperator; -} - -/** A rule condition based on a certain number of locations failing. */ -export interface LocationThresholdRuleCondition extends RuleCondition { - /** Polymorphic discriminator, which specifies the different types this object can be */ - odataType: "Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition"; - /** the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. If specified then it must be between 5 minutes and 1 day. */ - windowSize?: string; - /** the number of locations that must fail to activate the alert. */ - failedLocationCount: number; -} - -/** A management event rule condition. */ -export interface ManagementEventRuleCondition extends RuleCondition { - /** Polymorphic discriminator, which specifies the different types this object can be */ - odataType: "Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition"; - /** How the data that is collected should be combined over time and when the alert is activated. Note that for management event alerts aggregation is optional – if it is not provided then any event will cause the alert to activate. */ - aggregation?: ManagementEventAggregationCondition; -} - -/** A rule metric data source. The discriminator value is always RuleMetricDataSource in this case. */ -export interface RuleMetricDataSource extends RuleDataSource { - /** Polymorphic discriminator, which specifies the different types this object can be */ - odataType: "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource"; - /** the name of the metric that defines what the rule monitors. */ - metricName?: string; -} - -/** A rule management event data source. The discriminator fields is always RuleManagementEventDataSource in this case. */ -export interface RuleManagementEventDataSource extends RuleDataSource { - /** Polymorphic discriminator, which specifies the different types this object can be */ - odataType: "Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource"; - /** the event name. */ - eventName?: string; - /** the event source. */ - eventSource?: string; - /** the level. */ - level?: string; - /** The name of the operation that should be checked for. If no name is provided, any operation will match. */ - operationName?: string; - /** the resource group name. */ - resourceGroupName?: string; - /** the resource provider name. */ - resourceProviderName?: string; - /** The status of the operation that should be checked for. If no status is provided, any status will match. */ - status?: string; - /** the substatus. */ - subStatus?: string; - /** the claims. */ - claims?: RuleManagementEventClaimsDataSource; -} - -/** Specifies the action to send email when the rule condition is evaluated. The discriminator is always RuleEmailAction in this case. */ -export interface RuleEmailAction extends RuleAction { - /** Polymorphic discriminator, which specifies the different types this object can be */ - odataType: "Microsoft.Azure.Management.Insights.Models.RuleEmailAction"; - /** Whether the administrators (service and co-administrators) of the service should be notified when the alert is activated. */ - sendToServiceOwners?: boolean; - /** the list of administrator's custom email addresses to notify of the activation of the alert. */ - customEmails?: string[]; -} - -/** Specifies the action to post to service when the rule condition is evaluated. The discriminator is always RuleWebhookAction in this case. */ -export interface RuleWebhookAction extends RuleAction { - /** Polymorphic discriminator, which specifies the different types this object can be */ - odataType: "Microsoft.Azure.Management.Insights.Models.RuleWebhookAction"; - /** the service uri to Post the notification when the alert activates or resolves. */ - serviceUri?: string; - /** the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. */ - properties?: { [propertyName: string]: string }; -} - -/** The alert rule resource. */ -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. */ - description?: string; - /** the provisioning state. */ - provisioningState?: string; - /** the flag that indicates whether the alert rule is enabled. */ - isEnabled: boolean; - /** the condition that results in the alert rule being activated. */ - condition: RuleConditionUnion; - /** action that is performed when the alert rule becomes active, and when an alert condition is resolved. */ - action?: RuleActionUnion; - /** the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. */ - actions?: RuleActionUnion[]; - /** - * Last time the rule was updated in ISO8601 format. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly lastUpdatedTime?: Date; -} - -/** The log profile resource. */ -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}'. */ - serviceBusRuleId?: string; - /** List of regions for which Activity Log events should be stored or streamed. It is a comma separated list of valid ARM locations including the 'global' location. */ - locations: string[]; - /** the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.' */ - categories: string[]; - /** the retention policy for the events in the log. */ - retentionPolicy: RetentionPolicy; -} - -/** The diagnostic setting resource. */ -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. - */ - readonly systemData?: SystemData; - /** The resource ID of the storage account to which you would like to send Diagnostic Logs. */ - storageAccountId?: string; - /** The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility. */ - serviceBusRuleId?: string; - /** The resource Id for the event hub authorization rule. */ - eventHubAuthorizationRuleId?: string; - /** The name of the event hub. If none is specified, the default event hub will be selected. */ - eventHubName?: string; - /** The list of metric settings. */ - metrics?: MetricSettings[]; - /** The list of logs settings. */ - logs?: LogSettings[]; - /** The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 */ - workspaceId?: string; - /** The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. */ - marketplacePartnerId?: string; - /** A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, or use a destination type constructed as follows: _. Possible values are: Dedicated and null (null is default.) */ - logAnalyticsDestinationType?: string; -} - -/** The diagnostic settings category resource. */ -export interface DiagnosticSettingsCategoryResource - extends ResourceAutoGenerated5 { - /** - * The system metadata related to this resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; - /** The type of the diagnostic settings category. */ - categoryType?: CategoryType; - /** the collection of what category groups are supported. */ - categoryGroups?: string[]; -} - -/** The Private Endpoint Connection resource. */ -export interface PrivateEndpointConnectionAutoGenerated - extends ResourceAutoGenerated5 { - /** The resource of private end point. */ - 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. */ - provisioningState?: PrivateEndpointConnectionProvisioningState; -} - -/** 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; -} - -/** A private link resource */ -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. - */ - readonly groupId?: string; - /** - * The private link resource required member names. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly requiredMembers?: string[]; - /** The private link resource Private link DNS zone name. */ - requiredZoneNames?: string[]; -} - -/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ -export interface ProxyResourceAutoGenerated extends ResourceAutoGenerated5 {} - -/** An action group resource. */ -export interface ActionGroupResource extends AzureResource { - /** The short name of the action group. This will be used in SMS messages. */ - groupShortName?: string; - /** Indicates whether this action group is enabled. If an 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 action group. */ - emailReceivers?: EmailReceiver[]; - /** The list of SMS receivers that are part of this action group. */ - smsReceivers?: SmsReceiver[]; - /** The list of webhook receivers that are part of this action group. */ - webhookReceivers?: WebhookReceiver[]; - /** The list of ITSM receivers that are part of this action group. */ - itsmReceivers?: ItsmReceiver[]; - /** The list of AzureAppPush receivers that are part of this action group. */ - azureAppPushReceivers?: AzureAppPushReceiver[]; - /** The list of AutomationRunbook receivers that are part of this action group. */ - automationRunbookReceivers?: AutomationRunbookReceiver[]; - /** The list of voice receivers that are part of this action group. */ - voiceReceivers?: VoiceReceiver[]; - /** The list of logic app receivers that are part of this action group. */ - logicAppReceivers?: LogicAppReceiver[]; - /** The list of azure function receivers that are part of this action group. */ - azureFunctionReceivers?: AzureFunctionReceiver[]; - /** The list of ARM role receivers that are part of this action group. Roles are Azure RBAC roles and only built-in roles are supported. */ - armRoleReceivers?: ArmRoleReceiver[]; - /** The list of event hub receivers that are part of this action group. */ - 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 { - /** Polymorphic discriminator, which specifies the different types this object can be */ - odataType: "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria"; - /** The list of metric criteria for this 'all of' operation. */ - allOf?: MetricCriteria[]; -} - -/** Specifies the metric alert rule criteria for a web test resource. */ -export interface WebtestLocationAvailabilityCriteria - extends MetricAlertCriteria { - /** Polymorphic discriminator, which specifies the different types this object can be */ - odataType: "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria"; - /** The Application Insights web test Id. */ - webTestId: string; - /** The Application Insights resource Id. */ - componentId: string; - /** The number of failed locations. */ - failedLocationCount: number; -} - -/** Specifies the metric alert criteria for multiple resource that has multiple metric criteria. */ -export interface MetricAlertMultipleResourceMultipleMetricCriteria - extends MetricAlertCriteria { - /** Polymorphic discriminator, which specifies the different types this object can be */ - odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria"; - /** the list of multiple metric criteria for this 'all of' operation. */ - allOf?: MultiMetricCriteriaUnion[]; -} - -/** The metric alert resource. */ -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} */ - severity: number; - /** the flag that indicates whether the metric alert is enabled. */ - enabled: boolean; - /** the list of resource id's that this metric alert is scoped to. */ - scopes: string[]; - /** how often the metric alert is evaluated represented in ISO 8601 duration format. */ - evaluationFrequency: string; - /** the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. */ - windowSize: string; - /** the resource type of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. */ - targetResourceType?: string; - /** the region of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. */ - targetResourceRegion?: string; - /** defines the specific alert criteria information. */ - criteria: MetricAlertCriteriaUnion; - /** the flag that indicates whether the alert should be auto resolved or not. The default is true. */ - autoMitigate?: boolean; - /** the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. */ - actions?: MetricAlertAction[]; - /** - * Last time the rule was updated in ISO8601 format. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly lastUpdatedTime?: Date; - /** - * the value indicating whether this alert rule is migrated. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isMigrated?: boolean; -} - -/** VM Insights onboarding status for a resource. */ -export interface VMInsightsOnboardingStatus extends ProxyResource { - /** Azure Resource Manager identifier of the resource whose onboarding status is being represented. */ - resourceId?: string; - /** The onboarding status for the resource. Note that, a higher level scope, e.g., resource group or subscription, is considered onboarded if at least one resource under it is onboarded. */ - onboardingStatus?: OnboardingStatus; - /** The status of VM Insights data from the resource. When reported as `present` the data array will contain information about the data containers to which data for the specified resource is being routed. */ - dataStatus?: DataStatus; - /** Containers that currently store VM Insights data for the specified resource. */ - data?: DataContainer[]; -} - -/** - * An Activity Log Alert rule condition that is met when all its member conditions are met. - * Each condition can be of one of the following types: - * __Important__: Each type has its unique subset of properties. Properties from different types CANNOT exist in one condition. - * * __Leaf Condition -__ must contain 'field' and either 'equals' or 'containsAny'. - * _Please note, 'anyOf' should __not__ be set in a Leaf Condition._ - * * __AnyOf Condition -__ must contain __only__ 'anyOf' (which is an array of Leaf Conditions). - * _Please note, 'field', 'equals' and 'containsAny' should __not__ be set in an AnyOf Condition._ - * - */ -export interface AlertRuleAnyOfOrLeafCondition extends AlertRuleLeafCondition { - /** An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. */ - anyOf?: AlertRuleLeafCondition[]; -} - -/** An Activity Log Alert rule resource. */ -export interface ActivityLogAlertResource extends AzureResourceAutoGenerated { - /** A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs that fall under one of these prefixes. This list must include at least one item. */ - scopes?: string[]; - /** The condition that will cause this alert to activate. */ - condition?: AlertRuleAllOfCondition; - /** The actions that will activate when the condition is met. */ - actions?: ActionList; - /** Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its actions will be activated. */ - enabled?: boolean; - /** A description of this Activity Log Alert rule. */ - description?: string; -} - -/** Resource properties. */ -export interface DataCollectionEndpointResourceProperties - extends DataCollectionEndpoint {} - -/** The endpoint used by clients to access their configuration. */ -export interface DataCollectionEndpointConfigurationAccess - extends ConfigurationAccessEndpointSpec {} - -/** The endpoint used by clients to ingest logs. */ -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 {} - -/** 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 {} - -/** 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 {} - -/** - * The specification of data sources. - * This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint. - */ -export interface DataCollectionRuleDataSources extends DataSourcesSpec {} - -/** The log files specific settings. */ -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 {} - -/** Azure Monitor Metrics destination. */ -export interface DestinationsSpecAzureMonitorMetrics - extends AzureMonitorMetricsDestination {} - -/** Criterion to filter metrics. */ -export interface MetricCriteria extends MultiMetricCriteria { - /** Polymorphic discriminator, which specifies the different types this object can be */ - criterionType: "StaticThresholdCriterion"; - /** the criteria operator. */ - operator: Operator; - /** the criteria threshold value that activates the alert. */ - threshold: number; -} - -/** Criterion for dynamic threshold. */ -export interface DynamicMetricCriteria extends MultiMetricCriteria { - /** Polymorphic discriminator, which specifies the different types this object can be */ - criterionType: "DynamicThresholdCriterion"; - /** The operator used to compare the metric value against the threshold. */ - operator: DynamicThresholdOperator; - /** The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern. */ - alertSensitivity: DynamicThresholdSensitivity; - /** The minimum number of violations required within the selected lookback time window required to raise an alert. */ - failingPeriods: DynamicThresholdFailingPeriods; - /** Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format) */ - 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; - /** - * Properties related to the metrics container in 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 Azure Monitor 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 TrackedResourceAutoGenerated { - /** - * System data - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; - /** - * Current state of this PrivateLinkScope: whether or not is has been provisioned within the resource group it is defined. Users cannot change this value but are able to read from it. Values will include Provisioning ,Succeeded, Canceled and Failed. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** - * List of private endpoint connections. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly privateEndpointConnections?: PrivateEndpointConnectionAutoGenerated[]; - /** Access mode settings */ - accessModeSettings: AccessModeSettings; -} - -/** A private link scoped resource */ -export interface ScopedResource extends ProxyResourceAutoGenerated { - /** - * System data - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; - /** The resource id of the scoped Azure monitor resource. */ - linkedResourceId?: string; - /** - * State of the private endpoint connection. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; -} - -/** Defines headers for AzureMonitorWorkspaces_delete operation. */ -export interface AzureMonitorWorkspacesDeleteHeaders { - azureAsyncOperation?: string; - location?: string; -} - -/** Defines headers for ActionGroups_createNotificationsAtActionGroupResourceLevel operation. */ -export interface ActionGroupsCreateNotificationsAtActionGroupResourceLevelHeaders { - /** The location header that has the polling uri. */ - location?: string; -} - -/** Defines headers for MonitorClient_createNotificationsAtTenantActionGroupResourceLevel operation. */ -export interface MonitorClientCreateNotificationsAtTenantActionGroupResourceLevelHeaders { - /** The location header that has the polling uri. */ - location?: string; -} - -/** Known values of {@link NamespaceClassification} that the service accepts. */ -export enum KnownNamespaceClassification { - /** Platform */ - Platform = "Platform", - /** Custom */ - Custom = "Custom", - /** Qos */ - Qos = "Qos", -} - -/** - * Defines values for NamespaceClassification. \ - * {@link KnownNamespaceClassification} can be used interchangeably with NamespaceClassification, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Platform** \ - * **Custom** \ - * **Qos** - */ -export type NamespaceClassification = string; - -/** Known values of {@link MetricClass} that the service accepts. */ -export enum KnownMetricClass { - /** Availability */ - Availability = "Availability", - /** Transactions */ - Transactions = "Transactions", - /** Errors */ - Errors = "Errors", - /** Latency */ - Latency = "Latency", - /** Saturation */ - Saturation = "Saturation", -} - -/** - * Defines values for MetricClass. \ - * {@link KnownMetricClass} can be used interchangeably with MetricClass, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Availability** \ - * **Transactions** \ - * **Errors** \ - * **Latency** \ - * **Saturation** - */ -export type MetricClass = string; - -/** Known values of {@link MetricUnit} that the service accepts. */ -export enum KnownMetricUnit { - /** Unit of raw quantity. */ - Count = "Count", - /** Unit of memory in bytes. */ - Bytes = "Bytes", - /** Unit of time in seconds. */ - Seconds = "Seconds", - /** Rate unit of raw quantity per second. */ - CountPerSecond = "CountPerSecond", - /** Rate unit of memory in bytes per second. */ - BytesPerSecond = "BytesPerSecond", - /** Percentage unit. */ - Percent = "Percent", - /** Unit of time in 1\/1000th of a second. */ - MilliSeconds = "MilliSeconds", - /** Unit of data transfer or storage. It is the size of the data in bytes multiplied by the time it takes to transfer or store the data in seconds. */ - ByteSeconds = "ByteSeconds", - /** No specified unit. */ - Unspecified = "Unspecified", - /** Unit of processing power. */ - Cores = "Cores", - /** Unit of processing power in 1\/1000th of a CPU core. */ - MilliCores = "MilliCores", - /** Unit of processing power in one billionth of a CPU core. */ - NanoCores = "NanoCores", - /** Rate unit of binary digits per second. */ - BitsPerSecond = "BitsPerSecond", -} - -/** - * Defines values for MetricUnit. \ - * {@link KnownMetricUnit} can be used interchangeably with MetricUnit, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Count**: Unit of raw quantity. \ - * **Bytes**: Unit of memory in bytes. \ - * **Seconds**: Unit of time in seconds. \ - * **CountPerSecond**: Rate unit of raw quantity per second. \ - * **BytesPerSecond**: Rate unit of memory in bytes per second. \ - * **Percent**: Percentage unit. \ - * **MilliSeconds**: Unit of time in 1\/1000th of a second. \ - * **ByteSeconds**: Unit of data transfer or storage. It is the size of the data in bytes multiplied by the time it takes to transfer or store the data in seconds. \ - * **Unspecified**: No specified unit. \ - * **Cores**: Unit of processing power. \ - * **MilliCores**: Unit of processing power in 1\/1000th of a CPU core. \ - * **NanoCores**: Unit of processing power in one billionth of a CPU core. \ - * **BitsPerSecond**: Rate unit of binary digits per second. - */ -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 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", -} - -/** - * 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** - */ -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 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 */ - Equals = "Equals", - /** NotEquals */ - NotEquals = "NotEquals", -} - -/** - * Defines values for ScaleRuleMetricDimensionOperationType. \ - * {@link KnownScaleRuleMetricDimensionOperationType} can be used interchangeably with ScaleRuleMetricDimensionOperationType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Equals** \ - * **NotEquals** - */ -export type ScaleRuleMetricDimensionOperationType = string; - -/** Known values of {@link CategoryType} that the service accepts. */ -export enum KnownCategoryType { - /** Metrics */ - Metrics = "Metrics", - /** Logs */ - Logs = "Logs", -} - -/** - * Defines values for CategoryType. \ - * {@link KnownCategoryType} can be used interchangeably with CategoryType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Metrics** \ - * **Logs** - */ -export type CategoryType = string; - -/** Known values of {@link BaselineSensitivity} that the service accepts. */ -export enum KnownBaselineSensitivity { - /** Low */ - Low = "Low", - /** Medium */ - Medium = "Medium", - /** High */ - High = "High", -} - -/** - * Defines values for BaselineSensitivity. \ - * {@link KnownBaselineSensitivity} can be used interchangeably with BaselineSensitivity, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Low** \ - * **Medium** \ - * **High** - */ -export type BaselineSensitivity = string; - -/** Known values of {@link Odatatype} that the service accepts. */ -export enum KnownOdatatype { - /** MicrosoftAzureMonitorSingleResourceMultipleMetricCriteria */ - MicrosoftAzureMonitorSingleResourceMultipleMetricCriteria = "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", - /** MicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria */ - MicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria", - /** MicrosoftAzureMonitorWebtestLocationAvailabilityCriteria */ - MicrosoftAzureMonitorWebtestLocationAvailabilityCriteria = "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria", -} - -/** - * Defines values for Odatatype. \ - * {@link KnownOdatatype} can be used interchangeably with Odatatype, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria** \ - * **Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria** \ - * **Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria** - */ -export type Odatatype = string; - -/** Known values of {@link Kind} that the service accepts. */ -export enum KnownKind { - /** LogAlert */ - LogAlert = "LogAlert", - /** LogToMetric */ - LogToMetric = "LogToMetric", -} - -/** - * Defines values for Kind. \ - * {@link KnownKind} can be used interchangeably with Kind, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **LogAlert** \ - * **LogToMetric** - */ -export type Kind = string; - -/** Known values of {@link AlertSeverity} that the service accepts. */ -export enum KnownAlertSeverity { - /** Zero */ - Zero = 0, - /** One */ - One = 1, - /** Two */ - Two = 2, - /** Three */ - Three = 3, - /** Four */ - Four = 4, -} - -/** - * Defines values for AlertSeverity. \ - * {@link KnownAlertSeverity} can be used interchangeably with AlertSeverity, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **0** \ - * **1** \ - * **2** \ - * **3** \ - * **4** - */ -export type AlertSeverity = number; - -/** Known values of {@link TimeAggregation} that the service accepts. */ -export enum KnownTimeAggregation { - /** Count */ - Count = "Count", - /** Average */ - Average = "Average", - /** Minimum */ - Minimum = "Minimum", - /** Maximum */ - Maximum = "Maximum", - /** Total */ - Total = "Total", -} - -/** - * Defines values for TimeAggregation. \ - * {@link KnownTimeAggregation} can be used interchangeably with TimeAggregation, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Count** \ - * **Average** \ - * **Minimum** \ - * **Maximum** \ - * **Total** - */ -export type TimeAggregation = string; - -/** Known values of {@link DimensionOperator} that the service accepts. */ -export enum KnownDimensionOperator { - /** Include */ - Include = "Include", - /** Exclude */ - Exclude = "Exclude", -} - -/** - * Defines values for DimensionOperator. \ - * {@link KnownDimensionOperator} can be used interchangeably with DimensionOperator, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Include** \ - * **Exclude** - */ -export type DimensionOperator = string; - -/** Known values of {@link OnboardingStatus} that the service accepts. */ -export enum KnownOnboardingStatus { - /** Onboarded */ - Onboarded = "onboarded", - /** NotOnboarded */ - NotOnboarded = "notOnboarded", - /** Unknown */ - Unknown = "unknown", -} - -/** - * Defines values for OnboardingStatus. \ - * {@link KnownOnboardingStatus} can be used interchangeably with OnboardingStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **onboarded** \ - * **notOnboarded** \ - * **unknown** - */ -export type OnboardingStatus = string; - -/** Known values of {@link DataStatus} that the service accepts. */ -export enum KnownDataStatus { - /** Present */ - Present = "present", - /** NotPresent */ - NotPresent = "notPresent", -} - -/** - * Defines values for DataStatus. \ - * {@link KnownDataStatus} can be used interchangeably with DataStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **present** \ - * **notPresent** - */ -export type DataStatus = string; - -/** Known values of {@link AccessMode} that the service accepts. */ -export enum KnownAccessMode { - /** Open */ - Open = "Open", - /** PrivateOnly */ - PrivateOnly = "PrivateOnly", -} - -/** - * Defines values for AccessMode. \ - * {@link KnownAccessMode} can be used interchangeably with AccessMode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Open** \ - * **PrivateOnly** - */ -export type AccessMode = string; - -/** Known values of {@link KnownPublicNetworkAccessOptions} that the service accepts. */ -export enum KnownKnownPublicNetworkAccessOptions { - /** Enabled */ - Enabled = "Enabled", - /** Disabled */ - Disabled = "Disabled", - /** SecuredByPerimeter */ - SecuredByPerimeter = "SecuredByPerimeter", -} - -/** - * Defines values for KnownPublicNetworkAccessOptions. \ - * {@link KnownKnownPublicNetworkAccessOptions} can be used interchangeably with KnownPublicNetworkAccessOptions, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Enabled** \ - * **Disabled** \ - * **SecuredByPerimeter** - */ -export type KnownPublicNetworkAccessOptions = string; - -/** Known values of {@link KnownDataCollectionEndpointProvisioningState} that the service accepts. */ -export enum KnownKnownDataCollectionEndpointProvisioningState { - /** Creating */ - Creating = "Creating", - /** Updating */ - Updating = "Updating", - /** Deleting */ - Deleting = "Deleting", - /** Succeeded */ - Succeeded = "Succeeded", - /** Canceled */ - Canceled = "Canceled", - /** Failed */ - Failed = "Failed", -} - -/** - * Defines values for KnownDataCollectionEndpointProvisioningState. \ - * {@link KnownKnownDataCollectionEndpointProvisioningState} can be used interchangeably with KnownDataCollectionEndpointProvisioningState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Creating** \ - * **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 */ - Linux = "Linux", - /** Windows */ - Windows = "Windows", -} - -/** - * Defines values for KnownDataCollectionEndpointResourceKind. \ - * {@link KnownKnownDataCollectionEndpointResourceKind} can be used interchangeably with KnownDataCollectionEndpointResourceKind, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Linux** \ - * **Windows** - */ -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 */ - Creating = "Creating", - /** Updating */ - Updating = "Updating", - /** Deleting */ - Deleting = "Deleting", - /** Succeeded */ - Succeeded = "Succeeded", - /** Canceled */ - Canceled = "Canceled", - /** Failed */ - Failed = "Failed", -} - -/** - * Defines values for KnownDataCollectionRuleAssociationProvisioningState. \ - * {@link KnownKnownDataCollectionRuleAssociationProvisioningState} can be used interchangeably with KnownDataCollectionRuleAssociationProvisioningState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Creating** \ - * **Updating** \ - * **Deleting** \ - * **Succeeded** \ - * **Canceled** \ - * **Failed** - */ -export type KnownDataCollectionRuleAssociationProvisioningState = string; - -/** Known values of {@link KnownColumnDefinitionType} that the service accepts. */ -export enum KnownKnownColumnDefinitionType { - /** String */ - String = "string", - /** Int */ - Int = "int", - /** Long */ - Long = "long", - /** Real */ - Real = "real", - /** Boolean */ - Boolean = "boolean", - /** Datetime */ - Datetime = "datetime", - /** Dynamic */ - Dynamic = "dynamic", -} - -/** - * Defines values for KnownColumnDefinitionType. \ - * {@link KnownKnownColumnDefinitionType} can be used interchangeably with KnownColumnDefinitionType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **string** \ - * **int** \ - * **long** \ - * **real** \ - * **boolean** \ - * **datetime** \ - * **dynamic** - */ -export type KnownColumnDefinitionType = string; - -/** Known values of {@link KnownPerfCounterDataSourceStreams} that the service accepts. */ -export enum KnownKnownPerfCounterDataSourceStreams { - /** MicrosoftPerf */ - MicrosoftPerf = "Microsoft-Perf", - /** MicrosoftInsightsMetrics */ - MicrosoftInsightsMetrics = "Microsoft-InsightsMetrics", -} - -/** - * Defines values for KnownPerfCounterDataSourceStreams. \ - * {@link KnownKnownPerfCounterDataSourceStreams} can be used interchangeably with KnownPerfCounterDataSourceStreams, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Microsoft-Perf** \ - * **Microsoft-InsightsMetrics** - */ -export type KnownPerfCounterDataSourceStreams = string; - -/** Known values of {@link KnownWindowsEventLogDataSourceStreams} that the service accepts. */ -export enum KnownKnownWindowsEventLogDataSourceStreams { - /** MicrosoftWindowsEvent */ - MicrosoftWindowsEvent = "Microsoft-WindowsEvent", - /** MicrosoftEvent */ - MicrosoftEvent = "Microsoft-Event", -} - -/** - * Defines values for KnownWindowsEventLogDataSourceStreams. \ - * {@link KnownKnownWindowsEventLogDataSourceStreams} can be used interchangeably with KnownWindowsEventLogDataSourceStreams, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Microsoft-WindowsEvent** \ - * **Microsoft-Event** - */ -export type KnownWindowsEventLogDataSourceStreams = string; - -/** Known values of {@link KnownSyslogDataSourceStreams} that the service accepts. */ -export enum KnownKnownSyslogDataSourceStreams { - /** MicrosoftSyslog */ - MicrosoftSyslog = "Microsoft-Syslog", -} - -/** - * Defines values for KnownSyslogDataSourceStreams. \ - * {@link KnownKnownSyslogDataSourceStreams} can be used interchangeably with KnownSyslogDataSourceStreams, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Microsoft-Syslog** - */ -export type KnownSyslogDataSourceStreams = string; - -/** Known values of {@link KnownSyslogDataSourceFacilityNames} that the service accepts. */ -export enum KnownKnownSyslogDataSourceFacilityNames { - /** Alert */ - Alert = "alert", - /** Audit */ - Audit = "audit", - /** Auth */ - Auth = "auth", - /** Authpriv */ - Authpriv = "authpriv", - /** Clock */ - Clock = "clock", - /** Cron */ - Cron = "cron", - /** Daemon */ - Daemon = "daemon", - /** Ftp */ - Ftp = "ftp", - /** Kern */ - Kern = "kern", - /** Lpr */ - Lpr = "lpr", - /** Mail */ - Mail = "mail", - /** Mark */ - Mark = "mark", - /** News */ - News = "news", - /** Nopri */ - Nopri = "nopri", - /** Ntp */ - Ntp = "ntp", - /** Syslog */ - Syslog = "syslog", - /** User */ - User = "user", - /** Uucp */ - Uucp = "uucp", - /** Local0 */ - Local0 = "local0", - /** Local1 */ - Local1 = "local1", - /** Local2 */ - Local2 = "local2", - /** Local3 */ - Local3 = "local3", - /** Local4 */ - Local4 = "local4", - /** Local5 */ - Local5 = "local5", - /** Local6 */ - Local6 = "local6", - /** Local7 */ - Local7 = "local7", - /** Asterisk */ - Asterisk = "*", -} - -/** - * Defines values for KnownSyslogDataSourceFacilityNames. \ - * {@link KnownKnownSyslogDataSourceFacilityNames} can be used interchangeably with KnownSyslogDataSourceFacilityNames, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **alert** \ - * **audit** \ - * **auth** \ - * **authpriv** \ - * **clock** \ - * **cron** \ - * **daemon** \ - * **ftp** \ - * **kern** \ - * **lpr** \ - * **mail** \ - * **mark** \ - * **news** \ - * **nopri** \ - * **ntp** \ - * **syslog** \ - * **user** \ - * **uucp** \ - * **local0** \ - * **local1** \ - * **local2** \ - * **local3** \ - * **local4** \ - * **local5** \ - * **local6** \ - * **local7** \ - * ***** - */ -export type KnownSyslogDataSourceFacilityNames = string; - -/** Known values of {@link KnownSyslogDataSourceLogLevels} that the service accepts. */ -export enum KnownKnownSyslogDataSourceLogLevels { - /** Debug */ - Debug = "Debug", - /** Info */ - Info = "Info", - /** Notice */ - Notice = "Notice", - /** Warning */ - Warning = "Warning", - /** Error */ - Error = "Error", - /** Critical */ - Critical = "Critical", - /** Alert */ - Alert = "Alert", - /** Emergency */ - Emergency = "Emergency", - /** Asterisk */ - Asterisk = "*", -} - -/** - * Defines values for KnownSyslogDataSourceLogLevels. \ - * {@link KnownKnownSyslogDataSourceLogLevels} can be used interchangeably with KnownSyslogDataSourceLogLevels, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Debug** \ - * **Info** \ - * **Notice** \ - * **Warning** \ - * **Error** \ - * **Critical** \ - * **Alert** \ - * **Emergency** \ - * ***** - */ -export type KnownSyslogDataSourceLogLevels = string; - -/** Known values of {@link KnownExtensionDataSourceStreams} that the service accepts. */ -export enum KnownKnownExtensionDataSourceStreams { - /** MicrosoftEvent */ - MicrosoftEvent = "Microsoft-Event", - /** MicrosoftInsightsMetrics */ - MicrosoftInsightsMetrics = "Microsoft-InsightsMetrics", - /** MicrosoftPerf */ - MicrosoftPerf = "Microsoft-Perf", - /** MicrosoftSyslog */ - MicrosoftSyslog = "Microsoft-Syslog", - /** MicrosoftWindowsEvent */ - MicrosoftWindowsEvent = "Microsoft-WindowsEvent", -} - -/** - * Defines values for KnownExtensionDataSourceStreams. \ - * {@link KnownKnownExtensionDataSourceStreams} can be used interchangeably with KnownExtensionDataSourceStreams, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Microsoft-Event** \ - * **Microsoft-InsightsMetrics** \ - * **Microsoft-Perf** \ - * **Microsoft-Syslog** \ - * **Microsoft-WindowsEvent** - */ -export type KnownExtensionDataSourceStreams = string; - -/** Known values of {@link KnownLogFilesDataSourceFormat} that the service accepts. */ -export enum KnownKnownLogFilesDataSourceFormat { - /** Text */ - Text = "text", -} - -/** - * Defines values for KnownLogFilesDataSourceFormat. \ - * {@link KnownKnownLogFilesDataSourceFormat} can be used interchangeably with KnownLogFilesDataSourceFormat, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **text** - */ -export type KnownLogFilesDataSourceFormat = string; - -/** Known values of {@link KnownLogFileTextSettingsRecordStartTimestampFormat} that the service accepts. */ -export enum KnownKnownLogFileTextSettingsRecordStartTimestampFormat { - /** ISO8601 */ - ISO8601 = "ISO 8601", - /** YyyyMMDDHHMMSS */ - YyyyMMDDHHMMSS = "YYYY-MM-DD HH:MM:SS", - /** MDYyyyHHMMSSAMPM */ - MDYyyyHHMMSSAMPM = "M/D/YYYY HH:MM:SS AM/PM", - /** MonDDYyyyHHMMSS */ - MonDDYyyyHHMMSS = "Mon DD, YYYY HH:MM:SS", - /** YyMMddHHMmSs */ - YyMMddHHMmSs = "yyMMdd HH:mm:ss", - /** DdMMyyHHMmSs */ - DdMMyyHHMmSs = "ddMMyy HH:mm:ss", - /** MMMDHhMmSs */ - MMMDHhMmSs = "MMM d hh:mm:ss", - /** DdMMMYyyyHHMmSsZzz */ - DdMMMYyyyHHMmSsZzz = "dd/MMM/yyyy:HH:mm:ss zzz", - /** YyyyMMDdTHHMmSsK */ - YyyyMMDdTHHMmSsK = "yyyy-MM-ddTHH:mm:ssK", -} - -/** - * Defines values for KnownLogFileTextSettingsRecordStartTimestampFormat. \ - * {@link KnownKnownLogFileTextSettingsRecordStartTimestampFormat} can be used interchangeably with KnownLogFileTextSettingsRecordStartTimestampFormat, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **ISO 8601** \ - * **YYYY-MM-DD HH:MM:SS** \ - * **M\/D\/YYYY HH:MM:SS AM\/PM** \ - * **Mon DD, YYYY HH:MM:SS** \ - * **yyMMdd HH:mm:ss** \ - * **ddMMyy HH:mm:ss** \ - * **MMM d hh:mm:ss** \ - * **dd\/MMM\/yyyy:HH:mm:ss zzz** \ - * **yyyy-MM-ddTHH:mm:ssK** - */ -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 */ - MicrosoftEvent = "Microsoft-Event", - /** MicrosoftInsightsMetrics */ - MicrosoftInsightsMetrics = "Microsoft-InsightsMetrics", - /** MicrosoftPerf */ - MicrosoftPerf = "Microsoft-Perf", - /** MicrosoftSyslog */ - MicrosoftSyslog = "Microsoft-Syslog", - /** MicrosoftWindowsEvent */ - MicrosoftWindowsEvent = "Microsoft-WindowsEvent", -} - -/** - * Defines values for KnownDataFlowStreams. \ - * {@link KnownKnownDataFlowStreams} can be used interchangeably with KnownDataFlowStreams, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Microsoft-Event** \ - * **Microsoft-InsightsMetrics** \ - * **Microsoft-Perf** \ - * **Microsoft-Syslog** \ - * **Microsoft-WindowsEvent** - */ -export type KnownDataFlowStreams = string; - -/** Known values of {@link KnownDataCollectionRuleProvisioningState} that the service accepts. */ -export enum KnownKnownDataCollectionRuleProvisioningState { - /** Creating */ - Creating = "Creating", - /** Updating */ - Updating = "Updating", - /** Deleting */ - Deleting = "Deleting", - /** Succeeded */ - Succeeded = "Succeeded", - /** Canceled */ - Canceled = "Canceled", - /** Failed */ - Failed = "Failed", -} - -/** - * Defines values for KnownDataCollectionRuleProvisioningState. \ - * {@link KnownKnownDataCollectionRuleProvisioningState} can be used interchangeably with KnownDataCollectionRuleProvisioningState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Creating** \ - * **Updating** \ - * **Deleting** \ - * **Succeeded** \ - * **Canceled** \ - * **Failed** - */ -export type KnownDataCollectionRuleProvisioningState = string; - -/** Known values of {@link KnownDataCollectionRuleResourceKind} that the service accepts. */ -export enum KnownKnownDataCollectionRuleResourceKind { - /** Linux */ - Linux = "Linux", - /** Windows */ - Windows = "Windows", -} - -/** - * Defines values for KnownDataCollectionRuleResourceKind. \ - * {@link KnownKnownDataCollectionRuleResourceKind} can be used interchangeably with KnownDataCollectionRuleResourceKind, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Linux** \ - * **Windows** - */ -export type KnownDataCollectionRuleResourceKind = string; - -/** Known values of {@link Operator} that the service accepts. */ -export enum KnownOperator { - /** Equals */ - Equals = "Equals", - /** GreaterThan */ - GreaterThan = "GreaterThan", - /** GreaterThanOrEqual */ - GreaterThanOrEqual = "GreaterThanOrEqual", - /** LessThan */ - LessThan = "LessThan", - /** LessThanOrEqual */ - LessThanOrEqual = "LessThanOrEqual", -} - -/** - * Defines values for Operator. \ - * {@link KnownOperator} can be used interchangeably with Operator, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Equals** \ - * **GreaterThan** \ - * **GreaterThanOrEqual** \ - * **LessThan** \ - * **LessThanOrEqual** - */ -export type Operator = string; - -/** Known values of {@link CriterionType} that the service accepts. */ -export enum KnownCriterionType { - /** StaticThresholdCriterion */ - StaticThresholdCriterion = "StaticThresholdCriterion", - /** DynamicThresholdCriterion */ - DynamicThresholdCriterion = "DynamicThresholdCriterion", -} - -/** - * Defines values for CriterionType. \ - * {@link KnownCriterionType} can be used interchangeably with CriterionType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **StaticThresholdCriterion** \ - * **DynamicThresholdCriterion** - */ -export type CriterionType = string; - -/** Known values of {@link AggregationTypeEnum} that the service accepts. */ -export enum KnownAggregationTypeEnum { - /** Average */ - Average = "Average", - /** Count */ - Count = "Count", - /** Minimum */ - Minimum = "Minimum", - /** Maximum */ - Maximum = "Maximum", - /** Total */ - Total = "Total", -} - -/** - * Defines values for AggregationTypeEnum. \ - * {@link KnownAggregationTypeEnum} can be used interchangeably with AggregationTypeEnum, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Average** \ - * **Count** \ - * **Minimum** \ - * **Maximum** \ - * **Total** - */ -export type AggregationTypeEnum = string; - -/** Known values of {@link DynamicThresholdOperator} that the service accepts. */ -export enum KnownDynamicThresholdOperator { - /** GreaterThan */ - GreaterThan = "GreaterThan", - /** LessThan */ - LessThan = "LessThan", - /** GreaterOrLessThan */ - GreaterOrLessThan = "GreaterOrLessThan", -} - -/** - * Defines values for DynamicThresholdOperator. \ - * {@link KnownDynamicThresholdOperator} can be used interchangeably with DynamicThresholdOperator, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **GreaterThan** \ - * **LessThan** \ - * **GreaterOrLessThan** - */ -export type DynamicThresholdOperator = string; - -/** Known values of {@link DynamicThresholdSensitivity} that the service accepts. */ -export enum KnownDynamicThresholdSensitivity { - /** Low */ - Low = "Low", - /** Medium */ - Medium = "Medium", - /** High */ - High = "High", -} - -/** - * Defines values for DynamicThresholdSensitivity. \ - * {@link KnownDynamicThresholdSensitivity} can be used interchangeably with DynamicThresholdSensitivity, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Low** \ - * **Medium** \ - * **High** - */ -export type DynamicThresholdSensitivity = string; -/** Defines values for AggregationType. */ -export type AggregationType = - | "None" - | "Average" - | "Count" - | "Minimum" - | "Maximum" - | "Total"; -/** Defines values for ResultType. */ -export type ResultType = "Data" | "Metadata"; -/** Defines values for MetricStatisticType. */ -export type MetricStatisticType = "Average" | "Min" | "Max" | "Sum" | "Count"; -/** Defines values for TimeAggregationType. */ -export type TimeAggregationType = - | "Average" - | "Minimum" - | "Maximum" - | "Total" - | "Count" - | "Last"; -/** Defines values for ComparisonOperationType. */ -export type ComparisonOperationType = - | "Equals" - | "NotEquals" - | "GreaterThan" - | "GreaterThanOrEqual" - | "LessThan" - | "LessThanOrEqual"; -/** Defines values for ScaleDirection. */ -export type ScaleDirection = "None" | "Increase" | "Decrease"; -/** Defines values for ScaleType. */ -export type ScaleType = - | "ChangeCount" - | "PercentChangeCount" - | "ExactCount" - | "ServiceAllowedNextValue"; -/** Defines values for RecurrenceFrequency. */ -export type RecurrenceFrequency = - | "None" - | "Second" - | "Minute" - | "Hour" - | "Day" - | "Week" - | "Month" - | "Year"; -/** Defines values for PredictiveAutoscalePolicyScaleMode. */ -export type PredictiveAutoscalePolicyScaleMode = - | "Disabled" - | "ForecastOnly" - | "Enabled"; -/** Defines values for ReceiverStatus. */ -export type ReceiverStatus = "NotSpecified" | "Enabled" | "Disabled"; -/** Defines values for EventLevel. */ -export type EventLevel = - | "Critical" - | "Error" - | "Warning" - | "Informational" - | "Verbose"; -/** Defines values for IdentityType. */ -export type IdentityType = "SystemAssigned" | "UserAssigned" | "None"; -/** Defines values for ConditionOperator. */ -export type ConditionOperator = - | "GreaterThan" - | "GreaterThanOrEqual" - | "LessThan" - | "LessThanOrEqual" - | "Equals"; -/** Defines values for TimeAggregationOperator. */ -export type TimeAggregationOperator = - | "Average" - | "Minimum" - | "Maximum" - | "Total" - | "Last"; - -/** Optional parameters. */ -export interface MetricNamespacesListOptionalParams - extends coreClient.OperationOptions { - /** The ISO 8601 conform Date start time from which to query for metric namespaces. */ - startTime?: string; -} - -/** Contains response data for the list operation. */ -export type MetricNamespacesListResponse = MetricNamespaceCollection; - -/** 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 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 { - /** 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 in ISO 8601 duration format. Defaults to PT1M. Special case for 'FULL' value that returns single datapoint for entire time span requested. - * *Examples: PT15M, PT1H, P1D, FULL* - */ - interval?: string; - /** The names of the metrics (comma separated) to retrieve. */ - metricnames?: string; - /** - * The list of aggregation types (comma separated) to retrieve. - * *Examples: average, minimum, maximum* - */ - aggregation?: string; - /** - * The maximum number of records to retrieve per resource ID in the request. - * 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; - /** 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; - /** 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; - /** 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; -} - -/** Contains response data for the listAtSubscriptionScope operation. */ -export type MetricsListAtSubscriptionScopeResponse = Response; - -/** Optional parameters. */ -export interface MetricsListAtSubscriptionScopePostOptionalParams - extends coreClient.OperationOptions { - /** 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 in ISO 8601 duration format. Defaults to PT1M. Special case for 'FULL' value that returns single datapoint for entire time span requested. - * *Examples: PT15M, PT1H, P1D, FULL* - */ - interval?: string; - /** The names of the metrics (comma separated) to retrieve. */ - metricnames?: string; - /** - * The list of aggregation types (comma separated) to retrieve. - * *Examples: average, minimum, maximum* - */ - aggregation?: string; - /** - * The maximum number of records to retrieve per resource ID in the request. - * 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; - /** 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; - /** 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; - /** 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; - /** Parameters serialized in the body */ - body?: SubscriptionScopeMetricsRequestBodyParameters; -} - -/** Contains response data for the listAtSubscriptionScopePost operation. */ -export type MetricsListAtSubscriptionScopePostResponse = Response; - -/** Optional parameters. */ -export interface MetricsListOptionalParams extends coreClient.OperationOptions { - /** 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 in ISO 8601 duration format. Defaults to PT1M. Special case for 'FULL' value that returns single datapoint for entire time span requested. - * *Examples: PT15M, PT1H, P1D, FULL* - */ - interval?: string; - /** The names of the metrics (comma separated) to retrieve. */ - metricnames?: string; - /** - * The list of aggregation types (comma separated) to retrieve. - * *Examples: average, minimum, maximum* - */ - aggregation?: string; - /** - * The maximum number of records to retrieve per resource ID in the request. - * 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; - /** 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; - /** 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; - /** 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?: ResultType; -} - -/** Contains response data for the list operation. */ -export type MetricsListResponse = Response; - -/** 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 {} - -/** Contains response data for the listByResourceGroup operation. */ -export type AutoscaleSettingsListByResourceGroupResponse = - AutoscaleSettingResourceCollection; - -/** Optional parameters. */ -export interface AutoscaleSettingsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the createOrUpdate operation. */ -export type AutoscaleSettingsCreateOrUpdateResponse = AutoscaleSettingResource; - -/** Optional parameters. */ -export interface AutoscaleSettingsDeleteOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface AutoscaleSettingsGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type AutoscaleSettingsGetResponse = AutoscaleSettingResource; - -/** Optional parameters. */ -export interface AutoscaleSettingsUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the update operation. */ -export type AutoscaleSettingsUpdateResponse = AutoscaleSettingResource; - -/** Optional parameters. */ -export interface AutoscaleSettingsListBySubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscription operation. */ -export type AutoscaleSettingsListBySubscriptionResponse = - AutoscaleSettingResourceCollection; - -/** Optional parameters. */ -export interface AutoscaleSettingsListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type AutoscaleSettingsListByResourceGroupNextResponse = - AutoscaleSettingResourceCollection; - -/** Optional parameters. */ -export interface AutoscaleSettingsListBySubscriptionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscriptionNext operation. */ -export type AutoscaleSettingsListBySubscriptionNextResponse = - AutoscaleSettingResourceCollection; - -/** Optional parameters. */ -export interface PredictiveMetricGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type PredictiveMetricGetResponse = PredictiveResponse; - -/** Optional parameters. */ -export interface OperationsListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type OperationsListResponse = OperationListResultAutoGenerated; - -/** Optional parameters. */ -export interface AlertRuleIncidentsGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type AlertRuleIncidentsGetResponse = Incident; - -/** Optional parameters. */ -export interface AlertRuleIncidentsListByAlertRuleOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByAlertRule operation. */ -export type AlertRuleIncidentsListByAlertRuleResponse = IncidentListResult; - -/** Optional parameters. */ -export interface AlertRulesCreateOrUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the createOrUpdate operation. */ -export type AlertRulesCreateOrUpdateResponse = AlertRuleResource; - -/** Optional parameters. */ -export interface AlertRulesDeleteOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface AlertRulesGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type AlertRulesGetResponse = AlertRuleResource; - -/** Optional parameters. */ -export interface AlertRulesUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the update operation. */ -export type AlertRulesUpdateResponse = AlertRuleResource; - -/** Optional parameters. */ -export interface AlertRulesListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type AlertRulesListByResourceGroupResponse = AlertRuleResourceCollection; - -/** Optional parameters. */ -export interface AlertRulesListBySubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscription operation. */ -export type AlertRulesListBySubscriptionResponse = AlertRuleResourceCollection; - -/** Optional parameters. */ -export interface LogProfilesDeleteOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface LogProfilesGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type LogProfilesGetResponse = LogProfileResource; - -/** Optional parameters. */ -export interface LogProfilesCreateOrUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the createOrUpdate operation. */ -export type LogProfilesCreateOrUpdateResponse = LogProfileResource; - -/** Optional parameters. */ -export interface LogProfilesUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the update operation. */ -export type LogProfilesUpdateResponse = LogProfileResource; - -/** Optional parameters. */ -export interface LogProfilesListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type LogProfilesListResponse = LogProfileCollection; - -/** Optional parameters. */ -export interface DiagnosticSettingsGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type DiagnosticSettingsGetResponse = DiagnosticSettingsResource; - -/** Optional parameters. */ -export interface DiagnosticSettingsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the createOrUpdate operation. */ -export type DiagnosticSettingsCreateOrUpdateResponse = - DiagnosticSettingsResource; - -/** Optional parameters. */ -export interface DiagnosticSettingsDeleteOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface DiagnosticSettingsListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type DiagnosticSettingsListResponse = - DiagnosticSettingsResourceCollection; - -/** Optional parameters. */ -export interface DiagnosticSettingsCategoryGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type DiagnosticSettingsCategoryGetResponse = - DiagnosticSettingsCategoryResource; - -/** Optional parameters. */ -export interface DiagnosticSettingsCategoryListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type DiagnosticSettingsCategoryListResponse = - DiagnosticSettingsCategoryResourceCollection; - -/** Optional parameters. */ -export interface ActionGroupsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the createOrUpdate operation. */ -export type ActionGroupsCreateOrUpdateResponse = ActionGroupResource; - -/** Optional parameters. */ -export interface ActionGroupsGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type ActionGroupsGetResponse = ActionGroupResource; - -/** Optional parameters. */ -export interface ActionGroupsDeleteOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface ActionGroupsUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the update operation. */ -export type ActionGroupsUpdateResponse = ActionGroupResource; - -/** Optional parameters. */ -export interface ActionGroupsCreateNotificationsAtActionGroupResourceLevelOptionalParams - 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 createNotificationsAtActionGroupResourceLevel operation. */ -export type ActionGroupsCreateNotificationsAtActionGroupResourceLevelResponse = - TestNotificationDetailsResponse; - -/** Optional parameters. */ -export interface ActionGroupsGetTestNotificationsAtActionGroupResourceLevelOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getTestNotificationsAtActionGroupResourceLevel operation. */ -export type ActionGroupsGetTestNotificationsAtActionGroupResourceLevelResponse = - TestNotificationDetailsResponse; - -/** Optional parameters. */ -export interface ActionGroupsListBySubscriptionIdOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscriptionId operation. */ -export type ActionGroupsListBySubscriptionIdResponse = ActionGroupList; - -/** Optional parameters. */ -export interface ActionGroupsListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type ActionGroupsListByResourceGroupResponse = ActionGroupList; - -/** Optional parameters. */ -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 CreateNotificationsAtTenantActionGroupResourceLevelOptionalParams - 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 createNotificationsAtTenantActionGroupResourceLevel operation. */ -export type CreateNotificationsAtTenantActionGroupResourceLevelResponse = - TestNotificationDetailsResponseAutoGenerated; - -/** Optional parameters. */ -export interface GetTestNotificationsAtTenantActionGroupResourceLevelOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getTestNotificationsAtTenantActionGroupResourceLevel operation. */ -export type GetTestNotificationsAtTenantActionGroupResourceLevelResponse = - TestNotificationDetailsResponseAutoGenerated; - -/** Optional parameters. */ -export interface ActivityLogsListOptionalParams - extends coreClient.OperationOptions { - /** Used to fetch events with only the given properties.
The **$select** argument is a comma separated list of property names to be returned. Possible values are: *authorization*, *claims*, *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, *status*, *submissionTimestamp*, *subStatus*, *subscriptionId* */ - select?: string; -} - -/** Contains response data for the list operation. */ -export type ActivityLogsListResponse = EventDataCollection; - -/** Optional parameters. */ -export interface ActivityLogsListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type ActivityLogsListNextResponse = EventDataCollection; - -/** Optional parameters. */ -export interface EventCategoriesListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type EventCategoriesListResponse = EventCategoryCollection; - -/** Optional parameters. */ -export interface TenantActivityLogsListOptionalParams - extends coreClient.OperationOptions { - /** Reduces the set of data collected.
The **$filter** is very restricted and allows only the following patterns.
- List events for a resource group: $filter=eventTimestamp ge '' and eventTimestamp le '' and eventChannels eq 'Admin, Operation' and resourceGroupName eq ''.
- List events for resource: $filter=eventTimestamp ge '' and eventTimestamp le '' and eventChannels eq 'Admin, Operation' and resourceUri eq ''.
- List events for a subscription: $filter=eventTimestamp ge '' and eventTimestamp le '' and eventChannels eq 'Admin, Operation'.
- List events for a resource provider: $filter=eventTimestamp ge '' and eventTimestamp le '' and eventChannels eq 'Admin, Operation' and resourceProvider eq ''.
- List events for a correlation Id: api-version=2014-04-01&$filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and correlationId eq ''.
**NOTE**: No other syntax is allowed. */ - filter?: string; - /** Used to fetch events with only the given properties.
The **$select** argument is a comma separated list of property names to be returned. Possible values are: *authorization*, *claims*, *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, *status*, *submissionTimestamp*, *subStatus*, *subscriptionId* */ - select?: string; -} - -/** Contains response data for the list operation. */ -export type TenantActivityLogsListResponse = EventDataCollection; - -/** Optional parameters. */ -export interface TenantActivityLogsListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type TenantActivityLogsListNextResponse = EventDataCollection; - -/** Optional parameters. */ -export interface BaselinesListOptionalParams - extends coreClient.OperationOptions { - /** Metric namespace to query metric definitions for. */ - metricnamespace?: string; - /** The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'. */ - timespan?: 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'** */ - 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 '*'**. 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' "** */ - filter?: string; - /** Allows retrieving only metadata of the baseline. On data request all information is retrieved. */ - resultType?: ResultType; - /** The interval (i.e. timegrain) of the query. */ - interval?: string; - /** The list of sensitivities (comma separated) to retrieve. */ - sensitivities?: string; -} - -/** Contains response data for the list operation. */ -export type BaselinesListResponse = MetricBaselinesResponse; - -/** Optional parameters. */ -export interface MetricAlertsListBySubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscription operation. */ -export type MetricAlertsListBySubscriptionResponse = - MetricAlertResourceCollection; - -/** Optional parameters. */ -export interface MetricAlertsListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type MetricAlertsListByResourceGroupResponse = - MetricAlertResourceCollection; - -/** Optional parameters. */ -export interface MetricAlertsGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type MetricAlertsGetResponse = MetricAlertResource; - -/** Optional parameters. */ -export interface MetricAlertsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the createOrUpdate operation. */ -export type MetricAlertsCreateOrUpdateResponse = MetricAlertResource; - -/** Optional parameters. */ -export interface MetricAlertsUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the update operation. */ -export type MetricAlertsUpdateResponse = MetricAlertResource; - -/** Optional parameters. */ -export interface MetricAlertsDeleteOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface MetricAlertsStatusListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type MetricAlertsStatusListResponse = MetricAlertStatusCollection; - -/** Optional parameters. */ -export interface MetricAlertsStatusListByNameOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByName operation. */ -export type MetricAlertsStatusListByNameResponse = MetricAlertStatusCollection; - -/** Optional parameters. */ -export interface ScheduledQueryRulesListBySubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscription operation. */ -export type ScheduledQueryRulesListBySubscriptionResponse = - ScheduledQueryRuleResourceCollection; - -/** Optional parameters. */ -export interface ScheduledQueryRulesListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type ScheduledQueryRulesListByResourceGroupResponse = - ScheduledQueryRuleResourceCollection; - -/** Optional parameters. */ -export interface ScheduledQueryRulesGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type ScheduledQueryRulesGetResponse = ScheduledQueryRuleResource; - -/** Optional parameters. */ -export interface ScheduledQueryRulesCreateOrUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the createOrUpdate operation. */ -export type ScheduledQueryRulesCreateOrUpdateResponse = - ScheduledQueryRuleResource; - -/** Optional parameters. */ -export interface ScheduledQueryRulesUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the update operation. */ -export type ScheduledQueryRulesUpdateResponse = ScheduledQueryRuleResource; - -/** Optional parameters. */ -export interface ScheduledQueryRulesDeleteOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface ScheduledQueryRulesListBySubscriptionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscriptionNext operation. */ -export type ScheduledQueryRulesListBySubscriptionNextResponse = - ScheduledQueryRuleResourceCollection; - -/** Optional parameters. */ -export interface ScheduledQueryRulesListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type ScheduledQueryRulesListByResourceGroupNextResponse = - ScheduledQueryRuleResourceCollection; - -/** Optional parameters. */ -export interface VMInsightsGetOnboardingStatusOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getOnboardingStatus operation. */ -export type VMInsightsGetOnboardingStatusResponse = VMInsightsOnboardingStatus; - -/** Optional parameters. */ -export interface PrivateLinkScopesListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type PrivateLinkScopesListResponse = - AzureMonitorPrivateLinkScopeListResult; - -/** Optional parameters. */ -export interface PrivateLinkScopesListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type PrivateLinkScopesListByResourceGroupResponse = - AzureMonitorPrivateLinkScopeListResult; - -/** Optional parameters. */ -export interface PrivateLinkScopesDeleteOptionalParams - 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; -} - -/** Optional parameters. */ -export interface PrivateLinkScopesGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type PrivateLinkScopesGetResponse = AzureMonitorPrivateLinkScope; - -/** Optional parameters. */ -export interface PrivateLinkScopesCreateOrUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the createOrUpdate operation. */ -export type PrivateLinkScopesCreateOrUpdateResponse = - AzureMonitorPrivateLinkScope; - -/** Optional parameters. */ -export interface PrivateLinkScopesUpdateTagsOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the updateTags operation. */ -export type PrivateLinkScopesUpdateTagsResponse = AzureMonitorPrivateLinkScope; - -/** Optional parameters. */ -export interface PrivateLinkScopesListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type PrivateLinkScopesListNextResponse = - AzureMonitorPrivateLinkScopeListResult; - -/** Optional parameters. */ -export interface PrivateLinkScopesListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type PrivateLinkScopesListByResourceGroupNextResponse = - AzureMonitorPrivateLinkScopeListResult; - -/** Optional parameters. */ -export interface PrivateLinkScopeOperationStatusGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type PrivateLinkScopeOperationStatusGetResponse = OperationStatus; - -/** Optional parameters. */ -export interface PrivateLinkResourcesListByPrivateLinkScopeOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByPrivateLinkScope operation. */ -export type PrivateLinkResourcesListByPrivateLinkScopeResponse = - PrivateLinkResourceListResult; - -/** Optional parameters. */ -export interface PrivateLinkResourcesGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type PrivateLinkResourcesGetResponse = PrivateLinkResource; - -/** Optional parameters. */ -export interface PrivateEndpointConnectionsGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type PrivateEndpointConnectionsGetResponse = - PrivateEndpointConnectionAutoGenerated; - -/** Optional parameters. */ -export interface PrivateEndpointConnectionsCreateOrUpdateOptionalParams - 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 createOrUpdate operation. */ -export type PrivateEndpointConnectionsCreateOrUpdateResponse = - PrivateEndpointConnectionAutoGenerated; - -/** Optional parameters. */ -export interface PrivateEndpointConnectionsDeleteOptionalParams - 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; -} - -/** Optional parameters. */ -export interface PrivateEndpointConnectionsListByPrivateLinkScopeOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByPrivateLinkScope operation. */ -export type PrivateEndpointConnectionsListByPrivateLinkScopeResponse = - PrivateEndpointConnectionListResult; - -/** Optional parameters. */ -export interface PrivateLinkScopedResourcesGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type PrivateLinkScopedResourcesGetResponse = ScopedResource; - -/** Optional parameters. */ -export interface PrivateLinkScopedResourcesCreateOrUpdateOptionalParams - 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 createOrUpdate operation. */ -export type PrivateLinkScopedResourcesCreateOrUpdateResponse = ScopedResource; - -/** Optional parameters. */ -export interface PrivateLinkScopedResourcesDeleteOptionalParams - 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; -} - -/** Optional parameters. */ -export interface PrivateLinkScopedResourcesListByPrivateLinkScopeOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByPrivateLinkScope operation. */ -export type PrivateLinkScopedResourcesListByPrivateLinkScopeResponse = - ScopedResourceListResult; - -/** Optional parameters. */ -export interface PrivateLinkScopedResourcesListByPrivateLinkScopeNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByPrivateLinkScopeNext operation. */ -export type PrivateLinkScopedResourcesListByPrivateLinkScopeNextResponse = - ScopedResourceListResult; - -/** Optional parameters. */ -export interface ActivityLogAlertsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the createOrUpdate operation. */ -export type ActivityLogAlertsCreateOrUpdateResponse = ActivityLogAlertResource; - -/** Optional parameters. */ -export interface ActivityLogAlertsGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type ActivityLogAlertsGetResponse = ActivityLogAlertResource; - -/** Optional parameters. */ -export interface ActivityLogAlertsDeleteOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface ActivityLogAlertsUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the update operation. */ -export type ActivityLogAlertsUpdateResponse = ActivityLogAlertResource; - -/** Optional parameters. */ -export interface ActivityLogAlertsListBySubscriptionIdOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscriptionId operation. */ -export type ActivityLogAlertsListBySubscriptionIdResponse = AlertRuleList; - -/** Optional parameters. */ -export interface ActivityLogAlertsListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type ActivityLogAlertsListByResourceGroupResponse = AlertRuleList; - -/** Optional parameters. */ -export interface ActivityLogAlertsListBySubscriptionIdNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscriptionIdNext operation. */ -export type ActivityLogAlertsListBySubscriptionIdNextResponse = AlertRuleList; - -/** Optional parameters. */ -export interface ActivityLogAlertsListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} +/** 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", +} -/** Contains response data for the listByResourceGroupNext operation. */ -export type ActivityLogAlertsListByResourceGroupNextResponse = AlertRuleList; +/** + * 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; -/** Optional parameters. */ -export interface DataCollectionEndpointsListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} +/** Known values of {@link Kind} that the service accepts. */ +export enum KnownKind { + /** LogAlert */ + LogAlert = "LogAlert", + /** SimpleLogAlert */ + SimpleLogAlert = "SimpleLogAlert", + /** LogToMetric */ + LogToMetric = "LogToMetric", +} -/** Contains response data for the listByResourceGroup operation. */ -export type DataCollectionEndpointsListByResourceGroupResponse = - DataCollectionEndpointResourceListResult; +/** + * Defines values for Kind. \ + * {@link KnownKind} can be used interchangeably with Kind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **LogAlert** \ + * **SimpleLogAlert** \ + * **LogToMetric** + */ +export type Kind = string; -/** Optional parameters. */ -export interface DataCollectionEndpointsListBySubscriptionOptionalParams - extends coreClient.OperationOptions {} +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + /** User */ + User = "User", + /** Application */ + Application = "Application", + /** ManagedIdentity */ + ManagedIdentity = "ManagedIdentity", + /** Key */ + Key = "Key", +} -/** Contains response data for the listBySubscription operation. */ -export type DataCollectionEndpointsListBySubscriptionResponse = - DataCollectionEndpointResourceListResult; +/** + * 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; -/** Optional parameters. */ -export interface DataCollectionEndpointsGetOptionalParams - extends coreClient.OperationOptions {} +/** Known values of {@link AlertSeverity} that the service accepts. */ +export enum KnownAlertSeverity { + /** Zero */ + Zero = 0, + /** One */ + One = 1, + /** Two */ + Two = 2, + /** Three */ + Three = 3, + /** Four */ + Four = 4, +} -/** Contains response data for the get operation. */ -export type DataCollectionEndpointsGetResponse = DataCollectionEndpointResource; +/** + * Defines values for AlertSeverity. \ + * {@link KnownAlertSeverity} can be used interchangeably with AlertSeverity, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **0** \ + * **1** \ + * **2** \ + * **3** \ + * **4** + */ +export type AlertSeverity = number; -/** Optional parameters. */ -export interface DataCollectionEndpointsCreateOptionalParams - extends coreClient.OperationOptions { - /** The payload */ - body?: DataCollectionEndpointResource; +/** Known values of {@link CriterionType} that the service accepts. */ +export enum KnownCriterionType { + /** StaticThresholdCriterion */ + StaticThresholdCriterion = "StaticThresholdCriterion", + /** DynamicThresholdCriterion */ + DynamicThresholdCriterion = "DynamicThresholdCriterion", } -/** Contains response data for the create operation. */ -export type DataCollectionEndpointsCreateResponse = - DataCollectionEndpointResource; +/** + * Defines values for CriterionType. \ + * {@link KnownCriterionType} can be used interchangeably with CriterionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **StaticThresholdCriterion** \ + * **DynamicThresholdCriterion** + */ +export type CriterionType = string; -/** Optional parameters. */ -export interface DataCollectionEndpointsUpdateOptionalParams - extends coreClient.OperationOptions { - /** The payload */ - body?: ResourceForUpdate; +/** Known values of {@link TimeAggregation} that the service accepts. */ +export enum KnownTimeAggregation { + /** Count */ + Count = "Count", + /** Average */ + Average = "Average", + /** Minimum */ + Minimum = "Minimum", + /** Maximum */ + Maximum = "Maximum", + /** Total */ + Total = "Total", } -/** Contains response data for the update operation. */ -export type DataCollectionEndpointsUpdateResponse = - DataCollectionEndpointResource; - -/** Optional parameters. */ -export interface DataCollectionEndpointsDeleteOptionalParams - extends coreClient.OperationOptions {} +/** + * Defines values for TimeAggregation. \ + * {@link KnownTimeAggregation} can be used interchangeably with TimeAggregation, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Count** \ + * **Average** \ + * **Minimum** \ + * **Maximum** \ + * **Total** + */ +export type TimeAggregation = string; -/** Optional parameters. */ -export interface DataCollectionEndpointsListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} +/** Known values of {@link DimensionOperator} that the service accepts. */ +export enum KnownDimensionOperator { + /** Include */ + Include = "Include", + /** Exclude */ + Exclude = "Exclude", +} -/** Contains response data for the listByResourceGroupNext operation. */ -export type DataCollectionEndpointsListByResourceGroupNextResponse = - DataCollectionEndpointResourceListResult; +/** + * Defines values for DimensionOperator. \ + * {@link KnownDimensionOperator} can be used interchangeably with DimensionOperator, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Include** \ + * **Exclude** + */ +export type DimensionOperator = string; -/** Optional parameters. */ -export interface DataCollectionEndpointsListBySubscriptionNextOptionalParams - extends coreClient.OperationOptions {} +/** Known values of {@link ConditionOperator} that the service accepts. */ +export enum KnownConditionOperator { + /** Equals */ + Equals = "Equals", + /** GreaterThan */ + GreaterThan = "GreaterThan", + /** GreaterThanOrEqual */ + GreaterThanOrEqual = "GreaterThanOrEqual", + /** LessThan */ + LessThan = "LessThan", + /** LessThanOrEqual */ + LessThanOrEqual = "LessThanOrEqual", + /** GreaterOrLessThan */ + GreaterOrLessThan = "GreaterOrLessThan", +} -/** Contains response data for the listBySubscriptionNext operation. */ -export type DataCollectionEndpointsListBySubscriptionNextResponse = - DataCollectionEndpointResourceListResult; +/** + * Defines values for ConditionOperator. \ + * {@link KnownConditionOperator} can be used interchangeably with ConditionOperator, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Equals** \ + * **GreaterThan** \ + * **GreaterThanOrEqual** \ + * **LessThan** \ + * **LessThanOrEqual** \ + * **GreaterOrLessThan** + */ +export type ConditionOperator = string; +/** Defines values for ReceiverStatus. */ +export type ReceiverStatus = "NotSpecified" | "Enabled" | "Disabled"; +/** Defines values for IdentityType. */ +export type IdentityType = "SystemAssigned" | "UserAssigned" | "None"; /** Optional parameters. */ -export interface DataCollectionRuleAssociationsListByResourceOptionalParams +export interface ActionGroupsCreateOrUpdateOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByResource operation. */ -export type DataCollectionRuleAssociationsListByResourceResponse = - DataCollectionRuleAssociationProxyOnlyResourceListResult; +/** Contains response data for the createOrUpdate operation. */ +export type ActionGroupsCreateOrUpdateResponse = ActionGroupResource; /** Optional parameters. */ -export interface DataCollectionRuleAssociationsListByRuleOptionalParams +export interface ActionGroupsGetOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByRule operation. */ -export type DataCollectionRuleAssociationsListByRuleResponse = - DataCollectionRuleAssociationProxyOnlyResourceListResult; +/** Contains response data for the get operation. */ +export type ActionGroupsGetResponse = ActionGroupResource; /** Optional parameters. */ -export interface DataCollectionRuleAssociationsListByDataCollectionEndpointOptionalParams +export interface ActionGroupsDeleteOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByDataCollectionEndpoint operation. */ -export type DataCollectionRuleAssociationsListByDataCollectionEndpointResponse = - DataCollectionRuleAssociationProxyOnlyResourceListResult; - /** Optional parameters. */ -export interface DataCollectionRuleAssociationsGetOptionalParams +export interface ActionGroupsUpdateOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the get operation. */ -export type DataCollectionRuleAssociationsGetResponse = - DataCollectionRuleAssociationProxyOnlyResource; +/** Contains response data for the update operation. */ +export type ActionGroupsUpdateResponse = ActionGroupResource; /** Optional parameters. */ -export interface DataCollectionRuleAssociationsCreateOptionalParams +export interface ActionGroupsCreateNotificationsAtActionGroupResourceLevelOptionalParams extends coreClient.OperationOptions { - /** The payload */ - body?: DataCollectionRuleAssociationProxyOnlyResource; + /** 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 create operation. */ -export type DataCollectionRuleAssociationsCreateResponse = - DataCollectionRuleAssociationProxyOnlyResource; +/** Contains response data for the createNotificationsAtActionGroupResourceLevel operation. */ +export type ActionGroupsCreateNotificationsAtActionGroupResourceLevelResponse = + TestNotificationDetailsResponse; /** Optional parameters. */ -export interface DataCollectionRuleAssociationsDeleteOptionalParams +export interface ActionGroupsGetTestNotificationsAtActionGroupResourceLevelOptionalParams extends coreClient.OperationOptions {} +/** Contains response data for the getTestNotificationsAtActionGroupResourceLevel operation. */ +export type ActionGroupsGetTestNotificationsAtActionGroupResourceLevelResponse = + TestNotificationDetailsResponse; + /** Optional parameters. */ -export interface DataCollectionRuleAssociationsListByResourceNextOptionalParams +export interface ActionGroupsListBySubscriptionIdOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByResourceNext operation. */ -export type DataCollectionRuleAssociationsListByResourceNextResponse = - DataCollectionRuleAssociationProxyOnlyResourceListResult; +/** Contains response data for the listBySubscriptionId operation. */ +export type ActionGroupsListBySubscriptionIdResponse = ActionGroupList; /** Optional parameters. */ -export interface DataCollectionRuleAssociationsListByRuleNextOptionalParams +export interface ActionGroupsListByResourceGroupOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByRuleNext operation. */ -export type DataCollectionRuleAssociationsListByRuleNextResponse = - DataCollectionRuleAssociationProxyOnlyResourceListResult; +/** Contains response data for the listByResourceGroup operation. */ +export type ActionGroupsListByResourceGroupResponse = ActionGroupList; /** Optional parameters. */ -export interface DataCollectionRuleAssociationsListByDataCollectionEndpointNextOptionalParams +export interface ActionGroupsEnableReceiverOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByDataCollectionEndpointNext operation. */ -export type DataCollectionRuleAssociationsListByDataCollectionEndpointNextResponse = - DataCollectionRuleAssociationProxyOnlyResourceListResult; - /** Optional parameters. */ -export interface DataCollectionRulesListByResourceGroupOptionalParams +export interface ScheduledQueryRulesListBySubscriptionOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByResourceGroup operation. */ -export type DataCollectionRulesListByResourceGroupResponse = - DataCollectionRuleResourceListResult; +/** Contains response data for the listBySubscription operation. */ +export type ScheduledQueryRulesListBySubscriptionResponse = + ScheduledQueryRuleResourceCollection; /** Optional parameters. */ -export interface DataCollectionRulesListBySubscriptionOptionalParams +export interface ScheduledQueryRulesListByResourceGroupOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listBySubscription operation. */ -export type DataCollectionRulesListBySubscriptionResponse = - DataCollectionRuleResourceListResult; +/** Contains response data for the listByResourceGroup operation. */ +export type ScheduledQueryRulesListByResourceGroupResponse = + ScheduledQueryRuleResourceCollection; /** Optional parameters. */ -export interface DataCollectionRulesGetOptionalParams +export interface ScheduledQueryRulesGetOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ -export type DataCollectionRulesGetResponse = DataCollectionRuleResource; +export type ScheduledQueryRulesGetResponse = ScheduledQueryRuleResource; /** Optional parameters. */ -export interface DataCollectionRulesCreateOptionalParams - extends coreClient.OperationOptions { - /** The payload */ - body?: DataCollectionRuleResource; -} +export interface ScheduledQueryRulesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the create operation. */ -export type DataCollectionRulesCreateResponse = DataCollectionRuleResource; +/** Contains response data for the createOrUpdate operation. */ +export type ScheduledQueryRulesCreateOrUpdateResponse = + ScheduledQueryRuleResource; /** Optional parameters. */ -export interface DataCollectionRulesUpdateOptionalParams - extends coreClient.OperationOptions { - /** The payload */ - body?: ResourceForUpdate; -} +export interface ScheduledQueryRulesUpdateOptionalParams + extends coreClient.OperationOptions {} /** Contains response data for the update operation. */ -export type DataCollectionRulesUpdateResponse = DataCollectionRuleResource; +export type ScheduledQueryRulesUpdateResponse = ScheduledQueryRuleResource; /** Optional parameters. */ -export interface DataCollectionRulesDeleteOptionalParams +export interface ScheduledQueryRulesDeleteOptionalParams extends coreClient.OperationOptions {} /** Optional parameters. */ -export interface DataCollectionRulesListByResourceGroupNextOptionalParams +export interface ScheduledQueryRulesListBySubscriptionNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByResourceGroupNext operation. */ -export type DataCollectionRulesListByResourceGroupNextResponse = - DataCollectionRuleResourceListResult; +/** Contains response data for the listBySubscriptionNext operation. */ +export type ScheduledQueryRulesListBySubscriptionNextResponse = + ScheduledQueryRuleResourceCollection; /** Optional parameters. */ -export interface DataCollectionRulesListBySubscriptionNextOptionalParams +export interface ScheduledQueryRulesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listBySubscriptionNext operation. */ -export type DataCollectionRulesListBySubscriptionNextResponse = - DataCollectionRuleResourceListResult; +/** Contains response data for the listByResourceGroupNext operation. */ +export type ScheduledQueryRulesListByResourceGroupNextResponse = + ScheduledQueryRuleResourceCollection; /** Optional parameters. */ export interface MonitorClientOptionalParams diff --git a/sdk/monitor/arm-monitor/src/models/mappers.ts b/sdk/monitor/arm-monitor/src/models/mappers.ts index cf8c983420e5..873cb3de3c20 100644 --- a/sdk/monitor/arm-monitor/src/models/mappers.ts +++ b/sdk/monitor/arm-monitor/src/models/mappers.ts @@ -8,246 +8,202 @@ import * as coreClient from "@azure/core-client"; -export const MetricNamespaceCollection: coreClient.CompositeMapper = { +export const EmailReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricNamespaceCollection", + className: "EmailReceiver", modelProperties: { - value: { - serializedName: "value", + name: { + serializedName: "name", required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricNamespace", - }, - }, - }, - }, - }, - }, -}; - -export const MetricNamespace: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MetricNamespace", - modelProperties: { - id: { - serializedName: "id", type: { name: "String", }, }, - type: { - serializedName: "type", - type: { - name: "String", - }, - }, - name: { - serializedName: "name", + emailAddress: { + serializedName: "emailAddress", + required: true, type: { name: "String", }, }, - classification: { - serializedName: "classification", + useCommonAlertSchema: { + defaultValue: false, + serializedName: "useCommonAlertSchema", type: { - name: "String", + name: "Boolean", }, }, - properties: { - serializedName: "properties", + status: { + serializedName: "status", + readOnly: true, type: { - name: "Composite", - className: "MetricNamespaceName", + name: "Enum", + allowedValues: ["NotSpecified", "Enabled", "Disabled"], }, }, }, }, }; -export const MetricNamespaceName: coreClient.CompositeMapper = { +export const SmsReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricNamespaceName", + className: "SmsReceiver", modelProperties: { - metricNamespaceName: { - serializedName: "metricNamespaceName", + name: { + serializedName: "name", + required: true, type: { name: "String", }, }, - }, - }, -}; - -export const ErrorResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorResponse", - modelProperties: { - code: { - serializedName: "code", + countryCode: { + serializedName: "countryCode", + required: true, type: { name: "String", }, }, - message: { - serializedName: "message", + phoneNumber: { + serializedName: "phoneNumber", + required: true, type: { name: "String", }, }, - }, - }, -}; - -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", - }, - }, - }, + status: { + serializedName: "status", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["NotSpecified", "Enabled", "Disabled"], }, }, }, - }; + }, +}; -export const SubscriptionScopeMetricDefinition: coreClient.CompositeMapper = { +export const WebhookReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SubscriptionScopeMetricDefinition", + className: "WebhookReceiver", modelProperties: { - isDimensionRequired: { - serializedName: "isDimensionRequired", + name: { + serializedName: "name", + required: true, type: { - name: "Boolean", + name: "String", }, }, - resourceId: { - serializedName: "resourceId", + serviceUri: { + serializedName: "serviceUri", + required: true, type: { name: "String", }, }, - namespace: { - serializedName: "namespace", + useCommonAlertSchema: { + defaultValue: false, + serializedName: "useCommonAlertSchema", type: { - name: "String", + name: "Boolean", }, }, - name: { - serializedName: "name", + useAadAuth: { + defaultValue: false, + serializedName: "useAadAuth", type: { - name: "Composite", - className: "LocalizableString", + name: "Boolean", }, }, - displayDescription: { - serializedName: "displayDescription", + objectId: { + serializedName: "objectId", type: { name: "String", }, }, - category: { - serializedName: "category", + identifierUri: { + serializedName: "identifierUri", type: { name: "String", }, }, - metricClass: { - serializedName: "metricClass", + tenantId: { + serializedName: "tenantId", type: { name: "String", }, }, - unit: { - serializedName: "unit", + managedIdentity: { + serializedName: "managedIdentity", type: { name: "String", }, }, - primaryAggregationType: { - serializedName: "primaryAggregationType", + }, + }, +}; + +export const ItsmReceiver: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ItsmReceiver", + modelProperties: { + name: { + serializedName: "name", + required: true, type: { name: "String", }, }, - supportedAggregationTypes: { - serializedName: "supportedAggregationTypes", + workspaceId: { + serializedName: "workspaceId", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, + name: "String", }, }, - metricAvailabilities: { - serializedName: "metricAvailabilities", + connectionId: { + serializedName: "connectionId", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricAvailability", - }, - }, + name: "String", }, }, - id: { - serializedName: "id", + ticketConfiguration: { + serializedName: "ticketConfiguration", + required: true, type: { name: "String", }, }, - dimensions: { - serializedName: "dimensions", + region: { + serializedName: "region", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "LocalizableString", - }, - }, + name: "String", }, }, }, }, }; -export const LocalizableString: coreClient.CompositeMapper = { +export const AzureAppPushReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LocalizableString", + className: "AzureAppPushReceiver", modelProperties: { - value: { - serializedName: "value", + name: { + serializedName: "name", required: true, type: { name: "String", }, }, - localizedValue: { - serializedName: "localizedValue", + emailAddress: { + serializedName: "emailAddress", + required: true, type: { name: "String", }, @@ -256,437 +212,330 @@ export const LocalizableString: coreClient.CompositeMapper = { }, }; -export const MetricAvailability: coreClient.CompositeMapper = { +export const AutomationRunbookReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricAvailability", + className: "AutomationRunbookReceiver", modelProperties: { - timeGrain: { - serializedName: "timeGrain", + automationAccountId: { + serializedName: "automationAccountId", + required: true, type: { - name: "TimeSpan", + name: "String", }, }, - retention: { - serializedName: "retention", + runbookName: { + serializedName: "runbookName", + required: true, type: { - name: "TimeSpan", + name: "String", }, }, - }, - }, -}; - -export const ErrorContract: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorContract", - modelProperties: { - error: { - serializedName: "error", + webhookResourceId: { + serializedName: "webhookResourceId", + required: true, type: { - name: "Composite", - className: "ErrorResponseAutoGenerated", + name: "String", }, }, - }, - }, -}; - -export const ErrorResponseAutoGenerated: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorResponseAutoGenerated", - modelProperties: { - code: { - serializedName: "code", - readOnly: true, + isGlobalRunbook: { + serializedName: "isGlobalRunbook", + required: true, type: { - name: "String", + name: "Boolean", }, }, - message: { - serializedName: "message", - readOnly: true, + name: { + serializedName: "name", type: { name: "String", }, }, - target: { - serializedName: "target", - readOnly: true, + serviceUri: { + serializedName: "serviceUri", type: { name: "String", }, }, - details: { - serializedName: "details", - readOnly: true, + useCommonAlertSchema: { + defaultValue: false, + serializedName: "useCommonAlertSchema", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorResponseAutoGenerated", - }, - }, + name: "Boolean", }, }, - additionalInfo: { - serializedName: "additionalInfo", - readOnly: true, + managedIdentity: { + serializedName: "managedIdentity", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - }, - }, + name: "String", }, }, }, }, }; -export const ErrorAdditionalInfo: coreClient.CompositeMapper = { +export const VoiceReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorAdditionalInfo", + className: "VoiceReceiver", modelProperties: { - type: { - serializedName: "type", - readOnly: true, + name: { + serializedName: "name", + required: true, type: { name: "String", }, }, - info: { - serializedName: "info", - readOnly: true, + countryCode: { + serializedName: "countryCode", + required: true, type: { - name: "Dictionary", - value: { type: { name: "any" } }, + name: "String", }, }, - }, - }, -}; - -export const MetricDefinitionCollection: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MetricDefinitionCollection", - modelProperties: { - value: { - serializedName: "value", + phoneNumber: { + serializedName: "phoneNumber", required: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricDefinition", - }, - }, + name: "String", }, }, }, }, }; -export const MetricDefinition: coreClient.CompositeMapper = { +export const LogicAppReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricDefinition", + className: "LogicAppReceiver", modelProperties: { - isDimensionRequired: { - serializedName: "isDimensionRequired", + name: { + serializedName: "name", + required: true, type: { - name: "Boolean", + name: "String", }, }, resourceId: { serializedName: "resourceId", + required: true, type: { name: "String", }, }, - namespace: { - serializedName: "namespace", + callbackUrl: { + serializedName: "callbackUrl", + required: true, type: { name: "String", }, }, - name: { - serializedName: "name", + useCommonAlertSchema: { + defaultValue: false, + serializedName: "useCommonAlertSchema", type: { - name: "Composite", - className: "LocalizableString", + name: "Boolean", }, }, - displayDescription: { - serializedName: "displayDescription", + managedIdentity: { + serializedName: "managedIdentity", type: { name: "String", }, }, - category: { - serializedName: "category", + }, + }, +}; + +export const AzureFunctionReceiver: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureFunctionReceiver", + modelProperties: { + name: { + serializedName: "name", + required: true, type: { name: "String", }, }, - metricClass: { - serializedName: "metricClass", + functionAppResourceId: { + serializedName: "functionAppResourceId", + required: true, type: { name: "String", }, }, - unit: { - serializedName: "unit", + functionName: { + serializedName: "functionName", + required: true, type: { name: "String", }, }, - primaryAggregationType: { - serializedName: "primaryAggregationType", - type: { - name: "Enum", - allowedValues: [ - "None", - "Average", - "Count", - "Minimum", - "Maximum", - "Total", - ], - }, - }, - supportedAggregationTypes: { - serializedName: "supportedAggregationTypes", + httpTriggerUrl: { + serializedName: "httpTriggerUrl", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: [ - "None", - "Average", - "Count", - "Minimum", - "Maximum", - "Total", - ], - }, - }, + name: "String", }, }, - metricAvailabilities: { - serializedName: "metricAvailabilities", + useCommonAlertSchema: { + defaultValue: false, + serializedName: "useCommonAlertSchema", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricAvailability", - }, - }, + name: "Boolean", }, }, - id: { - serializedName: "id", + managedIdentity: { + serializedName: "managedIdentity", type: { name: "String", }, }, - dimensions: { - serializedName: "dimensions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "LocalizableString", - }, - }, - }, - }, }, }, }; -export const Response: coreClient.CompositeMapper = { +export const ArmRoleReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Response", + className: "ArmRoleReceiver", modelProperties: { - cost: { - constraints: { - InclusiveMinimum: 0, - }, - serializedName: "cost", - type: { - name: "Number", - }, - }, - timespan: { - serializedName: "timespan", + name: { + serializedName: "name", required: true, type: { name: "String", }, }, - interval: { - serializedName: "interval", - type: { - name: "String", - }, - }, - namespace: { - serializedName: "namespace", - type: { - name: "String", - }, - }, - resourceregion: { - serializedName: "resourceregion", + roleId: { + serializedName: "roleId", + required: true, type: { name: "String", }, }, - value: { - serializedName: "value", - required: true, + useCommonAlertSchema: { + defaultValue: false, + serializedName: "useCommonAlertSchema", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Metric", - }, - }, + name: "Boolean", }, }, }, }, }; -export const Metric: coreClient.CompositeMapper = { +export const EventHubReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Metric", + className: "EventHubReceiver", modelProperties: { - id: { - serializedName: "id", + name: { + serializedName: "name", required: true, type: { name: "String", }, }, - type: { - serializedName: "type", + eventHubNameSpace: { + serializedName: "eventHubNameSpace", required: true, type: { name: "String", }, }, - name: { - serializedName: "name", - type: { - name: "Composite", - className: "LocalizableString", - }, - }, - displayDescription: { - serializedName: "displayDescription", + eventHubName: { + serializedName: "eventHubName", + required: true, type: { name: "String", }, }, - errorCode: { - serializedName: "errorCode", + useCommonAlertSchema: { + defaultValue: false, + serializedName: "useCommonAlertSchema", type: { - name: "String", + name: "Boolean", }, }, - errorMessage: { - serializedName: "errorMessage", + tenantId: { + serializedName: "tenantId", type: { name: "String", }, }, - unit: { - serializedName: "unit", + subscriptionId: { + serializedName: "subscriptionId", required: true, type: { name: "String", }, }, - timeseries: { - serializedName: "timeseries", - required: true, + managedIdentity: { + serializedName: "managedIdentity", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "TimeSeriesElement", - }, - }, + name: "String", }, }, }, }, }; -export const TimeSeriesElement: coreClient.CompositeMapper = { +export const IncidentReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TimeSeriesElement", + className: "IncidentReceiver", modelProperties: { - metadatavalues: { - serializedName: "metadatavalues", + name: { + serializedName: "name", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetadataValue", - }, - }, + name: "String", }, }, - data: { - serializedName: "data", + connection: { + serializedName: "connection", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricValue", - }, - }, + name: "Composite", + className: "IncidentServiceConnection", + }, + }, + incidentManagementService: { + serializedName: "incidentManagementService", + required: true, + type: { + name: "String", + }, + }, + mappings: { + serializedName: "mappings", + required: true, + type: { + name: "Dictionary", + value: { type: { name: "String" } }, }, }, }, }, }; -export const MetadataValue: coreClient.CompositeMapper = { +export const IncidentServiceConnection: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetadataValue", + className: "IncidentServiceConnection", modelProperties: { name: { serializedName: "name", + required: true, type: { - name: "Composite", - className: "LocalizableString", + name: "String", }, }, - value: { - serializedName: "value", + id: { + serializedName: "id", + required: true, type: { name: "String", }, @@ -695,274 +544,132 @@ export const MetadataValue: coreClient.CompositeMapper = { }, }; -export const MetricValue: coreClient.CompositeMapper = { +export const AzureResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricValue", + className: "AzureResource", modelProperties: { - timeStamp: { - serializedName: "timeStamp", - required: true, + id: { + serializedName: "id", + readOnly: true, type: { - name: "DateTime", + name: "String", }, }, - average: { - serializedName: "average", + name: { + serializedName: "name", + readOnly: true, type: { - name: "Number", + name: "String", }, }, - minimum: { - serializedName: "minimum", + type: { + serializedName: "type", + readOnly: true, type: { - name: "Number", + name: "String", }, }, - maximum: { - serializedName: "maximum", + location: { + serializedName: "location", + required: true, type: { - name: "Number", + name: "String", }, }, - total: { - serializedName: "total", + tags: { + serializedName: "tags", type: { - name: "Number", + name: "Dictionary", + value: { type: { name: "String" } }, }, }, - count: { - serializedName: "count", + identity: { + serializedName: "identity", type: { - name: "Number", + name: "Composite", + className: "ManagedServiceIdentity", }, }, }, }, }; -export const SubscriptionScopeMetricsRequestBodyParameters: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "SubscriptionScopeMetricsRequestBodyParameters", - modelProperties: { - timespan: { - serializedName: "timespan", - type: { - name: "String", - }, - }, - interval: { - serializedName: "interval", - type: { - name: "String", - }, - }, - 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 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 = { +export const ManagedServiceIdentity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureMonitorWorkspace", + className: "ManagedServiceIdentity", modelProperties: { - accountId: { - serializedName: "accountId", + principalId: { + serializedName: "principalId", readOnly: true, type: { - name: "String", - }, - }, - metrics: { - serializedName: "metrics", - type: { - name: "Composite", - className: "AzureMonitorWorkspaceMetrics", + name: "Uuid", }, }, - provisioningState: { - serializedName: "provisioningState", + tenantId: { + serializedName: "tenantId", readOnly: true, type: { - name: "String", + name: "Uuid", }, }, - defaultIngestionSettings: { - serializedName: "defaultIngestionSettings", + type: { + serializedName: "type", + required: true, type: { - name: "Composite", - className: "AzureMonitorWorkspaceDefaultIngestionSettings", + name: "String", }, }, - privateEndpointConnections: { - serializedName: "privateEndpointConnections", - readOnly: true, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnection", - }, + name: "Dictionary", + value: { + type: { name: "Composite", className: "UserAssignedIdentity" }, }, }, }, - publicNetworkAccess: { - serializedName: "publicNetworkAccess", - readOnly: true, - type: { - name: "String", - }, - }, }, }, }; -export const Metrics: coreClient.CompositeMapper = { +export const UserAssignedIdentity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Metrics", + className: "UserAssignedIdentity", modelProperties: { - prometheusQueryEndpoint: { - serializedName: "prometheusQueryEndpoint", + principalId: { + serializedName: "principalId", readOnly: true, type: { - name: "String", + name: "Uuid", }, }, - internalId: { - serializedName: "internalId", + clientId: { + serializedName: "clientId", readOnly: true, type: { - name: "String", + name: "Uuid", }, }, }, }, }; -export const IngestionSettings: coreClient.CompositeMapper = { +export const ErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IngestionSettings", + className: "ErrorResponse", modelProperties: { - dataCollectionRuleResourceId: { - serializedName: "dataCollectionRuleResourceId", - readOnly: true, - type: { - name: "String", - }, - }, - dataCollectionEndpointResourceId: { - serializedName: "dataCollectionEndpointResourceId", - readOnly: true, + code: { + serializedName: "code", type: { name: "String", }, }, - }, - }, -}; - -export const PrivateEndpoint: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpoint", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, + message: { + serializedName: "message", type: { name: "String", }, @@ -971,216 +678,238 @@ export const PrivateEndpoint: coreClient.CompositeMapper = { }, }; -export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { +export const ActionGroupPatchBody: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateLinkServiceConnectionState", + className: "ActionGroupPatchBody", modelProperties: { - status: { - serializedName: "status", + tags: { + serializedName: "tags", type: { - name: "String", + name: "Dictionary", + value: { type: { name: "String" } }, }, }, - description: { - serializedName: "description", + identity: { + serializedName: "identity", type: { - name: "String", + name: "Composite", + className: "ManagedServiceIdentity", }, }, - actionsRequired: { - serializedName: "actionsRequired", + enabled: { + defaultValue: true, + serializedName: "properties.enabled", type: { - name: "String", + name: "Boolean", }, }, }, }, }; -export const Resource: coreClient.CompositeMapper = { +export const NotificationRequestBody: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "NotificationRequestBody", modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", + alertType: { + constraints: { + MaxLength: 30, }, - }, - name: { - serializedName: "name", - readOnly: true, + serializedName: "alertType", + required: true, type: { name: "String", }, }, - type: { - serializedName: "type", - readOnly: true, + emailReceivers: { + serializedName: "emailReceivers", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EmailReceiver", + }, + }, }, }, - systemData: { - serializedName: "systemData", + smsReceivers: { + serializedName: "smsReceivers", type: { - name: "Composite", - className: "SystemData", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SmsReceiver", + }, + }, }, }, - }, - }, -}; - -export const SystemData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SystemData", - modelProperties: { - createdBy: { - serializedName: "createdBy", + webhookReceivers: { + serializedName: "webhookReceivers", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "WebhookReceiver", + }, + }, }, }, - createdByType: { - serializedName: "createdByType", + itsmReceivers: { + serializedName: "itsmReceivers", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ItsmReceiver", + }, + }, }, }, - createdAt: { - serializedName: "createdAt", + azureAppPushReceivers: { + serializedName: "azureAppPushReceivers", type: { - name: "DateTime", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AzureAppPushReceiver", + }, + }, }, }, - lastModifiedBy: { - serializedName: "lastModifiedBy", + automationRunbookReceivers: { + serializedName: "automationRunbookReceivers", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AutomationRunbookReceiver", + }, + }, }, }, - lastModifiedByType: { - serializedName: "lastModifiedByType", + voiceReceivers: { + serializedName: "voiceReceivers", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VoiceReceiver", + }, + }, }, }, - lastModifiedAt: { - serializedName: "lastModifiedAt", + logicAppReceivers: { + serializedName: "logicAppReceivers", type: { - name: "DateTime", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LogicAppReceiver", + }, + }, }, }, - }, - }, -}; - -export const ResourceAutoGenerated: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceAutoGenerated", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, + azureFunctionReceivers: { + serializedName: "azureFunctionReceivers", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AzureFunctionReceiver", + }, + }, }, }, - name: { - serializedName: "name", - readOnly: true, + armRoleReceivers: { + serializedName: "armRoleReceivers", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ArmRoleReceiver", + }, + }, }, }, - type: { - serializedName: "type", - readOnly: true, + eventHubReceivers: { + serializedName: "eventHubReceivers", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EventHubReceiver", + }, + }, }, }, - systemData: { - serializedName: "systemData", + incidentReceivers: { + serializedName: "incidentReceivers", type: { - name: "Composite", - className: "SystemData", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IncidentReceiver", + }, + }, }, }, }, }, }; -export const ErrorResponseAutoGenerated2: coreClient.CompositeMapper = { +export const TestNotificationDetailsResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorResponseAutoGenerated2", + className: "TestNotificationDetailsResponse", modelProperties: { - error: { - serializedName: "error", + context: { + serializedName: "context", type: { name: "Composite", - className: "ErrorDetail", + className: "Context", }, }, - }, - }, -}; - -export const ErrorDetail: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorDetail", - modelProperties: { - code: { - serializedName: "code", - readOnly: true, + state: { + serializedName: "state", + required: true, type: { name: "String", }, }, - message: { - serializedName: "message", - readOnly: true, + completedTime: { + serializedName: "completedTime", type: { name: "String", }, }, - target: { - serializedName: "target", - readOnly: true, + createdTime: { + serializedName: "createdTime", type: { name: "String", }, }, - details: { - serializedName: "details", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorDetail", - }, - }, - }, - }, - additionalInfo: { - serializedName: "additionalInfo", - readOnly: true, + actionDetails: { + serializedName: "actionDetails", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ErrorAdditionalInfo", + className: "ActionDetail", }, }, }, @@ -1189,44 +918,19 @@ export const ErrorDetail: coreClient.CompositeMapper = { }, }; -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 = { +export const Context: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationListResult", + className: "Context", modelProperties: { - value: { - serializedName: "value", - readOnly: true, + notificationSource: { + serializedName: "notificationSource", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation", - }, - }, + name: "String", }, }, - nextLink: { - serializedName: "nextLink", - readOnly: true, + contextType: { + serializedName: "contextType", type: { name: "String", }, @@ -1235,79 +939,43 @@ export const OperationListResult: coreClient.CompositeMapper = { }, }; -export const Operation: coreClient.CompositeMapper = { +export const ActionDetail: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Operation", + className: "ActionDetail", 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, + mechanismType: { + serializedName: "MechanismType", type: { name: "String", }, }, - actionType: { - serializedName: "actionType", - readOnly: true, + name: { + serializedName: "Name", type: { name: "String", }, }, - }, - }, -}; - -export const OperationDisplay: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationDisplay", - modelProperties: { - provider: { - serializedName: "provider", - readOnly: true, + status: { + serializedName: "Status", type: { name: "String", }, }, - resource: { - serializedName: "resource", - readOnly: true, + subState: { + serializedName: "SubState", type: { name: "String", }, }, - operation: { - serializedName: "operation", - readOnly: true, + sendTime: { + serializedName: "SendTime", type: { name: "String", }, }, - description: { - serializedName: "description", - readOnly: true, + detail: { + serializedName: "Detail", type: { name: "String", }, @@ -1316,20 +984,19 @@ export const OperationDisplay: coreClient.CompositeMapper = { }, }; -export const AutoscaleSettingResourceCollection: coreClient.CompositeMapper = { +export const ActionGroupList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AutoscaleSettingResourceCollection", + className: "ActionGroupList", modelProperties: { value: { serializedName: "value", - required: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "AutoscaleSettingResource", + className: "ActionGroupResource", }, }, }, @@ -1344,243 +1011,187 @@ export const AutoscaleSettingResourceCollection: coreClient.CompositeMapper = { }, }; -export const AutoscaleProfile: coreClient.CompositeMapper = { +export const EnableRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AutoscaleProfile", + className: "EnableRequest", modelProperties: { - name: { - serializedName: "name", + receiverName: { + serializedName: "receiverName", required: true, type: { name: "String", }, }, - capacity: { - serializedName: "capacity", - type: { - name: "Composite", - className: "ScaleCapacity", - }, - }, - rules: { - serializedName: "rules", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ScaleRule", - }, - }, - }, - }, - fixedDate: { - serializedName: "fixedDate", - type: { - name: "Composite", - className: "TimeWindow", - }, - }, - recurrence: { - serializedName: "recurrence", - type: { - name: "Composite", - className: "Recurrence", - }, - }, }, }, }; -export const ScaleCapacity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ScaleCapacity", - modelProperties: { - minimum: { - serializedName: "minimum", - required: true, - type: { - name: "String", - }, - }, - maximum: { - serializedName: "maximum", - required: true, - type: { - name: "String", - }, - }, - default: { - serializedName: "default", - required: true, - type: { - name: "String", +export const ScheduledQueryRuleResourceCollection: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "ScheduledQueryRuleResourceCollection", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ScheduledQueryRuleResource", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, }, }, }, - }, -}; + }; -export const ScaleRule: coreClient.CompositeMapper = { +export const ScheduledQueryRuleResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ScaleRule", + className: "ScheduledQueryRuleResource", modelProperties: { - metricTrigger: { - serializedName: "metricTrigger", + id: { + serializedName: "id", + readOnly: true, type: { - name: "Composite", - className: "MetricTrigger", + name: "String", }, }, - scaleAction: { - serializedName: "scaleAction", + name: { + serializedName: "name", + readOnly: true, type: { - name: "Composite", - className: "ScaleAction", + name: "String", }, }, - }, - }, -}; - -export const MetricTrigger: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MetricTrigger", - modelProperties: { - metricName: { - serializedName: "metricName", - required: true, + type: { + serializedName: "type", + readOnly: true, type: { name: "String", }, }, - metricNamespace: { - serializedName: "metricNamespace", + identity: { + serializedName: "identity", type: { - name: "String", + name: "Composite", + className: "Identity", + }, + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, }, }, - metricResourceUri: { - serializedName: "metricResourceUri", + location: { + serializedName: "location", required: true, type: { name: "String", }, }, - metricResourceLocation: { - serializedName: "metricResourceLocation", + kind: { + serializedName: "kind", type: { name: "String", }, }, - timeGrain: { - serializedName: "timeGrain", - required: true, + etag: { + serializedName: "etag", + readOnly: true, type: { - name: "TimeSpan", + name: "String", }, }, - statistic: { - serializedName: "statistic", - required: true, + systemData: { + serializedName: "systemData", type: { - name: "Enum", - allowedValues: ["Average", "Min", "Max", "Sum", "Count"], + name: "Composite", + className: "SystemData", }, }, - timeWindow: { - serializedName: "timeWindow", - required: true, + createdWithApiVersion: { + serializedName: "properties.createdWithApiVersion", + readOnly: true, type: { - name: "TimeSpan", + name: "String", }, }, - timeAggregation: { - serializedName: "timeAggregation", - required: true, + isLegacyLogAnalyticsRule: { + serializedName: "properties.isLegacyLogAnalyticsRule", + readOnly: true, type: { - name: "Enum", - allowedValues: [ - "Average", - "Minimum", - "Maximum", - "Total", - "Count", - "Last", - ], + name: "Boolean", }, }, - operator: { - serializedName: "operator", - required: true, + description: { + serializedName: "properties.description", type: { - name: "Enum", - allowedValues: [ - "Equals", - "NotEquals", - "GreaterThan", - "GreaterThanOrEqual", - "LessThan", - "LessThanOrEqual", - ], + name: "String", }, }, - threshold: { - serializedName: "threshold", - required: true, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String", + }, + }, + severity: { + serializedName: "properties.severity", type: { name: "Number", }, }, - dimensions: { - serializedName: "dimensions", + enabled: { + serializedName: "properties.enabled", + type: { + name: "Boolean", + }, + }, + scopes: { + serializedName: "properties.scopes", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "ScaleRuleMetricDimension", + name: "String", }, }, }, }, - dividePerInstance: { - serializedName: "dividePerInstance", + evaluationFrequency: { + serializedName: "properties.evaluationFrequency", type: { - name: "Boolean", + name: "TimeSpan", }, }, - }, - }, -}; - -export const ScaleRuleMetricDimension: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ScaleRuleMetricDimension", - modelProperties: { - dimensionName: { - serializedName: "DimensionName", - required: true, + windowSize: { + serializedName: "properties.windowSize", type: { - name: "String", + name: "TimeSpan", }, }, - operator: { - serializedName: "Operator", - required: true, + overrideQueryTimeRange: { + serializedName: "properties.overrideQueryTimeRange", type: { - name: "String", + name: "TimeSpan", }, }, - values: { - serializedName: "Values", - required: true, + targetResourceTypes: { + serializedName: "properties.targetResourceTypes", type: { name: "Sequence", element: { @@ -1590,160 +1201,183 @@ export const ScaleRuleMetricDimension: coreClient.CompositeMapper = { }, }, }, - }, - }, -}; - -export const ScaleAction: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ScaleAction", - modelProperties: { - direction: { - serializedName: "direction", - required: true, + criteria: { + serializedName: "properties.criteria", type: { - name: "Enum", - allowedValues: ["None", "Increase", "Decrease"], + name: "Composite", + className: "ScheduledQueryRuleCriteria", }, }, - type: { - serializedName: "type", - required: true, + muteActionsDuration: { + serializedName: "properties.muteActionsDuration", type: { - name: "Enum", - allowedValues: [ - "ChangeCount", - "PercentChangeCount", - "ExactCount", - "ServiceAllowedNextValue", - ], + name: "TimeSpan", }, }, - value: { - defaultValue: "1", - serializedName: "value", + actions: { + serializedName: "properties.actions", type: { - name: "String", + name: "Composite", + className: "Actions", }, }, - cooldown: { - serializedName: "cooldown", - required: true, + isWorkspaceAlertsStorageConfigured: { + serializedName: "properties.isWorkspaceAlertsStorageConfigured", + readOnly: true, type: { - name: "TimeSpan", + name: "Boolean", + }, + }, + checkWorkspaceAlertsStorageConfigured: { + serializedName: "properties.checkWorkspaceAlertsStorageConfigured", + type: { + name: "Boolean", + }, + }, + skipQueryValidation: { + serializedName: "properties.skipQueryValidation", + type: { + name: "Boolean", + }, + }, + autoMitigate: { + serializedName: "properties.autoMitigate", + type: { + name: "Boolean", + }, + }, + resolveConfiguration: { + serializedName: "properties.resolveConfiguration", + type: { + name: "Composite", + className: "RuleResolveConfiguration", }, }, }, }, }; -export const TimeWindow: coreClient.CompositeMapper = { +export const Identity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TimeWindow", + className: "Identity", modelProperties: { - timeZone: { - serializedName: "timeZone", + principalId: { + serializedName: "principalId", + readOnly: true, type: { name: "String", }, }, - start: { - serializedName: "start", - required: true, + tenantId: { + serializedName: "tenantId", + readOnly: true, type: { - name: "DateTime", + name: "String", }, }, - end: { - serializedName: "end", + type: { + serializedName: "type", required: true, type: { - name: "DateTime", + name: "Enum", + allowedValues: ["SystemAssigned", "UserAssigned", "None"], + }, + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { name: "Composite", className: "UserIdentityProperties" }, + }, }, }, }, }, }; -export const Recurrence: coreClient.CompositeMapper = { +export const UserIdentityProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Recurrence", + className: "UserIdentityProperties", modelProperties: { - frequency: { - serializedName: "frequency", - required: true, + principalId: { + serializedName: "principalId", + readOnly: true, type: { - name: "Enum", - allowedValues: [ - "None", - "Second", - "Minute", - "Hour", - "Day", - "Week", - "Month", - "Year", - ], + name: "String", }, }, - schedule: { - serializedName: "schedule", + clientId: { + serializedName: "clientId", + readOnly: true, type: { - name: "Composite", - className: "RecurrentSchedule", + name: "String", }, }, }, }, }; -export const RecurrentSchedule: coreClient.CompositeMapper = { +export const SystemData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RecurrentSchedule", + className: "SystemData", modelProperties: { - timeZone: { - serializedName: "timeZone", - required: true, + createdBy: { + serializedName: "createdBy", type: { name: "String", }, }, - days: { - serializedName: "days", - required: true, + createdByType: { + serializedName: "createdByType", type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, + name: "String", }, }, - hours: { - serializedName: "hours", - required: true, + createdAt: { + serializedName: "createdAt", type: { - name: "Sequence", - element: { - type: { - name: "Number", - }, - }, + name: "DateTime", }, }, - minutes: { - serializedName: "minutes", - required: true, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String", + }, + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String", + }, + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime", + }, + }, + }, + }, +}; + +export const ScheduledQueryRuleCriteria: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ScheduledQueryRuleCriteria", + modelProperties: { + allOf: { + serializedName: "allOf", type: { name: "Sequence", element: { type: { - name: "Number", + name: "Composite", + className: "Condition", }, }, }, @@ -1752,63 +1386,122 @@ export const RecurrentSchedule: coreClient.CompositeMapper = { }, }; -export const AutoscaleNotification: coreClient.CompositeMapper = { +export const Condition: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AutoscaleNotification", + className: "Condition", modelProperties: { - operation: { - defaultValue: "Scale", - isConstant: true, - serializedName: "operation", + criterionType: { + serializedName: "criterionType", type: { name: "String", }, }, - email: { - serializedName: "email", + query: { + serializedName: "query", type: { - name: "Composite", - className: "EmailNotification", + name: "String", + }, + }, + timeAggregation: { + serializedName: "timeAggregation", + type: { + name: "String", + }, + }, + metricMeasureColumn: { + serializedName: "metricMeasureColumn", + type: { + name: "String", + }, + }, + resourceIdColumn: { + serializedName: "resourceIdColumn", + type: { + name: "String", }, }, - webhooks: { - serializedName: "webhooks", + dimensions: { + serializedName: "dimensions", type: { name: "Sequence", element: { type: { name: "Composite", - className: "WebhookNotification", + className: "Dimension", }, }, }, }, + operator: { + serializedName: "operator", + type: { + name: "String", + }, + }, + threshold: { + serializedName: "threshold", + type: { + name: "Number", + }, + }, + alertSensitivity: { + serializedName: "alertSensitivity", + type: { + name: "String", + }, + }, + ignoreDataBefore: { + serializedName: "ignoreDataBefore", + type: { + name: "DateTime", + }, + }, + failingPeriods: { + serializedName: "failingPeriods", + type: { + name: "Composite", + className: "ConditionFailingPeriods", + }, + }, + metricName: { + serializedName: "metricName", + type: { + name: "String", + }, + }, + minRecurrenceCount: { + serializedName: "minRecurrenceCount", + type: { + name: "Number", + }, + }, }, }, }; -export const EmailNotification: coreClient.CompositeMapper = { +export const Dimension: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EmailNotification", + className: "Dimension", modelProperties: { - sendToSubscriptionAdministrator: { - defaultValue: false, - serializedName: "sendToSubscriptionAdministrator", + name: { + serializedName: "name", + required: true, type: { - name: "Boolean", + name: "String", }, }, - sendToSubscriptionCoAdministrators: { - defaultValue: false, - serializedName: "sendToSubscriptionCoAdministrators", + operator: { + serializedName: "operator", + required: true, type: { - name: "Boolean", + name: "String", }, }, - customEmails: { - serializedName: "customEmails", + values: { + serializedName: "values", + required: true, type: { name: "Sequence", element: { @@ -1822,8142 +1515,497 @@ export const EmailNotification: coreClient.CompositeMapper = { }, }; -export const WebhookNotification: coreClient.CompositeMapper = { +export const ConditionFailingPeriods: coreClient.CompositeMapper = { type: { name: "Composite", - className: "WebhookNotification", + className: "ConditionFailingPeriods", modelProperties: { - serviceUri: { - serializedName: "serviceUri", + numberOfEvaluationPeriods: { + defaultValue: 1, + serializedName: "numberOfEvaluationPeriods", type: { - name: "String", + name: "Number", }, }, - properties: { - serializedName: "properties", + minFailingPeriodsToAlert: { + defaultValue: 1, + serializedName: "minFailingPeriodsToAlert", type: { - name: "Dictionary", - value: { type: { name: "String" } }, + name: "Number", }, }, }, }, }; -export const PredictiveAutoscalePolicy: coreClient.CompositeMapper = { +export const Actions: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PredictiveAutoscalePolicy", + className: "Actions", modelProperties: { - scaleMode: { - serializedName: "scaleMode", - required: true, + actionGroups: { + serializedName: "actionGroups", type: { - name: "Enum", - allowedValues: ["Disabled", "ForecastOnly", "Enabled"], + name: "Sequence", + element: { + type: { + name: "String", + }, + }, }, }, - scaleLookAheadTime: { - serializedName: "scaleLookAheadTime", + customProperties: { + serializedName: "customProperties", type: { - name: "TimeSpan", + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + actionProperties: { + serializedName: "actionProperties", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, }, }, }, }, }; -export const ResourceAutoGenerated2: coreClient.CompositeMapper = { +export const RuleResolveConfiguration: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceAutoGenerated2", + className: "RuleResolveConfiguration", 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", - }, - }, - location: { - serializedName: "location", - required: true, - type: { - name: "String", - }, - }, - tags: { - serializedName: "tags", + autoResolved: { + serializedName: "autoResolved", type: { - name: "Dictionary", - value: { type: { name: "String" } }, + name: "Boolean", }, }, - systemData: { - serializedName: "systemData", + timeToResolve: { + serializedName: "timeToResolve", type: { - name: "Composite", - className: "SystemData", + name: "TimeSpan", }, }, }, }, }; -export const AutoscaleErrorResponse: coreClient.CompositeMapper = { +export const ErrorContract: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AutoscaleErrorResponse", + className: "ErrorContract", modelProperties: { error: { serializedName: "error", type: { name: "Composite", - className: "AutoscaleErrorResponseError", - }, - }, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData", + className: "ErrorResponseAutoGenerated", }, }, }, }, }; -export const AutoscaleErrorResponseError: coreClient.CompositeMapper = { +export const ErrorResponseAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AutoscaleErrorResponseError", + className: "ErrorResponseAutoGenerated", 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: "String", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorResponseAutoGenerated", + }, + }, + }, + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + }, + }, }, }, }, }, }; -export const AutoscaleSettingResourcePatch: coreClient.CompositeMapper = { +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AutoscaleSettingResourcePatch", + className: "ErrorAdditionalInfo", modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - profiles: { - constraints: { - MaxItems: 20, - }, - serializedName: "properties.profiles", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AutoscaleProfile", - }, - }, - }, - }, - notifications: { - serializedName: "properties.notifications", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AutoscaleNotification", - }, - }, - }, - }, - enabled: { - defaultValue: false, - serializedName: "properties.enabled", - type: { - name: "Boolean", - }, - }, - predictiveAutoscalePolicy: { - serializedName: "properties.predictiveAutoscalePolicy", - type: { - name: "Composite", - className: "PredictiveAutoscalePolicy", - }, - }, - name: { - serializedName: "properties.name", - type: { - name: "String", - }, - }, - targetResourceUri: { - serializedName: "properties.targetResourceUri", - type: { - name: "String", - }, - }, - targetResourceLocation: { - serializedName: "properties.targetResourceLocation", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PredictiveResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PredictiveResponse", - modelProperties: { - timespan: { - serializedName: "timespan", - type: { - name: "String", - }, - }, - interval: { - serializedName: "interval", - type: { - name: "TimeSpan", - }, - }, - metricName: { - serializedName: "metricName", - type: { - name: "String", - }, - }, - targetResourceId: { - serializedName: "targetResourceId", + type: { + serializedName: "type", + readOnly: true, type: { name: "String", }, }, - data: { - serializedName: "data", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PredictiveValue", - }, - }, - }, - }, - }, - }, -}; - -export const PredictiveValue: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PredictiveValue", - modelProperties: { - timeStamp: { - serializedName: "timeStamp", - required: true, - type: { - name: "DateTime", - }, - }, - value: { - serializedName: "value", - required: true, - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const OperationListResultAutoGenerated: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationListResultAutoGenerated", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "OperationAutoGenerated", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", + info: { + serializedName: "info", + readOnly: true, type: { - name: "String", + name: "Dictionary", + value: { type: { name: "any" } }, }, }, }, }, }; -export const OperationAutoGenerated: coreClient.CompositeMapper = { +export const ScheduledQueryRuleResourcePatch: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationAutoGenerated", + className: "ScheduledQueryRuleResourcePatch", modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - display: { - serializedName: "display", + identity: { + serializedName: "identity", type: { name: "Composite", - className: "OperationDisplayAutoGenerated", - }, - }, - }, - }, -}; - -export const OperationDisplayAutoGenerated: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationDisplayAutoGenerated", - modelProperties: { - provider: { - serializedName: "provider", - type: { - name: "String", + className: "Identity", }, }, - resource: { - serializedName: "resource", + tags: { + serializedName: "tags", type: { - name: "String", + name: "Dictionary", + value: { type: { name: "String" } }, }, }, - operation: { - serializedName: "operation", + createdWithApiVersion: { + serializedName: "properties.createdWithApiVersion", + readOnly: true, type: { name: "String", }, }, - }, - }, -}; - -export const Incident: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Incident", - modelProperties: { - name: { - serializedName: "name", + isLegacyLogAnalyticsRule: { + serializedName: "properties.isLegacyLogAnalyticsRule", readOnly: true, type: { - name: "String", + name: "Boolean", }, }, - ruleName: { - serializedName: "ruleName", - readOnly: true, + description: { + serializedName: "properties.description", type: { name: "String", }, }, - isActive: { - serializedName: "isActive", - readOnly: true, + displayName: { + serializedName: "properties.displayName", type: { - name: "Boolean", + name: "String", }, }, - activatedTime: { - serializedName: "activatedTime", - readOnly: true, + severity: { + serializedName: "properties.severity", type: { - name: "DateTime", + name: "Number", }, }, - resolvedTime: { - serializedName: "resolvedTime", - readOnly: true, + enabled: { + serializedName: "properties.enabled", type: { - name: "DateTime", + name: "Boolean", }, }, - }, - }, -}; - -export const IncidentListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "IncidentListResult", - modelProperties: { - value: { - serializedName: "value", + scopes: { + serializedName: "properties.scopes", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "Incident", + name: "String", }, }, }, }, - }, - }, -}; - -export const RuleCondition: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RuleCondition", - uberParent: "RuleCondition", - polymorphicDiscriminator: { - serializedName: "odata\\.type", - clientName: "odataType", - }, - modelProperties: { - odataType: { - serializedName: "odata\\.type", - required: true, - type: { - name: "String", - }, - }, - dataSource: { - serializedName: "dataSource", - type: { - name: "Composite", - className: "RuleDataSource", - }, - }, - }, - }, -}; - -export const RuleDataSource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RuleDataSource", - uberParent: "RuleDataSource", - polymorphicDiscriminator: { - serializedName: "odata\\.type", - clientName: "odataType", - }, - modelProperties: { - odataType: { - serializedName: "odata\\.type", - required: true, - type: { - name: "String", - }, - }, - resourceUri: { - serializedName: "resourceUri", - type: { - name: "String", - }, - }, - legacyResourceId: { - serializedName: "legacyResourceId", - type: { - name: "String", - }, - }, - resourceLocation: { - serializedName: "resourceLocation", - type: { - name: "String", - }, - }, - metricNamespace: { - serializedName: "metricNamespace", + evaluationFrequency: { + serializedName: "properties.evaluationFrequency", type: { - name: "String", + name: "TimeSpan", }, }, - }, - }, -}; - -export const RuleAction: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RuleAction", - uberParent: "RuleAction", - polymorphicDiscriminator: { - serializedName: "odata\\.type", - clientName: "odataType", - }, - modelProperties: { - odataType: { - serializedName: "odata\\.type", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ResourceAutoGenerated3: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceAutoGenerated3", - 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", - }, - }, - location: { - serializedName: "location", - required: true, - type: { - name: "String", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const AlertRuleResourcePatch: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AlertRuleResourcePatch", - modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - name: { - serializedName: "properties.name", - type: { - name: "String", - }, - }, - description: { - serializedName: "properties.description", - type: { - name: "String", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - type: { - name: "String", - }, - }, - isEnabled: { - serializedName: "properties.isEnabled", - type: { - name: "Boolean", - }, - }, - condition: { - serializedName: "properties.condition", - type: { - name: "Composite", - className: "RuleCondition", - }, - }, - action: { - serializedName: "properties.action", - type: { - name: "Composite", - className: "RuleAction", - }, - }, - actions: { - serializedName: "properties.actions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RuleAction", - }, - }, - }, - }, - lastUpdatedTime: { - serializedName: "properties.lastUpdatedTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - }, - }, -}; - -export const AlertRuleResourceCollection: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AlertRuleResourceCollection", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AlertRuleResource", - }, - }, - }, - }, - }, - }, -}; - -export const RetentionPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RetentionPolicy", - modelProperties: { - enabled: { - serializedName: "enabled", - required: true, - type: { - name: "Boolean", - }, - }, - days: { - constraints: { - InclusiveMinimum: 0, - }, - serializedName: "days", - required: true, - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const ResourceAutoGenerated4: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceAutoGenerated4", - 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", - }, - }, - location: { - serializedName: "location", - required: true, - type: { - name: "String", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const LogProfileResourcePatch: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LogProfileResourcePatch", - modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - storageAccountId: { - serializedName: "properties.storageAccountId", - type: { - name: "String", - }, - }, - serviceBusRuleId: { - serializedName: "properties.serviceBusRuleId", - type: { - name: "String", - }, - }, - locations: { - serializedName: "properties.locations", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - categories: { - serializedName: "properties.categories", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - retentionPolicy: { - serializedName: "properties.retentionPolicy", - type: { - name: "Composite", - className: "RetentionPolicy", - }, - }, - }, - }, -}; - -export const LogProfileCollection: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LogProfileCollection", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "LogProfileResource", - }, - }, - }, - }, - }, - }, -}; - -export const MetricSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MetricSettings", - modelProperties: { - timeGrain: { - serializedName: "timeGrain", - type: { - name: "TimeSpan", - }, - }, - category: { - serializedName: "category", - type: { - name: "String", - }, - }, - enabled: { - serializedName: "enabled", - required: true, - type: { - name: "Boolean", - }, - }, - retentionPolicy: { - serializedName: "retentionPolicy", - type: { - name: "Composite", - className: "RetentionPolicy", - }, - }, - }, - }, -}; - -export const LogSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LogSettings", - modelProperties: { - category: { - serializedName: "category", - type: { - name: "String", - }, - }, - categoryGroup: { - serializedName: "categoryGroup", - type: { - name: "String", - }, - }, - enabled: { - serializedName: "enabled", - required: true, - type: { - name: "Boolean", - }, - }, - retentionPolicy: { - serializedName: "retentionPolicy", - type: { - name: "Composite", - className: "RetentionPolicy", - }, - }, - }, - }, -}; - -export const ResourceAutoGenerated5: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceAutoGenerated5", - 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", - }, - }, - }, - }, -}; - -export const DiagnosticSettingsResourceCollection: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "DiagnosticSettingsResourceCollection", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DiagnosticSettingsResource", - }, - }, - }, - }, - }, - }, - }; - -export const DiagnosticSettingsCategoryResourceCollection: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "DiagnosticSettingsCategoryResourceCollection", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DiagnosticSettingsCategoryResource", - }, - }, - }, - }, - }, - }, - }; - -export const EmailReceiver: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EmailReceiver", - 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 SmsReceiver: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SmsReceiver", - 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 WebhookReceiver: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "WebhookReceiver", - 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 ItsmReceiver: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ItsmReceiver", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - workspaceId: { - serializedName: "workspaceId", - required: true, - type: { - name: "String", - }, - }, - connectionId: { - serializedName: "connectionId", - required: true, - type: { - name: "String", - }, - }, - ticketConfiguration: { - serializedName: "ticketConfiguration", - required: true, - type: { - name: "String", - }, - }, - region: { - serializedName: "region", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const AzureAppPushReceiver: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AzureAppPushReceiver", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - emailAddress: { - serializedName: "emailAddress", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const AutomationRunbookReceiver: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AutomationRunbookReceiver", - modelProperties: { - automationAccountId: { - serializedName: "automationAccountId", - required: true, - type: { - name: "String", - }, - }, - runbookName: { - serializedName: "runbookName", - required: true, - type: { - name: "String", - }, - }, - webhookResourceId: { - serializedName: "webhookResourceId", - required: true, - type: { - name: "String", - }, - }, - isGlobalRunbook: { - serializedName: "isGlobalRunbook", - required: true, - type: { - name: "Boolean", - }, - }, - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - serviceUri: { - serializedName: "serviceUri", - type: { - name: "String", - }, - }, - useCommonAlertSchema: { - defaultValue: false, - serializedName: "useCommonAlertSchema", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const VoiceReceiver: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VoiceReceiver", - 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", - }, - }, - }, - }, -}; - -export const LogicAppReceiver: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LogicAppReceiver", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - resourceId: { - serializedName: "resourceId", - required: true, - type: { - name: "String", - }, - }, - callbackUrl: { - serializedName: "callbackUrl", - required: true, - type: { - name: "String", - }, - }, - useCommonAlertSchema: { - defaultValue: false, - serializedName: "useCommonAlertSchema", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const AzureFunctionReceiver: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AzureFunctionReceiver", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - functionAppResourceId: { - serializedName: "functionAppResourceId", - required: true, - type: { - name: "String", - }, - }, - functionName: { - serializedName: "functionName", - required: true, - type: { - name: "String", - }, - }, - httpTriggerUrl: { - serializedName: "httpTriggerUrl", - required: true, - type: { - name: "String", - }, - }, - useCommonAlertSchema: { - defaultValue: false, - serializedName: "useCommonAlertSchema", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const ArmRoleReceiver: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ArmRoleReceiver", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - roleId: { - serializedName: "roleId", - required: true, - type: { - name: "String", - }, - }, - useCommonAlertSchema: { - defaultValue: false, - serializedName: "useCommonAlertSchema", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const EventHubReceiver: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EventHubReceiver", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - eventHubNameSpace: { - serializedName: "eventHubNameSpace", - required: true, - type: { - name: "String", - }, - }, - eventHubName: { - serializedName: "eventHubName", - required: true, - type: { - name: "String", - }, - }, - useCommonAlertSchema: { - defaultValue: false, - serializedName: "useCommonAlertSchema", - type: { - name: "Boolean", - }, - }, - tenantId: { - serializedName: "tenantId", - type: { - name: "String", - }, - }, - subscriptionId: { - serializedName: "subscriptionId", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const AzureResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AzureResource", - 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", - }, - }, - location: { - serializedName: "location", - required: true, - type: { - name: "String", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const ActionGroupPatchBody: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ActionGroupPatchBody", - modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - enabled: { - defaultValue: true, - serializedName: "properties.enabled", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const NotificationRequestBody: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "NotificationRequestBody", - modelProperties: { - alertType: { - constraints: { - MaxLength: 30, - }, - serializedName: "alertType", - required: true, - type: { - name: "String", - }, - }, - emailReceivers: { - serializedName: "emailReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "EmailReceiver", - }, - }, - }, - }, - smsReceivers: { - serializedName: "smsReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SmsReceiver", - }, - }, - }, - }, - webhookReceivers: { - serializedName: "webhookReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "WebhookReceiver", - }, - }, - }, - }, - itsmReceivers: { - serializedName: "itsmReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ItsmReceiver", - }, - }, - }, - }, - azureAppPushReceivers: { - serializedName: "azureAppPushReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AzureAppPushReceiver", - }, - }, - }, - }, - automationRunbookReceivers: { - serializedName: "automationRunbookReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AutomationRunbookReceiver", - }, - }, - }, - }, - voiceReceivers: { - serializedName: "voiceReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VoiceReceiver", - }, - }, - }, - }, - logicAppReceivers: { - serializedName: "logicAppReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "LogicAppReceiver", - }, - }, - }, - }, - azureFunctionReceivers: { - serializedName: "azureFunctionReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AzureFunctionReceiver", - }, - }, - }, - }, - armRoleReceivers: { - serializedName: "armRoleReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ArmRoleReceiver", - }, - }, - }, - }, - eventHubReceivers: { - serializedName: "eventHubReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "EventHubReceiver", - }, - }, - }, - }, - }, - }, -}; - -export const TestNotificationDetailsResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TestNotificationDetailsResponse", - modelProperties: { - context: { - serializedName: "context", - type: { - name: "Composite", - className: "Context", - }, - }, - state: { - serializedName: "state", - required: true, - type: { - name: "String", - }, - }, - completedTime: { - serializedName: "completedTime", - type: { - name: "String", - }, - }, - createdTime: { - serializedName: "createdTime", - type: { - name: "String", - }, - }, - actionDetails: { - serializedName: "actionDetails", - type: { - 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 AzureAppPushReceiverAutoGenerated: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AzureAppPushReceiverAutoGenerated", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - emailAddress: { - serializedName: "emailAddress", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VoiceReceiverAutoGenerated: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VoiceReceiverAutoGenerated", - 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", - }, - }, - }, - }, -}; - -export const ActionGroupPatchBodyAutoGenerated: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ActionGroupPatchBodyAutoGenerated", - modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - enabled: { - defaultValue: true, - serializedName: "properties.enabled", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const TenantActionGroupList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TenantActionGroupList", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "TenantActionGroupResource", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const TenantNotificationRequestBody: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TenantNotificationRequestBody", - modelProperties: { - alertType: { - constraints: { - MaxLength: 30, - }, - serializedName: "alertType", - required: true, - type: { - name: "String", - }, - }, - emailReceivers: { - serializedName: "emailReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "EmailReceiverAutoGenerated", - }, - }, - }, - }, - smsReceivers: { - serializedName: "smsReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SmsReceiverAutoGenerated", - }, - }, - }, - }, - webhookReceivers: { - serializedName: "webhookReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "WebhookReceiverAutoGenerated", - }, - }, - }, - }, - azureAppPushReceivers: { - serializedName: "azureAppPushReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AzureAppPushReceiverAutoGenerated", - }, - }, - }, - }, - voiceReceivers: { - serializedName: "voiceReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VoiceReceiverAutoGenerated", - }, - }, - }, - }, - }, - }, -}; - -export const TestNotificationDetailsResponseAutoGenerated: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "TestNotificationDetailsResponseAutoGenerated", - modelProperties: { - context: { - serializedName: "context", - type: { - name: "Composite", - className: "Context", - }, - }, - state: { - serializedName: "state", - required: true, - type: { - name: "String", - }, - }, - completedTime: { - serializedName: "completedTime", - type: { - name: "String", - }, - }, - createdTime: { - serializedName: "createdTime", - type: { - name: "String", - }, - }, - actionDetails: { - serializedName: "actionDetails", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ActionDetailAutoGenerated", - }, - }, - }, - }, - }, - }, - }; - -export const ActionDetailAutoGenerated: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ActionDetailAutoGenerated", - 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", - }, - }, - message: { - serializedName: "message", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ErrorResponseAutoGenerated3: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorResponseAutoGenerated3", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorDetailAutoGenerated", - }, - }, - }, - }, -}; - -export const ErrorDetailAutoGenerated: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorDetailAutoGenerated", - 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: "ErrorDetailAutoGenerated", - }, - }, - }, - }, - additionalInfo: { - serializedName: "additionalInfo", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - }, - }, - }, - }, - }, - }, -}; - -export const EventDataCollection: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EventDataCollection", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "EventData", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const EventData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EventData", - modelProperties: { - authorization: { - serializedName: "authorization", - type: { - name: "Composite", - className: "SenderAuthorization", - }, - }, - claims: { - serializedName: "claims", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - caller: { - serializedName: "caller", - readOnly: true, - type: { - name: "String", - }, - }, - description: { - serializedName: "description", - readOnly: true, - type: { - name: "String", - }, - }, - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - eventDataId: { - serializedName: "eventDataId", - readOnly: true, - type: { - name: "String", - }, - }, - correlationId: { - serializedName: "correlationId", - readOnly: true, - type: { - name: "String", - }, - }, - eventName: { - serializedName: "eventName", - type: { - name: "Composite", - className: "LocalizableStringAutoGenerated", - }, - }, - category: { - serializedName: "category", - type: { - name: "Composite", - className: "LocalizableStringAutoGenerated", - }, - }, - httpRequest: { - serializedName: "httpRequest", - type: { - name: "Composite", - className: "HttpRequestInfo", - }, - }, - level: { - serializedName: "level", - readOnly: true, - type: { - name: "Enum", - allowedValues: [ - "Critical", - "Error", - "Warning", - "Informational", - "Verbose", - ], - }, - }, - resourceGroupName: { - serializedName: "resourceGroupName", - readOnly: true, - type: { - name: "String", - }, - }, - resourceProviderName: { - serializedName: "resourceProviderName", - type: { - name: "Composite", - className: "LocalizableStringAutoGenerated", - }, - }, - resourceId: { - serializedName: "resourceId", - readOnly: true, - type: { - name: "String", - }, - }, - resourceType: { - serializedName: "resourceType", - type: { - name: "Composite", - className: "LocalizableStringAutoGenerated", - }, - }, - operationId: { - serializedName: "operationId", - readOnly: true, - type: { - name: "String", - }, - }, - operationName: { - serializedName: "operationName", - type: { - name: "Composite", - className: "LocalizableStringAutoGenerated", - }, - }, - properties: { - serializedName: "properties", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - status: { - serializedName: "status", - type: { - name: "Composite", - className: "LocalizableStringAutoGenerated", - }, - }, - subStatus: { - serializedName: "subStatus", - type: { - name: "Composite", - className: "LocalizableStringAutoGenerated", - }, - }, - eventTimestamp: { - serializedName: "eventTimestamp", - readOnly: true, - type: { - name: "DateTime", - }, - }, - submissionTimestamp: { - serializedName: "submissionTimestamp", - readOnly: true, - type: { - name: "DateTime", - }, - }, - subscriptionId: { - serializedName: "subscriptionId", - readOnly: true, - type: { - name: "String", - }, - }, - tenantId: { - serializedName: "tenantId", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SenderAuthorization: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SenderAuthorization", - modelProperties: { - action: { - serializedName: "action", - type: { - name: "String", - }, - }, - role: { - serializedName: "role", - type: { - name: "String", - }, - }, - scope: { - serializedName: "scope", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const LocalizableStringAutoGenerated: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LocalizableStringAutoGenerated", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "String", - }, - }, - localizedValue: { - serializedName: "localizedValue", - type: { - name: "String", - }, - }, - }, - }, -}; - -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: "LocalizableStringAutoGenerated", - }, - }, - }, - }, - }, - }, -}; - -export const MetricBaselinesResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MetricBaselinesResponse", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SingleMetricBaseline", - }, - }, - }, - }, - }, - }, -}; - -export const SingleMetricBaseline: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SingleMetricBaseline", - modelProperties: { - id: { - serializedName: "id", - required: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - required: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - timespan: { - serializedName: "properties.timespan", - required: true, - type: { - name: "String", - }, - }, - interval: { - serializedName: "properties.interval", - required: true, - type: { - name: "TimeSpan", - }, - }, - namespace: { - serializedName: "properties.namespace", - type: { - name: "String", - }, - }, - baselines: { - serializedName: "properties.baselines", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "TimeSeriesBaseline", - }, - }, - }, - }, - }, - }, -}; - -export const TimeSeriesBaseline: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TimeSeriesBaseline", - modelProperties: { - aggregation: { - serializedName: "aggregation", - required: true, - type: { - name: "String", - }, - }, - dimensions: { - serializedName: "dimensions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricSingleDimension", - }, - }, - }, - }, - timestamps: { - serializedName: "timestamps", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "DateTime", - }, - }, - }, - }, - data: { - serializedName: "data", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SingleBaseline", - }, - }, - }, - }, - metadataValues: { - serializedName: "metadataValues", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BaselineMetadata", - }, - }, - }, - }, - }, - }, -}; - -export const MetricSingleDimension: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MetricSingleDimension", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - value: { - serializedName: "value", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SingleBaseline: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SingleBaseline", - modelProperties: { - sensitivity: { - serializedName: "sensitivity", - required: true, - type: { - name: "String", - }, - }, - lowThresholds: { - serializedName: "lowThresholds", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Number", - }, - }, - }, - }, - highThresholds: { - serializedName: "highThresholds", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Number", - }, - }, - }, - }, - }, - }, -}; - -export const BaselineMetadata: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BaselineMetadata", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - value: { - serializedName: "value", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const MetricAlertResourceCollection: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MetricAlertResourceCollection", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricAlertResource", - }, - }, - }, - }, - }, - }, -}; - -export const MetricAlertCriteria: coreClient.CompositeMapper = { - serializedName: "MetricAlertCriteria", - type: { - name: "Composite", - className: "MetricAlertCriteria", - uberParent: "MetricAlertCriteria", - additionalProperties: { type: { name: "Object" } }, - polymorphicDiscriminator: { - serializedName: "odata\\.type", - clientName: "odataType", - }, - modelProperties: { - odataType: { - serializedName: "odata\\.type", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const MetricAlertAction: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MetricAlertAction", - modelProperties: { - actionGroupId: { - serializedName: "actionGroupId", - type: { - name: "String", - }, - }, - webHookProperties: { - serializedName: "webHookProperties", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const ResourceAutoGenerated6: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceAutoGenerated6", - 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", - }, - }, - location: { - serializedName: "location", - required: true, - type: { - name: "String", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const MetricAlertResourcePatch: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MetricAlertResourcePatch", - modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - description: { - serializedName: "properties.description", - type: { - name: "String", - }, - }, - severity: { - serializedName: "properties.severity", - type: { - name: "Number", - }, - }, - enabled: { - serializedName: "properties.enabled", - type: { - name: "Boolean", - }, - }, - scopes: { - serializedName: "properties.scopes", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - evaluationFrequency: { - serializedName: "properties.evaluationFrequency", - type: { - name: "TimeSpan", - }, - }, - windowSize: { - serializedName: "properties.windowSize", - type: { - name: "TimeSpan", - }, - }, - targetResourceType: { - serializedName: "properties.targetResourceType", - type: { - name: "String", - }, - }, - targetResourceRegion: { - serializedName: "properties.targetResourceRegion", - type: { - name: "String", - }, - }, - criteria: { - serializedName: "properties.criteria", - type: { - name: "Composite", - className: "MetricAlertCriteria", - }, - }, - autoMitigate: { - serializedName: "properties.autoMitigate", - type: { - name: "Boolean", - }, - }, - actions: { - serializedName: "properties.actions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricAlertAction", - }, - }, - }, - }, - lastUpdatedTime: { - serializedName: "properties.lastUpdatedTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - isMigrated: { - serializedName: "properties.isMigrated", - readOnly: true, - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const MetricAlertStatusCollection: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MetricAlertStatusCollection", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricAlertStatus", - }, - }, - }, - }, - }, - }, -}; - -export const MetricAlertStatus: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MetricAlertStatus", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - id: { - serializedName: "id", - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - type: { - name: "String", - }, - }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "MetricAlertStatusProperties", - }, - }, - }, - }, -}; - -export const MetricAlertStatusProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MetricAlertStatusProperties", - modelProperties: { - dimensions: { - serializedName: "dimensions", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - status: { - serializedName: "status", - type: { - name: "String", - }, - }, - timestamp: { - serializedName: "timestamp", - type: { - name: "DateTime", - }, - }, - }, - }, -}; - -export const ScheduledQueryRuleResourceCollection: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "ScheduledQueryRuleResourceCollection", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ScheduledQueryRuleResource", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, - }; - -export const ScheduledQueryRuleResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ScheduledQueryRuleResource", - 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", - }, - }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "Identity", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - location: { - serializedName: "location", - required: true, - type: { - name: "String", - }, - }, - kind: { - serializedName: "kind", - type: { - name: "String", - }, - }, - etag: { - serializedName: "etag", - readOnly: true, - type: { - name: "String", - }, - }, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData", - }, - }, - createdWithApiVersion: { - serializedName: "properties.createdWithApiVersion", - readOnly: true, - type: { - name: "String", - }, - }, - isLegacyLogAnalyticsRule: { - serializedName: "properties.isLegacyLogAnalyticsRule", - readOnly: true, - type: { - name: "Boolean", - }, - }, - description: { - serializedName: "properties.description", - type: { - name: "String", - }, - }, - displayName: { - serializedName: "properties.displayName", - type: { - name: "String", - }, - }, - severity: { - serializedName: "properties.severity", - type: { - name: "Number", - }, - }, - enabled: { - serializedName: "properties.enabled", - type: { - name: "Boolean", - }, - }, - scopes: { - serializedName: "properties.scopes", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - evaluationFrequency: { - serializedName: "properties.evaluationFrequency", - type: { - name: "TimeSpan", - }, - }, - windowSize: { - serializedName: "properties.windowSize", - type: { - name: "TimeSpan", - }, - }, - overrideQueryTimeRange: { - serializedName: "properties.overrideQueryTimeRange", - type: { - name: "TimeSpan", - }, - }, - targetResourceTypes: { - serializedName: "properties.targetResourceTypes", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - criteria: { - serializedName: "properties.criteria", - type: { - name: "Composite", - className: "ScheduledQueryRuleCriteria", - }, - }, - muteActionsDuration: { - serializedName: "properties.muteActionsDuration", - type: { - name: "TimeSpan", - }, - }, - actions: { - serializedName: "properties.actions", - type: { - name: "Composite", - className: "Actions", - }, - }, - isWorkspaceAlertsStorageConfigured: { - serializedName: "properties.isWorkspaceAlertsStorageConfigured", - readOnly: true, - type: { - name: "Boolean", - }, - }, - checkWorkspaceAlertsStorageConfigured: { - serializedName: "properties.checkWorkspaceAlertsStorageConfigured", - type: { - name: "Boolean", - }, - }, - skipQueryValidation: { - serializedName: "properties.skipQueryValidation", - type: { - name: "Boolean", - }, - }, - autoMitigate: { - serializedName: "properties.autoMitigate", - type: { - name: "Boolean", - }, - }, - ruleResolveConfiguration: { - serializedName: "properties.ruleResolveConfiguration", - type: { - name: "Composite", - className: "RuleResolveConfiguration", - }, - }, - }, - }, -}; - -export const Identity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Identity", - modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, - type: { - name: "String", - }, - }, - tenantId: { - serializedName: "tenantId", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - required: true, - type: { - name: "Enum", - allowedValues: ["SystemAssigned", "UserAssigned", "None"], - }, - }, - userAssignedIdentities: { - serializedName: "userAssignedIdentities", - type: { - name: "Dictionary", - value: { - type: { name: "Composite", className: "UserIdentityProperties" }, - }, - }, - }, - }, - }, -}; - -export const UserIdentityProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UserIdentityProperties", - modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, - type: { - name: "String", - }, - }, - clientId: { - serializedName: "clientId", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ScheduledQueryRuleCriteria: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ScheduledQueryRuleCriteria", - modelProperties: { - allOf: { - serializedName: "allOf", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Condition", - }, - }, - }, - }, - }, - }, -}; - -export const Condition: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Condition", - modelProperties: { - query: { - serializedName: "query", - type: { - name: "String", - }, - }, - timeAggregation: { - serializedName: "timeAggregation", - type: { - name: "String", - }, - }, - metricMeasureColumn: { - serializedName: "metricMeasureColumn", - type: { - name: "String", - }, - }, - resourceIdColumn: { - serializedName: "resourceIdColumn", - type: { - name: "String", - }, - }, - dimensions: { - serializedName: "dimensions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Dimension", - }, - }, - }, - }, - operator: { - serializedName: "operator", - type: { - name: "Enum", - allowedValues: [ - "GreaterThan", - "GreaterThanOrEqual", - "LessThan", - "LessThanOrEqual", - "Equals", - ], - }, - }, - threshold: { - serializedName: "threshold", - type: { - name: "Number", - }, - }, - failingPeriods: { - serializedName: "failingPeriods", - type: { - name: "Composite", - className: "ConditionFailingPeriods", - }, - }, - metricName: { - serializedName: "metricName", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const Dimension: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Dimension", - 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 ConditionFailingPeriods: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ConditionFailingPeriods", - modelProperties: { - numberOfEvaluationPeriods: { - defaultValue: 1, - serializedName: "numberOfEvaluationPeriods", - type: { - name: "Number", - }, - }, - minFailingPeriodsToAlert: { - defaultValue: 1, - serializedName: "minFailingPeriodsToAlert", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const Actions: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Actions", - modelProperties: { - actionGroups: { - serializedName: "actionGroups", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - customProperties: { - serializedName: "customProperties", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - actionProperties: { - serializedName: "actionProperties", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const RuleResolveConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RuleResolveConfiguration", - modelProperties: { - autoResolved: { - serializedName: "autoResolved", - type: { - name: "Boolean", - }, - }, - timeToResolve: { - serializedName: "timeToResolve", - type: { - name: "TimeSpan", - }, - }, - }, - }, -}; - -export const ScheduledQueryRuleResourcePatch: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ScheduledQueryRuleResourcePatch", - modelProperties: { - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "Identity", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - createdWithApiVersion: { - serializedName: "properties.createdWithApiVersion", - readOnly: true, - type: { - name: "String", - }, - }, - isLegacyLogAnalyticsRule: { - serializedName: "properties.isLegacyLogAnalyticsRule", - readOnly: true, - type: { - name: "Boolean", - }, - }, - description: { - serializedName: "properties.description", - type: { - name: "String", - }, - }, - displayName: { - serializedName: "properties.displayName", - type: { - name: "String", - }, - }, - severity: { - serializedName: "properties.severity", - type: { - name: "Number", - }, - }, - enabled: { - serializedName: "properties.enabled", - type: { - name: "Boolean", - }, - }, - scopes: { - serializedName: "properties.scopes", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - evaluationFrequency: { - serializedName: "properties.evaluationFrequency", - type: { - name: "TimeSpan", - }, - }, - windowSize: { - serializedName: "properties.windowSize", - type: { - name: "TimeSpan", - }, - }, - overrideQueryTimeRange: { - serializedName: "properties.overrideQueryTimeRange", - type: { - name: "TimeSpan", - }, - }, - targetResourceTypes: { - serializedName: "properties.targetResourceTypes", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - criteria: { - serializedName: "properties.criteria", - type: { - name: "Composite", - className: "ScheduledQueryRuleCriteria", - }, - }, - muteActionsDuration: { - serializedName: "properties.muteActionsDuration", - type: { - name: "TimeSpan", - }, - }, - actions: { - serializedName: "properties.actions", - type: { - name: "Composite", - className: "Actions", - }, - }, - isWorkspaceAlertsStorageConfigured: { - serializedName: "properties.isWorkspaceAlertsStorageConfigured", - readOnly: true, - type: { - name: "Boolean", - }, - }, - checkWorkspaceAlertsStorageConfigured: { - serializedName: "properties.checkWorkspaceAlertsStorageConfigured", - type: { - name: "Boolean", - }, - }, - skipQueryValidation: { - serializedName: "properties.skipQueryValidation", - type: { - name: "Boolean", - }, - }, - autoMitigate: { - serializedName: "properties.autoMitigate", - type: { - name: "Boolean", - }, - }, - ruleResolveConfiguration: { - serializedName: "properties.ruleResolveConfiguration", - type: { - name: "Composite", - className: "RuleResolveConfiguration", - }, - }, - }, - }, -}; - -export const DataContainer: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataContainer", - modelProperties: { - workspace: { - serializedName: "workspace", - type: { - name: "Composite", - className: "WorkspaceInfo", - }, - }, - }, - }, -}; - -export const WorkspaceInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "WorkspaceInfo", - modelProperties: { - id: { - serializedName: "id", - required: true, - type: { - name: "String", - }, - }, - location: { - serializedName: "location", - required: true, - type: { - name: "String", - }, - }, - customerId: { - serializedName: "properties.customerId", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ProxyResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ProxyResource", - 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", - }, - }, - }, - }, -}; - -export const ResponseWithError: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResponseWithError", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorModel", - }, - }, - }, - }, -}; - -export const ErrorModel: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorModel", - modelProperties: { - code: { - serializedName: "code", - required: true, - type: { - name: "String", - }, - }, - message: { - serializedName: "message", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const AzureMonitorPrivateLinkScopeListResult: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "AzureMonitorPrivateLinkScopeListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AzureMonitorPrivateLinkScope", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, - }; - -export const PrivateEndpointAutoGenerated: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpointAutoGenerated", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const AccessModeSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AccessModeSettings", - modelProperties: { - queryAccessMode: { - serializedName: "queryAccessMode", - required: true, - type: { - name: "String", - }, - }, - ingestionAccessMode: { - serializedName: "ingestionAccessMode", - required: true, - type: { - name: "String", - }, - }, - exclusions: { - serializedName: "exclusions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AccessModeSettingsExclusion", - }, - }, - }, - }, - }, - }, -}; - -export const AccessModeSettingsExclusion: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AccessModeSettingsExclusion", - modelProperties: { - privateEndpointConnectionName: { - serializedName: "privateEndpointConnectionName", - type: { - name: "String", - }, - }, - queryAccessMode: { - serializedName: "queryAccessMode", - type: { - name: "String", - }, - }, - ingestionAccessMode: { - serializedName: "ingestionAccessMode", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DefaultErrorResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DefaultErrorResponse", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorDetailAutoGenerated", - }, - }, - }, - }, -}; - -export const TagsResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TagsResource", - modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const OperationStatus: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationStatus", - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - startTime: { - serializedName: "startTime", - nullable: true, - type: { - name: "DateTime", - }, - }, - endTime: { - serializedName: "endTime", - nullable: true, - type: { - name: "DateTime", - }, - }, - status: { - serializedName: "status", - type: { - name: "String", - }, - }, - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorDetailAutoGenerated", - }, - }, - }, - }, -}; - -export const PrivateLinkResourceListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateLinkResourceListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateLinkResource", - }, - }, - }, - }, - }, - }, -}; - -export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpointConnectionListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnectionAutoGenerated", - }, - }, - }, - }, - }, - }, -}; - -export const ScopedResourceListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ScopedResourceListResult", - modelProperties: { - value: { - serializedName: "value", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ScopedResource", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const AlertRuleAllOfCondition: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AlertRuleAllOfCondition", - modelProperties: { - allOf: { - serializedName: "allOf", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AlertRuleAnyOfOrLeafCondition", - }, - }, - }, - }, - }, - }, -}; - -export const AlertRuleLeafCondition: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AlertRuleLeafCondition", - modelProperties: { - field: { - serializedName: "field", - type: { - name: "String", - }, - }, - equals: { - serializedName: "equals", - type: { - name: "String", - }, - }, - containsAny: { - serializedName: "containsAny", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const ActionList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ActionList", - modelProperties: { - actionGroups: { - serializedName: "actionGroups", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ActionGroup", - }, - }, - }, - }, - }, - }, -}; - -export const ActionGroup: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ActionGroup", - modelProperties: { - actionGroupId: { - serializedName: "actionGroupId", - required: true, - type: { - name: "String", - }, - }, - webhookProperties: { - serializedName: "webhookProperties", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const AzureResourceAutoGenerated: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AzureResourceAutoGenerated", - 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", - }, - }, - location: { - defaultValue: "global", - serializedName: "location", - type: { - name: "String", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const ErrorResponseAutoGenerated4: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorResponseAutoGenerated4", - modelProperties: { - code: { - serializedName: "code", - readOnly: true, - type: { - name: "String", - }, - }, - message: { - serializedName: "message", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const AlertRulePatchObject: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AlertRulePatchObject", - modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - enabled: { - defaultValue: true, - serializedName: "properties.enabled", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const AlertRuleList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AlertRuleList", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ActivityLogAlertResource", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DataCollectionEndpointResourceListResult: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "DataCollectionEndpointResourceListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DataCollectionEndpointResource", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, - }; - -export const DataCollectionEndpointResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataCollectionEndpointResource", - modelProperties: { - location: { - serializedName: "location", - required: true, - type: { - name: "String", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - kind: { - serializedName: "kind", - type: { - name: "String", - }, - }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "DataCollectionEndpointResourceIdentity", - }, - }, - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - etag: { - serializedName: "etag", - readOnly: true, - type: { - name: "String", - }, - }, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "DataCollectionEndpointResourceSystemData", - }, - }, - description: { - serializedName: "properties.description", - type: { - name: "String", - }, - }, - immutableId: { - serializedName: "properties.immutableId", - type: { - name: "String", - }, - }, - configurationAccess: { - serializedName: "properties.configurationAccess", - type: { - name: "Composite", - className: "DataCollectionEndpointConfigurationAccess", - }, - }, - logsIngestion: { - serializedName: "properties.logsIngestion", - type: { - name: "Composite", - className: "DataCollectionEndpointLogsIngestion", - }, - }, - metricsIngestion: { - serializedName: "properties.metricsIngestion", - type: { - name: "Composite", - className: "DataCollectionEndpointMetricsIngestion", - }, - }, - networkAcls: { - serializedName: "properties.networkAcls", - type: { - name: "Composite", - className: "DataCollectionEndpointNetworkAcls", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - 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", - }, - }, - }, - }, -}; - -export const DataCollectionEndpoint: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataCollectionEndpoint", - modelProperties: { - description: { - serializedName: "description", - type: { - name: "String", - }, - }, - immutableId: { - serializedName: "immutableId", - type: { - name: "String", - }, - }, - configurationAccess: { - serializedName: "configurationAccess", - type: { - name: "Composite", - className: "DataCollectionEndpointConfigurationAccess", - }, - }, - logsIngestion: { - serializedName: "logsIngestion", - type: { - name: "Composite", - className: "DataCollectionEndpointLogsIngestion", - }, - }, - 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: "String", - }, - }, - provisioningStatus: { - serializedName: "provisioningStatus", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const Metadata: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Metadata", - modelProperties: { - provisionedBy: { - serializedName: "provisionedBy", - readOnly: true, - type: { - name: "String", - }, - }, - provisionedByResourceId: { - serializedName: "provisionedByResourceId", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ManagedServiceIdentity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ManagedServiceIdentity", - modelProperties: { - 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 UserAssignedIdentity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UserAssignedIdentity", - modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, - type: { - name: "Uuid", - }, - }, - clientId: { - serializedName: "clientId", - readOnly: true, - type: { - name: "Uuid", - }, - }, - }, - }, -}; - -export const ErrorResponseCommonV2: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorResponseCommonV2", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorDetailAutoGenerated", - }, - }, - }, - }, -}; - -export const ResourceForUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceForUpdate", - modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "ResourceForUpdateIdentity", - }, - }, - }, - }, -}; - -export const DataCollectionRuleAssociationProxyOnlyResourceListResult: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "DataCollectionRuleAssociationProxyOnlyResourceListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DataCollectionRuleAssociationProxyOnlyResource", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, - }; - -export const DataCollectionRuleAssociationProxyOnlyResource: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "DataCollectionRuleAssociationProxyOnlyResource", - 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", - }, - }, - etag: { - serializedName: "etag", - readOnly: true, - type: { - name: "String", - }, - }, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: - "DataCollectionRuleAssociationProxyOnlyResourceSystemData", - }, - }, - description: { - serializedName: "properties.description", - type: { - name: "String", - }, - }, - dataCollectionRuleId: { - serializedName: "properties.dataCollectionRuleId", - type: { - name: "String", - }, - }, - dataCollectionEndpointId: { - serializedName: "properties.dataCollectionEndpointId", - type: { - name: "String", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - metadata: { - serializedName: "properties.metadata", - type: { - name: "Composite", - className: "DataCollectionRuleAssociationMetadata", - }, - }, - }, - }, - }; - -export const DataCollectionRuleAssociation: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataCollectionRuleAssociation", - modelProperties: { - description: { - serializedName: "description", - type: { - name: "String", - }, - }, - dataCollectionRuleId: { - serializedName: "dataCollectionRuleId", - type: { - name: "String", - }, - }, - dataCollectionEndpointId: { - serializedName: "dataCollectionEndpointId", - type: { - name: "String", - }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - metadata: { - serializedName: "metadata", - type: { - name: "Composite", - className: "DataCollectionRuleAssociationMetadata", - }, - }, - }, - }, -}; - -export const DataCollectionRuleResourceListResult: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "DataCollectionRuleResourceListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DataCollectionRuleResource", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, - }; - -export const DataCollectionRuleResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataCollectionRuleResource", - modelProperties: { - location: { - serializedName: "location", - required: true, - type: { - name: "String", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - kind: { - serializedName: "kind", - type: { - name: "String", - }, - }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "DataCollectionRuleResourceIdentity", - }, - }, - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - etag: { - serializedName: "etag", - readOnly: true, - type: { - name: "String", - }, - }, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "DataCollectionRuleResourceSystemData", - }, - }, - description: { - serializedName: "properties.description", - type: { - name: "String", - }, - }, - immutableId: { - serializedName: "properties.immutableId", - readOnly: true, - type: { - name: "String", - }, - }, - dataCollectionEndpointId: { - serializedName: "properties.dataCollectionEndpointId", - type: { - name: "String", - }, - }, - metadata: { - serializedName: "properties.metadata", - type: { - name: "Composite", - className: "DataCollectionRuleMetadata", - }, - }, - streamDeclarations: { - serializedName: "properties.streamDeclarations", - type: { - name: "Dictionary", - value: { - type: { name: "Composite", className: "StreamDeclaration" }, - }, - }, - }, - dataSources: { - serializedName: "properties.dataSources", - type: { - name: "Composite", - className: "DataCollectionRuleDataSources", - }, - }, - destinations: { - serializedName: "properties.destinations", - type: { - name: "Composite", - className: "DataCollectionRuleDestinations", - }, - }, - dataFlows: { - serializedName: "properties.dataFlows", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DataFlow", - }, - }, - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DataCollectionRule: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataCollectionRule", - modelProperties: { - description: { - serializedName: "description", - type: { - name: "String", - }, - }, - immutableId: { - serializedName: "immutableId", - readOnly: true, - type: { - name: "String", - }, - }, - dataCollectionEndpointId: { - serializedName: "dataCollectionEndpointId", - type: { - name: "String", - }, - }, - metadata: { - serializedName: "metadata", - type: { - name: "Composite", - className: "DataCollectionRuleMetadata", - }, - }, - streamDeclarations: { - serializedName: "streamDeclarations", - type: { - name: "Dictionary", - value: { - type: { name: "Composite", className: "StreamDeclaration" }, - }, - }, - }, - dataSources: { - serializedName: "dataSources", - type: { - name: "Composite", - className: "DataCollectionRuleDataSources", - }, - }, - destinations: { - serializedName: "destinations", - type: { - name: "Composite", - className: "DataCollectionRuleDestinations", - }, - }, - dataFlows: { - serializedName: "dataFlows", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DataFlow", - }, - }, - }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const StreamDeclaration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "StreamDeclaration", - modelProperties: { - columns: { - serializedName: "columns", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ColumnDefinition", - }, - }, - }, - }, - }, - }, -}; - -export const ColumnDefinition: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ColumnDefinition", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DataSourcesSpec: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataSourcesSpec", - modelProperties: { - performanceCounters: { - serializedName: "performanceCounters", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PerfCounterDataSource", - }, - }, - }, - }, - windowsEventLogs: { - serializedName: "windowsEventLogs", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "WindowsEventLogDataSource", - }, - }, - }, - }, - syslog: { - serializedName: "syslog", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SyslogDataSource", - }, - }, - }, - }, - extensions: { - serializedName: "extensions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ExtensionDataSource", - }, - }, - }, - }, - logFiles: { - serializedName: "logFiles", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "LogFilesDataSource", - }, - }, - }, - }, - iisLogs: { - serializedName: "iisLogs", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "IisLogsDataSource", - }, - }, - }, - }, - 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", - }, - }, - }, - }, -}; - -export const PerfCounterDataSource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PerfCounterDataSource", - modelProperties: { - streams: { - serializedName: "streams", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - samplingFrequencyInSeconds: { - serializedName: "samplingFrequencyInSeconds", - type: { - name: "Number", - }, - }, - counterSpecifiers: { - serializedName: "counterSpecifiers", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const WindowsEventLogDataSource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "WindowsEventLogDataSource", - modelProperties: { - streams: { - serializedName: "streams", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - xPathQueries: { - serializedName: "xPathQueries", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SyslogDataSource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SyslogDataSource", - modelProperties: { - streams: { - serializedName: "streams", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - facilityNames: { - serializedName: "facilityNames", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - logLevels: { - serializedName: "logLevels", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ExtensionDataSource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ExtensionDataSource", - modelProperties: { - streams: { - serializedName: "streams", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - extensionName: { - serializedName: "extensionName", - required: true, - type: { - name: "String", - }, - }, - extensionSettings: { - serializedName: "extensionSettings", - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, - inputDataSources: { - serializedName: "inputDataSources", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const LogFilesDataSource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LogFilesDataSource", - modelProperties: { - streams: { - serializedName: "streams", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - filePatterns: { - serializedName: "filePatterns", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - format: { - serializedName: "format", - required: true, - type: { - name: "String", - }, - }, - settings: { - serializedName: "settings", - type: { - name: "Composite", - className: "LogFilesDataSourceSettings", - }, - }, - name: { - serializedName: "name", - type: { - 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 WindowsFirewallLogsDataSource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "WindowsFirewallLogsDataSource", - modelProperties: { - streams: { - serializedName: "streams", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PrometheusForwarderDataSource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrometheusForwarderDataSource", - modelProperties: { - streams: { - serializedName: "streams", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - labelIncludeFilter: { - serializedName: "labelIncludeFilter", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PlatformTelemetryDataSource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PlatformTelemetryDataSource", - modelProperties: { - streams: { - serializedName: "streams", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DataImportSources: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataImportSources", - modelProperties: { - eventHub: { - serializedName: "eventHub", - type: { - name: "Composite", - className: "DataImportSourcesEventHub", - }, - }, - }, - }, -}; - -export const EventHubDataSource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EventHubDataSource", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - consumerGroup: { - serializedName: "consumerGroup", - type: { - name: "String", - }, - }, - stream: { - serializedName: "stream", - 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", - }, - }, - }, - }, - monitoringAccounts: { - serializedName: "monitoringAccounts", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MonitoringAccountDestination", - }, - }, - }, - }, - azureMonitorMetrics: { - serializedName: "azureMonitorMetrics", - type: { - name: "Composite", - 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 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", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const MonitoringAccountDestination: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MonitoringAccountDestination", - modelProperties: { - accountResourceId: { - serializedName: "accountResourceId", - type: { - name: "String", - }, - }, - accountId: { - serializedName: "accountId", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const AzureMonitorMetricsDestination: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AzureMonitorMetricsDestination", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const EventHubDestination: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EventHubDestination", - modelProperties: { - eventHubResourceId: { - serializedName: "eventHubResourceId", - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const EventHubDirectDestination: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EventHubDirectDestination", - modelProperties: { - eventHubResourceId: { - serializedName: "eventHubResourceId", - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const StorageBlobDestination: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "StorageBlobDestination", - modelProperties: { - containerName: { - serializedName: "containerName", - type: { - name: "String", - }, - }, - storageAccountResourceId: { - serializedName: "storageAccountResourceId", - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const StorageTableDestination: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "StorageTableDestination", - modelProperties: { - tableName: { - serializedName: "tableName", - type: { - name: "String", - }, - }, - storageAccountResourceId: { - serializedName: "storageAccountResourceId", - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DataFlow: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataFlow", - modelProperties: { - streams: { - serializedName: "streams", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - destinations: { - serializedName: "destinations", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - transformKql: { - serializedName: "transformKql", - type: { - name: "String", - }, - }, - outputStream: { - serializedName: "outputStream", - type: { - name: "String", - }, - }, - builtInTransform: { - serializedName: "builtInTransform", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RuleManagementEventClaimsDataSource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RuleManagementEventClaimsDataSource", - modelProperties: { - emailAddress: { - serializedName: "emailAddress", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ManagementEventAggregationCondition: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ManagementEventAggregationCondition", - modelProperties: { - operator: { - serializedName: "operator", - type: { - name: "Enum", - allowedValues: [ - "GreaterThan", - "GreaterThanOrEqual", - "LessThan", - "LessThanOrEqual", - "Equals", - ], - }, - }, - threshold: { - serializedName: "threshold", - type: { - name: "Number", - }, - }, - windowSize: { - serializedName: "windowSize", - type: { - name: "TimeSpan", - }, - }, - }, - }, -}; - -export const MultiMetricCriteria: coreClient.CompositeMapper = { - serializedName: "MultiMetricCriteria", - type: { - name: "Composite", - className: "MultiMetricCriteria", - uberParent: "MultiMetricCriteria", - additionalProperties: { type: { name: "Object" } }, - polymorphicDiscriminator: { - serializedName: "criterionType", - clientName: "criterionType", - }, - modelProperties: { - criterionType: { - serializedName: "criterionType", - required: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - metricName: { - serializedName: "metricName", - required: true, - type: { - name: "String", - }, - }, - metricNamespace: { - serializedName: "metricNamespace", - type: { - 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", - }, - }, - }, - }, - privateEndpoint: { - serializedName: "properties.privateEndpoint", - type: { - name: "Composite", - className: "PrivateEndpoint", - }, - }, - privateLinkServiceConnectionState: { - serializedName: "properties.privateLinkServiceConnectionState", - type: { - name: "Composite", - className: "PrivateLinkServiceConnectionState", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - type: { - name: "String", - }, - }, - }, - }, -}; - -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 TrackedResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TrackedResource", - modelProperties: { - ...ResourceAutoGenerated.type.modelProperties, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - location: { - serializedName: "location", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const AutoscaleSettingResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AutoscaleSettingResource", - modelProperties: { - ...ResourceAutoGenerated2.type.modelProperties, - profiles: { - constraints: { - MaxItems: 20, - }, - serializedName: "properties.profiles", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AutoscaleProfile", - }, - }, - }, - }, - notifications: { - serializedName: "properties.notifications", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AutoscaleNotification", - }, - }, - }, - }, - enabled: { - defaultValue: false, - serializedName: "properties.enabled", - type: { - name: "Boolean", - }, - }, - predictiveAutoscalePolicy: { - serializedName: "properties.predictiveAutoscalePolicy", - type: { - name: "Composite", - className: "PredictiveAutoscalePolicy", - }, - }, - namePropertiesName: { - serializedName: "properties.name", - type: { - name: "String", - }, - }, - targetResourceUri: { - serializedName: "properties.targetResourceUri", - type: { - name: "String", - }, - }, - targetResourceLocation: { - serializedName: "properties.targetResourceLocation", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ThresholdRuleCondition: coreClient.CompositeMapper = { - serializedName: - "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition", - type: { - name: "Composite", - className: "ThresholdRuleCondition", - uberParent: "RuleCondition", - polymorphicDiscriminator: RuleCondition.type.polymorphicDiscriminator, - modelProperties: { - ...RuleCondition.type.modelProperties, - operator: { - serializedName: "operator", - required: true, - type: { - name: "Enum", - allowedValues: [ - "GreaterThan", - "GreaterThanOrEqual", - "LessThan", - "LessThanOrEqual", - "Equals", - ], - }, - }, - threshold: { - serializedName: "threshold", - required: true, - type: { - name: "Number", - }, - }, - windowSize: { - serializedName: "windowSize", - type: { - name: "TimeSpan", - }, - }, - timeAggregation: { - serializedName: "timeAggregation", - type: { - name: "Enum", - allowedValues: ["Average", "Minimum", "Maximum", "Total", "Last"], - }, - }, - }, - }, -}; - -export const LocationThresholdRuleCondition: coreClient.CompositeMapper = { - serializedName: - "Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition", - type: { - name: "Composite", - className: "LocationThresholdRuleCondition", - uberParent: "RuleCondition", - polymorphicDiscriminator: RuleCondition.type.polymorphicDiscriminator, - modelProperties: { - ...RuleCondition.type.modelProperties, - windowSize: { - serializedName: "windowSize", - type: { - name: "TimeSpan", - }, - }, - failedLocationCount: { - constraints: { - InclusiveMinimum: 0, - }, - serializedName: "failedLocationCount", - required: true, - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const ManagementEventRuleCondition: coreClient.CompositeMapper = { - serializedName: - "Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition", - type: { - name: "Composite", - className: "ManagementEventRuleCondition", - uberParent: "RuleCondition", - polymorphicDiscriminator: RuleCondition.type.polymorphicDiscriminator, - modelProperties: { - ...RuleCondition.type.modelProperties, - aggregation: { - serializedName: "aggregation", - type: { - name: "Composite", - className: "ManagementEventAggregationCondition", - }, - }, - }, - }, -}; - -export const RuleMetricDataSource: coreClient.CompositeMapper = { - serializedName: - "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource", - type: { - name: "Composite", - className: "RuleMetricDataSource", - uberParent: "RuleDataSource", - polymorphicDiscriminator: RuleDataSource.type.polymorphicDiscriminator, - modelProperties: { - ...RuleDataSource.type.modelProperties, - metricName: { - serializedName: "metricName", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RuleManagementEventDataSource: coreClient.CompositeMapper = { - serializedName: - "Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource", - type: { - name: "Composite", - className: "RuleManagementEventDataSource", - uberParent: "RuleDataSource", - polymorphicDiscriminator: RuleDataSource.type.polymorphicDiscriminator, - modelProperties: { - ...RuleDataSource.type.modelProperties, - eventName: { - serializedName: "eventName", - type: { - name: "String", - }, - }, - eventSource: { - serializedName: "eventSource", - type: { - name: "String", - }, - }, - level: { - serializedName: "level", - type: { - name: "String", - }, - }, - operationName: { - serializedName: "operationName", - type: { - name: "String", - }, - }, - resourceGroupName: { - serializedName: "resourceGroupName", - type: { - name: "String", - }, - }, - resourceProviderName: { - serializedName: "resourceProviderName", - type: { - name: "String", - }, - }, - status: { - serializedName: "status", - type: { - name: "String", - }, - }, - subStatus: { - serializedName: "subStatus", - type: { - name: "String", - }, - }, - claims: { - serializedName: "claims", - type: { - name: "Composite", - className: "RuleManagementEventClaimsDataSource", - }, - }, - }, - }, -}; - -export const RuleEmailAction: coreClient.CompositeMapper = { - serializedName: "Microsoft.Azure.Management.Insights.Models.RuleEmailAction", - type: { - name: "Composite", - className: "RuleEmailAction", - uberParent: "RuleAction", - polymorphicDiscriminator: RuleAction.type.polymorphicDiscriminator, - modelProperties: { - ...RuleAction.type.modelProperties, - sendToServiceOwners: { - serializedName: "sendToServiceOwners", - type: { - name: "Boolean", - }, - }, - customEmails: { - serializedName: "customEmails", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const RuleWebhookAction: coreClient.CompositeMapper = { - serializedName: - "Microsoft.Azure.Management.Insights.Models.RuleWebhookAction", - type: { - name: "Composite", - className: "RuleWebhookAction", - uberParent: "RuleAction", - polymorphicDiscriminator: RuleAction.type.polymorphicDiscriminator, - modelProperties: { - ...RuleAction.type.modelProperties, - serviceUri: { - serializedName: "serviceUri", - type: { - name: "String", - }, - }, - properties: { - serializedName: "properties", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const AlertRuleResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AlertRuleResource", - modelProperties: { - ...ResourceAutoGenerated3.type.modelProperties, - namePropertiesName: { - serializedName: "properties.name", - required: true, - type: { - name: "String", - }, - }, - description: { - serializedName: "properties.description", - type: { - name: "String", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - type: { - name: "String", - }, - }, - isEnabled: { - serializedName: "properties.isEnabled", - required: true, - type: { - name: "Boolean", - }, - }, - condition: { - serializedName: "properties.condition", - type: { - name: "Composite", - className: "RuleCondition", - }, - }, - action: { - serializedName: "properties.action", - type: { - name: "Composite", - className: "RuleAction", - }, - }, - actions: { - serializedName: "properties.actions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RuleAction", - }, - }, - }, - }, - lastUpdatedTime: { - serializedName: "properties.lastUpdatedTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - }, - }, -}; - -export const LogProfileResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LogProfileResource", - modelProperties: { - ...ResourceAutoGenerated4.type.modelProperties, - storageAccountId: { - serializedName: "properties.storageAccountId", - type: { - name: "String", - }, - }, - serviceBusRuleId: { - serializedName: "properties.serviceBusRuleId", - type: { - name: "String", - }, - }, - locations: { - serializedName: "properties.locations", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - categories: { - serializedName: "properties.categories", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - retentionPolicy: { - serializedName: "properties.retentionPolicy", - type: { - name: "Composite", - className: "RetentionPolicy", - }, - }, - }, - }, -}; - -export const DiagnosticSettingsResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiagnosticSettingsResource", - modelProperties: { - ...ResourceAutoGenerated5.type.modelProperties, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData", - }, - }, - storageAccountId: { - serializedName: "properties.storageAccountId", - type: { - name: "String", - }, - }, - serviceBusRuleId: { - serializedName: "properties.serviceBusRuleId", - type: { - name: "String", - }, - }, - eventHubAuthorizationRuleId: { - serializedName: "properties.eventHubAuthorizationRuleId", - type: { - name: "String", - }, - }, - eventHubName: { - serializedName: "properties.eventHubName", - type: { - name: "String", - }, - }, - metrics: { - serializedName: "properties.metrics", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricSettings", - }, - }, - }, - }, - logs: { - serializedName: "properties.logs", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "LogSettings", - }, - }, - }, - }, - workspaceId: { - serializedName: "properties.workspaceId", - type: { - name: "String", - }, - }, - marketplacePartnerId: { - serializedName: "properties.marketplacePartnerId", - type: { - name: "String", - }, - }, - logAnalyticsDestinationType: { - serializedName: "properties.logAnalyticsDestinationType", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DiagnosticSettingsCategoryResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiagnosticSettingsCategoryResource", - modelProperties: { - ...ResourceAutoGenerated5.type.modelProperties, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData", - }, - }, - categoryType: { - serializedName: "properties.categoryType", - type: { - name: "String", - }, - }, - categoryGroups: { - serializedName: "properties.categoryGroups", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const PrivateEndpointConnectionAutoGenerated: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "PrivateEndpointConnectionAutoGenerated", - modelProperties: { - ...ResourceAutoGenerated5.type.modelProperties, - privateEndpoint: { - serializedName: "properties.privateEndpoint", - type: { - name: "Composite", - className: "PrivateEndpointAutoGenerated", - }, - }, - privateLinkServiceConnectionState: { - serializedName: "properties.privateLinkServiceConnectionState", - type: { - name: "Composite", - className: "PrivateLinkServiceConnectionState", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - type: { - name: "String", - }, - }, - }, - }, - }; - -export const TrackedResourceAutoGenerated: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TrackedResourceAutoGenerated", - modelProperties: { - ...ResourceAutoGenerated5.type.modelProperties, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - location: { - serializedName: "location", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PrivateLinkResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateLinkResource", - modelProperties: { - ...ResourceAutoGenerated5.type.modelProperties, - groupId: { - serializedName: "properties.groupId", - readOnly: true, - type: { - name: "String", - }, - }, - requiredMembers: { - serializedName: "properties.requiredMembers", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - requiredZoneNames: { - serializedName: "properties.requiredZoneNames", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const ProxyResourceAutoGenerated: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ProxyResourceAutoGenerated", - modelProperties: { - ...ResourceAutoGenerated5.type.modelProperties, - }, - }, -}; - -export const ActionGroupResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ActionGroupResource", - modelProperties: { - ...AzureResource.type.modelProperties, - groupShortName: { - constraints: { - MaxLength: 12, - }, - serializedName: "properties.groupShortName", - type: { - name: "String", - }, - }, - enabled: { - defaultValue: true, - serializedName: "properties.enabled", - type: { - name: "Boolean", - }, - }, - emailReceivers: { - serializedName: "properties.emailReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "EmailReceiver", - }, - }, - }, - }, - smsReceivers: { - serializedName: "properties.smsReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SmsReceiver", - }, - }, - }, - }, - webhookReceivers: { - serializedName: "properties.webhookReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "WebhookReceiver", - }, - }, - }, - }, - itsmReceivers: { - serializedName: "properties.itsmReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ItsmReceiver", - }, - }, - }, - }, - azureAppPushReceivers: { - serializedName: "properties.azureAppPushReceivers", - type: { - 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", - }, - }, - enabled: { - defaultValue: true, - serializedName: "properties.enabled", - type: { - name: "Boolean", - }, - }, - emailReceivers: { - serializedName: "properties.emailReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "EmailReceiverAutoGenerated", - }, - }, - }, - }, - smsReceivers: { - serializedName: "properties.smsReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SmsReceiverAutoGenerated", - }, - }, - }, - }, - webhookReceivers: { - serializedName: "properties.webhookReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "WebhookReceiverAutoGenerated", - }, - }, - }, - }, - azureAppPushReceivers: { - serializedName: "properties.azureAppPushReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AzureAppPushReceiverAutoGenerated", - }, - }, - }, - }, - voiceReceivers: { - serializedName: "properties.voiceReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VoiceReceiverAutoGenerated", - }, - }, - }, - }, - }, - }, -}; - -export const MetricAlertSingleResourceMultipleMetricCriteria: coreClient.CompositeMapper = - { - serializedName: - "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", - type: { - name: "Composite", - className: "MetricAlertSingleResourceMultipleMetricCriteria", - uberParent: "MetricAlertCriteria", - additionalProperties: { type: { name: "Object" } }, - polymorphicDiscriminator: - MetricAlertCriteria.type.polymorphicDiscriminator, - modelProperties: { - ...MetricAlertCriteria.type.modelProperties, - allOf: { - serializedName: "allOf", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricCriteria", - }, - }, - }, - }, - }, - }, - }; - -export const WebtestLocationAvailabilityCriteria: coreClient.CompositeMapper = { - serializedName: "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria", - type: { - name: "Composite", - className: "WebtestLocationAvailabilityCriteria", - uberParent: "MetricAlertCriteria", - additionalProperties: { type: { name: "Object" } }, - polymorphicDiscriminator: MetricAlertCriteria.type.polymorphicDiscriminator, - modelProperties: { - ...MetricAlertCriteria.type.modelProperties, - webTestId: { - serializedName: "webTestId", - required: true, - type: { - name: "String", - }, - }, - componentId: { - serializedName: "componentId", - required: true, - type: { - name: "String", - }, - }, - failedLocationCount: { - serializedName: "failedLocationCount", - required: true, - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const MetricAlertMultipleResourceMultipleMetricCriteria: coreClient.CompositeMapper = - { - serializedName: - "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria", - type: { - name: "Composite", - className: "MetricAlertMultipleResourceMultipleMetricCriteria", - uberParent: "MetricAlertCriteria", - additionalProperties: { type: { name: "Object" } }, - polymorphicDiscriminator: - MetricAlertCriteria.type.polymorphicDiscriminator, - modelProperties: { - ...MetricAlertCriteria.type.modelProperties, - allOf: { - serializedName: "allOf", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MultiMetricCriteria", - }, - }, - }, - }, - }, - }, - }; - -export const MetricAlertResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MetricAlertResource", - modelProperties: { - ...ResourceAutoGenerated6.type.modelProperties, - description: { - serializedName: "properties.description", - type: { - name: "String", - }, - }, - severity: { - serializedName: "properties.severity", - required: true, - type: { - name: "Number", - }, - }, - enabled: { - serializedName: "properties.enabled", - required: true, - type: { - name: "Boolean", - }, - }, - scopes: { - serializedName: "properties.scopes", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - evaluationFrequency: { - serializedName: "properties.evaluationFrequency", - required: true, - type: { - name: "TimeSpan", - }, - }, - windowSize: { - serializedName: "properties.windowSize", - required: true, - type: { - name: "TimeSpan", - }, - }, - targetResourceType: { - serializedName: "properties.targetResourceType", - type: { - name: "String", - }, - }, - targetResourceRegion: { - serializedName: "properties.targetResourceRegion", - type: { - name: "String", - }, - }, - criteria: { - serializedName: "properties.criteria", - type: { - name: "Composite", - className: "MetricAlertCriteria", - }, - }, - autoMitigate: { - serializedName: "properties.autoMitigate", - type: { - name: "Boolean", - }, - }, - actions: { - serializedName: "properties.actions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricAlertAction", - }, - }, - }, - }, - lastUpdatedTime: { - serializedName: "properties.lastUpdatedTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - isMigrated: { - serializedName: "properties.isMigrated", - readOnly: true, - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const VMInsightsOnboardingStatus: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VMInsightsOnboardingStatus", - modelProperties: { - ...ProxyResource.type.modelProperties, - resourceId: { - serializedName: "properties.resourceId", - type: { - name: "String", - }, - }, - onboardingStatus: { - serializedName: "properties.onboardingStatus", - type: { - name: "String", - }, - }, - dataStatus: { - serializedName: "properties.dataStatus", - type: { - name: "String", - }, - }, - data: { - serializedName: "properties.data", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DataContainer", - }, - }, - }, - }, - }, - }, -}; - -export const AlertRuleAnyOfOrLeafCondition: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AlertRuleAnyOfOrLeafCondition", - modelProperties: { - ...AlertRuleLeafCondition.type.modelProperties, - anyOf: { - serializedName: "anyOf", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AlertRuleLeafCondition", - }, - }, - }, - }, - }, - }, -}; - -export const ActivityLogAlertResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ActivityLogAlertResource", - modelProperties: { - ...AzureResourceAutoGenerated.type.modelProperties, - scopes: { - serializedName: "properties.scopes", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - condition: { - serializedName: "properties.condition", - type: { - name: "Composite", - className: "AlertRuleAllOfCondition", - }, - }, - actions: { - serializedName: "properties.actions", - type: { - name: "Composite", - className: "ActionList", - }, - }, - enabled: { - defaultValue: true, - serializedName: "properties.enabled", - type: { - name: "Boolean", - }, - }, - description: { - serializedName: "properties.description", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DataCollectionEndpointResourceProperties: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "DataCollectionEndpointResourceProperties", - modelProperties: { - ...DataCollectionEndpoint.type.modelProperties, - }, - }, - }; - -export const DataCollectionEndpointConfigurationAccess: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "DataCollectionEndpointConfigurationAccess", - modelProperties: { - ...ConfigurationAccessEndpointSpec.type.modelProperties, - }, - }, - }; - -export const DataCollectionEndpointLogsIngestion: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataCollectionEndpointLogsIngestion", - modelProperties: { - ...LogsIngestionEndpointSpec.type.modelProperties, - }, - }, -}; - -export const DataCollectionEndpointMetricsIngestion: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "DataCollectionEndpointMetricsIngestion", - modelProperties: { - ...MetricsIngestionEndpointSpec.type.modelProperties, - }, - }, - }; - -export const DataCollectionEndpointNetworkAcls: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataCollectionEndpointNetworkAcls", - modelProperties: { - ...NetworkRuleSet.type.modelProperties, - }, - }, -}; - -export const DataCollectionEndpointFailoverConfiguration: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "DataCollectionEndpointFailoverConfiguration", - modelProperties: { - ...FailoverConfigurationSpec.type.modelProperties, - }, - }, - }; - -export const DataCollectionEndpointMetadata: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataCollectionEndpointMetadata", - modelProperties: { - ...Metadata.type.modelProperties, - }, - }, -}; - -export const DataCollectionRuleAssociationMetadata: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "DataCollectionRuleAssociationMetadata", - modelProperties: { - ...Metadata.type.modelProperties, - }, - }, - }; - -export const DataCollectionRuleMetadata: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataCollectionRuleMetadata", - modelProperties: { - ...Metadata.type.modelProperties, - }, - }, -}; - -export const DataCollectionEndpointResourceIdentity: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "DataCollectionEndpointResourceIdentity", - modelProperties: { - ...ManagedServiceIdentity.type.modelProperties, - }, - }, - }; - -export const ResourceForUpdateIdentity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceForUpdateIdentity", - modelProperties: { - ...ManagedServiceIdentity.type.modelProperties, - }, - }, -}; - -export const DataCollectionRuleResourceIdentity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataCollectionRuleResourceIdentity", - modelProperties: { - ...ManagedServiceIdentity.type.modelProperties, - }, - }, -}; - -export const DataCollectionRuleAssociationProxyOnlyResourceProperties: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "DataCollectionRuleAssociationProxyOnlyResourceProperties", - modelProperties: { - ...DataCollectionRuleAssociation.type.modelProperties, - }, - }, - }; - -export const DataCollectionRuleResourceProperties: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "DataCollectionRuleResourceProperties", - modelProperties: { - ...DataCollectionRule.type.modelProperties, - }, - }, - }; - -export const DataCollectionRuleDataSources: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataCollectionRuleDataSources", - modelProperties: { - ...DataSourcesSpec.type.modelProperties, - }, - }, -}; - -export const LogFilesDataSourceSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LogFilesDataSourceSettings", - modelProperties: { - ...LogFileSettings.type.modelProperties, - }, - }, -}; - -export const LogFileSettingsText: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LogFileSettingsText", - modelProperties: { - ...LogFileTextSettings.type.modelProperties, - }, - }, -}; - -export const DataSourcesSpecDataImports: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataSourcesSpecDataImports", - modelProperties: { - ...DataImportSources.type.modelProperties, - }, - }, -}; - -export const DataImportSourcesEventHub: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataImportSourcesEventHub", - modelProperties: { - ...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, - }, - }, -}; - -export const MetricCriteria: coreClient.CompositeMapper = { - serializedName: "StaticThresholdCriterion", - type: { - name: "Composite", - className: "MetricCriteria", - uberParent: "MultiMetricCriteria", - additionalProperties: { type: { name: "Object" } }, - polymorphicDiscriminator: MultiMetricCriteria.type.polymorphicDiscriminator, - modelProperties: { - ...MultiMetricCriteria.type.modelProperties, - operator: { - serializedName: "operator", - required: true, + windowSize: { + serializedName: "properties.windowSize", type: { - name: "String", + name: "TimeSpan", }, }, - threshold: { - serializedName: "threshold", - required: true, + overrideQueryTimeRange: { + serializedName: "properties.overrideQueryTimeRange", type: { - name: "Number", + name: "TimeSpan", }, }, - }, - }, -}; - -export const DynamicMetricCriteria: coreClient.CompositeMapper = { - serializedName: "DynamicThresholdCriterion", - type: { - name: "Composite", - className: "DynamicMetricCriteria", - uberParent: "MultiMetricCriteria", - additionalProperties: { type: { name: "Object" } }, - polymorphicDiscriminator: MultiMetricCriteria.type.polymorphicDiscriminator, - modelProperties: { - ...MultiMetricCriteria.type.modelProperties, - operator: { - serializedName: "operator", - required: true, + targetResourceTypes: { + serializedName: "properties.targetResourceTypes", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "String", + }, + }, }, }, - alertSensitivity: { - serializedName: "alertSensitivity", - required: true, + criteria: { + serializedName: "properties.criteria", type: { - name: "String", + name: "Composite", + className: "ScheduledQueryRuleCriteria", }, }, - failingPeriods: { - serializedName: "failingPeriods", + muteActionsDuration: { + serializedName: "properties.muteActionsDuration", + type: { + name: "TimeSpan", + }, + }, + actions: { + serializedName: "properties.actions", type: { name: "Composite", - className: "DynamicThresholdFailingPeriods", + className: "Actions", }, }, - ignoreDataBefore: { - serializedName: "ignoreDataBefore", + isWorkspaceAlertsStorageConfigured: { + serializedName: "properties.isWorkspaceAlertsStorageConfigured", + readOnly: true, type: { - name: "DateTime", + name: "Boolean", + }, + }, + checkWorkspaceAlertsStorageConfigured: { + serializedName: "properties.checkWorkspaceAlertsStorageConfigured", + type: { + name: "Boolean", + }, + }, + skipQueryValidation: { + serializedName: "properties.skipQueryValidation", + type: { + name: "Boolean", + }, + }, + autoMitigate: { + serializedName: "properties.autoMitigate", + type: { + name: "Boolean", + }, + }, + resolveConfiguration: { + serializedName: "properties.resolveConfiguration", + type: { + name: "Composite", + className: "RuleResolveConfiguration", }, }, }, }, }; -export const AzureMonitorWorkspaceResource: coreClient.CompositeMapper = { +export const ActionGroupResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureMonitorWorkspaceResource", + className: "ActionGroupResource", modelProperties: { - ...TrackedResource.type.modelProperties, - etag: { - serializedName: "etag", - readOnly: true, - type: { - name: "String", + ...AzureResource.type.modelProperties, + groupShortName: { + constraints: { + MaxLength: 12, }, - }, - accountId: { - serializedName: "properties.accountId", - readOnly: true, + serializedName: "properties.groupShortName", type: { name: "String", }, }, - metrics: { - serializedName: "properties.metrics", - type: { - name: "Composite", - className: "AzureMonitorWorkspaceMetrics", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, + enabled: { + defaultValue: true, + serializedName: "properties.enabled", type: { - name: "String", + name: "Boolean", }, }, - defaultIngestionSettings: { - serializedName: "properties.defaultIngestionSettings", + emailReceivers: { + serializedName: "properties.emailReceivers", type: { - name: "Composite", - className: "AzureMonitorWorkspaceDefaultIngestionSettings", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EmailReceiver", + }, + }, }, }, - privateEndpointConnections: { - serializedName: "properties.privateEndpointConnections", - readOnly: true, + smsReceivers: { + serializedName: "properties.smsReceivers", type: { name: "Sequence", element: { type: { name: "Composite", - className: "PrivateEndpointConnection", + className: "SmsReceiver", }, }, }, }, - publicNetworkAccess: { - serializedName: "properties.publicNetworkAccess", - readOnly: true, + webhookReceivers: { + serializedName: "properties.webhookReceivers", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "WebhookReceiver", + }, + }, }, }, - }, - }, -}; - -export const AzureMonitorPrivateLinkScope: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AzureMonitorPrivateLinkScope", - modelProperties: { - ...TrackedResourceAutoGenerated.type.modelProperties, - systemData: { - serializedName: "systemData", + itsmReceivers: { + serializedName: "properties.itsmReceivers", type: { - name: "Composite", - className: "SystemData", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ItsmReceiver", + }, + }, }, }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, + azureAppPushReceivers: { + serializedName: "properties.azureAppPushReceivers", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AzureAppPushReceiver", + }, + }, }, }, - privateEndpointConnections: { - serializedName: "properties.privateEndpointConnections", - readOnly: true, + automationRunbookReceivers: { + serializedName: "properties.automationRunbookReceivers", type: { name: "Sequence", element: { type: { name: "Composite", - className: "PrivateEndpointConnectionAutoGenerated", + className: "AutomationRunbookReceiver", }, }, }, }, - accessModeSettings: { - serializedName: "properties.accessModeSettings", + voiceReceivers: { + serializedName: "properties.voiceReceivers", type: { - name: "Composite", - className: "AccessModeSettings", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VoiceReceiver", + }, + }, }, }, - }, - }, -}; - -export const ScopedResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ScopedResource", - modelProperties: { - ...ProxyResourceAutoGenerated.type.modelProperties, - systemData: { - serializedName: "systemData", + logicAppReceivers: { + serializedName: "properties.logicAppReceivers", type: { - name: "Composite", - className: "SystemData", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LogicAppReceiver", + }, + }, }, }, - linkedResourceId: { - serializedName: "properties.linkedResourceId", + azureFunctionReceivers: { + serializedName: "properties.azureFunctionReceivers", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AzureFunctionReceiver", + }, + }, }, }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, + armRoleReceivers: { + serializedName: "properties.armRoleReceivers", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ArmRoleReceiver", + }, + }, }, }, - }, - }, -}; - -export const AzureMonitorWorkspacesDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AzureMonitorWorkspacesDeleteHeaders", - modelProperties: { - azureAsyncOperation: { - serializedName: "azure-asyncoperation", + eventHubReceivers: { + serializedName: "properties.eventHubReceivers", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EventHubReceiver", + }, + }, }, }, - location: { - serializedName: "location", + incidentReceivers: { + serializedName: "properties.incidentReceivers", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IncidentReceiver", + }, + }, }, }, }, @@ -9980,50 +2028,3 @@ export const ActionGroupsCreateNotificationsAtActionGroupResourceLevelHeaders: c }, }, }; - -export const MonitorClientCreateNotificationsAtTenantActionGroupResourceLevelHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: - "MonitorClientCreateNotificationsAtTenantActionGroupResourceLevelHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - }, - }, - }; - -export let discriminators = { - RuleCondition: RuleCondition, - RuleDataSource: RuleDataSource, - RuleAction: RuleAction, - MetricAlertCriteria: MetricAlertCriteria, - MultiMetricCriteria: MultiMetricCriteria, - "RuleCondition.Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition": - ThresholdRuleCondition, - "RuleCondition.Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition": - LocationThresholdRuleCondition, - "RuleCondition.Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition": - ManagementEventRuleCondition, - "RuleDataSource.Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource": - RuleMetricDataSource, - "RuleDataSource.Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource": - RuleManagementEventDataSource, - "RuleAction.Microsoft.Azure.Management.Insights.Models.RuleEmailAction": - RuleEmailAction, - "RuleAction.Microsoft.Azure.Management.Insights.Models.RuleWebhookAction": - RuleWebhookAction, - "MetricAlertCriteria.Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria": - MetricAlertSingleResourceMultipleMetricCriteria, - "MetricAlertCriteria.Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria": - WebtestLocationAvailabilityCriteria, - "MetricAlertCriteria.Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria": - MetricAlertMultipleResourceMultipleMetricCriteria, - "MultiMetricCriteria.StaticThresholdCriterion": MetricCriteria, - "MultiMetricCriteria.DynamicThresholdCriterion": DynamicMetricCriteria, -}; diff --git a/sdk/monitor/arm-monitor/src/models/parameters.ts b/sdk/monitor/arm-monitor/src/models/parameters.ts index 6be9cbf27c82..f1d78d8f03ca 100644 --- a/sdk/monitor/arm-monitor/src/models/parameters.ts +++ b/sdk/monitor/arm-monitor/src/models/parameters.ts @@ -12,242 +12,14 @@ import { OperationQueryParameter, } from "@azure/core-client"; import { - SubscriptionScopeMetricsRequestBodyParameters as SubscriptionScopeMetricsRequestBodyParametersMapper, - AzureMonitorWorkspaceResource as AzureMonitorWorkspaceResourceMapper, - AzureMonitorWorkspaceResourceForUpdate as AzureMonitorWorkspaceResourceForUpdateMapper, - AutoscaleSettingResource as AutoscaleSettingResourceMapper, - AutoscaleSettingResourcePatch as AutoscaleSettingResourcePatchMapper, - AlertRuleResource as AlertRuleResourceMapper, - AlertRuleResourcePatch as AlertRuleResourcePatchMapper, - LogProfileResource as LogProfileResourceMapper, - LogProfileResourcePatch as LogProfileResourcePatchMapper, - DiagnosticSettingsResource as DiagnosticSettingsResourceMapper, ActionGroupResource as ActionGroupResourceMapper, ActionGroupPatchBody as ActionGroupPatchBodyMapper, NotificationRequestBody as NotificationRequestBodyMapper, EnableRequest as EnableRequestMapper, - TenantActionGroupResource as TenantActionGroupResourceMapper, - ActionGroupPatchBodyAutoGenerated as ActionGroupPatchBodyAutoGeneratedMapper, - TenantNotificationRequestBody as TenantNotificationRequestBodyMapper, - MetricAlertResource as MetricAlertResourceMapper, - MetricAlertResourcePatch as MetricAlertResourcePatchMapper, ScheduledQueryRuleResource as ScheduledQueryRuleResourceMapper, ScheduledQueryRuleResourcePatch as ScheduledQueryRuleResourcePatchMapper, - AzureMonitorPrivateLinkScope as AzureMonitorPrivateLinkScopeMapper, - TagsResource as TagsResourceMapper, - PrivateEndpointConnectionAutoGenerated as PrivateEndpointConnectionAutoGeneratedMapper, - ScopedResource as ScopedResourceMapper, - ActivityLogAlertResource as ActivityLogAlertResourceMapper, - AlertRulePatchObject as AlertRulePatchObjectMapper, - DataCollectionEndpointResource as DataCollectionEndpointResourceMapper, - ResourceForUpdate as ResourceForUpdateMapper, - DataCollectionRuleAssociationProxyOnlyResource as DataCollectionRuleAssociationProxyOnlyResourceMapper, - DataCollectionRuleResource as DataCollectionRuleResourceMapper, } from "../models/mappers.js"; -export const accept: OperationParameter = { - parameterPath: "accept", - mapper: { - defaultValue: "application/json", - isConstant: true, - serializedName: "Accept", - type: { - name: "String", - }, - }, -}; - -export const $host: OperationURLParameter = { - parameterPath: "$host", - mapper: { - serializedName: "$host", - required: true, - type: { - name: "String", - }, - }, - skipEncoding: true, -}; - -export const resourceUri: OperationURLParameter = { - parameterPath: "resourceUri", - mapper: { - serializedName: "resourceUri", - required: true, - type: { - name: "String", - }, - }, - skipEncoding: true, -}; - -export const apiVersion: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2024-02-01", - isConstant: true, - serializedName: "api-version", - type: { - name: "String", - }, - }, -}; - -export const startTime: OperationQueryParameter = { - parameterPath: ["options", "startTime"], - mapper: { - serializedName: "startTime", - type: { - name: "String", - }, - }, -}; - -export const subscriptionId: OperationURLParameter = { - parameterPath: "subscriptionId", - mapper: { - constraints: { - MinLength: 1, - }, - serializedName: "subscriptionId", - required: true, - type: { - name: "String", - }, - }, -}; - -export const region: OperationQueryParameter = { - parameterPath: "region", - mapper: { - serializedName: "region", - required: true, - type: { - name: "String", - }, - }, -}; - -export const metricnamespace: OperationQueryParameter = { - parameterPath: ["options", "metricnamespace"], - mapper: { - serializedName: "metricnamespace", - type: { - name: "String", - }, - }, -}; - -export const timespan: OperationQueryParameter = { - parameterPath: ["options", "timespan"], - mapper: { - serializedName: "timespan", - type: { - name: "String", - }, - }, -}; - -export const interval: OperationQueryParameter = { - parameterPath: ["options", "interval"], - mapper: { - serializedName: "interval", - type: { - name: "String", - }, - }, -}; - -export const metricnames: OperationQueryParameter = { - parameterPath: ["options", "metricnames"], - mapper: { - serializedName: "metricnames", - type: { - name: "String", - }, - }, -}; - -export const aggregation: OperationQueryParameter = { - parameterPath: ["options", "aggregation"], - mapper: { - serializedName: "aggregation", - type: { - name: "String", - }, - }, -}; - -export const top: OperationQueryParameter = { - parameterPath: ["options", "top"], - mapper: { - serializedName: "top", - type: { - name: "Number", - }, - }, -}; - -export const orderby: OperationQueryParameter = { - parameterPath: ["options", "orderby"], - mapper: { - serializedName: "orderby", - type: { - name: "String", - }, - }, -}; - -export const filter: OperationQueryParameter = { - parameterPath: ["options", "filter"], - mapper: { - serializedName: "$filter", - type: { - name: "String", - }, - }, -}; - -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 rollupby: OperationQueryParameter = { - parameterPath: ["options", "rollupby"], - mapper: { - serializedName: "rollupby", - type: { - name: "String", - }, - }, -}; - export const contentType: OperationParameter = { parameterPath: ["options", "contentType"], mapper: { @@ -260,357 +32,43 @@ export const contentType: OperationParameter = { }, }; -export const body: OperationParameter = { - parameterPath: ["options", "body"], - mapper: SubscriptionScopeMetricsRequestBodyParametersMapper, -}; - -export const resultType1: OperationQueryParameter = { - parameterPath: ["options", "resultType"], - mapper: { - serializedName: "resultType", - type: { - name: "Enum", - allowedValues: ["Data", "Metadata"], - }, - }, -}; - -export const resourceGroupName: OperationURLParameter = { - parameterPath: "resourceGroupName", - mapper: { - constraints: { - MaxLength: 90, - MinLength: 1, - }, - serializedName: "resourceGroupName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const apiVersion1: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2023-04-03", - 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, -}; - -export const nextLink: OperationURLParameter = { - parameterPath: "nextLink", - mapper: { - serializedName: "nextLink", - required: true, - type: { - name: "String", - }, - }, - skipEncoding: true, -}; - -export const apiVersion2: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2022-10-01", - isConstant: true, - serializedName: "api-version", - type: { - name: "String", - }, - }, -}; - -export const parameters: OperationParameter = { - parameterPath: "parameters", - mapper: AutoscaleSettingResourceMapper, -}; - -export const autoscaleSettingName: OperationURLParameter = { - parameterPath: "autoscaleSettingName", - mapper: { - serializedName: "autoscaleSettingName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const autoscaleSettingResource: OperationParameter = { - parameterPath: "autoscaleSettingResource", - mapper: AutoscaleSettingResourcePatchMapper, -}; - -export const timespan1: OperationQueryParameter = { - parameterPath: "timespan", - mapper: { - serializedName: "timespan", - required: true, - type: { - name: "String", - }, - }, -}; - -export const interval1: OperationQueryParameter = { - parameterPath: "interval", - mapper: { - serializedName: "interval", - required: true, - type: { - name: "TimeSpan", - }, - }, -}; - -export const metricNamespace: OperationQueryParameter = { - parameterPath: "metricNamespace", - mapper: { - serializedName: "metricNamespace", - required: true, - type: { - name: "String", - }, - }, -}; - -export const metricName: OperationQueryParameter = { - parameterPath: "metricName", - mapper: { - serializedName: "metricName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const aggregation1: OperationQueryParameter = { - parameterPath: "aggregation", - mapper: { - serializedName: "aggregation", - required: true, - type: { - name: "String", - }, - }, -}; - -export const apiVersion3: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2015-04-01", - isConstant: true, - serializedName: "api-version", - type: { - name: "String", - }, - }, -}; - -export const ruleName: OperationURLParameter = { - parameterPath: "ruleName", - mapper: { - serializedName: "ruleName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const incidentName: OperationURLParameter = { - parameterPath: "incidentName", - mapper: { - serializedName: "incidentName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const apiVersion4: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2016-03-01", - isConstant: true, - serializedName: "api-version", - type: { - name: "String", - }, - }, -}; - -export const parameters1: OperationParameter = { - parameterPath: "parameters", - mapper: AlertRuleResourceMapper, -}; - -export const alertRulesResource: OperationParameter = { - parameterPath: "alertRulesResource", - mapper: AlertRuleResourcePatchMapper, -}; - -export const logProfileName: OperationURLParameter = { - parameterPath: "logProfileName", - mapper: { - serializedName: "logProfileName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const parameters2: OperationParameter = { - parameterPath: "parameters", - mapper: LogProfileResourceMapper, -}; - -export const logProfilesResource: OperationParameter = { - parameterPath: "logProfilesResource", - mapper: LogProfileResourcePatchMapper, -}; - -export const apiVersion5: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2021-05-01-preview", - isConstant: true, - serializedName: "api-version", - type: { - name: "String", - }, - }, -}; - -export const name: OperationURLParameter = { - parameterPath: "name", - mapper: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, -}; - -export const parameters3: OperationParameter = { - parameterPath: "parameters", - mapper: DiagnosticSettingsResourceMapper, -}; - export const actionGroup: OperationParameter = { parameterPath: "actionGroup", mapper: ActionGroupResourceMapper, }; -export const actionGroupName: OperationURLParameter = { - parameterPath: "actionGroupName", - mapper: { - serializedName: "actionGroupName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const apiVersion6: OperationQueryParameter = { - parameterPath: "apiVersion", +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { - defaultValue: "2023-01-01", + defaultValue: "application/json", isConstant: true, - serializedName: "api-version", - type: { - name: "String", - }, - }, -}; - -export const actionGroupPatch: OperationParameter = { - parameterPath: "actionGroupPatch", - mapper: ActionGroupPatchBodyMapper, -}; - -export const notificationRequest: OperationParameter = { - parameterPath: "notificationRequest", - mapper: NotificationRequestBodyMapper, -}; - -export const notificationId: OperationURLParameter = { - parameterPath: "notificationId", - mapper: { - serializedName: "notificationId", - required: true, + serializedName: "Accept", type: { name: "String", }, }, }; -export const enableRequest: OperationParameter = { - parameterPath: "enableRequest", - mapper: EnableRequestMapper, -}; - -export const actionGroup1: OperationParameter = { - parameterPath: "actionGroup", - mapper: TenantActionGroupResourceMapper, -}; - -export const managementGroupId: OperationURLParameter = { - parameterPath: "managementGroupId", +export const $host: OperationURLParameter = { + parameterPath: "$host", mapper: { - serializedName: "managementGroupId", + serializedName: "$host", required: true, type: { name: "String", }, }, + skipEncoding: true, }; -export const tenantActionGroupName: OperationURLParameter = { - parameterPath: "tenantActionGroupName", +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", mapper: { constraints: { - Pattern: new RegExp("^[A-Za-z][A-Za-z0-9]*$"), - MaxLength: 260, + MaxLength: 90, MinLength: 1, }, - serializedName: "tenantActionGroupName", + serializedName: "resourceGroupName", required: true, type: { name: "String", @@ -618,10 +76,10 @@ export const tenantActionGroupName: OperationURLParameter = { }, }; -export const xMsClientTenantId: OperationParameter = { - parameterPath: "xMsClientTenantId", +export const actionGroupName: OperationURLParameter = { + parameterPath: "actionGroupName", mapper: { - serializedName: "x-ms-client-tenant-id", + serializedName: "actionGroupName", required: true, type: { name: "String", @@ -629,32 +87,13 @@ export const xMsClientTenantId: OperationParameter = { }, }; -export const apiVersion7: OperationQueryParameter = { - parameterPath: "apiVersion", +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { - defaultValue: "2023-05-01-preview", - isConstant: true, - serializedName: "api-version", - type: { - name: "String", + constraints: { + MinLength: 1, }, - }, -}; - -export const tenantActionGroupPatch: OperationParameter = { - parameterPath: "tenantActionGroupPatch", - mapper: ActionGroupPatchBodyAutoGeneratedMapper, -}; - -export const notificationRequest1: OperationParameter = { - parameterPath: "notificationRequest", - mapper: TenantNotificationRequestBodyMapper, -}; - -export const filter1: OperationQueryParameter = { - parameterPath: "filter", - mapper: { - serializedName: "$filter", + serializedName: "subscriptionId", required: true, type: { name: "String", @@ -662,52 +101,10 @@ export const filter1: OperationQueryParameter = { }, }; -export const select: OperationQueryParameter = { - parameterPath: ["options", "select"], - mapper: { - serializedName: "$select", - type: { - name: "String", - }, - }, -}; - -export const interval2: OperationQueryParameter = { - parameterPath: ["options", "interval"], - mapper: { - serializedName: "interval", - type: { - name: "TimeSpan", - }, - }, -}; - -export const sensitivities: OperationQueryParameter = { - parameterPath: ["options", "sensitivities"], - mapper: { - serializedName: "sensitivities", - type: { - name: "String", - }, - }, -}; - -export const apiVersion8: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2019-03-01", - isConstant: true, - serializedName: "api-version", - type: { - name: "String", - }, - }, -}; - -export const apiVersion9: OperationQueryParameter = { +export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2018-03-01", + defaultValue: "2024-10-01-preview", isConstant: true, serializedName: "api-version", type: { @@ -716,20 +113,20 @@ export const apiVersion9: OperationQueryParameter = { }, }; -export const parameters4: OperationParameter = { - parameterPath: "parameters", - mapper: MetricAlertResourceMapper, +export const actionGroupPatch: OperationParameter = { + parameterPath: "actionGroupPatch", + mapper: ActionGroupPatchBodyMapper, }; -export const parameters5: OperationParameter = { - parameterPath: "parameters", - mapper: MetricAlertResourcePatchMapper, +export const notificationRequest: OperationParameter = { + parameterPath: "notificationRequest", + mapper: NotificationRequestBodyMapper, }; -export const statusName: OperationURLParameter = { - parameterPath: "statusName", +export const notificationId: OperationURLParameter = { + parameterPath: "notificationId", mapper: { - serializedName: "statusName", + serializedName: "notificationId", required: true, type: { name: "String", @@ -737,44 +134,15 @@ export const statusName: OperationURLParameter = { }, }; -export const apiVersion10: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2023-12-01", - isConstant: true, - serializedName: "api-version", - type: { - name: "String", - }, - }, -}; - -export const parameters6: OperationParameter = { - parameterPath: "parameters", - mapper: ScheduledQueryRuleResourceMapper, -}; - -export const parameters7: OperationParameter = { - parameterPath: "parameters", - mapper: ScheduledQueryRuleResourcePatchMapper, -}; - -export const apiVersion11: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2018-11-27-preview", - isConstant: true, - serializedName: "api-version", - type: { - name: "String", - }, - }, +export const enableRequest: OperationParameter = { + parameterPath: "enableRequest", + mapper: EnableRequestMapper, }; -export const apiVersion12: OperationQueryParameter = { +export const apiVersion1: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-07-01-preview", + defaultValue: "2025-01-01-preview", isConstant: true, serializedName: "api-version", type: { @@ -783,53 +151,13 @@ export const apiVersion12: OperationQueryParameter = { }, }; -export const scopeName: OperationURLParameter = { - parameterPath: "scopeName", - mapper: { - serializedName: "scopeName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const azureMonitorPrivateLinkScopePayload: OperationParameter = { - parameterPath: "azureMonitorPrivateLinkScopePayload", - mapper: AzureMonitorPrivateLinkScopeMapper, -}; - -export const privateLinkScopeTags: OperationParameter = { - parameterPath: "privateLinkScopeTags", - mapper: TagsResourceMapper, -}; - -export const asyncOperationId: OperationURLParameter = { - parameterPath: "asyncOperationId", - mapper: { - serializedName: "asyncOperationId", - required: true, - type: { - name: "String", - }, - }, -}; - -export const groupName: OperationURLParameter = { - parameterPath: "groupName", +export const ruleName: OperationURLParameter = { + parameterPath: "ruleName", mapper: { - serializedName: "groupName", - required: true, - type: { - name: "String", + constraints: { + Pattern: new RegExp("^[^#<>%&:\\?/{}*]{1,260}$"), }, - }, -}; - -export const privateEndpointConnectionName: OperationURLParameter = { - parameterPath: "privateEndpointConnectionName", - mapper: { - serializedName: "privateEndpointConnectionName", + serializedName: "ruleName", required: true, type: { name: "String", @@ -837,89 +165,20 @@ export const privateEndpointConnectionName: OperationURLParameter = { }, }; -export const parameters8: OperationParameter = { +export const parameters: OperationParameter = { parameterPath: "parameters", - mapper: PrivateEndpointConnectionAutoGeneratedMapper, + mapper: ScheduledQueryRuleResourceMapper, }; -export const parameters9: OperationParameter = { +export const parameters1: OperationParameter = { parameterPath: "parameters", - mapper: ScopedResourceMapper, -}; - -export const activityLogAlertRule: OperationParameter = { - parameterPath: "activityLogAlertRule", - mapper: ActivityLogAlertResourceMapper, -}; - -export const activityLogAlertName: OperationURLParameter = { - parameterPath: "activityLogAlertName", - mapper: { - serializedName: "activityLogAlertName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const apiVersion13: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2020-10-01", - isConstant: true, - serializedName: "api-version", - type: { - name: "String", - }, - }, -}; - -export const activityLogAlertRulePatch: OperationParameter = { - parameterPath: "activityLogAlertRulePatch", - mapper: AlertRulePatchObjectMapper, -}; - -export const apiVersion14: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2022-06-01", - isConstant: true, - serializedName: "api-version", - type: { - name: "String", - }, - }, -}; - -export const dataCollectionEndpointName: OperationURLParameter = { - parameterPath: "dataCollectionEndpointName", - mapper: { - serializedName: "dataCollectionEndpointName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const body1: OperationParameter = { - parameterPath: ["options", "body"], - mapper: DataCollectionEndpointResourceMapper, -}; - -export const body2: OperationParameter = { - parameterPath: ["options", "body"], - mapper: ResourceForUpdateMapper, + mapper: ScheduledQueryRuleResourcePatchMapper, }; -export const resourceUri1: OperationURLParameter = { - parameterPath: "resourceUri", +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", mapper: { - constraints: { - MinLength: 1, - }, - serializedName: "resourceUri", + serializedName: "nextLink", required: true, type: { name: "String", @@ -927,35 +186,3 @@ export const resourceUri1: OperationURLParameter = { }, skipEncoding: true, }; - -export const dataCollectionRuleName: OperationURLParameter = { - parameterPath: "dataCollectionRuleName", - mapper: { - serializedName: "dataCollectionRuleName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const associationName: OperationURLParameter = { - parameterPath: "associationName", - mapper: { - serializedName: "associationName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const body3: OperationParameter = { - parameterPath: ["options", "body"], - mapper: DataCollectionRuleAssociationProxyOnlyResourceMapper, -}; - -export const body4: OperationParameter = { - parameterPath: ["options", "body"], - mapper: DataCollectionRuleResourceMapper, -}; diff --git a/sdk/monitor/arm-monitor/src/monitorClient.ts b/sdk/monitor/arm-monitor/src/monitorClient.ts index a86de7d3186b..6c323f720cd1 100644 --- a/sdk/monitor/arm-monitor/src/monitorClient.ts +++ b/sdk/monitor/arm-monitor/src/monitorClient.ts @@ -9,94 +9,13 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "./lroImpl.js"; -import { - MetricNamespacesImpl, - MetricDefinitionsImpl, - MetricsOperationsImpl, - AzureMonitorWorkspacesImpl, - MonitorOperationsImpl, - AutoscaleSettingsImpl, - PredictiveMetricImpl, - OperationsImpl, - AlertRuleIncidentsImpl, - AlertRulesImpl, - LogProfilesImpl, - DiagnosticSettingsImpl, - DiagnosticSettingsCategoryImpl, - ActionGroupsImpl, - TenantActionGroupsImpl, - ActivityLogsImpl, - EventCategoriesImpl, - TenantActivityLogsImpl, - BaselinesImpl, - MetricAlertsImpl, - MetricAlertsStatusImpl, - ScheduledQueryRulesImpl, - VMInsightsImpl, - PrivateLinkScopesImpl, - PrivateLinkScopeOperationStatusImpl, - PrivateLinkResourcesImpl, - PrivateEndpointConnectionsImpl, - PrivateLinkScopedResourcesImpl, - ActivityLogAlertsImpl, - DataCollectionEndpointsImpl, - DataCollectionRuleAssociationsImpl, - DataCollectionRulesImpl, -} from "./operations/index.js"; -import { - MetricNamespaces, - MetricDefinitions, - MetricsOperations, - AzureMonitorWorkspaces, - MonitorOperations, - AutoscaleSettings, - PredictiveMetric, - Operations, - AlertRuleIncidents, - AlertRules, - LogProfiles, - DiagnosticSettings, - DiagnosticSettingsCategory, - ActionGroups, - TenantActionGroups, - ActivityLogs, - EventCategories, - TenantActivityLogs, - Baselines, - MetricAlerts, - MetricAlertsStatus, - ScheduledQueryRules, - VMInsights, - PrivateLinkScopes, - PrivateLinkScopeOperationStatus, - PrivateLinkResources, - PrivateEndpointConnections, - PrivateLinkScopedResources, - ActivityLogAlerts, - DataCollectionEndpoints, - DataCollectionRuleAssociations, - DataCollectionRules, -} from "./operationsInterfaces/index.js"; -import * as Parameters from "./models/parameters.js"; -import * as Mappers from "./models/mappers.js"; -import { - MonitorClientOptionalParams, - TenantNotificationRequestBody, - CreateNotificationsAtTenantActionGroupResourceLevelOptionalParams, - CreateNotificationsAtTenantActionGroupResourceLevelResponse, - GetTestNotificationsAtTenantActionGroupResourceLevelOptionalParams, - GetTestNotificationsAtTenantActionGroupResourceLevelResponse, -} from "./models/index.js"; +import { ActionGroupsImpl, ScheduledQueryRulesImpl } from "./operations/index.js"; +import { ActionGroups, ScheduledQueryRules } from "./operationsInterfaces/index.js"; +import { MonitorClientOptionalParams } from "./models/index.js"; export class MonitorClient extends coreClient.ServiceClient { $host: string; - subscriptionId?: string; + subscriptionId: string; /** * Initializes a new instance of the MonitorClient class. @@ -108,26 +27,12 @@ export class MonitorClient extends coreClient.ServiceClient { credentials: coreAuth.TokenCredential, subscriptionId: string, options?: MonitorClientOptionalParams, - ); - constructor( - credentials: coreAuth.TokenCredential, - options?: MonitorClientOptionalParams, - ); - constructor( - credentials: coreAuth.TokenCredential, - subscriptionIdOrOptions?: MonitorClientOptionalParams | string, - options?: MonitorClientOptionalParams, ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); } - - let subscriptionId: string | undefined; - - if (typeof subscriptionIdOrOptions === "string") { - subscriptionId = subscriptionIdOrOptions; - } else if (typeof subscriptionIdOrOptions === "object") { - options = subscriptionIdOrOptions; + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); } // Initializing default values for options @@ -193,267 +98,10 @@ export class MonitorClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.metricNamespaces = new MetricNamespacesImpl(this); - this.metricDefinitions = new MetricDefinitionsImpl(this); - this.metricsOperations = new MetricsOperationsImpl(this); - 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); - this.alertRuleIncidents = new AlertRuleIncidentsImpl(this); - this.alertRules = new AlertRulesImpl(this); - this.logProfiles = new LogProfilesImpl(this); - 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); - this.baselines = new BaselinesImpl(this); - this.metricAlerts = new MetricAlertsImpl(this); - this.metricAlertsStatus = new MetricAlertsStatusImpl(this); this.scheduledQueryRules = new ScheduledQueryRulesImpl(this); - this.vMInsights = new VMInsightsImpl(this); - this.privateLinkScopes = new PrivateLinkScopesImpl(this); - this.privateLinkScopeOperationStatus = - new PrivateLinkScopeOperationStatusImpl(this); - this.privateLinkResources = new PrivateLinkResourcesImpl(this); - this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); - this.privateLinkScopedResources = new PrivateLinkScopedResourcesImpl(this); - this.activityLogAlerts = new ActivityLogAlertsImpl(this); - this.dataCollectionEndpoints = new DataCollectionEndpointsImpl(this); - this.dataCollectionRuleAssociations = - new DataCollectionRuleAssociationsImpl(this); - this.dataCollectionRules = new DataCollectionRulesImpl(this); - } - - /** - * Send test notifications to a set of provided receivers - * @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 notificationRequest The notification request body which includes the contact details - * @param options The options parameters. - */ - async beginCreateNotificationsAtTenantActionGroupResourceLevel( - managementGroupId: string, - tenantActionGroupName: string, - xMsClientTenantId: string, - notificationRequest: TenantNotificationRequestBody, - options?: CreateNotificationsAtTenantActionGroupResourceLevelOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - CreateNotificationsAtTenantActionGroupResourceLevelResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.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: { - managementGroupId, - tenantActionGroupName, - xMsClientTenantId, - notificationRequest, - options, - }, - spec: createNotificationsAtTenantActionGroupResourceLevelOperationSpec, - }); - const poller = await createHttpPoller< - CreateNotificationsAtTenantActionGroupResourceLevelResponse, - 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 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 notificationRequest The notification request body which includes the contact details - * @param options The options parameters. - */ - async beginCreateNotificationsAtTenantActionGroupResourceLevelAndWait( - managementGroupId: string, - tenantActionGroupName: string, - xMsClientTenantId: string, - notificationRequest: TenantNotificationRequestBody, - options?: CreateNotificationsAtTenantActionGroupResourceLevelOptionalParams, - ): Promise { - const poller = - await this.beginCreateNotificationsAtTenantActionGroupResourceLevel( - managementGroupId, - tenantActionGroupName, - xMsClientTenantId, - notificationRequest, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Get the test notifications by the notification id - * @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 notificationId The notification id - * @param options The options parameters. - */ - getTestNotificationsAtTenantActionGroupResourceLevel( - managementGroupId: string, - tenantActionGroupName: string, - xMsClientTenantId: string, - notificationId: string, - options?: GetTestNotificationsAtTenantActionGroupResourceLevelOptionalParams, - ): Promise { - return this.sendOperationRequest( - { - managementGroupId, - tenantActionGroupName, - xMsClientTenantId, - notificationId, - options, - }, - getTestNotificationsAtTenantActionGroupResourceLevelOperationSpec, - ); } - metricNamespaces: MetricNamespaces; - metricDefinitions: MetricDefinitions; - metricsOperations: MetricsOperations; - azureMonitorWorkspaces: AzureMonitorWorkspaces; - monitorOperations: MonitorOperations; - autoscaleSettings: AutoscaleSettings; - predictiveMetric: PredictiveMetric; - operations: Operations; - alertRuleIncidents: AlertRuleIncidents; - alertRules: AlertRules; - logProfiles: LogProfiles; - diagnosticSettings: DiagnosticSettings; - diagnosticSettingsCategory: DiagnosticSettingsCategory; actionGroups: ActionGroups; - tenantActionGroups: TenantActionGroups; - activityLogs: ActivityLogs; - eventCategories: EventCategories; - tenantActivityLogs: TenantActivityLogs; - baselines: Baselines; - metricAlerts: MetricAlerts; - metricAlertsStatus: MetricAlertsStatus; scheduledQueryRules: ScheduledQueryRules; - vMInsights: VMInsights; - privateLinkScopes: PrivateLinkScopes; - privateLinkScopeOperationStatus: PrivateLinkScopeOperationStatus; - privateLinkResources: PrivateLinkResources; - privateEndpointConnections: PrivateEndpointConnections; - privateLinkScopedResources: PrivateLinkScopedResources; - activityLogAlerts: ActivityLogAlerts; - dataCollectionEndpoints: DataCollectionEndpoints; - dataCollectionRuleAssociations: DataCollectionRuleAssociations; - dataCollectionRules: DataCollectionRules; } -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const createNotificationsAtTenantActionGroupResourceLevelOperationSpec: coreClient.OperationSpec = - { - path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Insights/tenantActionGroups/{tenantActionGroupName}/createNotifications", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.TestNotificationDetailsResponseAutoGenerated, - }, - 201: { - bodyMapper: Mappers.TestNotificationDetailsResponseAutoGenerated, - }, - 202: { - bodyMapper: Mappers.TestNotificationDetailsResponseAutoGenerated, - }, - 204: { - bodyMapper: Mappers.TestNotificationDetailsResponseAutoGenerated, - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated3, - }, - }, - requestBody: Parameters.notificationRequest1, - queryParameters: [Parameters.apiVersion7], - urlParameters: [ - Parameters.$host, - Parameters.managementGroupId, - Parameters.tenantActionGroupName, - ], - headerParameters: [ - Parameters.accept, - Parameters.contentType, - Parameters.xMsClientTenantId, - ], - mediaType: "json", - serializer, - }; -const getTestNotificationsAtTenantActionGroupResourceLevelOperationSpec: coreClient.OperationSpec = - { - path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Insights/tenantActionGroups/{tenantActionGroupName}/notificationStatus/{notificationId}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.TestNotificationDetailsResponseAutoGenerated, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion7], - urlParameters: [ - Parameters.$host, - Parameters.notificationId, - Parameters.managementGroupId, - Parameters.tenantActionGroupName, - ], - headerParameters: [Parameters.accept, Parameters.xMsClientTenantId], - serializer, - }; diff --git a/sdk/monitor/arm-monitor/src/operations/actionGroups.ts b/sdk/monitor/arm-monitor/src/operations/actionGroups.ts index 9a6dab2feb40..d0198204e055 100644 --- a/sdk/monitor/arm-monitor/src/operations/actionGroups.ts +++ b/sdk/monitor/arm-monitor/src/operations/actionGroups.ts @@ -405,14 +405,14 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { }, }, requestBody: Parameters.actionGroup, - queryParameters: [Parameters.apiVersion6], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.actionGroupName, + Parameters.subscriptionId, ], - headerParameters: [Parameters.accept, Parameters.contentType], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", serializer, }; @@ -427,12 +427,12 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse, }, }, - queryParameters: [Parameters.apiVersion6], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.actionGroupName, + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], serializer, @@ -447,12 +447,12 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse, }, }, - queryParameters: [Parameters.apiVersion6], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.actionGroupName, + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], serializer, @@ -469,14 +469,14 @@ const updateOperationSpec: coreClient.OperationSpec = { }, }, requestBody: Parameters.actionGroupPatch, - queryParameters: [Parameters.apiVersion6], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.actionGroupName, + Parameters.subscriptionId, ], - headerParameters: [Parameters.accept, Parameters.contentType], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", serializer, }; @@ -502,14 +502,14 @@ const createNotificationsAtActionGroupResourceLevelOperationSpec: coreClient.Ope }, }, requestBody: Parameters.notificationRequest, - queryParameters: [Parameters.apiVersion6], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.actionGroupName, + Parameters.subscriptionId, ], - headerParameters: [Parameters.accept, Parameters.contentType], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", serializer, }; @@ -525,12 +525,12 @@ const getTestNotificationsAtActionGroupResourceLevelOperationSpec: coreClient.Op bodyMapper: Mappers.ErrorResponse, }, }, - queryParameters: [Parameters.apiVersion6], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.actionGroupName, + Parameters.subscriptionId, Parameters.notificationId, ], headerParameters: [Parameters.accept], @@ -547,7 +547,7 @@ const listBySubscriptionIdOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse, }, }, - queryParameters: [Parameters.apiVersion6], + queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer, @@ -563,11 +563,11 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse, }, }, - queryParameters: [Parameters.apiVersion6], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], serializer, @@ -585,14 +585,14 @@ const enableReceiverOperationSpec: coreClient.OperationSpec = { }, }, requestBody: Parameters.enableRequest, - queryParameters: [Parameters.apiVersion6], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.actionGroupName, + Parameters.subscriptionId, ], - headerParameters: [Parameters.accept, Parameters.contentType], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", serializer, }; diff --git a/sdk/monitor/arm-monitor/src/operations/activityLogAlerts.ts b/sdk/monitor/arm-monitor/src/operations/activityLogAlerts.ts deleted file mode 100644 index baaa640fd305..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/activityLogAlerts.ts +++ /dev/null @@ -1,483 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { setContinuationToken } from "../pagingHelper.js"; -import { ActivityLogAlerts } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - ActivityLogAlertResource, - ActivityLogAlertsListBySubscriptionIdNextOptionalParams, - ActivityLogAlertsListBySubscriptionIdOptionalParams, - ActivityLogAlertsListBySubscriptionIdResponse, - ActivityLogAlertsListByResourceGroupNextOptionalParams, - ActivityLogAlertsListByResourceGroupOptionalParams, - ActivityLogAlertsListByResourceGroupResponse, - ActivityLogAlertsCreateOrUpdateOptionalParams, - ActivityLogAlertsCreateOrUpdateResponse, - ActivityLogAlertsGetOptionalParams, - ActivityLogAlertsGetResponse, - ActivityLogAlertsDeleteOptionalParams, - AlertRulePatchObject, - ActivityLogAlertsUpdateOptionalParams, - ActivityLogAlertsUpdateResponse, - ActivityLogAlertsListBySubscriptionIdNextResponse, - ActivityLogAlertsListByResourceGroupNextResponse, -} from "../models/index.js"; - -/// -/** Class containing ActivityLogAlerts operations. */ -export class ActivityLogAlertsImpl implements ActivityLogAlerts { - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class ActivityLogAlerts class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - this.client = client; - } - - /** - * Get a list of all Activity Log Alert rules in a subscription. - * @param options The options parameters. - */ - public listBySubscriptionId( - options?: ActivityLogAlertsListBySubscriptionIdOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listBySubscriptionIdPagingAll(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.listBySubscriptionIdPagingPage(options, settings); - }, - }; - } - - private async *listBySubscriptionIdPagingPage( - options?: ActivityLogAlertsListBySubscriptionIdOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: ActivityLogAlertsListBySubscriptionIdResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listBySubscriptionId(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listBySubscriptionIdNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listBySubscriptionIdPagingAll( - options?: ActivityLogAlertsListBySubscriptionIdOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listBySubscriptionIdPagingPage(options)) { - yield* page; - } - } - - /** - * Get a list of all Activity Log Alert rules in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: ActivityLogAlertsListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, 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.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings, - ); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: ActivityLogAlertsListByResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: ActivityLogAlertsListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext( - resourceGroupName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: ActivityLogAlertsListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage( - resourceGroupName, - options, - )) { - yield* page; - } - } - - /** - * Create a new Activity Log Alert rule or update an existing one. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param activityLogAlertName The name of the Activity Log Alert rule. - * @param activityLogAlertRule The Activity Log Alert rule to create or use for the update. - * @param options The options parameters. - */ - createOrUpdate( - resourceGroupName: string, - activityLogAlertName: string, - activityLogAlertRule: ActivityLogAlertResource, - options?: ActivityLogAlertsCreateOrUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - activityLogAlertName, - activityLogAlertRule, - options, - }, - createOrUpdateOperationSpec, - ); - } - - /** - * Get an Activity Log Alert rule. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param activityLogAlertName The name of the Activity Log Alert rule. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - activityLogAlertName: string, - options?: ActivityLogAlertsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, activityLogAlertName, options }, - getOperationSpec, - ); - } - - /** - * Delete an Activity Log Alert rule. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param activityLogAlertName The name of the Activity Log Alert rule. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - activityLogAlertName: string, - options?: ActivityLogAlertsDeleteOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, activityLogAlertName, options }, - deleteOperationSpec, - ); - } - - /** - * 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. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param activityLogAlertName The name of the Activity Log Alert rule. - * @param activityLogAlertRulePatch Parameters supplied to the operation. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - activityLogAlertName: string, - activityLogAlertRulePatch: AlertRulePatchObject, - options?: ActivityLogAlertsUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - activityLogAlertName, - activityLogAlertRulePatch, - options, - }, - updateOperationSpec, - ); - } - - /** - * Get a list of all Activity Log Alert rules in a subscription. - * @param options The options parameters. - */ - private _listBySubscriptionId( - options?: ActivityLogAlertsListBySubscriptionIdOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { options }, - listBySubscriptionIdOperationSpec, - ); - } - - /** - * Get a list of all Activity Log Alert rules in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: ActivityLogAlertsListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * ListBySubscriptionIdNext - * @param nextLink The nextLink from the previous successful call to the ListBySubscriptionId method. - * @param options The options parameters. - */ - private _listBySubscriptionIdNext( - nextLink: string, - options?: ActivityLogAlertsListBySubscriptionIdNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listBySubscriptionIdNextOperationSpec, - ); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: ActivityLogAlertsListByResourceGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.ActivityLogAlertResource, - }, - 201: { - bodyMapper: Mappers.ActivityLogAlertResource, - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated4, - }, - }, - requestBody: Parameters.activityLogAlertRule, - queryParameters: [Parameters.apiVersion13], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.activityLogAlertName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ActivityLogAlertResource, - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated4, - }, - }, - queryParameters: [Parameters.apiVersion13], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.activityLogAlertName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated4, - }, - }, - queryParameters: [Parameters.apiVersion13], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.activityLogAlertName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.ActivityLogAlertResource, - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated4, - }, - }, - requestBody: Parameters.activityLogAlertRulePatch, - queryParameters: [Parameters.apiVersion13], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.activityLogAlertName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const listBySubscriptionIdOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/activityLogAlerts", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AlertRuleList, - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated4, - }, - }, - queryParameters: [Parameters.apiVersion13], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AlertRuleList, - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated4, - }, - }, - queryParameters: [Parameters.apiVersion13], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listBySubscriptionIdNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AlertRuleList, - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated4, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AlertRuleList, - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated4, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/monitor/arm-monitor/src/operations/activityLogs.ts b/sdk/monitor/arm-monitor/src/operations/activityLogs.ts deleted file mode 100644 index e1dce078b65a..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/activityLogs.ts +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { setContinuationToken } from "../pagingHelper.js"; -import { ActivityLogs } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - EventData, - ActivityLogsListNextOptionalParams, - ActivityLogsListOptionalParams, - ActivityLogsListResponse, - ActivityLogsListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing ActivityLogs operations. */ -export class ActivityLogsImpl implements ActivityLogs { - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class ActivityLogs class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - this.client = client; - } - - /** - * Provides the list of records from the activity logs. - * @param filter Reduces the set of data collected.
This argument is required and it also requires - * at least the start date/time.
The **$filter** argument is very restricted and allows only the - * following patterns.
- *List events for a resource group*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and - * resourceGroupName eq 'resourceGroupName'.
- *List events for resource*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri - * eq 'resourceURI'.
- *List events for a subscription in a time range*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'.
- *List - * events for a resource provider*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and - * eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceProvider eq - * 'resourceProviderName'.
- *List events for a correlation Id*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and - * correlationId eq 'correlationID'.

**NOTE**: No other syntax is allowed. - * @param options The options parameters. - */ - public list( - filter: string, - options?: ActivityLogsListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(filter, 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.listPagingPage(filter, options, settings); - }, - }; - } - - private async *listPagingPage( - filter: string, - options?: ActivityLogsListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: ActivityLogsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(filter, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - filter: string, - options?: ActivityLogsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(filter, options)) { - yield* page; - } - } - - /** - * Provides the list of records from the activity logs. - * @param filter Reduces the set of data collected.
This argument is required and it also requires - * at least the start date/time.
The **$filter** argument is very restricted and allows only the - * following patterns.
- *List events for a resource group*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and - * resourceGroupName eq 'resourceGroupName'.
- *List events for resource*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri - * eq 'resourceURI'.
- *List events for a subscription in a time range*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'.
- *List - * events for a resource provider*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and - * eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceProvider eq - * 'resourceProviderName'.
- *List events for a correlation Id*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and - * correlationId eq 'correlationID'.

**NOTE**: No other syntax is allowed. - * @param options The options parameters. - */ - private _list( - filter: string, - options?: ActivityLogsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { filter, options }, - listOperationSpec, - ); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: ActivityLogsListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/eventtypes/management/values", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.EventDataCollection, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [ - Parameters.apiVersion3, - Parameters.filter1, - Parameters.select, - ], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.EventDataCollection, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/monitor/arm-monitor/src/operations/alertRuleIncidents.ts b/sdk/monitor/arm-monitor/src/operations/alertRuleIncidents.ts deleted file mode 100644 index 8d55f0e5671e..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/alertRuleIncidents.ts +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { AlertRuleIncidents } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - Incident, - AlertRuleIncidentsListByAlertRuleOptionalParams, - AlertRuleIncidentsListByAlertRuleResponse, - AlertRuleIncidentsGetOptionalParams, - AlertRuleIncidentsGetResponse, -} from "../models/index.js"; - -/// -/** Class containing AlertRuleIncidents operations. */ -export class AlertRuleIncidentsImpl implements AlertRuleIncidents { - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class AlertRuleIncidents class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - this.client = client; - } - - /** - * Gets a list of incidents associated to an alert rule - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ruleName The name of the rule. - * @param options The options parameters. - */ - public listByAlertRule( - resourceGroupName: string, - ruleName: string, - options?: AlertRuleIncidentsListByAlertRuleOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByAlertRulePagingAll( - resourceGroupName, - ruleName, - 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.listByAlertRulePagingPage( - resourceGroupName, - ruleName, - options, - settings, - ); - }, - }; - } - - private async *listByAlertRulePagingPage( - resourceGroupName: string, - ruleName: string, - options?: AlertRuleIncidentsListByAlertRuleOptionalParams, - _settings?: PageSettings, - ): AsyncIterableIterator { - let result: AlertRuleIncidentsListByAlertRuleResponse; - result = await this._listByAlertRule(resourceGroupName, ruleName, options); - yield result.value || []; - } - - private async *listByAlertRulePagingAll( - resourceGroupName: string, - ruleName: string, - options?: AlertRuleIncidentsListByAlertRuleOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByAlertRulePagingPage( - resourceGroupName, - ruleName, - options, - )) { - yield* page; - } - } - - /** - * Gets an incident associated to an alert rule - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ruleName The name of the rule. - * @param incidentName The name of the incident to retrieve. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - ruleName: string, - incidentName: string, - options?: AlertRuleIncidentsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, ruleName, incidentName, options }, - getOperationSpec, - ); - } - - /** - * Gets a list of incidents associated to an alert rule - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ruleName The name of the rule. - * @param options The options parameters. - */ - private _listByAlertRule( - resourceGroupName: string, - ruleName: string, - options?: AlertRuleIncidentsListByAlertRuleOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, ruleName, options }, - listByAlertRuleOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}/incidents/{incidentName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.Incident, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.ruleName, - Parameters.incidentName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByAlertRuleOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}/incidents", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.IncidentListResult, - }, - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.ruleName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/monitor/arm-monitor/src/operations/alertRules.ts b/sdk/monitor/arm-monitor/src/operations/alertRules.ts deleted file mode 100644 index 8edf4273fc63..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/alertRules.ts +++ /dev/null @@ -1,369 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { AlertRules } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - AlertRuleResource, - AlertRulesListByResourceGroupOptionalParams, - AlertRulesListByResourceGroupResponse, - AlertRulesListBySubscriptionOptionalParams, - AlertRulesListBySubscriptionResponse, - AlertRulesCreateOrUpdateOptionalParams, - AlertRulesCreateOrUpdateResponse, - AlertRulesDeleteOptionalParams, - AlertRulesGetOptionalParams, - AlertRulesGetResponse, - AlertRuleResourcePatch, - AlertRulesUpdateOptionalParams, - AlertRulesUpdateResponse, -} from "../models/index.js"; - -/// -/** Class containing AlertRules operations. */ -export class AlertRulesImpl implements AlertRules { - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class AlertRules class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - this.client = client; - } - - /** - * List the classic metric alert rules within a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: AlertRulesListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, 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.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings, - ); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: AlertRulesListByResourceGroupOptionalParams, - _settings?: PageSettings, - ): AsyncIterableIterator { - let result: AlertRulesListByResourceGroupResponse; - result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: AlertRulesListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage( - resourceGroupName, - options, - )) { - yield* page; - } - } - - /** - * List the classic metric alert rules within a subscription. - * @param options The options parameters. - */ - public listBySubscription( - options?: AlertRulesListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listBySubscriptionPagingAll(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.listBySubscriptionPagingPage(options, settings); - }, - }; - } - - private async *listBySubscriptionPagingPage( - options?: AlertRulesListBySubscriptionOptionalParams, - _settings?: PageSettings, - ): AsyncIterableIterator { - let result: AlertRulesListBySubscriptionResponse; - result = await this._listBySubscription(options); - yield result.value || []; - } - - private async *listBySubscriptionPagingAll( - options?: AlertRulesListBySubscriptionOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listBySubscriptionPagingPage(options)) { - yield* page; - } - } - - /** - * Creates or updates a classic metric alert rule. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @param options The options parameters. - */ - createOrUpdate( - resourceGroupName: string, - ruleName: string, - parameters: AlertRuleResource, - options?: AlertRulesCreateOrUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, ruleName, parameters, options }, - createOrUpdateOperationSpec, - ); - } - - /** - * Deletes a classic metric alert rule - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ruleName The name of the rule. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - ruleName: string, - options?: AlertRulesDeleteOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, ruleName, options }, - deleteOperationSpec, - ); - } - - /** - * Gets a classic metric alert rule - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ruleName The name of the rule. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - ruleName: string, - options?: AlertRulesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, ruleName, options }, - getOperationSpec, - ); - } - - /** - * Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate - * method. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ruleName The name of the rule. - * @param alertRulesResource Parameters supplied to the operation. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - ruleName: string, - alertRulesResource: AlertRuleResourcePatch, - options?: AlertRulesUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, ruleName, alertRulesResource, options }, - updateOperationSpec, - ); - } - - /** - * List the classic metric alert rules within a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: AlertRulesListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * List the classic metric alert rules within a subscription. - * @param options The options parameters. - */ - private _listBySubscription( - options?: AlertRulesListBySubscriptionOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { options }, - listBySubscriptionOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.AlertRuleResource, - }, - 201: { - bodyMapper: Mappers.AlertRuleResource, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters1, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.ruleName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.ruleName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AlertRuleResource, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.ruleName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.AlertRuleResource, - }, - 201: { - bodyMapper: Mappers.AlertRuleResource, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.alertRulesResource, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.ruleName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AlertRuleResourceCollection, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/alertrules", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AlertRuleResourceCollection, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion4], - 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 deleted file mode 100644 index 0a8228651256..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/autoscaleSettings.ts +++ /dev/null @@ -1,476 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { setContinuationToken } from "../pagingHelper.js"; -import { AutoscaleSettings } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - AutoscaleSettingResource, - AutoscaleSettingsListByResourceGroupNextOptionalParams, - AutoscaleSettingsListByResourceGroupOptionalParams, - AutoscaleSettingsListByResourceGroupResponse, - AutoscaleSettingsListBySubscriptionNextOptionalParams, - AutoscaleSettingsListBySubscriptionOptionalParams, - AutoscaleSettingsListBySubscriptionResponse, - AutoscaleSettingsCreateOrUpdateOptionalParams, - AutoscaleSettingsCreateOrUpdateResponse, - AutoscaleSettingsDeleteOptionalParams, - AutoscaleSettingsGetOptionalParams, - AutoscaleSettingsGetResponse, - AutoscaleSettingResourcePatch, - AutoscaleSettingsUpdateOptionalParams, - AutoscaleSettingsUpdateResponse, - AutoscaleSettingsListByResourceGroupNextResponse, - AutoscaleSettingsListBySubscriptionNextResponse, -} from "../models/index.js"; - -/// -/** Class containing AutoscaleSettings operations. */ -export class AutoscaleSettingsImpl implements AutoscaleSettings { - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class AutoscaleSettings class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - this.client = client; - } - - /** - * Lists the autoscale settings for a resource group - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: AutoscaleSettingsListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, 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.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings, - ); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: AutoscaleSettingsListByResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: AutoscaleSettingsListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext( - resourceGroupName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: AutoscaleSettingsListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage( - resourceGroupName, - options, - )) { - yield* page; - } - } - - /** - * Lists the autoscale settings for a subscription - * @param options The options parameters. - */ - public listBySubscription( - options?: AutoscaleSettingsListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listBySubscriptionPagingAll(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.listBySubscriptionPagingPage(options, settings); - }, - }; - } - - private async *listBySubscriptionPagingPage( - options?: AutoscaleSettingsListBySubscriptionOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: AutoscaleSettingsListBySubscriptionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listBySubscription(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listBySubscriptionNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listBySubscriptionPagingAll( - options?: AutoscaleSettingsListBySubscriptionOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listBySubscriptionPagingPage(options)) { - yield* page; - } - } - - /** - * Lists the autoscale settings for a resource group - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: AutoscaleSettingsListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * Creates or updates an autoscale setting. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param autoscaleSettingName The autoscale setting name. - * @param parameters Parameters supplied to the operation. - * @param options The options parameters. - */ - createOrUpdate( - resourceGroupName: string, - autoscaleSettingName: string, - parameters: AutoscaleSettingResource, - options?: AutoscaleSettingsCreateOrUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, autoscaleSettingName, parameters, options }, - createOrUpdateOperationSpec, - ); - } - - /** - * Deletes and autoscale setting - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param autoscaleSettingName The autoscale setting name. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - autoscaleSettingName: string, - options?: AutoscaleSettingsDeleteOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, autoscaleSettingName, options }, - deleteOperationSpec, - ); - } - - /** - * Gets an autoscale setting - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param autoscaleSettingName The autoscale setting name. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - autoscaleSettingName: string, - options?: AutoscaleSettingsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, autoscaleSettingName, options }, - getOperationSpec, - ); - } - - /** - * Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param autoscaleSettingName The autoscale setting name. - * @param autoscaleSettingResource Parameters supplied to the operation. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - autoscaleSettingName: string, - autoscaleSettingResource: AutoscaleSettingResourcePatch, - options?: AutoscaleSettingsUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - autoscaleSettingName, - autoscaleSettingResource, - options, - }, - updateOperationSpec, - ); - } - - /** - * Lists the autoscale settings for a subscription - * @param options The options parameters. - */ - private _listBySubscription( - options?: AutoscaleSettingsListBySubscriptionOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { options }, - listBySubscriptionOperationSpec, - ); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: AutoscaleSettingsListByResourceGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec, - ); - } - - /** - * ListBySubscriptionNext - * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. - * @param options The options parameters. - */ - private _listBySubscriptionNext( - nextLink: string, - options?: AutoscaleSettingsListBySubscriptionNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listBySubscriptionNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AutoscaleSettingResourceCollection, - }, - default: { - bodyMapper: Mappers.AutoscaleErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion2], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.AutoscaleSettingResource, - }, - 201: { - bodyMapper: Mappers.AutoscaleSettingResource, - }, - default: { - bodyMapper: Mappers.AutoscaleErrorResponse, - }, - }, - requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion2], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.autoscaleSettingName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.AutoscaleErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion2], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.autoscaleSettingName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AutoscaleSettingResource, - }, - default: { - bodyMapper: Mappers.AutoscaleErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion2], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.autoscaleSettingName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.AutoscaleSettingResource, - }, - default: { - bodyMapper: Mappers.AutoscaleErrorResponse, - }, - }, - requestBody: Parameters.autoscaleSettingResource, - queryParameters: [Parameters.apiVersion2], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.autoscaleSettingName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/autoscalesettings", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AutoscaleSettingResourceCollection, - }, - default: { - bodyMapper: Mappers.AutoscaleErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion2], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AutoscaleSettingResourceCollection, - }, - default: { - bodyMapper: Mappers.AutoscaleErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AutoscaleSettingResourceCollection, - }, - default: { - bodyMapper: Mappers.AutoscaleErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/monitor/arm-monitor/src/operations/azureMonitorWorkspaces.ts b/sdk/monitor/arm-monitor/src/operations/azureMonitorWorkspaces.ts deleted file mode 100644 index 268e0a882013..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/azureMonitorWorkspaces.ts +++ /dev/null @@ -1,569 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { setContinuationToken } from "../pagingHelper.js"; -import { AzureMonitorWorkspaces } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import { - AzureMonitorWorkspaceResource, - AzureMonitorWorkspacesListByResourceGroupNextOptionalParams, - AzureMonitorWorkspacesListByResourceGroupOptionalParams, - AzureMonitorWorkspacesListByResourceGroupResponse, - AzureMonitorWorkspacesListBySubscriptionNextOptionalParams, - AzureMonitorWorkspacesListBySubscriptionOptionalParams, - AzureMonitorWorkspacesListBySubscriptionResponse, - AzureMonitorWorkspacesGetOptionalParams, - AzureMonitorWorkspacesGetResponse, - AzureMonitorWorkspacesCreateOptionalParams, - AzureMonitorWorkspacesCreateResponse, - AzureMonitorWorkspacesUpdateOptionalParams, - AzureMonitorWorkspacesUpdateResponse, - AzureMonitorWorkspacesDeleteOptionalParams, - AzureMonitorWorkspacesDeleteResponse, - AzureMonitorWorkspacesListByResourceGroupNextResponse, - AzureMonitorWorkspacesListBySubscriptionNextResponse, -} from "../models/index.js"; - -/// -/** Class containing AzureMonitorWorkspaces operations. */ -export class AzureMonitorWorkspacesImpl implements AzureMonitorWorkspaces { - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class AzureMonitorWorkspaces class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - this.client = client; - } - - /** - * Lists all Azure Monitor Workspaces in the specified resource group - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: AzureMonitorWorkspacesListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, 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.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings, - ); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: AzureMonitorWorkspacesListByResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: AzureMonitorWorkspacesListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext( - resourceGroupName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: AzureMonitorWorkspacesListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage( - resourceGroupName, - options, - )) { - yield* page; - } - } - - /** - * Lists all Azure Monitor Workspaces in the specified subscription - * @param options The options parameters. - */ - public listBySubscription( - options?: AzureMonitorWorkspacesListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listBySubscriptionPagingAll(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.listBySubscriptionPagingPage(options, settings); - }, - }; - } - - private async *listBySubscriptionPagingPage( - options?: AzureMonitorWorkspacesListBySubscriptionOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: AzureMonitorWorkspacesListBySubscriptionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listBySubscription(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listBySubscriptionNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listBySubscriptionPagingAll( - options?: AzureMonitorWorkspacesListBySubscriptionOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listBySubscriptionPagingPage(options)) { - yield* page; - } - } - - /** - * Lists all Azure Monitor Workspaces in the specified resource group - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: AzureMonitorWorkspacesListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * Lists all Azure Monitor Workspaces in the specified subscription - * @param options The options parameters. - */ - private _listBySubscription( - options?: AzureMonitorWorkspacesListBySubscriptionOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { options }, - listBySubscriptionOperationSpec, - ); - } - - /** - * Returns the specified Azure Monitor 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. - */ - get( - resourceGroupName: string, - azureMonitorWorkspaceName: string, - options?: AzureMonitorWorkspacesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, azureMonitorWorkspaceName, options }, - getOperationSpec, - ); - } - - /** - * Creates or updates an Azure Monitor 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 azureMonitorWorkspaceProperties Properties that need to be specified to create a new Azure - * Monitor Workspace - * @param options The options parameters. - */ - create( - resourceGroupName: string, - azureMonitorWorkspaceName: string, - azureMonitorWorkspaceProperties: AzureMonitorWorkspaceResource, - options?: AzureMonitorWorkspacesCreateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - azureMonitorWorkspaceName, - azureMonitorWorkspaceProperties, - options, - }, - createOperationSpec, - ); - } - - /** - * Updates part of an Azure Monitor 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. - */ - update( - resourceGroupName: string, - azureMonitorWorkspaceName: string, - options?: AzureMonitorWorkspacesUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, azureMonitorWorkspaceName, options }, - updateOperationSpec, - ); - } - - /** - * Deletes an Azure Monitor 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 beginDelete( - resourceGroupName: string, - azureMonitorWorkspaceName: string, - options?: AzureMonitorWorkspacesDeleteOptionalParams, - ): 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; - } - - /** - * Deletes an Azure Monitor 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(); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: AzureMonitorWorkspacesListByResourceGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec, - ); - } - - /** - * ListBySubscriptionNext - * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. - * @param options The options parameters. - */ - private _listBySubscriptionNext( - nextLink: string, - options?: AzureMonitorWorkspacesListBySubscriptionNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listBySubscriptionNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AzureMonitorWorkspaceResourceListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Monitor/accounts", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AzureMonitorWorkspaceResourceListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AzureMonitorWorkspaceResource, - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.azureMonitorWorkspaceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.AzureMonitorWorkspaceResource, - }, - 201: { - bodyMapper: Mappers.AzureMonitorWorkspaceResource, - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2, - }, - }, - requestBody: Parameters.azureMonitorWorkspaceProperties, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.azureMonitorWorkspaceName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.AzureMonitorWorkspaceResource, - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2, - }, - }, - requestBody: Parameters.azureMonitorWorkspaceProperties1, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.azureMonitorWorkspaceName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: Mappers.AzureMonitorWorkspacesDeleteHeaders, - }, - 201: { - headersMapper: Mappers.AzureMonitorWorkspacesDeleteHeaders, - }, - 202: { - headersMapper: Mappers.AzureMonitorWorkspacesDeleteHeaders, - }, - 204: { - headersMapper: Mappers.AzureMonitorWorkspacesDeleteHeaders, - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.azureMonitorWorkspaceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AzureMonitorWorkspaceResourceListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AzureMonitorWorkspaceResourceListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/monitor/arm-monitor/src/operations/baselines.ts b/sdk/monitor/arm-monitor/src/operations/baselines.ts deleted file mode 100644 index d9f5aa2218f3..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/baselines.ts +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { Baselines } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - SingleMetricBaseline, - BaselinesListOptionalParams, - BaselinesListResponse, -} from "../models/index.js"; - -/// -/** Class containing Baselines operations. */ -export class BaselinesImpl implements Baselines { - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class Baselines class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - this.client = client; - } - - /** - * **Lists the metric baseline values for a resource**. - * @param resourceUri The identifier of the resource. - * @param options The options parameters. - */ - public list( - resourceUri: string, - options?: BaselinesListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceUri, 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.listPagingPage(resourceUri, options, settings); - }, - }; - } - - private async *listPagingPage( - resourceUri: string, - options?: BaselinesListOptionalParams, - _settings?: PageSettings, - ): AsyncIterableIterator { - let result: BaselinesListResponse; - result = await this._list(resourceUri, options); - yield result.value || []; - } - - private async *listPagingAll( - resourceUri: string, - options?: BaselinesListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(resourceUri, options)) { - yield* page; - } - } - - /** - * **Lists the metric baseline values for a resource**. - * @param resourceUri The identifier of the resource. - * @param options The options parameters. - */ - private _list( - resourceUri: string, - options?: BaselinesListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, options }, - listOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.Insights/metricBaselines", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.MetricBaselinesResponse, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [ - Parameters.metricnamespace, - Parameters.timespan, - Parameters.metricnames, - Parameters.aggregation, - Parameters.filter, - Parameters.resultType1, - Parameters.interval2, - Parameters.sensitivities, - Parameters.apiVersion8, - ], - urlParameters: [Parameters.$host, Parameters.resourceUri], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/monitor/arm-monitor/src/operations/dataCollectionEndpoints.ts b/sdk/monitor/arm-monitor/src/operations/dataCollectionEndpoints.ts deleted file mode 100644 index 9d77edaff21f..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/dataCollectionEndpoints.ts +++ /dev/null @@ -1,470 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { setContinuationToken } from "../pagingHelper.js"; -import { DataCollectionEndpoints } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - DataCollectionEndpointResource, - DataCollectionEndpointsListByResourceGroupNextOptionalParams, - DataCollectionEndpointsListByResourceGroupOptionalParams, - DataCollectionEndpointsListByResourceGroupResponse, - DataCollectionEndpointsListBySubscriptionNextOptionalParams, - DataCollectionEndpointsListBySubscriptionOptionalParams, - DataCollectionEndpointsListBySubscriptionResponse, - DataCollectionEndpointsGetOptionalParams, - DataCollectionEndpointsGetResponse, - DataCollectionEndpointsCreateOptionalParams, - DataCollectionEndpointsCreateResponse, - DataCollectionEndpointsUpdateOptionalParams, - DataCollectionEndpointsUpdateResponse, - DataCollectionEndpointsDeleteOptionalParams, - DataCollectionEndpointsListByResourceGroupNextResponse, - DataCollectionEndpointsListBySubscriptionNextResponse, -} from "../models/index.js"; - -/// -/** Class containing DataCollectionEndpoints operations. */ -export class DataCollectionEndpointsImpl implements DataCollectionEndpoints { - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class DataCollectionEndpoints class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - this.client = client; - } - - /** - * Lists all data collection endpoints in the specified resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: DataCollectionEndpointsListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, 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.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings, - ); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: DataCollectionEndpointsListByResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DataCollectionEndpointsListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext( - resourceGroupName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: DataCollectionEndpointsListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage( - resourceGroupName, - options, - )) { - yield* page; - } - } - - /** - * Lists all data collection endpoints in the specified subscription - * @param options The options parameters. - */ - public listBySubscription( - options?: DataCollectionEndpointsListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listBySubscriptionPagingAll(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.listBySubscriptionPagingPage(options, settings); - }, - }; - } - - private async *listBySubscriptionPagingPage( - options?: DataCollectionEndpointsListBySubscriptionOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DataCollectionEndpointsListBySubscriptionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listBySubscription(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listBySubscriptionNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listBySubscriptionPagingAll( - options?: DataCollectionEndpointsListBySubscriptionOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listBySubscriptionPagingPage(options)) { - yield* page; - } - } - - /** - * Lists all data collection endpoints in the specified resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: DataCollectionEndpointsListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * Lists all data collection endpoints in the specified subscription - * @param options The options parameters. - */ - private _listBySubscription( - options?: DataCollectionEndpointsListBySubscriptionOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { options }, - listBySubscriptionOperationSpec, - ); - } - - /** - * Returns the specified data collection endpoint. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case - * insensitive. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - dataCollectionEndpointName: string, - options?: DataCollectionEndpointsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, dataCollectionEndpointName, options }, - getOperationSpec, - ); - } - - /** - * Creates or updates a data collection endpoint. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case - * insensitive. - * @param options The options parameters. - */ - create( - resourceGroupName: string, - dataCollectionEndpointName: string, - options?: DataCollectionEndpointsCreateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, dataCollectionEndpointName, options }, - createOperationSpec, - ); - } - - /** - * Updates part of a data collection endpoint. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case - * insensitive. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - dataCollectionEndpointName: string, - options?: DataCollectionEndpointsUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, dataCollectionEndpointName, options }, - updateOperationSpec, - ); - } - - /** - * Deletes a data collection endpoint. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case - * insensitive. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - dataCollectionEndpointName: string, - options?: DataCollectionEndpointsDeleteOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, dataCollectionEndpointName, options }, - deleteOperationSpec, - ); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: DataCollectionEndpointsListByResourceGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec, - ); - } - - /** - * ListBySubscriptionNext - * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. - * @param options The options parameters. - */ - private _listBySubscriptionNext( - nextLink: string, - options?: DataCollectionEndpointsListBySubscriptionNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listBySubscriptionNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionEndpoints", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DataCollectionEndpointResourceListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponseCommonV2, - }, - }, - queryParameters: [Parameters.apiVersion14], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/dataCollectionEndpoints", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DataCollectionEndpointResourceListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponseCommonV2, - }, - }, - queryParameters: [Parameters.apiVersion14], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionEndpoints/{dataCollectionEndpointName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DataCollectionEndpointResource, - }, - default: { - bodyMapper: Mappers.ErrorResponseCommonV2, - }, - }, - queryParameters: [Parameters.apiVersion14], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.dataCollectionEndpointName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionEndpoints/{dataCollectionEndpointName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.DataCollectionEndpointResource, - }, - 201: { - bodyMapper: Mappers.DataCollectionEndpointResource, - }, - default: { - bodyMapper: Mappers.ErrorResponseCommonV2, - }, - }, - requestBody: Parameters.body1, - queryParameters: [Parameters.apiVersion14], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.dataCollectionEndpointName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionEndpoints/{dataCollectionEndpointName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.DataCollectionEndpointResource, - }, - default: { - bodyMapper: Mappers.ErrorResponseCommonV2, - }, - }, - requestBody: Parameters.body2, - queryParameters: [Parameters.apiVersion14], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.dataCollectionEndpointName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionEndpoints/{dataCollectionEndpointName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponseCommonV2, - }, - }, - queryParameters: [Parameters.apiVersion14], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.dataCollectionEndpointName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DataCollectionEndpointResourceListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponseCommonV2, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DataCollectionEndpointResourceListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponseCommonV2, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/monitor/arm-monitor/src/operations/dataCollectionRuleAssociations.ts b/sdk/monitor/arm-monitor/src/operations/dataCollectionRuleAssociations.ts deleted file mode 100644 index 5c6f19cd77cf..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/dataCollectionRuleAssociations.ts +++ /dev/null @@ -1,636 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { setContinuationToken } from "../pagingHelper.js"; -import { DataCollectionRuleAssociations } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - DataCollectionRuleAssociationProxyOnlyResource, - DataCollectionRuleAssociationsListByResourceNextOptionalParams, - DataCollectionRuleAssociationsListByResourceOptionalParams, - DataCollectionRuleAssociationsListByResourceResponse, - DataCollectionRuleAssociationsListByRuleNextOptionalParams, - DataCollectionRuleAssociationsListByRuleOptionalParams, - DataCollectionRuleAssociationsListByRuleResponse, - DataCollectionRuleAssociationsListByDataCollectionEndpointNextOptionalParams, - DataCollectionRuleAssociationsListByDataCollectionEndpointOptionalParams, - DataCollectionRuleAssociationsListByDataCollectionEndpointResponse, - DataCollectionRuleAssociationsGetOptionalParams, - DataCollectionRuleAssociationsGetResponse, - DataCollectionRuleAssociationsCreateOptionalParams, - DataCollectionRuleAssociationsCreateResponse, - DataCollectionRuleAssociationsDeleteOptionalParams, - DataCollectionRuleAssociationsListByResourceNextResponse, - DataCollectionRuleAssociationsListByRuleNextResponse, - DataCollectionRuleAssociationsListByDataCollectionEndpointNextResponse, -} from "../models/index.js"; - -/// -/** Class containing DataCollectionRuleAssociations operations. */ -export class DataCollectionRuleAssociationsImpl - implements DataCollectionRuleAssociations -{ - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class DataCollectionRuleAssociations class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - this.client = client; - } - - /** - * Lists associations for the specified resource. - * @param resourceUri The identifier of the resource. - * @param options The options parameters. - */ - public listByResource( - resourceUri: string, - options?: DataCollectionRuleAssociationsListByResourceOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourcePagingAll(resourceUri, 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.listByResourcePagingPage(resourceUri, options, settings); - }, - }; - } - - private async *listByResourcePagingPage( - resourceUri: string, - options?: DataCollectionRuleAssociationsListByResourceOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DataCollectionRuleAssociationsListByResourceResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResource(resourceUri, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceNext( - resourceUri, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourcePagingAll( - resourceUri: string, - options?: DataCollectionRuleAssociationsListByResourceOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourcePagingPage( - resourceUri, - options, - )) { - yield* page; - } - } - - /** - * Lists associations for the specified data collection rule. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param options The options parameters. - */ - public listByRule( - resourceGroupName: string, - dataCollectionRuleName: string, - options?: DataCollectionRuleAssociationsListByRuleOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByRulePagingAll( - resourceGroupName, - dataCollectionRuleName, - 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.listByRulePagingPage( - resourceGroupName, - dataCollectionRuleName, - options, - settings, - ); - }, - }; - } - - private async *listByRulePagingPage( - resourceGroupName: string, - dataCollectionRuleName: string, - options?: DataCollectionRuleAssociationsListByRuleOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DataCollectionRuleAssociationsListByRuleResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByRule( - resourceGroupName, - dataCollectionRuleName, - options, - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByRuleNext( - resourceGroupName, - dataCollectionRuleName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByRulePagingAll( - resourceGroupName: string, - dataCollectionRuleName: string, - options?: DataCollectionRuleAssociationsListByRuleOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByRulePagingPage( - resourceGroupName, - dataCollectionRuleName, - options, - )) { - yield* page; - } - } - - /** - * Lists associations for the specified data collection endpoint. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case - * insensitive. - * @param options The options parameters. - */ - public listByDataCollectionEndpoint( - resourceGroupName: string, - dataCollectionEndpointName: string, - options?: DataCollectionRuleAssociationsListByDataCollectionEndpointOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByDataCollectionEndpointPagingAll( - resourceGroupName, - dataCollectionEndpointName, - 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.listByDataCollectionEndpointPagingPage( - resourceGroupName, - dataCollectionEndpointName, - options, - settings, - ); - }, - }; - } - - private async *listByDataCollectionEndpointPagingPage( - resourceGroupName: string, - dataCollectionEndpointName: string, - options?: DataCollectionRuleAssociationsListByDataCollectionEndpointOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DataCollectionRuleAssociationsListByDataCollectionEndpointResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByDataCollectionEndpoint( - resourceGroupName, - dataCollectionEndpointName, - options, - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByDataCollectionEndpointNext( - resourceGroupName, - dataCollectionEndpointName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByDataCollectionEndpointPagingAll( - resourceGroupName: string, - dataCollectionEndpointName: string, - options?: DataCollectionRuleAssociationsListByDataCollectionEndpointOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByDataCollectionEndpointPagingPage( - resourceGroupName, - dataCollectionEndpointName, - options, - )) { - yield* page; - } - } - - /** - * Lists associations for the specified resource. - * @param resourceUri The identifier of the resource. - * @param options The options parameters. - */ - private _listByResource( - resourceUri: string, - options?: DataCollectionRuleAssociationsListByResourceOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, options }, - listByResourceOperationSpec, - ); - } - - /** - * Lists associations for the specified data collection rule. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param options The options parameters. - */ - private _listByRule( - resourceGroupName: string, - dataCollectionRuleName: string, - options?: DataCollectionRuleAssociationsListByRuleOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, dataCollectionRuleName, options }, - listByRuleOperationSpec, - ); - } - - /** - * Lists associations for the specified data collection endpoint. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case - * insensitive. - * @param options The options parameters. - */ - private _listByDataCollectionEndpoint( - resourceGroupName: string, - dataCollectionEndpointName: string, - options?: DataCollectionRuleAssociationsListByDataCollectionEndpointOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, dataCollectionEndpointName, options }, - listByDataCollectionEndpointOperationSpec, - ); - } - - /** - * Returns the specified association. - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @param options The options parameters. - */ - get( - resourceUri: string, - associationName: string, - options?: DataCollectionRuleAssociationsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, associationName, options }, - getOperationSpec, - ); - } - - /** - * Creates or updates an association. - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @param options The options parameters. - */ - create( - resourceUri: string, - associationName: string, - options?: DataCollectionRuleAssociationsCreateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, associationName, options }, - createOperationSpec, - ); - } - - /** - * Deletes an association. - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @param options The options parameters. - */ - delete( - resourceUri: string, - associationName: string, - options?: DataCollectionRuleAssociationsDeleteOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, associationName, options }, - deleteOperationSpec, - ); - } - - /** - * ListByResourceNext - * @param resourceUri The identifier of the resource. - * @param nextLink The nextLink from the previous successful call to the ListByResource method. - * @param options The options parameters. - */ - private _listByResourceNext( - resourceUri: string, - nextLink: string, - options?: DataCollectionRuleAssociationsListByResourceNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, nextLink, options }, - listByResourceNextOperationSpec, - ); - } - - /** - * ListByRuleNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByRule method. - * @param options The options parameters. - */ - private _listByRuleNext( - resourceGroupName: string, - dataCollectionRuleName: string, - nextLink: string, - options?: DataCollectionRuleAssociationsListByRuleNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, dataCollectionRuleName, nextLink, options }, - listByRuleNextOperationSpec, - ); - } - - /** - * ListByDataCollectionEndpointNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case - * insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByDataCollectionEndpoint - * method. - * @param options The options parameters. - */ - private _listByDataCollectionEndpointNext( - resourceGroupName: string, - dataCollectionEndpointName: string, - nextLink: string, - options?: DataCollectionRuleAssociationsListByDataCollectionEndpointNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, dataCollectionEndpointName, nextLink, options }, - listByDataCollectionEndpointNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByResourceOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: - Mappers.DataCollectionRuleAssociationProxyOnlyResourceListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponseCommonV2, - }, - }, - queryParameters: [Parameters.apiVersion14], - urlParameters: [Parameters.$host, Parameters.resourceUri1], - headerParameters: [Parameters.accept], - serializer, -}; -const listByRuleOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}/associations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: - Mappers.DataCollectionRuleAssociationProxyOnlyResourceListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponseCommonV2, - }, - }, - queryParameters: [Parameters.apiVersion14], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.dataCollectionRuleName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByDataCollectionEndpointOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionEndpoints/{dataCollectionEndpointName}/associations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: - Mappers.DataCollectionRuleAssociationProxyOnlyResourceListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponseCommonV2, - }, - }, - queryParameters: [Parameters.apiVersion14], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.dataCollectionEndpointName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DataCollectionRuleAssociationProxyOnlyResource, - }, - default: { - bodyMapper: Mappers.ErrorResponseCommonV2, - }, - }, - queryParameters: [Parameters.apiVersion14], - urlParameters: [ - Parameters.$host, - Parameters.resourceUri1, - Parameters.associationName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.DataCollectionRuleAssociationProxyOnlyResource, - }, - 201: { - bodyMapper: Mappers.DataCollectionRuleAssociationProxyOnlyResource, - }, - default: { - bodyMapper: Mappers.ErrorResponseCommonV2, - }, - }, - requestBody: Parameters.body3, - queryParameters: [Parameters.apiVersion14], - urlParameters: [ - Parameters.$host, - Parameters.resourceUri1, - Parameters.associationName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponseCommonV2, - }, - }, - queryParameters: [Parameters.apiVersion14], - urlParameters: [ - Parameters.$host, - Parameters.resourceUri1, - Parameters.associationName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: - Mappers.DataCollectionRuleAssociationProxyOnlyResourceListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponseCommonV2, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.resourceUri1, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByRuleNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: - Mappers.DataCollectionRuleAssociationProxyOnlyResourceListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponseCommonV2, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.nextLink, - Parameters.dataCollectionRuleName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByDataCollectionEndpointNextOperationSpec: coreClient.OperationSpec = - { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: - Mappers.DataCollectionRuleAssociationProxyOnlyResourceListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponseCommonV2, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.nextLink, - Parameters.dataCollectionEndpointName, - ], - headerParameters: [Parameters.accept], - serializer, - }; diff --git a/sdk/monitor/arm-monitor/src/operations/dataCollectionRules.ts b/sdk/monitor/arm-monitor/src/operations/dataCollectionRules.ts deleted file mode 100644 index 728a2112132a..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/dataCollectionRules.ts +++ /dev/null @@ -1,466 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { setContinuationToken } from "../pagingHelper.js"; -import { DataCollectionRules } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - DataCollectionRuleResource, - DataCollectionRulesListByResourceGroupNextOptionalParams, - DataCollectionRulesListByResourceGroupOptionalParams, - DataCollectionRulesListByResourceGroupResponse, - DataCollectionRulesListBySubscriptionNextOptionalParams, - DataCollectionRulesListBySubscriptionOptionalParams, - DataCollectionRulesListBySubscriptionResponse, - DataCollectionRulesGetOptionalParams, - DataCollectionRulesGetResponse, - DataCollectionRulesCreateOptionalParams, - DataCollectionRulesCreateResponse, - DataCollectionRulesUpdateOptionalParams, - DataCollectionRulesUpdateResponse, - DataCollectionRulesDeleteOptionalParams, - DataCollectionRulesListByResourceGroupNextResponse, - DataCollectionRulesListBySubscriptionNextResponse, -} from "../models/index.js"; - -/// -/** Class containing DataCollectionRules operations. */ -export class DataCollectionRulesImpl implements DataCollectionRules { - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class DataCollectionRules class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - this.client = client; - } - - /** - * Lists all data collection rules in the specified resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: DataCollectionRulesListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, 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.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings, - ); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: DataCollectionRulesListByResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DataCollectionRulesListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext( - resourceGroupName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: DataCollectionRulesListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage( - resourceGroupName, - options, - )) { - yield* page; - } - } - - /** - * Lists all data collection rules in the specified subscription. - * @param options The options parameters. - */ - public listBySubscription( - options?: DataCollectionRulesListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listBySubscriptionPagingAll(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.listBySubscriptionPagingPage(options, settings); - }, - }; - } - - private async *listBySubscriptionPagingPage( - options?: DataCollectionRulesListBySubscriptionOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DataCollectionRulesListBySubscriptionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listBySubscription(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listBySubscriptionNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listBySubscriptionPagingAll( - options?: DataCollectionRulesListBySubscriptionOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listBySubscriptionPagingPage(options)) { - yield* page; - } - } - - /** - * Lists all data collection rules in the specified resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: DataCollectionRulesListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * Lists all data collection rules in the specified subscription. - * @param options The options parameters. - */ - private _listBySubscription( - options?: DataCollectionRulesListBySubscriptionOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { options }, - listBySubscriptionOperationSpec, - ); - } - - /** - * Returns the specified data collection rule. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - dataCollectionRuleName: string, - options?: DataCollectionRulesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, dataCollectionRuleName, options }, - getOperationSpec, - ); - } - - /** - * Creates or updates a data collection rule. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param options The options parameters. - */ - create( - resourceGroupName: string, - dataCollectionRuleName: string, - options?: DataCollectionRulesCreateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, dataCollectionRuleName, options }, - createOperationSpec, - ); - } - - /** - * Updates part of a data collection rule. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - dataCollectionRuleName: string, - options?: DataCollectionRulesUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, dataCollectionRuleName, options }, - updateOperationSpec, - ); - } - - /** - * Deletes a data collection rule. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - dataCollectionRuleName: string, - options?: DataCollectionRulesDeleteOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, dataCollectionRuleName, options }, - deleteOperationSpec, - ); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: DataCollectionRulesListByResourceGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec, - ); - } - - /** - * ListBySubscriptionNext - * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. - * @param options The options parameters. - */ - private _listBySubscriptionNext( - nextLink: string, - options?: DataCollectionRulesListBySubscriptionNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listBySubscriptionNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DataCollectionRuleResourceListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponseCommonV2, - }, - }, - queryParameters: [Parameters.apiVersion14], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/dataCollectionRules", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DataCollectionRuleResourceListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponseCommonV2, - }, - }, - queryParameters: [Parameters.apiVersion14], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DataCollectionRuleResource, - }, - default: { - bodyMapper: Mappers.ErrorResponseCommonV2, - }, - }, - queryParameters: [Parameters.apiVersion14], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.dataCollectionRuleName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.DataCollectionRuleResource, - }, - 201: { - bodyMapper: Mappers.DataCollectionRuleResource, - }, - default: { - bodyMapper: Mappers.ErrorResponseCommonV2, - }, - }, - requestBody: Parameters.body4, - queryParameters: [Parameters.apiVersion14], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.dataCollectionRuleName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.DataCollectionRuleResource, - }, - default: { - bodyMapper: Mappers.ErrorResponseCommonV2, - }, - }, - requestBody: Parameters.body2, - queryParameters: [Parameters.apiVersion14], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.dataCollectionRuleName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponseCommonV2, - }, - }, - queryParameters: [Parameters.apiVersion14], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.dataCollectionRuleName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DataCollectionRuleResourceListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponseCommonV2, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DataCollectionRuleResourceListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponseCommonV2, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/monitor/arm-monitor/src/operations/diagnosticSettings.ts b/sdk/monitor/arm-monitor/src/operations/diagnosticSettings.ts deleted file mode 100644 index 527e40aa7497..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/diagnosticSettings.ts +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { DiagnosticSettings } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - DiagnosticSettingsResource, - DiagnosticSettingsListOptionalParams, - DiagnosticSettingsListResponse, - DiagnosticSettingsGetOptionalParams, - DiagnosticSettingsGetResponse, - DiagnosticSettingsCreateOrUpdateOptionalParams, - DiagnosticSettingsCreateOrUpdateResponse, - DiagnosticSettingsDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Class containing DiagnosticSettings operations. */ -export class DiagnosticSettingsImpl implements DiagnosticSettings { - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class DiagnosticSettings class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - this.client = client; - } - - /** - * Gets the active diagnostic settings list for the specified resource. - * @param resourceUri The identifier of the resource. - * @param options The options parameters. - */ - public list( - resourceUri: string, - options?: DiagnosticSettingsListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceUri, 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.listPagingPage(resourceUri, options, settings); - }, - }; - } - - private async *listPagingPage( - resourceUri: string, - options?: DiagnosticSettingsListOptionalParams, - _settings?: PageSettings, - ): AsyncIterableIterator { - let result: DiagnosticSettingsListResponse; - result = await this._list(resourceUri, options); - yield result.value || []; - } - - private async *listPagingAll( - resourceUri: string, - options?: DiagnosticSettingsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(resourceUri, options)) { - yield* page; - } - } - - /** - * Gets the active diagnostic settings for the specified resource. - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param options The options parameters. - */ - get( - resourceUri: string, - name: string, - options?: DiagnosticSettingsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, name, options }, - getOperationSpec, - ); - } - - /** - * Creates or updates diagnostic settings for the specified resource. - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param parameters Parameters supplied to the operation. - * @param options The options parameters. - */ - createOrUpdate( - resourceUri: string, - name: string, - parameters: DiagnosticSettingsResource, - options?: DiagnosticSettingsCreateOrUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, name, parameters, options }, - createOrUpdateOperationSpec, - ); - } - - /** - * Deletes existing diagnostic settings for the specified resource. - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param options The options parameters. - */ - delete( - resourceUri: string, - name: string, - options?: DiagnosticSettingsDeleteOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, name, options }, - deleteOperationSpec, - ); - } - - /** - * Gets the active diagnostic settings list for the specified resource. - * @param resourceUri The identifier of the resource. - * @param options The options parameters. - */ - private _list( - resourceUri: string, - options?: DiagnosticSettingsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, options }, - listOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DiagnosticSettingsResource, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion5], - urlParameters: [Parameters.$host, Parameters.resourceUri, Parameters.name], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.DiagnosticSettingsResource, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters3, - queryParameters: [Parameters.apiVersion5], - urlParameters: [Parameters.$host, Parameters.resourceUri, Parameters.name], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion5], - urlParameters: [Parameters.$host, Parameters.resourceUri, Parameters.name], - headerParameters: [Parameters.accept], - serializer, -}; -const listOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DiagnosticSettingsResourceCollection, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion5], - 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 deleted file mode 100644 index c1454d5f8187..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/diagnosticSettingsCategory.ts +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { DiagnosticSettingsCategory } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - DiagnosticSettingsCategoryResource, - DiagnosticSettingsCategoryListOptionalParams, - DiagnosticSettingsCategoryListResponse, - DiagnosticSettingsCategoryGetOptionalParams, - DiagnosticSettingsCategoryGetResponse, -} from "../models/index.js"; - -/// -/** Class containing DiagnosticSettingsCategory operations. */ -export class DiagnosticSettingsCategoryImpl - implements DiagnosticSettingsCategory -{ - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class DiagnosticSettingsCategory class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - this.client = client; - } - - /** - * Lists the diagnostic settings categories for the specified resource. - * @param resourceUri The identifier of the resource. - * @param options The options parameters. - */ - public list( - resourceUri: string, - options?: DiagnosticSettingsCategoryListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceUri, 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.listPagingPage(resourceUri, options, settings); - }, - }; - } - - private async *listPagingPage( - resourceUri: string, - options?: DiagnosticSettingsCategoryListOptionalParams, - _settings?: PageSettings, - ): AsyncIterableIterator { - let result: DiagnosticSettingsCategoryListResponse; - result = await this._list(resourceUri, options); - yield result.value || []; - } - - private async *listPagingAll( - resourceUri: string, - options?: DiagnosticSettingsCategoryListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(resourceUri, options)) { - yield* page; - } - } - - /** - * Gets the diagnostic settings category for the specified resource. - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param options The options parameters. - */ - get( - resourceUri: string, - name: string, - options?: DiagnosticSettingsCategoryGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, name, options }, - getOperationSpec, - ); - } - - /** - * Lists the diagnostic settings categories for the specified resource. - * @param resourceUri The identifier of the resource. - * @param options The options parameters. - */ - private _list( - resourceUri: string, - options?: DiagnosticSettingsCategoryListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, options }, - listOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettingsCategories/{name}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DiagnosticSettingsCategoryResource, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion5], - urlParameters: [Parameters.$host, Parameters.resourceUri, Parameters.name], - headerParameters: [Parameters.accept], - serializer, -}; -const listOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettingsCategories", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DiagnosticSettingsCategoryResourceCollection, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion5], - 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 deleted file mode 100644 index 05a809fd3ed2..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/eventCategories.ts +++ /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. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { EventCategories } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - LocalizableStringAutoGenerated, - EventCategoriesListOptionalParams, - EventCategoriesListResponse, -} from "../models/index.js"; - -/// -/** Class containing EventCategories operations. */ -export class EventCategoriesImpl implements EventCategories { - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class EventCategories class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - this.client = client; - } - - /** - * 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. - * @param options The options parameters. - */ - public list( - options?: EventCategoriesListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(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.listPagingPage(options, settings); - }, - }; - } - - private async *listPagingPage( - options?: EventCategoriesListOptionalParams, - _settings?: PageSettings, - ): AsyncIterableIterator { - let result: EventCategoriesListResponse; - result = await this._list(options); - yield result.value || []; - } - - private async *listPagingAll( - options?: EventCategoriesListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * 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. - * @param options The options parameters. - */ - private _list( - options?: EventCategoriesListOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Insights/eventcategories", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.EventCategoryCollection, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion3], - 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 150ce9b37e37..7db126d853b8 100644 --- a/sdk/monitor/arm-monitor/src/operations/index.ts +++ b/sdk/monitor/arm-monitor/src/operations/index.ts @@ -6,35 +6,5 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export * from "./metricNamespaces.js"; -export * from "./metricDefinitions.js"; -export * from "./metricsOperations.js"; -export * from "./azureMonitorWorkspaces.js"; -export * from "./monitorOperations.js"; -export * from "./autoscaleSettings.js"; -export * from "./predictiveMetric.js"; -export * from "./operations.js"; -export * from "./alertRuleIncidents.js"; -export * from "./alertRules.js"; -export * from "./logProfiles.js"; -export * from "./diagnosticSettings.js"; -export * from "./diagnosticSettingsCategory.js"; export * from "./actionGroups.js"; -export * from "./tenantActionGroups.js"; -export * from "./activityLogs.js"; -export * from "./eventCategories.js"; -export * from "./tenantActivityLogs.js"; -export * from "./baselines.js"; -export * from "./metricAlerts.js"; -export * from "./metricAlertsStatus.js"; export * from "./scheduledQueryRules.js"; -export * from "./vMInsights.js"; -export * from "./privateLinkScopes.js"; -export * from "./privateLinkScopeOperationStatus.js"; -export * from "./privateLinkResources.js"; -export * from "./privateEndpointConnections.js"; -export * from "./privateLinkScopedResources.js"; -export * from "./activityLogAlerts.js"; -export * from "./dataCollectionEndpoints.js"; -export * from "./dataCollectionRuleAssociations.js"; -export * from "./dataCollectionRules.js"; diff --git a/sdk/monitor/arm-monitor/src/operations/logProfiles.ts b/sdk/monitor/arm-monitor/src/operations/logProfiles.ts deleted file mode 100644 index f8f1dcbebdca..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/logProfiles.ts +++ /dev/null @@ -1,245 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { LogProfiles } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - LogProfileResource, - LogProfilesListOptionalParams, - LogProfilesListResponse, - LogProfilesDeleteOptionalParams, - LogProfilesGetOptionalParams, - LogProfilesGetResponse, - LogProfilesCreateOrUpdateOptionalParams, - LogProfilesCreateOrUpdateResponse, - LogProfileResourcePatch, - LogProfilesUpdateOptionalParams, - LogProfilesUpdateResponse, -} from "../models/index.js"; - -/// -/** Class containing LogProfiles operations. */ -export class LogProfilesImpl implements LogProfiles { - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class LogProfiles class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - this.client = client; - } - - /** - * List the log profiles. - * @param options The options parameters. - */ - public list( - options?: LogProfilesListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(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.listPagingPage(options, settings); - }, - }; - } - - private async *listPagingPage( - options?: LogProfilesListOptionalParams, - _settings?: PageSettings, - ): AsyncIterableIterator { - let result: LogProfilesListResponse; - result = await this._list(options); - yield result.value || []; - } - - private async *listPagingAll( - options?: LogProfilesListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * Deletes the log profile. - * @param logProfileName The name of the log profile. - * @param options The options parameters. - */ - delete( - logProfileName: string, - options?: LogProfilesDeleteOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { logProfileName, options }, - deleteOperationSpec, - ); - } - - /** - * Gets the log profile. - * @param logProfileName The name of the log profile. - * @param options The options parameters. - */ - get( - logProfileName: string, - options?: LogProfilesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { logProfileName, options }, - getOperationSpec, - ); - } - - /** - * Create or update a log profile in Azure Monitoring REST API. - * @param logProfileName The name of the log profile. - * @param parameters Parameters supplied to the operation. - * @param options The options parameters. - */ - createOrUpdate( - logProfileName: string, - parameters: LogProfileResource, - options?: LogProfilesCreateOrUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { logProfileName, parameters, options }, - createOrUpdateOperationSpec, - ); - } - - /** - * Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. - * @param logProfileName The name of the log profile. - * @param logProfilesResource Parameters supplied to the operation. - * @param options The options parameters. - */ - update( - logProfileName: string, - logProfilesResource: LogProfileResourcePatch, - options?: LogProfilesUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { logProfileName, logProfilesResource, options }, - updateOperationSpec, - ); - } - - /** - * List the log profiles. - * @param options The options parameters. - */ - private _list( - options?: LogProfilesListOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName}", - httpMethod: "DELETE", - responses: { 200: {} }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.logProfileName, - ], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.LogProfileResource, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.logProfileName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.LogProfileResource, - }, - }, - requestBody: Parameters.parameters2, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.logProfileName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.LogProfileResource, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.logProfilesResource, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.logProfileName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.LogProfileCollection, - }, - }, - queryParameters: [Parameters.apiVersion4], - 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 deleted file mode 100644 index fb3811323554..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/metricAlerts.ts +++ /dev/null @@ -1,362 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { MetricAlerts } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - MetricAlertResource, - MetricAlertsListBySubscriptionOptionalParams, - MetricAlertsListBySubscriptionResponse, - MetricAlertsListByResourceGroupOptionalParams, - MetricAlertsListByResourceGroupResponse, - MetricAlertsGetOptionalParams, - MetricAlertsGetResponse, - MetricAlertsCreateOrUpdateOptionalParams, - MetricAlertsCreateOrUpdateResponse, - MetricAlertResourcePatch, - MetricAlertsUpdateOptionalParams, - MetricAlertsUpdateResponse, - MetricAlertsDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Class containing MetricAlerts operations. */ -export class MetricAlertsImpl implements MetricAlerts { - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class MetricAlerts class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - this.client = client; - } - - /** - * Retrieve alert rule definitions in a subscription. - * @param options The options parameters. - */ - public listBySubscription( - options?: MetricAlertsListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listBySubscriptionPagingAll(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.listBySubscriptionPagingPage(options, settings); - }, - }; - } - - private async *listBySubscriptionPagingPage( - options?: MetricAlertsListBySubscriptionOptionalParams, - _settings?: PageSettings, - ): AsyncIterableIterator { - let result: MetricAlertsListBySubscriptionResponse; - result = await this._listBySubscription(options); - yield result.value || []; - } - - private async *listBySubscriptionPagingAll( - options?: MetricAlertsListBySubscriptionOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listBySubscriptionPagingPage(options)) { - yield* page; - } - } - - /** - * Retrieve alert rule definitions in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: MetricAlertsListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, 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.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings, - ); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: MetricAlertsListByResourceGroupOptionalParams, - _settings?: PageSettings, - ): AsyncIterableIterator { - let result: MetricAlertsListByResourceGroupResponse; - result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: MetricAlertsListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage( - resourceGroupName, - options, - )) { - yield* page; - } - } - - /** - * Retrieve alert rule definitions in a subscription. - * @param options The options parameters. - */ - private _listBySubscription( - options?: MetricAlertsListBySubscriptionOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { options }, - listBySubscriptionOperationSpec, - ); - } - - /** - * Retrieve alert rule definitions in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: MetricAlertsListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * Retrieve an alert rule definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ruleName The name of the rule. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - ruleName: string, - options?: MetricAlertsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, ruleName, options }, - getOperationSpec, - ); - } - - /** - * Create or update an metric alert definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @param options The options parameters. - */ - createOrUpdate( - resourceGroupName: string, - ruleName: string, - parameters: MetricAlertResource, - options?: MetricAlertsCreateOrUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, ruleName, parameters, options }, - createOrUpdateOperationSpec, - ); - } - - /** - * Update an metric alert definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to update. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - ruleName: string, - parameters: MetricAlertResourcePatch, - options?: MetricAlertsUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, ruleName, parameters, options }, - updateOperationSpec, - ); - } - - /** - * Delete an alert rule definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ruleName The name of the rule. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - ruleName: string, - options?: MetricAlertsDeleteOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, ruleName, options }, - deleteOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metricAlerts", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.MetricAlertResourceCollection, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion9], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.MetricAlertResourceCollection, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion9], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.MetricAlertResource, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion9], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.ruleName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.MetricAlertResource, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters4, - queryParameters: [Parameters.apiVersion9], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.ruleName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.MetricAlertResource, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters5, - queryParameters: [Parameters.apiVersion9], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.ruleName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion9], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.ruleName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/monitor/arm-monitor/src/operations/metricAlertsStatus.ts b/sdk/monitor/arm-monitor/src/operations/metricAlertsStatus.ts deleted file mode 100644 index 066a8c56c3a6..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/metricAlertsStatus.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. - */ - -import { MetricAlertsStatus } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - MetricAlertsStatusListOptionalParams, - MetricAlertsStatusListResponse, - MetricAlertsStatusListByNameOptionalParams, - MetricAlertsStatusListByNameResponse, -} from "../models/index.js"; - -/** Class containing MetricAlertsStatus operations. */ -export class MetricAlertsStatusImpl implements MetricAlertsStatus { - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class MetricAlertsStatus class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - this.client = client; - } - - /** - * Retrieve an alert rule status. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ruleName The name of the rule. - * @param options The options parameters. - */ - list( - resourceGroupName: string, - ruleName: string, - options?: MetricAlertsStatusListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, ruleName, options }, - listOperationSpec, - ); - } - - /** - * Retrieve an alert rule status. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ruleName The name of the rule. - * @param statusName The name of the status. - * @param options The options parameters. - */ - listByName( - resourceGroupName: string, - ruleName: string, - statusName: string, - options?: MetricAlertsStatusListByNameOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, ruleName, statusName, options }, - listByNameOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}/status", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.MetricAlertStatusCollection, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion9], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.ruleName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByNameOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}/status/{statusName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.MetricAlertStatusCollection, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion9], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.ruleName, - Parameters.statusName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/monitor/arm-monitor/src/operations/metricDefinitions.ts b/sdk/monitor/arm-monitor/src/operations/metricDefinitions.ts deleted file mode 100644 index 8b6e9415c551..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/metricDefinitions.ts +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { MetricDefinitions } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - SubscriptionScopeMetricDefinition, - MetricDefinitionsListAtSubscriptionScopeOptionalParams, - MetricDefinitionsListAtSubscriptionScopeResponse, - MetricDefinition, - MetricDefinitionsListOptionalParams, - MetricDefinitionsListResponse, -} from "../models/index.js"; - -/// -/** Class containing MetricDefinitions operations. */ -export class MetricDefinitionsImpl implements MetricDefinitions { - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class MetricDefinitions class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - 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. - * @param options The options parameters. - */ - public list( - resourceUri: string, - options?: MetricDefinitionsListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceUri, 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.listPagingPage(resourceUri, options, settings); - }, - }; - } - - private async *listPagingPage( - resourceUri: string, - options?: MetricDefinitionsListOptionalParams, - _settings?: PageSettings, - ): AsyncIterableIterator { - let result: MetricDefinitionsListResponse; - result = await this._list(resourceUri, options); - yield result.value || []; - } - - private async *listPagingAll( - resourceUri: string, - options?: MetricDefinitionsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(resourceUri, options)) { - yield* page; - } - } - - /** - * 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. - * @param options The options parameters. - */ - private _list( - resourceUri: string, - options?: MetricDefinitionsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, options }, - listOperationSpec, - ); - } -} -// 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.apiVersion, - 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", - responses: { - 200: { - bodyMapper: Mappers.MetricDefinitionCollection, - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated, - }, - }, - queryParameters: [Parameters.apiVersion, 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 deleted file mode 100644 index 83164754f858..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/metricNamespaces.ts +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { MetricNamespaces } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - MetricNamespace, - MetricNamespacesListOptionalParams, - MetricNamespacesListResponse, -} from "../models/index.js"; - -/// -/** Class containing MetricNamespaces operations. */ -export class MetricNamespacesImpl implements MetricNamespaces { - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class MetricNamespaces class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - this.client = client; - } - - /** - * Lists the metric namespaces for the resource. - * @param resourceUri The identifier of the resource. - * @param options The options parameters. - */ - public list( - resourceUri: string, - options?: MetricNamespacesListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceUri, 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.listPagingPage(resourceUri, options, settings); - }, - }; - } - - private async *listPagingPage( - resourceUri: string, - options?: MetricNamespacesListOptionalParams, - _settings?: PageSettings, - ): AsyncIterableIterator { - let result: MetricNamespacesListResponse; - result = await this._list(resourceUri, options); - yield result.value || []; - } - - private async *listPagingAll( - resourceUri: string, - options?: MetricNamespacesListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(resourceUri, options)) { - yield* page; - } - } - - /** - * Lists the metric namespaces for the resource. - * @param resourceUri The identifier of the resource. - * @param options The options parameters. - */ - private _list( - resourceUri: string, - options?: MetricNamespacesListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, options }, - listOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/microsoft.insights/metricNamespaces", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.MetricNamespaceCollection, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion, 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 deleted file mode 100644 index 9ad6e6fff662..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/metricsOperations.ts +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { MetricsOperations } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - MetricsListAtSubscriptionScopeOptionalParams, - MetricsListAtSubscriptionScopeResponse, - MetricsListAtSubscriptionScopePostOptionalParams, - MetricsListAtSubscriptionScopePostResponse, - MetricsListOptionalParams, - MetricsListResponse, -} from "../models/index.js"; - -/** Class containing MetricsOperations operations. */ -export class MetricsOperationsImpl implements MetricsOperations { - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class MetricsOperations class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - 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. - * @param options The options parameters. - */ - list( - resourceUri: string, - options?: MetricsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, options }, - listOperationSpec, - ); - } -} -// 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.Response, - }, - default: { - bodyMapper: Mappers.ErrorContract, - }, - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.region, - Parameters.metricnamespace, - Parameters.timespan, - Parameters.interval, - Parameters.metricnames, - Parameters.aggregation, - Parameters.top, - Parameters.orderby, - Parameters.filter, - Parameters.resultType, - Parameters.autoAdjustTimegrain, - Parameters.validateDimensions, - Parameters.rollupby, - ], - 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.Response, - }, - default: { - bodyMapper: Mappers.ErrorContract, - }, - }, - requestBody: Parameters.body, - queryParameters: [ - Parameters.apiVersion, - Parameters.region, - Parameters.metricnamespace, - Parameters.timespan, - Parameters.interval, - Parameters.metricnames, - Parameters.aggregation, - Parameters.top, - Parameters.orderby, - Parameters.filter, - Parameters.resultType, - Parameters.autoAdjustTimegrain, - Parameters.validateDimensions, - Parameters.rollupby, - ], - 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", - responses: { - 200: { - bodyMapper: Mappers.Response, - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated, - }, - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.metricnamespace, - Parameters.timespan, - Parameters.interval, - Parameters.metricnames, - Parameters.aggregation, - Parameters.top, - Parameters.orderby, - Parameters.filter, - Parameters.autoAdjustTimegrain, - Parameters.validateDimensions, - Parameters.rollupby, - Parameters.resultType1, - ], - urlParameters: [Parameters.$host, Parameters.resourceUri], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/monitor/arm-monitor/src/operations/monitorOperations.ts b/sdk/monitor/arm-monitor/src/operations/monitorOperations.ts deleted file mode 100644 index ee1e74fe4aad..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/monitorOperations.ts +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { setContinuationToken } from "../pagingHelper.js"; -import { MonitorOperations } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - Operation, - MonitorOperationsListNextOptionalParams, - MonitorOperationsListOptionalParams, - MonitorOperationsListResponse, - MonitorOperationsListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing MonitorOperations operations. */ -export class MonitorOperationsImpl implements MonitorOperations { - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class MonitorOperations class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - this.client = client; - } - - /** - * Lists available Operations for this Resource Provider - * @param options The options parameters. - */ - public list( - options?: MonitorOperationsListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(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.listPagingPage(options, settings); - }, - }; - } - - private async *listPagingPage( - options?: MonitorOperationsListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: MonitorOperationsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - options?: MonitorOperationsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * Lists available Operations for this Resource Provider - * @param options The options parameters. - */ - private _list( - options?: MonitorOperationsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: MonitorOperationsListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Monitor/operations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OperationListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [Parameters.$host], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OperationListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/monitor/arm-monitor/src/operations/operations.ts b/sdk/monitor/arm-monitor/src/operations/operations.ts deleted file mode 100644 index c5aaed9104de..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/operations.ts +++ /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. - */ - -import { Operations } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - OperationsListOptionalParams, - OperationsListResponse, -} from "../models/index.js"; - -/** Class containing Operations operations. */ -export class OperationsImpl implements Operations { - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class Operations class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - this.client = client; - } - - /** - * Lists all of the available operations from Microsoft.Insights provider. - * @param options The options parameters. - */ - list( - options?: OperationsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Insights/operations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OperationListResultAutoGenerated, - }, - }, - queryParameters: [Parameters.apiVersion3], - 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 deleted file mode 100644 index f3c99ca81cd2..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/predictiveMetric.ts +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { PredictiveMetric } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - PredictiveMetricGetOptionalParams, - PredictiveMetricGetResponse, -} from "../models/index.js"; - -/** Class containing PredictiveMetric operations. */ -export class PredictiveMetricImpl implements PredictiveMetric { - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class PredictiveMetric class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - this.client = client; - } - - /** - * get predictive autoscale metric future data - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param autoscaleSettingName The autoscale setting name. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param interval The interval (i.e. timegrain) of the query. - * @param metricNamespace Metric namespace to query metric definitions for. - * @param metricName 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'** - * @param aggregation The list of aggregation types (comma separated) to retrieve. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - autoscaleSettingName: string, - timespan: string, - interval: string, - metricNamespace: string, - metricName: string, - aggregation: string, - options?: PredictiveMetricGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - autoscaleSettingName, - timespan, - interval, - metricNamespace, - metricName, - aggregation, - options, - }, - getOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}/predictiveMetrics", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PredictiveResponse, - }, - default: { - bodyMapper: Mappers.AutoscaleErrorResponse, - }, - }, - queryParameters: [ - Parameters.apiVersion2, - Parameters.timespan1, - Parameters.interval1, - Parameters.metricNamespace, - Parameters.metricName, - Parameters.aggregation1, - ], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.autoscaleSettingName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/monitor/arm-monitor/src/operations/privateEndpointConnections.ts b/sdk/monitor/arm-monitor/src/operations/privateEndpointConnections.ts deleted file mode 100644 index 8e674f2ac429..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/privateEndpointConnections.ts +++ /dev/null @@ -1,378 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { PrivateEndpointConnections } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import { - PrivateEndpointConnectionsGetOptionalParams, - PrivateEndpointConnectionsGetResponse, - PrivateEndpointConnectionAutoGenerated, - PrivateEndpointConnectionsCreateOrUpdateOptionalParams, - PrivateEndpointConnectionsCreateOrUpdateResponse, - PrivateEndpointConnectionsDeleteOptionalParams, - PrivateEndpointConnectionsListByPrivateLinkScopeOptionalParams, - PrivateEndpointConnectionsListByPrivateLinkScopeResponse, -} from "../models/index.js"; - -/** Class containing PrivateEndpointConnections operations. */ -export class PrivateEndpointConnectionsImpl - implements PrivateEndpointConnections -{ - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class PrivateEndpointConnections class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - this.client = client; - } - - /** - * Gets a private endpoint connection. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - scopeName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, scopeName, privateEndpointConnectionName, options }, - getOperationSpec, - ); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters The Private Endpoint Connection resource. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - scopeName: string, - privateEndpointConnectionName: string, - parameters: PrivateEndpointConnectionAutoGenerated, - options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - PrivateEndpointConnectionsCreateOrUpdateResponse - > - > { - 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, - scopeName, - privateEndpointConnectionName, - parameters, - options, - }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - PrivateEndpointConnectionsCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Approve or reject a private endpoint connection with a given name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters The Private Endpoint Connection resource. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - scopeName: string, - privateEndpointConnectionName: string, - parameters: PrivateEndpointConnectionAutoGenerated, - options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - scopeName, - privateEndpointConnectionName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Deletes a private endpoint connection with a given name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - scopeName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsDeleteOptionalParams, - ): Promise, void>> { - 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, - scopeName, - privateEndpointConnectionName, - options, - }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Deletes a private endpoint connection with a given name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - scopeName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - scopeName, - privateEndpointConnectionName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Gets all private endpoint connections on a private link scope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param options The options parameters. - */ - listByPrivateLinkScope( - resourceGroupName: string, - scopeName: string, - options?: PrivateEndpointConnectionsListByPrivateLinkScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, scopeName, options }, - listByPrivateLinkScopeOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PrivateEndpointConnectionAutoGenerated, - }, - default: { - bodyMapper: Mappers.DefaultErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion12], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.scopeName, - Parameters.privateEndpointConnectionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.PrivateEndpointConnectionAutoGenerated, - }, - 201: { - bodyMapper: Mappers.PrivateEndpointConnectionAutoGenerated, - }, - 202: { - bodyMapper: Mappers.PrivateEndpointConnectionAutoGenerated, - }, - 204: { - bodyMapper: Mappers.PrivateEndpointConnectionAutoGenerated, - }, - default: { - bodyMapper: Mappers.DefaultErrorResponse, - }, - }, - requestBody: Parameters.parameters8, - queryParameters: [Parameters.apiVersion12], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.scopeName, - Parameters.privateEndpointConnectionName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.DefaultErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion12], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.scopeName, - Parameters.privateEndpointConnectionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByPrivateLinkScopeOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/privateEndpointConnections", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PrivateEndpointConnectionListResult, - }, - default: { - bodyMapper: Mappers.DefaultErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion12], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.scopeName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/monitor/arm-monitor/src/operations/privateLinkResources.ts b/sdk/monitor/arm-monitor/src/operations/privateLinkResources.ts deleted file mode 100644 index 415f9e4b4116..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/privateLinkResources.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. - */ - -import { PrivateLinkResources } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - PrivateLinkResourcesListByPrivateLinkScopeOptionalParams, - PrivateLinkResourcesListByPrivateLinkScopeResponse, - PrivateLinkResourcesGetOptionalParams, - PrivateLinkResourcesGetResponse, -} from "../models/index.js"; - -/** Class containing PrivateLinkResources operations. */ -export class PrivateLinkResourcesImpl implements PrivateLinkResources { - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class PrivateLinkResources class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - this.client = client; - } - - /** - * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param options The options parameters. - */ - listByPrivateLinkScope( - resourceGroupName: string, - scopeName: string, - options?: PrivateLinkResourcesListByPrivateLinkScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, scopeName, options }, - listByPrivateLinkScopeOperationSpec, - ); - } - - /** - * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param groupName The name of the private link resource. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - scopeName: string, - groupName: string, - options?: PrivateLinkResourcesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, scopeName, groupName, options }, - getOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByPrivateLinkScopeOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/privateLinkResources", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PrivateLinkResourceListResult, - }, - default: { - bodyMapper: Mappers.DefaultErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion12], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.scopeName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/privateLinkResources/{groupName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PrivateLinkResource, - }, - default: { - bodyMapper: Mappers.DefaultErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion12], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.scopeName, - Parameters.groupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/monitor/arm-monitor/src/operations/privateLinkScopeOperationStatus.ts b/sdk/monitor/arm-monitor/src/operations/privateLinkScopeOperationStatus.ts deleted file mode 100644 index 614bf5182183..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/privateLinkScopeOperationStatus.ts +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { PrivateLinkScopeOperationStatus } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - PrivateLinkScopeOperationStatusGetOptionalParams, - PrivateLinkScopeOperationStatusGetResponse, -} from "../models/index.js"; - -/** Class containing PrivateLinkScopeOperationStatus operations. */ -export class PrivateLinkScopeOperationStatusImpl - implements PrivateLinkScopeOperationStatus -{ - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class PrivateLinkScopeOperationStatus class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - this.client = client; - } - - /** - * Get the status of an azure asynchronous operation associated with a private link scope operation. - * @param asyncOperationId The operation Id. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - get( - asyncOperationId: string, - resourceGroupName: string, - options?: PrivateLinkScopeOperationStatusGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { asyncOperationId, resourceGroupName, options }, - getOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopeOperationStatuses/{asyncOperationId}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OperationStatus, - }, - default: { - bodyMapper: Mappers.DefaultErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion12], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.asyncOperationId, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/monitor/arm-monitor/src/operations/privateLinkScopedResources.ts b/sdk/monitor/arm-monitor/src/operations/privateLinkScopedResources.ts deleted file mode 100644 index 222f22510fb6..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/privateLinkScopedResources.ts +++ /dev/null @@ -1,496 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { setContinuationToken } from "../pagingHelper.js"; -import { PrivateLinkScopedResources } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import { - ScopedResource, - PrivateLinkScopedResourcesListByPrivateLinkScopeNextOptionalParams, - PrivateLinkScopedResourcesListByPrivateLinkScopeOptionalParams, - PrivateLinkScopedResourcesListByPrivateLinkScopeResponse, - PrivateLinkScopedResourcesGetOptionalParams, - PrivateLinkScopedResourcesGetResponse, - PrivateLinkScopedResourcesCreateOrUpdateOptionalParams, - PrivateLinkScopedResourcesCreateOrUpdateResponse, - PrivateLinkScopedResourcesDeleteOptionalParams, - PrivateLinkScopedResourcesListByPrivateLinkScopeNextResponse, -} from "../models/index.js"; - -/// -/** Class containing PrivateLinkScopedResources operations. */ -export class PrivateLinkScopedResourcesImpl - implements PrivateLinkScopedResources -{ - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class PrivateLinkScopedResources class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - this.client = client; - } - - /** - * Gets all private endpoint connections on a private link scope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param options The options parameters. - */ - public listByPrivateLinkScope( - resourceGroupName: string, - scopeName: string, - options?: PrivateLinkScopedResourcesListByPrivateLinkScopeOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByPrivateLinkScopePagingAll( - resourceGroupName, - scopeName, - 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.listByPrivateLinkScopePagingPage( - resourceGroupName, - scopeName, - options, - settings, - ); - }, - }; - } - - private async *listByPrivateLinkScopePagingPage( - resourceGroupName: string, - scopeName: string, - options?: PrivateLinkScopedResourcesListByPrivateLinkScopeOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: PrivateLinkScopedResourcesListByPrivateLinkScopeResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByPrivateLinkScope( - resourceGroupName, - scopeName, - options, - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByPrivateLinkScopeNext( - resourceGroupName, - scopeName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByPrivateLinkScopePagingAll( - resourceGroupName: string, - scopeName: string, - options?: PrivateLinkScopedResourcesListByPrivateLinkScopeOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByPrivateLinkScopePagingPage( - resourceGroupName, - scopeName, - options, - )) { - yield* page; - } - } - - /** - * Gets a scoped resource in a private link scope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - scopeName: string, - name: string, - options?: PrivateLinkScopedResourcesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, scopeName, name, options }, - getOperationSpec, - ); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param parameters A private link scoped resource - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - scopeName: string, - name: string, - parameters: ScopedResource, - options?: PrivateLinkScopedResourcesCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - PrivateLinkScopedResourcesCreateOrUpdateResponse - > - > { - 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, scopeName, name, parameters, options }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - PrivateLinkScopedResourcesCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Approve or reject a private endpoint connection with a given name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param parameters A private link scoped resource - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - scopeName: string, - name: string, - parameters: ScopedResource, - options?: PrivateLinkScopedResourcesCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - scopeName, - name, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Deletes a private endpoint connection with a given name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - scopeName: string, - name: string, - options?: PrivateLinkScopedResourcesDeleteOptionalParams, - ): Promise, void>> { - 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, scopeName, name, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Deletes a private endpoint connection with a given name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - scopeName: string, - name: string, - options?: PrivateLinkScopedResourcesDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - scopeName, - name, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Gets all private endpoint connections on a private link scope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param options The options parameters. - */ - private _listByPrivateLinkScope( - resourceGroupName: string, - scopeName: string, - options?: PrivateLinkScopedResourcesListByPrivateLinkScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, scopeName, options }, - listByPrivateLinkScopeOperationSpec, - ); - } - - /** - * ListByPrivateLinkScopeNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param nextLink The nextLink from the previous successful call to the ListByPrivateLinkScope method. - * @param options The options parameters. - */ - private _listByPrivateLinkScopeNext( - resourceGroupName: string, - scopeName: string, - nextLink: string, - options?: PrivateLinkScopedResourcesListByPrivateLinkScopeNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, scopeName, nextLink, options }, - listByPrivateLinkScopeNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/scopedResources/{name}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ScopedResource, - }, - default: { - bodyMapper: Mappers.DefaultErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion12], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.name, - Parameters.scopeName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/scopedResources/{name}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.ScopedResource, - }, - 201: { - bodyMapper: Mappers.ScopedResource, - }, - 202: { - bodyMapper: Mappers.ScopedResource, - }, - 204: { - bodyMapper: Mappers.ScopedResource, - }, - default: { - bodyMapper: Mappers.DefaultErrorResponse, - }, - }, - requestBody: Parameters.parameters9, - queryParameters: [Parameters.apiVersion12], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.name, - Parameters.scopeName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/scopedResources/{name}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.DefaultErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion12], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.name, - Parameters.scopeName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByPrivateLinkScopeOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/scopedResources", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ScopedResourceListResult, - }, - default: { - bodyMapper: Mappers.DefaultErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion12], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.scopeName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByPrivateLinkScopeNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ScopedResourceListResult, - }, - default: { - bodyMapper: Mappers.DefaultErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.nextLink, - Parameters.scopeName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/monitor/arm-monitor/src/operations/privateLinkScopes.ts b/sdk/monitor/arm-monitor/src/operations/privateLinkScopes.ts deleted file mode 100644 index 8c7dfe21e3f9..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/privateLinkScopes.ts +++ /dev/null @@ -1,547 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { setContinuationToken } from "../pagingHelper.js"; -import { PrivateLinkScopes } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import { - AzureMonitorPrivateLinkScope, - PrivateLinkScopesListNextOptionalParams, - PrivateLinkScopesListOptionalParams, - PrivateLinkScopesListResponse, - PrivateLinkScopesListByResourceGroupNextOptionalParams, - PrivateLinkScopesListByResourceGroupOptionalParams, - PrivateLinkScopesListByResourceGroupResponse, - PrivateLinkScopesDeleteOptionalParams, - PrivateLinkScopesGetOptionalParams, - PrivateLinkScopesGetResponse, - PrivateLinkScopesCreateOrUpdateOptionalParams, - PrivateLinkScopesCreateOrUpdateResponse, - TagsResource, - PrivateLinkScopesUpdateTagsOptionalParams, - PrivateLinkScopesUpdateTagsResponse, - PrivateLinkScopesListNextResponse, - PrivateLinkScopesListByResourceGroupNextResponse, -} from "../models/index.js"; - -/// -/** Class containing PrivateLinkScopes operations. */ -export class PrivateLinkScopesImpl implements PrivateLinkScopes { - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class PrivateLinkScopes class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - this.client = client; - } - - /** - * Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. - * @param options The options parameters. - */ - public list( - options?: PrivateLinkScopesListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(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.listPagingPage(options, settings); - }, - }; - } - - private async *listPagingPage( - options?: PrivateLinkScopesListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: PrivateLinkScopesListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - options?: PrivateLinkScopesListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * Gets a list of Azure Monitor PrivateLinkScopes within a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: PrivateLinkScopesListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, 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.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings, - ); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: PrivateLinkScopesListByResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: PrivateLinkScopesListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext( - resourceGroupName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: PrivateLinkScopesListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage( - resourceGroupName, - options, - )) { - yield* page; - } - } - - /** - * Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. - * @param options The options parameters. - */ - private _list( - options?: PrivateLinkScopesListOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * Gets a list of Azure Monitor PrivateLinkScopes within a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: PrivateLinkScopesListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * Deletes a Azure Monitor PrivateLinkScope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - scopeName: string, - options?: PrivateLinkScopesDeleteOptionalParams, - ): Promise, void>> { - 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, scopeName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Deletes a Azure Monitor PrivateLinkScope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - scopeName: string, - options?: PrivateLinkScopesDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - scopeName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Returns a Azure Monitor PrivateLinkScope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - scopeName: string, - options?: PrivateLinkScopesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, scopeName, options }, - getOperationSpec, - ); - } - - /** - * Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value - * for InstrumentationKey nor AppId in the Put operation. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param azureMonitorPrivateLinkScopePayload Properties that need to be specified to create or update - * a Azure Monitor PrivateLinkScope. - * @param options The options parameters. - */ - createOrUpdate( - resourceGroupName: string, - scopeName: string, - azureMonitorPrivateLinkScopePayload: AzureMonitorPrivateLinkScope, - options?: PrivateLinkScopesCreateOrUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - scopeName, - azureMonitorPrivateLinkScopePayload, - options, - }, - createOrUpdateOperationSpec, - ); - } - - /** - * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateLinkScopeTags Updated tag information to set into the PrivateLinkScope instance. - * @param options The options parameters. - */ - updateTags( - resourceGroupName: string, - scopeName: string, - privateLinkScopeTags: TagsResource, - options?: PrivateLinkScopesUpdateTagsOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, scopeName, privateLinkScopeTags, options }, - updateTagsOperationSpec, - ); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: PrivateLinkScopesListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec, - ); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: PrivateLinkScopesListByResourceGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/microsoft.insights/privateLinkScopes", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AzureMonitorPrivateLinkScopeListResult, - }, - default: { - bodyMapper: Mappers.DefaultErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion12], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopes", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AzureMonitorPrivateLinkScopeListResult, - }, - default: { - bodyMapper: Mappers.DefaultErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion12], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopes/{scopeName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.DefaultErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion12], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.scopeName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopes/{scopeName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AzureMonitorPrivateLinkScope, - }, - default: { - bodyMapper: Mappers.DefaultErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion12], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.scopeName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopes/{scopeName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.AzureMonitorPrivateLinkScope, - }, - 201: { - bodyMapper: Mappers.AzureMonitorPrivateLinkScope, - }, - default: { - bodyMapper: Mappers.DefaultErrorResponse, - }, - }, - requestBody: Parameters.azureMonitorPrivateLinkScopePayload, - queryParameters: [Parameters.apiVersion12], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.scopeName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateTagsOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopes/{scopeName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.AzureMonitorPrivateLinkScope, - }, - default: { - bodyMapper: Mappers.DefaultErrorResponse, - }, - }, - requestBody: Parameters.privateLinkScopeTags, - queryParameters: [Parameters.apiVersion12], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.scopeName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AzureMonitorPrivateLinkScopeListResult, - }, - default: { - bodyMapper: Mappers.DefaultErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AzureMonitorPrivateLinkScopeListResult, - }, - default: { - bodyMapper: Mappers.DefaultErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/monitor/arm-monitor/src/operations/scheduledQueryRules.ts b/sdk/monitor/arm-monitor/src/operations/scheduledQueryRules.ts index 47336a6c42dd..0deae268ff2f 100644 --- a/sdk/monitor/arm-monitor/src/operations/scheduledQueryRules.ts +++ b/sdk/monitor/arm-monitor/src/operations/scheduledQueryRules.ts @@ -315,7 +315,7 @@ const listBySubscriptionOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorContract, }, }, - queryParameters: [Parameters.apiVersion10], + queryParameters: [Parameters.apiVersion1], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer, @@ -331,11 +331,11 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorContract, }, }, - queryParameters: [Parameters.apiVersion10], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], serializer, @@ -351,11 +351,11 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorContract, }, }, - queryParameters: [Parameters.apiVersion10], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, + Parameters.subscriptionId, Parameters.ruleName, ], headerParameters: [Parameters.accept], @@ -375,15 +375,15 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorContract, }, }, - requestBody: Parameters.parameters6, - queryParameters: [Parameters.apiVersion10], + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, + Parameters.subscriptionId, Parameters.ruleName, ], - headerParameters: [Parameters.accept, Parameters.contentType], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", serializer, }; @@ -398,15 +398,15 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorContract, }, }, - requestBody: Parameters.parameters7, - queryParameters: [Parameters.apiVersion10], + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, + Parameters.subscriptionId, Parameters.ruleName, ], - headerParameters: [Parameters.accept, Parameters.contentType], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", serializer, }; @@ -420,11 +420,11 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorContract, }, }, - queryParameters: [Parameters.apiVersion10], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, + Parameters.subscriptionId, Parameters.ruleName, ], headerParameters: [Parameters.accept], @@ -462,8 +462,8 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { }, urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, + Parameters.subscriptionId, 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 deleted file mode 100644 index 3aeda60ba05b..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/tenantActionGroups.ts +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - TenantActionGroupResource, - TenantActionGroupsListByManagementGroupIdOptionalParams, - TenantActionGroupsListByManagementGroupIdResponse, - TenantActionGroupsCreateOrUpdateOptionalParams, - TenantActionGroupsCreateOrUpdateResponse, - TenantActionGroupsGetOptionalParams, - TenantActionGroupsGetResponse, - TenantActionGroupsDeleteOptionalParams, - ActionGroupPatchBodyAutoGenerated, - TenantActionGroupsUpdateOptionalParams, - TenantActionGroupsUpdateResponse, -} from "../models/index.js"; - -/// -/** 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.ErrorResponse, - }, - }, - requestBody: Parameters.actionGroup1, - queryParameters: [Parameters.apiVersion7], - 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.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion7], - 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.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion7], - 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.ErrorResponse, - }, - }, - requestBody: Parameters.tenantActionGroupPatch, - queryParameters: [Parameters.apiVersion7], - 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.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion7], - 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 deleted file mode 100644 index 934e8edfffca..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/tenantActivityLogs.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. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import { TenantActivityLogs } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - EventData, - TenantActivityLogsListNextOptionalParams, - TenantActivityLogsListOptionalParams, - TenantActivityLogsListResponse, - TenantActivityLogsListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing TenantActivityLogs operations. */ -export class TenantActivityLogsImpl implements TenantActivityLogs { - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class TenantActivityLogs class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - this.client = client; - } - - /** - * 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. - * @param options The options parameters. - */ - public list( - options?: TenantActivityLogsListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(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.listPagingPage(options, settings); - }, - }; - } - - private async *listPagingPage( - options?: TenantActivityLogsListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: TenantActivityLogsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - options?: TenantActivityLogsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * 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. - * @param options The options parameters. - */ - private _list( - options?: TenantActivityLogsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: TenantActivityLogsListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Insights/eventtypes/management/values", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.EventDataCollection, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [ - Parameters.filter, - Parameters.apiVersion3, - Parameters.select, - ], - urlParameters: [Parameters.$host], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.EventDataCollection, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/monitor/arm-monitor/src/operations/vMInsights.ts b/sdk/monitor/arm-monitor/src/operations/vMInsights.ts deleted file mode 100644 index 6a2ad40fbde0..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/vMInsights.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { VMInsights } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { MonitorClient } from "../monitorClient.js"; -import { - VMInsightsGetOnboardingStatusOptionalParams, - VMInsightsGetOnboardingStatusResponse, -} from "../models/index.js"; - -/** Class containing VMInsights operations. */ -export class VMInsightsImpl implements VMInsights { - private readonly client: MonitorClient; - - /** - * Initialize a new instance of the class VMInsights class. - * @param client Reference to the service client - */ - constructor(client: MonitorClient) { - this.client = client; - } - - /** - * Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource, or scope, - * whose status to retrieve. - * @param options The options parameters. - */ - getOnboardingStatus( - resourceUri: string, - options?: VMInsightsGetOnboardingStatusOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, options }, - getOnboardingStatusOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOnboardingStatusOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.Insights/vmInsightsOnboardingStatuses/default", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VMInsightsOnboardingStatus, - }, - default: { - bodyMapper: Mappers.ResponseWithError, - }, - }, - queryParameters: [Parameters.apiVersion11], - urlParameters: [Parameters.$host, Parameters.resourceUri], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/activityLogAlerts.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/activityLogAlerts.ts deleted file mode 100644 index e14d91603fe1..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/activityLogAlerts.ts +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { - ActivityLogAlertResource, - ActivityLogAlertsListBySubscriptionIdOptionalParams, - ActivityLogAlertsListByResourceGroupOptionalParams, - ActivityLogAlertsCreateOrUpdateOptionalParams, - ActivityLogAlertsCreateOrUpdateResponse, - ActivityLogAlertsGetOptionalParams, - ActivityLogAlertsGetResponse, - ActivityLogAlertsDeleteOptionalParams, - AlertRulePatchObject, - ActivityLogAlertsUpdateOptionalParams, - ActivityLogAlertsUpdateResponse, -} from "../models/index.js"; - -/// -/** Interface representing a ActivityLogAlerts. */ -export interface ActivityLogAlerts { - /** - * Get a list of all Activity Log Alert rules in a subscription. - * @param options The options parameters. - */ - listBySubscriptionId( - options?: ActivityLogAlertsListBySubscriptionIdOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Get a list of all Activity Log Alert rules in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: ActivityLogAlertsListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Create a new Activity Log Alert rule or update an existing one. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param activityLogAlertName The name of the Activity Log Alert rule. - * @param activityLogAlertRule The Activity Log Alert rule to create or use for the update. - * @param options The options parameters. - */ - createOrUpdate( - resourceGroupName: string, - activityLogAlertName: string, - activityLogAlertRule: ActivityLogAlertResource, - options?: ActivityLogAlertsCreateOrUpdateOptionalParams, - ): Promise; - /** - * Get an Activity Log Alert rule. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param activityLogAlertName The name of the Activity Log Alert rule. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - activityLogAlertName: string, - options?: ActivityLogAlertsGetOptionalParams, - ): Promise; - /** - * Delete an Activity Log Alert rule. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param activityLogAlertName The name of the Activity Log Alert rule. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - activityLogAlertName: string, - options?: ActivityLogAlertsDeleteOptionalParams, - ): Promise; - /** - * 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. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param activityLogAlertName The name of the Activity Log Alert rule. - * @param activityLogAlertRulePatch Parameters supplied to the operation. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - activityLogAlertName: string, - activityLogAlertRulePatch: AlertRulePatchObject, - options?: ActivityLogAlertsUpdateOptionalParams, - ): Promise; -} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/activityLogs.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/activityLogs.ts deleted file mode 100644 index 66e61d5a7365..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/activityLogs.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { EventData, ActivityLogsListOptionalParams } from "../models/index.js"; - -/// -/** Interface representing a ActivityLogs. */ -export interface ActivityLogs { - /** - * Provides the list of records from the activity logs. - * @param filter Reduces the set of data collected.
This argument is required and it also requires - * at least the start date/time.
The **$filter** argument is very restricted and allows only the - * following patterns.
- *List events for a resource group*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and - * resourceGroupName eq 'resourceGroupName'.
- *List events for resource*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri - * eq 'resourceURI'.
- *List events for a subscription in a time range*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'.
- *List - * events for a resource provider*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and - * eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceProvider eq - * 'resourceProviderName'.
- *List events for a correlation Id*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and - * correlationId eq 'correlationID'.

**NOTE**: No other syntax is allowed. - * @param options The options parameters. - */ - list( - filter: string, - options?: ActivityLogsListOptionalParams, - ): PagedAsyncIterableIterator; -} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/alertRuleIncidents.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/alertRuleIncidents.ts deleted file mode 100644 index 5ddbb9cb1a15..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/alertRuleIncidents.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. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - Incident, - AlertRuleIncidentsListByAlertRuleOptionalParams, - AlertRuleIncidentsGetOptionalParams, - AlertRuleIncidentsGetResponse, -} from "../models/index.js"; - -/// -/** Interface representing a AlertRuleIncidents. */ -export interface AlertRuleIncidents { - /** - * Gets a list of incidents associated to an alert rule - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ruleName The name of the rule. - * @param options The options parameters. - */ - listByAlertRule( - resourceGroupName: string, - ruleName: string, - options?: AlertRuleIncidentsListByAlertRuleOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets an incident associated to an alert rule - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ruleName The name of the rule. - * @param incidentName The name of the incident to retrieve. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - ruleName: string, - incidentName: string, - options?: AlertRuleIncidentsGetOptionalParams, - ): Promise; -} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/alertRules.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/alertRules.ts deleted file mode 100644 index efebff513327..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/alertRules.ts +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { - AlertRuleResource, - AlertRulesListByResourceGroupOptionalParams, - AlertRulesListBySubscriptionOptionalParams, - AlertRulesCreateOrUpdateOptionalParams, - AlertRulesCreateOrUpdateResponse, - AlertRulesDeleteOptionalParams, - AlertRulesGetOptionalParams, - AlertRulesGetResponse, - AlertRuleResourcePatch, - AlertRulesUpdateOptionalParams, - AlertRulesUpdateResponse, -} from "../models/index.js"; - -/// -/** Interface representing a AlertRules. */ -export interface AlertRules { - /** - * List the classic metric alert rules within a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: AlertRulesListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * List the classic metric alert rules within a subscription. - * @param options The options parameters. - */ - listBySubscription( - options?: AlertRulesListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Creates or updates a classic metric alert rule. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @param options The options parameters. - */ - createOrUpdate( - resourceGroupName: string, - ruleName: string, - parameters: AlertRuleResource, - options?: AlertRulesCreateOrUpdateOptionalParams, - ): Promise; - /** - * Deletes a classic metric alert rule - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ruleName The name of the rule. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - ruleName: string, - options?: AlertRulesDeleteOptionalParams, - ): Promise; - /** - * Gets a classic metric alert rule - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ruleName The name of the rule. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - ruleName: string, - options?: AlertRulesGetOptionalParams, - ): Promise; - /** - * Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate - * method. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ruleName The name of the rule. - * @param alertRulesResource Parameters supplied to the operation. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - ruleName: string, - alertRulesResource: AlertRuleResourcePatch, - options?: AlertRulesUpdateOptionalParams, - ): Promise; -} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/autoscaleSettings.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/autoscaleSettings.ts deleted file mode 100644 index 5bd59d5fe905..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/autoscaleSettings.ts +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { - AutoscaleSettingResource, - AutoscaleSettingsListByResourceGroupOptionalParams, - AutoscaleSettingsListBySubscriptionOptionalParams, - AutoscaleSettingsCreateOrUpdateOptionalParams, - AutoscaleSettingsCreateOrUpdateResponse, - AutoscaleSettingsDeleteOptionalParams, - AutoscaleSettingsGetOptionalParams, - AutoscaleSettingsGetResponse, - AutoscaleSettingResourcePatch, - AutoscaleSettingsUpdateOptionalParams, - AutoscaleSettingsUpdateResponse, -} from "../models/index.js"; - -/// -/** Interface representing a AutoscaleSettings. */ -export interface AutoscaleSettings { - /** - * Lists the autoscale settings for a resource group - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: AutoscaleSettingsListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Lists the autoscale settings for a subscription - * @param options The options parameters. - */ - listBySubscription( - options?: AutoscaleSettingsListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Creates or updates an autoscale setting. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param autoscaleSettingName The autoscale setting name. - * @param parameters Parameters supplied to the operation. - * @param options The options parameters. - */ - createOrUpdate( - resourceGroupName: string, - autoscaleSettingName: string, - parameters: AutoscaleSettingResource, - options?: AutoscaleSettingsCreateOrUpdateOptionalParams, - ): Promise; - /** - * Deletes and autoscale setting - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param autoscaleSettingName The autoscale setting name. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - autoscaleSettingName: string, - options?: AutoscaleSettingsDeleteOptionalParams, - ): Promise; - /** - * Gets an autoscale setting - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param autoscaleSettingName The autoscale setting name. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - autoscaleSettingName: string, - options?: AutoscaleSettingsGetOptionalParams, - ): Promise; - /** - * Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param autoscaleSettingName The autoscale setting name. - * @param autoscaleSettingResource Parameters supplied to the operation. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - autoscaleSettingName: string, - autoscaleSettingResource: AutoscaleSettingResourcePatch, - options?: AutoscaleSettingsUpdateOptionalParams, - ): Promise; -} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/azureMonitorWorkspaces.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/azureMonitorWorkspaces.ts deleted file mode 100644 index 517f569d578b..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/azureMonitorWorkspaces.ts +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - AzureMonitorWorkspaceResource, - AzureMonitorWorkspacesListByResourceGroupOptionalParams, - AzureMonitorWorkspacesListBySubscriptionOptionalParams, - AzureMonitorWorkspacesGetOptionalParams, - AzureMonitorWorkspacesGetResponse, - AzureMonitorWorkspacesCreateOptionalParams, - AzureMonitorWorkspacesCreateResponse, - AzureMonitorWorkspacesUpdateOptionalParams, - AzureMonitorWorkspacesUpdateResponse, - AzureMonitorWorkspacesDeleteOptionalParams, - AzureMonitorWorkspacesDeleteResponse, -} from "../models/index.js"; - -/// -/** Interface representing a AzureMonitorWorkspaces. */ -export interface AzureMonitorWorkspaces { - /** - * Lists all Azure Monitor Workspaces in the specified resource group - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: AzureMonitorWorkspacesListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Lists all Azure Monitor Workspaces in the specified subscription - * @param options The options parameters. - */ - listBySubscription( - options?: AzureMonitorWorkspacesListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Returns the specified Azure Monitor 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. - */ - get( - resourceGroupName: string, - azureMonitorWorkspaceName: string, - options?: AzureMonitorWorkspacesGetOptionalParams, - ): Promise; - /** - * Creates or updates an Azure Monitor 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 azureMonitorWorkspaceProperties Properties that need to be specified to create a new Azure - * Monitor Workspace - * @param options The options parameters. - */ - create( - resourceGroupName: string, - azureMonitorWorkspaceName: string, - azureMonitorWorkspaceProperties: AzureMonitorWorkspaceResource, - options?: AzureMonitorWorkspacesCreateOptionalParams, - ): Promise; - /** - * Updates part of an Azure Monitor 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. - */ - update( - resourceGroupName: string, - azureMonitorWorkspaceName: string, - options?: AzureMonitorWorkspacesUpdateOptionalParams, - ): Promise; - /** - * Deletes an Azure Monitor 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. - */ - beginDelete( - resourceGroupName: string, - azureMonitorWorkspaceName: string, - options?: AzureMonitorWorkspacesDeleteOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - AzureMonitorWorkspacesDeleteResponse - > - >; - /** - * Deletes an Azure Monitor 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/baselines.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/baselines.ts deleted file mode 100644 index 94f2c9642c1f..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/baselines.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { SingleMetricBaseline, BaselinesListOptionalParams } from "../models/index.js"; - -/// -/** Interface representing a Baselines. */ -export interface Baselines { - /** - * **Lists the metric baseline values for a resource**. - * @param resourceUri The identifier of the resource. - * @param options The options parameters. - */ - list( - resourceUri: string, - options?: BaselinesListOptionalParams, - ): PagedAsyncIterableIterator; -} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/dataCollectionEndpoints.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/dataCollectionEndpoints.ts deleted file mode 100644 index b4ff541e9268..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/dataCollectionEndpoints.ts +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { - DataCollectionEndpointResource, - DataCollectionEndpointsListByResourceGroupOptionalParams, - DataCollectionEndpointsListBySubscriptionOptionalParams, - DataCollectionEndpointsGetOptionalParams, - DataCollectionEndpointsGetResponse, - DataCollectionEndpointsCreateOptionalParams, - DataCollectionEndpointsCreateResponse, - DataCollectionEndpointsUpdateOptionalParams, - DataCollectionEndpointsUpdateResponse, - DataCollectionEndpointsDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a DataCollectionEndpoints. */ -export interface DataCollectionEndpoints { - /** - * Lists all data collection endpoints in the specified resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: DataCollectionEndpointsListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Lists all data collection endpoints in the specified subscription - * @param options The options parameters. - */ - listBySubscription( - options?: DataCollectionEndpointsListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Returns the specified data collection endpoint. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case - * insensitive. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - dataCollectionEndpointName: string, - options?: DataCollectionEndpointsGetOptionalParams, - ): Promise; - /** - * Creates or updates a data collection endpoint. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case - * insensitive. - * @param options The options parameters. - */ - create( - resourceGroupName: string, - dataCollectionEndpointName: string, - options?: DataCollectionEndpointsCreateOptionalParams, - ): Promise; - /** - * Updates part of a data collection endpoint. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case - * insensitive. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - dataCollectionEndpointName: string, - options?: DataCollectionEndpointsUpdateOptionalParams, - ): Promise; - /** - * Deletes a data collection endpoint. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case - * insensitive. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - dataCollectionEndpointName: string, - options?: DataCollectionEndpointsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/dataCollectionRuleAssociations.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/dataCollectionRuleAssociations.ts deleted file mode 100644 index c37e39febbc1..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/dataCollectionRuleAssociations.ts +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { - DataCollectionRuleAssociationProxyOnlyResource, - DataCollectionRuleAssociationsListByResourceOptionalParams, - DataCollectionRuleAssociationsListByRuleOptionalParams, - DataCollectionRuleAssociationsListByDataCollectionEndpointOptionalParams, - DataCollectionRuleAssociationsGetOptionalParams, - DataCollectionRuleAssociationsGetResponse, - DataCollectionRuleAssociationsCreateOptionalParams, - DataCollectionRuleAssociationsCreateResponse, - DataCollectionRuleAssociationsDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a DataCollectionRuleAssociations. */ -export interface DataCollectionRuleAssociations { - /** - * Lists associations for the specified resource. - * @param resourceUri The identifier of the resource. - * @param options The options parameters. - */ - listByResource( - resourceUri: string, - options?: DataCollectionRuleAssociationsListByResourceOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Lists associations for the specified data collection rule. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param options The options parameters. - */ - listByRule( - resourceGroupName: string, - dataCollectionRuleName: string, - options?: DataCollectionRuleAssociationsListByRuleOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Lists associations for the specified data collection endpoint. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case - * insensitive. - * @param options The options parameters. - */ - listByDataCollectionEndpoint( - resourceGroupName: string, - dataCollectionEndpointName: string, - options?: DataCollectionRuleAssociationsListByDataCollectionEndpointOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Returns the specified association. - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @param options The options parameters. - */ - get( - resourceUri: string, - associationName: string, - options?: DataCollectionRuleAssociationsGetOptionalParams, - ): Promise; - /** - * Creates or updates an association. - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @param options The options parameters. - */ - create( - resourceUri: string, - associationName: string, - options?: DataCollectionRuleAssociationsCreateOptionalParams, - ): Promise; - /** - * Deletes an association. - * @param resourceUri The identifier of the resource. - * @param associationName The name of the association. The name is case insensitive. - * @param options The options parameters. - */ - delete( - resourceUri: string, - associationName: string, - options?: DataCollectionRuleAssociationsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/dataCollectionRules.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/dataCollectionRules.ts deleted file mode 100644 index b1581d29d014..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/dataCollectionRules.ts +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { - DataCollectionRuleResource, - DataCollectionRulesListByResourceGroupOptionalParams, - DataCollectionRulesListBySubscriptionOptionalParams, - DataCollectionRulesGetOptionalParams, - DataCollectionRulesGetResponse, - DataCollectionRulesCreateOptionalParams, - DataCollectionRulesCreateResponse, - DataCollectionRulesUpdateOptionalParams, - DataCollectionRulesUpdateResponse, - DataCollectionRulesDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a DataCollectionRules. */ -export interface DataCollectionRules { - /** - * Lists all data collection rules in the specified resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: DataCollectionRulesListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Lists all data collection rules in the specified subscription. - * @param options The options parameters. - */ - listBySubscription( - options?: DataCollectionRulesListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Returns the specified data collection rule. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - dataCollectionRuleName: string, - options?: DataCollectionRulesGetOptionalParams, - ): Promise; - /** - * Creates or updates a data collection rule. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param options The options parameters. - */ - create( - resourceGroupName: string, - dataCollectionRuleName: string, - options?: DataCollectionRulesCreateOptionalParams, - ): Promise; - /** - * Updates part of a data collection rule. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - dataCollectionRuleName: string, - options?: DataCollectionRulesUpdateOptionalParams, - ): Promise; - /** - * Deletes a data collection rule. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - dataCollectionRuleName: string, - options?: DataCollectionRulesDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/diagnosticSettings.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/diagnosticSettings.ts deleted file mode 100644 index 4d3487471feb..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/diagnosticSettings.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. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - DiagnosticSettingsResource, - DiagnosticSettingsListOptionalParams, - DiagnosticSettingsGetOptionalParams, - DiagnosticSettingsGetResponse, - DiagnosticSettingsCreateOrUpdateOptionalParams, - DiagnosticSettingsCreateOrUpdateResponse, - DiagnosticSettingsDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a DiagnosticSettings. */ -export interface DiagnosticSettings { - /** - * Gets the active diagnostic settings list for the specified resource. - * @param resourceUri The identifier of the resource. - * @param options The options parameters. - */ - list( - resourceUri: string, - options?: DiagnosticSettingsListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets the active diagnostic settings for the specified resource. - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param options The options parameters. - */ - get( - resourceUri: string, - name: string, - options?: DiagnosticSettingsGetOptionalParams, - ): Promise; - /** - * Creates or updates diagnostic settings for the specified resource. - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param parameters Parameters supplied to the operation. - * @param options The options parameters. - */ - createOrUpdate( - resourceUri: string, - name: string, - parameters: DiagnosticSettingsResource, - options?: DiagnosticSettingsCreateOrUpdateOptionalParams, - ): Promise; - /** - * Deletes existing diagnostic settings for the specified resource. - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param options The options parameters. - */ - delete( - resourceUri: string, - name: string, - options?: DiagnosticSettingsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/diagnosticSettingsCategory.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/diagnosticSettingsCategory.ts deleted file mode 100644 index b435768679c3..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/diagnosticSettingsCategory.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. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - DiagnosticSettingsCategoryResource, - DiagnosticSettingsCategoryListOptionalParams, - DiagnosticSettingsCategoryGetOptionalParams, - DiagnosticSettingsCategoryGetResponse, -} from "../models/index.js"; - -/// -/** Interface representing a DiagnosticSettingsCategory. */ -export interface DiagnosticSettingsCategory { - /** - * Lists the diagnostic settings categories for the specified resource. - * @param resourceUri The identifier of the resource. - * @param options The options parameters. - */ - list( - resourceUri: string, - options?: DiagnosticSettingsCategoryListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets the diagnostic settings category for the specified resource. - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param options The options parameters. - */ - get( - resourceUri: string, - name: string, - options?: DiagnosticSettingsCategoryGetOptionalParams, - ): Promise; -} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/eventCategories.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/eventCategories.ts deleted file mode 100644 index ccba8085e174..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/eventCategories.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { - LocalizableStringAutoGenerated, - EventCategoriesListOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a EventCategories. */ -export interface EventCategories { - /** - * 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. - * @param options The options parameters. - */ - list( - options?: EventCategoriesListOptionalParams, - ): PagedAsyncIterableIterator; -} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/index.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/index.ts index 150ce9b37e37..7db126d853b8 100644 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/index.ts +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/index.ts @@ -6,35 +6,5 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export * from "./metricNamespaces.js"; -export * from "./metricDefinitions.js"; -export * from "./metricsOperations.js"; -export * from "./azureMonitorWorkspaces.js"; -export * from "./monitorOperations.js"; -export * from "./autoscaleSettings.js"; -export * from "./predictiveMetric.js"; -export * from "./operations.js"; -export * from "./alertRuleIncidents.js"; -export * from "./alertRules.js"; -export * from "./logProfiles.js"; -export * from "./diagnosticSettings.js"; -export * from "./diagnosticSettingsCategory.js"; export * from "./actionGroups.js"; -export * from "./tenantActionGroups.js"; -export * from "./activityLogs.js"; -export * from "./eventCategories.js"; -export * from "./tenantActivityLogs.js"; -export * from "./baselines.js"; -export * from "./metricAlerts.js"; -export * from "./metricAlertsStatus.js"; export * from "./scheduledQueryRules.js"; -export * from "./vMInsights.js"; -export * from "./privateLinkScopes.js"; -export * from "./privateLinkScopeOperationStatus.js"; -export * from "./privateLinkResources.js"; -export * from "./privateEndpointConnections.js"; -export * from "./privateLinkScopedResources.js"; -export * from "./activityLogAlerts.js"; -export * from "./dataCollectionEndpoints.js"; -export * from "./dataCollectionRuleAssociations.js"; -export * from "./dataCollectionRules.js"; diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/logProfiles.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/logProfiles.ts deleted file mode 100644 index 55e7b03c701f..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/logProfiles.ts +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { - LogProfileResource, - LogProfilesListOptionalParams, - LogProfilesDeleteOptionalParams, - LogProfilesGetOptionalParams, - LogProfilesGetResponse, - LogProfilesCreateOrUpdateOptionalParams, - LogProfilesCreateOrUpdateResponse, - LogProfileResourcePatch, - LogProfilesUpdateOptionalParams, - LogProfilesUpdateResponse, -} from "../models/index.js"; - -/// -/** Interface representing a LogProfiles. */ -export interface LogProfiles { - /** - * List the log profiles. - * @param options The options parameters. - */ - list( - options?: LogProfilesListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Deletes the log profile. - * @param logProfileName The name of the log profile. - * @param options The options parameters. - */ - delete( - logProfileName: string, - options?: LogProfilesDeleteOptionalParams, - ): Promise; - /** - * Gets the log profile. - * @param logProfileName The name of the log profile. - * @param options The options parameters. - */ - get( - logProfileName: string, - options?: LogProfilesGetOptionalParams, - ): Promise; - /** - * Create or update a log profile in Azure Monitoring REST API. - * @param logProfileName The name of the log profile. - * @param parameters Parameters supplied to the operation. - * @param options The options parameters. - */ - createOrUpdate( - logProfileName: string, - parameters: LogProfileResource, - options?: LogProfilesCreateOrUpdateOptionalParams, - ): Promise; - /** - * Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. - * @param logProfileName The name of the log profile. - * @param logProfilesResource Parameters supplied to the operation. - * @param options The options parameters. - */ - update( - logProfileName: string, - logProfilesResource: LogProfileResourcePatch, - options?: LogProfilesUpdateOptionalParams, - ): Promise; -} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/metricAlerts.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/metricAlerts.ts deleted file mode 100644 index d992b0ba434f..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/metricAlerts.ts +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { - MetricAlertResource, - MetricAlertsListBySubscriptionOptionalParams, - MetricAlertsListByResourceGroupOptionalParams, - MetricAlertsGetOptionalParams, - MetricAlertsGetResponse, - MetricAlertsCreateOrUpdateOptionalParams, - MetricAlertsCreateOrUpdateResponse, - MetricAlertResourcePatch, - MetricAlertsUpdateOptionalParams, - MetricAlertsUpdateResponse, - MetricAlertsDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a MetricAlerts. */ -export interface MetricAlerts { - /** - * Retrieve alert rule definitions in a subscription. - * @param options The options parameters. - */ - listBySubscription( - options?: MetricAlertsListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Retrieve alert rule definitions in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: MetricAlertsListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Retrieve an alert rule definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ruleName The name of the rule. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - ruleName: string, - options?: MetricAlertsGetOptionalParams, - ): Promise; - /** - * Create or update an metric alert definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @param options The options parameters. - */ - createOrUpdate( - resourceGroupName: string, - ruleName: string, - parameters: MetricAlertResource, - options?: MetricAlertsCreateOrUpdateOptionalParams, - ): Promise; - /** - * Update an metric alert definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to update. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - ruleName: string, - parameters: MetricAlertResourcePatch, - options?: MetricAlertsUpdateOptionalParams, - ): Promise; - /** - * Delete an alert rule definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ruleName The name of the rule. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - ruleName: string, - options?: MetricAlertsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/metricAlertsStatus.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/metricAlertsStatus.ts deleted file mode 100644 index d2240231e54f..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/metricAlertsStatus.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. - */ - -import { - MetricAlertsStatusListOptionalParams, - MetricAlertsStatusListResponse, - MetricAlertsStatusListByNameOptionalParams, - MetricAlertsStatusListByNameResponse, -} from "../models/index.js"; - -/** Interface representing a MetricAlertsStatus. */ -export interface MetricAlertsStatus { - /** - * Retrieve an alert rule status. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ruleName The name of the rule. - * @param options The options parameters. - */ - list( - resourceGroupName: string, - ruleName: string, - options?: MetricAlertsStatusListOptionalParams, - ): Promise; - /** - * Retrieve an alert rule status. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ruleName The name of the rule. - * @param statusName The name of the status. - * @param options The options parameters. - */ - listByName( - resourceGroupName: string, - ruleName: string, - statusName: string, - options?: MetricAlertsStatusListByNameOptionalParams, - ): Promise; -} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/metricDefinitions.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/metricDefinitions.ts deleted file mode 100644 index 019c8d36f0fc..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/metricDefinitions.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. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - SubscriptionScopeMetricDefinition, - MetricDefinitionsListAtSubscriptionScopeOptionalParams, - MetricDefinition, - MetricDefinitionsListOptionalParams, -} from "../models/index.js"; - -/// -/** 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. - * @param options The options parameters. - */ - list( - resourceUri: string, - options?: MetricDefinitionsListOptionalParams, - ): PagedAsyncIterableIterator; -} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/metricNamespaces.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/metricNamespaces.ts deleted file mode 100644 index 78611324b8d8..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/metricNamespaces.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { MetricNamespace, MetricNamespacesListOptionalParams } from "../models/index.js"; - -/// -/** Interface representing a MetricNamespaces. */ -export interface MetricNamespaces { - /** - * Lists the metric namespaces for the resource. - * @param resourceUri The identifier of the resource. - * @param options The options parameters. - */ - list( - resourceUri: string, - options?: MetricNamespacesListOptionalParams, - ): PagedAsyncIterableIterator; -} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/metricsOperations.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/metricsOperations.ts deleted file mode 100644 index ae398fc8924c..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/metricsOperations.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - MetricsListAtSubscriptionScopeOptionalParams, - MetricsListAtSubscriptionScopeResponse, - MetricsListAtSubscriptionScopePostOptionalParams, - MetricsListAtSubscriptionScopePostResponse, - MetricsListOptionalParams, - MetricsListResponse, -} from "../models/index.js"; - -/** 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. - * @param options The options parameters. - */ - list( - resourceUri: string, - options?: MetricsListOptionalParams, - ): Promise; -} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/monitorOperations.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/monitorOperations.ts deleted file mode 100644 index ed8582dea3ad..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/monitorOperations.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { Operation, MonitorOperationsListOptionalParams } from "../models/index.js"; - -/// -/** Interface representing a MonitorOperations. */ -export interface MonitorOperations { - /** - * Lists available Operations for this Resource Provider - * @param options The options parameters. - */ - list( - options?: MonitorOperationsListOptionalParams, - ): PagedAsyncIterableIterator; -} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/operations.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/operations.ts deleted file mode 100644 index 34c26ad61475..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/operations.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { - OperationsListOptionalParams, - OperationsListResponse, -} from "../models/index.js"; - -/** Interface representing a Operations. */ -export interface Operations { - /** - * Lists all of the available operations from Microsoft.Insights provider. - * @param options The options parameters. - */ - list(options?: OperationsListOptionalParams): Promise; -} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/predictiveMetric.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/predictiveMetric.ts deleted file mode 100644 index 0e0bd8ba8867..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/predictiveMetric.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. - */ - -import { - PredictiveMetricGetOptionalParams, - PredictiveMetricGetResponse, -} from "../models/index.js"; - -/** Interface representing a PredictiveMetric. */ -export interface PredictiveMetric { - /** - * get predictive autoscale metric future data - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param autoscaleSettingName The autoscale setting name. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param interval The interval (i.e. timegrain) of the query. - * @param metricNamespace Metric namespace to query metric definitions for. - * @param metricName 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'** - * @param aggregation The list of aggregation types (comma separated) to retrieve. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - autoscaleSettingName: string, - timespan: string, - interval: string, - metricNamespace: string, - metricName: string, - aggregation: string, - options?: PredictiveMetricGetOptionalParams, - ): Promise; -} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/privateEndpointConnections.ts deleted file mode 100644 index fcca97a85d65..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/privateEndpointConnections.ts +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - PrivateEndpointConnectionsGetOptionalParams, - PrivateEndpointConnectionsGetResponse, - PrivateEndpointConnectionAutoGenerated, - PrivateEndpointConnectionsCreateOrUpdateOptionalParams, - PrivateEndpointConnectionsCreateOrUpdateResponse, - PrivateEndpointConnectionsDeleteOptionalParams, - PrivateEndpointConnectionsListByPrivateLinkScopeOptionalParams, - PrivateEndpointConnectionsListByPrivateLinkScopeResponse, -} from "../models/index.js"; - -/** Interface representing a PrivateEndpointConnections. */ -export interface PrivateEndpointConnections { - /** - * Gets a private endpoint connection. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - scopeName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsGetOptionalParams, - ): Promise; - /** - * Approve or reject a private endpoint connection with a given name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters The Private Endpoint Connection resource. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - scopeName: string, - privateEndpointConnectionName: string, - parameters: PrivateEndpointConnectionAutoGenerated, - options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - PrivateEndpointConnectionsCreateOrUpdateResponse - > - >; - /** - * Approve or reject a private endpoint connection with a given name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters The Private Endpoint Connection resource. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - scopeName: string, - privateEndpointConnectionName: string, - parameters: PrivateEndpointConnectionAutoGenerated, - options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams, - ): Promise; - /** - * Deletes a private endpoint connection with a given name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - scopeName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsDeleteOptionalParams, - ): Promise, void>>; - /** - * Deletes a private endpoint connection with a given name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - scopeName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsDeleteOptionalParams, - ): Promise; - /** - * Gets all private endpoint connections on a private link scope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param options The options parameters. - */ - listByPrivateLinkScope( - resourceGroupName: string, - scopeName: string, - options?: PrivateEndpointConnectionsListByPrivateLinkScopeOptionalParams, - ): Promise; -} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/privateLinkResources.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/privateLinkResources.ts deleted file mode 100644 index 6e932ea4f398..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/privateLinkResources.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. - */ - -import { - PrivateLinkResourcesListByPrivateLinkScopeOptionalParams, - PrivateLinkResourcesListByPrivateLinkScopeResponse, - PrivateLinkResourcesGetOptionalParams, - PrivateLinkResourcesGetResponse, -} from "../models/index.js"; - -/** Interface representing a PrivateLinkResources. */ -export interface PrivateLinkResources { - /** - * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param options The options parameters. - */ - listByPrivateLinkScope( - resourceGroupName: string, - scopeName: string, - options?: PrivateLinkResourcesListByPrivateLinkScopeOptionalParams, - ): Promise; - /** - * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param groupName The name of the private link resource. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - scopeName: string, - groupName: string, - options?: PrivateLinkResourcesGetOptionalParams, - ): Promise; -} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/privateLinkScopeOperationStatus.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/privateLinkScopeOperationStatus.ts deleted file mode 100644 index eaa38c710908..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/privateLinkScopeOperationStatus.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { - PrivateLinkScopeOperationStatusGetOptionalParams, - PrivateLinkScopeOperationStatusGetResponse, -} from "../models/index.js"; - -/** Interface representing a PrivateLinkScopeOperationStatus. */ -export interface PrivateLinkScopeOperationStatus { - /** - * Get the status of an azure asynchronous operation associated with a private link scope operation. - * @param asyncOperationId The operation Id. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - get( - asyncOperationId: string, - resourceGroupName: string, - options?: PrivateLinkScopeOperationStatusGetOptionalParams, - ): Promise; -} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/privateLinkScopedResources.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/privateLinkScopedResources.ts deleted file mode 100644 index 49fbac345c4c..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/privateLinkScopedResources.ts +++ /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. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - ScopedResource, - PrivateLinkScopedResourcesListByPrivateLinkScopeOptionalParams, - PrivateLinkScopedResourcesGetOptionalParams, - PrivateLinkScopedResourcesGetResponse, - PrivateLinkScopedResourcesCreateOrUpdateOptionalParams, - PrivateLinkScopedResourcesCreateOrUpdateResponse, - PrivateLinkScopedResourcesDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a PrivateLinkScopedResources. */ -export interface PrivateLinkScopedResources { - /** - * Gets all private endpoint connections on a private link scope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param options The options parameters. - */ - listByPrivateLinkScope( - resourceGroupName: string, - scopeName: string, - options?: PrivateLinkScopedResourcesListByPrivateLinkScopeOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets a scoped resource in a private link scope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - scopeName: string, - name: string, - options?: PrivateLinkScopedResourcesGetOptionalParams, - ): Promise; - /** - * Approve or reject a private endpoint connection with a given name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param parameters A private link scoped resource - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - scopeName: string, - name: string, - parameters: ScopedResource, - options?: PrivateLinkScopedResourcesCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - PrivateLinkScopedResourcesCreateOrUpdateResponse - > - >; - /** - * Approve or reject a private endpoint connection with a given name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param parameters A private link scoped resource - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - scopeName: string, - name: string, - parameters: ScopedResource, - options?: PrivateLinkScopedResourcesCreateOrUpdateOptionalParams, - ): Promise; - /** - * Deletes a private endpoint connection with a given name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - scopeName: string, - name: string, - options?: PrivateLinkScopedResourcesDeleteOptionalParams, - ): Promise, void>>; - /** - * Deletes a private endpoint connection with a given name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param name The name of the scoped resource object. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - scopeName: string, - name: string, - options?: PrivateLinkScopedResourcesDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/privateLinkScopes.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/privateLinkScopes.ts deleted file mode 100644 index 3f5554c06eaf..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/privateLinkScopes.ts +++ /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. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - AzureMonitorPrivateLinkScope, - PrivateLinkScopesListOptionalParams, - PrivateLinkScopesListByResourceGroupOptionalParams, - PrivateLinkScopesDeleteOptionalParams, - PrivateLinkScopesGetOptionalParams, - PrivateLinkScopesGetResponse, - PrivateLinkScopesCreateOrUpdateOptionalParams, - PrivateLinkScopesCreateOrUpdateResponse, - TagsResource, - PrivateLinkScopesUpdateTagsOptionalParams, - PrivateLinkScopesUpdateTagsResponse, -} from "../models/index.js"; - -/// -/** Interface representing a PrivateLinkScopes. */ -export interface PrivateLinkScopes { - /** - * Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. - * @param options The options parameters. - */ - list( - options?: PrivateLinkScopesListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets a list of Azure Monitor PrivateLinkScopes within a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: PrivateLinkScopesListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Deletes a Azure Monitor PrivateLinkScope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - scopeName: string, - options?: PrivateLinkScopesDeleteOptionalParams, - ): Promise, void>>; - /** - * Deletes a Azure Monitor PrivateLinkScope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - scopeName: string, - options?: PrivateLinkScopesDeleteOptionalParams, - ): Promise; - /** - * Returns a Azure Monitor PrivateLinkScope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - scopeName: string, - options?: PrivateLinkScopesGetOptionalParams, - ): Promise; - /** - * Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value - * for InstrumentationKey nor AppId in the Put operation. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param azureMonitorPrivateLinkScopePayload Properties that need to be specified to create or update - * a Azure Monitor PrivateLinkScope. - * @param options The options parameters. - */ - createOrUpdate( - resourceGroupName: string, - scopeName: string, - azureMonitorPrivateLinkScopePayload: AzureMonitorPrivateLinkScope, - options?: PrivateLinkScopesCreateOrUpdateOptionalParams, - ): Promise; - /** - * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. - * @param privateLinkScopeTags Updated tag information to set into the PrivateLinkScope instance. - * @param options The options parameters. - */ - updateTags( - resourceGroupName: string, - scopeName: string, - privateLinkScopeTags: TagsResource, - options?: PrivateLinkScopesUpdateTagsOptionalParams, - ): Promise; -} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/tenantActionGroups.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/tenantActionGroups.ts deleted file mode 100644 index 62bc24aa861f..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/tenantActionGroups.ts +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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/index.js"; - -/// -/** 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/src/operationsInterfaces/tenantActivityLogs.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/tenantActivityLogs.ts deleted file mode 100644 index e02518fa5b7b..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/tenantActivityLogs.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { EventData, TenantActivityLogsListOptionalParams } from "../models/index.js"; - -/// -/** Interface representing a TenantActivityLogs. */ -export interface TenantActivityLogs { - /** - * 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. - * @param options The options parameters. - */ - list( - options?: TenantActivityLogsListOptionalParams, - ): PagedAsyncIterableIterator; -} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/vMInsights.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/vMInsights.ts deleted file mode 100644 index cf4a8a5df856..000000000000 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/vMInsights.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { - VMInsightsGetOnboardingStatusOptionalParams, - VMInsightsGetOnboardingStatusResponse, -} from "../models/index.js"; - -/** Interface representing a VMInsights. */ -export interface VMInsights { - /** - * Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource, or scope, - * whose status to retrieve. - * @param options The options parameters. - */ - getOnboardingStatus( - resourceUri: string, - options?: VMInsightsGetOnboardingStatusOptionalParams, - ): Promise; -} diff --git a/sdk/monitor/arm-monitor/test/monitor.spec.ts b/sdk/monitor/arm-monitor/test/monitor.spec.ts deleted file mode 100644 index 01902a48688a..000000000000 --- a/sdk/monitor/arm-monitor/test/monitor.spec.ts +++ /dev/null @@ -1,357 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 type { RecorderStartOptions } from "@azure-tools/test-recorder"; -import { env, Recorder, isPlaybackMode } from "@azure-tools/test-recorder"; -import { createTestCredential } from "@azure-tools/test-credential"; -import { MonitorClient } from "../src/monitorClient.js"; -import { LogicManagementClient } from "@azure/arm-logic"; -import { StorageManagementClient } from "@azure/arm-storage"; -import { EventHubManagementClient } from "@azure/arm-eventhub"; -import { OperationalInsightsManagementClient } from "@azure/arm-operationalinsights"; -import { describe, it, assert, beforeEach, afterEach } from "vitest"; - -const replaceableVariables: Record = { - SUBSCRIPTION_ID: "azure_subscription_id", -}; - -const recorderOptions: RecorderStartOptions = { - envSetupForPlayback: replaceableVariables, - removeCentralSanitizers: [ - "AZSDK3493", // .name in the body is not a secret and is listed below in the beforeEach section - "AZSDK3430", // .id in the body is not a secret and is listed below in the beforeEach section - ], -}; - -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 (ctx) => { - recorder = new Recorder(ctx); - 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 = "mystorageaccountyyy1"; - namespaceName = "mynamespacexxx"; - eventhubName = "myeventhubxxx"; - workspaceName = "myworkspacexxx"; - authorizationRuleName = "myauthorizationRulexxx"; - logProfileName = "mylogProfilexxx"; - diagnosticName = "mydiagnosticxxxx"; - azureMonitorWorkspaceName = "myAzureMonitorWorkspace"; - }); - - afterEach(async () => { - await recorder.stop(); - }); - - it("create parameters for diagnosticSettings", async () => { - // 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", - }, - }, - testPollingOptions, - ); - storageId = storageaccount.id || ""; - - // namespaces.beginCreateOrUpdateAndWait - await eventhub_client.namespaces.beginCreateOrUpdateAndWait(resourceGroup, namespaceName, { - sku: { - name: "Standard", - tier: "Standard", - }, - location: location, - tags: { - tag1: "value1", - tag2: "value2", - } - }, testPollingOptions) - // namespaces.createOrUpdateAuthorizationRule - const authorization = await eventhub_client.namespaces.createOrUpdateAuthorizationRule( - resourceGroup, - namespaceName, - authorizationRuleName, - { rights: ["Listen", "Send", "Manage"] }, - ); - authorizationId = authorization.id || ""; - - // workspaces.beginCreateOrUpdateAndWait - const workspace = await op_client.workspaces.beginCreateOrUpdateAndWait( - resourceGroup, - workspaceName, - { - sku: { - name: "PerNode", - }, - retentionInDays: 30, - location: location, - tags: { - tag1: "value1", - }, - }, - testPollingOptions, - ); - workspaceId = workspace.id || ""; - }); - // skip this case as no data plane write permissions - it.skip("eventhub create test", async () => { - // eventHubs.createOrUpdate - 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}", - } - } - }); - }) - - it("diagnosticSettings create test", async () => { - workflowsId = ((await logic_client.workflows.get(resourceGroup, workflowName)).id || "/").substring(1) - storageId = (await storage_client.storageAccounts.getProperties(resourceGroup, storageAccountName)).id || ""; - authorizationId = (await eventhub_client.namespaces.getAuthorizationRule(resourceGroup, namespaceName, authorizationRuleName)).id || ""; - workspaceId = (await op_client.workspaces.get(resourceGroup, workspaceName)).id || ""; - 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 () => { - const res = await client.diagnosticSettings.get(workflowsId, diagnosticName); - assert.equal(res.name, diagnosticName); - }); - - it("diagnosticSettings list test", async () => { - const res = await client.diagnosticSettings.list(workflowsId); - assert.ok(res); - }); - - it("diagnosticSettings delete test", async () => { - const res = await client.diagnosticSettings.delete(workflowsId, diagnosticName); - assert.ok(res); - }); - - it("logProfiles create test", async () => { - //delete sample logfile - const resArray = new Array(); - for await (const 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 () => { - const res = await client.logProfiles.get(logProfileName); - assert.equal(res.name, logProfileName); - }); - - it("logProfiles list test", async () => { - const resArray = new Array(); - for await (const item of client.logProfiles.list()) { - resArray.push(item); - } - assert.equal(resArray.length, 1); - }); - - it("workspace create test", async () => { - const res = await client.azureMonitorWorkspaces.create( - resourceGroup, - azureMonitorWorkspaceName, - { - location - }); - assert.equal(res.name, azureMonitorWorkspaceName); - }); - - it("workspace get test", async () => { - const res = await client.azureMonitorWorkspaces.get(resourceGroup, azureMonitorWorkspaceName); - assert.equal(res.name, azureMonitorWorkspaceName); - }); - - it("workspace list test", async () => { - const resArray = new Array(); - for await (const item of client.azureMonitorWorkspaces.listByResourceGroup(resourceGroup)) { - resArray.push(item); - } - assert.equal(resArray.length, 1); - }); - - it("workspace delete test", async () => { - const resArray = new Array(); - await client.azureMonitorWorkspaces.beginDeleteAndWait(resourceGroup, azureMonitorWorkspaceName); - for await (const item of client.azureMonitorWorkspaces.listByResourceGroup(resourceGroup)) { - resArray.push(item); - } - assert.equal(resArray.length, 0); - }); - - it("metric listAtSubscriptionScope test", async () => { - await client.metricsOperations.listAtSubscriptionScope( - location, - { - metricnamespace: "microsoft.compute/virtualmachines" - } - ); - }); - - it("metric list test", async () => { - await client.metricsOperations.list( - "subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroup + "/providers/Microsoft.Storage/storageAccounts/" + storageAccountName + "/blobServices/default", - { - metricnamespace: "Microsoft.Storage/storageAccounts/blobServices" - } - ); - }); - - it("delete parameters for diagnosticSettings", async () => { - await logic_client.workflows.delete(resourceGroup, workflowName); - await storage_client.storageAccounts.delete(resourceGroup, storageAccountName); - await eventhub_client.namespaces.beginDeleteAndWait(resourceGroup, namespaceName, testPollingOptions); - await op_client.workspaces.beginDeleteAndWait(resourceGroup, workspaceName, testPollingOptions); - }); - - it("logProfiles delete test", async () => { - await client.logProfiles.delete(logProfileName); - const resArray = new Array(); - for await (const 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..a1cf7c25afd2 --- /dev/null +++ b/sdk/monitor/arm-monitor/test/sampleTest.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, +} from "@azure-tools/test-recorder"; + +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 (ctx) => { + recorder = new Recorder(ctx); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async function () { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/monitor/arm-monitor/test/snippets.spec.ts b/sdk/monitor/arm-monitor/test/snippets.spec.ts index 66369ae94270..a82030dbd059 100644 --- a/sdk/monitor/arm-monitor/test/snippets.spec.ts +++ b/sdk/monitor/arm-monitor/test/snippets.spec.ts @@ -1,15 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { MonitorClient } from "../src/index.js"; -import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; +import { + DefaultAzureCredential, + InteractiveBrowserCredential, +} from "@azure/identity"; import { setLogLevel } from "@azure/logger"; import { describe, it } from "vitest"; describe("snippets", () => { it("ReadmeSampleCreateClient_Node", async () => { const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new MonitorClient(new DefaultAzureCredential(), subscriptionId); + const client = new MonitorClient( + new DefaultAzureCredential(), + subscriptionId, + ); }); it("ReadmeSampleCreateClient_Browser", async () => { diff --git a/sdk/monitor/arm-monitor/tsconfig.browser.config.json b/sdk/monitor/arm-monitor/tsconfig.browser.config.json index 75871518e3a0..0c8bafa97126 100644 --- a/sdk/monitor/arm-monitor/tsconfig.browser.config.json +++ b/sdk/monitor/arm-monitor/tsconfig.browser.config.json @@ -1,3 +1,6 @@ { - "extends": ["./tsconfig.test.json", "../../../tsconfig.browser.base.json"] + "extends": [ + "./tsconfig.test.json", + "../../../tsconfig.browser.base.json" + ] } diff --git a/sdk/monitor/arm-monitor/tsconfig.json b/sdk/monitor/arm-monitor/tsconfig.json index 19ceb382b521..b35d05ad6e9d 100644 --- a/sdk/monitor/arm-monitor/tsconfig.json +++ b/sdk/monitor/arm-monitor/tsconfig.json @@ -1,13 +1,27 @@ { - "references": [ - { - "path": "./tsconfig.src.json" - }, - { - "path": "./tsconfig.samples.json" - }, - { - "path": "./tsconfig.test.json" - } + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "dom" + ], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true + }, + "include": [ + "src/**/*.ts", + "test/**/*.ts" + ], + "exclude": [ + "node_modules" ] -} +} \ No newline at end of file diff --git a/sdk/monitor/arm-monitor/tsconfig.samples.json b/sdk/monitor/arm-monitor/tsconfig.samples.json index a6799bc9538c..fe75148d5a08 100644 --- a/sdk/monitor/arm-monitor/tsconfig.samples.json +++ b/sdk/monitor/arm-monitor/tsconfig.samples.json @@ -2,7 +2,9 @@ "extends": "../../../tsconfig.samples.base.json", "compilerOptions": { "paths": { - "@azure/arm-monitor": ["./dist/esm"] + "@azure/arm-monitor": [ + "./dist/esm" + ] } } } diff --git a/sdk/monitor/arm-monitor/tsconfig.test.json b/sdk/monitor/arm-monitor/tsconfig.test.json index 290ca214aebc..3c2b783a8c1b 100644 --- a/sdk/monitor/arm-monitor/tsconfig.test.json +++ b/sdk/monitor/arm-monitor/tsconfig.test.json @@ -1,3 +1,6 @@ { - "extends": ["./tsconfig.src.json", "../../../tsconfig.test.base.json"] + "extends": [ + "./tsconfig.src.json", + "../../../tsconfig.test.base.json" + ] } diff --git a/sdk/monitor/arm-monitor/vitest.browser.config.ts b/sdk/monitor/arm-monitor/vitest.browser.config.ts index 10e70dbfa8ee..182729ab5ce9 100644 --- a/sdk/monitor/arm-monitor/vitest.browser.config.ts +++ b/sdk/monitor/arm-monitor/vitest.browser.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. @@ -8,7 +9,7 @@ export default mergeConfig( viteConfig, defineConfig({ test: { - include: ["dist-test/browser/test/**/*.spec.js"], + include: ["dist-test/browser/test/**/*.spec.js",], testTimeout: 1200000, hookTimeout: 1200000, }, diff --git a/sdk/monitor/arm-monitor/vitest.config.ts b/sdk/monitor/arm-monitor/vitest.config.ts index 86a71911ccc2..40e031385dd8 100644 --- a/sdk/monitor/arm-monitor/vitest.config.ts +++ b/sdk/monitor/arm-monitor/vitest.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. diff --git a/sdk/monitor/arm-monitor/vitest.esm.config.ts b/sdk/monitor/arm-monitor/vitest.esm.config.ts index 5e9735e9b144..a70127279fc9 100644 --- a/sdk/monitor/arm-monitor/vitest.esm.config.ts +++ b/sdk/monitor/arm-monitor/vitest.esm.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. @@ -5,4 +6,7 @@ import { mergeConfig } from "vitest/config"; import vitestConfig from "./vitest.config.ts"; import vitestEsmConfig from "../../../vitest.esm.shared.config.ts"; -export default mergeConfig(vitestConfig, vitestEsmConfig); +export default mergeConfig( + vitestConfig, + vitestEsmConfig +);