From 4d06662f1c69de59fb9dd7c42fabeaa2e0b710e7 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 5 Jan 2023 01:41:32 +0000 Subject: [PATCH] CodeGen from PR 21879 in Azure/azure-rest-api-specs Task 16564293: Update swagger description of new budget alert. (#21879) * Task 16564293: Update swagger description of new budget alert. * Also remove "budget" as it will not longer be used. * Add custom words Co-authored-by: Thomas Pham --- common/config/rush/pnpm-lock.yaml | 100 +- sdk/monitor/arm-monitor/CHANGELOG.md | 105 +- sdk/monitor/arm-monitor/LICENSE | 2 +- sdk/monitor/arm-monitor/_meta.json | 8 +- sdk/monitor/arm-monitor/package.json | 23 +- ...ate_parameters_for_diagnosticsettings.json | 1858 ---------- ...ete_parameters_for_diagnosticsettings.json | 289 -- ...ording_diagnosticsettings_create_test.json | 85 - ...ording_diagnosticsettings_delete_test.json | 34 - ...recording_diagnosticsettings_get_test.json | 74 - ...ecording_diagnosticsettings_list_test.json | 4 - .../recording_logprofiles_create_test.json | 114 - .../recording_logprofiles_delete_test.json | 93 - .../recording_logprofiles_get_test.json | 61 - .../recording_logprofiles_list_test.json | 65 - .../arm-monitor/review/arm-monitor.api.md | 563 ++- ...cationsAtActionGroupResourceLevelSample.ts | 149 - ...NotificationsAtResourceGroupLevelSample.ts | 147 - .../actionGroupsCreateOrUpdateSample.ts | 147 - .../samples-dev/actionGroupsDeleteSample.ts | 33 - .../actionGroupsEnableReceiverSample.ts | 35 - .../samples-dev/actionGroupsGetSample.ts | 33 - ...cationsAtActionGroupResourceLevelSample.ts | 35 - ...NotificationsAtResourceGroupLevelSample.ts | 33 - .../actionGroupsGetTestNotificationsSample.ts | 29 - .../actionGroupsListByResourceGroupSample.ts | 34 - .../actionGroupsListBySubscriptionIdSample.ts | 31 - ...actionGroupsPostTestNotificationsSample.ts | 145 - .../samples-dev/actionGroupsUpdateSample.ts | 38 - .../activityLogAlertsCreateOrUpdateSample.ts | 154 - .../activityLogAlertsDeleteSample.ts | 33 - .../samples-dev/activityLogAlertsGetSample.ts | 33 - ...ivityLogAlertsListByResourceGroupSample.ts | 34 - ...vityLogAlertsListBySubscriptionIdSample.ts | 31 - .../activityLogAlertsUpdateSample.ts | 38 - .../samples-dev/activityLogsListSample.ts | 60 - .../alertRuleIncidentsGetSample.ts | 35 - ...alertRuleIncidentsListByAlertRuleSample.ts | 36 - .../alertRulesCreateOrUpdateSample.ts | 57 - .../samples-dev/alertRulesDeleteSample.ts | 30 - .../samples-dev/alertRulesGetSample.ts | 30 - .../alertRulesListByResourceGroupSample.ts | 34 - .../alertRulesListBySubscriptionSample.ts | 31 - .../samples-dev/alertRulesUpdateSample.ts | 59 - .../autoscaleSettingsCreateOrUpdateSample.ts | 156 - .../autoscaleSettingsDeleteSample.ts | 33 - .../samples-dev/autoscaleSettingsGetSample.ts | 33 - ...oscaleSettingsListByResourceGroupSample.ts | 34 - ...toscaleSettingsListBySubscriptionSample.ts | 31 - .../autoscaleSettingsUpdateSample.ts | 158 - .../samples-dev/baselinesListSample.ts | 43 - .../dataCollectionEndpointsCreateSample.ts | 43 - .../dataCollectionEndpointsDeleteSample.ts | 33 - .../dataCollectionEndpointsGetSample.ts | 33 - ...ctionEndpointsListByResourceGroupSample.ts | 34 - ...ectionEndpointsListBySubscriptionSample.ts | 31 - .../dataCollectionEndpointsUpdateSample.ts | 40 - ...aCollectionRuleAssociationsCreateSample.ts | 44 - ...aCollectionRuleAssociationsDeleteSample.ts | 34 - ...dataCollectionRuleAssociationsGetSample.ts | 34 - ...tionsListByDataCollectionEndpointSample.ts | 36 - ...ionRuleAssociationsListByResourceSample.ts | 35 - ...lectionRuleAssociationsListByRuleSample.ts | 36 - .../dataCollectionRulesCreateSample.ts | 111 - .../dataCollectionRulesDeleteSample.ts | 33 - .../dataCollectionRulesGetSample.ts | 33 - ...ollectionRulesListByResourceGroupSample.ts | 34 - ...CollectionRulesListBySubscriptionSample.ts | 31 - .../dataCollectionRulesUpdateSample.ts | 40 - .../diagnosticSettingsCategoryGetSample.ts | 31 - .../diagnosticSettingsCategoryListSample.ts | 33 - .../diagnosticSettingsCreateOrUpdateSample.ts | 108 - .../diagnosticSettingsDeleteSample.ts | 31 - .../diagnosticSettingsGetSample.ts | 50 - .../diagnosticSettingsListSample.ts | 54 - .../samples-dev/eventCategoriesListSample.ts | 31 - .../logProfilesCreateOrUpdateSample.ts | 42 - .../samples-dev/logProfilesDeleteSample.ts | 29 - .../samples-dev/logProfilesGetSample.ts | 29 - .../samples-dev/logProfilesListSample.ts | 31 - .../samples-dev/logProfilesUpdateSample.ts | 41 - .../metricAlertsCreateOrUpdateSample.ts | 487 --- .../samples-dev/metricAlertsDeleteSample.ts | 30 - .../samples-dev/metricAlertsGetSample.ts | 138 - .../metricAlertsListByResourceGroupSample.ts | 34 - .../metricAlertsListBySubscriptionSample.ts | 31 - .../metricAlertsStatusListByNameSample.ts | 36 - .../metricAlertsStatusListSample.ts | 33 - .../samples-dev/metricAlertsUpdateSample.ts | 67 - .../metricDefinitionsListSample.ts | 84 - .../samples-dev/metricNamespacesListSample.ts | 38 - .../samples-dev/metricsListSample.ts | 110 - .../samples-dev/operationsListSample.ts | 28 - .../samples-dev/predictiveMetricGetSample.ts | 43 - ...EndpointConnectionsCreateOrUpdateSample.ts | 42 - .../privateEndpointConnectionsDeleteSample.ts | 35 - .../privateEndpointConnectionsGetSample.ts | 35 - ...ConnectionsListByPrivateLinkScopeSample.ts | 33 - .../privateLinkResourcesGetSample.ts | 35 - ...nkResourcesListByPrivateLinkScopeSample.ts | 33 - ...rivateLinkScopeOperationStatusGetSample.ts | 33 - ...LinkScopedResourcesCreateOrUpdateSample.ts | 40 - .../privateLinkScopedResourcesDeleteSample.ts | 35 - .../privateLinkScopedResourcesGetSample.ts | 35 - ...edResourcesListByPrivateLinkScopeSample.ts | 36 - .../privateLinkScopesCreateOrUpdateSample.ts | 76 - .../privateLinkScopesDeleteSample.ts | 33 - .../samples-dev/privateLinkScopesGetSample.ts | 33 - ...vateLinkScopesListByResourceGroupSample.ts | 34 - .../privateLinkScopesListSample.ts | 31 - .../privateLinkScopesUpdateTagsSample.ts | 37 - ...scheduledQueryRulesCreateOrUpdateSample.ts | 156 - .../scheduledQueryRulesDeleteSample.ts | 33 - .../scheduledQueryRulesGetSample.ts | 33 - ...uledQueryRulesListByResourceGroupSample.ts | 34 - ...duledQueryRulesListBySubscriptionSample.ts | 31 - .../scheduledQueryRulesUpdateSample.ts | 35 - .../tenantActivityLogsListSample.ts | 102 - .../vmInsightsGetOnboardingStatusSample.ts | 105 - .../samples/v8-beta/javascript/README.md | 254 -- ...cationsAtActionGroupResourceLevelSample.js | 144 - ...NotificationsAtResourceGroupLevelSample.js | 141 - .../actionGroupsCreateOrUpdateSample.js | 141 - .../javascript/actionGroupsDeleteSample.js | 30 - .../actionGroupsEnableReceiverSample.js | 35 - .../javascript/actionGroupsGetSample.js | 30 - ...cationsAtActionGroupResourceLevelSample.js | 35 - ...NotificationsAtResourceGroupLevelSample.js | 33 - .../actionGroupsGetTestNotificationsSample.js | 29 - .../actionGroupsListByResourceGroupSample.js | 32 - .../actionGroupsListBySubscriptionIdSample.js | 31 - ...actionGroupsPostTestNotificationsSample.js | 137 - .../javascript/actionGroupsUpdateSample.js | 38 - .../activityLogAlertsCreateOrUpdateSample.js | 152 - .../activityLogAlertsDeleteSample.js | 30 - .../javascript/activityLogAlertsGetSample.js | 30 - ...ivityLogAlertsListByResourceGroupSample.js | 32 - ...vityLogAlertsListBySubscriptionIdSample.js | 31 - .../activityLogAlertsUpdateSample.js | 38 - .../javascript/activityLogsListSample.js | 57 - .../javascript/alertRuleIncidentsGetSample.js | 31 - ...alertRuleIncidentsListByAlertRuleSample.js | 33 - .../alertRulesCreateOrUpdateSample.js | 51 - .../javascript/alertRulesDeleteSample.js | 30 - .../v8-beta/javascript/alertRulesGetSample.js | 30 - .../alertRulesListByResourceGroupSample.js | 32 - .../alertRulesListBySubscriptionSample.js | 31 - .../javascript/alertRulesUpdateSample.js | 52 - .../autoscaleSettingsCreateOrUpdateSample.js | 156 - .../autoscaleSettingsDeleteSample.js | 30 - .../javascript/autoscaleSettingsGetSample.js | 30 - ...oscaleSettingsListByResourceGroupSample.js | 32 - ...toscaleSettingsListBySubscriptionSample.js | 31 - .../autoscaleSettingsUpdateSample.js | 155 - .../v8-beta/javascript/baselinesListSample.js | 43 - .../dataCollectionEndpointsCreateSample.js | 39 - .../dataCollectionEndpointsDeleteSample.js | 33 - .../dataCollectionEndpointsGetSample.js | 33 - ...ctionEndpointsListByResourceGroupSample.js | 32 - ...ectionEndpointsListBySubscriptionSample.js | 31 - .../dataCollectionEndpointsUpdateSample.js | 36 - ...aCollectionRuleAssociationsCreateSample.js | 40 - ...aCollectionRuleAssociationsDeleteSample.js | 31 - ...dataCollectionRuleAssociationsGetSample.js | 31 - ...tionsListByDataCollectionEndpointSample.js | 36 - ...ionRuleAssociationsListByResourceSample.js | 33 - ...lectionRuleAssociationsListByRuleSample.js | 36 - .../dataCollectionRulesCreateSample.js | 103 - .../dataCollectionRulesDeleteSample.js | 30 - .../dataCollectionRulesGetSample.js | 30 - ...ollectionRulesListByResourceGroupSample.js | 32 - ...CollectionRulesListBySubscriptionSample.js | 31 - .../dataCollectionRulesUpdateSample.js | 36 - .../diagnosticSettingsCategoryGetSample.js | 31 - .../diagnosticSettingsCategoryListSample.js | 33 - .../diagnosticSettingsCreateOrUpdateSample.js | 100 - .../diagnosticSettingsDeleteSample.js | 31 - .../javascript/diagnosticSettingsGetSample.js | 50 - .../diagnosticSettingsListSample.js | 54 - .../javascript/eventCategoriesListSample.js | 31 - .../logProfilesCreateOrUpdateSample.js | 39 - .../javascript/logProfilesDeleteSample.js | 29 - .../javascript/logProfilesGetSample.js | 29 - .../javascript/logProfilesListSample.js | 31 - .../javascript/logProfilesUpdateSample.js | 38 - .../metricAlertsCreateOrUpdateSample.js | 448 --- .../javascript/metricAlertsDeleteSample.js | 30 - .../javascript/metricAlertsGetSample.js | 138 - .../metricAlertsListByResourceGroupSample.js | 32 - .../metricAlertsListBySubscriptionSample.js | 31 - .../metricAlertsStatusListByNameSample.js | 36 - .../metricAlertsStatusListSample.js | 30 - .../javascript/metricAlertsUpdateSample.js | 63 - .../javascript/metricDefinitionsListSample.js | 81 - .../javascript/metricNamespacesListSample.js | 35 - .../v8-beta/javascript/metricsListSample.js | 110 - .../javascript/operationsListSample.js | 28 - .../samples/v8-beta/javascript/package.json | 32 - .../javascript/predictiveMetricGetSample.js | 43 - ...EndpointConnectionsCreateOrUpdateSample.js | 42 - .../privateEndpointConnectionsDeleteSample.js | 35 - .../privateEndpointConnectionsGetSample.js | 35 - ...ConnectionsListByPrivateLinkScopeSample.js | 33 - .../privateLinkResourcesGetSample.js | 31 - ...nkResourcesListByPrivateLinkScopeSample.js | 33 - ...rivateLinkScopeOperationStatusGetSample.js | 33 - ...LinkScopedResourcesCreateOrUpdateSample.js | 40 - .../privateLinkScopedResourcesDeleteSample.js | 35 - .../privateLinkScopedResourcesGetSample.js | 31 - ...edResourcesListByPrivateLinkScopeSample.js | 36 - .../privateLinkScopesCreateOrUpdateSample.js | 73 - .../privateLinkScopesDeleteSample.js | 30 - .../javascript/privateLinkScopesGetSample.js | 30 - ...vateLinkScopesListByResourceGroupSample.js | 32 - .../javascript/privateLinkScopesListSample.js | 31 - .../privateLinkScopesUpdateTagsSample.js | 37 - .../samples/v8-beta/javascript/sample.env | 4 - ...scheduledQueryRulesCreateOrUpdateSample.js | 155 - .../scheduledQueryRulesDeleteSample.js | 30 - .../scheduledQueryRulesGetSample.js | 30 - ...uledQueryRulesListByResourceGroupSample.js | 32 - ...duledQueryRulesListBySubscriptionSample.js | 31 - .../scheduledQueryRulesUpdateSample.js | 31 - .../tenantActivityLogsListSample.js | 99 - .../vmInsightsGetOnboardingStatusSample.js | 101 - .../samples/v8-beta/typescript/README.md | 267 -- .../samples/v8-beta/typescript/package.json | 41 - .../samples/v8-beta/typescript/sample.env | 4 - ...cationsAtActionGroupResourceLevelSample.ts | 149 - ...NotificationsAtResourceGroupLevelSample.ts | 147 - .../src/actionGroupsCreateOrUpdateSample.ts | 147 - .../src/actionGroupsDeleteSample.ts | 33 - .../src/actionGroupsEnableReceiverSample.ts | 35 - .../typescript/src/actionGroupsGetSample.ts | 33 - ...cationsAtActionGroupResourceLevelSample.ts | 35 - ...NotificationsAtResourceGroupLevelSample.ts | 33 - .../actionGroupsGetTestNotificationsSample.ts | 29 - .../actionGroupsListByResourceGroupSample.ts | 34 - .../actionGroupsListBySubscriptionIdSample.ts | 31 - ...actionGroupsPostTestNotificationsSample.ts | 145 - .../src/actionGroupsUpdateSample.ts | 38 - .../activityLogAlertsCreateOrUpdateSample.ts | 154 - .../src/activityLogAlertsDeleteSample.ts | 33 - .../src/activityLogAlertsGetSample.ts | 33 - ...ivityLogAlertsListByResourceGroupSample.ts | 34 - ...vityLogAlertsListBySubscriptionIdSample.ts | 31 - .../src/activityLogAlertsUpdateSample.ts | 38 - .../typescript/src/activityLogsListSample.ts | 60 - .../src/alertRuleIncidentsGetSample.ts | 35 - ...alertRuleIncidentsListByAlertRuleSample.ts | 36 - .../src/alertRulesCreateOrUpdateSample.ts | 57 - .../typescript/src/alertRulesDeleteSample.ts | 30 - .../typescript/src/alertRulesGetSample.ts | 30 - .../alertRulesListByResourceGroupSample.ts | 34 - .../src/alertRulesListBySubscriptionSample.ts | 31 - .../typescript/src/alertRulesUpdateSample.ts | 59 - .../autoscaleSettingsCreateOrUpdateSample.ts | 156 - .../src/autoscaleSettingsDeleteSample.ts | 33 - .../src/autoscaleSettingsGetSample.ts | 33 - ...oscaleSettingsListByResourceGroupSample.ts | 34 - ...toscaleSettingsListBySubscriptionSample.ts | 31 - .../src/autoscaleSettingsUpdateSample.ts | 158 - .../typescript/src/baselinesListSample.ts | 43 - .../dataCollectionEndpointsCreateSample.ts | 43 - .../dataCollectionEndpointsDeleteSample.ts | 33 - .../src/dataCollectionEndpointsGetSample.ts | 33 - ...ctionEndpointsListByResourceGroupSample.ts | 34 - ...ectionEndpointsListBySubscriptionSample.ts | 31 - .../dataCollectionEndpointsUpdateSample.ts | 40 - ...aCollectionRuleAssociationsCreateSample.ts | 44 - ...aCollectionRuleAssociationsDeleteSample.ts | 34 - ...dataCollectionRuleAssociationsGetSample.ts | 34 - ...tionsListByDataCollectionEndpointSample.ts | 36 - ...ionRuleAssociationsListByResourceSample.ts | 35 - ...lectionRuleAssociationsListByRuleSample.ts | 36 - .../src/dataCollectionRulesCreateSample.ts | 111 - .../src/dataCollectionRulesDeleteSample.ts | 33 - .../src/dataCollectionRulesGetSample.ts | 33 - ...ollectionRulesListByResourceGroupSample.ts | 34 - ...CollectionRulesListBySubscriptionSample.ts | 31 - .../src/dataCollectionRulesUpdateSample.ts | 40 - .../diagnosticSettingsCategoryGetSample.ts | 31 - .../diagnosticSettingsCategoryListSample.ts | 33 - .../diagnosticSettingsCreateOrUpdateSample.ts | 108 - .../src/diagnosticSettingsDeleteSample.ts | 31 - .../src/diagnosticSettingsGetSample.ts | 50 - .../src/diagnosticSettingsListSample.ts | 54 - .../src/eventCategoriesListSample.ts | 31 - .../src/logProfilesCreateOrUpdateSample.ts | 42 - .../typescript/src/logProfilesDeleteSample.ts | 29 - .../typescript/src/logProfilesGetSample.ts | 29 - .../typescript/src/logProfilesListSample.ts | 31 - .../typescript/src/logProfilesUpdateSample.ts | 41 - .../src/metricAlertsCreateOrUpdateSample.ts | 487 --- .../src/metricAlertsDeleteSample.ts | 30 - .../typescript/src/metricAlertsGetSample.ts | 138 - .../metricAlertsListByResourceGroupSample.ts | 34 - .../metricAlertsListBySubscriptionSample.ts | 31 - .../src/metricAlertsStatusListByNameSample.ts | 36 - .../src/metricAlertsStatusListSample.ts | 33 - .../src/metricAlertsUpdateSample.ts | 67 - .../src/metricDefinitionsListSample.ts | 84 - .../src/metricNamespacesListSample.ts | 38 - .../typescript/src/metricsListSample.ts | 110 - .../typescript/src/operationsListSample.ts | 28 - .../src/predictiveMetricGetSample.ts | 43 - ...EndpointConnectionsCreateOrUpdateSample.ts | 42 - .../privateEndpointConnectionsDeleteSample.ts | 35 - .../privateEndpointConnectionsGetSample.ts | 35 - ...ConnectionsListByPrivateLinkScopeSample.ts | 33 - .../src/privateLinkResourcesGetSample.ts | 35 - ...nkResourcesListByPrivateLinkScopeSample.ts | 33 - ...rivateLinkScopeOperationStatusGetSample.ts | 33 - ...LinkScopedResourcesCreateOrUpdateSample.ts | 40 - .../privateLinkScopedResourcesDeleteSample.ts | 35 - .../privateLinkScopedResourcesGetSample.ts | 35 - ...edResourcesListByPrivateLinkScopeSample.ts | 36 - .../privateLinkScopesCreateOrUpdateSample.ts | 76 - .../src/privateLinkScopesDeleteSample.ts | 33 - .../src/privateLinkScopesGetSample.ts | 33 - ...vateLinkScopesListByResourceGroupSample.ts | 34 - .../src/privateLinkScopesListSample.ts | 31 - .../src/privateLinkScopesUpdateTagsSample.ts | 37 - ...scheduledQueryRulesCreateOrUpdateSample.ts | 156 - .../src/scheduledQueryRulesDeleteSample.ts | 33 - .../src/scheduledQueryRulesGetSample.ts | 33 - ...uledQueryRulesListByResourceGroupSample.ts | 34 - ...duledQueryRulesListBySubscriptionSample.ts | 31 - .../src/scheduledQueryRulesUpdateSample.ts | 35 - .../src/tenantActivityLogsListSample.ts | 102 - .../vmInsightsGetOnboardingStatusSample.ts | 105 - .../samples/v8-beta/typescript/tsconfig.json | 17 - sdk/monitor/arm-monitor/src/index.ts | 1 + sdk/monitor/arm-monitor/src/models/index.ts | 1096 ++++-- sdk/monitor/arm-monitor/src/models/mappers.ts | 3290 ++++++++++------- .../arm-monitor/src/models/parameters.ts | 55 +- sdk/monitor/arm-monitor/src/monitorClient.ts | 29 +- .../src/operations/actionGroups.ts | 36 +- .../src/operations/activityLogAlerts.ts | 65 +- .../src/operations/activityLogs.ts | 52 +- .../src/operations/alertRuleIncidents.ts | 24 +- .../arm-monitor/src/operations/alertRules.ts | 38 +- .../src/operations/autoscaleSettings.ts | 65 +- .../arm-monitor/src/operations/baselines.ts | 15 +- .../src/operations/dataCollectionEndpoints.ts | 63 +- .../dataCollectionRuleAssociations.ts | 106 +- .../src/operations/dataCollectionRules.ts | 63 +- .../src/operations/diagnosticSettings.ts | 19 +- .../operations/diagnosticSettingsCategory.ts | 19 +- .../src/operations/eventCategories.ts | 15 +- .../arm-monitor/src/operations/index.ts | 4 +- .../arm-monitor/src/operations/logProfiles.ts | 19 +- .../src/operations/metricAlerts.ts | 34 +- .../src/operations/metricDefinitions.ts | 15 +- .../src/operations/metricNamespaces.ts | 15 +- .../{metrics.ts => metricsOperations.ts} | 8 +- .../arm-monitor/src/operations/monitor.ts | 152 + .../src/operations/monitoringAccounts.ts | 479 +++ .../operations/privateLinkScopedResources.ts | 41 +- .../src/operations/privateLinkScopes.ts | 63 +- .../src/operations/scheduledQueryRules.ts | 278 +- .../src/operations/tenantActivityLogs.ts | 34 +- .../src/operationsInterfaces/index.ts | 4 +- .../{metrics.ts => metricsOperations.ts} | 4 +- .../src/operationsInterfaces/monitor.ts | 25 + .../monitoringAccounts.ts | 89 + .../scheduledQueryRules.ts | 42 +- sdk/monitor/arm-monitor/src/pagingHelper.ts | 39 + .../arm-monitor/test/monitor_examples.ts | 270 -- sdk/monitor/arm-monitor/test/sampleTest.ts | 43 + sdk/monitor/arm-monitor/tsconfig.json | 10 +- 371 files changed, 4987 insertions(+), 22464 deletions(-) delete mode 100644 sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_create_parameters_for_diagnosticsettings.json delete mode 100644 sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_delete_parameters_for_diagnosticsettings.json delete mode 100644 sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_create_test.json delete mode 100644 sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_delete_test.json delete mode 100644 sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_get_test.json delete mode 100644 sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_list_test.json delete mode 100644 sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_create_test.json delete mode 100644 sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_delete_test.json delete mode 100644 sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_get_test.json delete mode 100644 sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_list_test.json delete mode 100644 sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateNotificationsAtResourceGroupLevelSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateOrUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/actionGroupsDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/actionGroupsEnableReceiverSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/actionGroupsGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/actionGroupsListByResourceGroupSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/actionGroupsListBySubscriptionIdSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/actionGroupsPostTestNotificationsSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/actionGroupsUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/activityLogAlertsCreateOrUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/activityLogAlertsDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/activityLogAlertsGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/activityLogAlertsListByResourceGroupSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/activityLogAlertsListBySubscriptionIdSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/activityLogAlertsUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/activityLogsListSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/alertRuleIncidentsGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/alertRuleIncidentsListByAlertRuleSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/alertRulesCreateOrUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/alertRulesDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/alertRulesGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/alertRulesListByResourceGroupSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/alertRulesListBySubscriptionSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/alertRulesUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsCreateOrUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsListByResourceGroupSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsListBySubscriptionSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/baselinesListSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsCreateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsListByResourceGroupSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsListBySubscriptionSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsCreateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsListByResourceSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsListByRuleSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesCreateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesListByResourceGroupSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesListBySubscriptionSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCategoryGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCategoryListSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCreateOrUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsListSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/eventCategoriesListSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/logProfilesCreateOrUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/logProfilesDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/logProfilesGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/logProfilesListSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/logProfilesUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/metricAlertsCreateOrUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/metricAlertsDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/metricAlertsGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/metricAlertsListByResourceGroupSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/metricAlertsListBySubscriptionSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/metricAlertsStatusListByNameSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/metricAlertsStatusListSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/metricAlertsUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/metricDefinitionsListSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/metricNamespacesListSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/metricsListSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/operationsListSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/predictiveMetricGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsListByPrivateLinkScopeSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/privateLinkResourcesGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/privateLinkResourcesListByPrivateLinkScopeSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/privateLinkScopeOperationStatusGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesCreateOrUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesListByPrivateLinkScopeSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/privateLinkScopesCreateOrUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/privateLinkScopesDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/privateLinkScopesGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/privateLinkScopesListByResourceGroupSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/privateLinkScopesListSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/privateLinkScopesUpdateTagsSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesCreateOrUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesListByResourceGroupSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesListBySubscriptionSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/tenantActivityLogsListSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples-dev/vmInsightsGetOnboardingStatusSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/README.md delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateNotificationsAtResourceGroupLevelSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateOrUpdateSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsDeleteSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsEnableReceiverSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsListByResourceGroupSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsListBySubscriptionIdSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsPostTestNotificationsSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsUpdateSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsCreateOrUpdateSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsDeleteSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsGetSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsListByResourceGroupSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsListBySubscriptionIdSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsUpdateSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogsListSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRuleIncidentsGetSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRuleIncidentsListByAlertRuleSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesCreateOrUpdateSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesDeleteSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesGetSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesListByResourceGroupSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesListBySubscriptionSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesUpdateSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsCreateOrUpdateSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsDeleteSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsGetSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsListByResourceGroupSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsListBySubscriptionSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsUpdateSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/baselinesListSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsCreateSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsDeleteSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsGetSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsListByResourceGroupSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsListBySubscriptionSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsUpdateSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsCreateSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsDeleteSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsGetSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByResourceSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByRuleSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesCreateSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesDeleteSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesGetSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesListByResourceGroupSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesListBySubscriptionSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesUpdateSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCategoryGetSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCategoryListSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCreateOrUpdateSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsDeleteSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsGetSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsListSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/eventCategoriesListSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesCreateOrUpdateSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesDeleteSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesGetSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesListSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesUpdateSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsCreateOrUpdateSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsDeleteSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsGetSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsListByResourceGroupSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsListBySubscriptionSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsStatusListByNameSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsStatusListSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsUpdateSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricDefinitionsListSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricNamespacesListSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricsListSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/operationsListSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/package.json delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/predictiveMetricGetSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsCreateOrUpdateSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsDeleteSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsGetSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsListByPrivateLinkScopeSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkResourcesGetSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkResourcesListByPrivateLinkScopeSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopeOperationStatusGetSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesCreateOrUpdateSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesDeleteSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesGetSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesListByPrivateLinkScopeSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesCreateOrUpdateSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesDeleteSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesGetSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesListByResourceGroupSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesListSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesUpdateTagsSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/sample.env delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesCreateOrUpdateSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesDeleteSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesGetSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesListByResourceGroupSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesListBySubscriptionSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesUpdateSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActivityLogsListSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/javascript/vmInsightsGetOnboardingStatusSample.js delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/README.md delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/package.json delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/sample.env delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateNotificationsAtResourceGroupLevelSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateOrUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsEnableReceiverSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsListByResourceGroupSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsListBySubscriptionIdSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsPostTestNotificationsSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsCreateOrUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsListByResourceGroupSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsListBySubscriptionIdSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogsListSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRuleIncidentsGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRuleIncidentsListByAlertRuleSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesCreateOrUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesListByResourceGroupSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesListBySubscriptionSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsCreateOrUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsListByResourceGroupSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsListBySubscriptionSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/baselinesListSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsCreateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsListByResourceGroupSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsListBySubscriptionSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsCreateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByResourceSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByRuleSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesCreateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesListByResourceGroupSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesListBySubscriptionSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCategoryGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCategoryListSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCreateOrUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsListSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/eventCategoriesListSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesCreateOrUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesListSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsCreateOrUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsListByResourceGroupSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsListBySubscriptionSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsStatusListByNameSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsStatusListSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricDefinitionsListSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricNamespacesListSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricsListSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/operationsListSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/predictiveMetricGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsListByPrivateLinkScopeSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkResourcesGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkResourcesListByPrivateLinkScopeSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopeOperationStatusGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesCreateOrUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesListByPrivateLinkScopeSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesCreateOrUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesListByResourceGroupSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesListSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesUpdateTagsSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesCreateOrUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesDeleteSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesGetSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesListByResourceGroupSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesListBySubscriptionSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesUpdateSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActivityLogsListSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/vmInsightsGetOnboardingStatusSample.ts delete mode 100644 sdk/monitor/arm-monitor/samples/v8-beta/typescript/tsconfig.json rename sdk/monitor/arm-monitor/src/operations/{metrics.ts => metricsOperations.ts} (88%) create mode 100644 sdk/monitor/arm-monitor/src/operations/monitor.ts create mode 100644 sdk/monitor/arm-monitor/src/operations/monitoringAccounts.ts rename sdk/monitor/arm-monitor/src/operationsInterfaces/{metrics.ts => metricsOperations.ts} (86%) create mode 100644 sdk/monitor/arm-monitor/src/operationsInterfaces/monitor.ts create mode 100644 sdk/monitor/arm-monitor/src/operationsInterfaces/monitoringAccounts.ts create mode 100644 sdk/monitor/arm-monitor/src/pagingHelper.ts delete mode 100644 sdk/monitor/arm-monitor/test/monitor_examples.ts create mode 100644 sdk/monitor/arm-monitor/test/sampleTest.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 91ad81e837e8..9cdd83383e5c 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -2131,7 +2131,7 @@ packages: resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} dependencies: '@types/connect': 3.4.35 - '@types/node': 14.18.36 + '@types/node': 18.11.18 dev: false /@types/chai-as-promised/7.1.5: @@ -2153,7 +2153,7 @@ packages: /@types/connect/3.4.35: resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} dependencies: - '@types/node': 14.18.36 + '@types/node': 18.11.18 dev: false /@types/cookie/0.4.1: @@ -2163,7 +2163,7 @@ packages: /@types/cors/2.8.13: resolution: {integrity: sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==} dependencies: - '@types/node': 14.18.36 + '@types/node': 18.11.18 dev: false /@types/debug/4.1.7: @@ -2190,7 +2190,7 @@ packages: /@types/express-serve-static-core/4.17.32: resolution: {integrity: sha512-aI5h/VOkxOF2Z1saPy0Zsxs5avets/iaiAJYznQFm5By/pamU31xWKL//epiF4OfUA2qTOc9PV6tCUjhO8wlZA==} dependencies: - '@types/node': 14.18.36 + '@types/node': 18.11.18 '@types/qs': 6.9.7 '@types/range-parser': 1.2.4 dev: false @@ -2207,20 +2207,20 @@ packages: /@types/fs-extra/8.1.2: resolution: {integrity: sha512-SvSrYXfWSc7R4eqnOzbQF4TZmfpNSM9FrSWLU3EUnWBuyZqNBOrv1B1JA3byUDPUl9z4Ab3jeZG2eDdySlgNMg==} dependencies: - '@types/node': 14.18.36 + '@types/node': 18.11.18 dev: false /@types/fs-extra/9.0.13: resolution: {integrity: sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==} dependencies: - '@types/node': 14.18.36 + '@types/node': 18.11.18 dev: false /@types/glob/7.2.0: resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} dependencies: '@types/minimatch': 5.1.2 - '@types/node': 14.18.36 + '@types/node': 18.11.18 dev: false /@types/inquirer/8.2.5: @@ -2232,7 +2232,7 @@ packages: /@types/is-buffer/2.0.0: resolution: {integrity: sha512-0f7N/e3BAz32qDYvgB4d2cqv1DqUwvGxHkXsrucICn8la1Vb6Yl6Eg8mPScGwUiqHJeE7diXlzaK+QMA9m4Gxw==} dependencies: - '@types/node': 14.18.36 + '@types/node': 18.11.18 dev: false /@types/json-schema/7.0.11: @@ -2246,13 +2246,13 @@ packages: /@types/jsonwebtoken/9.0.0: resolution: {integrity: sha512-mM4TkDpA9oixqg1Fv2vVpOFyIVLJjm5x4k0V+K/rEsizfjD7Tk7LKk3GTtbB7KCfP0FEHQtsZqFxYA0+sijNVg==} dependencies: - '@types/node': 14.18.36 + '@types/node': 18.11.18 dev: false /@types/jws/3.2.4: resolution: {integrity: sha512-aqtH4dPw1wUjFZaeMD1ak/pf8iXlu/odFe+trJrvw0g1sTh93i+SCykg0Ek8C6B7rVK3oBORbfZAsKO7P10etg==} dependencies: - '@types/node': 14.18.36 + '@types/node': 18.11.18 dev: false /@types/mdast/3.0.10: @@ -2288,7 +2288,7 @@ packages: /@types/node-fetch/2.6.2: resolution: {integrity: sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==} dependencies: - '@types/node': 14.18.36 + '@types/node': 18.11.18 form-data: 3.0.1 dev: false @@ -2343,7 +2343,7 @@ packages: /@types/resolve/1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 14.18.36 + '@types/node': 18.11.18 dev: false /@types/semaphore/1.1.1: @@ -2358,7 +2358,7 @@ packages: resolution: {integrity: sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==} dependencies: '@types/mime': 3.0.1 - '@types/node': 14.18.36 + '@types/node': 18.11.18 dev: false /@types/sinon/10.0.13: @@ -2380,13 +2380,13 @@ packages: /@types/stoppable/1.1.1: resolution: {integrity: sha512-b8N+fCADRIYYrGZOcmOR8ZNBOqhktWTB/bMUl5LvGtT201QKJZOOH5UsFyI3qtteM6ZAJbJqZoBcLqqxKIwjhw==} dependencies: - '@types/node': 14.18.36 + '@types/node': 18.11.18 dev: false /@types/through/0.0.30: resolution: {integrity: sha512-FvnCJljyxhPM3gkRgWmxmDZyAQSiBQQWLI0A0VFL0K7W1oRUrPJSqNO0NvTnLkBcotdlp3lKvaT0JrnyRDkzOg==} dependencies: - '@types/node': 14.18.36 + '@types/node': 18.11.18 dev: false /@types/tough-cookie/4.0.2: @@ -2400,13 +2400,13 @@ packages: /@types/tunnel/0.0.1: resolution: {integrity: sha512-AOqu6bQu5MSWwYvehMXLukFHnupHrpZ8nvgae5Ggie9UwzDR1CCwoXgSSWNZJuyOlCdfdsWMA5F2LlmvyoTv8A==} dependencies: - '@types/node': 14.18.36 + '@types/node': 18.11.18 dev: false /@types/tunnel/0.0.3: resolution: {integrity: sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA==} dependencies: - '@types/node': 14.18.36 + '@types/node': 18.11.18 dev: false /@types/underscore/1.11.4: @@ -2424,19 +2424,19 @@ packages: /@types/ws/7.4.7: resolution: {integrity: sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==} dependencies: - '@types/node': 14.18.36 + '@types/node': 18.11.18 dev: false /@types/ws/8.5.4: resolution: {integrity: sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==} dependencies: - '@types/node': 14.18.36 + '@types/node': 18.11.18 dev: false /@types/xml2js/0.4.11: resolution: {integrity: sha512-JdigeAKmCyoJUiQljjr7tQG3if9NkqGUgwEUqBvV0N7LM4HyQk7UXCnusRa1lnvXAEYJ8mw8GtZWioagNztOwA==} dependencies: - '@types/node': 14.18.36 + '@types/node': 18.11.18 dev: false /@types/yargs-parser/21.0.0: @@ -2453,7 +2453,7 @@ packages: resolution: {integrity: sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==} requiresBuild: true dependencies: - '@types/node': 14.18.36 + '@types/node': 18.11.18 dev: false optional: true @@ -2843,8 +2843,8 @@ packages: hasBin: true dev: false - /autorest/3.6.2: - resolution: {integrity: sha512-JRMmAsSG4wplYUkjVOWELidF+P/OG9BjF542aQcbt4Qj85bJ+7EzRCTV09vbf8f4ScOB+I68+9IcskjNTU9UkQ==} + /autorest/3.6.3: + resolution: {integrity: sha512-j/Axwk9bniifTNtBLYVxfQZGQIGPKljFaCQCBWOiybVar2j3tkHP1btiC4a/t9pAJXY6IaFgWctoPM3G/Puhyg==} engines: {node: '>=12.0.0'} hasBin: true requiresBuild: true @@ -3491,7 +3491,7 @@ packages: resolution: {integrity: sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==} deprecated: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) dependencies: - ms: 2.1.1 + ms: 2.1.3 dev: false /debug/3.2.7: @@ -3673,7 +3673,7 @@ packages: dependencies: semver: 7.3.8 shelljs: 0.8.5 - typescript: 5.0.0-dev.20230103 + typescript: 5.0.0-dev.20230104 dev: false /downlevel-dts/0.7.0: @@ -3691,7 +3691,7 @@ packages: dependencies: semver: 7.3.8 shelljs: 0.8.5 - typescript: 4.6.4 + typescript: 4.9.4 dev: false /ecdsa-sig-formatter/1.0.11: @@ -3742,7 +3742,7 @@ packages: dependencies: '@types/cookie': 0.4.1 '@types/cors': 2.8.13 - '@types/node': 14.18.36 + '@types/node': 18.11.18 accepts: 1.3.8 base64id: 2.0.0 cookie: 0.4.2 @@ -4725,7 +4725,7 @@ packages: fs.realpath: 1.0.0 inflight: 1.0.6 inherits: 2.0.4 - minimatch: 3.0.4 + minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 dev: false @@ -8270,8 +8270,8 @@ packages: hasBin: true dev: false - /typescript/5.0.0-dev.20230103: - resolution: {integrity: sha512-vHf8Y8+op6MsFIDgvNmZhAIAUGVmzFzYCUBysMS6hlxlhSWIh1h5AXAW7WKs4GYr325jwTF/L72NKUYZHSD6Mw==} + /typescript/5.0.0-dev.20230104: + resolution: {integrity: sha512-1W+qcvZu8Spq1fi/ajNcSobXt2ZBPDqyt6qwoNGaMgX1X82ZYmlh50oJfJVf44DNVwXNAsRfyKJ3UkXVf4OYsw==} engines: {node: '>=4.2.0'} hasBin: true dev: false @@ -8874,7 +8874,7 @@ packages: '@types/chai': 4.3.4 '@types/mocha': 7.0.2 '@types/node': 14.18.36 - autorest: 3.6.2 + autorest: 3.6.3 chai: 4.3.7 cross-env: 7.0.3 csv-parse: 5.3.3 @@ -9163,7 +9163,7 @@ packages: '@microsoft/api-extractor': 7.33.7 '@types/chai': 4.3.4 '@types/node': 14.18.36 - autorest: 3.6.2 + autorest: 3.6.3 chai: 4.3.7 cross-env: 7.0.3 dotenv: 8.6.0 @@ -9696,7 +9696,7 @@ packages: '@microsoft/api-extractor': 7.33.7 '@types/chai': 4.3.4 '@types/node': 14.18.36 - autorest: 3.6.2 + autorest: 3.6.3 chai: 4.3.7 cross-env: 7.0.3 dotenv: 8.6.0 @@ -10387,7 +10387,7 @@ packages: '@microsoft/api-extractor': 7.33.7 '@types/chai': 4.3.4 '@types/node': 14.18.36 - autorest: 3.6.2 + autorest: 3.6.3 chai: 4.3.7 cross-env: 7.0.3 dotenv: 8.6.0 @@ -10619,7 +10619,7 @@ packages: '@microsoft/api-extractor': 7.33.7 '@types/chai': 4.3.4 '@types/node': 14.18.36 - autorest: 3.6.2 + autorest: 3.6.3 chai: 4.3.7 cross-env: 7.0.3 dotenv: 8.6.0 @@ -12610,7 +12610,7 @@ packages: dev: false file:projects/arm-monitor.tgz: - resolution: {integrity: sha512-JqAHhcYJwMaGSP5SvF2dZyO6RFZaYueuYmtilPzpg6vje557tOyo94Ud179y+XPTayevkly2risLB+bRd6JM3w==, tarball: file:projects/arm-monitor.tgz} + resolution: {integrity: sha512-JDZVaV0iO02HyTSiiyi0nfvk4oVJXBBVGA4nfQoPJWHSpfJH1/iGLw2KMylK9+vDUhuiBd/wMTfXp+0qXZqjzw==, tarball: file:projects/arm-monitor.tgz} name: '@rush-temp/arm-monitor' version: 0.0.0 dependencies: @@ -12623,18 +12623,18 @@ packages: '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 '@types/chai': 4.3.4 + '@types/node': 14.18.36 chai: 4.3.7 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 - rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1 + rollup-plugin-sourcemaps: 0.6.3_7e8d81808a761355f6c3da2f25cfe887 tslib: 2.4.1 - typescript: 4.6.4 + typescript: 4.8.4 uglify-js: 3.17.4 transitivePeerDependencies: - - '@types/node' - supports-color dev: false @@ -12812,7 +12812,7 @@ packages: '@microsoft/api-extractor': 7.33.7 '@types/chai': 4.3.4 '@types/node': 14.18.36 - autorest: 3.6.2 + autorest: 3.6.3 chai: 4.3.7 cross-env: 7.0.3 dotenv: 8.6.0 @@ -13966,7 +13966,7 @@ packages: '@microsoft/api-extractor': 7.33.7 '@types/chai': 4.3.4 '@types/node': 14.18.36 - autorest: 3.6.2 + autorest: 3.6.3 chai: 4.3.7 cross-env: 7.0.3 dotenv: 8.6.0 @@ -15294,7 +15294,7 @@ packages: '@types/chai': 4.3.4 '@types/mocha': 7.0.2 '@types/node': 14.18.36 - autorest: 3.6.2 + autorest: 3.6.3 chai: 4.3.7 cross-env: 7.0.3 dotenv: 8.6.0 @@ -15988,7 +15988,7 @@ packages: '@types/node': 14.18.36 '@types/prettier': 2.7.2 '@types/semver': 7.3.13 - autorest: 3.6.2 + autorest: 3.6.3 builtin-modules: 3.3.0 chai: 4.3.7 chai-as-promised: 7.1.1_chai@4.3.7 @@ -16034,7 +16034,7 @@ packages: '@microsoft/api-extractor': 7.33.7 '@types/chai': 4.3.4 '@types/node': 14.18.36 - autorest: 3.6.2 + autorest: 3.6.3 chai: 4.3.7 cross-env: 7.0.3 dotenv: 8.6.0 @@ -16850,7 +16850,7 @@ packages: '@types/chai': 4.3.4 '@types/node': 12.20.55 '@types/uuid': 8.3.4 - autorest: 3.6.2 + autorest: 3.6.3 chai: 4.3.7 cross-env: 7.0.3 dotenv: 8.6.0 @@ -16956,7 +16956,7 @@ packages: '@types/chai': 4.3.4 '@types/mocha': 7.0.2 '@types/node': 14.18.36 - autorest: 3.6.2 + autorest: 3.6.3 chai: 4.3.7 cross-env: 7.0.3 dotenv: 8.6.0 @@ -17000,7 +17000,7 @@ packages: '@types/chai': 4.3.4 '@types/mocha': 7.0.2 '@types/node': 14.18.36 - autorest: 3.6.2 + autorest: 3.6.3 chai: 4.3.7 cross-env: 7.0.3 dotenv: 8.6.0 @@ -17044,7 +17044,7 @@ packages: '@types/chai': 4.3.4 '@types/mocha': 7.0.2 '@types/node': 12.20.55 - autorest: 3.6.2 + autorest: 3.6.3 chai: 4.3.7 cross-env: 7.0.3 dotenv: 8.6.0 @@ -17135,7 +17135,7 @@ packages: '@types/chai': 4.3.4 '@types/mocha': 7.0.2 '@types/node': 14.18.36 - autorest: 3.6.2 + autorest: 3.6.3 chai: 4.3.7 cross-env: 7.0.3 dotenv: 8.6.0 @@ -19209,7 +19209,7 @@ packages: dev: false file:projects/web-pubsub-client.tgz: - resolution: {integrity: sha512-Oc9P1qEG7j1/x5vxElDNAR1HvB4MjTHj49e6G4eZZHSDjCS9EDFNtYg+gauXUYmJe0ESYPLAy4dfz2tdifps2A==, tarball: file:projects/web-pubsub-client.tgz} + resolution: {integrity: sha512-+Apad1BfmHLxmvPilgDRLuuW5MS/769gUHJZoNLd6g+CicZnt/no0bsPcSOuXXler5WqeM0kFu7grG0q2MOCzg==, tarball: file:projects/web-pubsub-client.tgz} name: '@rush-temp/web-pubsub-client' version: 0.0.0 dependencies: diff --git a/sdk/monitor/arm-monitor/CHANGELOG.md b/sdk/monitor/arm-monitor/CHANGELOG.md index 36737ae2e77b..a752337553f3 100644 --- a/sdk/monitor/arm-monitor/CHANGELOG.md +++ b/sdk/monitor/arm-monitor/CHANGELOG.md @@ -1,19 +1,12 @@ # Release History - -## 8.0.0-beta.3 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 8.0.0-beta.2 (2022-07-29) + +## 8.0.0-beta.3 (2023-01-05) **Features** + - Added operation group MetricsOperations + - Added operation group Monitor + - Added operation group MonitoringAccounts - Added operation group PredictiveMetric - Added operation ActionGroups.beginCreateNotificationsAtActionGroupResourceLevel - Added operation ActionGroups.beginCreateNotificationsAtActionGroupResourceLevelAndWait @@ -34,10 +27,10 @@ - Added Interface ActionGroupsGetTestNotificationsAtResourceGroupLevelOptionalParams - Added Interface ActionGroupsPostTestNotificationsHeaders - Added Interface ActionList + - Added Interface Actions - Added Interface ActivityLogAlertResource - Added Interface ActivityLogAlertsListByResourceGroupNextOptionalParams - Added Interface ActivityLogAlertsListBySubscriptionIdNextOptionalParams - - Added Interface AlertingAction - Added Interface AlertRuleAllOfCondition - Added Interface AlertRuleAnyOfOrLeafCondition - Added Interface AlertRuleLeafCondition @@ -50,6 +43,8 @@ - Added Interface AzureMonitorPrivateLinkScope - Added Interface AzureResourceAutoGenerated - Added Interface ColumnDefinition + - Added Interface Condition + - Added Interface ConditionFailingPeriods - Added Interface DataCollectionEndpointConfigurationAccess - Added Interface DataCollectionEndpointLogsIngestion - Added Interface DataCollectionEndpointNetworkAcls @@ -70,8 +65,14 @@ - Added Interface DiagnosticSettingsCategoryResource - Added Interface DiagnosticSettingsResource - Added Interface DynamicMetricCriteria + - Added Interface ErrorDetailAutoGenerated + - Added Interface ErrorResponseAdditionalInfo - Added Interface ErrorResponseAutoGenerated + - Added Interface ErrorResponseAutoGenerated2 + - Added Interface ErrorResponseDetails + - Added Interface Identity - Added Interface IisLogsDataSource + - Added Interface IngestionSettings - Added Interface LocationThresholdRuleCondition - Added Interface LogFilesDataSource - Added Interface LogFilesDataSourceSettings @@ -79,14 +80,33 @@ - Added Interface LogFileSettingsText - Added Interface LogFileTextSettings - Added Interface LogProfileResource - - Added Interface LogSearchRuleResource - - Added Interface LogToMetricAction - Added Interface ManagementEventRuleCondition - Added Interface Metadata - Added Interface MetricAlertMultipleResourceMultipleMetricCriteria - Added Interface MetricAlertResource - Added Interface MetricAlertSingleResourceMultipleMetricCriteria - Added Interface MetricCriteria + - Added Interface Metrics + - Added Interface MonitoringAccount + - Added Interface MonitoringAccountDefaultIngestionSettings + - Added Interface MonitoringAccountMetrics + - Added Interface MonitoringAccountResource + - Added Interface MonitoringAccountResourceForUpdate + - Added Interface MonitoringAccountResourceListResult + - Added Interface MonitoringAccountResourceProperties + - Added Interface MonitoringAccountsCreateOptionalParams + - Added Interface MonitoringAccountsDeleteOptionalParams + - Added Interface MonitoringAccountsGetOptionalParams + - Added Interface MonitoringAccountsListByResourceGroupNextOptionalParams + - Added Interface MonitoringAccountsListByResourceGroupOptionalParams + - Added Interface MonitoringAccountsListBySubscriptionNextOptionalParams + - Added Interface MonitoringAccountsListBySubscriptionOptionalParams + - Added Interface MonitoringAccountsUpdateOptionalParams + - Added Interface MonitorOperationsListNextOptionalParams + - Added Interface MonitorOperationsListOptionalParams + - Added Interface OperationAutoGenerated + - Added Interface OperationDisplayAutoGenerated + - Added Interface OperationListResultAutoGenerated - Added Interface PredictiveAutoscalePolicy - Added Interface PredictiveMetricGetOptionalParams - Added Interface PredictiveResponse @@ -103,11 +123,20 @@ - Added Interface RuleEmailAction - Added Interface RuleManagementEventDataSource - Added Interface RuleMetricDataSource + - Added Interface RuleResolveConfiguration - Added Interface RuleWebhookAction + - Added Interface ScheduledQueryRuleCriteria + - Added Interface ScheduledQueryRuleResource + - Added Interface ScheduledQueryRuleResourceCollection + - Added Interface ScheduledQueryRuleResourcePatch + - Added Interface ScheduledQueryRulesListByResourceGroupNextOptionalParams + - Added Interface ScheduledQueryRulesListBySubscriptionNextOptionalParams - Added Interface ScopedResource - Added Interface StreamDeclaration - Added Interface ThresholdRuleCondition - Added Interface TrackedResource + - Added Interface TrackedResourceAutoGenerated + - Added Interface UserIdentityProperties - Added Interface VMInsightsOnboardingStatus - Added Interface WebtestLocationAvailabilityCriteria - Added Type Alias AccessMode @@ -115,17 +144,35 @@ - Added Type Alias ActionGroupsCreateNotificationsAtResourceGroupLevelResponse - Added Type Alias ActionGroupsGetTestNotificationsAtActionGroupResourceLevelResponse - Added Type Alias ActionGroupsGetTestNotificationsAtResourceGroupLevelResponse + - Added Type Alias ActionType - Added Type Alias ActivityLogAlertsListByResourceGroupNextResponse - Added Type Alias ActivityLogAlertsListBySubscriptionIdNextResponse - Added Type Alias DataCollectionRuleAssociationsListByDataCollectionEndpointNextResponse - Added Type Alias DataCollectionRuleAssociationsListByDataCollectionEndpointResponse + - Added Type Alias DimensionOperator + - Added Type Alias IdentityType + - Added Type Alias Kind - Added Type Alias KnownColumnDefinitionType - Added Type Alias KnownLogFilesDataSourceFormat - Added Type Alias KnownLogFileTextSettingsRecordStartTimestampFormat + - Added Type Alias MonitoringAccountsCreateResponse + - Added Type Alias MonitoringAccountsGetResponse + - Added Type Alias MonitoringAccountsListByResourceGroupNextResponse + - Added Type Alias MonitoringAccountsListByResourceGroupResponse + - Added Type Alias MonitoringAccountsListBySubscriptionNextResponse + - Added Type Alias MonitoringAccountsListBySubscriptionResponse + - Added Type Alias MonitoringAccountsUpdateResponse + - Added Type Alias MonitorOperationsListNextResponse + - Added Type Alias MonitorOperationsListResponse + - Added Type Alias Origin - Added Type Alias PredictiveAutoscalePolicyScaleMode - Added Type Alias PredictiveMetricGetResponse - Added Type Alias PrivateEndpointConnectionProvisioningState - Added Type Alias PrivateEndpointServiceConnectionStatus + - Added Type Alias PublicNetworkAccess + - Added Type Alias ScheduledQueryRulesListByResourceGroupNextResponse + - Added Type Alias ScheduledQueryRulesListBySubscriptionNextResponse + - Added Type Alias TimeAggregation - Interface AutoscaleSettingResourcePatch has a new optional parameter predictiveAutoscalePolicy - Interface DataCollectionRule has a new optional parameter dataCollectionEndpointId - Interface DataCollectionRule has a new optional parameter metadata @@ -141,24 +188,50 @@ - Interface DataSourcesSpec has a new optional parameter logFiles - Interface LogSettings has a new optional parameter categoryGroup - Interface Resource has a new optional parameter systemData - - Class MonitorClient has a new parameter predictiveMetric - Added Enum KnownAccessMode + - Added Enum KnownActionType - Added Enum KnownCategoryType + - Added Enum KnownDimensionOperator + - Added Enum KnownKind - Added Enum KnownKnownColumnDefinitionType - Added Enum KnownKnownLogFilesDataSourceFormat - Added Enum KnownKnownLogFileTextSettingsRecordStartTimestampFormat + - Added Enum KnownOrigin - Added Enum KnownPrivateEndpointConnectionProvisioningState - Added Enum KnownPrivateEndpointServiceConnectionStatus + - Added Enum KnownPublicNetworkAccess + - Added Enum KnownTimeAggregation + - Enum KnownProvisioningState has a new value Creating + - Enum KnownProvisioningState has a new value Deleting + - Added function getContinuationToken **Breaking Changes** + - Removed operation group Metrics - Operation ActivityLogAlerts.update has a new signature + - Operation ScheduledQueryRules.createOrUpdate has a new signature + - Operation ScheduledQueryRules.update has a new signature + - Interface ActivityLogsListNextOptionalParams no longer has parameter select - Interface AzureResource no longer has parameter identity - Interface AzureResource no longer has parameter kind - Interface PrivateEndpointConnectionListResult no longer has parameter nextLink - Interface PrivateLinkResourceListResult no longer has parameter nextLink - Interface ResourceAutoGenerated no longer has parameter etag - Interface ResourceAutoGenerated no longer has parameter kind + - Interface ScheduledQueryRulesListByResourceGroupOptionalParams no longer has parameter filter + - Interface ScheduledQueryRulesListBySubscriptionOptionalParams no longer has parameter filter + - Interface TenantActivityLogsListNextOptionalParams no longer has parameter filter + - Interface TenantActivityLogsListNextOptionalParams no longer has parameter select + - Type of parameter operator of interface Dimension is changed from Operator to DimensionOperator + - Type of parameter error of interface ErrorContract is changed from ErrorResponse to ErrorResponseDetails + - Type of parameter error of interface OperationStatus is changed from ErrorResponseCommon to ErrorDetail + - Class MonitorClient no longer has parameter metrics + - Removed Enum KnownConditionalOperator + - Removed Enum KnownEnabled + - Removed Enum KnownMetricTriggerType + - Removed Enum KnownQueryType + - Enum KnownOperator no longer has value Include + - Enum KnownProvisioningState no longer has value Deploying ## 7.0.0 (2021-12-20) diff --git a/sdk/monitor/arm-monitor/LICENSE b/sdk/monitor/arm-monitor/LICENSE index 5d1d36e0af80..3a1d9b6f24f7 100644 --- a/sdk/monitor/arm-monitor/LICENSE +++ b/sdk/monitor/arm-monitor/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2022 Microsoft +Copyright (c) 2023 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/monitor/arm-monitor/_meta.json b/sdk/monitor/arm-monitor/_meta.json index 964036d46ad2..170ee04ebb03 100644 --- a/sdk/monitor/arm-monitor/_meta.json +++ b/sdk/monitor/arm-monitor/_meta.json @@ -1,8 +1,8 @@ { - "commit": "1dd79c416cdccde274113ec03b92b75069fad464", + "commit": "76f3342a830bbf03cccc9c9a1ee76b8e9b4a2228", "readme": "specification/monitor/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\monitor\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.1.20220721.1 --generate-sample=true", + "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/monitor/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.5", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.0", - "use": "@autorest/typescript@6.0.0-rc.1.20220721.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.5.4", + "use": "@autorest/typescript@6.0.0-rc.5" } \ No newline at end of file diff --git a/sdk/monitor/arm-monitor/package.json b/sdk/monitor/arm-monitor/package.json index 32cee388dff8..e507556e4432 100644 --- a/sdk/monitor/arm-monitor/package.json +++ b/sdk/monitor/arm-monitor/package.json @@ -11,7 +11,7 @@ "@azure/core-lro": "^2.2.0", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.5.0", + "@azure/core-client": "^1.6.1", "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" @@ -36,7 +36,7 @@ "mkdirp": "^1.0.4", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", - "typescript": "~4.6.0", + "typescript": "~4.8.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", @@ -46,11 +46,8 @@ "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", - "@azure/dev-tool": "^1.0.0", - "@azure/arm-eventhub": "^5.0.0", - "@azure/arm-logic": "^8.0.0", - "@azure/arm-operationalinsights": "^8.0.0", - "@azure/arm-storage": "^17.0.0" + "@types/node": "^14.0.0", + "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/monitor/arm-monitor", "repository": { @@ -113,13 +110,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-monitor?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_create_parameters_for_diagnosticsettings.json b/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_create_parameters_for_diagnosticsettings.json deleted file mode 100644 index e510d7210be0..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_create_parameters_for_diagnosticsettings.json +++ /dev/null @@ -1,1858 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Logic/workflows/myworkflowxxx?api-version=2019-05-01", - "RequestMethod": "PUT", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Length": "252", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-logic/8.0.0 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "4b9531ca-5c12-4d33-91f9-e0c12e1d65a1" - }, - "RequestBody": { - "location": "eastus", - "properties": { - "definition": { - "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", - "contentVersion": "1.0.0.0", - "parameters": {}, - "triggers": {}, - "actions": {}, - "outputs": {} - } - } - }, - "StatusCode": 201, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "1816", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:30:30 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "e4091552-d8d3-4bd6-be90-20dee872efa9", - "x-ms-ratelimit-remaining-subscription-writes": "1199", - "x-ms-request-id": "eastus:047a73b0-e641-42ed-a334-1b4309d7137c", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023030Z:e4091552-d8d3-4bd6-be90-20dee872efa9" - }, - "ResponseBody": { - "properties": { - "provisioningState": "Succeeded", - "createdTime": "2022-07-29T02:30:29.4141863Z", - "changedTime": "2022-07-29T02:30:29.4086103Z", - "state": "Enabled", - "version": "08585425450560880545", - "accessEndpoint": "https://prod-19.eastus.logic.azure.com:443/workflows/2afcc9487d4641228c57efdbec247bc5", - "definition": { - "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", - "contentVersion": "1.0.0.0", - "parameters": {}, - "triggers": {}, - "actions": {}, - "outputs": {} - }, - "parameters": {}, - "endpointsConfiguration": { - "workflow": { - "outgoingIpAddresses": [ - { - "address": "13.92.98.111" - }, - { - "address": "40.121.91.41" - }, - { - "address": "40.114.82.191" - }, - { - "address": "23.101.139.153" - }, - { - "address": "23.100.29.190" - }, - { - "address": "23.101.136.201" - }, - { - "address": "104.45.153.81" - }, - { - "address": "23.101.132.208" - }, - { - "address": "52.226.216.197" - }, - { - "address": "52.226.216.187" - }, - { - "address": "40.76.151.25" - }, - { - "address": "40.76.148.50" - }, - { - "address": "20.84.29.29" - }, - { - "address": "20.84.29.18" - }, - { - "address": "40.76.174.83" - }, - { - "address": "40.76.174.39" - } - ], - "accessEndpointIpAddresses": [ - { - "address": "137.135.106.54" - }, - { - "address": "40.117.99.79" - }, - { - "address": "40.117.100.228" - }, - { - "address": "137.116.126.165" - }, - { - "address": "52.226.216.209" - }, - { - "address": "40.76.151.124" - }, - { - "address": "20.84.29.150" - }, - { - "address": "40.76.174.148" - } - ] - }, - "connector": { - "outgoingIpAddresses": [ - { - "address": "40.71.249.139" - }, - { - "address": "40.71.249.205" - }, - { - "address": "40.114.40.132" - }, - { - "address": "40.71.11.80/28" - }, - { - "address": "40.71.15.160/27" - }, - { - "address": "52.188.157.160" - }, - { - "address": "20.88.153.176/28" - }, - { - "address": "20.88.153.192/27" - }, - { - "address": "52.151.221.184" - }, - { - "address": "52.151.221.119" - } - ] - } - } - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Logic/workflows/myworkflowxxx", - "name": "myworkflowxxx", - "type": "Microsoft.Logic/workflows", - "location": "eastus" - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy?api-version=2021-09-01", - "RequestMethod": "PUT", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Length": "274", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-storage/17.2.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "97e055d7-3a45-40de-8d32-1802e888b609" - }, - "RequestBody": { - "sku": { - "name": "Standard_GRS" - }, - "kind": "StorageV2", - "location": "eastus", - "tags": { - "key1": "value1", - "key2": "value2" - }, - "properties": { - "encryption": { - "services": { - "blob": { - "enabled": true, - "keyType": "Account" - }, - "file": { - "enabled": true, - "keyType": "Account" - } - }, - "keySource": "Microsoft.Storage" - } - } - }, - "StatusCode": 202, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Content-Type": "text/plain; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:30:34 GMT", - "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Storage/locations/eastus/asyncoperations/2f700f34-20d2-41a2-b3a3-8950aa164e79?monitor=true\u0026api-version=2021-09-01", - "Pragma": "no-cache", - "Retry-After": "17", - "Server": "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "0f49279e-51db-417f-b896-919f75095738", - "x-ms-ratelimit-remaining-subscription-writes": "1198", - "x-ms-request-id": "2f700f34-20d2-41a2-b3a3-8950aa164e79", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023035Z:0f49279e-51db-417f-b896-919f75095738" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Storage/locations/eastus/asyncoperations/2f700f34-20d2-41a2-b3a3-8950aa164e79?monitor=true\u0026api-version=2021-09-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-storage/17.2.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "92dcaa1c-25f8-4601-83df-e43206b43515" - }, - "RequestBody": null, - "StatusCode": 202, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Content-Type": "text/plain; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:30:35 GMT", - "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Storage/locations/eastus/asyncoperations/2f700f34-20d2-41a2-b3a3-8950aa164e79?monitor=true\u0026api-version=2021-09-01", - "Pragma": "no-cache", - "Retry-After": "17", - "Server": "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "c471ed3f-2250-4311-a985-7689e6dd7139", - "x-ms-ratelimit-remaining-subscription-reads": "11996", - "x-ms-request-id": "cb23da85-e607-43fb-94dc-868ce44ea731", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023036Z:c471ed3f-2250-4311-a985-7689e6dd7139" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Storage/locations/eastus/asyncoperations/2f700f34-20d2-41a2-b3a3-8950aa164e79?monitor=true\u0026api-version=2021-09-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-storage/17.2.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "4f5c6bb3-1d0a-4176-8c89-d1c66495bf0c" - }, - "RequestBody": null, - "StatusCode": 202, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Content-Type": "text/plain; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:30:35 GMT", - "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Storage/locations/eastus/asyncoperations/2f700f34-20d2-41a2-b3a3-8950aa164e79?monitor=true\u0026api-version=2021-09-01", - "Pragma": "no-cache", - "Retry-After": "17", - "Server": "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "697778dd-542d-4de3-b728-f19aeb8ec48e", - "x-ms-ratelimit-remaining-subscription-reads": "11995", - "x-ms-request-id": "362ca2d8-63b3-4955-bfdc-adcb6bfda95c", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023036Z:697778dd-542d-4de3-b728-f19aeb8ec48e" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Storage/locations/eastus/asyncoperations/2f700f34-20d2-41a2-b3a3-8950aa164e79?monitor=true\u0026api-version=2021-09-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-storage/17.2.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "6a3e00b5-ddde-48ff-a8fe-89fd2d01714e" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json", - "Date": "Fri, 29 Jul 2022 02:30:54 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "39871246-7634-4d9b-be80-41e01b0b3aff", - "x-ms-ratelimit-remaining-subscription-reads": "11994", - "x-ms-request-id": "995f1514-c1b4-469b-a65e-3e5c8bc12dcb", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023054Z:39871246-7634-4d9b-be80-41e01b0b3aff" - }, - "ResponseBody": { - "sku": { - "name": "Standard_GRS", - "tier": "Standard" - }, - "kind": "StorageV2", - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy", - "name": "mystorageaccountyyy", - "type": "Microsoft.Storage/storageAccounts", - "location": "eastus", - "tags": { - "key1": "value1", - "key2": "value2" - }, - "properties": { - "keyCreationTime": { - "key1": "2022-07-29T02:30:33.7747641Z", - "key2": "2022-07-29T02:30:33.7747641Z" - }, - "privateEndpointConnections": [], - "minimumTlsVersion": "TLS1_0", - "allowBlobPublicAccess": true, - "networkAcls": { - "bypass": "AzureServices", - "virtualNetworkRules": [], - "ipRules": [], - "defaultAction": "Allow" - }, - "supportsHttpsTrafficOnly": true, - "encryption": { - "services": { - "file": { - "keyType": "Account", - "enabled": true, - "lastEnabledTime": "2022-07-29T02:30:33.7903811Z" - }, - "blob": { - "keyType": "Account", - "enabled": true, - "lastEnabledTime": "2022-07-29T02:30:33.7903811Z" - } - }, - "keySource": "Microsoft.Storage" - }, - "accessTier": "Hot", - "provisioningState": "Succeeded", - "creationTime": "2022-07-29T02:30:33.6653815Z", - "primaryEndpoints": { - "dfs": "https://mystorageaccountyyy.dfs.core.windows.net/", - "web": "https://mystorageaccountyyy.z13.web.core.windows.net/", - "blob": "https://mystorageaccountyyy.blob.core.windows.net/", - "queue": "https://mystorageaccountyyy.queue.core.windows.net/", - "table": "https://mystorageaccountyyy.table.core.windows.net/", - "file": "https://mystorageaccountyyy.file.core.windows.net/" - }, - "primaryLocation": "eastus", - "statusOfPrimary": "available", - "secondaryLocation": "westus", - "statusOfSecondary": "available" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "PUT", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Length": "106", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.0.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "511fd2f0-9629-416d-a38a-c85235f08bc9" - }, - "RequestBody": { - "location": "eastus", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "sku": { - "name": "Standard", - "tier": "Standard" - } - }, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:30:58 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "9534eb38-0756-4f19-84c7-de2da56f0b55", - "x-ms-ratelimit-remaining-subscription-resource-requests": "49", - "x-ms-request-id": "08e998e9-76fb-4ee1-b36d-dc695be623d1_M10SN1_M10SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023058Z:9534eb38-0756-4f19-84c7-de2da56f0b55" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2022-07-29T02:30:56.607Z", - "updatedAt": "2022-07-29T02:30:56.607Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.0.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "a95d3a8e-fec7-43b9-8569-7a82fd87cf4e" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:30:59 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "41550b31-e495-470b-8ee3-fa18a3908e74", - "x-ms-ratelimit-remaining-subscription-reads": "11993", - "x-ms-request-id": "6e1e5920-62f3-4be2-9611-4abd67d46176_M2SN1_M2SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023059Z:41550b31-e495-470b-8ee3-fa18a3908e74" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2022-07-29T02:30:56.607Z", - "updatedAt": "2022-07-29T02:30:56.607Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.0.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "7be83777-5744-4020-8275-f59072d0b411" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:30:59 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "1d0c6153-1647-4d01-b454-8e8ce5123d48", - "x-ms-ratelimit-remaining-subscription-reads": "11992", - "x-ms-request-id": "12340d77-5452-49db-a3f3-66980a55e5ae_M2SN1_M2SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023100Z:1d0c6153-1647-4d01-b454-8e8ce5123d48" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2022-07-29T02:30:56.607Z", - "updatedAt": "2022-07-29T02:30:56.607Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.0.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "359afae2-a7d5-4801-b342-07a50ce59ab7" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:31:02 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "151f28f0-3d93-4ee3-96ac-25f6c198a906", - "x-ms-ratelimit-remaining-subscription-reads": "11991", - "x-ms-request-id": "735e7b3f-5e67-481e-b309-63c1301164c5_M2SN1_M2SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023102Z:151f28f0-3d93-4ee3-96ac-25f6c198a906" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2022-07-29T02:30:56.607Z", - "updatedAt": "2022-07-29T02:30:56.607Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.0.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "16ef135f-2a51-4425-b893-aa4a7de8aed8" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:31:05 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "a6ea370e-4879-401e-9a33-d7881d97d1a8", - "x-ms-ratelimit-remaining-subscription-reads": "11990", - "x-ms-request-id": "1be14ebb-c51d-4213-af59-976a6a38fdf0_M2SN1_M2SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023105Z:a6ea370e-4879-401e-9a33-d7881d97d1a8" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2022-07-29T02:30:56.607Z", - "updatedAt": "2022-07-29T02:30:56.607Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.0.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "803845da-8bb4-4365-8aa0-8d532f9e5086" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:31:07 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "86478443-3fdf-4cb4-a946-78aca654e804", - "x-ms-ratelimit-remaining-subscription-reads": "11989", - "x-ms-request-id": "629902b8-5d86-4a04-b099-5541741b1474_M2SN1_M2SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023107Z:86478443-3fdf-4cb4-a946-78aca654e804" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2022-07-29T02:30:56.607Z", - "updatedAt": "2022-07-29T02:30:56.607Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.0.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "ea37b8a0-a346-46cd-aac1-0e60b1b02348" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:31:10 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "0c8a70a3-9fc1-4100-b039-a074cc417b15", - "x-ms-ratelimit-remaining-subscription-reads": "11988", - "x-ms-request-id": "033b7715-a3e6-4703-92e4-a098daa53024_M2SN1_M2SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023110Z:0c8a70a3-9fc1-4100-b039-a074cc417b15" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2022-07-29T02:30:56.607Z", - "updatedAt": "2022-07-29T02:30:56.607Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.0.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "5c310de8-d6a8-4ec5-9776-4bd269ff5bb6" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:31:12 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "aa839df4-7f7a-4e10-b137-a38b7101ee82", - "x-ms-ratelimit-remaining-subscription-reads": "11987", - "x-ms-request-id": "40f9e6d9-213d-476f-ba4c-ace3fed6dbed_M10SN1_M10SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023113Z:aa839df4-7f7a-4e10-b137-a38b7101ee82" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2022-07-29T02:30:56.607Z", - "updatedAt": "2022-07-29T02:30:56.607Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.0.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "f530fdc9-ea70-410a-b9e4-346469166f40" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:31:15 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "e4d900ec-6373-4339-9a7c-7fe2bf97ac35", - "x-ms-ratelimit-remaining-subscription-reads": "11986", - "x-ms-request-id": "38d9d68c-e90d-4c97-8d9c-34e440460376_M2SN1_M2SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023115Z:e4d900ec-6373-4339-9a7c-7fe2bf97ac35" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2022-07-29T02:30:56.607Z", - "updatedAt": "2022-07-29T02:30:56.607Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.0.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "4fa50b86-94b1-400c-b394-8faf06f152c3" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:31:18 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "6e53a2f0-6c67-458b-84d2-fbe40520092e", - "x-ms-ratelimit-remaining-subscription-reads": "11985", - "x-ms-request-id": "d2b00eec-fc63-42b7-8f15-e1ad7b216112_M2SN1_M2SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023118Z:6e53a2f0-6c67-458b-84d2-fbe40520092e" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2022-07-29T02:30:56.607Z", - "updatedAt": "2022-07-29T02:30:56.607Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.0.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "3abb2ef9-f270-4a3a-baa7-34793e6a8edc" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:31:20 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "d272b192-fb15-4dd7-bf87-8c33ae289ebf", - "x-ms-ratelimit-remaining-subscription-reads": "11984", - "x-ms-request-id": "7de59e4b-0bc8-437e-acd0-7dda88d8f481_M2SN1_M2SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023121Z:d272b192-fb15-4dd7-bf87-8c33ae289ebf" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2022-07-29T02:30:56.607Z", - "updatedAt": "2022-07-29T02:30:56.607Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.0.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "84035f0d-cdc5-41f6-be72-5282d7887a1a" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:31:23 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "c3a6b029-734a-4430-b7f6-a3fd6c7f706c", - "x-ms-ratelimit-remaining-subscription-reads": "11983", - "x-ms-request-id": "337c8652-4ae0-44c5-ac26-b6e927f64307_M2SN1_M2SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023123Z:c3a6b029-734a-4430-b7f6-a3fd6c7f706c" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2022-07-29T02:30:56.607Z", - "updatedAt": "2022-07-29T02:30:56.607Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.0.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "7270a552-1f5d-467e-9896-3a1ad1287b83" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:31:25 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "a806f064-1360-40dd-874f-2142eba541f5", - "x-ms-ratelimit-remaining-subscription-reads": "11982", - "x-ms-request-id": "71937ae7-a45c-4a7b-ac3b-10ff820b3681_M2SN1_M2SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023126Z:a806f064-1360-40dd-874f-2142eba541f5" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2022-07-29T02:30:56.607Z", - "updatedAt": "2022-07-29T02:30:56.607Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.0.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "353ab055-be67-498b-ac9a-d45987ba5321" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:31:27 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "5bf3ae24-0952-4ef9-b305-feb71d10ced2", - "x-ms-ratelimit-remaining-subscription-reads": "11981", - "x-ms-request-id": "78f76efb-2c85-4938-adc1-fd39db5d5bb5_M2SN1_M2SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023128Z:5bf3ae24-0952-4ef9-b305-feb71d10ced2" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2022-07-29T02:30:56.607Z", - "updatedAt": "2022-07-29T02:30:56.607Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.0.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "aa77d7c0-8bf6-4c35-b490-04d9d76a2b13" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:31:30 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "2d543a07-09cf-49e4-9f03-568cf9a3ca8c", - "x-ms-ratelimit-remaining-subscription-reads": "11980", - "x-ms-request-id": "c96b42f9-7e6e-4ed4-833e-1078190eb174_M2SN1_M2SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023130Z:2d543a07-09cf-49e4-9f03-568cf9a3ca8c" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2022-07-29T02:30:56.607Z", - "updatedAt": "2022-07-29T02:30:56.607Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.0.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "72e0ced1-aa76-4f9a-9f4d-7d49469d02b8" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:31:32 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "19d679d7-ae28-41ea-9684-1fddc862bb48", - "x-ms-ratelimit-remaining-subscription-reads": "11979", - "x-ms-request-id": "d33a2e8f-2b64-4f23-ab35-cff938db67c2_M2SN1_M2SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023133Z:19d679d7-ae28-41ea-9684-1fddc862bb48" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2022-07-29T02:30:56.607Z", - "updatedAt": "2022-07-29T02:30:56.607Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.0.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "038d9cdd-3007-4552-aa8f-cd5afaf9678a" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:31:35 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "08b2109b-754e-44b3-8cd2-a722547f3837", - "x-ms-ratelimit-remaining-subscription-reads": "11978", - "x-ms-request-id": "60a96c31-5297-439e-942e-dfdbd8ecdfee_M10SN1_M10SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023135Z:08b2109b-754e-44b3-8cd2-a722547f3837" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2022-07-29T02:30:56.607Z", - "updatedAt": "2022-07-29T02:30:56.607Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.0.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "3051c794-cda4-4d0a-82f7-9e820937efc9" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:31:37 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "ae18919b-8aa3-4d3a-aac9-e35fb86465c5", - "x-ms-ratelimit-remaining-subscription-reads": "11977", - "x-ms-request-id": "110e14c3-1d2e-4213-a0fe-081d5ef96d07_M2SN1_M2SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023138Z:ae18919b-8aa3-4d3a-aac9-e35fb86465c5" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Created", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2022-07-29T02:30:56.607Z", - "updatedAt": "2022-07-29T02:30:56.607Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Activating" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.0.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "5d147e8f-51ba-450d-b33e-ab67b18a3566" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:31:39 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "6fcb10b5-24e4-43ae-8074-88f612c04de7", - "x-ms-ratelimit-remaining-subscription-reads": "11976", - "x-ms-request-id": "9bdbe7af-04ee-4cf2-ae8c-5259c82c3294_M2SN1_M2SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023140Z:6fcb10b5-24e4-43ae-8074-88f612c04de7" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Succeeded", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2022-07-29T02:30:56.607Z", - "updatedAt": "2022-07-29T02:31:38.49Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Active" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx/authorizationRules/myauthorizationRulexxx?api-version=2021-11-01", - "RequestMethod": "PUT", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Length": "52", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.0.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "1ae596da-44c8-4407-b8bc-81700fa85ba8" - }, - "RequestBody": { - "properties": { - "rights": [ - "Listen", - "Send", - "Manage" - ] - } - }, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:31:52 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "168450b8-d79c-455a-abf8-dfe7713dbb5e", - "x-ms-ratelimit-remaining-subscription-writes": "1197", - "x-ms-request-id": "4541f219-c0e7-48ad-b7e6-2e78a335c9b9_M2SN1_M2SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023153Z:168450b8-d79c-455a-abf8-dfe7713dbb5e" - }, - "ResponseBody": { - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx/authorizationRules/myauthorizationRulexxx", - "name": "myauthorizationRulexxx", - "type": "Microsoft.EventHub/Namespaces/AuthorizationRules", - "location": "East US", - "properties": { - "rights": [ - "Listen", - "Send", - "Manage" - ] - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx/eventhubs/myeventhubxxx?api-version=2021-11-01", - "RequestMethod": "PUT", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Length": "546", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-eventhub/5.0.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "c623182d-022f-41ff-a06f-83ef99d7758b" - }, - "RequestBody": { - "properties": { - "messageRetentionInDays": 4, - "partitionCount": 4, - "status": "Active", - "captureDescription": { - "enabled": true, - "encoding": "Avro", - "intervalInSeconds": 120, - "sizeLimitInBytes": 10485763, - "destination": { - "name": "EventHubArchive.AzureBlockBlob", - "properties": { - "storageAccountResourceId": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy", - "blobContainer": "container", - "archiveNameFormat": "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}" - } - } - } - } - }, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:31:56 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": "Microsoft-HTTPAPI/2.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "1a673a28-8d1d-4506-bffb-bb0f87a8f217", - "x-ms-ratelimit-remaining-subscription-writes": "1196", - "x-ms-request-id": "1a673a28-8d1d-4506-bffb-bb0f87a8f217", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023156Z:1a673a28-8d1d-4506-bffb-bb0f87a8f217" - }, - "ResponseBody": { - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx/eventhubs/myeventhubxxx", - "name": "myeventhubxxx", - "type": "Microsoft.EventHub/Namespaces/EventHubs", - "location": "eastus", - "properties": { - "messageRetentionInDays": 4, - "partitionCount": 4, - "status": "Active", - "createdAt": "2022-07-29T02:31:55.92Z", - "updatedAt": "2022-07-29T02:31:56.24Z", - "partitionIds": [ - "0", - "1", - "2", - "3" - ], - "captureDescription": { - "enabled": true, - "encoding": "Avro", - "destination": { - "name": "EventHubArchive.AzureBlockBlob", - "properties": { - "storageAccountResourceId": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy", - "blobContainer": "container", - "archiveNameFormat": "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}" - } - }, - "intervalInSeconds": 120, - "sizeLimitInBytes": 10485763 - } - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourcegroups/myjstest/providers/Microsoft.OperationalInsights/workspaces/myworkspacexxx?api-version=2021-06-01", - "RequestMethod": "PUT", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Length": "107", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-operationalinsights/8.0.1 core-rest-pipeline/1.9.0 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "d89ef7c8-0b3c-4845-9f63-f8e0955602d5" - }, - "RequestBody": { - "tags": { - "tag1": "value1" - }, - "location": "eastus", - "properties": { - "sku": { - "name": "PerNode" - }, - "retentionInDays": 30 - } - }, - "StatusCode": 200, - "ResponseHeaders": { - "Access-Control-Allow-Origin": "*", - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json", - "Date": "Fri, 29 Jul 2022 02:32:01 GMT", - "Pragma": "no-cache", - "Request-Context": "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508", - "Server": "Microsoft-IIS/10.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": [ - "Accept-Encoding", - "Accept-Encoding" - ], - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "d6adc4d0-b76b-49ea-98e2-67d827212d5b", - "x-ms-ratelimit-remaining-subscription-writes": "1195", - "x-ms-request-id": "37fe6daf-4117-4ada-b743-c37b496631ff", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023201Z:d6adc4d0-b76b-49ea-98e2-67d827212d5b", - "X-Powered-By": [ - "ASP.NET", - "ASP.NET" - ] - }, - "ResponseBody": { - "properties": { - "source": "Azure", - "customerId": "15d47c37-8ce3-4eb5-8079-32a08437e7c9", - "provisioningState": "Succeeded", - "sku": { - "name": "pergb2018", - "lastSkuUpdate": "Fri, 29 Jul 2022 02:06:37 GMT" - }, - "retentionInDays": 30, - "features": { - "legacy": 0, - "searchVersion": 1, - "enableLogAccessUsingOnlyResourcePermissions": true - }, - "workspaceCapping": { - "dailyQuotaGb": -1.0, - "quotaNextResetTime": "Fri, 29 Jul 2022 20:00:00 GMT", - "dataIngestionStatus": "RespectQuota" - }, - "publicNetworkAccessForIngestion": "Enabled", - "publicNetworkAccessForQuery": "Enabled", - "createdDate": "Fri, 29 Jul 2022 02:06:37 GMT", - "modifiedDate": "Fri, 29 Jul 2022 02:18:55 GMT" - }, - "id": "/subscriptions/azure_subscription_id/resourcegroups/myjstest/providers/microsoft.operationalinsights/workspaces/myworkspacexxx", - "name": "myworkspacexxx", - "type": "Microsoft.OperationalInsights/workspaces", - "location": "eastus", - "tags": { - "tag1": "value1" - } - } - } - ], - "Variables": {} -} diff --git a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_delete_parameters_for_diagnosticsettings.json b/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_delete_parameters_for_diagnosticsettings.json deleted file mode 100644 index e818cdabab7b..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_delete_parameters_for_diagnosticsettings.json +++ /dev/null @@ -1,289 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Logic/workflows/myworkflowxxx?api-version=2019-05-01", - "RequestMethod": "DELETE", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-logic/8.0.0 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "07df1da9-ca45-4e56-b8fe-942a41bfee8e" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Date": "Fri, 29 Jul 2022 02:34:14 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "2ac9b762-de68-4230-bcf8-a3d464fd22bb", - "x-ms-ratelimit-remaining-subscription-deletes": "14999", - "x-ms-request-id": "eastus:c002f987-e67d-409b-9f3c-aca513331195", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023415Z:2ac9b762-de68-4230-bcf8-a3d464fd22bb" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy?api-version=2021-09-01", - "RequestMethod": "DELETE", - "RequestHeaders": { - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-storage/17.2.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "7ed9bd35-8bb7-4cd0-9194-19a786be4605" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Content-Type": "text/plain; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:34:20 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "0e5934db-0b71-4161-b938-37553a331f74", - "x-ms-ratelimit-remaining-subscription-deletes": "14998", - "x-ms-request-id": "af19484b-d0cc-4bb0-801f-b572211efd09", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023421Z:0e5934db-0b71-4161-b938-37553a331f74" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "DELETE", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-eventhub/5.0.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "b67bb2b9-fe54-4e37-ad13-ed7dd9ecb4fb" - }, - "RequestBody": null, - "StatusCode": 202, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Date": "Fri, 29 Jul 2022 02:34:23 GMT", - "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2021-11-01", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "bd193166-c094-461a-83bf-beec4f11c095", - "x-ms-ratelimit-remaining-subscription-deletes": "14997", - "x-ms-request-id": "c6b4ef98-3d92-410a-b46f-a4b7a2316002_M10SN1_M10SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023424Z:bd193166-c094-461a-83bf-beec4f11c095" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-eventhub/5.0.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "a17be9ef-f438-4b03-949f-013e0cb5f726" - }, - "RequestBody": null, - "StatusCode": 202, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "694", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:34:24 GMT", - "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2021-11-01", - "Pragma": "no-cache", - "Retry-After": "36", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "03188a07-ab86-4b68-a8f4-93501d69f83a", - "x-ms-ratelimit-remaining-subscription-reads": "11997", - "x-ms-request-id": "eb97e0a9-197e-4aad-adfd-b9c983d1bebe_M10SN1_M10SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023425Z:03188a07-ab86-4b68-a8f4-93501d69f83a" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Succeeded", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2022-07-29T02:30:56.607Z", - "updatedAt": "2022-07-29T02:34:24Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Removing" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-eventhub/5.0.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "2322242e-7b41-45a5-ab58-7583824337bb" - }, - "RequestBody": null, - "StatusCode": 202, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "694", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:34:25 GMT", - "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2021-11-01", - "Pragma": "no-cache", - "Retry-After": "46", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "0c093612-96e8-4967-a16f-23435aa2a785", - "x-ms-ratelimit-remaining-subscription-reads": "11996", - "x-ms-request-id": "9a03c343-cb6e-4b57-9536-009cb6d46c46_M10SN1_M10SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023426Z:0c093612-96e8-4967-a16f-23435aa2a785" - }, - "ResponseBody": { - "sku": { - "name": "Standard", - "tier": "Standard", - "capacity": 1 - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx", - "name": "mynamespacexxx", - "type": "Microsoft.EventHub/Namespaces", - "location": "East US", - "tags": { - "tag1": "value1", - "tag2": "value2" - }, - "properties": { - "disableLocalAuth": false, - "zoneRedundant": false, - "isAutoInflateEnabled": false, - "maximumThroughputUnits": 0, - "kafkaEnabled": true, - "provisioningState": "Succeeded", - "metricId": "azure_subscription_id:mynamespacexxx", - "createdAt": "2022-07-29T02:30:56.607Z", - "updatedAt": "2022-07-29T02:34:24Z", - "serviceBusEndpoint": "https://mynamespacexxx.servicebus.windows.net:443/", - "status": "Removing" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2021-11-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-eventhub/5.0.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "7a26dbed-eb0e-4e38-8638-7207f2618274" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Date": "Fri, 29 Jul 2022 02:35:13 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/SN1", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/SN1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "7f137d5e-38bf-4c33-a28f-dcebed9b14b8", - "x-ms-ratelimit-remaining-subscription-reads": "11995", - "x-ms-request-id": "03eefd97-d041-433c-b255-a2e226bb7531_M6SN1_M6SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023513Z:7f137d5e-38bf-4c33-a28f-dcebed9b14b8" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourcegroups/myjstest/providers/Microsoft.OperationalInsights/workspaces/myworkspacexxx?api-version=2021-06-01", - "RequestMethod": "DELETE", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-operationalinsights/8.0.1 core-rest-pipeline/1.9.0 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "30748129-ff81-45ef-9d8a-eeb0cbb45ed5" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Access-Control-Allow-Origin": "*", - "Cache-Control": "no-cache", - "Content-Length": "0", - "Date": "Fri, 29 Jul 2022 02:35:23 GMT", - "Pragma": "no-cache", - "Request-Context": "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508", - "Server": "Microsoft-IIS/10.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "8c5bf0c2-8706-4def-8b47-98e300ce801a", - "x-ms-ratelimit-remaining-subscription-deletes": "14996", - "x-ms-request-id": "4cd790f8-5ff7-4734-9f00-2523b1fcf34a", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023523Z:8c5bf0c2-8706-4def-8b47-98e300ce801a", - "X-Powered-By": [ - "ASP.NET", - "ASP.NET" - ] - }, - "ResponseBody": null - } - ], - "Variables": {} -} diff --git a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_create_test.json b/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_create_test.json deleted file mode 100644 index ce0ae5c8cc4c..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_create_test.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Logic/workflows/myworkflowxxx/providers/Microsoft.Insights/diagnosticSettings/mydiagnosticxxxx?api-version=2021-05-01-preview", - "RequestMethod": "PUT", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Length": "639", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-monitor/8.0.0-beta.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "563c841c-5a38-4f8e-a3e4-c3c0237879d0" - }, - "RequestBody": { - "properties": { - "storageAccountId": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy", - "eventHubAuthorizationRuleId": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx/authorizationRules/myauthorizationRulexxx", - "eventHubName": "myeventhubxxx", - "metrics": [], - "logs": [ - { - "category": "WorkflowRuntime", - "enabled": true, - "retentionPolicy": { - "enabled": false, - "days": 0 - } - } - ], - "workspaceId": "/subscriptions/azure_subscription_id/resourcegroups/myjstest/providers/microsoft.operationalinsights/workspaces/myworkspacexxx" - } - }, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:32:08 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": "Microsoft-IIS/10.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "757d784e-af25-4bb6-8ddb-c99e1fa7c2b5", - "x-ms-ratelimit-remaining-subscription-resource-requests": "149", - "x-ms-request-id": "9efdf4d7-ea44-41f2-b2e3-29696ea3c03d", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023208Z:757d784e-af25-4bb6-8ddb-c99e1fa7c2b5" - }, - "ResponseBody": { - "id": "/subscriptions/azure_subscription_id/resourcegroups/myjstest/providers/microsoft.logic/workflows/myworkflowxxx/providers/microsoft.insights/diagnosticSettings/mydiagnosticxxxx", - "type": "Microsoft.Insights/diagnosticSettings", - "name": "mydiagnosticxxxx", - "location": null, - "kind": null, - "tags": null, - "properties": { - "storageAccountId": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy", - "serviceBusRuleId": null, - "workspaceId": "/subscriptions/azure_subscription_id/resourcegroups/myjstest/providers/microsoft.operationalinsights/workspaces/myworkspacexxx", - "eventHubAuthorizationRuleId": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx/authorizationRules/myauthorizationRulexxx", - "eventHubName": "myeventhubxxx", - "metrics": [], - "logs": [ - { - "category": "WorkflowRuntime", - "categoryGroup": null, - "enabled": true, - "retentionPolicy": { - "enabled": false, - "days": 0 - } - } - ], - "logAnalyticsDestinationType": null - }, - "identity": null - } - } - ], - "Variables": {} -} diff --git a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_delete_test.json b/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_delete_test.json deleted file mode 100644 index 29c827586e64..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_delete_test.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Logic/workflows/myworkflowxxx/providers/Microsoft.Insights/diagnosticSettings/mydiagnosticxxxx?api-version=2021-05-01-preview", - "RequestMethod": "DELETE", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-monitor/8.0.0-beta.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "d7bdfbed-4799-4a72-b426-3faec25ff72d" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Date": "Fri, 29 Jul 2022 02:32:12 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": "Microsoft-IIS/10.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "1f83b60d-6fa8-4bec-8d58-1a108e76850a", - "x-ms-ratelimit-remaining-subscription-deletes": "14994", - "x-ms-request-id": "d654062c-b38b-4344-807f-9e111d8bbfa2", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023212Z:1f83b60d-6fa8-4bec-8d58-1a108e76850a" - }, - "ResponseBody": null - } - ], - "Variables": {} -} diff --git a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_get_test.json b/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_get_test.json deleted file mode 100644 index 534bde5ce1d7..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_get_test.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Logic/workflows/myworkflowxxx/providers/Microsoft.Insights/diagnosticSettings/mydiagnosticxxxx?api-version=2021-05-01-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-monitor/8.0.0-beta.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "1012a6f3-1462-4355-8ffa-a83ad7d06d5b" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:32:08 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": "Microsoft-IIS/10.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "0c825667-83dc-4513-9f53-4ccb50171c01", - "x-ms-ratelimit-remaining-subscription-reads": "11975", - "x-ms-request-id": "9820fd37-4757-471e-812d-bff17db9c085", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023209Z:0c825667-83dc-4513-9f53-4ccb50171c01" - }, - "ResponseBody": { - "id": "/subscriptions/azure_subscription_id/resourcegroups/myjstest/providers/microsoft.logic/workflows/myworkflowxxx/providers/microsoft.insights/diagnosticSettings/mydiagnosticxxxx", - "type": "Microsoft.Insights/diagnosticSettings", - "name": "mydiagnosticxxxx", - "location": null, - "kind": null, - "tags": null, - "properties": { - "storageAccountId": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy", - "serviceBusRuleId": null, - "workspaceId": "/subscriptions/azure_subscription_id/resourcegroups/myjstest/providers/microsoft.operationalinsights/workspaces/myworkspacexxx", - "eventHubAuthorizationRuleId": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx/authorizationRules/myauthorizationRulexxx", - "eventHubName": "myeventhubxxx", - "metrics": [ - { - "category": "AllMetrics", - "enabled": false, - "retentionPolicy": { - "enabled": false, - "days": 0 - } - } - ], - "logs": [ - { - "category": "WorkflowRuntime", - "categoryGroup": null, - "enabled": true, - "retentionPolicy": { - "enabled": false, - "days": 0 - } - } - ], - "logAnalyticsDestinationType": null - }, - "identity": null - } - } - ], - "Variables": {} -} diff --git a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_list_test.json b/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_list_test.json deleted file mode 100644 index f721723386d8..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_list_test.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "Entries": [], - "Variables": {} -} diff --git a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_create_test.json b/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_create_test.json deleted file mode 100644 index 24054dd16277..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_create_test.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Insights/logprofiles?api-version=2016-03-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-monitor/8.0.0-beta.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "eb72b1f5-43f3-4b7c-8000-b845911d3861" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:32:12 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": "Microsoft-IIS/10.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "8464f65e-4159-4026-ad9b-f1649002bd89", - "x-ms-ratelimit-remaining-subscription-reads": "11974", - "x-ms-request-id": "0864d68c-00de-46c7-883d-ef9ca9dcf708", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023213Z:8464f65e-4159-4026-ad9b-f1649002bd89" - }, - "ResponseBody": { - "value": [] - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Insights/logprofiles/mylogProfilexxx?api-version=2016-03-01", - "RequestMethod": "PUT", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Length": "284", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-monitor/8.0.0-beta.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "91775cce-7bb3-4475-a85a-1e8833f00406" - }, - "RequestBody": { - "location": "", - "properties": { - "storageAccountId": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy", - "locations": [ - "global" - ], - "categories": [ - "Write", - "Delete", - "Action" - ], - "retentionPolicy": { - "enabled": true, - "days": 3 - } - } - }, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:32:15 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": "Microsoft-IIS/10.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "f9c07631-bf36-4c99-903d-a1f868e25b71", - "x-ms-ratelimit-remaining-subscription-writes": "1194", - "x-ms-request-id": "134e5db7-be0b-468c-b875-e24aa6d98fce", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023216Z:f9c07631-bf36-4c99-903d-a1f868e25b71" - }, - "ResponseBody": { - "id": "/subscriptions/azure_subscription_id/providers/microsoft.insights/logprofiles/mylogProfilexxx", - "type": null, - "name": "mylogProfilexxx", - "location": "", - "kind": null, - "tags": null, - "properties": { - "storageAccountId": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy", - "serviceBusRuleId": null, - "locations": [ - "global" - ], - "categories": [ - "Write", - "Delete", - "Action" - ], - "retentionPolicy": { - "enabled": true, - "days": 3 - } - }, - "identity": null - } - } - ], - "Variables": {} -} diff --git a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_delete_test.json b/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_delete_test.json deleted file mode 100644 index 4de4e7b8d8d3..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_delete_test.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Insights/logprofiles/mylogProfilexxx?api-version=2016-03-01", - "RequestMethod": "DELETE", - "RequestHeaders": { - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-monitor/8.0.0-beta.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "c74147e8-8bb8-44ee-a96b-ba9a544111f7" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Date": "Fri, 29 Jul 2022 02:35:25 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": "Microsoft-IIS/10.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "73c24b3f-d224-4749-bc71-84f7abc47556", - "x-ms-ratelimit-remaining-subscription-deletes": "14995", - "x-ms-request-id": "acc37305-bdc3-45c5-812b-16a9df3ca517", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023526Z:73c24b3f-d224-4749-bc71-84f7abc47556" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Insights/logprofiles?api-version=2016-03-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-monitor/8.0.0-beta.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "eebae787-8161-419a-b820-1a0ea3d8914c" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:35:26 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": "Microsoft-IIS/10.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "3bdb4f38-cc90-4866-aef8-8cfcf1036fc0", - "x-ms-ratelimit-remaining-subscription-reads": "11994", - "x-ms-request-id": "87357649-3d27-4449-8c25-81ba855dc4c5", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023526Z:3bdb4f38-cc90-4866-aef8-8cfcf1036fc0" - }, - "ResponseBody": { - "value": [ - { - "id": "/subscriptions/azure_subscription_id/providers/microsoft.insights/logprofiles/mylogprofilexxx", - "type": null, - "name": "mylogprofilexxx", - "location": null, - "kind": null, - "tags": null, - "properties": { - "storageAccountId": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy", - "serviceBusRuleId": null, - "locations": [ - "global" - ], - "categories": [ - "Write", - "Delete", - "Action" - ], - "retentionPolicy": { - "enabled": true, - "days": 3 - } - }, - "identity": null - } - ] - } - } - ], - "Variables": {} -} diff --git a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_get_test.json b/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_get_test.json deleted file mode 100644 index 989dadbc7807..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_get_test.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Insights/logprofiles/mylogProfilexxx?api-version=2016-03-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-monitor/8.0.0-beta.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "35e1d208-3485-400e-ac2c-e154f25eeca1" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:34:01 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": "Microsoft-IIS/10.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "950a82af-130a-46f0-b7b8-ffbe0ec53147", - "x-ms-ratelimit-remaining-subscription-reads": "11999", - "x-ms-request-id": "68074e6e-d98e-4637-9ebd-6d6d326d267e", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023402Z:950a82af-130a-46f0-b7b8-ffbe0ec53147" - }, - "ResponseBody": { - "id": "/subscriptions/azure_subscription_id/providers/microsoft.insights/logprofiles/mylogProfilexxx", - "type": null, - "name": "mylogProfilexxx", - "location": null, - "kind": null, - "tags": null, - "properties": { - "storageAccountId": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy", - "serviceBusRuleId": null, - "locations": [ - "global" - ], - "categories": [ - "Write", - "Delete", - "Action" - ], - "retentionPolicy": { - "enabled": true, - "days": 3 - } - }, - "identity": null - } - } - ], - "Variables": {} -} diff --git a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_list_test.json b/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_list_test.json deleted file mode 100644 index 3c84fc561f71..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_list_test.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Insights/logprofiles?api-version=2016-03-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-monitor/8.0.0-beta.2 core-rest-pipeline/1.9.1 Node/v16.15.1 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "032c4ed8-cebc-43de-b455-d945c73d323b" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 29 Jul 2022 02:34:02 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": "Microsoft-IIS/10.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "2640c757-b4e5-470c-b1d7-3103c19daecf", - "x-ms-ratelimit-remaining-subscription-reads": "11998", - "x-ms-request-id": "9ab70257-f2c7-497e-8c7f-56f4772678b0", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220729T023403Z:2640c757-b4e5-470c-b1d7-3103c19daecf" - }, - "ResponseBody": { - "value": [ - { - "id": "/subscriptions/azure_subscription_id/providers/microsoft.insights/logprofiles/mylogprofilexxx", - "type": null, - "name": "mylogprofilexxx", - "location": null, - "kind": null, - "tags": null, - "properties": { - "storageAccountId": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy", - "serviceBusRuleId": null, - "locations": [ - "global" - ], - "categories": [ - "Write", - "Delete", - "Action" - ], - "retentionPolicy": { - "enabled": true, - "days": 3 - } - }, - "identity": null - } - ] - } - } - ], - "Variables": {} -} diff --git a/sdk/monitor/arm-monitor/review/arm-monitor.api.md b/sdk/monitor/arm-monitor/review/arm-monitor.api.md index fdccf4036bbb..4c505329cfe4 100644 --- a/sdk/monitor/arm-monitor/review/arm-monitor.api.md +++ b/sdk/monitor/arm-monitor/review/arm-monitor.api.md @@ -27,11 +27,6 @@ export interface AccessModeSettingsExclusion { queryAccessMode?: AccessMode; } -// @public -export interface Action { - odataType: "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction" | "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction"; -} - // @public export interface ActionDetail { detail?: string; @@ -212,8 +207,16 @@ export interface ActionList { actionGroups?: ActionGroup[]; } -// @public (undocumented) -export type ActionUnion = Action | AlertingAction | LogToMetricAction; +// @public +export interface Actions { + actionGroups?: string[]; + customProperties?: { + [propertyName: string]: string; + }; +} + +// @public +export type ActionType = string; // @public export interface ActivityLogAlertResource extends AzureResourceAutoGenerated { @@ -294,7 +297,6 @@ export interface ActivityLogs { // @public export interface ActivityLogsListNextOptionalParams extends coreClient.OperationOptions { - select?: string; } // @public @@ -314,15 +316,6 @@ export type AggregationType = "None" | "Average" | "Count" | "Minimum" | "Maximu // @public export type AggregationTypeEnum = string; -// @public -export interface AlertingAction extends Action { - aznsAction?: AzNsActionGroup; - odataType: "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction"; - severity: AlertSeverity; - throttlingInMin?: number; - trigger: TriggerCondition; -} - // @public export interface AlertRuleAllOfCondition { allOf: AlertRuleAnyOfOrLeafCondition[]; @@ -456,7 +449,7 @@ export interface AlertRulesUpdateOptionalParams extends coreClient.OperationOpti export type AlertRulesUpdateResponse = AlertRuleResource; // @public -export type AlertSeverity = string; +export type AlertSeverity = number; // @public export interface ArmRoleReceiver { @@ -600,13 +593,6 @@ export interface AutoscaleSettingsUpdateOptionalParams extends coreClient.Operat // @public export type AutoscaleSettingsUpdateResponse = AutoscaleSettingResource; -// @public -export interface AzNsActionGroup { - actionGroup?: string[]; - customWebhookPayload?: string; - emailSubject?: string; -} - // @public export interface AzureAppPushReceiver { emailAddress: string; @@ -705,10 +691,26 @@ export interface ColumnDefinition { export type ComparisonOperationType = "Equals" | "NotEquals" | "GreaterThan" | "GreaterThanOrEqual" | "LessThan" | "LessThanOrEqual"; // @public -export type ConditionalOperator = string; +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"; +export type ConditionOperator = "GreaterThan" | "GreaterThanOrEqual" | "LessThan" | "LessThanOrEqual" | "Equals"; // @public export interface ConfigurationAccessEndpointSpec { @@ -724,12 +726,6 @@ export interface Context { // @public export type CreatedByType = string; -// @public -export interface Criteria { - dimensions?: Dimension[]; - metricName: string; -} - // @public export type CriterionType = string; @@ -1225,10 +1221,13 @@ export interface DiagnosticSettingsResourceCollection { // @public export interface Dimension { name: string; - operator: Operator; + operator: DimensionOperator; values: string[]; } +// @public +export type DimensionOperator = string; + // @public export interface DynamicMetricCriteria extends MultiMetricCriteria { alertSensitivity: DynamicThresholdSensitivity; @@ -1265,9 +1264,6 @@ export interface EmailReceiver { useCommonAlertSchema?: boolean; } -// @public -export type Enabled = string; - // @public export interface EnableRequest { receiverName: string; @@ -1281,7 +1277,7 @@ export interface ErrorAdditionalInfo { // @public export interface ErrorContract { - error?: ErrorResponse; + error?: ErrorResponseDetails; } // @public @@ -1293,6 +1289,15 @@ export interface ErrorDetail { 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; @@ -1305,17 +1310,37 @@ export interface ErrorResponse { message?: string; } +// @public +export interface ErrorResponseAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + // @public export interface ErrorResponseAutoGenerated { readonly code?: string; readonly message?: string; } +// @public +export interface ErrorResponseAutoGenerated2 { + error?: ErrorDetailAutoGenerated; +} + // @public export interface ErrorResponseCommonV2 { error?: ErrorDetail; } +// @public +export interface ErrorResponseDetails { + readonly additionalInfo?: ErrorResponseAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorResponseDetails[]; + readonly message?: string; + readonly target?: string; +} + // @public export interface EventCategories { list(options?: EventCategoriesListOptionalParams): PagedAsyncIterableIterator; @@ -1393,6 +1418,9 @@ export interface ExtensionDataSource { streams?: KnownExtensionDataSourceStreams[]; } +// @public +export function getContinuationToken(page: unknown): string | undefined; + // @public export interface HttpRequestInfo { clientIpAddress?: string; @@ -1401,6 +1429,19 @@ export interface HttpRequestInfo { 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[]; @@ -1422,6 +1463,12 @@ export interface IncidentListResult { value?: Incident[]; } +// @public +export interface IngestionSettings { + readonly dataCollectionEndpointResourceId?: string; + readonly dataCollectionRuleResourceId?: string; +} + // @public export interface ItsmReceiver { connectionId: string; @@ -1431,12 +1478,20 @@ export interface ItsmReceiver { 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", @@ -1448,11 +1503,11 @@ export enum KnownAggregationTypeEnum { // @public export enum KnownAlertSeverity { - Four = "4", - One = "1", - Three = "3", - Two = "2", - Zero = "0" + Four = 4, + One = 1, + Three = 3, + Two = 2, + Zero = 0 } // @public @@ -1471,15 +1526,6 @@ export enum KnownCategoryType { // @public export type KnownColumnDefinitionType = string; -// @public -export enum KnownConditionalOperator { - Equal = "Equal", - GreaterThan = "GreaterThan", - GreaterThanOrEqual = "GreaterThanOrEqual", - LessThan = "LessThan", - LessThanOrEqual = "LessThanOrEqual" -} - // @public export enum KnownCreatedByType { Application = "Application", @@ -1518,6 +1564,12 @@ export enum KnownDataStatus { Present = "present" } +// @public +export enum KnownDimensionOperator { + Exclude = "Exclude", + Include = "Include" +} + // @public export enum KnownDynamicThresholdOperator { GreaterOrLessThan = "GreaterOrLessThan", @@ -1533,13 +1585,13 @@ export enum KnownDynamicThresholdSensitivity { } // @public -export enum KnownEnabled { - False = "false", - True = "true" -} +export type KnownExtensionDataSourceStreams = string; // @public -export type KnownExtensionDataSourceStreams = string; +export enum KnownKind { + LogAlert = "LogAlert", + LogToMetric = "LogToMetric" +} // @public export enum KnownKnownColumnDefinitionType { @@ -1703,12 +1755,6 @@ export enum KnownMetricClass { Transactions = "Transactions" } -// @public -export enum KnownMetricTriggerType { - Consecutive = "Consecutive", - Total = "Total" -} - // @public export enum KnownMetricUnit { BitsPerSecond = "BitsPerSecond", @@ -1752,11 +1798,17 @@ export enum KnownOperator { Equals = "Equals", GreaterThan = "GreaterThan", GreaterThanOrEqual = "GreaterThanOrEqual", - Include = "Include", LessThan = "LessThan", LessThanOrEqual = "LessThanOrEqual" } +// @public +export enum KnownOrigin { + System = "system", + User = "user", + UserSystem = "user,system" +} + // @public export type KnownPerfCounterDataSourceStreams = string; @@ -1778,18 +1830,21 @@ export enum KnownPrivateEndpointServiceConnectionStatus { // @public export enum KnownProvisioningState { Canceled = "Canceled", - Deploying = "Deploying", + Creating = "Creating", + Deleting = "Deleting", Failed = "Failed", Succeeded = "Succeeded" } // @public -export type KnownPublicNetworkAccessOptions = string; +export enum KnownPublicNetworkAccess { + Disabled = "Disabled", + Enabled = "Enabled", + SecuredByPerimeter = "SecuredByPerimeter" +} // @public -export enum KnownQueryType { - ResultCount = "ResultCount" -} +export type KnownPublicNetworkAccessOptions = string; // @public export enum KnownScaleRuleMetricDimensionOperationType { @@ -1806,6 +1861,15 @@ 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; @@ -1864,14 +1928,6 @@ export interface LogicAppReceiver { useCommonAlertSchema?: boolean; } -// @public -export interface LogMetricTrigger { - metricColumn?: string; - metricTriggerType?: MetricTriggerType; - threshold?: number; - thresholdOperator?: ConditionalOperator; -} - // @public export interface LogProfileCollection { value: LogProfileResource[]; @@ -1939,34 +1995,6 @@ export interface LogProfilesUpdateOptionalParams extends coreClient.OperationOpt // @public export type LogProfilesUpdateResponse = LogProfileResource; -// @public -export interface LogSearchRuleResource extends ResourceAutoGenerated5 { - action: ActionUnion; - autoMitigate?: boolean; - readonly createdWithApiVersion?: string; - description?: string; - displayName?: string; - enabled?: Enabled; - readonly isLegacyLogAnalyticsRule?: boolean; - readonly lastUpdatedTime?: Date; - readonly provisioningState?: ProvisioningState; - schedule?: Schedule; - source: Source; -} - -// @public -export interface LogSearchRuleResourceCollection { - value?: LogSearchRuleResource[]; -} - -// @public -export interface LogSearchRuleResourcePatch { - enabled?: Enabled; - tags?: { - [propertyName: string]: string; - }; -} - // @public export interface LogSettings { category?: string; @@ -1980,12 +2008,6 @@ export interface LogsIngestionEndpointSpec { readonly endpoint?: string; } -// @public -export interface LogToMetricAction extends Action { - criteria: Criteria[]; - odataType: "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction"; -} - // @public export interface ManagementEventAggregationCondition { operator?: ConditionOperator; @@ -2281,7 +2303,8 @@ export type MetricNamespacesListResponse = MetricNamespaceCollection; // @public export interface Metrics { - list(resourceUri: string, options?: MetricsListOptionalParams): Promise; + readonly internalId?: string; + readonly prometheusQueryEndpoint?: string; } // @public @@ -2314,6 +2337,11 @@ export interface MetricsListOptionalParams extends coreClient.OperationOptions { // @public export type MetricsListResponse = Response_2; +// @public +export interface MetricsOperations { + list(resourceUri: string, options?: MetricsListOptionalParams): Promise; +} + // @public export type MetricStatisticType = "Average" | "Min" | "Max" | "Sum" | "Count"; @@ -2333,9 +2361,6 @@ export interface MetricTrigger { timeWindow: string; } -// @public -export type MetricTriggerType = string; - // @public export type MetricUnit = string; @@ -2349,6 +2374,11 @@ export interface MetricValue { total?: number; } +// @public +export interface Monitor { + listOperationsList(options?: MonitorOperationsListOptionalParams): PagedAsyncIterableIterator; +} + // @public (undocumented) export class MonitorClient extends coreClient.ServiceClient { // (undocumented) @@ -2391,7 +2421,11 @@ export class MonitorClient extends coreClient.ServiceClient { // (undocumented) metricNamespaces: MetricNamespaces; // (undocumented) - metrics: Metrics; + metricsOperations: MetricsOperations; + // (undocumented) + monitor: Monitor; + // (undocumented) + monitoringAccounts: MonitoringAccounts; // (undocumented) operations: Operations; // (undocumented) @@ -2422,6 +2456,126 @@ export interface MonitorClientOptionalParams extends coreClient.ServiceClientOpt endpoint?: string; } +// @public +export interface MonitoringAccount { + readonly accountId?: string; + readonly defaultIngestionSettings?: MonitoringAccountDefaultIngestionSettings; + readonly metrics?: MonitoringAccountMetrics; + readonly provisioningState?: ProvisioningState; +} + +// @public +export interface MonitoringAccountDefaultIngestionSettings extends IngestionSettings { +} + +// @public +export interface MonitoringAccountMetrics extends Metrics { +} + +// @public +export interface MonitoringAccountResource extends TrackedResourceAutoGenerated { + readonly accountId?: string; + readonly defaultIngestionSettings?: MonitoringAccountDefaultIngestionSettings; + readonly etag?: string; + readonly metrics?: MonitoringAccountMetrics; + readonly provisioningState?: ProvisioningState; +} + +// @public +export interface MonitoringAccountResourceForUpdate { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface MonitoringAccountResourceListResult { + nextLink?: string; + value: MonitoringAccountResource[]; +} + +// @public +export interface MonitoringAccountResourceProperties extends MonitoringAccount { +} + +// @public +export interface MonitoringAccounts { + create(resourceGroupName: string, monitoringAccountName: string, monitoringAccountProperties: MonitoringAccountResource, options?: MonitoringAccountsCreateOptionalParams): Promise; + delete(resourceGroupName: string, monitoringAccountName: string, options?: MonitoringAccountsDeleteOptionalParams): Promise; + get(resourceGroupName: string, monitoringAccountName: string, options?: MonitoringAccountsGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: MonitoringAccountsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: MonitoringAccountsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, monitoringAccountName: string, options?: MonitoringAccountsUpdateOptionalParams): Promise; +} + +// @public +export interface MonitoringAccountsCreateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitoringAccountsCreateResponse = MonitoringAccountResource; + +// @public +export interface MonitoringAccountsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface MonitoringAccountsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitoringAccountsGetResponse = MonitoringAccountResource; + +// @public +export interface MonitoringAccountsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitoringAccountsListByResourceGroupNextResponse = MonitoringAccountResourceListResult; + +// @public +export interface MonitoringAccountsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitoringAccountsListByResourceGroupResponse = MonitoringAccountResourceListResult; + +// @public +export interface MonitoringAccountsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitoringAccountsListBySubscriptionNextResponse = MonitoringAccountResourceListResult; + +// @public +export interface MonitoringAccountsListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitoringAccountsListBySubscriptionResponse = MonitoringAccountResourceListResult; + +// @public +export interface MonitoringAccountsUpdateOptionalParams extends coreClient.OperationOptions { + monitoringAccountProperties?: MonitoringAccountResourceForUpdate; +} + +// @public +export type MonitoringAccountsUpdateResponse = MonitoringAccountResource; + +// @public +export interface MonitorOperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorOperationsListNextResponse = OperationListResultAutoGenerated; + +// @public +export interface MonitorOperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorOperationsListResponse = OperationListResultAutoGenerated; + // @public export interface MultiMetricCriteria { [property: string]: any; @@ -2473,6 +2627,15 @@ export interface Operation { name?: string; } +// @public +export interface OperationAutoGenerated { + readonly actionType?: ActionType; + display?: OperationDisplayAutoGenerated; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + // @public export interface OperationDisplay { operation?: string; @@ -2480,12 +2643,26 @@ export interface OperationDisplay { resource?: string; } +// @public +export interface OperationDisplayAutoGenerated { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + // @public export interface OperationListResult { nextLink?: string; value?: Operation[]; } +// @public +export interface OperationListResultAutoGenerated { + readonly nextLink?: string; + readonly value?: OperationAutoGenerated[]; +} + // @public export interface Operations { list(options?: OperationsListOptionalParams): Promise; @@ -2511,6 +2688,9 @@ export interface OperationStatus { // @public export type Operator = string; +// @public +export type Origin = string; + // @public export interface PerfCounterDataSource { counterSpecifiers?: string[]; @@ -2795,7 +2975,7 @@ export interface ProxyResourceAutoGenerated extends ResourceAutoGenerated3 { } // @public -export type QueryType = string; +export type PublicNetworkAccess = string; // @public export type ReceiverStatus = "NotSpecified" | "Enabled" | "Disabled"; @@ -2871,14 +3051,9 @@ export interface ResourceAutoGenerated4 { // @public export interface ResourceAutoGenerated5 { - readonly etag?: string; readonly id?: string; - readonly kind?: string; - location: string; readonly name?: string; - tags?: { - [propertyName: string]: string; - }; + readonly systemData?: SystemData; readonly type?: string; } @@ -2975,6 +3150,12 @@ export interface RuleMetricDataSource extends RuleDataSource { 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"; @@ -3022,19 +3203,87 @@ export type ScaleRuleMetricDimensionOperationType = string; export type ScaleType = "ChangeCount" | "PercentChangeCount" | "ExactCount" | "ServiceAllowedNextValue"; // @public -export interface Schedule { - frequencyInMinutes: number; - timeWindowInMinutes: number; +export interface ScheduledQueryRuleCriteria { + allOf?: Condition[]; +} + +// @public +export interface ScheduledQueryRuleResource { + actions?: Actions; + autoMitigate?: boolean; + checkWorkspaceAlertsStorageConfigured?: boolean; + readonly createdWithApiVersion?: string; + criteria?: ScheduledQueryRuleCriteria; + description?: string; + displayName?: string; + enabled?: boolean; + readonly etag?: string; + evaluationFrequency?: string; + readonly id?: string; + identity?: Identity; + readonly isLegacyLogAnalyticsRule?: boolean; + readonly isWorkspaceAlertsStorageConfigured?: boolean; + kind?: Kind; + location: string; + muteActionsDuration?: string; + readonly name?: string; + overrideQueryTimeRange?: string; + publicNetworkAccess?: PublicNetworkAccess; + ruleResolveConfiguration?: RuleResolveConfiguration; + scopes?: string[]; + severity?: AlertSeverity; + skipQueryValidation?: boolean; + readonly systemData?: SystemData; + tags?: { + [propertyName: string]: string; + }; + targetResourceTypes?: string[]; + readonly type?: string; + windowSize?: string; +} + +// @public +export interface ScheduledQueryRuleResourceCollection { + readonly nextLink?: string; + value?: ScheduledQueryRuleResource[]; +} + +// @public +export interface ScheduledQueryRuleResourcePatch { + actions?: Actions; + autoMitigate?: boolean; + checkWorkspaceAlertsStorageConfigured?: boolean; + readonly createdWithApiVersion?: string; + criteria?: ScheduledQueryRuleCriteria; + description?: string; + displayName?: string; + enabled?: boolean; + evaluationFrequency?: string; + identity?: Identity; + readonly isLegacyLogAnalyticsRule?: boolean; + readonly isWorkspaceAlertsStorageConfigured?: boolean; + muteActionsDuration?: string; + overrideQueryTimeRange?: string; + publicNetworkAccess?: PublicNetworkAccess; + ruleResolveConfiguration?: RuleResolveConfiguration; + scopes?: string[]; + severity?: AlertSeverity; + skipQueryValidation?: boolean; + tags?: { + [propertyName: string]: string; + }; + targetResourceTypes?: string[]; + windowSize?: string; } // @public export interface ScheduledQueryRules { - createOrUpdate(resourceGroupName: string, ruleName: string, parameters: LogSearchRuleResource, options?: ScheduledQueryRulesCreateOrUpdateOptionalParams): Promise; + createOrUpdate(resourceGroupName: string, ruleName: string, parameters: ScheduledQueryRuleResource, options?: ScheduledQueryRulesCreateOrUpdateOptionalParams): Promise; delete(resourceGroupName: string, ruleName: string, options?: ScheduledQueryRulesDeleteOptionalParams): Promise; get(resourceGroupName: string, ruleName: string, options?: ScheduledQueryRulesGetOptionalParams): Promise; - listByResourceGroup(resourceGroupName: string, options?: ScheduledQueryRulesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - listBySubscription(options?: ScheduledQueryRulesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; - update(resourceGroupName: string, ruleName: string, parameters: LogSearchRuleResourcePatch, options?: ScheduledQueryRulesUpdateOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: ScheduledQueryRulesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: ScheduledQueryRulesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, ruleName: string, parameters: ScheduledQueryRuleResourcePatch, options?: ScheduledQueryRulesUpdateOptionalParams): Promise; } // @public @@ -3042,7 +3291,7 @@ export interface ScheduledQueryRulesCreateOrUpdateOptionalParams extends coreCli } // @public -export type ScheduledQueryRulesCreateOrUpdateResponse = LogSearchRuleResource; +export type ScheduledQueryRulesCreateOrUpdateResponse = ScheduledQueryRuleResource; // @public export interface ScheduledQueryRulesDeleteOptionalParams extends coreClient.OperationOptions { @@ -3053,30 +3302,42 @@ export interface ScheduledQueryRulesGetOptionalParams extends coreClient.Operati } // @public -export type ScheduledQueryRulesGetResponse = LogSearchRuleResource; +export type ScheduledQueryRulesGetResponse = ScheduledQueryRuleResource; + +// @public +export interface ScheduledQueryRulesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ScheduledQueryRulesListByResourceGroupNextResponse = ScheduledQueryRuleResourceCollection; // @public export interface ScheduledQueryRulesListByResourceGroupOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public -export type ScheduledQueryRulesListByResourceGroupResponse = LogSearchRuleResourceCollection; +export type ScheduledQueryRulesListByResourceGroupResponse = ScheduledQueryRuleResourceCollection; + +// @public +export interface ScheduledQueryRulesListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ScheduledQueryRulesListBySubscriptionNextResponse = ScheduledQueryRuleResourceCollection; // @public export interface ScheduledQueryRulesListBySubscriptionOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public -export type ScheduledQueryRulesListBySubscriptionResponse = LogSearchRuleResourceCollection; +export type ScheduledQueryRulesListBySubscriptionResponse = ScheduledQueryRuleResourceCollection; // @public export interface ScheduledQueryRulesUpdateOptionalParams extends coreClient.OperationOptions { } // @public -export type ScheduledQueryRulesUpdateResponse = LogSearchRuleResource; +export type ScheduledQueryRulesUpdateResponse = ScheduledQueryRuleResource; // @public export interface ScopedResource extends ProxyResourceAutoGenerated { @@ -3124,14 +3385,6 @@ export interface SmsReceiver { readonly status?: ReceiverStatus; } -// @public -export interface Source { - authorizedResources?: string[]; - dataSourceId: string; - query?: string; - queryType?: QueryType; -} - // @public export interface StreamDeclaration { columns?: ColumnDefinition[]; @@ -3169,8 +3422,6 @@ export interface TenantActivityLogs { // @public export interface TenantActivityLogsListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - select?: string; } // @public @@ -3203,6 +3454,9 @@ export interface ThresholdRuleCondition extends RuleCondition { windowSize?: string; } +// @public +export type TimeAggregation = string; + // @public export type TimeAggregationOperator = "Average" | "Minimum" | "Maximum" | "Total" | "Last"; @@ -3240,10 +3494,17 @@ export interface TrackedResource extends ResourceAutoGenerated3 { } // @public -export interface TriggerCondition { - metricTrigger?: LogMetricTrigger; - threshold: number; - thresholdOperator: ConditionalOperator; +export interface TrackedResourceAutoGenerated extends ResourceAutoGenerated5 { + location: string; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface UserIdentityProperties { + readonly clientId?: string; + readonly principalId?: string; } // @public 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 14730cfd5f3b..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NotificationRequestBody, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Send test notifications to a set of provided receivers - * - * @summary Send test notifications to a set of provided receivers - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtActionGroupResourceLevel.json - */ -async function createNotificationsAtResourceGroupLevel() { - const subscriptionId = "11111111-1111-1111-1111-111111111111"; - const resourceGroupName = "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); -} - -createNotificationsAtResourceGroupLevel().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateNotificationsAtResourceGroupLevelSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateNotificationsAtResourceGroupLevelSample.ts deleted file mode 100644 index 8e7aff71d60a..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateNotificationsAtResourceGroupLevelSample.ts +++ /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. -import { NotificationRequestBody, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Send test notifications to a set of provided receivers - * - * @summary Send test notifications to a set of provided receivers - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtResourceGroupLevel.json - */ -async function createNotificationsAtResourceGroupLevel() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "Default-TestNotifications"; - const notificationRequest: NotificationRequestBody = { - alertType: "budget", - armRoleReceivers: [ - { - name: "ArmRole-Common", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: true - }, - { - name: "ArmRole-nonCommon", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: false - } - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "http://test.me", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084" - } - ], - azureAppPushReceivers: [ - { name: "Sample azureAppPush", emailAddress: "johndoe@email.com" } - ], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true - } - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true - } - ], - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84" - } - ], - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: - "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c" - } - ], - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false - } - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890" - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321" - } - ], - voiceReceivers: [ - { name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" } - ], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true - }, - { - name: "Sample webhook 2", - identifierUri: - "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true - } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.beginCreateNotificationsAtResourceGroupLevelAndWait( - resourceGroupName, - notificationRequest - ); - console.log(result); -} - -createNotificationsAtResourceGroupLevel().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 0e0211e5df2f..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateOrUpdateSample.ts +++ /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. -import { ActionGroupResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Create a new action group or update an existing one. - * - * @summary Create a new action group or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/createOrUpdateActionGroup.json - */ -async function createOrUpdateAnActionGroup() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -createOrUpdateAnActionGroup().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 bbb4fe0af36d..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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Delete an action group. - * - * @summary Delete an action group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/deleteActionGroup.json - */ -async function deleteAnActionGroup() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -deleteAnActionGroup().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 3076b7381dbd..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsEnableReceiverSample.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 { EnableRequest, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation is only supported for Email or SMS receivers. - * - * @summary Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation is only supported for Email or SMS receivers. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/enableReceiver.json - */ -async function enableTheReceiver() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -enableTheReceiver().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 9f3170a74dbe..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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get an action group. - * - * @summary Get an action group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getActionGroup.json - */ -async function getAnActionGroup() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -getAnActionGroup().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 e69eeafd2369..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.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"; - -/** - * This sample demonstrates how to Get the test notifications by the notification id - * - * @summary Get the test notifications by the notification id - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtActionGroupResourceLevel.json - */ -async function getNotificationDetailsAtResourceGroupLevel() { - const subscriptionId = "11111111-1111-1111-1111-111111111111"; - const resourceGroupName = "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); -} - -getNotificationDetailsAtResourceGroupLevel().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.ts deleted file mode 100644 index d4028c828e29..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the test notifications by the notification id - * - * @summary Get the test notifications by the notification id - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtResourceGroupLevel.json - */ -async function getNotificationDetailsAtResourceGroupLevel() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "Default-TestNotifications"; - const notificationId = "11000222191287"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.getTestNotificationsAtResourceGroupLevel( - resourceGroupName, - notificationId - ); - console.log(result); -} - -getNotificationDetailsAtResourceGroupLevel().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsSample.ts deleted file mode 100644 index fa911a387a1b..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the test notifications by the notification id - * - * @summary Get the test notifications by the notification id - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotifications.json - */ -async function getNotificationDetailsAtSubscriptionLevel() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const notificationId = "11000222191287"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.getTestNotifications(notificationId); - console.log(result); -} - -getNotificationDetailsAtSubscriptionLevel().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 713e65f337fc..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsListByResourceGroupSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get a list of all action groups in a resource group. - * - * @summary Get a list of all action groups in a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json - */ -async function listActionGroupsAtResourceGroupLevel() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -listActionGroupsAtResourceGroupLevel().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 7693616de76f..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsListBySubscriptionIdSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get a list of all action groups in a subscription. - * - * @summary Get a list of all action groups in a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json - */ -async function listActionGroupsAtSubscriptionLevel() { - const subscriptionId = "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); -} - -listActionGroupsAtSubscriptionLevel().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsPostTestNotificationsSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsPostTestNotificationsSample.ts deleted file mode 100644 index 09ba14e48b33..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsPostTestNotificationsSample.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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NotificationRequestBody, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Send test notifications to a set of provided receivers - * - * @summary Send test notifications to a set of provided receivers - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotifications.json - */ -async function createNotificationsAtSubscriptionLevel() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const notificationRequest: NotificationRequestBody = { - alertType: "budget", - armRoleReceivers: [ - { - name: "ArmRole-Common", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: true - }, - { - name: "ArmRole-nonCommon", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: false - } - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "http://test.me", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084" - } - ], - azureAppPushReceivers: [ - { name: "Sample azureAppPush", emailAddress: "johndoe@email.com" } - ], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true - } - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true - } - ], - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84" - } - ], - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: - "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c" - } - ], - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false - } - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890" - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321" - } - ], - voiceReceivers: [ - { name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" } - ], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true - }, - { - name: "Sample webhook 2", - identifierUri: - "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true - } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.beginPostTestNotificationsAndWait( - notificationRequest - ); - console.log(result); -} - -createNotificationsAtSubscriptionLevel().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 02ad5766df97..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsUpdateSample.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 { ActionGroupPatchBody, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/patchActionGroup.json - */ -async function patchAnActionGroup() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -patchAnActionGroup().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 1ffb147250db..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsCreateOrUpdateSample.ts +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ActivityLogAlertResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -createOrUpdateAnActivityLogAlertRule().catch(console.error); - -/** - * 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 = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -createOrUpdateAnActivityLogAlertRuleWithAnyOfCondition().catch(console.error); - -/** - * 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 = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -createOrUpdateAnActivityLogAlertRuleWithContainsAny().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 350ccbafc9ab..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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -deleteAnActivityLogAlertRule().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 bae118a56a21..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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -getAnActivityLogAlertRule().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 2ebab98a1f1f..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsListByResourceGroupSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -listActivityLogAlerts().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 8599914a6da8..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsListBySubscriptionIdSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "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); -} - -getListOfAllActivityLogAlertRulesUnderASubscription().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 5442590f1a56..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsUpdateSample.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 { AlertRulePatchObject, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -patchAnActivityLogAlertRule().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 bfe0834c38d5..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/activityLogsListSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ActivityLogsListOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "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); -} - -getActivityLogsWithFilter().catch(console.error); - -/** - * 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 = "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); -} - -getActivityLogsWithFilterAndSelect().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 63b490c82b03..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRuleIncidentsGetSample.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"; - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -getASingleAlertRuleIncident().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 f4c64d9d78c4..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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -listAlertRuleIncidents().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 84504952c1ab..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRulesCreateOrUpdateSample.ts +++ /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. -import { AlertRuleResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -createOrUpdateAnAlertRule().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 8dc25f8e8d3d..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRulesDeleteSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -deleteAnAlertRule().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 15bb81680a64..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRulesGetSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -getAnAlertRule().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 574e1e4af6a1..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRulesListByResourceGroupSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -listAlertRules().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 463d30dd0c95..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRulesListBySubscriptionSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "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); -} - -listAlertRules().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 a48a50c7afed..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRulesUpdateSample.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AlertRuleResourcePatch, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -patchAnAlertRule().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 63cc1543832f..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsCreateOrUpdateSample.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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AutoscaleSettingResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -createOrUpdateAnAutoscaleSetting().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 13d81a9bc8d5..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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -deleteAnAutoscaleSetting().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 152ec9d51b0d..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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -getAnAutoscaleSetting().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 f2db8ccdd5cb..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsListByResourceGroupSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -listAutoscaleSettings().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 ee1819296832..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsListBySubscriptionSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "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); -} - -listAutoscaleSettingsBySubs().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 13126d25fa43..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsUpdateSample.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 { - AutoscaleSettingResourcePatch, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -patchAnAutoscaleSetting().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 9018150856ce..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/baselinesListSample.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 { BaselinesListOptionalParams, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to **Lists the metric baseline values for a resource**. - * - * @summary **Lists the metric baseline values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2019-03-01/examples/metricBaselines.json - */ -async function getMetricBaselines() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1"; - const timespan = "2019-03-12T11:00:00.000Z/2019-03-12T12:00:00.000Z"; - const interval = "PT1H"; - const aggregation = "average"; - const sensitivities = "Low,Medium"; - const options: BaselinesListOptionalParams = { - timespan, - interval, - aggregation, - sensitivities - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.baselines.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -getMetricBaselines().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 e4a2ac6e2139..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsCreateSample.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 { - DataCollectionEndpointResource, - DataCollectionEndpointsCreateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Creates or updates a data collection endpoint. - * - * @summary Creates or updates a data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsCreate.json - */ -async function createOrUpdateDataCollectionEndpoint() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -createOrUpdateDataCollectionEndpoint().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 0df7e3bb72ef..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsDeleteSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Deletes a data collection endpoint. - * - * @summary Deletes a data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsDelete.json - */ -async function deleteDataCollectionEndpoint() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -deleteDataCollectionEndpoint().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 08ed8322033f..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Returns the specified data collection endpoint. - * - * @summary Returns the specified data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsGet.json - */ -async function getDataCollectionEndpoint() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -getDataCollectionEndpoint().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 ad69bc5207bd..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsListByResourceGroupSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists all data collection endpoints in the specified resource group. - * - * @summary Lists all data collection endpoints in the specified resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListByResourceGroup.json - */ -async function listDataCollectionEndpointsByResourceGroup() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -listDataCollectionEndpointsByResourceGroup().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 e6f0325b1163..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsListBySubscriptionSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists all data collection endpoints in the specified subscription - * - * @summary Lists all data collection endpoints in the specified subscription - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListBySubscription.json - */ -async function listDataCollectionEndpointsBySubscription() { - const subscriptionId = "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); -} - -listDataCollectionEndpointsBySubscription().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 730129793f0a..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsUpdateSample.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 { - ResourceForUpdate, - DataCollectionEndpointsUpdateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Updates part of a data collection endpoint. - * - * @summary Updates part of a data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsUpdate.json - */ -async function updateDataCollectionEndpoint() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -updateDataCollectionEndpoint().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 74cc5eaf0b09..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsCreateSample.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 { - DataCollectionRuleAssociationProxyOnlyResource, - DataCollectionRuleAssociationsCreateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Creates or updates an association. - * - * @summary Creates or updates an association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsCreate.json - */ -async function createOrUpdateAssociation() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const associationName = "myAssociation"; - const body: DataCollectionRuleAssociationProxyOnlyResource = { - dataCollectionRuleId: - "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule" - }; - const options: DataCollectionRuleAssociationsCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRuleAssociations.create( - resourceUri, - associationName, - options - ); - console.log(result); -} - -createOrUpdateAssociation().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 8c7881e8c1d2..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsDeleteSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Deletes an association. - * - * @summary Deletes an association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsDelete.json - */ -async function deleteAssociation() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const associationName = "myAssociation"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRuleAssociations.delete( - resourceUri, - associationName - ); - console.log(result); -} - -deleteAssociation().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 d416cffe8df8..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsGetSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Returns the specified association. - * - * @summary Returns the specified association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsGet.json - */ -async function getAssociation() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const associationName = "myAssociation"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRuleAssociations.get( - resourceUri, - associationName - ); - console.log(result); -} - -getAssociation().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 865091cdc7c8..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.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"; - -/** - * This sample demonstrates how to Lists associations for the specified data collection endpoint. - * - * @summary Lists associations for the specified data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByDataCollectionEndpoint.json - */ -async function listAssociationsForSpecifiedDataCollectionEndpoint() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -listAssociationsForSpecifiedDataCollectionEndpoint().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 a386a6046ed4..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsListByResourceSample.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"; - -/** - * This sample demonstrates how to Lists associations for the specified resource. - * - * @summary Lists associations for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByResource.json - */ -async function listAssociationsForSpecifiedResource() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRuleAssociations.listByResource( - resourceUri - )) { - resArray.push(item); - } - console.log(resArray); -} - -listAssociationsForSpecifiedResource().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 6c5e25aaa1de..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsListByRuleSample.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"; - -/** - * This sample demonstrates how to Lists associations for the specified data collection rule. - * - * @summary Lists associations for the specified data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByRule.json - */ -async function listAssociationsForSpecifiedDataCollectionRule() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -listAssociationsForSpecifiedDataCollectionRule().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 13f65c014fe9..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesCreateSample.ts +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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"; - -/** - * This sample demonstrates how to Creates or updates a data collection rule. - * - * @summary Creates or updates a data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesCreate.json - */ -async function createOrUpdateDataCollectionRule() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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", - "MemoryCommitted 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); -} - -createOrUpdateDataCollectionRule().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 e7047f5ee242..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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Deletes a data collection rule. - * - * @summary Deletes a data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesDelete.json - */ -async function deleteDataCollectionRule() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -deleteDataCollectionRule().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 ae578d398426..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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Returns the specified data collection rule. - * - * @summary Returns the specified data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesGet.json - */ -async function getDataCollectionRule() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -getDataCollectionRule().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 66492b5e0886..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesListByResourceGroupSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists all data collection rules in the specified resource group. - * - * @summary Lists all data collection rules in the specified resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListByResourceGroup.json - */ -async function listDataCollectionRulesByResourceGroup() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -listDataCollectionRulesByResourceGroup().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 e622dc1a393a..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesListBySubscriptionSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists all data collection rules in the specified subscription. - * - * @summary Lists all data collection rules in the specified subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListBySubscription.json - */ -async function listDataCollectionRulesBySubscription() { - const subscriptionId = "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); -} - -listDataCollectionRulesBySubscription().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 4bfc7b5c2e26..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesUpdateSample.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 { - ResourceForUpdate, - DataCollectionRulesUpdateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Updates part of a data collection rule. - * - * @summary Updates part of a data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesUpdate.json - */ -async function updateDataCollectionRule() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -updateDataCollectionRule().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 d2989c3d6727..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCategoryGetSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets the diagnostic settings category for the specified resource. - * - * @summary Gets the diagnostic settings category for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingsCategory.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "WorkflowRuntime"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettingsCategory.get(resourceUri, name); - console.log(result); -} - -getsTheDiagnosticSetting().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 5d95a59fff22..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCategoryListSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists the diagnostic settings categories for the specified resource. - * - * @summary Lists the diagnostic settings categories for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettingsCategories.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.diagnosticSettingsCategory.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -getsTheDiagnosticSetting().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 95b01554e4cc..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCreateOrUpdateSample.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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { DiagnosticSettingsResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Creates or updates diagnostic settings for the specified resource. - * - * @summary Creates or updates diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateDiagnosticSetting.json - */ -async function createsOrUpdatesTheDiagnosticSetting() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const parameters: DiagnosticSettingsResource = { - eventHubAuthorizationRuleId: - "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule", - eventHubName: "myeventhub", - logAnalyticsDestinationType: "Dedicated", - logs: [ - { - categoryGroup: "allLogs", - enabled: true, - retentionPolicy: { days: 0, enabled: false } - } - ], - marketplacePartnerId: - "/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1", - metrics: [ - { - category: "WorkflowMetrics", - enabled: true, - retentionPolicy: { days: 0, enabled: false } - } - ], - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1", - workspaceId: "" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.createOrUpdate( - resourceUri, - name, - parameters - ); - console.log(result); -} - -createsOrUpdatesTheDiagnosticSetting().catch(console.error); - -/** - * This sample demonstrates how to Creates or updates diagnostic settings for the specified resource. - * - * @summary Creates or updates diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateDiagnosticSettingCategory.json - */ -async function createsOrUpdatesTheDiagnosticSettingForCategory() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const parameters: DiagnosticSettingsResource = { - eventHubAuthorizationRuleId: - "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule", - eventHubName: "myeventhub", - logAnalyticsDestinationType: "Dedicated", - logs: [ - { - category: "WorkflowRuntime", - enabled: true, - retentionPolicy: { days: 0, enabled: false } - } - ], - marketplacePartnerId: - "/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1", - metrics: [ - { - category: "WorkflowMetrics", - enabled: true, - retentionPolicy: { days: 0, enabled: false } - } - ], - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1", - workspaceId: "" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.createOrUpdate( - resourceUri, - name, - parameters - ); - console.log(result); -} - -createsOrUpdatesTheDiagnosticSettingForCategory().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 e87ead0982bc..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsDeleteSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Deletes existing diagnostic settings for the specified resource. - * - * @summary Deletes existing diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/deleteDiagnosticSetting.json - */ -async function deletesTheDiagnosticSetting() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.delete(resourceUri, name); - console.log(result); -} - -deletesTheDiagnosticSetting().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 0c6e5af5c99a..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsGetSample.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"; - -/** - * This sample demonstrates how to Gets the active diagnostic settings for the specified resource. - * - * @summary Gets the active diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSetting.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.get(resourceUri, name); - console.log(result); -} - -getsTheDiagnosticSetting().catch(console.error); - -/** - * This sample demonstrates how to Gets the active diagnostic settings for the specified resource. - * - * @summary Gets the active diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingCategory.json - */ -async function getsTheDiagnosticSettingForCategory() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.get(resourceUri, name); - console.log(result); -} - -getsTheDiagnosticSettingForCategory().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 3391144c471b..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsListSample.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 { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets the active diagnostic settings list for the specified resource. - * - * @summary Gets the active diagnostic settings list for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettings.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.diagnosticSettings.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -getsTheDiagnosticSetting().catch(console.error); - -/** - * This sample demonstrates how to Gets the active diagnostic settings list for the specified resource. - * - * @summary Gets the active diagnostic settings list for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettingsCategory.json - */ -async function getsTheDiagnosticSettingForCategory() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.diagnosticSettings.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -getsTheDiagnosticSettingForCategory().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 327aee38fa46..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/eventCategoriesListSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the list of available event categories supported in the Activity Logs Service.
The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. - * - * @summary Get the list of available event categories supported in the Activity Logs Service.
The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetEventCategories.json - */ -async function getEventCategories() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.eventCategories.list()) { - resArray.push(item); - } - console.log(resArray); -} - -getEventCategories().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 9380ac49e851..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/logProfilesCreateOrUpdateSample.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 { LogProfileResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "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); -} - -createOrUpdateALogProfile().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 05afd6c9cfdd..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/logProfilesDeleteSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "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); -} - -deleteLogProfile().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 fcfd4e333451..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/logProfilesGetSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "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); -} - -getLogProfile().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 c85e315bb4c4..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/logProfilesListSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "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); -} - -listLogProfiles().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 6c604354e8ad..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/logProfilesUpdateSample.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 { LogProfileResourcePatch, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "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); -} - -patchALogProfile().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 de5f8be8879d..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsCreateOrUpdateSample.ts +++ /dev/null @@ -1,487 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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"; - -/** - * 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 = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "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); -} - -createOrUpdateADynamicAlertRuleForMultipleResources().catch(console.error); - -/** - * 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 = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "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); -} - -createOrUpdateADynamicAlertRuleForSingleResource().catch(console.error); - -/** - * 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 = "12345678-1234-1234-1234-123456789101"; - const resourceGroupName = "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); -} - -createOrUpdateAWebTestAlertRule().catch(console.error); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -createOrUpdateAnAlertRuleForMultipleResource().catch(console.error); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -createOrUpdateAnAlertRuleForSingleResource().catch(console.error); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -createOrUpdateAnAlertRuleOnResourceGroupS().catch(console.error); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -createOrUpdateAnAlertRuleOnSubscription().catch(console.error); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -createOrUpdateAnAlertRulesWithDimensions().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 3b25ab0bc93f..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsDeleteSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -deleteAnAlertRule().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 20f1c2da8438..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsGetSample.ts +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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"; - -/** - * 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 = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "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); -} - -getADynamicAlertRuleForMultipleResources().catch(console.error); - -/** - * 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 = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "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); -} - -getADynamicAlertRuleForSingleResource().catch(console.error); - -/** - * 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 = "12345678-1234-1234-1234-123456789101"; - const resourceGroupName = "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); -} - -getAWebTestAlertRule().catch(console.error); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -getAnAlertRuleForMultipleResources().catch(console.error); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -getAnAlertRuleForSingleResource().catch(console.error); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -getAnAlertRuleOnResourceGroupS().catch(console.error); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -getAnAlertRuleOnSubscription().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 e35301adb673..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsListByResourceGroupSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -listMetricAlertRules().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 a40ec5a27ddd..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsListBySubscriptionSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "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); -} - -listMetricAlertRules().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 112a5b0c9e80..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsStatusListByNameSample.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"; - -/** - * 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 = "009f6022-67ec-423e-9aa7-691182870588"; - const resourceGroupName = "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); -} - -getAnAlertRuleStatus().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 0408b564ef6e..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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -getAnAlertRuleStatus().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 d7e5b58acbc3..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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MetricAlertResourcePatch, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -createOrUpdateAnAlertRule().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 4b7ec466e7d8..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/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"; - -/** - * This sample demonstrates how to Lists the metric definitions for the resource. - * - * @summary Lists the metric definitions for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitionsApplicationInsights.json - */ -async function getApplicationInsightsMetricDefinitionsWithoutFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions"; - const metricnamespace = "microsoft.insights/components"; - const options: MetricDefinitionsListOptionalParams = { metricnamespace }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -getApplicationInsightsMetricDefinitionsWithoutFilter().catch(console.error); - -/** - * This sample demonstrates how to Lists the metric definitions for the resource. - * - * @summary Lists the metric definitions for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitions.json - */ -async function getMetricDefinitionsWithoutFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricDefinitions"; - const metricnamespace = "Microsoft.Web/sites"; - const options: MetricDefinitionsListOptionalParams = { metricnamespace }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -getMetricDefinitionsWithoutFilter().catch(console.error); - -/** - * This sample demonstrates how to Lists the metric definitions for the resource. - * - * @summary Lists the metric definitions for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitionsMetricClass.json - */ -async function getStorageCacheMetricDefinitionsWithMetricClass() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"; - const metricnamespace = "microsoft.storagecache/caches"; - const options: MetricDefinitionsListOptionalParams = { metricnamespace }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -getStorageCacheMetricDefinitionsWithMetricClass().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 64c8b014c540..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricNamespacesListSample.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 { - MetricNamespacesListOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists the metric namespaces for the resource. - * - * @summary Lists the metric namespaces for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/examples/GetMetricNamespaces.json - */ -async function getMetricNamespacesWithoutFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"; - const startTime = "2020-08-31T15:53:00Z"; - const options: MetricNamespacesListOptionalParams = { startTime }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricNamespaces.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -getMetricNamespacesWithoutFilter().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 87c22cbc65f8..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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MetricsListOptionalParams, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to **Lists the metric values for a resource**. - * - * @summary **Lists the metric values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetric.json - */ -async function getMetricForData() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default"; - const timespan = "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z"; - const interval = "PT1M"; - const aggregation = "Average,count"; - const top = 3; - const orderby = "Average asc"; - const filter = "BlobType eq '*'"; - const metricnamespace = "Microsoft.Storage/storageAccounts/blobServices"; - const options: MetricsListOptionalParams = { - timespan, - interval, - aggregation, - top, - orderby, - filter, - metricnamespace - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metrics.list(resourceUri, options); - console.log(result); -} - -getMetricForData().catch(console.error); - -/** - * This sample demonstrates how to **Lists the metric values for a resource**. - * - * @summary **Lists the metric values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricMetadata.json - */ -async function getMetricForMetadata() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default"; - const timespan = "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z"; - const interval = "PT1M"; - const aggregation = "Average,count"; - const top = 3; - const orderby = "Average asc"; - const filter = "BlobType eq '*'"; - const metricnamespace = "Microsoft.Storage/storageAccounts/blobServices"; - const options: MetricsListOptionalParams = { - timespan, - interval, - aggregation, - top, - orderby, - filter, - metricnamespace - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metrics.list(resourceUri, options); - console.log(result); -} - -getMetricForMetadata().catch(console.error); - -/** - * This sample demonstrates how to **Lists the metric values for a resource**. - * - * @summary **Lists the metric values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricError.json - */ -async function getMetricWithError() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/ac41e21f-afd6-4a79-8070-f01eba278f97/resourceGroups/todking/providers/Microsoft.DocumentDb/databaseAccounts/tk-cosmos-mongo"; - const timespan = "2021-06-07T21:51:00Z/2021-06-08T01:51:00Z"; - const interval = "FULL"; - const metricnames = "MongoRequestsCount,MongoRequests"; - const aggregation = "average"; - const metricnamespace = "microsoft.documentdb/databaseaccounts"; - const options: MetricsListOptionalParams = { - timespan, - interval, - metricnames, - aggregation, - metricnamespace - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metrics.list(resourceUri, options); - console.log(result); -} - -getMetricWithError().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 758830df40d5..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/operationsListSample.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.operations.list(); - console.log(result); -} - -getAListOfOperationsForAResourceProvider().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 5698cfee7be5..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/predictiveMetricGetSample.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"; - -/** - * 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 = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "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); -} - -getMetricForData().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 58206cb36211..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.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 { PrivateEndpointConnection, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const privateEndpointConnectionName = "private-endpoint-connection-name"; - const parameters: PrivateEndpointConnection = { - privateLinkServiceConnectionState: { - description: "Approved by johndoe@contoso.com", - status: "Approved" - } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginCreateOrUpdateAndWait( - resourceGroupName, - scopeName, - privateEndpointConnectionName, - parameters - ); - console.log(result); -} - -approveOrRejectAPrivateEndpointConnectionWithAGivenName().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 4fcd19543efb..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsDeleteSample.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"; - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -deletesAPrivateEndpointConnectionWithAGivenName().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 f48d3d2f4df8..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsGetSample.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"; - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -getsPrivateEndpointConnection().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 0ca1e44f0bfe..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsListByPrivateLinkScopeSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -getsListOfPrivateEndpointConnectionsOnAPrivateLinkScope().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 3f88401dc007..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkResourcesGetSample.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"; - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -getsPrivateEndpointConnection().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 7285ca8536d9..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkResourcesListByPrivateLinkScopeSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -getsPrivateEndpointConnection().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 073cda5f69e0..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopeOperationStatusGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "613192d7-503f-477a-9cfe-4efc3ee2bd60"; - const asyncOperationId = "713192d7-503f-477a-9cfe-4efc3ee2bd11"; - const resourceGroupName = "MyResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopeOperationStatus.get( - asyncOperationId, - resourceGroupName - ); - console.log(result); -} - -getSpecificOperationStatus().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 b1a4de94ed97..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesCreateOrUpdateSample.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 { ScopedResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -updateAScopedResourceInAPrivateLinkScope().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 0b3d189af0be..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesDeleteSample.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"; - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -deletesAScopedResourceWithAGivenName().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 803b21e0a281..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesGetSample.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"; - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -getsPrivateLinkScopedResource().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 40495b505eb2..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesListByPrivateLinkScopeSample.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"; - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -getsListOfScopedResourcesInAPrivateLinkScope().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 ee3c8730fe23..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesCreateOrUpdateSample.ts +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AzureMonitorPrivateLinkScope, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = "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); -} - -privateLinkScopeCreate().catch(console.error); - -/** - * 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 = "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = "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); -} - -privateLinkScopeUpdate().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 4baf96e85732..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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = "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); -} - -privateLinkScopesDelete().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 89c95def352f..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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = "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); -} - -privateLinkScopeGet().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 d5f02230f8a7..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesListByResourceGroupSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = "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); -} - -privateLinkScopeListByResourceGroup().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 df679d343e17..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesListSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "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); -} - -privateLinkScopesListJson().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 f40c975303dd..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesUpdateTagsSample.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 { TagsResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "subid"; - const resourceGroupName = "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); -} - -privateLinkScopeUpdateTagsOnly().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 14f27c7ec33d..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesCreateOrUpdateSample.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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { LogSearchRuleResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Creates or updates an log search rule. - * - * @summary Creates or updates an log search rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRules.json - */ -async function createOrUpdateRuleAlertingAction() { - const subscriptionId = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "Rac46PostSwapRG"; - const ruleName = "logalertfoo"; - const parameters: LogSearchRuleResource = { - description: "log alert description", - action: { - aznsAction: { - actionGroup: [], - customWebhookPayload: "{}", - emailSubject: "Email Header" - }, - odataType: - "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", - severity: "1", - trigger: { - metricTrigger: { - metricColumn: "Computer", - metricTriggerType: "Consecutive", - threshold: 5, - thresholdOperator: "GreaterThan" - }, - threshold: 3, - thresholdOperator: "GreaterThan" - } - }, - enabled: "true", - location: "eastus", - schedule: { frequencyInMinutes: 15, timeWindowInMinutes: 15 }, - source: { - dataSourceId: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.OperationalInsights/workspaces/sampleWorkspace", - query: - "Heartbeat | summarize AggregatedValue = count() by bin(TimeGenerated, 5m)", - queryType: "ResultCount" - }, - tags: {} - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -createOrUpdateRuleAlertingAction().catch(console.error); - -/** - * This sample demonstrates how to Creates or updates an log search rule. - * - * @summary Creates or updates an log search rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRuleswithCrossResource.json - */ -async function createOrUpdateRuleAlertingActionWithCrossResource() { - const subscriptionId = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "Rac46PostSwapRG"; - const ruleName = "SampleCrossResourceAlert"; - const parameters: LogSearchRuleResource = { - description: "Sample Cross Resource alert", - action: { - aznsAction: { - actionGroup: [ - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/actiongroups/test-ag" - ], - emailSubject: "Cross Resource Mail!!" - }, - odataType: - "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", - severity: "3", - trigger: { threshold: 5000, thresholdOperator: "GreaterThan" } - }, - enabled: "true", - location: "eastus", - schedule: { frequencyInMinutes: 60, timeWindowInMinutes: 60 }, - source: { - authorizedResources: [ - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.OperationalInsights/workspaces/sampleWorkspace", - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI" - ], - dataSourceId: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI", - query: 'union requests, workspace("sampleWorkspace").Update', - queryType: "ResultCount" - }, - tags: {} - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -createOrUpdateRuleAlertingActionWithCrossResource().catch(console.error); - -/** - * This sample demonstrates how to Creates or updates an log search rule. - * - * @summary Creates or updates an log search rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRule-LogToMetricAction.json - */ -async function createOrUpdateRuleLogToMetricAction() { - const subscriptionId = "af52d502-a447-4bc6-8cb7-4780fbb00490"; - const resourceGroupName = "alertsweu"; - const ruleName = "logtometricfoo"; - const parameters: LogSearchRuleResource = { - description: "log to metric description", - action: { - criteria: [{ dimensions: [], metricName: "Average_% Idle Time" }], - odataType: - "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction" - }, - enabled: "true", - location: "West Europe", - source: { - dataSourceId: - "/subscriptions/af52d502-a447-4bc6-8cb7-4780fbb00490/resourceGroups/alertsweu/providers/Microsoft.OperationalInsights/workspaces/alertsweu" - }, - tags: {} - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -createOrUpdateRuleLogToMetricAction().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 e5d32d5deca6..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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Deletes a Log Search rule - * - * @summary Deletes a Log Search rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/deleteScheduledQueryRules.json - */ -async function deleteRule() { - const subscriptionId = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "Rac46PostSwapRG"; - const ruleName = "logalertfoo"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.delete( - resourceGroupName, - ruleName - ); - console.log(result); -} - -deleteRule().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 159d6e1f4415..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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets an Log Search rule - * - * @summary Gets an Log Search rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/getScheduledQueryRules.json - */ -async function getRule() { - const subscriptionId = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "Rac46PostSwapRG"; - const ruleName = "logalertfoo"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.get( - resourceGroupName, - ruleName - ); - console.log(result); -} - -getRule().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 4a54ad156ab2..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesListByResourceGroupSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to List the Log Search rules within a resource group. - * - * @summary List the Log Search rules within a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/listScheduledQueryRules.json - */ -async function listRules() { - const subscriptionId = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "gigtest"; - 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); -} - -listRules().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 2fca11d6bcf0..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesListBySubscriptionSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to List the Log Search rules within a subscription group. - * - * @summary List the Log Search rules within a subscription group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/listScheduledQueryRules.json - */ -async function listRules() { - const subscriptionId = "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.scheduledQueryRules.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -listRules().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 ab8f6ea717d9..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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { LogSearchRuleResourcePatch, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Update log search Rule. - * - * @summary Update log search Rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/patchScheduledQueryRules.json - */ -async function patchLogSearchRule() { - const subscriptionId = "subid"; - const resourceGroupName = "my-resource-group"; - const ruleName = "logalertfoo"; - const parameters: LogSearchRuleResourcePatch = { enabled: "true" }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.update( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -patchLogSearchRule().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 f4f597a65179..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/tenantActivityLogsListSample.ts +++ /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. -import { - TenantActivityLogsListOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsFiltered.json - */ -async function getTenantActivityLogsWithFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const options: TenantActivityLogsListOptionalParams = { filter }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -getTenantActivityLogsWithFilter().catch(console.error); - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsFilteredAndSelected.json - */ -async function getTenantActivityLogsWithFilterAndSelect() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const select = - "eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level"; - const options: TenantActivityLogsListOptionalParams = { filter, select }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -getTenantActivityLogsWithFilterAndSelect().catch(console.error); - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsSelected.json - */ -async function getTenantActivityLogsWithSelect() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const select = - "eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level"; - const options: TenantActivityLogsListOptionalParams = { select }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -getTenantActivityLogsWithSelect().catch(console.error); - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsNoParams.json - */ -async function getTenantActivityLogsWithoutFilterOrSelect() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list()) { - resArray.push(item); - } - console.log(resArray); -} - -getTenantActivityLogsWithoutFilterOrSelect().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 726927302f4f..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/vmInsightsGetOnboardingStatusSample.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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusVMScaleSet.json - */ -async function getStatusForAVMScaleSetThatIsActivelyReportingData() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/my-service-cluster/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-01"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -getStatusForAVMScaleSetThatIsActivelyReportingData().catch(console.error); - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSingleVMUnknown.json - */ -async function getStatusForAVMThatHasNotYetReportedData() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -getStatusForAVMThatHasNotYetReportedData().catch(console.error); - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSingleVM.json - */ -async function getStatusForAVMThatIsActivelyReportingData() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -getStatusForAVMThatIsActivelyReportingData().catch(console.error); - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusResourceGroup.json - */ -async function getStatusForAResourceGroupThatHasAtLeastOneVMThatIsActivelyReportingData() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/resource-group-with-vms"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -getStatusForAResourceGroupThatHasAtLeastOneVMThatIsActivelyReportingData().catch( - console.error -); - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSubscription.json - */ -async function getStatusForASubscriptionThatHasAtLeastOneVMThatIsActivelyReportingData() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -getStatusForASubscriptionThatHasAtLeastOneVMThatIsActivelyReportingData().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 492aac54f9c3..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/README.md +++ /dev/null @@ -1,254 +0,0 @@ -# client library samples for JavaScript (Beta) - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| --------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.js][actiongroupscreatenotificationsatactiongroupresourcelevelsample] | Send test notifications to a set of provided receivers x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtActionGroupResourceLevel.json | -| [actionGroupsCreateNotificationsAtResourceGroupLevelSample.js][actiongroupscreatenotificationsatresourcegrouplevelsample] | Send test notifications to a set of provided receivers x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtResourceGroupLevel.json | -| [actionGroupsCreateOrUpdateSample.js][actiongroupscreateorupdatesample] | Create a new action group or update an existing one. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/createOrUpdateActionGroup.json | -| [actionGroupsDeleteSample.js][actiongroupsdeletesample] | Delete an action group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/deleteActionGroup.json | -| [actionGroupsEnableReceiverSample.js][actiongroupsenablereceiversample] | Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation is only supported for Email or SMS receivers. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/enableReceiver.json | -| [actionGroupsGetSample.js][actiongroupsgetsample] | Get an action group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getActionGroup.json | -| [actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.js][actiongroupsgettestnotificationsatactiongroupresourcelevelsample] | Get the test notifications by the notification id x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtActionGroupResourceLevel.json | -| [actionGroupsGetTestNotificationsAtResourceGroupLevelSample.js][actiongroupsgettestnotificationsatresourcegrouplevelsample] | Get the test notifications by the notification id x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtResourceGroupLevel.json | -| [actionGroupsGetTestNotificationsSample.js][actiongroupsgettestnotificationssample] | Get the test notifications by the notification id x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotifications.json | -| [actionGroupsListByResourceGroupSample.js][actiongroupslistbyresourcegroupsample] | Get a list of all action groups in a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json | -| [actionGroupsListBySubscriptionIdSample.js][actiongroupslistbysubscriptionidsample] | Get a list of all action groups in a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json | -| [actionGroupsPostTestNotificationsSample.js][actiongroupsposttestnotificationssample] | Send test notifications to a set of provided receivers x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotifications.json | -| [actionGroupsUpdateSample.js][actiongroupsupdatesample] | Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/patchActionGroup.json | -| [activityLogAlertsCreateOrUpdateSample.js][activitylogalertscreateorupdatesample] | Create a new Activity Log Alert rule or update an existing one. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_CreateOrUpdate.json | -| [activityLogAlertsDeleteSample.js][activitylogalertsdeletesample] | Delete an Activity Log Alert rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Delete.json | -| [activityLogAlertsGetSample.js][activitylogalertsgetsample] | Get an Activity Log Alert rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Get.json | -| [activityLogAlertsListByResourceGroupSample.js][activitylogalertslistbyresourcegroupsample] | Get a list of all Activity Log Alert rules in a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_ListByResourceGroupName.json | -| [activityLogAlertsListBySubscriptionIdSample.js][activitylogalertslistbysubscriptionidsample] | Get a list of all Activity Log Alert rules in a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_ListBySubscriptionId.json | -| [activityLogAlertsUpdateSample.js][activitylogalertsupdatesample] | Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Update.json | -| [activityLogsListSample.js][activitylogslistsample] | Provides the list of records from the activity logs. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetActivityLogsFiltered.json | -| [alertRuleIncidentsGetSample.js][alertruleincidentsgetsample] | Gets an incident associated to an alert rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getAlertRuleIncident.json | -| [alertRuleIncidentsListByAlertRuleSample.js][alertruleincidentslistbyalertrulesample] | Gets a list of incidents associated to an alert rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRuleIncidents.json | -| [alertRulesCreateOrUpdateSample.js][alertrulescreateorupdatesample] | Creates or updates a classic metric alert rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/createOrUpdateAlertRule.json | -| [alertRulesDeleteSample.js][alertrulesdeletesample] | Deletes a classic metric alert rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteAlertRule.json | -| [alertRulesGetSample.js][alertrulesgetsample] | Gets a classic metric alert rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getAlertRule.json | -| [alertRulesListByResourceGroupSample.js][alertruleslistbyresourcegroupsample] | List the classic metric alert rules within a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRule.json | -| [alertRulesListBySubscriptionSample.js][alertruleslistbysubscriptionsample] | List the classic metric alert rules within a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRuleBySubscription.json | -| [alertRulesUpdateSample.js][alertrulesupdatesample] | Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/patchAlertRule.json | -| [autoscaleSettingsCreateOrUpdateSample.js][autoscalesettingscreateorupdatesample] | Creates or updates an autoscale setting. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/createOrUpdateAutoscaleSetting.json | -| [autoscaleSettingsDeleteSample.js][autoscalesettingsdeletesample] | Deletes and autoscale setting x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/deleteAutoscaleSetting.json | -| [autoscaleSettingsGetSample.js][autoscalesettingsgetsample] | Gets an autoscale setting x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/getAutoscaleSetting.json | -| [autoscaleSettingsListByResourceGroupSample.js][autoscalesettingslistbyresourcegroupsample] | Lists the autoscale settings for a resource group x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/listAutoscaleSetting.json | -| [autoscaleSettingsListBySubscriptionSample.js][autoscalesettingslistbysubscriptionsample] | Lists the autoscale settings for a subscription x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/listAutoscaleSettingBySubscription.json | -| [autoscaleSettingsUpdateSample.js][autoscalesettingsupdatesample] | Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/patchAutoscaleSetting.json | -| [baselinesListSample.js][baselineslistsample] | **Lists the metric baseline values for a resource**. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2019-03-01/examples/metricBaselines.json | -| [dataCollectionEndpointsCreateSample.js][datacollectionendpointscreatesample] | Creates or updates a data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsCreate.json | -| [dataCollectionEndpointsDeleteSample.js][datacollectionendpointsdeletesample] | Deletes a data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsDelete.json | -| [dataCollectionEndpointsGetSample.js][datacollectionendpointsgetsample] | Returns the specified data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsGet.json | -| [dataCollectionEndpointsListByResourceGroupSample.js][datacollectionendpointslistbyresourcegroupsample] | Lists all data collection endpoints in the specified resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListByResourceGroup.json | -| [dataCollectionEndpointsListBySubscriptionSample.js][datacollectionendpointslistbysubscriptionsample] | Lists all data collection endpoints in the specified subscription x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListBySubscription.json | -| [dataCollectionEndpointsUpdateSample.js][datacollectionendpointsupdatesample] | Updates part of a data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsUpdate.json | -| [dataCollectionRuleAssociationsCreateSample.js][datacollectionruleassociationscreatesample] | Creates or updates an association. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsCreate.json | -| [dataCollectionRuleAssociationsDeleteSample.js][datacollectionruleassociationsdeletesample] | Deletes an association. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsDelete.json | -| [dataCollectionRuleAssociationsGetSample.js][datacollectionruleassociationsgetsample] | Returns the specified association. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsGet.json | -| [dataCollectionRuleAssociationsListByDataCollectionEndpointSample.js][datacollectionruleassociationslistbydatacollectionendpointsample] | Lists associations for the specified data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByDataCollectionEndpoint.json | -| [dataCollectionRuleAssociationsListByResourceSample.js][datacollectionruleassociationslistbyresourcesample] | Lists associations for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByResource.json | -| [dataCollectionRuleAssociationsListByRuleSample.js][datacollectionruleassociationslistbyrulesample] | Lists associations for the specified data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByRule.json | -| [dataCollectionRulesCreateSample.js][datacollectionrulescreatesample] | Creates or updates a data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesCreate.json | -| [dataCollectionRulesDeleteSample.js][datacollectionrulesdeletesample] | Deletes a data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesDelete.json | -| [dataCollectionRulesGetSample.js][datacollectionrulesgetsample] | Returns the specified data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesGet.json | -| [dataCollectionRulesListByResourceGroupSample.js][datacollectionruleslistbyresourcegroupsample] | Lists all data collection rules in the specified resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListByResourceGroup.json | -| [dataCollectionRulesListBySubscriptionSample.js][datacollectionruleslistbysubscriptionsample] | Lists all data collection rules in the specified subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListBySubscription.json | -| [dataCollectionRulesUpdateSample.js][datacollectionrulesupdatesample] | Updates part of a data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesUpdate.json | -| [diagnosticSettingsCategoryGetSample.js][diagnosticsettingscategorygetsample] | Gets the diagnostic settings category for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingsCategory.json | -| [diagnosticSettingsCategoryListSample.js][diagnosticsettingscategorylistsample] | Lists the diagnostic settings categories for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettingsCategories.json | -| [diagnosticSettingsCreateOrUpdateSample.js][diagnosticsettingscreateorupdatesample] | Creates or updates diagnostic settings for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateDiagnosticSetting.json | -| [diagnosticSettingsDeleteSample.js][diagnosticsettingsdeletesample] | Deletes existing diagnostic settings for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/deleteDiagnosticSetting.json | -| [diagnosticSettingsGetSample.js][diagnosticsettingsgetsample] | Gets the active diagnostic settings for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSetting.json | -| [diagnosticSettingsListSample.js][diagnosticsettingslistsample] | Gets the active diagnostic settings list for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettings.json | -| [eventCategoriesListSample.js][eventcategorieslistsample] | Get the list of available event categories supported in the Activity Logs Service.
The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetEventCategories.json | -| [logProfilesCreateOrUpdateSample.js][logprofilescreateorupdatesample] | Create or update a log profile in Azure Monitoring REST API. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/createOrUpdateLogProfile.json | -| [logProfilesDeleteSample.js][logprofilesdeletesample] | Deletes the log profile. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteLogProfile.json | -| [logProfilesGetSample.js][logprofilesgetsample] | Gets the log profile. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getLogProfile.json | -| [logProfilesListSample.js][logprofileslistsample] | List the log profiles. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listLogProfile.json | -| [logProfilesUpdateSample.js][logprofilesupdatesample] | Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/patchLogProfile.json | -| [metricAlertsCreateOrUpdateSample.js][metricalertscreateorupdatesample] | Create or update an metric alert definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateDynamicMetricAlertMultipleResource.json | -| [metricAlertsDeleteSample.js][metricalertsdeletesample] | Delete an alert rule definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/deleteMetricAlert.json | -| [metricAlertsGetSample.js][metricalertsgetsample] | Retrieve an alert rule definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getDynamicMetricAlertMultipleResource.json | -| [metricAlertsListByResourceGroupSample.js][metricalertslistbyresourcegroupsample] | Retrieve alert rule definitions in a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/listMetricAlert.json | -| [metricAlertsListBySubscriptionSample.js][metricalertslistbysubscriptionsample] | Retrieve alert rule definitions in a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/listMetricAlert.json | -| [metricAlertsStatusListByNameSample.js][metricalertsstatuslistbynamesample] | Retrieve an alert rule status. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertStatusByName.json | -| [metricAlertsStatusListSample.js][metricalertsstatuslistsample] | Retrieve an alert rule status. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertStatus.json | -| [metricAlertsUpdateSample.js][metricalertsupdatesample] | Update an metric alert definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/UpdateMetricAlert.json | -| [metricDefinitionsListSample.js][metricdefinitionslistsample] | Lists the metric definitions for the resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitionsApplicationInsights.json | -| [metricNamespacesListSample.js][metricnamespaceslistsample] | Lists the metric namespaces for the resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/examples/GetMetricNamespaces.json | -| [metricsListSample.js][metricslistsample] | **Lists the metric values for a resource**. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetric.json | -| [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 an log search rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRules.json | -| [scheduledQueryRulesDeleteSample.js][scheduledqueryrulesdeletesample] | Deletes a Log Search rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/deleteScheduledQueryRules.json | -| [scheduledQueryRulesGetSample.js][scheduledqueryrulesgetsample] | Gets an Log Search rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/getScheduledQueryRules.json | -| [scheduledQueryRulesListByResourceGroupSample.js][scheduledqueryruleslistbyresourcegroupsample] | List the Log Search rules within a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/listScheduledQueryRules.json | -| [scheduledQueryRulesListBySubscriptionSample.js][scheduledqueryruleslistbysubscriptionsample] | List the Log Search rules within a subscription group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/listScheduledQueryRules.json | -| [scheduledQueryRulesUpdateSample.js][scheduledqueryrulesupdatesample] | Update log search Rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/patchScheduledQueryRules.json | -| [tenantActivityLogsListSample.js][tenantactivitylogslistsample] | Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does _not_ retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsFiltered.json | -| [vmInsightsGetOnboardingStatusSample.js][vminsightsgetonboardingstatussample] | Retrieves the VM Insights onboarding status for the specified resource or resource scope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusVMScaleSet.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env node actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[actiongroupscreatenotificationsatactiongroupresourcelevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.js -[actiongroupscreatenotificationsatresourcegrouplevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateNotificationsAtResourceGroupLevelSample.js -[actiongroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateOrUpdateSample.js -[actiongroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsDeleteSample.js -[actiongroupsenablereceiversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsEnableReceiverSample.js -[actiongroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetSample.js -[actiongroupsgettestnotificationsatactiongroupresourcelevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.js -[actiongroupsgettestnotificationsatresourcegrouplevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.js -[actiongroupsgettestnotificationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsSample.js -[actiongroupslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsListByResourceGroupSample.js -[actiongroupslistbysubscriptionidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsListBySubscriptionIdSample.js -[actiongroupsposttestnotificationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsPostTestNotificationsSample.js -[actiongroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsUpdateSample.js -[activitylogalertscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsCreateOrUpdateSample.js -[activitylogalertsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsDeleteSample.js -[activitylogalertsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsGetSample.js -[activitylogalertslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsListByResourceGroupSample.js -[activitylogalertslistbysubscriptionidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsListBySubscriptionIdSample.js -[activitylogalertsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsUpdateSample.js -[activitylogslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogsListSample.js -[alertruleincidentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRuleIncidentsGetSample.js -[alertruleincidentslistbyalertrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRuleIncidentsListByAlertRuleSample.js -[alertrulescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesCreateOrUpdateSample.js -[alertrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesDeleteSample.js -[alertrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesGetSample.js -[alertruleslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesListByResourceGroupSample.js -[alertruleslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesListBySubscriptionSample.js -[alertrulesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesUpdateSample.js -[autoscalesettingscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsCreateOrUpdateSample.js -[autoscalesettingsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsDeleteSample.js -[autoscalesettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsGetSample.js -[autoscalesettingslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsListByResourceGroupSample.js -[autoscalesettingslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsListBySubscriptionSample.js -[autoscalesettingsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsUpdateSample.js -[baselineslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/baselinesListSample.js -[datacollectionendpointscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsCreateSample.js -[datacollectionendpointsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsDeleteSample.js -[datacollectionendpointsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsGetSample.js -[datacollectionendpointslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsListByResourceGroupSample.js -[datacollectionendpointslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsListBySubscriptionSample.js -[datacollectionendpointsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsUpdateSample.js -[datacollectionruleassociationscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsCreateSample.js -[datacollectionruleassociationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsDeleteSample.js -[datacollectionruleassociationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsGetSample.js -[datacollectionruleassociationslistbydatacollectionendpointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.js -[datacollectionruleassociationslistbyresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByResourceSample.js -[datacollectionruleassociationslistbyrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByRuleSample.js -[datacollectionrulescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesCreateSample.js -[datacollectionrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesDeleteSample.js -[datacollectionrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesGetSample.js -[datacollectionruleslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesListByResourceGroupSample.js -[datacollectionruleslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesListBySubscriptionSample.js -[datacollectionrulesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesUpdateSample.js -[diagnosticsettingscategorygetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCategoryGetSample.js -[diagnosticsettingscategorylistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCategoryListSample.js -[diagnosticsettingscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCreateOrUpdateSample.js -[diagnosticsettingsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsDeleteSample.js -[diagnosticsettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsGetSample.js -[diagnosticsettingslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsListSample.js -[eventcategorieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/eventCategoriesListSample.js -[logprofilescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesCreateOrUpdateSample.js -[logprofilesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesDeleteSample.js -[logprofilesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesGetSample.js -[logprofileslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesListSample.js -[logprofilesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesUpdateSample.js -[metricalertscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsCreateOrUpdateSample.js -[metricalertsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsDeleteSample.js -[metricalertsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsGetSample.js -[metricalertslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsListByResourceGroupSample.js -[metricalertslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsListBySubscriptionSample.js -[metricalertsstatuslistbynamesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsStatusListByNameSample.js -[metricalertsstatuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsStatusListSample.js -[metricalertsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsUpdateSample.js -[metricdefinitionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricDefinitionsListSample.js -[metricnamespaceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricNamespacesListSample.js -[metricslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricsListSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/operationsListSample.js -[predictivemetricgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/predictiveMetricGetSample.js -[privateendpointconnectionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsCreateOrUpdateSample.js -[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsDeleteSample.js -[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsGetSample.js -[privateendpointconnectionslistbyprivatelinkscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsListByPrivateLinkScopeSample.js -[privatelinkresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkResourcesGetSample.js -[privatelinkresourceslistbyprivatelinkscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkResourcesListByPrivateLinkScopeSample.js -[privatelinkscopeoperationstatusgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopeOperationStatusGetSample.js -[privatelinkscopedresourcescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesCreateOrUpdateSample.js -[privatelinkscopedresourcesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesDeleteSample.js -[privatelinkscopedresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesGetSample.js -[privatelinkscopedresourceslistbyprivatelinkscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesListByPrivateLinkScopeSample.js -[privatelinkscopescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesCreateOrUpdateSample.js -[privatelinkscopesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesDeleteSample.js -[privatelinkscopesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesGetSample.js -[privatelinkscopeslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesListByResourceGroupSample.js -[privatelinkscopeslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesListSample.js -[privatelinkscopesupdatetagssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesUpdateTagsSample.js -[scheduledqueryrulescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesCreateOrUpdateSample.js -[scheduledqueryrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesDeleteSample.js -[scheduledqueryrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesGetSample.js -[scheduledqueryruleslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesListByResourceGroupSample.js -[scheduledqueryruleslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesListBySubscriptionSample.js -[scheduledqueryrulesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesUpdateSample.js -[tenantactivitylogslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActivityLogsListSample.js -[vminsightsgetonboardingstatussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/vmInsightsGetOnboardingStatusSample.js -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-monitor?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/monitor/arm-monitor/README.md diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.js deleted file mode 100644 index 6c587e609dfd..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.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"); - -/** - * This sample demonstrates how to Send test notifications to a set of provided receivers - * - * @summary Send test notifications to a set of provided receivers - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtActionGroupResourceLevel.json - */ -async function createNotificationsAtResourceGroupLevel() { - const subscriptionId = "11111111-1111-1111-1111-111111111111"; - const resourceGroupName = "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); -} - -createNotificationsAtResourceGroupLevel().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateNotificationsAtResourceGroupLevelSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateNotificationsAtResourceGroupLevelSample.js deleted file mode 100644 index 04d1c425a620..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateNotificationsAtResourceGroupLevelSample.js +++ /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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Send test notifications to a set of provided receivers - * - * @summary Send test notifications to a set of provided receivers - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtResourceGroupLevel.json - */ -async function createNotificationsAtResourceGroupLevel() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "Default-TestNotifications"; - const notificationRequest = { - alertType: "budget", - armRoleReceivers: [ - { - name: "ArmRole-Common", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: true, - }, - { - name: "ArmRole-nonCommon", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: false, - }, - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "http://test.me", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084", - }, - ], - azureAppPushReceivers: [{ name: "Sample azureAppPush", emailAddress: "johndoe@email.com" }], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true, - }, - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false, - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true, - }, - ], - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - }, - ], - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c", - }, - ], - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false, - }, - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890", - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321", - }, - ], - voiceReceivers: [{ name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" }], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true, - }, - { - name: "Sample webhook 2", - identifierUri: "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true, - }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.beginCreateNotificationsAtResourceGroupLevelAndWait( - resourceGroupName, - notificationRequest - ); - console.log(result); -} - -createNotificationsAtResourceGroupLevel().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 5fa8398cd7a7..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateOrUpdateSample.js +++ /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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Create a new action group or update an existing one. - * - * @summary Create a new action group or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/createOrUpdateActionGroup.json - */ -async function createOrUpdateAnActionGroup() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -createOrUpdateAnActionGroup().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 99965eebae0e..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsDeleteSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Delete an action group. - * - * @summary Delete an action group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/deleteActionGroup.json - */ -async function deleteAnActionGroup() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -deleteAnActionGroup().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 e48465616b94..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsEnableReceiverSample.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"); - -/** - * This sample demonstrates how to Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation is only supported for Email or SMS receivers. - * - * @summary Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation is only supported for Email or SMS receivers. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/enableReceiver.json - */ -async function enableTheReceiver() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -enableTheReceiver().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 c9210626500c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get an action group. - * - * @summary Get an action group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getActionGroup.json - */ -async function getAnActionGroup() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -getAnActionGroup().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 bd684939e442..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.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"); - -/** - * This sample demonstrates how to Get the test notifications by the notification id - * - * @summary Get the test notifications by the notification id - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtActionGroupResourceLevel.json - */ -async function getNotificationDetailsAtResourceGroupLevel() { - const subscriptionId = "11111111-1111-1111-1111-111111111111"; - const resourceGroupName = "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); -} - -getNotificationDetailsAtResourceGroupLevel().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.js deleted file mode 100644 index 3dd7287c1194..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get the test notifications by the notification id - * - * @summary Get the test notifications by the notification id - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtResourceGroupLevel.json - */ -async function getNotificationDetailsAtResourceGroupLevel() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "Default-TestNotifications"; - const notificationId = "11000222191287"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.getTestNotificationsAtResourceGroupLevel( - resourceGroupName, - notificationId - ); - console.log(result); -} - -getNotificationDetailsAtResourceGroupLevel().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsSample.js deleted file mode 100644 index aafbfa10a911..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsSample.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get the test notifications by the notification id - * - * @summary Get the test notifications by the notification id - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotifications.json - */ -async function getNotificationDetailsAtSubscriptionLevel() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const notificationId = "11000222191287"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.getTestNotifications(notificationId); - console.log(result); -} - -getNotificationDetailsAtSubscriptionLevel().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 e8fb7c82d277..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsListByResourceGroupSample.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get a list of all action groups in a resource group. - * - * @summary Get a list of all action groups in a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json - */ -async function listActionGroupsAtResourceGroupLevel() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -listActionGroupsAtResourceGroupLevel().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 6d4e03b51d53..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsListBySubscriptionIdSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get a list of all action groups in a subscription. - * - * @summary Get a list of all action groups in a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json - */ -async function listActionGroupsAtSubscriptionLevel() { - const subscriptionId = "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); -} - -listActionGroupsAtSubscriptionLevel().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsPostTestNotificationsSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsPostTestNotificationsSample.js deleted file mode 100644 index 0805c3168b35..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsPostTestNotificationsSample.js +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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"); - -/** - * This sample demonstrates how to Send test notifications to a set of provided receivers - * - * @summary Send test notifications to a set of provided receivers - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotifications.json - */ -async function createNotificationsAtSubscriptionLevel() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const notificationRequest = { - alertType: "budget", - armRoleReceivers: [ - { - name: "ArmRole-Common", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: true, - }, - { - name: "ArmRole-nonCommon", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: false, - }, - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "http://test.me", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084", - }, - ], - azureAppPushReceivers: [{ name: "Sample azureAppPush", emailAddress: "johndoe@email.com" }], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true, - }, - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false, - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true, - }, - ], - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - }, - ], - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c", - }, - ], - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false, - }, - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890", - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321", - }, - ], - voiceReceivers: [{ name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" }], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true, - }, - { - name: "Sample webhook 2", - identifierUri: "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true, - }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.beginPostTestNotificationsAndWait(notificationRequest); - console.log(result); -} - -createNotificationsAtSubscriptionLevel().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 c4d3970e1aad..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsUpdateSample.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"); - -/** - * This sample demonstrates how to Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/patchActionGroup.json - */ -async function patchAnActionGroup() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -patchAnActionGroup().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 7b384a0e95d1..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsCreateOrUpdateSample.js +++ /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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -createOrUpdateAnActivityLogAlertRule().catch(console.error); - -/** - * 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 = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -createOrUpdateAnActivityLogAlertRuleWithAnyOfCondition().catch(console.error); - -/** - * 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 = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -createOrUpdateAnActivityLogAlertRuleWithContainsAny().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 a697455a2822..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsDeleteSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -deleteAnActivityLogAlertRule().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 3b5642f7e6da..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsGetSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -getAnActivityLogAlertRule().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 6d892b6987e2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsListByResourceGroupSample.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -listActivityLogAlerts().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 0ad911dbb711..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsListBySubscriptionIdSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "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); -} - -getListOfAllActivityLogAlertRulesUnderASubscription().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 8b458f8fcf61..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsUpdateSample.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"); - -/** - * 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 = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -patchAnActivityLogAlertRule().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 127162efc33a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogsListSample.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"); - -/** - * 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 = "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); -} - -getActivityLogsWithFilter().catch(console.error); - -/** - * 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 = "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); -} - -getActivityLogsWithFilterAndSelect().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 67e897d7fa46..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRuleIncidentsGetSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -getASingleAlertRuleIncident().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 f32a4149b83a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRuleIncidentsListByAlertRuleSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -listAlertRuleIncidents().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 a0c9999ebf3a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesCreateOrUpdateSample.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -createOrUpdateAnAlertRule().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 b3fcf2ca22cd..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesDeleteSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -deleteAnAlertRule().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 54dad275fcd2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesGetSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -getAnAlertRule().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 6ca0168a3ede..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesListByResourceGroupSample.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -listAlertRules().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 3ca6000ec440..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesListBySubscriptionSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "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); -} - -listAlertRules().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 3cd617bb5dad..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesUpdateSample.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"); - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -patchAnAlertRule().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 2ac647f54ddc..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsCreateOrUpdateSample.js +++ /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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -createOrUpdateAnAutoscaleSetting().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 1b0c3898797a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsDeleteSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -deleteAnAutoscaleSetting().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 11c3e489e48d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsGetSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -getAnAutoscaleSetting().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 23b518e2670b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsListByResourceGroupSample.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -listAutoscaleSettings().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 b45c7e88a77f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsListBySubscriptionSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "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); -} - -listAutoscaleSettingsBySubs().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 46fe23d466be..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsUpdateSample.js +++ /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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -patchAnAutoscaleSetting().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 52c4e23b39c9..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/baselinesListSample.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"); - -/** - * This sample demonstrates how to **Lists the metric baseline values for a resource**. - * - * @summary **Lists the metric baseline values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2019-03-01/examples/metricBaselines.json - */ -async function getMetricBaselines() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1"; - const timespan = "2019-03-12T11:00:00.000Z/2019-03-12T12:00:00.000Z"; - const interval = "PT1H"; - const aggregation = "average"; - const sensitivities = "Low,Medium"; - const options = { - timespan, - interval, - aggregation, - sensitivities, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.baselines.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -getMetricBaselines().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 2be63fdf83a3..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsCreateSample.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"); - -/** - * This sample demonstrates how to Creates or updates a data collection endpoint. - * - * @summary Creates or updates a data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsCreate.json - */ -async function createOrUpdateDataCollectionEndpoint() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -createOrUpdateDataCollectionEndpoint().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 4f99f2c0974c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsDeleteSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Deletes a data collection endpoint. - * - * @summary Deletes a data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsDelete.json - */ -async function deleteDataCollectionEndpoint() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -deleteDataCollectionEndpoint().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 264530b00650..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsGetSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Returns the specified data collection endpoint. - * - * @summary Returns the specified data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsGet.json - */ -async function getDataCollectionEndpoint() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -getDataCollectionEndpoint().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 f26c73edd550..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsListByResourceGroupSample.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Lists all data collection endpoints in the specified resource group. - * - * @summary Lists all data collection endpoints in the specified resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListByResourceGroup.json - */ -async function listDataCollectionEndpointsByResourceGroup() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -listDataCollectionEndpointsByResourceGroup().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 1f18edb63a49..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsListBySubscriptionSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Lists all data collection endpoints in the specified subscription - * - * @summary Lists all data collection endpoints in the specified subscription - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListBySubscription.json - */ -async function listDataCollectionEndpointsBySubscription() { - const subscriptionId = "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); -} - -listDataCollectionEndpointsBySubscription().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 2648e1f268d9..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsUpdateSample.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"); - -/** - * This sample demonstrates how to Updates part of a data collection endpoint. - * - * @summary Updates part of a data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsUpdate.json - */ -async function updateDataCollectionEndpoint() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -updateDataCollectionEndpoint().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 7fc3d8b6ebba..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsCreateSample.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"); - -/** - * This sample demonstrates how to Creates or updates an association. - * - * @summary Creates or updates an association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsCreate.json - */ -async function createOrUpdateAssociation() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const associationName = "myAssociation"; - const body = { - dataCollectionRuleId: - "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule", - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRuleAssociations.create( - resourceUri, - associationName, - options - ); - console.log(result); -} - -createOrUpdateAssociation().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 7e4b41c5ac8c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsDeleteSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Deletes an association. - * - * @summary Deletes an association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsDelete.json - */ -async function deleteAssociation() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const associationName = "myAssociation"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRuleAssociations.delete(resourceUri, associationName); - console.log(result); -} - -deleteAssociation().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 1f1c00424db6..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsGetSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Returns the specified association. - * - * @summary Returns the specified association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsGet.json - */ -async function getAssociation() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const associationName = "myAssociation"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRuleAssociations.get(resourceUri, associationName); - console.log(result); -} - -getAssociation().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 0f4a5cbafb8c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.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"); - -/** - * This sample demonstrates how to Lists associations for the specified data collection endpoint. - * - * @summary Lists associations for the specified data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByDataCollectionEndpoint.json - */ -async function listAssociationsForSpecifiedDataCollectionEndpoint() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -listAssociationsForSpecifiedDataCollectionEndpoint().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 b0fd050c26c1..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByResourceSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Lists associations for the specified resource. - * - * @summary Lists associations for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByResource.json - */ -async function listAssociationsForSpecifiedResource() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRuleAssociations.listByResource(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -listAssociationsForSpecifiedResource().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 e9560ce4547f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByRuleSample.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"); - -/** - * This sample demonstrates how to Lists associations for the specified data collection rule. - * - * @summary Lists associations for the specified data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByRule.json - */ -async function listAssociationsForSpecifiedDataCollectionRule() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -listAssociationsForSpecifiedDataCollectionRule().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 39f16990be63..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesCreateSample.js +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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"); - -/** - * This sample demonstrates how to Creates or updates a data collection rule. - * - * @summary Creates or updates a data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesCreate.json - */ -async function createOrUpdateDataCollectionRule() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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", - "MemoryCommitted 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); -} - -createOrUpdateDataCollectionRule().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 1725d3ba613e..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesDeleteSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Deletes a data collection rule. - * - * @summary Deletes a data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesDelete.json - */ -async function deleteDataCollectionRule() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -deleteDataCollectionRule().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 37e7cd6c4c1c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesGetSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Returns the specified data collection rule. - * - * @summary Returns the specified data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesGet.json - */ -async function getDataCollectionRule() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -getDataCollectionRule().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 d30bb5b936c7..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesListByResourceGroupSample.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Lists all data collection rules in the specified resource group. - * - * @summary Lists all data collection rules in the specified resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListByResourceGroup.json - */ -async function listDataCollectionRulesByResourceGroup() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -listDataCollectionRulesByResourceGroup().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 a08db15e83cd..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesListBySubscriptionSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Lists all data collection rules in the specified subscription. - * - * @summary Lists all data collection rules in the specified subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListBySubscription.json - */ -async function listDataCollectionRulesBySubscription() { - const subscriptionId = "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); -} - -listDataCollectionRulesBySubscription().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 aeca169437df..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesUpdateSample.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"); - -/** - * This sample demonstrates how to Updates part of a data collection rule. - * - * @summary Updates part of a data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesUpdate.json - */ -async function updateDataCollectionRule() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -updateDataCollectionRule().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 32f135dabcf3..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCategoryGetSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Gets the diagnostic settings category for the specified resource. - * - * @summary Gets the diagnostic settings category for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingsCategory.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "WorkflowRuntime"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettingsCategory.get(resourceUri, name); - console.log(result); -} - -getsTheDiagnosticSetting().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 021932e4f03e..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCategoryListSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Lists the diagnostic settings categories for the specified resource. - * - * @summary Lists the diagnostic settings categories for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettingsCategories.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.diagnosticSettingsCategory.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -getsTheDiagnosticSetting().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 bb84fa0d1346..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCreateOrUpdateSample.js +++ /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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Creates or updates diagnostic settings for the specified resource. - * - * @summary Creates or updates diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateDiagnosticSetting.json - */ -async function createsOrUpdatesTheDiagnosticSetting() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const parameters = { - eventHubAuthorizationRuleId: - "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule", - eventHubName: "myeventhub", - logAnalyticsDestinationType: "Dedicated", - logs: [ - { - categoryGroup: "allLogs", - enabled: true, - retentionPolicy: { days: 0, enabled: false }, - }, - ], - marketplacePartnerId: - "/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1", - metrics: [ - { - category: "WorkflowMetrics", - enabled: true, - retentionPolicy: { days: 0, enabled: false }, - }, - ], - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1", - workspaceId: "", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.createOrUpdate(resourceUri, name, parameters); - console.log(result); -} - -createsOrUpdatesTheDiagnosticSetting().catch(console.error); - -/** - * This sample demonstrates how to Creates or updates diagnostic settings for the specified resource. - * - * @summary Creates or updates diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateDiagnosticSettingCategory.json - */ -async function createsOrUpdatesTheDiagnosticSettingForCategory() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const parameters = { - eventHubAuthorizationRuleId: - "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule", - eventHubName: "myeventhub", - logAnalyticsDestinationType: "Dedicated", - logs: [ - { - category: "WorkflowRuntime", - enabled: true, - retentionPolicy: { days: 0, enabled: false }, - }, - ], - marketplacePartnerId: - "/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1", - metrics: [ - { - category: "WorkflowMetrics", - enabled: true, - retentionPolicy: { days: 0, enabled: false }, - }, - ], - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1", - workspaceId: "", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.createOrUpdate(resourceUri, name, parameters); - console.log(result); -} - -createsOrUpdatesTheDiagnosticSettingForCategory().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 2beeb80a7cf1..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsDeleteSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Deletes existing diagnostic settings for the specified resource. - * - * @summary Deletes existing diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/deleteDiagnosticSetting.json - */ -async function deletesTheDiagnosticSetting() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.delete(resourceUri, name); - console.log(result); -} - -deletesTheDiagnosticSetting().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 712b5fb940d2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsGetSample.js +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Gets the active diagnostic settings for the specified resource. - * - * @summary Gets the active diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSetting.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.get(resourceUri, name); - console.log(result); -} - -getsTheDiagnosticSetting().catch(console.error); - -/** - * This sample demonstrates how to Gets the active diagnostic settings for the specified resource. - * - * @summary Gets the active diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingCategory.json - */ -async function getsTheDiagnosticSettingForCategory() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.get(resourceUri, name); - console.log(result); -} - -getsTheDiagnosticSettingForCategory().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 73d6c49eded8..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsListSample.js +++ /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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Gets the active diagnostic settings list for the specified resource. - * - * @summary Gets the active diagnostic settings list for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettings.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.diagnosticSettings.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -getsTheDiagnosticSetting().catch(console.error); - -/** - * This sample demonstrates how to Gets the active diagnostic settings list for the specified resource. - * - * @summary Gets the active diagnostic settings list for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettingsCategory.json - */ -async function getsTheDiagnosticSettingForCategory() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.diagnosticSettings.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -getsTheDiagnosticSettingForCategory().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 c7f6223e7ac7..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/eventCategoriesListSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get the list of available event categories supported in the Activity Logs Service.
The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. - * - * @summary Get the list of available event categories supported in the Activity Logs Service.
The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetEventCategories.json - */ -async function getEventCategories() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.eventCategories.list()) { - resArray.push(item); - } - console.log(resArray); -} - -getEventCategories().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 ce11137f5a09..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesCreateOrUpdateSample.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"); - -/** - * 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 = "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); -} - -createOrUpdateALogProfile().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 67ba8630414b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesDeleteSample.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "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); -} - -deleteLogProfile().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 c3e36f5d9f05..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesGetSample.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "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); -} - -getLogProfile().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 649cae0472f1..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesListSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "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); -} - -listLogProfiles().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 c131a1df249b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesUpdateSample.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"); - -/** - * 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 = "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); -} - -patchALogProfile().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 85736ba0c29e..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsCreateOrUpdateSample.js +++ /dev/null @@ -1,448 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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"); - -/** - * 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 = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "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); -} - -createOrUpdateADynamicAlertRuleForMultipleResources().catch(console.error); - -/** - * 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 = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "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); -} - -createOrUpdateADynamicAlertRuleForSingleResource().catch(console.error); - -/** - * 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 = "12345678-1234-1234-1234-123456789101"; - const resourceGroupName = "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); -} - -createOrUpdateAWebTestAlertRule().catch(console.error); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -createOrUpdateAnAlertRuleForMultipleResource().catch(console.error); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -createOrUpdateAnAlertRuleForSingleResource().catch(console.error); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -createOrUpdateAnAlertRuleOnResourceGroupS().catch(console.error); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -createOrUpdateAnAlertRuleOnSubscription().catch(console.error); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -createOrUpdateAnAlertRulesWithDimensions().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 2a9c6b511817..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsDeleteSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -deleteAnAlertRule().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 0552478f358d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsGetSample.js +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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"); - -/** - * 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 = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "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); -} - -getADynamicAlertRuleForMultipleResources().catch(console.error); - -/** - * 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 = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "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); -} - -getADynamicAlertRuleForSingleResource().catch(console.error); - -/** - * 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 = "12345678-1234-1234-1234-123456789101"; - const resourceGroupName = "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); -} - -getAWebTestAlertRule().catch(console.error); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -getAnAlertRuleForMultipleResources().catch(console.error); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -getAnAlertRuleForSingleResource().catch(console.error); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -getAnAlertRuleOnResourceGroupS().catch(console.error); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -getAnAlertRuleOnSubscription().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 385a6fcd0d1f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsListByResourceGroupSample.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -listMetricAlertRules().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 44328bf82505..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsListBySubscriptionSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "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); -} - -listMetricAlertRules().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 22af932492a6..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsStatusListByNameSample.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"); - -/** - * 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 = "009f6022-67ec-423e-9aa7-691182870588"; - const resourceGroupName = "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); -} - -getAnAlertRuleStatus().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 de114912aa63..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsStatusListSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -getAnAlertRuleStatus().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 dfc64d63d0f0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsUpdateSample.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"); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -createOrUpdateAnAlertRule().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 b3c7a49c9666..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"); - -/** - * This sample demonstrates how to Lists the metric definitions for the resource. - * - * @summary Lists the metric definitions for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitionsApplicationInsights.json - */ -async function getApplicationInsightsMetricDefinitionsWithoutFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions"; - const metricnamespace = "microsoft.insights/components"; - const options = { metricnamespace }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -getApplicationInsightsMetricDefinitionsWithoutFilter().catch(console.error); - -/** - * This sample demonstrates how to Lists the metric definitions for the resource. - * - * @summary Lists the metric definitions for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitions.json - */ -async function getMetricDefinitionsWithoutFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricDefinitions"; - const metricnamespace = "Microsoft.Web/sites"; - const options = { metricnamespace }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -getMetricDefinitionsWithoutFilter().catch(console.error); - -/** - * This sample demonstrates how to Lists the metric definitions for the resource. - * - * @summary Lists the metric definitions for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitionsMetricClass.json - */ -async function getStorageCacheMetricDefinitionsWithMetricClass() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"; - const metricnamespace = "microsoft.storagecache/caches"; - const options = { metricnamespace }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -getStorageCacheMetricDefinitionsWithMetricClass().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 419b0ef7fb1c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricNamespacesListSample.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"); - -/** - * This sample demonstrates how to Lists the metric namespaces for the resource. - * - * @summary Lists the metric namespaces for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/examples/GetMetricNamespaces.json - */ -async function getMetricNamespacesWithoutFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"; - const startTime = "2020-08-31T15:53:00Z"; - const options = { startTime }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricNamespaces.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -getMetricNamespacesWithoutFilter().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 bf5d52e97b89..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricsListSample.js +++ /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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to **Lists the metric values for a resource**. - * - * @summary **Lists the metric values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetric.json - */ -async function getMetricForData() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default"; - const timespan = "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z"; - const interval = "PT1M"; - const aggregation = "Average,count"; - const top = 3; - const orderby = "Average asc"; - const filter = "BlobType eq '*'"; - const metricnamespace = "Microsoft.Storage/storageAccounts/blobServices"; - const options = { - timespan, - interval, - aggregation, - top, - orderby, - filter, - metricnamespace, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metrics.list(resourceUri, options); - console.log(result); -} - -getMetricForData().catch(console.error); - -/** - * This sample demonstrates how to **Lists the metric values for a resource**. - * - * @summary **Lists the metric values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricMetadata.json - */ -async function getMetricForMetadata() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default"; - const timespan = "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z"; - const interval = "PT1M"; - const aggregation = "Average,count"; - const top = 3; - const orderby = "Average asc"; - const filter = "BlobType eq '*'"; - const metricnamespace = "Microsoft.Storage/storageAccounts/blobServices"; - const options = { - timespan, - interval, - aggregation, - top, - orderby, - filter, - metricnamespace, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metrics.list(resourceUri, options); - console.log(result); -} - -getMetricForMetadata().catch(console.error); - -/** - * This sample demonstrates how to **Lists the metric values for a resource**. - * - * @summary **Lists the metric values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricError.json - */ -async function getMetricWithError() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/ac41e21f-afd6-4a79-8070-f01eba278f97/resourceGroups/todking/providers/Microsoft.DocumentDb/databaseAccounts/tk-cosmos-mongo"; - const timespan = "2021-06-07T21:51:00Z/2021-06-08T01:51:00Z"; - const interval = "FULL"; - const metricnames = "MongoRequestsCount,MongoRequests"; - const aggregation = "average"; - const metricnamespace = "microsoft.documentdb/databaseaccounts"; - const options = { - timespan, - interval, - metricnames, - aggregation, - metricnamespace, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metrics.list(resourceUri, options); - console.log(result); -} - -getMetricWithError().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 3d58399960f1..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/operationsListSample.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.operations.list(); - console.log(result); -} - -getAListOfOperationsForAResourceProvider().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/package.json b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/package.json deleted file mode 100644 index 9a21b8943f92..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@azure-samples/arm-monitor-js-beta", - "private": true, - "version": "1.0.0", - "description": " client library samples for JavaScript (Beta)", - "engines": { - "node": ">=14.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/monitor/arm-monitor" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/monitor/arm-monitor", - "dependencies": { - "@azure/arm-monitor": "next", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - } -} diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/predictiveMetricGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/predictiveMetricGetSample.js deleted file mode 100644 index 2664972b52d2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/predictiveMetricGetSample.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"); - -/** - * 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 = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "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); -} - -getMetricForData().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 09a5ea34a538..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsCreateOrUpdateSample.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"); - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -approveOrRejectAPrivateEndpointConnectionWithAGivenName().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 6051e22ea80f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsDeleteSample.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"); - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -deletesAPrivateEndpointConnectionWithAGivenName().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 fd9b2010c243..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsGetSample.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"); - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -getsPrivateEndpointConnection().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 4ca32a0200ef..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsListByPrivateLinkScopeSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -getsListOfPrivateEndpointConnectionsOnAPrivateLinkScope().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 63bec5a2ce01..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkResourcesGetSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -getsPrivateEndpointConnection().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 955bb936758d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkResourcesListByPrivateLinkScopeSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -getsPrivateEndpointConnection().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 fd9cf0e49b5f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopeOperationStatusGetSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "613192d7-503f-477a-9cfe-4efc3ee2bd60"; - const asyncOperationId = "713192d7-503f-477a-9cfe-4efc3ee2bd11"; - const resourceGroupName = "MyResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopeOperationStatus.get( - asyncOperationId, - resourceGroupName - ); - console.log(result); -} - -getSpecificOperationStatus().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 0719e64f17ee..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesCreateOrUpdateSample.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"); - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -updateAScopedResourceInAPrivateLinkScope().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 84eb619595fe..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesDeleteSample.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"); - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -deletesAScopedResourceWithAGivenName().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 ca3307362132..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesGetSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -getsPrivateLinkScopedResource().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 825f3b84ef0a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesListByPrivateLinkScopeSample.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"); - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -getsListOfScopedResourcesInAPrivateLinkScope().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 bbce264d7dbf..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesCreateOrUpdateSample.js +++ /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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = "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); -} - -privateLinkScopeCreate().catch(console.error); - -/** - * 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 = "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = "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); -} - -privateLinkScopeUpdate().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 e7c2d445137f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesDeleteSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = "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); -} - -privateLinkScopesDelete().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 70393a39123d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesGetSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = "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); -} - -privateLinkScopeGet().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 4e3f51181549..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesListByResourceGroupSample.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = "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); -} - -privateLinkScopeListByResourceGroup().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 3287a3f12b0f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesListSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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 = "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); -} - -privateLinkScopesListJson().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 968c064c8a06..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesUpdateTagsSample.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"); - -/** - * 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 = "subid"; - const resourceGroupName = "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); -} - -privateLinkScopeUpdateTagsOnly().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 6a946a62dd15..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesCreateOrUpdateSample.js +++ /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. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Creates or updates an log search rule. - * - * @summary Creates or updates an log search rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRules.json - */ -async function createOrUpdateRuleAlertingAction() { - const subscriptionId = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "Rac46PostSwapRG"; - const ruleName = "logalertfoo"; - const parameters = { - description: "log alert description", - action: { - aznsAction: { - actionGroup: [], - customWebhookPayload: "{}", - emailSubject: "Email Header", - }, - odataType: - "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", - severity: "1", - trigger: { - metricTrigger: { - metricColumn: "Computer", - metricTriggerType: "Consecutive", - threshold: 5, - thresholdOperator: "GreaterThan", - }, - threshold: 3, - thresholdOperator: "GreaterThan", - }, - }, - enabled: "true", - location: "eastus", - schedule: { frequencyInMinutes: 15, timeWindowInMinutes: 15 }, - source: { - dataSourceId: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.OperationalInsights/workspaces/sampleWorkspace", - query: "Heartbeat | summarize AggregatedValue = count() by bin(TimeGenerated, 5m)", - queryType: "ResultCount", - }, - tags: {}, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -createOrUpdateRuleAlertingAction().catch(console.error); - -/** - * This sample demonstrates how to Creates or updates an log search rule. - * - * @summary Creates or updates an log search rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRuleswithCrossResource.json - */ -async function createOrUpdateRuleAlertingActionWithCrossResource() { - const subscriptionId = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "Rac46PostSwapRG"; - const ruleName = "SampleCrossResourceAlert"; - const parameters = { - description: "Sample Cross Resource alert", - action: { - aznsAction: { - actionGroup: [ - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/actiongroups/test-ag", - ], - emailSubject: "Cross Resource Mail!!", - }, - odataType: - "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", - severity: "3", - trigger: { threshold: 5000, thresholdOperator: "GreaterThan" }, - }, - enabled: "true", - location: "eastus", - schedule: { frequencyInMinutes: 60, timeWindowInMinutes: 60 }, - source: { - authorizedResources: [ - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.OperationalInsights/workspaces/sampleWorkspace", - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI", - ], - dataSourceId: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI", - query: 'union requests, workspace("sampleWorkspace").Update', - queryType: "ResultCount", - }, - tags: {}, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -createOrUpdateRuleAlertingActionWithCrossResource().catch(console.error); - -/** - * This sample demonstrates how to Creates or updates an log search rule. - * - * @summary Creates or updates an log search rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRule-LogToMetricAction.json - */ -async function createOrUpdateRuleLogToMetricAction() { - const subscriptionId = "af52d502-a447-4bc6-8cb7-4780fbb00490"; - const resourceGroupName = "alertsweu"; - const ruleName = "logtometricfoo"; - const parameters = { - description: "log to metric description", - action: { - criteria: [{ dimensions: [], metricName: "Average_% Idle Time" }], - odataType: - "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction", - }, - enabled: "true", - location: "West Europe", - source: { - dataSourceId: - "/subscriptions/af52d502-a447-4bc6-8cb7-4780fbb00490/resourceGroups/alertsweu/providers/Microsoft.OperationalInsights/workspaces/alertsweu", - }, - tags: {}, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -createOrUpdateRuleLogToMetricAction().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 a17659e18259..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesDeleteSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Deletes a Log Search rule - * - * @summary Deletes a Log Search rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/deleteScheduledQueryRules.json - */ -async function deleteRule() { - const subscriptionId = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "Rac46PostSwapRG"; - const ruleName = "logalertfoo"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.delete(resourceGroupName, ruleName); - console.log(result); -} - -deleteRule().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 d4112d50fd62..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesGetSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Gets an Log Search rule - * - * @summary Gets an Log Search rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/getScheduledQueryRules.json - */ -async function getRule() { - const subscriptionId = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "Rac46PostSwapRG"; - const ruleName = "logalertfoo"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.get(resourceGroupName, ruleName); - console.log(result); -} - -getRule().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 5b275e2f5047..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesListByResourceGroupSample.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to List the Log Search rules within a resource group. - * - * @summary List the Log Search rules within a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/listScheduledQueryRules.json - */ -async function listRules() { - const subscriptionId = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "gigtest"; - 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); -} - -listRules().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 05bfe236e433..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesListBySubscriptionSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to List the Log Search rules within a subscription group. - * - * @summary List the Log Search rules within a subscription group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/listScheduledQueryRules.json - */ -async function listRules() { - const subscriptionId = "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.scheduledQueryRules.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -listRules().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 c79e8531e7e5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesUpdateSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Update log search Rule. - * - * @summary Update log search Rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/patchScheduledQueryRules.json - */ -async function patchLogSearchRule() { - const subscriptionId = "subid"; - const resourceGroupName = "my-resource-group"; - const ruleName = "logalertfoo"; - const parameters = { enabled: "true" }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.update(resourceGroupName, ruleName, parameters); - console.log(result); -} - -patchLogSearchRule().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 f3885f99f323..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActivityLogsListSample.js +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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"); - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsFiltered.json - */ -async function getTenantActivityLogsWithFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const options = { filter }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -getTenantActivityLogsWithFilter().catch(console.error); - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsFilteredAndSelected.json - */ -async function getTenantActivityLogsWithFilterAndSelect() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const select = - "eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level"; - const options = { filter, select }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -getTenantActivityLogsWithFilterAndSelect().catch(console.error); - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsSelected.json - */ -async function getTenantActivityLogsWithSelect() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const select = - "eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level"; - const options = { select }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -getTenantActivityLogsWithSelect().catch(console.error); - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsNoParams.json - */ -async function getTenantActivityLogsWithoutFilterOrSelect() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list()) { - resArray.push(item); - } - console.log(resArray); -} - -getTenantActivityLogsWithoutFilterOrSelect().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 34debcfbeba0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/vmInsightsGetOnboardingStatusSample.js +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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"); - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusVMScaleSet.json - */ -async function getStatusForAVMScaleSetThatIsActivelyReportingData() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/my-service-cluster/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-01"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -getStatusForAVMScaleSetThatIsActivelyReportingData().catch(console.error); - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSingleVMUnknown.json - */ -async function getStatusForAVMThatHasNotYetReportedData() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -getStatusForAVMThatHasNotYetReportedData().catch(console.error); - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSingleVM.json - */ -async function getStatusForAVMThatIsActivelyReportingData() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -getStatusForAVMThatIsActivelyReportingData().catch(console.error); - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusResourceGroup.json - */ -async function getStatusForAResourceGroupThatHasAtLeastOneVMThatIsActivelyReportingData() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/resource-group-with-vms"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -getStatusForAResourceGroupThatHasAtLeastOneVMThatIsActivelyReportingData().catch(console.error); - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSubscription.json - */ -async function getStatusForASubscriptionThatHasAtLeastOneVMThatIsActivelyReportingData() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -getStatusForASubscriptionThatHasAtLeastOneVMThatIsActivelyReportingData().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 dd201ba71ae7..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/README.md +++ /dev/null @@ -1,267 +0,0 @@ -# client library samples for TypeScript (Beta) - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| --------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.ts][actiongroupscreatenotificationsatactiongroupresourcelevelsample] | Send test notifications to a set of provided receivers x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtActionGroupResourceLevel.json | -| [actionGroupsCreateNotificationsAtResourceGroupLevelSample.ts][actiongroupscreatenotificationsatresourcegrouplevelsample] | Send test notifications to a set of provided receivers x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtResourceGroupLevel.json | -| [actionGroupsCreateOrUpdateSample.ts][actiongroupscreateorupdatesample] | Create a new action group or update an existing one. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/createOrUpdateActionGroup.json | -| [actionGroupsDeleteSample.ts][actiongroupsdeletesample] | Delete an action group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/deleteActionGroup.json | -| [actionGroupsEnableReceiverSample.ts][actiongroupsenablereceiversample] | Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation is only supported for Email or SMS receivers. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/enableReceiver.json | -| [actionGroupsGetSample.ts][actiongroupsgetsample] | Get an action group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getActionGroup.json | -| [actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.ts][actiongroupsgettestnotificationsatactiongroupresourcelevelsample] | Get the test notifications by the notification id x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtActionGroupResourceLevel.json | -| [actionGroupsGetTestNotificationsAtResourceGroupLevelSample.ts][actiongroupsgettestnotificationsatresourcegrouplevelsample] | Get the test notifications by the notification id x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtResourceGroupLevel.json | -| [actionGroupsGetTestNotificationsSample.ts][actiongroupsgettestnotificationssample] | Get the test notifications by the notification id x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotifications.json | -| [actionGroupsListByResourceGroupSample.ts][actiongroupslistbyresourcegroupsample] | Get a list of all action groups in a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json | -| [actionGroupsListBySubscriptionIdSample.ts][actiongroupslistbysubscriptionidsample] | Get a list of all action groups in a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json | -| [actionGroupsPostTestNotificationsSample.ts][actiongroupsposttestnotificationssample] | Send test notifications to a set of provided receivers x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotifications.json | -| [actionGroupsUpdateSample.ts][actiongroupsupdatesample] | Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/patchActionGroup.json | -| [activityLogAlertsCreateOrUpdateSample.ts][activitylogalertscreateorupdatesample] | Create a new Activity Log Alert rule or update an existing one. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_CreateOrUpdate.json | -| [activityLogAlertsDeleteSample.ts][activitylogalertsdeletesample] | Delete an Activity Log Alert rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Delete.json | -| [activityLogAlertsGetSample.ts][activitylogalertsgetsample] | Get an Activity Log Alert rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Get.json | -| [activityLogAlertsListByResourceGroupSample.ts][activitylogalertslistbyresourcegroupsample] | Get a list of all Activity Log Alert rules in a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_ListByResourceGroupName.json | -| [activityLogAlertsListBySubscriptionIdSample.ts][activitylogalertslistbysubscriptionidsample] | Get a list of all Activity Log Alert rules in a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_ListBySubscriptionId.json | -| [activityLogAlertsUpdateSample.ts][activitylogalertsupdatesample] | Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Update.json | -| [activityLogsListSample.ts][activitylogslistsample] | Provides the list of records from the activity logs. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetActivityLogsFiltered.json | -| [alertRuleIncidentsGetSample.ts][alertruleincidentsgetsample] | Gets an incident associated to an alert rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getAlertRuleIncident.json | -| [alertRuleIncidentsListByAlertRuleSample.ts][alertruleincidentslistbyalertrulesample] | Gets a list of incidents associated to an alert rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRuleIncidents.json | -| [alertRulesCreateOrUpdateSample.ts][alertrulescreateorupdatesample] | Creates or updates a classic metric alert rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/createOrUpdateAlertRule.json | -| [alertRulesDeleteSample.ts][alertrulesdeletesample] | Deletes a classic metric alert rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteAlertRule.json | -| [alertRulesGetSample.ts][alertrulesgetsample] | Gets a classic metric alert rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getAlertRule.json | -| [alertRulesListByResourceGroupSample.ts][alertruleslistbyresourcegroupsample] | List the classic metric alert rules within a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRule.json | -| [alertRulesListBySubscriptionSample.ts][alertruleslistbysubscriptionsample] | List the classic metric alert rules within a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRuleBySubscription.json | -| [alertRulesUpdateSample.ts][alertrulesupdatesample] | Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/patchAlertRule.json | -| [autoscaleSettingsCreateOrUpdateSample.ts][autoscalesettingscreateorupdatesample] | Creates or updates an autoscale setting. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/createOrUpdateAutoscaleSetting.json | -| [autoscaleSettingsDeleteSample.ts][autoscalesettingsdeletesample] | Deletes and autoscale setting x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/deleteAutoscaleSetting.json | -| [autoscaleSettingsGetSample.ts][autoscalesettingsgetsample] | Gets an autoscale setting x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/getAutoscaleSetting.json | -| [autoscaleSettingsListByResourceGroupSample.ts][autoscalesettingslistbyresourcegroupsample] | Lists the autoscale settings for a resource group x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/listAutoscaleSetting.json | -| [autoscaleSettingsListBySubscriptionSample.ts][autoscalesettingslistbysubscriptionsample] | Lists the autoscale settings for a subscription x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/listAutoscaleSettingBySubscription.json | -| [autoscaleSettingsUpdateSample.ts][autoscalesettingsupdatesample] | Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/patchAutoscaleSetting.json | -| [baselinesListSample.ts][baselineslistsample] | **Lists the metric baseline values for a resource**. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2019-03-01/examples/metricBaselines.json | -| [dataCollectionEndpointsCreateSample.ts][datacollectionendpointscreatesample] | Creates or updates a data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsCreate.json | -| [dataCollectionEndpointsDeleteSample.ts][datacollectionendpointsdeletesample] | Deletes a data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsDelete.json | -| [dataCollectionEndpointsGetSample.ts][datacollectionendpointsgetsample] | Returns the specified data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsGet.json | -| [dataCollectionEndpointsListByResourceGroupSample.ts][datacollectionendpointslistbyresourcegroupsample] | Lists all data collection endpoints in the specified resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListByResourceGroup.json | -| [dataCollectionEndpointsListBySubscriptionSample.ts][datacollectionendpointslistbysubscriptionsample] | Lists all data collection endpoints in the specified subscription x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListBySubscription.json | -| [dataCollectionEndpointsUpdateSample.ts][datacollectionendpointsupdatesample] | Updates part of a data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsUpdate.json | -| [dataCollectionRuleAssociationsCreateSample.ts][datacollectionruleassociationscreatesample] | Creates or updates an association. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsCreate.json | -| [dataCollectionRuleAssociationsDeleteSample.ts][datacollectionruleassociationsdeletesample] | Deletes an association. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsDelete.json | -| [dataCollectionRuleAssociationsGetSample.ts][datacollectionruleassociationsgetsample] | Returns the specified association. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsGet.json | -| [dataCollectionRuleAssociationsListByDataCollectionEndpointSample.ts][datacollectionruleassociationslistbydatacollectionendpointsample] | Lists associations for the specified data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByDataCollectionEndpoint.json | -| [dataCollectionRuleAssociationsListByResourceSample.ts][datacollectionruleassociationslistbyresourcesample] | Lists associations for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByResource.json | -| [dataCollectionRuleAssociationsListByRuleSample.ts][datacollectionruleassociationslistbyrulesample] | Lists associations for the specified data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByRule.json | -| [dataCollectionRulesCreateSample.ts][datacollectionrulescreatesample] | Creates or updates a data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesCreate.json | -| [dataCollectionRulesDeleteSample.ts][datacollectionrulesdeletesample] | Deletes a data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesDelete.json | -| [dataCollectionRulesGetSample.ts][datacollectionrulesgetsample] | Returns the specified data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesGet.json | -| [dataCollectionRulesListByResourceGroupSample.ts][datacollectionruleslistbyresourcegroupsample] | Lists all data collection rules in the specified resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListByResourceGroup.json | -| [dataCollectionRulesListBySubscriptionSample.ts][datacollectionruleslistbysubscriptionsample] | Lists all data collection rules in the specified subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListBySubscription.json | -| [dataCollectionRulesUpdateSample.ts][datacollectionrulesupdatesample] | Updates part of a data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesUpdate.json | -| [diagnosticSettingsCategoryGetSample.ts][diagnosticsettingscategorygetsample] | Gets the diagnostic settings category for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingsCategory.json | -| [diagnosticSettingsCategoryListSample.ts][diagnosticsettingscategorylistsample] | Lists the diagnostic settings categories for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettingsCategories.json | -| [diagnosticSettingsCreateOrUpdateSample.ts][diagnosticsettingscreateorupdatesample] | Creates or updates diagnostic settings for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateDiagnosticSetting.json | -| [diagnosticSettingsDeleteSample.ts][diagnosticsettingsdeletesample] | Deletes existing diagnostic settings for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/deleteDiagnosticSetting.json | -| [diagnosticSettingsGetSample.ts][diagnosticsettingsgetsample] | Gets the active diagnostic settings for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSetting.json | -| [diagnosticSettingsListSample.ts][diagnosticsettingslistsample] | Gets the active diagnostic settings list for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettings.json | -| [eventCategoriesListSample.ts][eventcategorieslistsample] | Get the list of available event categories supported in the Activity Logs Service.
The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetEventCategories.json | -| [logProfilesCreateOrUpdateSample.ts][logprofilescreateorupdatesample] | Create or update a log profile in Azure Monitoring REST API. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/createOrUpdateLogProfile.json | -| [logProfilesDeleteSample.ts][logprofilesdeletesample] | Deletes the log profile. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteLogProfile.json | -| [logProfilesGetSample.ts][logprofilesgetsample] | Gets the log profile. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getLogProfile.json | -| [logProfilesListSample.ts][logprofileslistsample] | List the log profiles. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listLogProfile.json | -| [logProfilesUpdateSample.ts][logprofilesupdatesample] | Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/patchLogProfile.json | -| [metricAlertsCreateOrUpdateSample.ts][metricalertscreateorupdatesample] | Create or update an metric alert definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateDynamicMetricAlertMultipleResource.json | -| [metricAlertsDeleteSample.ts][metricalertsdeletesample] | Delete an alert rule definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/deleteMetricAlert.json | -| [metricAlertsGetSample.ts][metricalertsgetsample] | Retrieve an alert rule definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getDynamicMetricAlertMultipleResource.json | -| [metricAlertsListByResourceGroupSample.ts][metricalertslistbyresourcegroupsample] | Retrieve alert rule definitions in a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/listMetricAlert.json | -| [metricAlertsListBySubscriptionSample.ts][metricalertslistbysubscriptionsample] | Retrieve alert rule definitions in a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/listMetricAlert.json | -| [metricAlertsStatusListByNameSample.ts][metricalertsstatuslistbynamesample] | Retrieve an alert rule status. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertStatusByName.json | -| [metricAlertsStatusListSample.ts][metricalertsstatuslistsample] | Retrieve an alert rule status. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertStatus.json | -| [metricAlertsUpdateSample.ts][metricalertsupdatesample] | Update an metric alert definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/UpdateMetricAlert.json | -| [metricDefinitionsListSample.ts][metricdefinitionslistsample] | Lists the metric definitions for the resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitionsApplicationInsights.json | -| [metricNamespacesListSample.ts][metricnamespaceslistsample] | Lists the metric namespaces for the resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/examples/GetMetricNamespaces.json | -| [metricsListSample.ts][metricslistsample] | **Lists the metric values for a resource**. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetric.json | -| [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 an log search rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRules.json | -| [scheduledQueryRulesDeleteSample.ts][scheduledqueryrulesdeletesample] | Deletes a Log Search rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/deleteScheduledQueryRules.json | -| [scheduledQueryRulesGetSample.ts][scheduledqueryrulesgetsample] | Gets an Log Search rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/getScheduledQueryRules.json | -| [scheduledQueryRulesListByResourceGroupSample.ts][scheduledqueryruleslistbyresourcegroupsample] | List the Log Search rules within a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/listScheduledQueryRules.json | -| [scheduledQueryRulesListBySubscriptionSample.ts][scheduledqueryruleslistbysubscriptionsample] | List the Log Search rules within a subscription group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/listScheduledQueryRules.json | -| [scheduledQueryRulesUpdateSample.ts][scheduledqueryrulesupdatesample] | Update log search Rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/patchScheduledQueryRules.json | -| [tenantActivityLogsListSample.ts][tenantactivitylogslistsample] | Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does _not_ retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsFiltered.json | -| [vmInsightsGetOnboardingStatusSample.ts][vminsightsgetonboardingstatussample] | Retrieves the VM Insights onboarding status for the specified resource or resource scope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusVMScaleSet.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env node dist/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[actiongroupscreatenotificationsatactiongroupresourcelevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.ts -[actiongroupscreatenotificationsatresourcegrouplevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateNotificationsAtResourceGroupLevelSample.ts -[actiongroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateOrUpdateSample.ts -[actiongroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsDeleteSample.ts -[actiongroupsenablereceiversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsEnableReceiverSample.ts -[actiongroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetSample.ts -[actiongroupsgettestnotificationsatactiongroupresourcelevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.ts -[actiongroupsgettestnotificationsatresourcegrouplevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.ts -[actiongroupsgettestnotificationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsSample.ts -[actiongroupslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsListByResourceGroupSample.ts -[actiongroupslistbysubscriptionidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsListBySubscriptionIdSample.ts -[actiongroupsposttestnotificationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsPostTestNotificationsSample.ts -[actiongroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsUpdateSample.ts -[activitylogalertscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsCreateOrUpdateSample.ts -[activitylogalertsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsDeleteSample.ts -[activitylogalertsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsGetSample.ts -[activitylogalertslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsListByResourceGroupSample.ts -[activitylogalertslistbysubscriptionidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsListBySubscriptionIdSample.ts -[activitylogalertsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsUpdateSample.ts -[activitylogslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogsListSample.ts -[alertruleincidentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRuleIncidentsGetSample.ts -[alertruleincidentslistbyalertrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRuleIncidentsListByAlertRuleSample.ts -[alertrulescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesCreateOrUpdateSample.ts -[alertrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesDeleteSample.ts -[alertrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesGetSample.ts -[alertruleslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesListByResourceGroupSample.ts -[alertruleslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesListBySubscriptionSample.ts -[alertrulesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesUpdateSample.ts -[autoscalesettingscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsCreateOrUpdateSample.ts -[autoscalesettingsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsDeleteSample.ts -[autoscalesettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsGetSample.ts -[autoscalesettingslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsListByResourceGroupSample.ts -[autoscalesettingslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsListBySubscriptionSample.ts -[autoscalesettingsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsUpdateSample.ts -[baselineslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/baselinesListSample.ts -[datacollectionendpointscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsCreateSample.ts -[datacollectionendpointsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsDeleteSample.ts -[datacollectionendpointsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsGetSample.ts -[datacollectionendpointslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsListByResourceGroupSample.ts -[datacollectionendpointslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsListBySubscriptionSample.ts -[datacollectionendpointsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsUpdateSample.ts -[datacollectionruleassociationscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsCreateSample.ts -[datacollectionruleassociationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsDeleteSample.ts -[datacollectionruleassociationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsGetSample.ts -[datacollectionruleassociationslistbydatacollectionendpointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.ts -[datacollectionruleassociationslistbyresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByResourceSample.ts -[datacollectionruleassociationslistbyrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByRuleSample.ts -[datacollectionrulescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesCreateSample.ts -[datacollectionrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesDeleteSample.ts -[datacollectionrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesGetSample.ts -[datacollectionruleslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesListByResourceGroupSample.ts -[datacollectionruleslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesListBySubscriptionSample.ts -[datacollectionrulesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesUpdateSample.ts -[diagnosticsettingscategorygetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCategoryGetSample.ts -[diagnosticsettingscategorylistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCategoryListSample.ts -[diagnosticsettingscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCreateOrUpdateSample.ts -[diagnosticsettingsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsDeleteSample.ts -[diagnosticsettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsGetSample.ts -[diagnosticsettingslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsListSample.ts -[eventcategorieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/eventCategoriesListSample.ts -[logprofilescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesCreateOrUpdateSample.ts -[logprofilesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesDeleteSample.ts -[logprofilesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesGetSample.ts -[logprofileslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesListSample.ts -[logprofilesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesUpdateSample.ts -[metricalertscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsCreateOrUpdateSample.ts -[metricalertsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsDeleteSample.ts -[metricalertsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsGetSample.ts -[metricalertslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsListByResourceGroupSample.ts -[metricalertslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsListBySubscriptionSample.ts -[metricalertsstatuslistbynamesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsStatusListByNameSample.ts -[metricalertsstatuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsStatusListSample.ts -[metricalertsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsUpdateSample.ts -[metricdefinitionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricDefinitionsListSample.ts -[metricnamespaceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricNamespacesListSample.ts -[metricslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricsListSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/operationsListSample.ts -[predictivemetricgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/predictiveMetricGetSample.ts -[privateendpointconnectionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.ts -[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts -[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsGetSample.ts -[privateendpointconnectionslistbyprivatelinkscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsListByPrivateLinkScopeSample.ts -[privatelinkresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkResourcesGetSample.ts -[privatelinkresourceslistbyprivatelinkscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkResourcesListByPrivateLinkScopeSample.ts -[privatelinkscopeoperationstatusgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopeOperationStatusGetSample.ts -[privatelinkscopedresourcescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesCreateOrUpdateSample.ts -[privatelinkscopedresourcesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesDeleteSample.ts -[privatelinkscopedresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesGetSample.ts -[privatelinkscopedresourceslistbyprivatelinkscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesListByPrivateLinkScopeSample.ts -[privatelinkscopescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesCreateOrUpdateSample.ts -[privatelinkscopesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesDeleteSample.ts -[privatelinkscopesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesGetSample.ts -[privatelinkscopeslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesListByResourceGroupSample.ts -[privatelinkscopeslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesListSample.ts -[privatelinkscopesupdatetagssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesUpdateTagsSample.ts -[scheduledqueryrulescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesCreateOrUpdateSample.ts -[scheduledqueryrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesDeleteSample.ts -[scheduledqueryrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesGetSample.ts -[scheduledqueryruleslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesListByResourceGroupSample.ts -[scheduledqueryruleslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesListBySubscriptionSample.ts -[scheduledqueryrulesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesUpdateSample.ts -[tenantactivitylogslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActivityLogsListSample.ts -[vminsightsgetonboardingstatussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/vmInsightsGetOnboardingStatusSample.ts -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-monitor?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/monitor/arm-monitor/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/package.json b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/package.json deleted file mode 100644 index abef395f21e2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@azure-samples/arm-monitor-ts-beta", - "private": true, - "version": "1.0.0", - "description": " client library samples for TypeScript (Beta)", - "engines": { - "node": ">=14.0.0" - }, - "scripts": { - "build": "tsc", - "prebuild": "rimraf dist/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/monitor/arm-monitor" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/monitor/arm-monitor", - "dependencies": { - "@azure/arm-monitor": "next", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - }, - "devDependencies": { - "@types/node": "^14.0.0", - "typescript": "~4.6.0", - "rimraf": "latest" - } -} diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/sample.env b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.ts deleted file mode 100644 index 14730cfd5f3b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NotificationRequestBody, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Send test notifications to a set of provided receivers - * - * @summary Send test notifications to a set of provided receivers - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtActionGroupResourceLevel.json - */ -async function createNotificationsAtResourceGroupLevel() { - const subscriptionId = "11111111-1111-1111-1111-111111111111"; - const resourceGroupName = "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); -} - -createNotificationsAtResourceGroupLevel().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateNotificationsAtResourceGroupLevelSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateNotificationsAtResourceGroupLevelSample.ts deleted file mode 100644 index 8e7aff71d60a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateNotificationsAtResourceGroupLevelSample.ts +++ /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. -import { NotificationRequestBody, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Send test notifications to a set of provided receivers - * - * @summary Send test notifications to a set of provided receivers - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtResourceGroupLevel.json - */ -async function createNotificationsAtResourceGroupLevel() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "Default-TestNotifications"; - const notificationRequest: NotificationRequestBody = { - alertType: "budget", - armRoleReceivers: [ - { - name: "ArmRole-Common", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: true - }, - { - name: "ArmRole-nonCommon", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: false - } - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "http://test.me", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084" - } - ], - azureAppPushReceivers: [ - { name: "Sample azureAppPush", emailAddress: "johndoe@email.com" } - ], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true - } - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true - } - ], - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84" - } - ], - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: - "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c" - } - ], - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false - } - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890" - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321" - } - ], - voiceReceivers: [ - { name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" } - ], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true - }, - { - name: "Sample webhook 2", - identifierUri: - "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true - } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.beginCreateNotificationsAtResourceGroupLevelAndWait( - resourceGroupName, - notificationRequest - ); - console.log(result); -} - -createNotificationsAtResourceGroupLevel().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 0e0211e5df2f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateOrUpdateSample.ts +++ /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. -import { ActionGroupResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Create a new action group or update an existing one. - * - * @summary Create a new action group or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/createOrUpdateActionGroup.json - */ -async function createOrUpdateAnActionGroup() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -createOrUpdateAnActionGroup().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 bbb4fe0af36d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Delete an action group. - * - * @summary Delete an action group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/deleteActionGroup.json - */ -async function deleteAnActionGroup() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -deleteAnActionGroup().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 3076b7381dbd..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsEnableReceiverSample.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 { EnableRequest, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation is only supported for Email or SMS receivers. - * - * @summary Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation is only supported for Email or SMS receivers. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/enableReceiver.json - */ -async function enableTheReceiver() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -enableTheReceiver().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 9f3170a74dbe..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get an action group. - * - * @summary Get an action group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getActionGroup.json - */ -async function getAnActionGroup() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -getAnActionGroup().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 e69eeafd2369..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.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"; - -/** - * This sample demonstrates how to Get the test notifications by the notification id - * - * @summary Get the test notifications by the notification id - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtActionGroupResourceLevel.json - */ -async function getNotificationDetailsAtResourceGroupLevel() { - const subscriptionId = "11111111-1111-1111-1111-111111111111"; - const resourceGroupName = "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); -} - -getNotificationDetailsAtResourceGroupLevel().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.ts deleted file mode 100644 index d4028c828e29..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the test notifications by the notification id - * - * @summary Get the test notifications by the notification id - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtResourceGroupLevel.json - */ -async function getNotificationDetailsAtResourceGroupLevel() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "Default-TestNotifications"; - const notificationId = "11000222191287"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.getTestNotificationsAtResourceGroupLevel( - resourceGroupName, - notificationId - ); - console.log(result); -} - -getNotificationDetailsAtResourceGroupLevel().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsSample.ts deleted file mode 100644 index fa911a387a1b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the test notifications by the notification id - * - * @summary Get the test notifications by the notification id - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotifications.json - */ -async function getNotificationDetailsAtSubscriptionLevel() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const notificationId = "11000222191287"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.getTestNotifications(notificationId); - console.log(result); -} - -getNotificationDetailsAtSubscriptionLevel().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 713e65f337fc..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsListByResourceGroupSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get a list of all action groups in a resource group. - * - * @summary Get a list of all action groups in a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json - */ -async function listActionGroupsAtResourceGroupLevel() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -listActionGroupsAtResourceGroupLevel().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 7693616de76f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsListBySubscriptionIdSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get a list of all action groups in a subscription. - * - * @summary Get a list of all action groups in a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json - */ -async function listActionGroupsAtSubscriptionLevel() { - const subscriptionId = "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); -} - -listActionGroupsAtSubscriptionLevel().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsPostTestNotificationsSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsPostTestNotificationsSample.ts deleted file mode 100644 index 09ba14e48b33..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsPostTestNotificationsSample.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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NotificationRequestBody, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Send test notifications to a set of provided receivers - * - * @summary Send test notifications to a set of provided receivers - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotifications.json - */ -async function createNotificationsAtSubscriptionLevel() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const notificationRequest: NotificationRequestBody = { - alertType: "budget", - armRoleReceivers: [ - { - name: "ArmRole-Common", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: true - }, - { - name: "ArmRole-nonCommon", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: false - } - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "http://test.me", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084" - } - ], - azureAppPushReceivers: [ - { name: "Sample azureAppPush", emailAddress: "johndoe@email.com" } - ], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true - } - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true - } - ], - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84" - } - ], - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: - "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c" - } - ], - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false - } - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890" - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321" - } - ], - voiceReceivers: [ - { name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" } - ], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true - }, - { - name: "Sample webhook 2", - identifierUri: - "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true - } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.beginPostTestNotificationsAndWait( - notificationRequest - ); - console.log(result); -} - -createNotificationsAtSubscriptionLevel().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 02ad5766df97..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsUpdateSample.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 { ActionGroupPatchBody, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/patchActionGroup.json - */ -async function patchAnActionGroup() { - const subscriptionId = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -patchAnActionGroup().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 1ffb147250db..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsCreateOrUpdateSample.ts +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ActivityLogAlertResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -createOrUpdateAnActivityLogAlertRule().catch(console.error); - -/** - * 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 = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -createOrUpdateAnActivityLogAlertRuleWithAnyOfCondition().catch(console.error); - -/** - * 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 = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -createOrUpdateAnActivityLogAlertRuleWithContainsAny().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 350ccbafc9ab..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -deleteAnActivityLogAlertRule().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 bae118a56a21..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -getAnActivityLogAlertRule().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 2ebab98a1f1f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsListByResourceGroupSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -listActivityLogAlerts().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 8599914a6da8..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsListBySubscriptionIdSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "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); -} - -getListOfAllActivityLogAlertRulesUnderASubscription().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 5442590f1a56..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsUpdateSample.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 { AlertRulePatchObject, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = "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); -} - -patchAnActivityLogAlertRule().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 bfe0834c38d5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogsListSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ActivityLogsListOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "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); -} - -getActivityLogsWithFilter().catch(console.error); - -/** - * 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 = "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); -} - -getActivityLogsWithFilterAndSelect().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 63b490c82b03..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRuleIncidentsGetSample.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"; - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -getASingleAlertRuleIncident().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 f4c64d9d78c4..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -listAlertRuleIncidents().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 84504952c1ab..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesCreateOrUpdateSample.ts +++ /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. -import { AlertRuleResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -createOrUpdateAnAlertRule().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 8dc25f8e8d3d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesDeleteSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -deleteAnAlertRule().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 15bb81680a64..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesGetSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -getAnAlertRule().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 574e1e4af6a1..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesListByResourceGroupSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -listAlertRules().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 463d30dd0c95..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesListBySubscriptionSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "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); -} - -listAlertRules().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 a48a50c7afed..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesUpdateSample.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AlertRuleResourcePatch, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -patchAnAlertRule().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 63cc1543832f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsCreateOrUpdateSample.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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AutoscaleSettingResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -createOrUpdateAnAutoscaleSetting().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 13d81a9bc8d5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -deleteAnAutoscaleSetting().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 152ec9d51b0d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -getAnAutoscaleSetting().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 f2db8ccdd5cb..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsListByResourceGroupSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -listAutoscaleSettings().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 ee1819296832..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsListBySubscriptionSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "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); -} - -listAutoscaleSettingsBySubs().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 13126d25fa43..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsUpdateSample.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 { - AutoscaleSettingResourcePatch, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "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); -} - -patchAnAutoscaleSetting().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 9018150856ce..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/baselinesListSample.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 { BaselinesListOptionalParams, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to **Lists the metric baseline values for a resource**. - * - * @summary **Lists the metric baseline values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2019-03-01/examples/metricBaselines.json - */ -async function getMetricBaselines() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1"; - const timespan = "2019-03-12T11:00:00.000Z/2019-03-12T12:00:00.000Z"; - const interval = "PT1H"; - const aggregation = "average"; - const sensitivities = "Low,Medium"; - const options: BaselinesListOptionalParams = { - timespan, - interval, - aggregation, - sensitivities - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.baselines.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -getMetricBaselines().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 e4a2ac6e2139..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsCreateSample.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 { - DataCollectionEndpointResource, - DataCollectionEndpointsCreateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Creates or updates a data collection endpoint. - * - * @summary Creates or updates a data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsCreate.json - */ -async function createOrUpdateDataCollectionEndpoint() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -createOrUpdateDataCollectionEndpoint().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 0df7e3bb72ef..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsDeleteSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Deletes a data collection endpoint. - * - * @summary Deletes a data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsDelete.json - */ -async function deleteDataCollectionEndpoint() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -deleteDataCollectionEndpoint().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 08ed8322033f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Returns the specified data collection endpoint. - * - * @summary Returns the specified data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsGet.json - */ -async function getDataCollectionEndpoint() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -getDataCollectionEndpoint().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 ad69bc5207bd..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsListByResourceGroupSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists all data collection endpoints in the specified resource group. - * - * @summary Lists all data collection endpoints in the specified resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListByResourceGroup.json - */ -async function listDataCollectionEndpointsByResourceGroup() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -listDataCollectionEndpointsByResourceGroup().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 e6f0325b1163..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsListBySubscriptionSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists all data collection endpoints in the specified subscription - * - * @summary Lists all data collection endpoints in the specified subscription - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListBySubscription.json - */ -async function listDataCollectionEndpointsBySubscription() { - const subscriptionId = "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); -} - -listDataCollectionEndpointsBySubscription().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 730129793f0a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsUpdateSample.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 { - ResourceForUpdate, - DataCollectionEndpointsUpdateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Updates part of a data collection endpoint. - * - * @summary Updates part of a data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsUpdate.json - */ -async function updateDataCollectionEndpoint() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -updateDataCollectionEndpoint().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 74cc5eaf0b09..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsCreateSample.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 { - DataCollectionRuleAssociationProxyOnlyResource, - DataCollectionRuleAssociationsCreateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Creates or updates an association. - * - * @summary Creates or updates an association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsCreate.json - */ -async function createOrUpdateAssociation() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const associationName = "myAssociation"; - const body: DataCollectionRuleAssociationProxyOnlyResource = { - dataCollectionRuleId: - "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule" - }; - const options: DataCollectionRuleAssociationsCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRuleAssociations.create( - resourceUri, - associationName, - options - ); - console.log(result); -} - -createOrUpdateAssociation().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 8c7881e8c1d2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsDeleteSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Deletes an association. - * - * @summary Deletes an association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsDelete.json - */ -async function deleteAssociation() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const associationName = "myAssociation"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRuleAssociations.delete( - resourceUri, - associationName - ); - console.log(result); -} - -deleteAssociation().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 d416cffe8df8..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsGetSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Returns the specified association. - * - * @summary Returns the specified association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsGet.json - */ -async function getAssociation() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const associationName = "myAssociation"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRuleAssociations.get( - resourceUri, - associationName - ); - console.log(result); -} - -getAssociation().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 865091cdc7c8..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.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"; - -/** - * This sample demonstrates how to Lists associations for the specified data collection endpoint. - * - * @summary Lists associations for the specified data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByDataCollectionEndpoint.json - */ -async function listAssociationsForSpecifiedDataCollectionEndpoint() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -listAssociationsForSpecifiedDataCollectionEndpoint().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 a386a6046ed4..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByResourceSample.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"; - -/** - * This sample demonstrates how to Lists associations for the specified resource. - * - * @summary Lists associations for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByResource.json - */ -async function listAssociationsForSpecifiedResource() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRuleAssociations.listByResource( - resourceUri - )) { - resArray.push(item); - } - console.log(resArray); -} - -listAssociationsForSpecifiedResource().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 6c5e25aaa1de..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByRuleSample.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"; - -/** - * This sample demonstrates how to Lists associations for the specified data collection rule. - * - * @summary Lists associations for the specified data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByRule.json - */ -async function listAssociationsForSpecifiedDataCollectionRule() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -listAssociationsForSpecifiedDataCollectionRule().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 13f65c014fe9..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesCreateSample.ts +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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"; - -/** - * This sample demonstrates how to Creates or updates a data collection rule. - * - * @summary Creates or updates a data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesCreate.json - */ -async function createOrUpdateDataCollectionRule() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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", - "MemoryCommitted 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); -} - -createOrUpdateDataCollectionRule().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 e7047f5ee242..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Deletes a data collection rule. - * - * @summary Deletes a data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesDelete.json - */ -async function deleteDataCollectionRule() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -deleteDataCollectionRule().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 ae578d398426..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Returns the specified data collection rule. - * - * @summary Returns the specified data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesGet.json - */ -async function getDataCollectionRule() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -getDataCollectionRule().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 66492b5e0886..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesListByResourceGroupSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists all data collection rules in the specified resource group. - * - * @summary Lists all data collection rules in the specified resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListByResourceGroup.json - */ -async function listDataCollectionRulesByResourceGroup() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -listDataCollectionRulesByResourceGroup().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 e622dc1a393a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesListBySubscriptionSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists all data collection rules in the specified subscription. - * - * @summary Lists all data collection rules in the specified subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListBySubscription.json - */ -async function listDataCollectionRulesBySubscription() { - const subscriptionId = "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); -} - -listDataCollectionRulesBySubscription().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 4bfc7b5c2e26..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesUpdateSample.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 { - ResourceForUpdate, - DataCollectionRulesUpdateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Updates part of a data collection rule. - * - * @summary Updates part of a data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesUpdate.json - */ -async function updateDataCollectionRule() { - const subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = "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); -} - -updateDataCollectionRule().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 d2989c3d6727..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCategoryGetSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets the diagnostic settings category for the specified resource. - * - * @summary Gets the diagnostic settings category for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingsCategory.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "WorkflowRuntime"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettingsCategory.get(resourceUri, name); - console.log(result); -} - -getsTheDiagnosticSetting().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 5d95a59fff22..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCategoryListSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists the diagnostic settings categories for the specified resource. - * - * @summary Lists the diagnostic settings categories for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettingsCategories.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.diagnosticSettingsCategory.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -getsTheDiagnosticSetting().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 95b01554e4cc..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCreateOrUpdateSample.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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { DiagnosticSettingsResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Creates or updates diagnostic settings for the specified resource. - * - * @summary Creates or updates diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateDiagnosticSetting.json - */ -async function createsOrUpdatesTheDiagnosticSetting() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const parameters: DiagnosticSettingsResource = { - eventHubAuthorizationRuleId: - "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule", - eventHubName: "myeventhub", - logAnalyticsDestinationType: "Dedicated", - logs: [ - { - categoryGroup: "allLogs", - enabled: true, - retentionPolicy: { days: 0, enabled: false } - } - ], - marketplacePartnerId: - "/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1", - metrics: [ - { - category: "WorkflowMetrics", - enabled: true, - retentionPolicy: { days: 0, enabled: false } - } - ], - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1", - workspaceId: "" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.createOrUpdate( - resourceUri, - name, - parameters - ); - console.log(result); -} - -createsOrUpdatesTheDiagnosticSetting().catch(console.error); - -/** - * This sample demonstrates how to Creates or updates diagnostic settings for the specified resource. - * - * @summary Creates or updates diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateDiagnosticSettingCategory.json - */ -async function createsOrUpdatesTheDiagnosticSettingForCategory() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const parameters: DiagnosticSettingsResource = { - eventHubAuthorizationRuleId: - "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule", - eventHubName: "myeventhub", - logAnalyticsDestinationType: "Dedicated", - logs: [ - { - category: "WorkflowRuntime", - enabled: true, - retentionPolicy: { days: 0, enabled: false } - } - ], - marketplacePartnerId: - "/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1", - metrics: [ - { - category: "WorkflowMetrics", - enabled: true, - retentionPolicy: { days: 0, enabled: false } - } - ], - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1", - workspaceId: "" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.createOrUpdate( - resourceUri, - name, - parameters - ); - console.log(result); -} - -createsOrUpdatesTheDiagnosticSettingForCategory().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 e87ead0982bc..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsDeleteSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Deletes existing diagnostic settings for the specified resource. - * - * @summary Deletes existing diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/deleteDiagnosticSetting.json - */ -async function deletesTheDiagnosticSetting() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.delete(resourceUri, name); - console.log(result); -} - -deletesTheDiagnosticSetting().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 0c6e5af5c99a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsGetSample.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"; - -/** - * This sample demonstrates how to Gets the active diagnostic settings for the specified resource. - * - * @summary Gets the active diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSetting.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.get(resourceUri, name); - console.log(result); -} - -getsTheDiagnosticSetting().catch(console.error); - -/** - * This sample demonstrates how to Gets the active diagnostic settings for the specified resource. - * - * @summary Gets the active diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingCategory.json - */ -async function getsTheDiagnosticSettingForCategory() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.get(resourceUri, name); - console.log(result); -} - -getsTheDiagnosticSettingForCategory().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 3391144c471b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsListSample.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 { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets the active diagnostic settings list for the specified resource. - * - * @summary Gets the active diagnostic settings list for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettings.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.diagnosticSettings.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -getsTheDiagnosticSetting().catch(console.error); - -/** - * This sample demonstrates how to Gets the active diagnostic settings list for the specified resource. - * - * @summary Gets the active diagnostic settings list for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettingsCategory.json - */ -async function getsTheDiagnosticSettingForCategory() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.diagnosticSettings.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -getsTheDiagnosticSettingForCategory().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 327aee38fa46..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/eventCategoriesListSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the list of available event categories supported in the Activity Logs Service.
The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. - * - * @summary Get the list of available event categories supported in the Activity Logs Service.
The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetEventCategories.json - */ -async function getEventCategories() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.eventCategories.list()) { - resArray.push(item); - } - console.log(resArray); -} - -getEventCategories().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 9380ac49e851..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesCreateOrUpdateSample.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 { LogProfileResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "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); -} - -createOrUpdateALogProfile().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 05afd6c9cfdd..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesDeleteSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "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); -} - -deleteLogProfile().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 fcfd4e333451..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesGetSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "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); -} - -getLogProfile().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 c85e315bb4c4..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesListSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "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); -} - -listLogProfiles().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 6c604354e8ad..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesUpdateSample.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 { LogProfileResourcePatch, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "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); -} - -patchALogProfile().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 de5f8be8879d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsCreateOrUpdateSample.ts +++ /dev/null @@ -1,487 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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"; - -/** - * 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 = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "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); -} - -createOrUpdateADynamicAlertRuleForMultipleResources().catch(console.error); - -/** - * 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 = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "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); -} - -createOrUpdateADynamicAlertRuleForSingleResource().catch(console.error); - -/** - * 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 = "12345678-1234-1234-1234-123456789101"; - const resourceGroupName = "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); -} - -createOrUpdateAWebTestAlertRule().catch(console.error); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -createOrUpdateAnAlertRuleForMultipleResource().catch(console.error); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -createOrUpdateAnAlertRuleForSingleResource().catch(console.error); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -createOrUpdateAnAlertRuleOnResourceGroupS().catch(console.error); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -createOrUpdateAnAlertRuleOnSubscription().catch(console.error); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -createOrUpdateAnAlertRulesWithDimensions().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 3b25ab0bc93f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsDeleteSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -deleteAnAlertRule().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 20f1c2da8438..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsGetSample.ts +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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"; - -/** - * 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 = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "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); -} - -getADynamicAlertRuleForMultipleResources().catch(console.error); - -/** - * 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 = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "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); -} - -getADynamicAlertRuleForSingleResource().catch(console.error); - -/** - * 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 = "12345678-1234-1234-1234-123456789101"; - const resourceGroupName = "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); -} - -getAWebTestAlertRule().catch(console.error); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -getAnAlertRuleForMultipleResources().catch(console.error); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -getAnAlertRuleForSingleResource().catch(console.error); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -getAnAlertRuleOnResourceGroupS().catch(console.error); - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -getAnAlertRuleOnSubscription().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 e35301adb673..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsListByResourceGroupSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -listMetricAlertRules().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 a40ec5a27ddd..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsListBySubscriptionSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "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); -} - -listMetricAlertRules().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 112a5b0c9e80..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsStatusListByNameSample.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"; - -/** - * 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 = "009f6022-67ec-423e-9aa7-691182870588"; - const resourceGroupName = "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); -} - -getAnAlertRuleStatus().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 0408b564ef6e..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -getAnAlertRuleStatus().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 d7e5b58acbc3..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MetricAlertResourcePatch, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "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); -} - -createOrUpdateAnAlertRule().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 4b7ec466e7d8..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"; - -/** - * This sample demonstrates how to Lists the metric definitions for the resource. - * - * @summary Lists the metric definitions for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitionsApplicationInsights.json - */ -async function getApplicationInsightsMetricDefinitionsWithoutFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions"; - const metricnamespace = "microsoft.insights/components"; - const options: MetricDefinitionsListOptionalParams = { metricnamespace }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -getApplicationInsightsMetricDefinitionsWithoutFilter().catch(console.error); - -/** - * This sample demonstrates how to Lists the metric definitions for the resource. - * - * @summary Lists the metric definitions for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitions.json - */ -async function getMetricDefinitionsWithoutFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricDefinitions"; - const metricnamespace = "Microsoft.Web/sites"; - const options: MetricDefinitionsListOptionalParams = { metricnamespace }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -getMetricDefinitionsWithoutFilter().catch(console.error); - -/** - * This sample demonstrates how to Lists the metric definitions for the resource. - * - * @summary Lists the metric definitions for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitionsMetricClass.json - */ -async function getStorageCacheMetricDefinitionsWithMetricClass() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"; - const metricnamespace = "microsoft.storagecache/caches"; - const options: MetricDefinitionsListOptionalParams = { metricnamespace }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -getStorageCacheMetricDefinitionsWithMetricClass().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 64c8b014c540..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricNamespacesListSample.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 { - MetricNamespacesListOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists the metric namespaces for the resource. - * - * @summary Lists the metric namespaces for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/examples/GetMetricNamespaces.json - */ -async function getMetricNamespacesWithoutFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"; - const startTime = "2020-08-31T15:53:00Z"; - const options: MetricNamespacesListOptionalParams = { startTime }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricNamespaces.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -getMetricNamespacesWithoutFilter().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 87c22cbc65f8..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MetricsListOptionalParams, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to **Lists the metric values for a resource**. - * - * @summary **Lists the metric values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetric.json - */ -async function getMetricForData() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default"; - const timespan = "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z"; - const interval = "PT1M"; - const aggregation = "Average,count"; - const top = 3; - const orderby = "Average asc"; - const filter = "BlobType eq '*'"; - const metricnamespace = "Microsoft.Storage/storageAccounts/blobServices"; - const options: MetricsListOptionalParams = { - timespan, - interval, - aggregation, - top, - orderby, - filter, - metricnamespace - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metrics.list(resourceUri, options); - console.log(result); -} - -getMetricForData().catch(console.error); - -/** - * This sample demonstrates how to **Lists the metric values for a resource**. - * - * @summary **Lists the metric values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricMetadata.json - */ -async function getMetricForMetadata() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default"; - const timespan = "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z"; - const interval = "PT1M"; - const aggregation = "Average,count"; - const top = 3; - const orderby = "Average asc"; - const filter = "BlobType eq '*'"; - const metricnamespace = "Microsoft.Storage/storageAccounts/blobServices"; - const options: MetricsListOptionalParams = { - timespan, - interval, - aggregation, - top, - orderby, - filter, - metricnamespace - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metrics.list(resourceUri, options); - console.log(result); -} - -getMetricForMetadata().catch(console.error); - -/** - * This sample demonstrates how to **Lists the metric values for a resource**. - * - * @summary **Lists the metric values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricError.json - */ -async function getMetricWithError() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/ac41e21f-afd6-4a79-8070-f01eba278f97/resourceGroups/todking/providers/Microsoft.DocumentDb/databaseAccounts/tk-cosmos-mongo"; - const timespan = "2021-06-07T21:51:00Z/2021-06-08T01:51:00Z"; - const interval = "FULL"; - const metricnames = "MongoRequestsCount,MongoRequests"; - const aggregation = "average"; - const metricnamespace = "microsoft.documentdb/databaseaccounts"; - const options: MetricsListOptionalParams = { - timespan, - interval, - metricnames, - aggregation, - metricnamespace - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metrics.list(resourceUri, options); - console.log(result); -} - -getMetricWithError().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 758830df40d5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.operations.list(); - console.log(result); -} - -getAListOfOperationsForAResourceProvider().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 5698cfee7be5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/predictiveMetricGetSample.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"; - -/** - * 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 = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "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); -} - -getMetricForData().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 58206cb36211..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.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 { PrivateEndpointConnection, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const privateEndpointConnectionName = "private-endpoint-connection-name"; - const parameters: PrivateEndpointConnection = { - privateLinkServiceConnectionState: { - description: "Approved by johndoe@contoso.com", - status: "Approved" - } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginCreateOrUpdateAndWait( - resourceGroupName, - scopeName, - privateEndpointConnectionName, - parameters - ); - console.log(result); -} - -approveOrRejectAPrivateEndpointConnectionWithAGivenName().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 4fcd19543efb..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsDeleteSample.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"; - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -deletesAPrivateEndpointConnectionWithAGivenName().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 f48d3d2f4df8..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsGetSample.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"; - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -getsPrivateEndpointConnection().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 0ca1e44f0bfe..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsListByPrivateLinkScopeSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -getsListOfPrivateEndpointConnectionsOnAPrivateLinkScope().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 3f88401dc007..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkResourcesGetSample.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"; - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -getsPrivateEndpointConnection().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 7285ca8536d9..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkResourcesListByPrivateLinkScopeSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -getsPrivateEndpointConnection().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 073cda5f69e0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopeOperationStatusGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "613192d7-503f-477a-9cfe-4efc3ee2bd60"; - const asyncOperationId = "713192d7-503f-477a-9cfe-4efc3ee2bd11"; - const resourceGroupName = "MyResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopeOperationStatus.get( - asyncOperationId, - resourceGroupName - ); - console.log(result); -} - -getSpecificOperationStatus().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 b1a4de94ed97..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesCreateOrUpdateSample.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 { ScopedResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -updateAScopedResourceInAPrivateLinkScope().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 0b3d189af0be..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesDeleteSample.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"; - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -deletesAScopedResourceWithAGivenName().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 803b21e0a281..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesGetSample.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"; - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -getsPrivateLinkScopedResource().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 40495b505eb2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesListByPrivateLinkScopeSample.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"; - -/** - * 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 = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "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); -} - -getsListOfScopedResourcesInAPrivateLinkScope().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 ee3c8730fe23..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesCreateOrUpdateSample.ts +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AzureMonitorPrivateLinkScope, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = "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); -} - -privateLinkScopeCreate().catch(console.error); - -/** - * 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 = "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = "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); -} - -privateLinkScopeUpdate().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 4baf96e85732..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = "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); -} - -privateLinkScopesDelete().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 89c95def352f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = "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); -} - -privateLinkScopeGet().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 d5f02230f8a7..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesListByResourceGroupSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = "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); -} - -privateLinkScopeListByResourceGroup().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 df679d343e17..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesListSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "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); -} - -privateLinkScopesListJson().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 f40c975303dd..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesUpdateTagsSample.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 { TagsResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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 = "subid"; - const resourceGroupName = "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); -} - -privateLinkScopeUpdateTagsOnly().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 14f27c7ec33d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesCreateOrUpdateSample.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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { LogSearchRuleResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Creates or updates an log search rule. - * - * @summary Creates or updates an log search rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRules.json - */ -async function createOrUpdateRuleAlertingAction() { - const subscriptionId = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "Rac46PostSwapRG"; - const ruleName = "logalertfoo"; - const parameters: LogSearchRuleResource = { - description: "log alert description", - action: { - aznsAction: { - actionGroup: [], - customWebhookPayload: "{}", - emailSubject: "Email Header" - }, - odataType: - "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", - severity: "1", - trigger: { - metricTrigger: { - metricColumn: "Computer", - metricTriggerType: "Consecutive", - threshold: 5, - thresholdOperator: "GreaterThan" - }, - threshold: 3, - thresholdOperator: "GreaterThan" - } - }, - enabled: "true", - location: "eastus", - schedule: { frequencyInMinutes: 15, timeWindowInMinutes: 15 }, - source: { - dataSourceId: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.OperationalInsights/workspaces/sampleWorkspace", - query: - "Heartbeat | summarize AggregatedValue = count() by bin(TimeGenerated, 5m)", - queryType: "ResultCount" - }, - tags: {} - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -createOrUpdateRuleAlertingAction().catch(console.error); - -/** - * This sample demonstrates how to Creates or updates an log search rule. - * - * @summary Creates or updates an log search rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRuleswithCrossResource.json - */ -async function createOrUpdateRuleAlertingActionWithCrossResource() { - const subscriptionId = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "Rac46PostSwapRG"; - const ruleName = "SampleCrossResourceAlert"; - const parameters: LogSearchRuleResource = { - description: "Sample Cross Resource alert", - action: { - aznsAction: { - actionGroup: [ - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/actiongroups/test-ag" - ], - emailSubject: "Cross Resource Mail!!" - }, - odataType: - "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", - severity: "3", - trigger: { threshold: 5000, thresholdOperator: "GreaterThan" } - }, - enabled: "true", - location: "eastus", - schedule: { frequencyInMinutes: 60, timeWindowInMinutes: 60 }, - source: { - authorizedResources: [ - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.OperationalInsights/workspaces/sampleWorkspace", - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI" - ], - dataSourceId: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI", - query: 'union requests, workspace("sampleWorkspace").Update', - queryType: "ResultCount" - }, - tags: {} - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -createOrUpdateRuleAlertingActionWithCrossResource().catch(console.error); - -/** - * This sample demonstrates how to Creates or updates an log search rule. - * - * @summary Creates or updates an log search rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRule-LogToMetricAction.json - */ -async function createOrUpdateRuleLogToMetricAction() { - const subscriptionId = "af52d502-a447-4bc6-8cb7-4780fbb00490"; - const resourceGroupName = "alertsweu"; - const ruleName = "logtometricfoo"; - const parameters: LogSearchRuleResource = { - description: "log to metric description", - action: { - criteria: [{ dimensions: [], metricName: "Average_% Idle Time" }], - odataType: - "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction" - }, - enabled: "true", - location: "West Europe", - source: { - dataSourceId: - "/subscriptions/af52d502-a447-4bc6-8cb7-4780fbb00490/resourceGroups/alertsweu/providers/Microsoft.OperationalInsights/workspaces/alertsweu" - }, - tags: {} - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -createOrUpdateRuleLogToMetricAction().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 e5d32d5deca6..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Deletes a Log Search rule - * - * @summary Deletes a Log Search rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/deleteScheduledQueryRules.json - */ -async function deleteRule() { - const subscriptionId = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "Rac46PostSwapRG"; - const ruleName = "logalertfoo"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.delete( - resourceGroupName, - ruleName - ); - console.log(result); -} - -deleteRule().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 159d6e1f4415..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets an Log Search rule - * - * @summary Gets an Log Search rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/getScheduledQueryRules.json - */ -async function getRule() { - const subscriptionId = "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = "Rac46PostSwapRG"; - const ruleName = "logalertfoo"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.get( - resourceGroupName, - ruleName - ); - console.log(result); -} - -getRule().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 4a54ad156ab2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesListByResourceGroupSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to List the Log Search rules within a resource group. - * - * @summary List the Log Search rules within a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/listScheduledQueryRules.json - */ -async function listRules() { - const subscriptionId = "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = "gigtest"; - 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); -} - -listRules().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 2fca11d6bcf0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesListBySubscriptionSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to List the Log Search rules within a subscription group. - * - * @summary List the Log Search rules within a subscription group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/listScheduledQueryRules.json - */ -async function listRules() { - const subscriptionId = "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.scheduledQueryRules.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -listRules().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 ab8f6ea717d9..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { LogSearchRuleResourcePatch, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Update log search Rule. - * - * @summary Update log search Rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/patchScheduledQueryRules.json - */ -async function patchLogSearchRule() { - const subscriptionId = "subid"; - const resourceGroupName = "my-resource-group"; - const ruleName = "logalertfoo"; - const parameters: LogSearchRuleResourcePatch = { enabled: "true" }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.update( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -patchLogSearchRule().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 f4f597a65179..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActivityLogsListSample.ts +++ /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. -import { - TenantActivityLogsListOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsFiltered.json - */ -async function getTenantActivityLogsWithFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const options: TenantActivityLogsListOptionalParams = { filter }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -getTenantActivityLogsWithFilter().catch(console.error); - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsFilteredAndSelected.json - */ -async function getTenantActivityLogsWithFilterAndSelect() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const select = - "eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level"; - const options: TenantActivityLogsListOptionalParams = { filter, select }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -getTenantActivityLogsWithFilterAndSelect().catch(console.error); - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsSelected.json - */ -async function getTenantActivityLogsWithSelect() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const select = - "eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level"; - const options: TenantActivityLogsListOptionalParams = { select }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -getTenantActivityLogsWithSelect().catch(console.error); - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsNoParams.json - */ -async function getTenantActivityLogsWithoutFilterOrSelect() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list()) { - resArray.push(item); - } - console.log(resArray); -} - -getTenantActivityLogsWithoutFilterOrSelect().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 726927302f4f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/vmInsightsGetOnboardingStatusSample.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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusVMScaleSet.json - */ -async function getStatusForAVMScaleSetThatIsActivelyReportingData() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/my-service-cluster/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-01"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -getStatusForAVMScaleSetThatIsActivelyReportingData().catch(console.error); - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSingleVMUnknown.json - */ -async function getStatusForAVMThatHasNotYetReportedData() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -getStatusForAVMThatHasNotYetReportedData().catch(console.error); - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSingleVM.json - */ -async function getStatusForAVMThatIsActivelyReportingData() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -getStatusForAVMThatIsActivelyReportingData().catch(console.error); - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusResourceGroup.json - */ -async function getStatusForAResourceGroupThatHasAtLeastOneVMThatIsActivelyReportingData() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/resource-group-with-vms"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -getStatusForAResourceGroupThatHasAtLeastOneVMThatIsActivelyReportingData().catch( - console.error -); - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSubscription.json - */ -async function getStatusForASubscriptionThatHasAtLeastOneVMThatIsActivelyReportingData() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceUri = "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -getStatusForASubscriptionThatHasAtLeastOneVMThatIsActivelyReportingData().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 416c2dd82e00..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2018", - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "alwaysStrict": true, - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**.ts" - ] -} diff --git a/sdk/monitor/arm-monitor/src/index.ts b/sdk/monitor/arm-monitor/src/index.ts index 826cbfe61d7d..798b194044f8 100644 --- a/sdk/monitor/arm-monitor/src/index.ts +++ b/sdk/monitor/arm-monitor/src/index.ts @@ -7,6 +7,7 @@ */ /// +export { getContinuationToken } from "./pagingHelper"; export * from "./models"; export { MonitorClient } from "./monitorClient"; export * from "./operationsInterfaces"; diff --git a/sdk/monitor/arm-monitor/src/models/index.ts b/sdk/monitor/arm-monitor/src/models/index.ts index a4187a7b3232..0435bf2c8479 100644 --- a/sdk/monitor/arm-monitor/src/models/index.ts +++ b/sdk/monitor/arm-monitor/src/models/index.ts @@ -23,7 +23,6 @@ export type MetricAlertCriteriaUnion = | MetricAlertSingleResourceMultipleMetricCriteria | WebtestLocationAvailabilityCriteria | MetricAlertMultipleResourceMultipleMetricCriteria; -export type ActionUnion = Action | AlertingAction | LogToMetricAction; export type MultiMetricCriteriaUnion = | MultiMetricCriteria | MetricCriteria @@ -743,7 +742,7 @@ export interface ActionGroupPatchBody { /** The request body which contain contact detail metadata */ export interface NotificationRequestBody { - /** The name of the supported alert type. */ + /** 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[]; @@ -1279,85 +1278,301 @@ export interface MetricAlertStatusProperties { timestamp?: Date; } -/** Specifies the log search query. */ -export interface Source { - /** Log search query. Required for action type - AlertingAction */ - query?: string; - /** List of Resource referred into query */ - authorizedResources?: string[]; - /** The resource uri over which log search query is to be run. */ - dataSourceId: string; - /** Set value to 'ResultCount' . */ - queryType?: QueryType; -} - -/** Defines how often to run the search and the time interval. */ -export interface Schedule { - /** frequency (in minutes) at which rule condition should be evaluated. */ - frequencyInMinutes: number; - /** Time window for which data needs to be fetched for query (should be greater than or equal to frequencyInMinutes). */ - timeWindowInMinutes: number; -} - -/** Action descriptor. */ -export interface Action { - /** Polymorphic discriminator, which specifies the different types this object can be */ - odataType: - | "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction" - | "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction"; +/** 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; } -/** An azure resource object */ -export interface ResourceAutoGenerated5 { +/** The scheduled query rule resource. */ +export interface ScheduledQueryRuleResource { /** - * Azure resource Id + * 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; /** - * Azure resource name + * The name of the resource * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * Azure resource type + * 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; - /** Resource location */ - location: string; - /** Resource tags */ + /** 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; /** - * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. + * 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 kind?: string; + readonly etag?: string; /** - * 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. + * SystemData of ScheduledQueryRule. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly etag?: string; + 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; + /** This determines if traffic is allowed over public network. By default it is enabled. */ + publicNetworkAccess?: PublicNetworkAccess; + /** 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 }; +} + +/** 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 ErrorContract { /** The error details. */ - error?: ErrorResponse; + error?: ErrorResponseDetails; } -/** The log search rule resource for patch operations. */ -export interface LogSearchRuleResourcePatch { - /** Resource tags */ - tags?: { [propertyName: string]: string }; - /** The flag which indicates whether the Log Search rule is enabled. Value should be true or false */ - enabled?: Enabled; +/** 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 ErrorResponseDetails { + /** + * 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?: ErrorResponseDetails[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorResponseAdditionalInfo[]; } -/** Represents a collection of Log Search rule resources. */ -export interface LogSearchRuleResourceCollection { - /** The values for the Log Search Rule resources. */ - value?: LogSearchRuleResource[]; +/** The resource management error additional info. */ +export interface ErrorResponseAdditionalInfo { + /** + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly info?: Record; +} + +/** 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; + /** This determines if traffic is allowed over public network. By default it is enabled. */ + publicNetworkAccess?: PublicNetworkAccess; + /** 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; } /** Represents collection of metric namespaces. */ @@ -2178,6 +2393,195 @@ export interface DataFlow { outputStream?: string; } +/** A pageable list of resources */ +export interface MonitoringAccountResourceListResult { + /** A list of resources */ + value: MonitoringAccountResource[]; + /** The URL to use for getting the next set of results */ + nextLink?: string; +} + +/** Properties of a monitoring account */ +export interface MonitoringAccount { + /** + * The immutable ID of the monitoring account. This property is read-only. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly accountId?: string; + /** + * Information about metrics for the monitoring account + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly metrics?: MonitoringAccountMetrics; + /** + * The provisioning state of the monitoring account. 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?: MonitoringAccountDefaultIngestionSettings; +} + +/** Information about metrics for the monitoring account */ +export interface Metrics { + /** + * The Prometheus query endpoint for the monitoring account + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly prometheusQueryEndpoint?: string; + /** + * An internal identifier for the metrics container. Only to be used by the system + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly internalId?: string; +} + +/** Settings for data ingestion */ +export interface IngestionSettings { + /** + * The Azure resource Id of the default data collection rule for this monitoring account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly dataCollectionRuleResourceId?: string; + /** + * The Azure resource Id of the default data collection endpoint for this monitoring account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly dataCollectionEndpointResourceId?: 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; + /** + * 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?: 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[]; +} + +/** Definition of ARM tracked top level resource properties for update operation */ +export interface MonitoringAccountResourceForUpdate { + /** 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 OperationListResultAutoGenerated { + /** + * List of operations supported by the resource provider + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: OperationAutoGenerated[]; + /** + * URL to get the next set of operation list results (if there are any). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface OperationAutoGenerated { + /** + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplayAutoGenerated; + /** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly origin?: Origin; + /** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly actionType?: ActionType; +} + +/** Localized display information for this particular operation. */ +export interface OperationDisplayAutoGenerated { + /** + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provider?: string; + /** + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resource?: string; + /** + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operation?: string; + /** + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; +} + /** The claims for a rule management event data source. */ export interface RuleManagementEventClaimsDataSource { /** the email address. */ @@ -2232,56 +2636,6 @@ export interface DynamicThresholdFailingPeriods { minFailingPeriodsToAlert: number; } -/** The condition that results in the Log Search rule. */ -export interface TriggerCondition { - /** Evaluation operation for rule - 'GreaterThan' or 'LessThan. */ - thresholdOperator: ConditionalOperator; - /** Result or count threshold based on which rule should be triggered. */ - threshold: number; - /** Trigger condition for metric query rule */ - metricTrigger?: LogMetricTrigger; -} - -/** A log metrics trigger descriptor. */ -export interface LogMetricTrigger { - /** Evaluation operation for Metric -'GreaterThan' or 'LessThan' or 'Equal'. */ - thresholdOperator?: ConditionalOperator; - /** The threshold of the metric trigger. */ - threshold?: number; - /** Metric Trigger Type - 'Consecutive' or 'Total' */ - metricTriggerType?: MetricTriggerType; - /** Evaluation of metric on a particular column */ - metricColumn?: string; -} - -/** Azure action group */ -export interface AzNsActionGroup { - /** Azure Action Group reference. */ - actionGroup?: string[]; - /** Custom subject override for all email ids in Azure action group */ - emailSubject?: string; - /** Custom payload to be sent for all webhook URI in Azure action group */ - customWebhookPayload?: string; -} - -/** Specifies the criteria for converting log to metric. */ -export interface Dimension { - /** Name of the dimension */ - name: string; - /** Operator for dimension values */ - operator: Operator; - /** List of dimension values */ - values: string[]; -} - -/** Specifies the criteria for converting log to metric. */ -export interface Criteria { - /** Name of the metric */ - metricName: string; - /** List of Dimensions for creating metric */ - dimensions?: Dimension[]; -} - /** The autoscale setting resource. */ export interface AutoscaleSettingResource extends Resource { /** the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified. */ @@ -2609,66 +2963,6 @@ export interface MetricAlertResource extends ResourceAutoGenerated4 { readonly isMigrated?: boolean; } -/** Specify action need to be taken when rule type is Alert */ -export interface AlertingAction extends Action { - /** Polymorphic discriminator, which specifies the different types this object can be */ - odataType: "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction"; - /** Severity of the alert */ - severity: AlertSeverity; - /** Azure action group reference. */ - aznsAction?: AzNsActionGroup; - /** time (in minutes) for which Alerts should be throttled or suppressed. */ - throttlingInMin?: number; - /** The trigger condition that results in the alert rule being. */ - trigger: TriggerCondition; -} - -/** Specify action need to be taken when rule type is converting log to metric */ -export interface LogToMetricAction extends Action { - /** Polymorphic discriminator, which specifies the different types this object can be */ - odataType: "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction"; - /** Criteria of Metric */ - criteria: Criteria[]; -} - -/** The Log Search Rule resource. */ -export interface LogSearchRuleResource extends ResourceAutoGenerated5 { - /** - * 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 Log Search rule. */ - description?: string; - /** The display name of the alert rule */ - displayName?: string; - /** The flag that indicates whether the alert should be automatically resolved or not. The default is false. */ - autoMitigate?: boolean; - /** The flag which indicates whether the Log Search rule is enabled. Value should be true or false */ - enabled?: Enabled; - /** - * Last time the rule was updated in IS08601 format. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly lastUpdatedTime?: Date; - /** - * Provisioning state of the scheduled query rule - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningState; - /** Data Source against which rule will Query Data */ - source: Source; - /** Schedule (Frequency, Time Window) for rule. Required for action type - AlertingAction */ - schedule?: Schedule; - /** Action needs to be taken on rule execution. */ - action: ActionUnion; -} - /** 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. */ @@ -2758,6 +3052,25 @@ export interface DataCollectionRuleDestinations extends DestinationsSpec {} export interface DestinationsSpecAzureMonitorMetrics extends AzureMonitorMetricsDestination {} +/** Resource properties */ +export interface MonitoringAccountResourceProperties + extends MonitoringAccount {} + +/** Information about metrics for the monitoring account */ +export interface MonitoringAccountMetrics extends Metrics {} + +/** The Data Collection Rule and Endpoint used for ingestion by default. */ +export interface MonitoringAccountDefaultIngestionSettings + extends IngestionSettings {} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResourceAutoGenerated extends ResourceAutoGenerated5 { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +} + /** Criterion to filter metrics. */ export interface MetricCriteria extends MultiMetricCriteria { /** Polymorphic discriminator, which specifies the different types this object can be */ @@ -2793,30 +3106,60 @@ export interface AzureMonitorPrivateLinkScope extends TrackedResource { * 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; + 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?: PrivateEndpointConnection[]; + /** 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; +} + +/** A Monitoring Account definition */ +export interface MonitoringAccountResource + extends TrackedResourceAutoGenerated { + /** + * Resource entity tag (ETag) + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly etag?: string; + /** + * The immutable ID of the monitoring account. This property is read-only. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly accountId?: string; /** - * List of private endpoint connections. + * Information about metrics for the monitoring account * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly privateEndpointConnections?: PrivateEndpointConnection[]; - /** Access mode settings */ - accessModeSettings: AccessModeSettings; -} - -/** A private link scoped resource */ -export interface ScopedResource extends ProxyResourceAutoGenerated { + readonly metrics?: MonitoringAccountMetrics; /** - * System data + * The provisioning state of the monitoring account. Set to Succeeded if everything is healthy. * 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; + readonly provisioningState?: ProvisioningState; /** - * State of the private endpoint connection. + * 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 provisioningState?: string; + readonly defaultIngestionSettings?: MonitoringAccountDefaultIngestionSettings; } /** Defines headers for ActionGroups_postTestNotifications operation. */ @@ -3017,62 +3360,116 @@ export enum KnownOdatatype { */ export type Odatatype = string; -/** Known values of {@link Enabled} that the service accepts. */ -export enum KnownEnabled { - /** True */ - True = "true", - /** False */ - False = "false" +/** Known values of {@link Kind} that the service accepts. */ +export enum KnownKind { + /** LogAlert */ + LogAlert = "LogAlert", + /** LogToMetric */ + LogToMetric = "LogToMetric" } /** - * Defines values for Enabled. \ - * {@link KnownEnabled} can be used interchangeably with Enabled, + * 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 - * **true** \ - * **false** + * **LogAlert** \ + * **LogToMetric** */ -export type Enabled = string; +export type Kind = string; -/** Known values of {@link ProvisioningState} that the service accepts. */ -export enum KnownProvisioningState { - /** Succeeded */ - Succeeded = "Succeeded", - /** Deploying */ - Deploying = "Deploying", - /** Canceled */ - Canceled = "Canceled", - /** Failed */ - Failed = "Failed" +/** 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 ProvisioningState. \ - * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * 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 - * **Succeeded** \ - * **Deploying** \ - * **Canceled** \ - * **Failed** + * **0** \ + * **1** \ + * **2** \ + * **3** \ + * **4** */ -export type ProvisioningState = string; +export type AlertSeverity = number; + +/** Known values of {@link PublicNetworkAccess} that the service accepts. */ +export enum KnownPublicNetworkAccess { + /** Enabled */ + Enabled = "Enabled", + /** Disabled */ + Disabled = "Disabled", + /** SecuredByPerimeter */ + SecuredByPerimeter = "SecuredByPerimeter" +} + +/** + * Defines values for PublicNetworkAccess. \ + * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** \ + * **SecuredByPerimeter** + */ +export type PublicNetworkAccess = string; + +/** Known values of {@link TimeAggregation} that the service accepts. */ +export enum KnownTimeAggregation { + /** Count */ + 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 QueryType} that the service accepts. */ -export enum KnownQueryType { - /** ResultCount */ - ResultCount = "ResultCount" +/** Known values of {@link DimensionOperator} that the service accepts. */ +export enum KnownDimensionOperator { + /** Include */ + Include = "Include", + /** Exclude */ + Exclude = "Exclude" } /** - * Defines values for QueryType. \ - * {@link KnownQueryType} can be used interchangeably with QueryType, + * 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 - * **ResultCount** + * **Include** \ + * **Exclude** */ -export type QueryType = string; +export type DimensionOperator = string; /** Known values of {@link NamespaceClassification} that the service accepts. */ export enum KnownNamespaceClassification { @@ -3638,6 +4035,69 @@ export enum KnownKnownDataCollectionRuleResourceKind { */ export type KnownDataCollectionRuleResourceKind = string; +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + /** Creating */ + Creating = "Creating", + /** Succeeded */ + Succeeded = "Succeeded", + /** Deleting */ + Deleting = "Deleting", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled" +} + +/** + * Defines values for ProvisioningState. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Creating** \ + * **Succeeded** \ + * **Deleting** \ + * **Failed** \ + * **Canceled** + */ +export type ProvisioningState = string; + +/** Known values of {@link Origin} that the service accepts. */ +export enum KnownOrigin { + /** User */ + User = "user", + /** System */ + System = "system", + /** UserSystem */ + UserSystem = "user,system" +} + +/** + * Defines values for Origin. \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user** \ + * **system** \ + * **user,system** + */ +export type Origin = string; + +/** Known values of {@link ActionType} that the service accepts. */ +export enum KnownActionType { + /** Internal */ + Internal = "Internal" +} + +/** + * Defines values for ActionType. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal** + */ +export type ActionType = string; + /** Known values of {@link Operator} that the service accepts. */ export enum KnownOperator { /** Equals */ @@ -3649,9 +4109,7 @@ export enum KnownOperator { /** LessThan */ LessThan = "LessThan", /** LessThanOrEqual */ - LessThanOrEqual = "LessThanOrEqual", - /** Include */ - Include = "Include" + LessThanOrEqual = "LessThanOrEqual" } /** @@ -3663,8 +4121,7 @@ export enum KnownOperator { * **GreaterThan** \ * **GreaterThanOrEqual** \ * **LessThan** \ - * **LessThanOrEqual** \ - * **Include** + * **LessThanOrEqual** */ export type Operator = string; @@ -3754,78 +4211,6 @@ export enum KnownDynamicThresholdSensitivity { * **High** */ export type DynamicThresholdSensitivity = string; - -/** Known values of {@link ConditionalOperator} that the service accepts. */ -export enum KnownConditionalOperator { - /** GreaterThanOrEqual */ - GreaterThanOrEqual = "GreaterThanOrEqual", - /** LessThanOrEqual */ - LessThanOrEqual = "LessThanOrEqual", - /** GreaterThan */ - GreaterThan = "GreaterThan", - /** LessThan */ - LessThan = "LessThan", - /** Equal */ - Equal = "Equal" -} - -/** - * Defines values for ConditionalOperator. \ - * {@link KnownConditionalOperator} can be used interchangeably with ConditionalOperator, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **GreaterThanOrEqual** \ - * **LessThanOrEqual** \ - * **GreaterThan** \ - * **LessThan** \ - * **Equal** - */ -export type ConditionalOperator = string; - -/** Known values of {@link MetricTriggerType} that the service accepts. */ -export enum KnownMetricTriggerType { - /** Consecutive */ - Consecutive = "Consecutive", - /** Total */ - Total = "Total" -} - -/** - * Defines values for MetricTriggerType. \ - * {@link KnownMetricTriggerType} can be used interchangeably with MetricTriggerType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Consecutive** \ - * **Total** - */ -export type MetricTriggerType = 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 = string; /** Defines values for MetricStatisticType. */ export type MetricStatisticType = "Average" | "Min" | "Max" | "Sum" | "Count"; /** Defines values for TimeAggregationType. */ @@ -3886,12 +4271,15 @@ export type AggregationType = | "Total"; /** Defines values for ResultType. */ export type ResultType = "Data" | "Metadata"; +/** Defines values for IdentityType. */ +export type IdentityType = "SystemAssigned" | "UserAssigned" | "None"; /** Defines values for ConditionOperator. */ export type ConditionOperator = | "GreaterThan" | "GreaterThanOrEqual" | "LessThan" - | "LessThanOrEqual"; + | "LessThanOrEqual" + | "Equals"; /** Defines values for TimeAggregationOperator. */ export type TimeAggregationOperator = | "Average" @@ -4203,10 +4591,7 @@ export type ActivityLogsListResponse = EventDataCollection; /** Optional parameters. */ export interface ActivityLogsListNextOptionalParams - 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; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type ActivityLogsListNextResponse = EventDataCollection; @@ -4232,12 +4617,7 @@ export type TenantActivityLogsListResponse = EventDataCollection; /** Optional parameters. */ export interface TenantActivityLogsListNextOptionalParams - 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; - /** 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; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type TenantActivityLogsListNextResponse = EventDataCollection; @@ -4363,49 +4743,57 @@ export interface MetricAlertsStatusListByNameOptionalParams export type MetricAlertsStatusListByNameResponse = MetricAlertStatusCollection; /** Optional parameters. */ -export interface ScheduledQueryRulesCreateOrUpdateOptionalParams +export interface ScheduledQueryRulesListBySubscriptionOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the createOrUpdate operation. */ -export type ScheduledQueryRulesCreateOrUpdateResponse = LogSearchRuleResource; +/** 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 = LogSearchRuleResource; +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 = LogSearchRuleResource; +export type ScheduledQueryRulesUpdateResponse = ScheduledQueryRuleResource; /** Optional parameters. */ export interface ScheduledQueryRulesDeleteOptionalParams extends coreClient.OperationOptions {} /** Optional parameters. */ -export interface ScheduledQueryRulesListBySubscriptionOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. For more information please see https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx */ - filter?: string; -} +export interface ScheduledQueryRulesListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the listBySubscription operation. */ -export type ScheduledQueryRulesListBySubscriptionResponse = LogSearchRuleResourceCollection; +/** Contains response data for the listBySubscriptionNext operation. */ +export type ScheduledQueryRulesListBySubscriptionNextResponse = ScheduledQueryRuleResourceCollection; /** Optional parameters. */ -export interface ScheduledQueryRulesListByResourceGroupOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. For more information please see https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx */ - filter?: string; -} +export interface ScheduledQueryRulesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the listByResourceGroup operation. */ -export type ScheduledQueryRulesListByResourceGroupResponse = LogSearchRuleResourceCollection; +/** Contains response data for the listByResourceGroupNext operation. */ +export type ScheduledQueryRulesListByResourceGroupNextResponse = ScheduledQueryRuleResourceCollection; /** Optional parameters. */ export interface MetricNamespacesListOptionalParams @@ -4814,6 +5202,76 @@ export interface DataCollectionRulesListBySubscriptionNextOptionalParams /** Contains response data for the listBySubscriptionNext operation. */ export type DataCollectionRulesListBySubscriptionNextResponse = DataCollectionRuleResourceListResult; +/** Optional parameters. */ +export interface MonitoringAccountsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type MonitoringAccountsListByResourceGroupResponse = MonitoringAccountResourceListResult; + +/** Optional parameters. */ +export interface MonitoringAccountsListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type MonitoringAccountsListBySubscriptionResponse = MonitoringAccountResourceListResult; + +/** Optional parameters. */ +export interface MonitoringAccountsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type MonitoringAccountsGetResponse = MonitoringAccountResource; + +/** Optional parameters. */ +export interface MonitoringAccountsCreateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the create operation. */ +export type MonitoringAccountsCreateResponse = MonitoringAccountResource; + +/** Optional parameters. */ +export interface MonitoringAccountsUpdateOptionalParams + extends coreClient.OperationOptions { + /** The payload */ + monitoringAccountProperties?: MonitoringAccountResourceForUpdate; +} + +/** Contains response data for the update operation. */ +export type MonitoringAccountsUpdateResponse = MonitoringAccountResource; + +/** Optional parameters. */ +export interface MonitoringAccountsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface MonitoringAccountsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type MonitoringAccountsListByResourceGroupNextResponse = MonitoringAccountResourceListResult; + +/** Optional parameters. */ +export interface MonitoringAccountsListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type MonitoringAccountsListBySubscriptionNextResponse = MonitoringAccountResourceListResult; + +/** Optional parameters. */ +export interface MonitorOperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the operationsList operation. */ +export type MonitorOperationsListResponse = OperationListResultAutoGenerated; + +/** Optional parameters. */ +export interface MonitorOperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the operationsListNext operation. */ +export type MonitorOperationsListNextResponse = OperationListResultAutoGenerated; + /** Optional parameters. */ export interface MonitorClientOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/monitor/arm-monitor/src/models/mappers.ts b/sdk/monitor/arm-monitor/src/models/mappers.ts index 8ae6e60b3dc3..e41092ded87f 100644 --- a/sdk/monitor/arm-monitor/src/models/mappers.ts +++ b/sdk/monitor/arm-monitor/src/models/mappers.ts @@ -3601,81 +3601,26 @@ export const MetricAlertStatusProperties: coreClient.CompositeMapper = { } }; -export const Source: coreClient.CompositeMapper = { +export const ScheduledQueryRuleResourceCollection: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Source", + className: "ScheduledQueryRuleResourceCollection", modelProperties: { - query: { - serializedName: "query", - type: { - name: "String" - } - }, - authorizedResources: { - serializedName: "authorizedResources", + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "ScheduledQueryRuleResource" } } } }, - dataSourceId: { - serializedName: "dataSourceId", - required: true, - type: { - name: "String" - } - }, - queryType: { - serializedName: "queryType", - type: { - name: "String" - } - } - } - } -}; - -export const Schedule: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Schedule", - modelProperties: { - frequencyInMinutes: { - serializedName: "frequencyInMinutes", - required: true, - type: { - name: "Number" - } - }, - timeWindowInMinutes: { - serializedName: "timeWindowInMinutes", - required: true, - type: { - name: "Number" - } - } - } - } -}; - -export const Action: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Action", - uberParent: "Action", - polymorphicDiscriminator: { - serializedName: "odata\\.type", - clientName: "odataType" - }, - modelProperties: { - odataType: { - serializedName: "odata\\.type", - required: true, + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { name: "String" } @@ -3684,10 +3629,10 @@ export const Action: coreClient.CompositeMapper = { } }; -export const ResourceAutoGenerated5: coreClient.CompositeMapper = { +export const ScheduledQueryRuleResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceAutoGenerated5", + className: "ScheduledQueryRuleResource", modelProperties: { id: { serializedName: "id", @@ -3710,11 +3655,11 @@ export const ResourceAutoGenerated5: coreClient.CompositeMapper = { name: "String" } }, - location: { - serializedName: "location", - required: true, + identity: { + serializedName: "identity", type: { - name: "String" + name: "Composite", + className: "Identity" } }, tags: { @@ -3724,9 +3669,15 @@ export const ResourceAutoGenerated5: coreClient.CompositeMapper = { value: { type: { name: "String" } } } }, + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + }, kind: { serializedName: "kind", - readOnly: true, type: { name: "String" } @@ -3737,297 +3688,308 @@ export const ResourceAutoGenerated5: coreClient.CompositeMapper = { type: { name: "String" } - } - } - } -}; - -export const ErrorContract: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorContract", - modelProperties: { - error: { - serializedName: "error", + }, + systemData: { + serializedName: "systemData", type: { name: "Composite", - className: "ErrorResponse" + className: "SystemData" } - } - } - } -}; - -export const LogSearchRuleResourcePatch: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LogSearchRuleResourcePatch", - modelProperties: { - tags: { - serializedName: "tags", + }, + createdWithApiVersion: { + serializedName: "properties.createdWithApiVersion", + readOnly: true, type: { - name: "Dictionary", - value: { type: { name: "String" } } + 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" + } + }, + publicNetworkAccess: { + defaultValue: "Enabled", + serializedName: "properties.publicNetworkAccess", type: { name: "String" } - } - } - } -}; - -export const LogSearchRuleResourceCollection: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LogSearchRuleResourceCollection", - modelProperties: { - value: { - serializedName: "value", + }, + scopes: { + serializedName: "properties.scopes", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "LogSearchRuleResource" + name: "String" } } } - } - } - } -}; - -export const MetricNamespaceCollection: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MetricNamespaceCollection", - modelProperties: { - value: { - serializedName: "value", - required: true, + }, + 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: "Composite", - className: "MetricNamespace" + name: "String" } } } - } - } - } -}; - -export const MetricNamespace: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MetricNamespace", - modelProperties: { - id: { - serializedName: "id", + }, + criteria: { + serializedName: "properties.criteria", type: { - name: "String" + name: "Composite", + className: "ScheduledQueryRuleCriteria" } }, - type: { - serializedName: "type", + muteActionsDuration: { + serializedName: "properties.muteActionsDuration", type: { - name: "String" + name: "TimeSpan" } }, - name: { - serializedName: "name", + actions: { + serializedName: "properties.actions", type: { - name: "String" + name: "Composite", + className: "Actions" } }, - classification: { - serializedName: "classification", + isWorkspaceAlertsStorageConfigured: { + serializedName: "properties.isWorkspaceAlertsStorageConfigured", + readOnly: true, type: { - name: "String" + name: "Boolean" } }, - properties: { - serializedName: "properties", + 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: "MetricNamespaceName" + className: "RuleResolveConfiguration" } } } } }; -export const MetricNamespaceName: coreClient.CompositeMapper = { +export const Identity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricNamespaceName", + className: "Identity", modelProperties: { - metricNamespaceName: { - serializedName: "metricNamespaceName", + 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 DataContainer: coreClient.CompositeMapper = { +export const UserIdentityProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataContainer", + className: "UserIdentityProperties", modelProperties: { - workspace: { - serializedName: "workspace", + principalId: { + serializedName: "principalId", + readOnly: true, type: { - name: "Composite", - className: "WorkspaceInfo" + name: "String" + } + }, + clientId: { + serializedName: "clientId", + readOnly: true, + type: { + name: "String" } } } } }; -export const WorkspaceInfo: coreClient.CompositeMapper = { +export const ScheduledQueryRuleCriteria: coreClient.CompositeMapper = { type: { name: "Composite", - className: "WorkspaceInfo", + className: "ScheduledQueryRuleCriteria", modelProperties: { - id: { - serializedName: "id", - required: true, - type: { - name: "String" - } - }, - location: { - serializedName: "location", - required: true, - type: { - name: "String" - } - }, - customerId: { - serializedName: "properties.customerId", - required: true, + allOf: { + serializedName: "allOf", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Condition" + } + } } } } } }; -export const ProxyResource: coreClient.CompositeMapper = { +export const Condition: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ProxyResource", + className: "Condition", modelProperties: { - id: { - serializedName: "id", - readOnly: true, + query: { + serializedName: "query", type: { name: "String" } }, - name: { - serializedName: "name", - readOnly: true, + timeAggregation: { + serializedName: "timeAggregation", 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, + metricMeasureColumn: { + serializedName: "metricMeasureColumn", type: { name: "String" } }, - message: { - serializedName: "message", + resourceIdColumn: { + serializedName: "resourceIdColumn", type: { name: "String" } - } - } - } -}; - -export const AzureMonitorPrivateLinkScopeListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AzureMonitorPrivateLinkScopeListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, + }, + dimensions: { + serializedName: "dimensions", type: { name: "Sequence", element: { type: { name: "Composite", - className: "AzureMonitorPrivateLinkScope" + className: "Dimension" } } } }, - nextLink: { - serializedName: "nextLink", + operator: { + serializedName: "operator", type: { - name: "String" + name: "Enum", + allowedValues: [ + "GreaterThan", + "GreaterThanOrEqual", + "LessThan", + "LessThanOrEqual", + "Equals" + ] } - } - } - } -}; - -export const PrivateEndpoint: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpoint", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, + }, + threshold: { + serializedName: "threshold", + type: { + name: "Number" + } + }, + failingPeriods: { + serializedName: "failingPeriods", + type: { + name: "Composite", + className: "ConditionFailingPeriods" + } + }, + metricName: { + serializedName: "metricName", type: { name: "String" } @@ -4036,115 +3998,132 @@ export const PrivateEndpoint: coreClient.CompositeMapper = { } }; -export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { +export const Dimension: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateLinkServiceConnectionState", + className: "Dimension", modelProperties: { - status: { - serializedName: "status", + name: { + serializedName: "name", + required: true, type: { name: "String" } }, - description: { - serializedName: "description", + operator: { + serializedName: "operator", + required: true, type: { name: "String" } }, - actionsRequired: { - serializedName: "actionsRequired", + values: { + serializedName: "values", + required: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } } } } }; -export const AccessModeSettings: coreClient.CompositeMapper = { +export const ConditionFailingPeriods: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessModeSettings", + className: "ConditionFailingPeriods", modelProperties: { - queryAccessMode: { - serializedName: "queryAccessMode", - required: true, + numberOfEvaluationPeriods: { + defaultValue: 1, + serializedName: "numberOfEvaluationPeriods", type: { - name: "String" + name: "Number" } }, - ingestionAccessMode: { - serializedName: "ingestionAccessMode", - required: true, + minFailingPeriodsToAlert: { + defaultValue: 1, + serializedName: "minFailingPeriodsToAlert", type: { - name: "String" + name: "Number" } - }, - exclusions: { - serializedName: "exclusions", + } + } + } +}; + +export const Actions: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Actions", + modelProperties: { + actionGroups: { + serializedName: "actionGroups", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "AccessModeSettingsExclusion" + name: "String" } } } + }, + customProperties: { + serializedName: "customProperties", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } } } } }; -export const AccessModeSettingsExclusion: coreClient.CompositeMapper = { +export const RuleResolveConfiguration: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessModeSettingsExclusion", + className: "RuleResolveConfiguration", modelProperties: { - privateEndpointConnectionName: { - serializedName: "privateEndpointConnectionName", - type: { - name: "String" - } - }, - queryAccessMode: { - serializedName: "queryAccessMode", + autoResolved: { + serializedName: "autoResolved", type: { - name: "String" + name: "Boolean" } }, - ingestionAccessMode: { - serializedName: "ingestionAccessMode", + timeToResolve: { + serializedName: "timeToResolve", type: { - name: "String" + name: "TimeSpan" } } } } }; -export const DefaultErrorResponse: coreClient.CompositeMapper = { +export const ErrorContract: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DefaultErrorResponse", + className: "ErrorContract", modelProperties: { error: { serializedName: "error", type: { name: "Composite", - className: "ErrorDetail" + className: "ErrorResponseDetails" } } } } }; -export const ErrorDetail: coreClient.CompositeMapper = { +export const ErrorResponseDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorDetail", + className: "ErrorResponseDetails", modelProperties: { code: { serializedName: "code", @@ -4175,7 +4154,7 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorDetail" + className: "ErrorResponseDetails" } } } @@ -4188,7 +4167,7 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorAdditionalInfo" + className: "ErrorResponseAdditionalInfo" } } } @@ -4197,10 +4176,10 @@ export const ErrorDetail: coreClient.CompositeMapper = { } }; -export const ErrorAdditionalInfo: coreClient.CompositeMapper = { +export const ErrorResponseAdditionalInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorAdditionalInfo", + className: "ErrorResponseAdditionalInfo", modelProperties: { type: { serializedName: "type", @@ -4221,155 +4200,180 @@ export const ErrorAdditionalInfo: coreClient.CompositeMapper = { } }; -export const TagsResource: coreClient.CompositeMapper = { +export const ScheduledQueryRuleResourcePatch: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TagsResource", + className: "ScheduledQueryRuleResourcePatch", modelProperties: { + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity" + } + }, tags: { serializedName: "tags", type: { name: "Dictionary", value: { type: { name: "String" } } } - } - } - } -}; - -export const OperationStatus: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationStatus", - modelProperties: { - id: { - serializedName: "id", + }, + createdWithApiVersion: { + serializedName: "properties.createdWithApiVersion", + readOnly: true, type: { name: "String" } }, - name: { - serializedName: "name", + isLegacyLogAnalyticsRule: { + serializedName: "properties.isLegacyLogAnalyticsRule", + readOnly: true, + type: { + name: "Boolean" + } + }, + description: { + serializedName: "properties.description", type: { name: "String" } }, - startTime: { - serializedName: "startTime", - nullable: true, + displayName: { + serializedName: "properties.displayName", type: { - name: "DateTime" + name: "String" } }, - endTime: { - serializedName: "endTime", - nullable: true, + severity: { + serializedName: "properties.severity", type: { - name: "DateTime" + name: "Number" } }, - status: { - serializedName: "status", + enabled: { + serializedName: "properties.enabled", type: { - name: "String" + name: "Boolean" } }, - error: { - serializedName: "error", + publicNetworkAccess: { + defaultValue: "Enabled", + serializedName: "properties.publicNetworkAccess", type: { - name: "Composite", - className: "ErrorDetail" + name: "String" } - } - } - } -}; - -export const PrivateLinkResourceListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateLinkResourceListResult", - modelProperties: { - value: { - serializedName: "value", + }, + scopes: { + serializedName: "properties.scopes", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "PrivateLinkResource" + name: "String" } } } - } - } - } -}; - -export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpointConnectionListResult", - modelProperties: { - value: { - serializedName: "value", + }, + evaluationFrequency: { + serializedName: "properties.evaluationFrequency", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnection" - } - } + name: "TimeSpan" } - } - } - } -}; - -export const ScopedResourceListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ScopedResourceListResult", - modelProperties: { - value: { - serializedName: "value", - readOnly: true, + }, + windowSize: { + serializedName: "properties.windowSize", + type: { + name: "TimeSpan" + } + }, + overrideQueryTimeRange: { + serializedName: "properties.overrideQueryTimeRange", + type: { + name: "TimeSpan" + } + }, + targetResourceTypes: { + serializedName: "properties.targetResourceTypes", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "ScopedResource" + name: "String" } } } }, - nextLink: { - serializedName: "nextLink", + 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: "String" + 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 AlertRuleAllOfCondition: coreClient.CompositeMapper = { +export const MetricNamespaceCollection: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AlertRuleAllOfCondition", + className: "MetricNamespaceCollection", modelProperties: { - allOf: { - serializedName: "allOf", + value: { + serializedName: "value", required: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "AlertRuleAnyOfOrLeafCondition" + className: "MetricNamespace" } } } @@ -4378,86 +4382,111 @@ export const AlertRuleAllOfCondition: coreClient.CompositeMapper = { } }; -export const AlertRuleLeafCondition: coreClient.CompositeMapper = { +export const MetricNamespace: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AlertRuleLeafCondition", + className: "MetricNamespace", modelProperties: { - field: { - serializedName: "field", + id: { + serializedName: "id", type: { name: "String" } }, - equals: { - serializedName: "equals", + type: { + serializedName: "type", type: { name: "String" } }, - containsAny: { - serializedName: "containsAny", + name: { + serializedName: "name", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" + } + }, + classification: { + serializedName: "classification", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "MetricNamespaceName" } } } } }; -export const ActionList: coreClient.CompositeMapper = { +export const MetricNamespaceName: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ActionList", + className: "MetricNamespaceName", modelProperties: { - actionGroups: { - serializedName: "actionGroups", + metricNamespaceName: { + serializedName: "metricNamespaceName", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ActionGroup" - } - } + name: "String" } } } } }; -export const ActionGroup: coreClient.CompositeMapper = { +export const DataContainer: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ActionGroup", + className: "DataContainer", modelProperties: { - actionGroupId: { - serializedName: "actionGroupId", + 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" } }, - webhookProperties: { - serializedName: "webhookProperties", + location: { + serializedName: "location", + required: true, type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" + } + }, + customerId: { + serializedName: "properties.customerId", + required: true, + type: { + name: "String" } } } } }; -export const AzureResourceAutoGenerated: coreClient.CompositeMapper = { +export const ProxyResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureResourceAutoGenerated", + className: "ProxyResource", modelProperties: { id: { serializedName: "id", @@ -4479,84 +4508,63 @@ export const AzureResourceAutoGenerated: coreClient.CompositeMapper = { type: { name: "String" } - }, - location: { - defaultValue: "global", - serializedName: "location", - type: { - name: "String" - } - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } } } } }; -export const ErrorResponseAutoGenerated: coreClient.CompositeMapper = { +export const ResponseWithError: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorResponseAutoGenerated", + className: "ResponseWithError", modelProperties: { - code: { - serializedName: "code", - readOnly: true, - type: { - name: "String" - } - }, - message: { - serializedName: "message", - readOnly: true, + error: { + serializedName: "error", type: { - name: "String" + name: "Composite", + className: "ErrorModel" } } } } }; -export const AlertRulePatchObject: coreClient.CompositeMapper = { +export const ErrorModel: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AlertRulePatchObject", + className: "ErrorModel", modelProperties: { - tags: { - serializedName: "tags", + code: { + serializedName: "code", + required: true, type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" } }, - enabled: { - defaultValue: true, - serializedName: "properties.enabled", + message: { + serializedName: "message", type: { - name: "Boolean" + name: "String" } } } } }; -export const AlertRuleList: coreClient.CompositeMapper = { +export const AzureMonitorPrivateLinkScopeListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AlertRuleList", + className: "AzureMonitorPrivateLinkScopeListResult", modelProperties: { value: { serializedName: "value", + required: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "ActivityLogAlertResource" + className: "AzureMonitorPrivateLinkScope" } } } @@ -4571,26 +4579,14 @@ export const AlertRuleList: coreClient.CompositeMapper = { } }; -export const DataCollectionEndpointResourceListResult: coreClient.CompositeMapper = { +export const PrivateEndpoint: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataCollectionEndpointResourceListResult", + className: "PrivateEndpoint", modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DataCollectionEndpointResource" - } - } - } - }, - nextLink: { - serializedName: "nextLink", + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } @@ -4599,258 +4595,318 @@ export const DataCollectionEndpointResourceListResult: coreClient.CompositeMappe } }; -export const DataCollectionEndpointResource: coreClient.CompositeMapper = { +export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataCollectionEndpointResource", + className: "PrivateLinkServiceConnectionState", modelProperties: { - location: { - serializedName: "location", - required: true, - type: { - name: "String" - } - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - }, - kind: { - serializedName: "kind", + status: { + serializedName: "status", type: { name: "String" } }, - id: { - serializedName: "id", - readOnly: true, + description: { + serializedName: "description", type: { name: "String" } }, - name: { - serializedName: "name", - readOnly: true, + actionsRequired: { + serializedName: "actionsRequired", type: { name: "String" } - }, - type: { - serializedName: "type", - readOnly: true, + } + } + } +}; + +export const AccessModeSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccessModeSettings", + modelProperties: { + queryAccessMode: { + serializedName: "queryAccessMode", + required: true, type: { name: "String" } }, - etag: { - serializedName: "etag", - readOnly: true, + ingestionAccessMode: { + serializedName: "ingestionAccessMode", + required: true, type: { name: "String" } }, - systemData: { - serializedName: "systemData", + exclusions: { + serializedName: "exclusions", type: { - name: "Composite", - className: "DataCollectionEndpointResourceSystemData" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AccessModeSettingsExclusion" + } + } } - }, - description: { - serializedName: "properties.description", + } + } + } +}; + +export const AccessModeSettingsExclusion: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccessModeSettingsExclusion", + modelProperties: { + privateEndpointConnectionName: { + serializedName: "privateEndpointConnectionName", type: { name: "String" } }, - immutableId: { - serializedName: "properties.immutableId", + queryAccessMode: { + serializedName: "queryAccessMode", type: { name: "String" } }, - configurationAccess: { - serializedName: "properties.configurationAccess", - type: { - name: "Composite", - className: "DataCollectionEndpointConfigurationAccess" - } - }, - logsIngestion: { - serializedName: "properties.logsIngestion", + ingestionAccessMode: { + serializedName: "ingestionAccessMode", type: { - name: "Composite", - className: "DataCollectionEndpointLogsIngestion" + name: "String" } - }, - networkAcls: { - serializedName: "properties.networkAcls", + } + } + } +}; + +export const DefaultErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DefaultErrorResponse", + modelProperties: { + error: { + serializedName: "error", type: { name: "Composite", - className: "DataCollectionEndpointNetworkAcls" - } - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String" + className: "ErrorDetail" } } } } }; -export const DataCollectionEndpoint: coreClient.CompositeMapper = { +export const ErrorDetail: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataCollectionEndpoint", + className: "ErrorDetail", modelProperties: { - description: { - serializedName: "description", + code: { + serializedName: "code", + readOnly: true, type: { name: "String" } }, - immutableId: { - serializedName: "immutableId", + message: { + serializedName: "message", + readOnly: true, type: { name: "String" } }, - configurationAccess: { - serializedName: "configurationAccess", - type: { - name: "Composite", - className: "DataCollectionEndpointConfigurationAccess" - } - }, - logsIngestion: { - serializedName: "logsIngestion", + target: { + serializedName: "target", + readOnly: true, type: { - name: "Composite", - className: "DataCollectionEndpointLogsIngestion" + name: "String" } }, - networkAcls: { - serializedName: "networkAcls", + details: { + serializedName: "details", + readOnly: true, type: { - name: "Composite", - className: "DataCollectionEndpointNetworkAcls" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } } }, - provisioningState: { - serializedName: "provisioningState", + additionalInfo: { + serializedName: "additionalInfo", readOnly: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } } } } } }; -export const ConfigurationAccessEndpointSpec: coreClient.CompositeMapper = { +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ConfigurationAccessEndpointSpec", + className: "ErrorAdditionalInfo", modelProperties: { - endpoint: { - serializedName: "endpoint", + type: { + serializedName: "type", readOnly: true, type: { name: "String" } + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } } } } }; -export const LogsIngestionEndpointSpec: coreClient.CompositeMapper = { +export const TagsResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LogsIngestionEndpointSpec", + className: "TagsResource", modelProperties: { - endpoint: { - serializedName: "endpoint", - readOnly: true, + tags: { + serializedName: "tags", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const NetworkRuleSet: coreClient.CompositeMapper = { +export const OperationStatus: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NetworkRuleSet", + className: "OperationStatus", modelProperties: { - publicNetworkAccess: { - serializedName: "publicNetworkAccess", + 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: "ErrorDetail" + } } } } }; -export const ErrorResponseCommonV2: coreClient.CompositeMapper = { +export const PrivateLinkResourceListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorResponseCommonV2", + className: "PrivateLinkResourceListResult", modelProperties: { - error: { - serializedName: "error", + value: { + serializedName: "value", type: { - name: "Composite", - className: "ErrorDetail" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateLinkResource" + } + } } } } } }; -export const ResourceForUpdate: coreClient.CompositeMapper = { +export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceForUpdate", + className: "PrivateEndpointConnectionListResult", modelProperties: { - tags: { - serializedName: "tags", + value: { + serializedName: "value", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } } } } } }; -export const DataCollectionRuleAssociationProxyOnlyResourceListResult: coreClient.CompositeMapper = { +export const ScopedResourceListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataCollectionRuleAssociationProxyOnlyResourceListResult", + className: "ScopedResourceListResult", modelProperties: { value: { serializedName: "value", - required: true, + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "DataCollectionRuleAssociationProxyOnlyResource" + className: "ScopedResource" } } } }, nextLink: { serializedName: "nextLink", + readOnly: true, type: { name: "String" } @@ -4859,131 +4915,213 @@ export const DataCollectionRuleAssociationProxyOnlyResourceListResult: coreClien } }; -export const DataCollectionRuleAssociationProxyOnlyResource: coreClient.CompositeMapper = { +export const AlertRuleAllOfCondition: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataCollectionRuleAssociationProxyOnlyResource", + className: "AlertRuleAllOfCondition", modelProperties: { - id: { - serializedName: "id", - readOnly: true, + allOf: { + serializedName: "allOf", + required: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AlertRuleAnyOfOrLeafCondition" + } + } } - }, - name: { - serializedName: "name", - readOnly: true, + } + } + } +}; + +export const AlertRuleLeafCondition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AlertRuleLeafCondition", + modelProperties: { + field: { + serializedName: "field", type: { name: "String" } }, - type: { - serializedName: "type", - readOnly: true, + equals: { + serializedName: "equals", type: { name: "String" } }, - etag: { - serializedName: "etag", - readOnly: true, + 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" } }, - systemData: { - serializedName: "systemData", + webhookProperties: { + serializedName: "webhookProperties", type: { - name: "Composite", - className: "DataCollectionRuleAssociationProxyOnlyResourceSystemData" + name: "Dictionary", + value: { type: { name: "String" } } } - }, - description: { - serializedName: "properties.description", + } + } + } +}; + +export const AzureResourceAutoGenerated: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureResourceAutoGenerated", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - dataCollectionRuleId: { - serializedName: "properties.dataCollectionRuleId", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - dataCollectionEndpointId: { - serializedName: "properties.dataCollectionEndpointId", + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, + location: { + defaultValue: "global", + serializedName: "location", type: { name: "String" } }, - metadata: { - serializedName: "properties.metadata", + tags: { + serializedName: "tags", type: { - name: "Composite", - className: "DataCollectionRuleAssociationMetadata" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const DataCollectionRuleAssociation: coreClient.CompositeMapper = { +export const ErrorResponseAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataCollectionRuleAssociation", + className: "ErrorResponseAutoGenerated", modelProperties: { - description: { - serializedName: "description", + code: { + serializedName: "code", + readOnly: true, type: { name: "String" } }, - dataCollectionRuleId: { - serializedName: "dataCollectionRuleId", + message: { + serializedName: "message", + readOnly: true, type: { name: "String" } - }, - dataCollectionEndpointId: { - serializedName: "dataCollectionEndpointId", - type: { - name: "String" - } - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, + } + } + } +}; + +export const AlertRulePatchObject: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AlertRulePatchObject", + modelProperties: { + tags: { + serializedName: "tags", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } }, - metadata: { - serializedName: "metadata", + enabled: { + defaultValue: true, + serializedName: "properties.enabled", type: { - name: "Composite", - className: "DataCollectionRuleAssociationMetadata" + name: "Boolean" } } } } }; -export const Metadata: coreClient.CompositeMapper = { +export const AlertRuleList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Metadata", + className: "AlertRuleList", modelProperties: { - provisionedBy: { - serializedName: "provisionedBy", - readOnly: true, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ActivityLogAlertResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", type: { name: "String" } @@ -4992,10 +5130,10 @@ export const Metadata: coreClient.CompositeMapper = { } }; -export const DataCollectionRuleResourceListResult: coreClient.CompositeMapper = { +export const DataCollectionEndpointResourceListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataCollectionRuleResourceListResult", + className: "DataCollectionEndpointResourceListResult", modelProperties: { value: { serializedName: "value", @@ -5005,7 +5143,7 @@ export const DataCollectionRuleResourceListResult: coreClient.CompositeMapper = element: { type: { name: "Composite", - className: "DataCollectionRuleResource" + className: "DataCollectionEndpointResource" } } } @@ -5020,10 +5158,10 @@ export const DataCollectionRuleResourceListResult: coreClient.CompositeMapper = } }; -export const DataCollectionRuleResource: coreClient.CompositeMapper = { +export const DataCollectionEndpointResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataCollectionRuleResource", + className: "DataCollectionEndpointResource", modelProperties: { location: { serializedName: "location", @@ -5077,7 +5215,7 @@ export const DataCollectionRuleResource: coreClient.CompositeMapper = { serializedName: "systemData", type: { name: "Composite", - className: "DataCollectionRuleResourceSystemData" + className: "DataCollectionEndpointResourceSystemData" } }, description: { @@ -5088,55 +5226,29 @@ export const DataCollectionRuleResource: coreClient.CompositeMapper = { }, immutableId: { serializedName: "properties.immutableId", - readOnly: true, - type: { - name: "String" - } - }, - dataCollectionEndpointId: { - serializedName: "properties.dataCollectionEndpointId", type: { name: "String" } }, - metadata: { - serializedName: "properties.metadata", + configurationAccess: { + serializedName: "properties.configurationAccess", type: { name: "Composite", - className: "DataCollectionRuleMetadata" - } - }, - streamDeclarations: { - serializedName: "properties.streamDeclarations", - type: { - name: "Dictionary", - value: { type: { name: "Composite", className: "StreamDeclaration" } } + className: "DataCollectionEndpointConfigurationAccess" } }, - dataSources: { - serializedName: "properties.dataSources", + logsIngestion: { + serializedName: "properties.logsIngestion", type: { name: "Composite", - className: "DataCollectionRuleDataSources" + className: "DataCollectionEndpointLogsIngestion" } }, - destinations: { - serializedName: "properties.destinations", + networkAcls: { + serializedName: "properties.networkAcls", type: { name: "Composite", - className: "DataCollectionRuleDestinations" - } - }, - dataFlows: { - serializedName: "properties.dataFlows", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DataFlow" - } - } + className: "DataCollectionEndpointNetworkAcls" } }, provisioningState: { @@ -5150,10 +5262,10 @@ export const DataCollectionRuleResource: coreClient.CompositeMapper = { } }; -export const DataCollectionRule: coreClient.CompositeMapper = { +export const DataCollectionEndpoint: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataCollectionRule", + className: "DataCollectionEndpoint", modelProperties: { description: { serializedName: "description", @@ -5163,55 +5275,29 @@ export const DataCollectionRule: coreClient.CompositeMapper = { }, immutableId: { serializedName: "immutableId", - readOnly: true, - type: { - name: "String" - } - }, - dataCollectionEndpointId: { - serializedName: "dataCollectionEndpointId", type: { name: "String" } }, - metadata: { - serializedName: "metadata", + configurationAccess: { + serializedName: "configurationAccess", type: { name: "Composite", - className: "DataCollectionRuleMetadata" - } - }, - streamDeclarations: { - serializedName: "streamDeclarations", - type: { - name: "Dictionary", - value: { type: { name: "Composite", className: "StreamDeclaration" } } + className: "DataCollectionEndpointConfigurationAccess" } }, - dataSources: { - serializedName: "dataSources", + logsIngestion: { + serializedName: "logsIngestion", type: { name: "Composite", - className: "DataCollectionRuleDataSources" + className: "DataCollectionEndpointLogsIngestion" } }, - destinations: { - serializedName: "destinations", + networkAcls: { + serializedName: "networkAcls", type: { name: "Composite", - className: "DataCollectionRuleDestinations" - } - }, - dataFlows: { - serializedName: "dataFlows", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DataFlow" - } - } + className: "DataCollectionEndpointNetworkAcls" } }, provisioningState: { @@ -5225,40 +5311,45 @@ export const DataCollectionRule: coreClient.CompositeMapper = { } }; -export const StreamDeclaration: coreClient.CompositeMapper = { +export const ConfigurationAccessEndpointSpec: coreClient.CompositeMapper = { type: { name: "Composite", - className: "StreamDeclaration", + className: "ConfigurationAccessEndpointSpec", modelProperties: { - columns: { - serializedName: "columns", + endpoint: { + serializedName: "endpoint", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ColumnDefinition" - } - } + name: "String" } } } } }; -export const ColumnDefinition: coreClient.CompositeMapper = { +export const LogsIngestionEndpointSpec: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ColumnDefinition", + className: "LogsIngestionEndpointSpec", modelProperties: { - name: { - serializedName: "name", + endpoint: { + serializedName: "endpoint", + readOnly: true, type: { name: "String" } - }, - type: { - serializedName: "type", + } + } + } +}; + +export const NetworkRuleSet: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkRuleSet", + modelProperties: { + publicNetworkAccess: { + serializedName: "publicNetworkAccess", type: { name: "String" } @@ -5267,94 +5358,827 @@ export const ColumnDefinition: coreClient.CompositeMapper = { } }; -export const DataSourcesSpec: coreClient.CompositeMapper = { +export const ErrorResponseCommonV2: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataSourcesSpec", + className: "ErrorResponseCommonV2", modelProperties: { - performanceCounters: { - serializedName: "performanceCounters", + error: { + serializedName: "error", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PerfCounterDataSource" - } - } + name: "Composite", + className: "ErrorDetail" } - }, - windowsEventLogs: { - serializedName: "windowsEventLogs", + } + } + } +}; + +export const ResourceForUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceForUpdate", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const DataCollectionRuleAssociationProxyOnlyResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataCollectionRuleAssociationProxyOnlyResourceListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "WindowsEventLogDataSource" + className: "DataCollectionRuleAssociationProxyOnlyResource" } } } }, - syslog: { - serializedName: "syslog", + nextLink: { + serializedName: "nextLink", type: { - name: "Sequence", - element: { + 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 Metadata: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Metadata", + modelProperties: { + provisionedBy: { + serializedName: "provisionedBy", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const DataCollectionRuleResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + 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" + } + }, + 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: "SyslogDataSource" + className: "IisLogsDataSource" + } + } + } + } + } + } +}; + +export const PerfCounterDataSource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PerfCounterDataSource", + modelProperties: { + streams: { + serializedName: "streams", + type: { + name: "Sequence", + element: { + type: { + name: "String" } } } }, - extensions: { - serializedName: "extensions", + samplingFrequencyInSeconds: { + serializedName: "samplingFrequencyInSeconds", + type: { + name: "Number" + } + }, + counterSpecifiers: { + serializedName: "counterSpecifiers", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "ExtensionDataSource" + name: "String" } } } }, - logFiles: { - serializedName: "logFiles", + 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: "Composite", - className: "LogFilesDataSource" + name: "String" } } } }, - iisLogs: { - serializedName: "iisLogs", + xPathQueries: { + serializedName: "xPathQueries", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "IisLogsDataSource" + 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 PerfCounterDataSource: coreClient.CompositeMapper = { +export const IisLogsDataSource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PerfCounterDataSource", + className: "IisLogsDataSource", modelProperties: { streams: { serializedName: "streams", + required: true, type: { name: "Sequence", element: { @@ -5364,14 +6188,8 @@ export const PerfCounterDataSource: coreClient.CompositeMapper = { } } }, - samplingFrequencyInSeconds: { - serializedName: "samplingFrequencyInSeconds", - type: { - name: "Number" - } - }, - counterSpecifiers: { - serializedName: "counterSpecifiers", + logDirectories: { + serializedName: "logDirectories", type: { name: "Sequence", element: { @@ -5391,31 +6209,50 @@ export const PerfCounterDataSource: coreClient.CompositeMapper = { } }; -export const WindowsEventLogDataSource: coreClient.CompositeMapper = { +export const DestinationsSpec: coreClient.CompositeMapper = { type: { name: "Composite", - className: "WindowsEventLogDataSource", + className: "DestinationsSpec", modelProperties: { - streams: { - serializedName: "streams", + logAnalytics: { + serializedName: "logAnalytics", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "LogAnalyticsDestination" } } } }, - xPathQueries: { - serializedName: "xPathQueries", + azureMonitorMetrics: { + serializedName: "azureMonitorMetrics", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "Composite", + className: "DestinationsSpecAzureMonitorMetrics" + } + } + } + } +}; + +export const LogAnalyticsDestination: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LogAnalyticsDestination", + modelProperties: { + workspaceResourceId: { + serializedName: "workspaceResourceId", + type: { + name: "String" + } + }, + workspaceId: { + serializedName: "workspaceId", + readOnly: true, + type: { + name: "String" } }, name: { @@ -5428,10 +6265,25 @@ export const WindowsEventLogDataSource: coreClient.CompositeMapper = { } }; -export const SyslogDataSource: coreClient.CompositeMapper = { +export const AzureMonitorMetricsDestination: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SyslogDataSource", + className: "AzureMonitorMetricsDestination", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const DataFlow: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataFlow", modelProperties: { streams: { serializedName: "streams", @@ -5444,8 +6296,8 @@ export const SyslogDataSource: coreClient.CompositeMapper = { } } }, - facilityNames: { - serializedName: "facilityNames", + destinations: { + serializedName: "destinations", type: { name: "Sequence", element: { @@ -5455,19 +6307,14 @@ export const SyslogDataSource: coreClient.CompositeMapper = { } } }, - logLevels: { - serializedName: "logLevels", + transformKql: { + serializedName: "transformKql", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - name: { - serializedName: "name", + outputStream: { + serializedName: "outputStream", type: { name: "String" } @@ -5476,102 +6323,109 @@ export const SyslogDataSource: coreClient.CompositeMapper = { } }; -export const ExtensionDataSource: coreClient.CompositeMapper = { +export const MonitoringAccountResourceListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ExtensionDataSource", + className: "MonitoringAccountResourceListResult", modelProperties: { - streams: { - serializedName: "streams", + value: { + serializedName: "value", + required: true, type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "MonitoringAccountResource" } } } }, - extensionName: { - serializedName: "extensionName", - required: true, + nextLink: { + serializedName: "nextLink", type: { name: "String" } - }, - extensionSettings: { - serializedName: "extensionSettings", + } + } + } +}; + +export const MonitoringAccount: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoringAccount", + modelProperties: { + accountId: { + serializedName: "accountId", + readOnly: true, type: { - name: "Dictionary", - value: { type: { name: "any" } } + name: "String" } }, - inputDataSources: { - serializedName: "inputDataSources", + metrics: { + serializedName: "metrics", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "Composite", + className: "MonitoringAccountMetrics" } }, - name: { - serializedName: "name", + provisioningState: { + serializedName: "provisioningState", + readOnly: true, type: { name: "String" } + }, + defaultIngestionSettings: { + serializedName: "defaultIngestionSettings", + type: { + name: "Composite", + className: "MonitoringAccountDefaultIngestionSettings" + } } } } }; -export const LogFilesDataSource: coreClient.CompositeMapper = { +export const Metrics: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LogFilesDataSource", + className: "Metrics", modelProperties: { - streams: { - serializedName: "streams", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - filePatterns: { - serializedName: "filePatterns", - required: true, + prometheusQueryEndpoint: { + serializedName: "prometheusQueryEndpoint", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - format: { - serializedName: "format", - required: true, + internalId: { + serializedName: "internalId", + readOnly: true, type: { name: "String" } - }, - settings: { - serializedName: "settings", + } + } + } +}; + +export const IngestionSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IngestionSettings", + modelProperties: { + dataCollectionRuleResourceId: { + serializedName: "dataCollectionRuleResourceId", + readOnly: true, type: { - name: "Composite", - className: "LogFilesDataSourceSettings" + name: "String" } }, - name: { - serializedName: "name", + dataCollectionEndpointResourceId: { + serializedName: "dataCollectionEndpointResourceId", + readOnly: true, type: { name: "String" } @@ -5580,139 +6434,196 @@ export const LogFilesDataSource: coreClient.CompositeMapper = { } }; -export const LogFileSettings: coreClient.CompositeMapper = { +export const ResourceAutoGenerated5: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LogFileSettings", + className: "ResourceAutoGenerated5", modelProperties: { - text: { - serializedName: "text", + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + systemData: { + serializedName: "systemData", type: { name: "Composite", - className: "LogFileSettingsText" + className: "SystemData" } } } } }; -export const LogFileTextSettings: coreClient.CompositeMapper = { +export const ErrorResponseAutoGenerated2: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LogFileTextSettings", + className: "ErrorResponseAutoGenerated2", modelProperties: { - recordStartTimestampFormat: { - serializedName: "recordStartTimestampFormat", - required: true, + error: { + serializedName: "error", type: { - name: "String" + name: "Composite", + className: "ErrorDetailAutoGenerated" } } } } }; -export const IisLogsDataSource: coreClient.CompositeMapper = { +export const ErrorDetailAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IisLogsDataSource", + className: "ErrorDetailAutoGenerated", modelProperties: { - streams: { - serializedName: "streams", - required: true, + 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: "String" + name: "Composite", + className: "ErrorDetailAutoGenerated" } } } }, - logDirectories: { - serializedName: "logDirectories", + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "ErrorAdditionalInfo" } } } - }, - name: { - serializedName: "name", + } + } + } +}; + +export const MonitoringAccountResourceForUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoringAccountResourceForUpdate", + modelProperties: { + tags: { + serializedName: "tags", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const DestinationsSpec: coreClient.CompositeMapper = { +export const OperationListResultAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DestinationsSpec", + className: "OperationListResultAutoGenerated", modelProperties: { - logAnalytics: { - serializedName: "logAnalytics", + value: { + serializedName: "value", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "LogAnalyticsDestination" + className: "OperationAutoGenerated" } } } }, - azureMonitorMetrics: { - serializedName: "azureMonitorMetrics", + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { - name: "Composite", - className: "DestinationsSpecAzureMonitorMetrics" + name: "String" } } } } }; -export const LogAnalyticsDestination: coreClient.CompositeMapper = { +export const OperationAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LogAnalyticsDestination", + className: "OperationAutoGenerated", modelProperties: { - workspaceResourceId: { - serializedName: "workspaceResourceId", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - workspaceId: { - serializedName: "workspaceId", + isDataAction: { + serializedName: "isDataAction", readOnly: true, type: { - name: "String" + name: "Boolean" } }, - name: { - serializedName: "name", + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplayAutoGenerated" + } + }, + origin: { + serializedName: "origin", + readOnly: true, type: { name: "String" } - } - } - } -}; - -export const AzureMonitorMetricsDestination: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AzureMonitorMetricsDestination", - modelProperties: { - name: { - serializedName: "name", + }, + actionType: { + serializedName: "actionType", + readOnly: true, type: { name: "String" } @@ -5721,41 +6632,35 @@ export const AzureMonitorMetricsDestination: coreClient.CompositeMapper = { } }; -export const DataFlow: coreClient.CompositeMapper = { +export const OperationDisplayAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataFlow", + className: "OperationDisplayAutoGenerated", modelProperties: { - streams: { - serializedName: "streams", + provider: { + serializedName: "provider", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - destinations: { - serializedName: "destinations", + resource: { + serializedName: "resource", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - transformKql: { - serializedName: "transformKql", + operation: { + serializedName: "operation", + readOnly: true, type: { name: "String" } }, - outputStream: { - serializedName: "outputStream", + description: { + serializedName: "description", + readOnly: true, type: { name: "String" } @@ -5792,7 +6697,8 @@ export const ManagementEventAggregationCondition: coreClient.CompositeMapper = { "GreaterThan", "GreaterThanOrEqual", "LessThan", - "LessThanOrEqual" + "LessThanOrEqual", + "Equals" ] } }, @@ -5840,206 +6746,50 @@ export const MultiMetricCriteria: coreClient.CompositeMapper = { }, 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 TriggerCondition: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TriggerCondition", - modelProperties: { - thresholdOperator: { - defaultValue: "GreaterThanOrEqual", - serializedName: "thresholdOperator", - required: true, - type: { - name: "String" - } - }, - threshold: { - serializedName: "threshold", - required: true, - type: { - name: "Number" - } - }, - metricTrigger: { - serializedName: "metricTrigger", - type: { - name: "Composite", - className: "LogMetricTrigger" - } - } - } - } -}; - -export const LogMetricTrigger: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LogMetricTrigger", - modelProperties: { - thresholdOperator: { - defaultValue: "GreaterThanOrEqual", - serializedName: "thresholdOperator", - type: { - name: "String" - } - }, - threshold: { - serializedName: "threshold", + required: true, type: { - name: "Number" + name: "String" } }, - metricTriggerType: { - defaultValue: "Consecutive", - serializedName: "metricTriggerType", + metricNamespace: { + serializedName: "metricNamespace", type: { name: "String" } }, - metricColumn: { - serializedName: "metricColumn", + timeAggregation: { + serializedName: "timeAggregation", + required: true, type: { name: "String" } - } - } - } -}; - -export const AzNsActionGroup: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AzNsActionGroup", - modelProperties: { - actionGroup: { - serializedName: "actionGroup", + }, + dimensions: { + serializedName: "dimensions", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "MetricDimension" } } } }, - emailSubject: { - serializedName: "emailSubject", - type: { - name: "String" - } - }, - customWebhookPayload: { - serializedName: "customWebhookPayload", + skipMetricValidation: { + serializedName: "skipMetricValidation", type: { - name: "String" + name: "Boolean" } } } } }; -export const Dimension: coreClient.CompositeMapper = { +export const MetricDimension: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Dimension", + className: "MetricDimension", modelProperties: { name: { serializedName: "name", @@ -6071,28 +6821,23 @@ export const Dimension: coreClient.CompositeMapper = { } }; -export const Criteria: coreClient.CompositeMapper = { +export const DynamicThresholdFailingPeriods: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Criteria", + className: "DynamicThresholdFailingPeriods", modelProperties: { - metricName: { - serializedName: "metricName", + numberOfEvaluationPeriods: { + serializedName: "numberOfEvaluationPeriods", required: true, type: { - name: "String" + name: "Number" } }, - dimensions: { - serializedName: "dimensions", + minFailingPeriodsToAlert: { + serializedName: "minFailingPeriodsToAlert", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Dimension" - } - } + name: "Number" } } } @@ -6218,7 +6963,8 @@ export const ThresholdRuleCondition: coreClient.CompositeMapper = { "GreaterThan", "GreaterThanOrEqual", "LessThan", - "LessThanOrEqual" + "LessThanOrEqual", + "Equals" ] } }, @@ -7141,158 +7887,6 @@ export const MetricAlertResource: coreClient.CompositeMapper = { } }; -export const AlertingAction: coreClient.CompositeMapper = { - serializedName: - "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", - type: { - name: "Composite", - className: "AlertingAction", - uberParent: "Action", - polymorphicDiscriminator: Action.type.polymorphicDiscriminator, - modelProperties: { - ...Action.type.modelProperties, - severity: { - serializedName: "severity", - required: true, - type: { - name: "String" - } - }, - aznsAction: { - serializedName: "aznsAction", - type: { - name: "Composite", - className: "AzNsActionGroup" - } - }, - throttlingInMin: { - serializedName: "throttlingInMin", - type: { - name: "Number" - } - }, - trigger: { - serializedName: "trigger", - type: { - name: "Composite", - className: "TriggerCondition" - } - } - } - } -}; - -export const LogToMetricAction: coreClient.CompositeMapper = { - serializedName: - "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction", - type: { - name: "Composite", - className: "LogToMetricAction", - uberParent: "Action", - polymorphicDiscriminator: Action.type.polymorphicDiscriminator, - modelProperties: { - ...Action.type.modelProperties, - criteria: { - serializedName: "criteria", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Criteria" - } - } - } - } - } - } -}; - -export const LogSearchRuleResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LogSearchRuleResource", - modelProperties: { - ...ResourceAutoGenerated5.type.modelProperties, - 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" - } - }, - autoMitigate: { - defaultValue: false, - serializedName: "properties.autoMitigate", - type: { - name: "Boolean" - } - }, - enabled: { - serializedName: "properties.enabled", - type: { - name: "String" - } - }, - lastUpdatedTime: { - serializedName: "properties.lastUpdatedTime", - readOnly: true, - type: { - name: "DateTime" - } - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String" - } - }, - source: { - serializedName: "properties.source", - type: { - name: "Composite", - className: "Source" - } - }, - schedule: { - serializedName: "properties.schedule", - type: { - name: "Composite", - className: "Schedule" - } - }, - action: { - serializedName: "properties.action", - type: { - name: "Composite", - className: "Action" - } - } - } - } -}; - export const VMInsightsOnboardingStatus: coreClient.CompositeMapper = { type: { name: "Composite", @@ -7533,6 +8127,60 @@ export const DestinationsSpecAzureMonitorMetrics: coreClient.CompositeMapper = { } }; +export const MonitoringAccountResourceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoringAccountResourceProperties", + modelProperties: { + ...MonitoringAccount.type.modelProperties + } + } +}; + +export const MonitoringAccountMetrics: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoringAccountMetrics", + modelProperties: { + ...Metrics.type.modelProperties + } + } +}; + +export const MonitoringAccountDefaultIngestionSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoringAccountDefaultIngestionSettings", + modelProperties: { + ...IngestionSettings.type.modelProperties + } + } +}; + +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 MetricCriteria: coreClient.CompositeMapper = { serializedName: "StaticThresholdCriterion", type: { @@ -7676,6 +8324,51 @@ export const ScopedResource: coreClient.CompositeMapper = { } }; +export const MonitoringAccountResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoringAccountResource", + modelProperties: { + ...TrackedResourceAutoGenerated.type.modelProperties, + etag: { + serializedName: "etag", + readOnly: true, + type: { + name: "String" + } + }, + accountId: { + serializedName: "properties.accountId", + readOnly: true, + type: { + name: "String" + } + }, + metrics: { + serializedName: "properties.metrics", + type: { + name: "Composite", + className: "MonitoringAccountMetrics" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + defaultIngestionSettings: { + serializedName: "properties.defaultIngestionSettings", + type: { + name: "Composite", + className: "MonitoringAccountDefaultIngestionSettings" + } + } + } + } +}; + export const ActionGroupsPostTestNotificationsHeaders: coreClient.CompositeMapper = { type: { name: "Composite", @@ -7727,7 +8420,6 @@ export let discriminators = { RuleDataSource: RuleDataSource, RuleAction: RuleAction, MetricAlertCriteria: MetricAlertCriteria, - Action: Action, MultiMetricCriteria: MultiMetricCriteria, "RuleCondition.Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition": ThresholdRuleCondition, "RuleCondition.Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition": LocationThresholdRuleCondition, @@ -7739,8 +8431,6 @@ export let discriminators = { "MetricAlertCriteria.Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria": MetricAlertSingleResourceMultipleMetricCriteria, "MetricAlertCriteria.Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria": WebtestLocationAvailabilityCriteria, "MetricAlertCriteria.Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria": MetricAlertMultipleResourceMultipleMetricCriteria, - "Action.Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction": AlertingAction, - "Action.Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction": LogToMetricAction, "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 8b31cb187586..05e6837d6cdd 100644 --- a/sdk/monitor/arm-monitor/src/models/parameters.ts +++ b/sdk/monitor/arm-monitor/src/models/parameters.ts @@ -25,8 +25,8 @@ import { EnableRequest as EnableRequestMapper, MetricAlertResource as MetricAlertResourceMapper, MetricAlertResourcePatch as MetricAlertResourcePatchMapper, - LogSearchRuleResource as LogSearchRuleResourceMapper, - LogSearchRuleResourcePatch as LogSearchRuleResourcePatchMapper, + ScheduledQueryRuleResource as ScheduledQueryRuleResourceMapper, + ScheduledQueryRuleResourcePatch as ScheduledQueryRuleResourcePatchMapper, AzureMonitorPrivateLinkScope as AzureMonitorPrivateLinkScopeMapper, TagsResource as TagsResourceMapper, PrivateEndpointConnection as PrivateEndpointConnectionMapper, @@ -36,7 +36,9 @@ import { DataCollectionEndpointResource as DataCollectionEndpointResourceMapper, ResourceForUpdate as ResourceForUpdateMapper, DataCollectionRuleAssociationProxyOnlyResource as DataCollectionRuleAssociationProxyOnlyResourceMapper, - DataCollectionRuleResource as DataCollectionRuleResourceMapper + DataCollectionRuleResource as DataCollectionRuleResourceMapper, + MonitoringAccountResource as MonitoringAccountResourceMapper, + MonitoringAccountResourceForUpdate as MonitoringAccountResourceForUpdateMapper } from "../models/mappers"; export const accept: OperationParameter = { @@ -554,15 +556,10 @@ export const statusName: OperationURLParameter = { } }; -export const parameters6: OperationParameter = { - parameterPath: "parameters", - mapper: LogSearchRuleResourceMapper -}; - export const apiVersion8: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2018-04-16", + defaultValue: "2022-08-01-preview", isConstant: true, serializedName: "api-version", type: { @@ -571,9 +568,14 @@ export const apiVersion8: OperationQueryParameter = { } }; +export const parameters6: OperationParameter = { + parameterPath: "parameters", + mapper: ScheduledQueryRuleResourceMapper +}; + export const parameters7: OperationParameter = { parameterPath: "parameters", - mapper: LogSearchRuleResourcePatchMapper + mapper: ScheduledQueryRuleResourcePatchMapper }; export const apiVersion9: OperationQueryParameter = { @@ -798,3 +800,36 @@ export const body3: OperationParameter = { parameterPath: ["options", "body"], mapper: DataCollectionRuleResourceMapper }; + +export const apiVersion14: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2021-06-03-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const monitoringAccountName: OperationURLParameter = { + parameterPath: "monitoringAccountName", + mapper: { + serializedName: "monitoringAccountName", + required: true, + type: { + name: "String" + } + } +}; + +export const monitoringAccountProperties: OperationParameter = { + parameterPath: "monitoringAccountProperties", + mapper: MonitoringAccountResourceMapper +}; + +export const monitoringAccountProperties1: OperationParameter = { + parameterPath: ["options", "monitoringAccountProperties"], + mapper: MonitoringAccountResourceForUpdateMapper +}; diff --git a/sdk/monitor/arm-monitor/src/monitorClient.ts b/sdk/monitor/arm-monitor/src/monitorClient.ts index 79cac6fe879f..2e6c6db8fc17 100644 --- a/sdk/monitor/arm-monitor/src/monitorClient.ts +++ b/sdk/monitor/arm-monitor/src/monitorClient.ts @@ -23,7 +23,7 @@ import { EventCategoriesImpl, TenantActivityLogsImpl, MetricDefinitionsImpl, - MetricsImpl, + MetricsOperationsImpl, BaselinesImpl, MetricAlertsImpl, MetricAlertsStatusImpl, @@ -38,7 +38,9 @@ import { ActivityLogAlertsImpl, DataCollectionEndpointsImpl, DataCollectionRuleAssociationsImpl, - DataCollectionRulesImpl + DataCollectionRulesImpl, + MonitoringAccountsImpl, + MonitorImpl } from "./operations"; import { AutoscaleSettings, @@ -54,7 +56,7 @@ import { EventCategories, TenantActivityLogs, MetricDefinitions, - Metrics, + MetricsOperations, Baselines, MetricAlerts, MetricAlertsStatus, @@ -69,7 +71,9 @@ import { ActivityLogAlerts, DataCollectionEndpoints, DataCollectionRuleAssociations, - DataCollectionRules + DataCollectionRules, + MonitoringAccounts, + Monitor } from "./operationsInterfaces"; import { MonitorClientOptionalParams } from "./models"; @@ -110,16 +114,13 @@ export class MonitorClient extends coreClient.ServiceClient { ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - if (!options.credentialScopes) { - options.credentialScopes = ["https://management.azure.com/.default"]; - } const optionsWithDefaults = { ...defaults, ...options, userAgentOptions: { userAgentPrefix }, - baseUri: + endpoint: options.endpoint ?? options.baseUri ?? "https://management.azure.com" }; super(optionsWithDefaults); @@ -145,7 +146,9 @@ export class MonitorClient extends coreClient.ServiceClient { this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ credential: credentials, - scopes: `${optionsWithDefaults.credentialScopes}`, + scopes: + optionsWithDefaults.credentialScopes ?? + `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge @@ -171,7 +174,7 @@ export class MonitorClient extends coreClient.ServiceClient { this.eventCategories = new EventCategoriesImpl(this); this.tenantActivityLogs = new TenantActivityLogsImpl(this); this.metricDefinitions = new MetricDefinitionsImpl(this); - this.metrics = new MetricsImpl(this); + this.metricsOperations = new MetricsOperationsImpl(this); this.baselines = new BaselinesImpl(this); this.metricAlerts = new MetricAlertsImpl(this); this.metricAlertsStatus = new MetricAlertsStatusImpl(this); @@ -191,6 +194,8 @@ export class MonitorClient extends coreClient.ServiceClient { this ); this.dataCollectionRules = new DataCollectionRulesImpl(this); + this.monitoringAccounts = new MonitoringAccountsImpl(this); + this.monitor = new MonitorImpl(this); } autoscaleSettings: AutoscaleSettings; @@ -206,7 +211,7 @@ export class MonitorClient extends coreClient.ServiceClient { eventCategories: EventCategories; tenantActivityLogs: TenantActivityLogs; metricDefinitions: MetricDefinitions; - metrics: Metrics; + metricsOperations: MetricsOperations; baselines: Baselines; metricAlerts: MetricAlerts; metricAlertsStatus: MetricAlertsStatus; @@ -222,4 +227,6 @@ export class MonitorClient extends coreClient.ServiceClient { dataCollectionEndpoints: DataCollectionEndpoints; dataCollectionRuleAssociations: DataCollectionRuleAssociations; dataCollectionRules: DataCollectionRules; + monitoringAccounts: MonitoringAccounts; + monitor: Monitor; } diff --git a/sdk/monitor/arm-monitor/src/operations/actionGroups.ts b/sdk/monitor/arm-monitor/src/operations/actionGroups.ts index 09cbdbbdcb47..79603d490cc1 100644 --- a/sdk/monitor/arm-monitor/src/operations/actionGroups.ts +++ b/sdk/monitor/arm-monitor/src/operations/actionGroups.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { ActionGroups } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -17,7 +17,9 @@ import { LroImpl } from "../lroImpl"; import { ActionGroupResource, ActionGroupsListBySubscriptionIdOptionalParams, + ActionGroupsListBySubscriptionIdResponse, ActionGroupsListByResourceGroupOptionalParams, + ActionGroupsListByResourceGroupResponse, ActionGroupsCreateOrUpdateOptionalParams, ActionGroupsCreateOrUpdateResponse, ActionGroupsGetOptionalParams, @@ -39,8 +41,6 @@ import { ActionGroupsGetTestNotificationsAtResourceGroupLevelResponse, ActionGroupsGetTestNotificationsAtActionGroupResourceLevelOptionalParams, ActionGroupsGetTestNotificationsAtActionGroupResourceLevelResponse, - ActionGroupsListBySubscriptionIdResponse, - ActionGroupsListByResourceGroupResponse, EnableRequest, ActionGroupsEnableReceiverOptionalParams } from "../models"; @@ -73,16 +73,21 @@ export class ActionGroupsImpl implements ActionGroups { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listBySubscriptionIdPagingPage(options); + 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?: ActionGroupsListBySubscriptionIdOptionalParams + options?: ActionGroupsListBySubscriptionIdOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listBySubscriptionId(options); + let result: ActionGroupsListBySubscriptionIdResponse; + result = await this._listBySubscriptionId(options); yield result.value || []; } @@ -111,17 +116,26 @@ export class ActionGroupsImpl implements ActionGroups { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: ActionGroupsListByResourceGroupOptionalParams + options?: ActionGroupsListByResourceGroupOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); + let result: ActionGroupsListByResourceGroupResponse; + result = await this._listByResourceGroup(resourceGroupName, options); yield result.value || []; } diff --git a/sdk/monitor/arm-monitor/src/operations/activityLogAlerts.ts b/sdk/monitor/arm-monitor/src/operations/activityLogAlerts.ts index fb841d6f0dc5..87d37e3a8af9 100644 --- a/sdk/monitor/arm-monitor/src/operations/activityLogAlerts.ts +++ b/sdk/monitor/arm-monitor/src/operations/activityLogAlerts.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ActivityLogAlerts } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,8 +17,10 @@ import { ActivityLogAlertResource, ActivityLogAlertsListBySubscriptionIdNextOptionalParams, ActivityLogAlertsListBySubscriptionIdOptionalParams, + ActivityLogAlertsListBySubscriptionIdResponse, ActivityLogAlertsListByResourceGroupNextOptionalParams, ActivityLogAlertsListByResourceGroupOptionalParams, + ActivityLogAlertsListByResourceGroupResponse, ActivityLogAlertsCreateOrUpdateOptionalParams, ActivityLogAlertsCreateOrUpdateResponse, ActivityLogAlertsGetOptionalParams, @@ -26,8 +29,6 @@ import { AlertRulePatchObject, ActivityLogAlertsUpdateOptionalParams, ActivityLogAlertsUpdateResponse, - ActivityLogAlertsListBySubscriptionIdResponse, - ActivityLogAlertsListByResourceGroupResponse, ActivityLogAlertsListBySubscriptionIdNextResponse, ActivityLogAlertsListByResourceGroupNextResponse } from "../models"; @@ -60,22 +61,34 @@ export class ActivityLogAlertsImpl implements ActivityLogAlerts { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listBySubscriptionIdPagingPage(options); + 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 + options?: ActivityLogAlertsListBySubscriptionIdOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listBySubscriptionId(options); - yield result.value || []; - let continuationToken = result.nextLink; + 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; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -104,19 +117,33 @@ export class ActivityLogAlertsImpl implements ActivityLogAlerts { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: ActivityLogAlertsListByResourceGroupOptionalParams + options?: ActivityLogAlertsListByResourceGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + 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, @@ -124,7 +151,9 @@ export class ActivityLogAlertsImpl implements ActivityLogAlerts { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -430,7 +459,6 @@ const listBySubscriptionIdNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion12], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -450,7 +478,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion12], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/monitor/arm-monitor/src/operations/activityLogs.ts b/sdk/monitor/arm-monitor/src/operations/activityLogs.ts index 6adbcaf2588c..ad27be0e79fc 100644 --- a/sdk/monitor/arm-monitor/src/operations/activityLogs.ts +++ b/sdk/monitor/arm-monitor/src/operations/activityLogs.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ActivityLogs } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -62,23 +63,35 @@ export class ActivityLogsImpl implements ActivityLogs { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(filter, options); + 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 + options?: ActivityLogsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(filter, options); - yield result.value || []; - let continuationToken = result.nextLink; + 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(filter, continuationToken, options); + result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -120,29 +133,15 @@ export class ActivityLogsImpl implements ActivityLogs { /** * ListNext - * @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 nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ private _listNext( - filter: string, nextLink: string, options?: ActivityLogsListNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { filter, nextLink, options }, + { nextLink, options }, listNextOperationSpec ); } @@ -182,11 +181,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [ - Parameters.apiVersion1, - Parameters.filter, - Parameters.select - ], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/monitor/arm-monitor/src/operations/alertRuleIncidents.ts b/sdk/monitor/arm-monitor/src/operations/alertRuleIncidents.ts index 47a502fe5e23..80aa7721e864 100644 --- a/sdk/monitor/arm-monitor/src/operations/alertRuleIncidents.ts +++ b/sdk/monitor/arm-monitor/src/operations/alertRuleIncidents.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { AlertRuleIncidents } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -15,9 +15,9 @@ import { MonitorClient } from "../monitorClient"; import { Incident, AlertRuleIncidentsListByAlertRuleOptionalParams, + AlertRuleIncidentsListByAlertRuleResponse, AlertRuleIncidentsGetOptionalParams, - AlertRuleIncidentsGetResponse, - AlertRuleIncidentsListByAlertRuleResponse + AlertRuleIncidentsGetResponse } from "../models"; /// @@ -56,11 +56,15 @@ export class AlertRuleIncidentsImpl implements AlertRuleIncidents { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByAlertRulePagingPage( resourceGroupName, ruleName, - options + options, + settings ); } }; @@ -69,13 +73,11 @@ export class AlertRuleIncidentsImpl implements AlertRuleIncidents { private async *listByAlertRulePagingPage( resourceGroupName: string, ruleName: string, - options?: AlertRuleIncidentsListByAlertRuleOptionalParams + options?: AlertRuleIncidentsListByAlertRuleOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByAlertRule( - resourceGroupName, - ruleName, - options - ); + let result: AlertRuleIncidentsListByAlertRuleResponse; + result = await this._listByAlertRule(resourceGroupName, ruleName, options); yield result.value || []; } diff --git a/sdk/monitor/arm-monitor/src/operations/alertRules.ts b/sdk/monitor/arm-monitor/src/operations/alertRules.ts index 66f75849e904..a9c71c40c9b7 100644 --- a/sdk/monitor/arm-monitor/src/operations/alertRules.ts +++ b/sdk/monitor/arm-monitor/src/operations/alertRules.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { AlertRules } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -15,7 +15,9 @@ import { MonitorClient } from "../monitorClient"; import { AlertRuleResource, AlertRulesListByResourceGroupOptionalParams, + AlertRulesListByResourceGroupResponse, AlertRulesListBySubscriptionOptionalParams, + AlertRulesListBySubscriptionResponse, AlertRulesCreateOrUpdateOptionalParams, AlertRulesCreateOrUpdateResponse, AlertRulesDeleteOptionalParams, @@ -23,9 +25,7 @@ import { AlertRulesGetResponse, AlertRuleResourcePatch, AlertRulesUpdateOptionalParams, - AlertRulesUpdateResponse, - AlertRulesListByResourceGroupResponse, - AlertRulesListBySubscriptionResponse + AlertRulesUpdateResponse } from "../models"; /// @@ -58,17 +58,26 @@ export class AlertRulesImpl implements AlertRules { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: AlertRulesListByResourceGroupOptionalParams + options?: AlertRulesListByResourceGroupOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); + let result: AlertRulesListByResourceGroupResponse; + result = await this._listByResourceGroup(resourceGroupName, options); yield result.value || []; } @@ -99,16 +108,21 @@ export class AlertRulesImpl implements AlertRules { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listBySubscriptionPagingPage(options); + 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 + options?: AlertRulesListBySubscriptionOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listBySubscription(options); + let result: AlertRulesListBySubscriptionResponse; + result = await this._listBySubscription(options); yield result.value || []; } diff --git a/sdk/monitor/arm-monitor/src/operations/autoscaleSettings.ts b/sdk/monitor/arm-monitor/src/operations/autoscaleSettings.ts index 7089e94b92d4..f4930cf25476 100644 --- a/sdk/monitor/arm-monitor/src/operations/autoscaleSettings.ts +++ b/sdk/monitor/arm-monitor/src/operations/autoscaleSettings.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { AutoscaleSettings } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,9 +17,10 @@ import { AutoscaleSettingResource, AutoscaleSettingsListByResourceGroupNextOptionalParams, AutoscaleSettingsListByResourceGroupOptionalParams, + AutoscaleSettingsListByResourceGroupResponse, AutoscaleSettingsListBySubscriptionNextOptionalParams, AutoscaleSettingsListBySubscriptionOptionalParams, - AutoscaleSettingsListByResourceGroupResponse, + AutoscaleSettingsListBySubscriptionResponse, AutoscaleSettingsCreateOrUpdateOptionalParams, AutoscaleSettingsCreateOrUpdateResponse, AutoscaleSettingsDeleteOptionalParams, @@ -27,7 +29,6 @@ import { AutoscaleSettingResourcePatch, AutoscaleSettingsUpdateOptionalParams, AutoscaleSettingsUpdateResponse, - AutoscaleSettingsListBySubscriptionResponse, AutoscaleSettingsListByResourceGroupNextResponse, AutoscaleSettingsListBySubscriptionNextResponse } from "../models"; @@ -62,19 +63,33 @@ export class AutoscaleSettingsImpl implements AutoscaleSettings { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: AutoscaleSettingsListByResourceGroupOptionalParams + options?: AutoscaleSettingsListByResourceGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + 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, @@ -82,7 +97,9 @@ export class AutoscaleSettingsImpl implements AutoscaleSettings { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -113,22 +130,34 @@ export class AutoscaleSettingsImpl implements AutoscaleSettings { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listBySubscriptionPagingPage(options); + 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 + options?: AutoscaleSettingsListBySubscriptionOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listBySubscription(options); - yield result.value || []; - let continuationToken = result.nextLink; + 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; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -423,7 +452,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AutoscaleErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, @@ -444,7 +472,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AutoscaleErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/monitor/arm-monitor/src/operations/baselines.ts b/sdk/monitor/arm-monitor/src/operations/baselines.ts index b58e4ab681b2..5c7c5fa1abab 100644 --- a/sdk/monitor/arm-monitor/src/operations/baselines.ts +++ b/sdk/monitor/arm-monitor/src/operations/baselines.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { Baselines } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -48,17 +48,22 @@ export class BaselinesImpl implements Baselines { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceUri, options); + 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 + options?: BaselinesListOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceUri, options); + let result: BaselinesListResponse; + result = await this._list(resourceUri, options); yield result.value || []; } diff --git a/sdk/monitor/arm-monitor/src/operations/dataCollectionEndpoints.ts b/sdk/monitor/arm-monitor/src/operations/dataCollectionEndpoints.ts index f10ae29ad52f..7bc434d0a6f3 100644 --- a/sdk/monitor/arm-monitor/src/operations/dataCollectionEndpoints.ts +++ b/sdk/monitor/arm-monitor/src/operations/dataCollectionEndpoints.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { DataCollectionEndpoints } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,9 +17,9 @@ import { DataCollectionEndpointResource, DataCollectionEndpointsListByResourceGroupNextOptionalParams, DataCollectionEndpointsListByResourceGroupOptionalParams, + DataCollectionEndpointsListByResourceGroupResponse, DataCollectionEndpointsListBySubscriptionNextOptionalParams, DataCollectionEndpointsListBySubscriptionOptionalParams, - DataCollectionEndpointsListByResourceGroupResponse, DataCollectionEndpointsListBySubscriptionResponse, DataCollectionEndpointsGetOptionalParams, DataCollectionEndpointsGetResponse, @@ -61,19 +62,33 @@ export class DataCollectionEndpointsImpl implements DataCollectionEndpoints { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: DataCollectionEndpointsListByResourceGroupOptionalParams + options?: DataCollectionEndpointsListByResourceGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + 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, @@ -81,7 +96,9 @@ export class DataCollectionEndpointsImpl implements DataCollectionEndpoints { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -112,22 +129,34 @@ export class DataCollectionEndpointsImpl implements DataCollectionEndpoints { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listBySubscriptionPagingPage(options); + 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 + options?: DataCollectionEndpointsListBySubscriptionOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listBySubscription(options); - yield result.value || []; - let continuationToken = result.nextLink; + 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; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -417,7 +446,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, @@ -438,7 +466,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/monitor/arm-monitor/src/operations/dataCollectionRuleAssociations.ts b/sdk/monitor/arm-monitor/src/operations/dataCollectionRuleAssociations.ts index 1d153dfbfa0d..51bceb3ab96d 100644 --- a/sdk/monitor/arm-monitor/src/operations/dataCollectionRuleAssociations.ts +++ b/sdk/monitor/arm-monitor/src/operations/dataCollectionRuleAssociations.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { DataCollectionRuleAssociations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,12 +17,12 @@ import { DataCollectionRuleAssociationProxyOnlyResource, DataCollectionRuleAssociationsListByResourceNextOptionalParams, DataCollectionRuleAssociationsListByResourceOptionalParams, + DataCollectionRuleAssociationsListByResourceResponse, DataCollectionRuleAssociationsListByRuleNextOptionalParams, DataCollectionRuleAssociationsListByRuleOptionalParams, + DataCollectionRuleAssociationsListByRuleResponse, DataCollectionRuleAssociationsListByDataCollectionEndpointNextOptionalParams, DataCollectionRuleAssociationsListByDataCollectionEndpointOptionalParams, - DataCollectionRuleAssociationsListByResourceResponse, - DataCollectionRuleAssociationsListByRuleResponse, DataCollectionRuleAssociationsListByDataCollectionEndpointResponse, DataCollectionRuleAssociationsGetOptionalParams, DataCollectionRuleAssociationsGetResponse, @@ -66,19 +67,29 @@ export class DataCollectionRuleAssociationsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourcePagingPage(resourceUri, options); + 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 + options?: DataCollectionRuleAssociationsListByResourceOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResource(resourceUri, options); - yield result.value || []; - let continuationToken = result.nextLink; + 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, @@ -86,7 +97,9 @@ export class DataCollectionRuleAssociationsImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -127,11 +140,15 @@ export class DataCollectionRuleAssociationsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByRulePagingPage( resourceGroupName, dataCollectionRuleName, - options + options, + settings ); } }; @@ -140,15 +157,22 @@ export class DataCollectionRuleAssociationsImpl private async *listByRulePagingPage( resourceGroupName: string, dataCollectionRuleName: string, - options?: DataCollectionRuleAssociationsListByRuleOptionalParams + options?: DataCollectionRuleAssociationsListByRuleOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByRule( - resourceGroupName, - dataCollectionRuleName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + 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, @@ -157,7 +181,9 @@ export class DataCollectionRuleAssociationsImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -201,11 +227,15 @@ export class DataCollectionRuleAssociationsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByDataCollectionEndpointPagingPage( resourceGroupName, dataCollectionEndpointName, - options + options, + settings ); } }; @@ -214,15 +244,22 @@ export class DataCollectionRuleAssociationsImpl private async *listByDataCollectionEndpointPagingPage( resourceGroupName: string, dataCollectionEndpointName: string, - options?: DataCollectionRuleAssociationsListByDataCollectionEndpointOptionalParams + options?: DataCollectionRuleAssociationsListByDataCollectionEndpointOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByDataCollectionEndpoint( - resourceGroupName, - dataCollectionEndpointName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + 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, @@ -231,7 +268,9 @@ export class DataCollectionRuleAssociationsImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -557,7 +596,6 @@ const listByResourceNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, Parameters.nextLink, @@ -578,7 +616,6 @@ const listByRuleNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, @@ -601,7 +638,6 @@ const listByDataCollectionEndpointNextOperationSpec: coreClient.OperationSpec = bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/monitor/arm-monitor/src/operations/dataCollectionRules.ts b/sdk/monitor/arm-monitor/src/operations/dataCollectionRules.ts index d4971f175b2c..df8ae456aef4 100644 --- a/sdk/monitor/arm-monitor/src/operations/dataCollectionRules.ts +++ b/sdk/monitor/arm-monitor/src/operations/dataCollectionRules.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { DataCollectionRules } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,9 +17,9 @@ import { DataCollectionRuleResource, DataCollectionRulesListByResourceGroupNextOptionalParams, DataCollectionRulesListByResourceGroupOptionalParams, + DataCollectionRulesListByResourceGroupResponse, DataCollectionRulesListBySubscriptionNextOptionalParams, DataCollectionRulesListBySubscriptionOptionalParams, - DataCollectionRulesListByResourceGroupResponse, DataCollectionRulesListBySubscriptionResponse, DataCollectionRulesGetOptionalParams, DataCollectionRulesGetResponse, @@ -61,19 +62,33 @@ export class DataCollectionRulesImpl implements DataCollectionRules { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: DataCollectionRulesListByResourceGroupOptionalParams + options?: DataCollectionRulesListByResourceGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + 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, @@ -81,7 +96,9 @@ export class DataCollectionRulesImpl implements DataCollectionRules { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -112,22 +129,34 @@ export class DataCollectionRulesImpl implements DataCollectionRules { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listBySubscriptionPagingPage(options); + 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 + options?: DataCollectionRulesListBySubscriptionOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listBySubscription(options); - yield result.value || []; - let continuationToken = result.nextLink; + 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; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -413,7 +442,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, @@ -434,7 +462,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/monitor/arm-monitor/src/operations/diagnosticSettings.ts b/sdk/monitor/arm-monitor/src/operations/diagnosticSettings.ts index 64e665a69095..416c6f18f6d5 100644 --- a/sdk/monitor/arm-monitor/src/operations/diagnosticSettings.ts +++ b/sdk/monitor/arm-monitor/src/operations/diagnosticSettings.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { DiagnosticSettings } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -15,12 +15,12 @@ import { MonitorClient } from "../monitorClient"; import { DiagnosticSettingsResource, DiagnosticSettingsListOptionalParams, + DiagnosticSettingsListResponse, DiagnosticSettingsGetOptionalParams, DiagnosticSettingsGetResponse, DiagnosticSettingsCreateOrUpdateOptionalParams, DiagnosticSettingsCreateOrUpdateResponse, - DiagnosticSettingsDeleteOptionalParams, - DiagnosticSettingsListResponse + DiagnosticSettingsDeleteOptionalParams } from "../models"; /// @@ -53,17 +53,22 @@ export class DiagnosticSettingsImpl implements DiagnosticSettings { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceUri, options); + 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 + options?: DiagnosticSettingsListOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceUri, options); + let result: DiagnosticSettingsListResponse; + result = await this._list(resourceUri, options); yield result.value || []; } diff --git a/sdk/monitor/arm-monitor/src/operations/diagnosticSettingsCategory.ts b/sdk/monitor/arm-monitor/src/operations/diagnosticSettingsCategory.ts index d6cf0bbaeb60..19bdf9571d7a 100644 --- a/sdk/monitor/arm-monitor/src/operations/diagnosticSettingsCategory.ts +++ b/sdk/monitor/arm-monitor/src/operations/diagnosticSettingsCategory.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { DiagnosticSettingsCategory } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -15,9 +15,9 @@ import { MonitorClient } from "../monitorClient"; import { DiagnosticSettingsCategoryResource, DiagnosticSettingsCategoryListOptionalParams, + DiagnosticSettingsCategoryListResponse, DiagnosticSettingsCategoryGetOptionalParams, - DiagnosticSettingsCategoryGetResponse, - DiagnosticSettingsCategoryListResponse + DiagnosticSettingsCategoryGetResponse } from "../models"; /// @@ -51,17 +51,22 @@ export class DiagnosticSettingsCategoryImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceUri, options); + 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 + options?: DiagnosticSettingsCategoryListOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceUri, options); + let result: DiagnosticSettingsCategoryListResponse; + result = await this._list(resourceUri, options); yield result.value || []; } diff --git a/sdk/monitor/arm-monitor/src/operations/eventCategories.ts b/sdk/monitor/arm-monitor/src/operations/eventCategories.ts index 500bba8cd4c5..06b81c9146b1 100644 --- a/sdk/monitor/arm-monitor/src/operations/eventCategories.ts +++ b/sdk/monitor/arm-monitor/src/operations/eventCategories.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { EventCategories } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -47,16 +47,21 @@ export class EventCategoriesImpl implements EventCategories { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); } }; } private async *listPagingPage( - options?: EventCategoriesListOptionalParams + options?: EventCategoriesListOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); + let result: EventCategoriesListResponse; + result = await this._list(options); yield result.value || []; } diff --git a/sdk/monitor/arm-monitor/src/operations/index.ts b/sdk/monitor/arm-monitor/src/operations/index.ts index 13d8893f98ff..8a0d4660274c 100644 --- a/sdk/monitor/arm-monitor/src/operations/index.ts +++ b/sdk/monitor/arm-monitor/src/operations/index.ts @@ -19,7 +19,7 @@ export * from "./activityLogs"; export * from "./eventCategories"; export * from "./tenantActivityLogs"; export * from "./metricDefinitions"; -export * from "./metrics"; +export * from "./metricsOperations"; export * from "./baselines"; export * from "./metricAlerts"; export * from "./metricAlertsStatus"; @@ -35,3 +35,5 @@ export * from "./activityLogAlerts"; export * from "./dataCollectionEndpoints"; export * from "./dataCollectionRuleAssociations"; export * from "./dataCollectionRules"; +export * from "./monitoringAccounts"; +export * from "./monitor"; diff --git a/sdk/monitor/arm-monitor/src/operations/logProfiles.ts b/sdk/monitor/arm-monitor/src/operations/logProfiles.ts index e700bf3369e4..4fb57d8e48b5 100644 --- a/sdk/monitor/arm-monitor/src/operations/logProfiles.ts +++ b/sdk/monitor/arm-monitor/src/operations/logProfiles.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { LogProfiles } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -15,6 +15,7 @@ import { MonitorClient } from "../monitorClient"; import { LogProfileResource, LogProfilesListOptionalParams, + LogProfilesListResponse, LogProfilesDeleteOptionalParams, LogProfilesGetOptionalParams, LogProfilesGetResponse, @@ -22,8 +23,7 @@ import { LogProfilesCreateOrUpdateResponse, LogProfileResourcePatch, LogProfilesUpdateOptionalParams, - LogProfilesUpdateResponse, - LogProfilesListResponse + LogProfilesUpdateResponse } from "../models"; /// @@ -54,16 +54,21 @@ export class LogProfilesImpl implements LogProfiles { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); } }; } private async *listPagingPage( - options?: LogProfilesListOptionalParams + options?: LogProfilesListOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); + let result: LogProfilesListResponse; + result = await this._list(options); yield result.value || []; } diff --git a/sdk/monitor/arm-monitor/src/operations/metricAlerts.ts b/sdk/monitor/arm-monitor/src/operations/metricAlerts.ts index c69accc8c0f3..a47b7e6616e3 100644 --- a/sdk/monitor/arm-monitor/src/operations/metricAlerts.ts +++ b/sdk/monitor/arm-monitor/src/operations/metricAlerts.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { MetricAlerts } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -15,8 +15,8 @@ import { MonitorClient } from "../monitorClient"; import { MetricAlertResource, MetricAlertsListBySubscriptionOptionalParams, - MetricAlertsListByResourceGroupOptionalParams, MetricAlertsListBySubscriptionResponse, + MetricAlertsListByResourceGroupOptionalParams, MetricAlertsListByResourceGroupResponse, MetricAlertsGetOptionalParams, MetricAlertsGetResponse, @@ -56,16 +56,21 @@ export class MetricAlertsImpl implements MetricAlerts { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listBySubscriptionPagingPage(options); + 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 + options?: MetricAlertsListBySubscriptionOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listBySubscription(options); + let result: MetricAlertsListBySubscriptionResponse; + result = await this._listBySubscription(options); yield result.value || []; } @@ -94,17 +99,26 @@ export class MetricAlertsImpl implements MetricAlerts { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: MetricAlertsListByResourceGroupOptionalParams + options?: MetricAlertsListByResourceGroupOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); + let result: MetricAlertsListByResourceGroupResponse; + result = await this._listByResourceGroup(resourceGroupName, options); yield result.value || []; } diff --git a/sdk/monitor/arm-monitor/src/operations/metricDefinitions.ts b/sdk/monitor/arm-monitor/src/operations/metricDefinitions.ts index 3bf10233e6fa..e63fa4aab82d 100644 --- a/sdk/monitor/arm-monitor/src/operations/metricDefinitions.ts +++ b/sdk/monitor/arm-monitor/src/operations/metricDefinitions.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { MetricDefinitions } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -48,17 +48,22 @@ export class MetricDefinitionsImpl implements MetricDefinitions { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceUri, options); + 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 + options?: MetricDefinitionsListOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceUri, options); + let result: MetricDefinitionsListResponse; + result = await this._list(resourceUri, options); yield result.value || []; } diff --git a/sdk/monitor/arm-monitor/src/operations/metricNamespaces.ts b/sdk/monitor/arm-monitor/src/operations/metricNamespaces.ts index 70eead2d45d5..65ef9597becc 100644 --- a/sdk/monitor/arm-monitor/src/operations/metricNamespaces.ts +++ b/sdk/monitor/arm-monitor/src/operations/metricNamespaces.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { MetricNamespaces } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -48,17 +48,22 @@ export class MetricNamespacesImpl implements MetricNamespaces { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceUri, options); + 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 + options?: MetricNamespacesListOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceUri, options); + let result: MetricNamespacesListResponse; + result = await this._list(resourceUri, options); yield result.value || []; } diff --git a/sdk/monitor/arm-monitor/src/operations/metrics.ts b/sdk/monitor/arm-monitor/src/operations/metricsOperations.ts similarity index 88% rename from sdk/monitor/arm-monitor/src/operations/metrics.ts rename to sdk/monitor/arm-monitor/src/operations/metricsOperations.ts index 432b19a335b1..257b46781186 100644 --- a/sdk/monitor/arm-monitor/src/operations/metrics.ts +++ b/sdk/monitor/arm-monitor/src/operations/metricsOperations.ts @@ -6,19 +6,19 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { Metrics } from "../operationsInterfaces"; +import { MetricsOperations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { MonitorClient } from "../monitorClient"; import { MetricsListOptionalParams, MetricsListResponse } from "../models"; -/** Class containing Metrics operations. */ -export class MetricsImpl implements Metrics { +/** Class containing MetricsOperations operations. */ +export class MetricsOperationsImpl implements MetricsOperations { private readonly client: MonitorClient; /** - * Initialize a new instance of the class Metrics class. + * Initialize a new instance of the class MetricsOperations class. * @param client Reference to the service client */ constructor(client: MonitorClient) { diff --git a/sdk/monitor/arm-monitor/src/operations/monitor.ts b/sdk/monitor/arm-monitor/src/operations/monitor.ts new file mode 100644 index 000000000000..bcd15cc3d3df --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operations/monitor.ts @@ -0,0 +1,152 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import { Monitor } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MonitorClient } from "../monitorClient"; +import { + OperationAutoGenerated, + MonitorOperationsListNextOptionalParams, + MonitorOperationsListOptionalParams, + MonitorOperationsListResponse, + MonitorOperationsListNextResponse +} from "../models"; + +/// +/** Class containing Monitor operations. */ +export class MonitorImpl implements Monitor { + private readonly client: MonitorClient; + + /** + * Initialize a new instance of the class Monitor 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 listOperationsList( + options?: MonitorOperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.operationsListPagingAll(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.operationsListPagingPage(options, settings); + } + }; + } + + private async *operationsListPagingPage( + options?: MonitorOperationsListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: MonitorOperationsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._operationsList(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._operationsListNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *operationsListPagingAll( + options?: MonitorOperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.operationsListPagingPage(options)) { + yield* page; + } + } + + /** + * Lists available Operations for this Resource Provider + * @param options The options parameters. + */ + private _operationsList( + options?: MonitorOperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + operationsListOperationSpec + ); + } + + /** + * OperationsListNext + * @param nextLink The nextLink from the previous successful call to the OperationsList method. + * @param options The options parameters. + */ + private _operationsListNext( + nextLink: string, + options?: MonitorOperationsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + operationsListNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const operationsListOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Monitor/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResultAutoGenerated + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated2 + } + }, + queryParameters: [Parameters.apiVersion14], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; +const operationsListNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResultAutoGenerated + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated2 + } + }, + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/monitor/arm-monitor/src/operations/monitoringAccounts.ts b/sdk/monitor/arm-monitor/src/operations/monitoringAccounts.ts new file mode 100644 index 000000000000..12d961a027fd --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operations/monitoringAccounts.ts @@ -0,0 +1,479 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; +import { MonitoringAccounts } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MonitorClient } from "../monitorClient"; +import { + MonitoringAccountResource, + MonitoringAccountsListByResourceGroupNextOptionalParams, + MonitoringAccountsListByResourceGroupOptionalParams, + MonitoringAccountsListByResourceGroupResponse, + MonitoringAccountsListBySubscriptionNextOptionalParams, + MonitoringAccountsListBySubscriptionOptionalParams, + MonitoringAccountsListBySubscriptionResponse, + MonitoringAccountsGetOptionalParams, + MonitoringAccountsGetResponse, + MonitoringAccountsCreateOptionalParams, + MonitoringAccountsCreateResponse, + MonitoringAccountsUpdateOptionalParams, + MonitoringAccountsUpdateResponse, + MonitoringAccountsDeleteOptionalParams, + MonitoringAccountsListByResourceGroupNextResponse, + MonitoringAccountsListBySubscriptionNextResponse +} from "../models"; + +/// +/** Class containing MonitoringAccounts operations. */ +export class MonitoringAccountsImpl implements MonitoringAccounts { + private readonly client: MonitorClient; + + /** + * Initialize a new instance of the class MonitoringAccounts class. + * @param client Reference to the service client + */ + constructor(client: MonitorClient) { + this.client = client; + } + + /** + * Lists all monitoring accounts 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?: MonitoringAccountsListByResourceGroupOptionalParams + ): 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?: MonitoringAccountsListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: MonitoringAccountsListByResourceGroupResponse; + 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?: MonitoringAccountsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Lists all monitoring accounts in the specified subscription + * @param options The options parameters. + */ + public listBySubscription( + options?: MonitoringAccountsListBySubscriptionOptionalParams + ): 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?: MonitoringAccountsListBySubscriptionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: MonitoringAccountsListBySubscriptionResponse; + 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?: MonitoringAccountsListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Lists all monitoring accounts 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?: MonitoringAccountsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Lists all monitoring accounts in the specified subscription + * @param options The options parameters. + */ + private _listBySubscription( + options?: MonitoringAccountsListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * Returns the specific monitoring account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitoringAccountName The name of the monitoring account. The name is case insensitive + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitoringAccountName: string, + options?: MonitoringAccountsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitoringAccountName, options }, + getOperationSpec + ); + } + + /** + * Create or update a monitoring account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitoringAccountName The name of the monitoring account. The name is case insensitive + * @param monitoringAccountProperties Properties that need to be specified to create a new monitoring + * account + * @param options The options parameters. + */ + create( + resourceGroupName: string, + monitoringAccountName: string, + monitoringAccountProperties: MonitoringAccountResource, + options?: MonitoringAccountsCreateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + monitoringAccountName, + monitoringAccountProperties, + options + }, + createOperationSpec + ); + } + + /** + * Updates part of a monitoring account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitoringAccountName The name of the monitoring account. The name is case insensitive + * @param options The options parameters. + */ + update( + resourceGroupName: string, + monitoringAccountName: string, + options?: MonitoringAccountsUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitoringAccountName, options }, + updateOperationSpec + ); + } + + /** + * Delete an monitoring account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitoringAccountName The name of the monitoring account. The name is case insensitive + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + monitoringAccountName: string, + options?: MonitoringAccountsDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitoringAccountName, 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?: MonitoringAccountsListByResourceGroupNextOptionalParams + ): 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?: MonitoringAccountsListBySubscriptionNextOptionalParams + ): 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.MonitoringAccountResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated2 + } + }, + queryParameters: [Parameters.apiVersion14], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Monitor/accounts", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MonitoringAccountResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated2 + } + }, + queryParameters: [Parameters.apiVersion14], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{monitoringAccountName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MonitoringAccountResource + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated2 + } + }, + queryParameters: [Parameters.apiVersion14], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.monitoringAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{monitoringAccountName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.MonitoringAccountResource + }, + 201: { + bodyMapper: Mappers.MonitoringAccountResource + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated2 + } + }, + requestBody: Parameters.monitoringAccountProperties, + queryParameters: [Parameters.apiVersion14], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.monitoringAccountName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{monitoringAccountName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.MonitoringAccountResource + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated2 + } + }, + requestBody: Parameters.monitoringAccountProperties1, + queryParameters: [Parameters.apiVersion14], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.monitoringAccountName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{monitoringAccountName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated2 + } + }, + queryParameters: [Parameters.apiVersion14], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.monitoringAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MonitoringAccountResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated2 + } + }, + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MonitoringAccountResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated2 + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/monitor/arm-monitor/src/operations/privateLinkScopedResources.ts b/sdk/monitor/arm-monitor/src/operations/privateLinkScopedResources.ts index 115b22041f00..bad13d722e5b 100644 --- a/sdk/monitor/arm-monitor/src/operations/privateLinkScopedResources.ts +++ b/sdk/monitor/arm-monitor/src/operations/privateLinkScopedResources.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { PrivateLinkScopedResources } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,12 +19,12 @@ import { ScopedResource, PrivateLinkScopedResourcesListByPrivateLinkScopeNextOptionalParams, PrivateLinkScopedResourcesListByPrivateLinkScopeOptionalParams, + PrivateLinkScopedResourcesListByPrivateLinkScopeResponse, PrivateLinkScopedResourcesGetOptionalParams, PrivateLinkScopedResourcesGetResponse, PrivateLinkScopedResourcesCreateOrUpdateOptionalParams, PrivateLinkScopedResourcesCreateOrUpdateResponse, PrivateLinkScopedResourcesDeleteOptionalParams, - PrivateLinkScopedResourcesListByPrivateLinkScopeResponse, PrivateLinkScopedResourcesListByPrivateLinkScopeNextResponse } from "../models"; @@ -64,11 +65,15 @@ export class PrivateLinkScopedResourcesImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByPrivateLinkScopePagingPage( resourceGroupName, scopeName, - options + options, + settings ); } }; @@ -77,15 +82,22 @@ export class PrivateLinkScopedResourcesImpl private async *listByPrivateLinkScopePagingPage( resourceGroupName: string, scopeName: string, - options?: PrivateLinkScopedResourcesListByPrivateLinkScopeOptionalParams + options?: PrivateLinkScopedResourcesListByPrivateLinkScopeOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByPrivateLinkScope( - resourceGroupName, - scopeName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + 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, @@ -94,7 +106,9 @@ export class PrivateLinkScopedResourcesImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -468,7 +482,6 @@ const listByPrivateLinkScopeNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/monitor/arm-monitor/src/operations/privateLinkScopes.ts b/sdk/monitor/arm-monitor/src/operations/privateLinkScopes.ts index c9b5257fc69a..a188b7db413f 100644 --- a/sdk/monitor/arm-monitor/src/operations/privateLinkScopes.ts +++ b/sdk/monitor/arm-monitor/src/operations/privateLinkScopes.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { PrivateLinkScopes } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,9 +19,9 @@ import { AzureMonitorPrivateLinkScope, PrivateLinkScopesListNextOptionalParams, PrivateLinkScopesListOptionalParams, + PrivateLinkScopesListResponse, PrivateLinkScopesListByResourceGroupNextOptionalParams, PrivateLinkScopesListByResourceGroupOptionalParams, - PrivateLinkScopesListResponse, PrivateLinkScopesListByResourceGroupResponse, PrivateLinkScopesDeleteOptionalParams, PrivateLinkScopesGetOptionalParams, @@ -62,22 +63,34 @@ export class PrivateLinkScopesImpl implements PrivateLinkScopes { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); } }; } private async *listPagingPage( - options?: PrivateLinkScopesListOptionalParams + options?: PrivateLinkScopesListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + 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; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -106,19 +119,33 @@ export class PrivateLinkScopesImpl implements PrivateLinkScopes { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: PrivateLinkScopesListByResourceGroupOptionalParams + options?: PrivateLinkScopesListByResourceGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + 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, @@ -126,7 +153,9 @@ export class PrivateLinkScopesImpl implements PrivateLinkScopes { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -491,7 +520,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -511,7 +539,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/monitor/arm-monitor/src/operations/scheduledQueryRules.ts b/sdk/monitor/arm-monitor/src/operations/scheduledQueryRules.ts index 31ac44b7f350..cad03c26e444 100644 --- a/sdk/monitor/arm-monitor/src/operations/scheduledQueryRules.ts +++ b/sdk/monitor/arm-monitor/src/operations/scheduledQueryRules.ts @@ -6,26 +6,31 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ScheduledQueryRules } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { MonitorClient } from "../monitorClient"; import { - LogSearchRuleResource, + ScheduledQueryRuleResource, + ScheduledQueryRulesListBySubscriptionNextOptionalParams, ScheduledQueryRulesListBySubscriptionOptionalParams, + ScheduledQueryRulesListBySubscriptionResponse, + ScheduledQueryRulesListByResourceGroupNextOptionalParams, ScheduledQueryRulesListByResourceGroupOptionalParams, - ScheduledQueryRulesCreateOrUpdateOptionalParams, - ScheduledQueryRulesCreateOrUpdateResponse, + ScheduledQueryRulesListByResourceGroupResponse, ScheduledQueryRulesGetOptionalParams, ScheduledQueryRulesGetResponse, - LogSearchRuleResourcePatch, + ScheduledQueryRulesCreateOrUpdateOptionalParams, + ScheduledQueryRulesCreateOrUpdateResponse, + ScheduledQueryRuleResourcePatch, ScheduledQueryRulesUpdateOptionalParams, ScheduledQueryRulesUpdateResponse, ScheduledQueryRulesDeleteOptionalParams, - ScheduledQueryRulesListBySubscriptionResponse, - ScheduledQueryRulesListByResourceGroupResponse + ScheduledQueryRulesListBySubscriptionNextResponse, + ScheduledQueryRulesListByResourceGroupNextResponse } from "../models"; /// @@ -42,12 +47,12 @@ export class ScheduledQueryRulesImpl implements ScheduledQueryRules { } /** - * List the Log Search rules within a subscription group. + * Retrieve a scheduled query rule definitions in a subscription. * @param options The options parameters. */ public listBySubscription( options?: ScheduledQueryRulesListBySubscriptionOptionalParams - ): PagedAsyncIterableIterator { + ): PagedAsyncIterableIterator { const iter = this.listBySubscriptionPagingAll(options); return { next() { @@ -56,36 +61,54 @@ export class ScheduledQueryRulesImpl implements ScheduledQueryRules { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listBySubscriptionPagingPage(options); + 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?: ScheduledQueryRulesListBySubscriptionOptionalParams - ): AsyncIterableIterator { - let result = await this._listBySubscription(options); - yield result.value || []; + options?: ScheduledQueryRulesListBySubscriptionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ScheduledQueryRulesListBySubscriptionResponse; + 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?: ScheduledQueryRulesListBySubscriptionOptionalParams - ): AsyncIterableIterator { + ): AsyncIterableIterator { for await (const page of this.listBySubscriptionPagingPage(options)) { yield* page; } } /** - * List the Log Search rules within a resource group. + * Retrieve scheduled query 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?: ScheduledQueryRulesListByResourceGroupOptionalParams - ): PagedAsyncIterableIterator { + ): PagedAsyncIterableIterator { const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); return { next() { @@ -94,24 +117,50 @@ export class ScheduledQueryRulesImpl implements ScheduledQueryRules { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: ScheduledQueryRulesListByResourceGroupOptionalParams - ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; + options?: ScheduledQueryRulesListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ScheduledQueryRulesListByResourceGroupResponse; + 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?: ScheduledQueryRulesListByResourceGroupOptionalParams - ): AsyncIterableIterator { + ): AsyncIterableIterator { for await (const page of this.listByResourceGroupPagingPage( resourceGroupName, options @@ -121,26 +170,35 @@ export class ScheduledQueryRulesImpl implements ScheduledQueryRules { } /** - * Creates or updates an log search rule. + * Retrieve a scheduled query rule definitions in a subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: ScheduledQueryRulesListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * Retrieve scheduled query rule definitions in a resource group. * @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( + private _listByResourceGroup( resourceGroupName: string, - ruleName: string, - parameters: LogSearchRuleResource, - options?: ScheduledQueryRulesCreateOrUpdateOptionalParams - ): Promise { + options?: ScheduledQueryRulesListByResourceGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { resourceGroupName, ruleName, parameters, options }, - createOrUpdateOperationSpec + { resourceGroupName, options }, + listByResourceGroupOperationSpec ); } /** - * Gets an Log Search rule + * Retrieve an scheduled query 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. @@ -157,7 +215,26 @@ export class ScheduledQueryRulesImpl implements ScheduledQueryRules { } /** - * Update log search Rule. + * Creates or updates a scheduled query 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: ScheduledQueryRuleResource, + options?: ScheduledQueryRulesCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, ruleName, parameters, options }, + createOrUpdateOperationSpec + ); + } + + /** + * Update a scheduled query 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 update. @@ -166,7 +243,7 @@ export class ScheduledQueryRulesImpl implements ScheduledQueryRules { update( resourceGroupName: string, ruleName: string, - parameters: LogSearchRuleResourcePatch, + parameters: ScheduledQueryRuleResourcePatch, options?: ScheduledQueryRulesUpdateOptionalParams ): Promise { return this.client.sendOperationRequest( @@ -176,7 +253,7 @@ export class ScheduledQueryRulesImpl implements ScheduledQueryRules { } /** - * Deletes a Log Search rule + * Deletes a scheduled query 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. @@ -193,70 +270,85 @@ export class ScheduledQueryRulesImpl implements ScheduledQueryRules { } /** - * List the Log Search rules within a subscription group. + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. * @param options The options parameters. */ - private _listBySubscription( - options?: ScheduledQueryRulesListBySubscriptionOptionalParams - ): Promise { + private _listBySubscriptionNext( + nextLink: string, + options?: ScheduledQueryRulesListBySubscriptionNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { options }, - listBySubscriptionOperationSpec + { nextLink, options }, + listBySubscriptionNextOperationSpec ); } /** - * List the Log Search rules within a resource group. + * 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 _listByResourceGroup( + private _listByResourceGroupNext( resourceGroupName: string, - options?: ScheduledQueryRulesListByResourceGroupOptionalParams - ): Promise { + nextLink: string, + options?: ScheduledQueryRulesListByResourceGroupNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const createOrUpdateOperationSpec: coreClient.OperationSpec = { +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}", - httpMethod: "PUT", + "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/scheduledQueryRules", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.LogSearchRuleResource + bodyMapper: Mappers.ScheduledQueryRuleResourceCollection }, - 201: { - bodyMapper: Mappers.LogSearchRuleResource + default: { + bodyMapper: Mappers.ErrorContract + } + }, + queryParameters: [Parameters.apiVersion8], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ScheduledQueryRuleResourceCollection }, default: { bodyMapper: Mappers.ErrorContract } }, - requestBody: Parameters.parameters6, queryParameters: [Parameters.apiVersion8], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.ruleName + Parameters.subscriptionId ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", + headerParameters: [Parameters.accept], serializer }; const getOperationSpec: coreClient.OperationSpec = { path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.LogSearchRuleResource + bodyMapper: Mappers.ScheduledQueryRuleResource }, default: { bodyMapper: Mappers.ErrorContract @@ -272,13 +364,40 @@ const getOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ScheduledQueryRuleResource + }, + 201: { + bodyMapper: Mappers.ScheduledQueryRuleResource + }, + default: { + bodyMapper: Mappers.ErrorContract + } + }, + requestBody: Parameters.parameters6, + queryParameters: [Parameters.apiVersion8], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.ruleName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; const updateOperationSpec: coreClient.OperationSpec = { path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.LogSearchRuleResource + bodyMapper: Mappers.ScheduledQueryRuleResource }, default: { bodyMapper: Mappers.ErrorContract @@ -298,7 +417,7 @@ const updateOperationSpec: coreClient.OperationSpec = { }; const deleteOperationSpec: coreClient.OperationSpec = { path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}", httpMethod: "DELETE", responses: { 200: {}, @@ -317,40 +436,41 @@ const deleteOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; -const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/scheduledQueryRules", +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.LogSearchRuleResourceCollection + bodyMapper: Mappers.ScheduledQueryRuleResourceCollection }, default: { bodyMapper: Mappers.ErrorContract } }, - queryParameters: [Parameters.filter1, Parameters.apiVersion8], - urlParameters: [Parameters.$host, Parameters.subscriptionId], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], headerParameters: [Parameters.accept], serializer }; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules", +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.LogSearchRuleResourceCollection + bodyMapper: Mappers.ScheduledQueryRuleResourceCollection }, default: { bodyMapper: Mappers.ErrorContract } }, - queryParameters: [Parameters.filter1, Parameters.apiVersion8], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.nextLink ], headerParameters: [Parameters.accept], serializer diff --git a/sdk/monitor/arm-monitor/src/operations/tenantActivityLogs.ts b/sdk/monitor/arm-monitor/src/operations/tenantActivityLogs.ts index fac70640bb34..9ad3a25eca1a 100644 --- a/sdk/monitor/arm-monitor/src/operations/tenantActivityLogs.ts +++ b/sdk/monitor/arm-monitor/src/operations/tenantActivityLogs.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { TenantActivityLogs } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -51,22 +52,34 @@ export class TenantActivityLogsImpl implements TenantActivityLogs { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); } }; } private async *listPagingPage( - options?: TenantActivityLogsListOptionalParams + options?: TenantActivityLogsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + 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; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -140,11 +153,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [ - Parameters.apiVersion1, - Parameters.select, - Parameters.filter1 - ], urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], serializer diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/index.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/index.ts index 13d8893f98ff..8a0d4660274c 100644 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/index.ts +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/index.ts @@ -19,7 +19,7 @@ export * from "./activityLogs"; export * from "./eventCategories"; export * from "./tenantActivityLogs"; export * from "./metricDefinitions"; -export * from "./metrics"; +export * from "./metricsOperations"; export * from "./baselines"; export * from "./metricAlerts"; export * from "./metricAlertsStatus"; @@ -35,3 +35,5 @@ export * from "./activityLogAlerts"; export * from "./dataCollectionEndpoints"; export * from "./dataCollectionRuleAssociations"; export * from "./dataCollectionRules"; +export * from "./monitoringAccounts"; +export * from "./monitor"; diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/metrics.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/metricsOperations.ts similarity index 86% rename from sdk/monitor/arm-monitor/src/operationsInterfaces/metrics.ts rename to sdk/monitor/arm-monitor/src/operationsInterfaces/metricsOperations.ts index ad60c0009c95..a9b3f7a4756a 100644 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/metrics.ts +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/metricsOperations.ts @@ -8,8 +8,8 @@ import { MetricsListOptionalParams, MetricsListResponse } from "../models"; -/** Interface representing a Metrics. */ -export interface Metrics { +/** Interface representing a MetricsOperations. */ +export interface MetricsOperations { /** * **Lists the metric values for a resource**. * @param resourceUri The identifier of the resource. diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/monitor.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/monitor.ts new file mode 100644 index 000000000000..37702ab67fb5 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/monitor.ts @@ -0,0 +1,25 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { + OperationAutoGenerated, + MonitorOperationsListOptionalParams +} from "../models"; + +/// +/** Interface representing a Monitor. */ +export interface Monitor { + /** + * Lists available Operations for this Resource Provider + * @param options The options parameters. + */ + listOperationsList( + options?: MonitorOperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/monitoringAccounts.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/monitoringAccounts.ts new file mode 100644 index 000000000000..70d963c92c76 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/monitoringAccounts.ts @@ -0,0 +1,89 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { + MonitoringAccountResource, + MonitoringAccountsListByResourceGroupOptionalParams, + MonitoringAccountsListBySubscriptionOptionalParams, + MonitoringAccountsGetOptionalParams, + MonitoringAccountsGetResponse, + MonitoringAccountsCreateOptionalParams, + MonitoringAccountsCreateResponse, + MonitoringAccountsUpdateOptionalParams, + MonitoringAccountsUpdateResponse, + MonitoringAccountsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a MonitoringAccounts. */ +export interface MonitoringAccounts { + /** + * Lists all monitoring accounts 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?: MonitoringAccountsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists all monitoring accounts in the specified subscription + * @param options The options parameters. + */ + listBySubscription( + options?: MonitoringAccountsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the specific monitoring account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitoringAccountName The name of the monitoring account. The name is case insensitive + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitoringAccountName: string, + options?: MonitoringAccountsGetOptionalParams + ): Promise; + /** + * Create or update a monitoring account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitoringAccountName The name of the monitoring account. The name is case insensitive + * @param monitoringAccountProperties Properties that need to be specified to create a new monitoring + * account + * @param options The options parameters. + */ + create( + resourceGroupName: string, + monitoringAccountName: string, + monitoringAccountProperties: MonitoringAccountResource, + options?: MonitoringAccountsCreateOptionalParams + ): Promise; + /** + * Updates part of a monitoring account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitoringAccountName The name of the monitoring account. The name is case insensitive + * @param options The options parameters. + */ + update( + resourceGroupName: string, + monitoringAccountName: string, + options?: MonitoringAccountsUpdateOptionalParams + ): Promise; + /** + * Delete an monitoring account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitoringAccountName The name of the monitoring account. The name is case insensitive + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + monitoringAccountName: string, + options?: MonitoringAccountsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/scheduledQueryRules.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/scheduledQueryRules.ts index 711c2180f5b2..0dbf37bd644f 100644 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/scheduledQueryRules.ts +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/scheduledQueryRules.ts @@ -8,14 +8,14 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { - LogSearchRuleResource, + ScheduledQueryRuleResource, ScheduledQueryRulesListBySubscriptionOptionalParams, ScheduledQueryRulesListByResourceGroupOptionalParams, - ScheduledQueryRulesCreateOrUpdateOptionalParams, - ScheduledQueryRulesCreateOrUpdateResponse, ScheduledQueryRulesGetOptionalParams, ScheduledQueryRulesGetResponse, - LogSearchRuleResourcePatch, + ScheduledQueryRulesCreateOrUpdateOptionalParams, + ScheduledQueryRulesCreateOrUpdateResponse, + ScheduledQueryRuleResourcePatch, ScheduledQueryRulesUpdateOptionalParams, ScheduledQueryRulesUpdateResponse, ScheduledQueryRulesDeleteOptionalParams @@ -25,47 +25,47 @@ import { /** Interface representing a ScheduledQueryRules. */ export interface ScheduledQueryRules { /** - * List the Log Search rules within a subscription group. + * Retrieve a scheduled query rule definitions in a subscription. * @param options The options parameters. */ listBySubscription( options?: ScheduledQueryRulesListBySubscriptionOptionalParams - ): PagedAsyncIterableIterator; + ): PagedAsyncIterableIterator; /** - * List the Log Search rules within a resource group. + * Retrieve scheduled query 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?: ScheduledQueryRulesListByResourceGroupOptionalParams - ): PagedAsyncIterableIterator; + ): PagedAsyncIterableIterator; /** - * Creates or updates an log search rule. + * Retrieve an scheduled query rule 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( + get( resourceGroupName: string, ruleName: string, - parameters: LogSearchRuleResource, - options?: ScheduledQueryRulesCreateOrUpdateOptionalParams - ): Promise; + options?: ScheduledQueryRulesGetOptionalParams + ): Promise; /** - * Gets an Log Search rule + * Creates or updates a scheduled query 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. */ - get( + createOrUpdate( resourceGroupName: string, ruleName: string, - options?: ScheduledQueryRulesGetOptionalParams - ): Promise; + parameters: ScheduledQueryRuleResource, + options?: ScheduledQueryRulesCreateOrUpdateOptionalParams + ): Promise; /** - * Update log search Rule. + * Update a scheduled query 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 update. @@ -74,11 +74,11 @@ export interface ScheduledQueryRules { update( resourceGroupName: string, ruleName: string, - parameters: LogSearchRuleResourcePatch, + parameters: ScheduledQueryRuleResourcePatch, options?: ScheduledQueryRulesUpdateOptionalParams ): Promise; /** - * Deletes a Log Search rule + * Deletes a scheduled query 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. diff --git a/sdk/monitor/arm-monitor/src/pagingHelper.ts b/sdk/monitor/arm-monitor/src/pagingHelper.ts new file mode 100644 index 000000000000..269a2b9814b5 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/pagingHelper.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export interface PageInfo { + continuationToken?: string; +} + +const pageMap = new WeakMap(); + +/** + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from + * that point later. + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. + */ +export function getContinuationToken(page: unknown): string | undefined { + if (typeof page !== "object" || page === null) { + return undefined; + } + return pageMap.get(page)?.continuationToken; +} + +export function setContinuationToken( + page: unknown, + continuationToken: string | undefined +): void { + if (typeof page !== "object" || page === null || !continuationToken) { + return; + } + const pageInfo = pageMap.get(page) ?? {}; + pageInfo.continuationToken = continuationToken; + pageMap.set(page, pageInfo); +} diff --git a/sdk/monitor/arm-monitor/test/monitor_examples.ts b/sdk/monitor/arm-monitor/test/monitor_examples.ts deleted file mode 100644 index 92cf2910825e..000000000000 --- a/sdk/monitor/arm-monitor/test/monitor_examples.ts +++ /dev/null @@ -1,270 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - env, - Recorder, - RecorderStartOptions, - delay, - isPlaybackMode, -} from "@azure-tools/test-recorder"; -import { createTestCredential } from "@azure-tools/test-credential"; -import { assert } from "chai"; -import { Context } from "mocha"; -import { MonitorClient } from "../src/monitorClient"; -import { LogicManagementClient } from "@azure/arm-logic"; -import { StorageManagementClient } from "@azure/arm-storage"; -import { EventHubManagementClient } from "@azure/arm-eventhub"; -import { OperationalInsightsManagementClient } from "@azure/arm-operationalinsights"; - -const replaceableVariables: Record = { - AZURE_CLIENT_ID: "azure_client_id", - AZURE_CLIENT_SECRET: "azure_client_secret", - AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", - SUBSCRIPTION_ID: "azure_subscription_id" -}; - -const recorderOptions: RecorderStartOptions = { - envSetupForPlayback: replaceableVariables -}; - -export const testPollingOptions = { - updateIntervalInMs: isPlaybackMode() ? 0 : undefined, -}; - -describe("Monitor test", () => { - let recorder: Recorder; - let subscriptionId: string; - let client: MonitorClient; - let location: string; - let resourceGroup: string; - let workflowName: string; - let storageAccountName: string; - let namespaceName: string; - let authorizationRuleName: string; - let eventhubName: string; - let workspaceName: string; - let logProfileName: string; - let diagnosticName: string; - let logic_client: LogicManagementClient; - let storage_client: StorageManagementClient; - let eventhub_client: EventHubManagementClient; - let op_client: OperationalInsightsManagementClient; - let workflowsId: string; - let storageId: string; - let authorizationId: string; - let workspaceId: string; - - beforeEach(async function (this: Context) { - recorder = new Recorder(this.currentTest); - await recorder.start(recorderOptions); - subscriptionId = env.SUBSCRIPTION_ID || ''; - // This is an example of how the environment variables are used - const credential = createTestCredential(); - client = new MonitorClient(credential, subscriptionId, recorder.configureClientOptions({})); - logic_client = new LogicManagementClient(credential, subscriptionId, recorder.configureClientOptions({})); - storage_client = new StorageManagementClient(credential, subscriptionId, recorder.configureClientOptions({})); - eventhub_client = new EventHubManagementClient(credential, subscriptionId, recorder.configureClientOptions({})); - op_client = new OperationalInsightsManagementClient(credential, subscriptionId, recorder.configureClientOptions({})); - location = "eastus"; - resourceGroup = "myjstest"; - workflowName = "myworkflowxxx"; - storageAccountName = "mystorageaccountyyy"; - namespaceName = "mynamespacexxx"; - eventhubName = "myeventhubxxx"; - workspaceName = "myworkspacexxx"; - authorizationRuleName = "myauthorizationRulexxx"; - logProfileName = "mylogProfilexxx"; - diagnosticName = "mydiagnosticxxxx"; - }); - - afterEach(async function () { - await recorder.stop(); - }); - - it("create parameters for diagnosticSettings", async function () { - //workflows.createOrUpdate - const res = await logic_client.workflows.createOrUpdate(resourceGroup, workflowName, { - location: location, - definition: { - "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", - "contentVersion": "1.0.0.0", - "parameters": {}, - "triggers": {}, - "actions": {}, - "outputs": {} - } - }); - workflowsId = (res.id || "/").substring(1); - - //storageAccounts.beginCreateAndWait - const storageaccount = await storage_client.storageAccounts.beginCreateAndWait(resourceGroup, storageAccountName, { - sku: { - name: "Standard_GRS", - }, - kind: "StorageV2", - location: "eastus", - encryption: { - services: { - file: { - keyType: "Account", - enabled: true, - }, - blob: { - keyType: "Account", - enabled: true, - }, - }, - keySource: "Microsoft.Storage", - }, - tags: { - key1: "value1", - key2: "value2", - } - }); - storageId = storageaccount.id || ""; - - //namespaces.beginCreateOrUpdateAndWait - const namespaces = await eventhub_client.namespaces.beginCreateOrUpdateAndWait(resourceGroup, namespaceName, { - sku: { - name: "Standard", - tier: "Standard", - }, - location: location, - tags: { - tag1: "value1", - tag2: "value2", - } - }) - //namespaces.createOrUpdateAuthorizationRule - const authorization = await eventhub_client.namespaces.createOrUpdateAuthorizationRule(resourceGroup, namespaceName, authorizationRuleName, { rights: ["Listen", "Send", "Manage"] }); - //eventHubs.createOrUpdate - const eventhub = await eventhub_client.eventHubs.createOrUpdate(resourceGroup, namespaceName, eventhubName, { - messageRetentionInDays: 4, - partitionCount: 4, - status: "Active", - captureDescription: { - enabled: true, - encoding: "Avro", - intervalInSeconds: 120, - sizeLimitInBytes: 10485763, - destination: { - name: "EventHubArchive.AzureBlockBlob", - storageAccountResourceId: "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroup + "/providers/Microsoft.Storage/storageAccounts/" + storageAccountName, - blobContainer: "container", - archiveNameFormat: "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}", - } - } - }); - authorizationId = authorization.id || ""; - - //workspaces.beginCreateOrUpdateAndWait - const workspace = await op_client.workspaces.beginCreateOrUpdateAndWait(resourceGroup, workspaceName, { - sku: { - name: "PerNode" - }, - retentionInDays: 30, - location: location, - tags: { - tag1: "value1" - } - }) - workspaceId = workspace.id || ""; - }); - - it("diagnosticSettings create test", async function () { - const res = await client.diagnosticSettings.createOrUpdate(workflowsId, diagnosticName, { - storageAccountId: storageId, - workspaceId: workspaceId, - eventHubAuthorizationRuleId: authorizationId, - eventHubName: eventhubName, - metrics: [], - logs: [ - { - category: "WorkflowRuntime", - enabled: true, - retentionPolicy: { - enabled: false, - days: 0 - } - } - ] - }) - assert.equal(res.name, diagnosticName); - }); - - it("diagnosticSettings get test", async function () { - const res = await client.diagnosticSettings.get(workflowsId, diagnosticName); - assert.equal(res.name, diagnosticName); - }); - - it("diagnosticSettings list test", async function () { - const res = await client.diagnosticSettings.list(workflowsId); - }); - - it("diagnosticSettings delete test", async function () { - const res = await client.diagnosticSettings.delete(workflowsId, diagnosticName); - }); - - it("logProfiles create test", async function () { - //delete sample logfile - const resArray = new Array(); - for await (let item of client.logProfiles.list()) { - resArray.push(item); - } - if (resArray.length >= 1) { - await client.logProfiles.delete("sample-log-profile") - } - const res = await client.logProfiles.createOrUpdate(logProfileName, { - location: "", - locations: [ - "global" - ], - categories: [ - "Write", - "Delete", - "Action" - ], - retentionPolicy: { - enabled: true, - days: 3 - }, - storageAccountId: storageId - }) - assert.equal(res.name, logProfileName); - }); - - it("logProfiles get test", async function () { - const res = await client.logProfiles.get(logProfileName); - assert.equal(res.name, logProfileName); - }); - - it("logProfiles list test", async function () { - const resArray = new Array(); - for await (let item of client.logProfiles.list()) { - resArray.push(item); - } - assert.equal(resArray.length, 1); - }); - - it("delete parameters for diagnosticSettings", async function () { - const workflowDlete = await logic_client.workflows.delete(resourceGroup, workflowName); - const storageDelete = await storage_client.storageAccounts.delete(resourceGroup, storageAccountName); - const namespaceDelete = await eventhub_client.namespaces.beginDeleteAndWait(resourceGroup, namespaceName); - const workspaceDelete = await op_client.workspaces.beginDeleteAndWait(resourceGroup, workspaceName); - }); - - it("logProfiles delete test", async function () { - const res = await client.logProfiles.delete(logProfileName); - const resArray = new Array(); - for await (let item of client.logProfiles.list()) { - resArray.push(item); - } - assert.equal(resArray.length, 1); //still exist sample logfile - }); -}); diff --git a/sdk/monitor/arm-monitor/test/sampleTest.ts b/sdk/monitor/arm-monitor/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/monitor/arm-monitor/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/monitor/arm-monitor/tsconfig.json b/sdk/monitor/arm-monitor/tsconfig.json index 293df9ae64ce..3e6ae96443f3 100644 --- a/sdk/monitor/arm-monitor/tsconfig.json +++ b/sdk/monitor/arm-monitor/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-monitor": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"