From 15b594f1dcced5018e06591e18a01b1e2780e38f Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 13 Jul 2022 06:32:51 +0000 Subject: [PATCH] CodeGen from PR 19652 in Azure/azure-rest-api-specs Merge d58f80070f821c23c1d25776d2da3a05d0e89897 into a960d5bbc48507716518a94f5bb0f4640bf69beb --- sdk/monitor/arm-monitor/CHANGELOG.md | 47 +- sdk/monitor/arm-monitor/_meta.json | 8 +- sdk/monitor/arm-monitor/package.json | 20 +- ...ate_parameters_for_diagnosticsettings.json | 2052 ----------------- ...ete_parameters_for_diagnosticsettings.json | 290 --- ...ording_diagnosticsettings_create_test.json | 85 - ...ording_diagnosticsettings_delete_test.json | 34 - ...recording_diagnosticsettings_get_test.json | 74 - ...ecording_diagnosticsettings_list_test.json | 69 - .../recording_logprofiles_create_test.json | 114 - .../recording_logprofiles_delete_test.json | 67 - .../recording_logprofiles_get_test.json | 61 - .../recording_logprofiles_list_test.json | 65 - .../arm-monitor/review/arm-monitor.api.md | 372 ++- sdk/monitor/arm-monitor/sample.env | 4 - ...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 | 155 -- .../autoscaleSettingsDeleteSample.ts | 33 - .../samples-dev/autoscaleSettingsGetSample.ts | 33 - ...oscaleSettingsListByResourceGroupSample.ts | 34 - ...toscaleSettingsListBySubscriptionSample.ts | 31 - .../autoscaleSettingsUpdateSample.ts | 160 -- .../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 | 30 - .../diagnosticSettingsCreateOrUpdateSample.ts | 58 - .../diagnosticSettingsDeleteSample.ts | 31 - .../diagnosticSettingsGetSample.ts | 31 - .../diagnosticSettingsListSample.ts | 30 - .../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 - ...EndpointConnectionsCreateOrUpdateSample.ts | 42 - .../privateEndpointConnectionsDeleteSample.ts | 35 - .../privateEndpointConnectionsGetSample.ts | 35 - ...ConnectionsListByPrivateLinkScopeSample.ts | 36 - .../privateLinkResourcesGetSample.ts | 35 - ...nkResourcesListByPrivateLinkScopeSample.ts | 36 - ...rivateLinkScopeOperationStatusGetSample.ts | 33 - ...LinkScopedResourcesCreateOrUpdateSample.ts | 40 - .../privateLinkScopedResourcesDeleteSample.ts | 35 - .../privateLinkScopedResourcesGetSample.ts | 35 - ...edResourcesListByPrivateLinkScopeSample.ts | 36 - .../privateLinkScopesCreateOrUpdateSample.ts | 66 - .../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 | 252 -- ...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 | 155 -- .../autoscaleSettingsDeleteSample.js | 30 - .../javascript/autoscaleSettingsGetSample.js | 30 - ...oscaleSettingsListByResourceGroupSample.js | 32 - ...toscaleSettingsListBySubscriptionSample.js | 31 - .../autoscaleSettingsUpdateSample.js | 156 -- .../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 | 30 - .../diagnosticSettingsCreateOrUpdateSample.js | 54 - .../diagnosticSettingsDeleteSample.js | 31 - .../javascript/diagnosticSettingsGetSample.js | 31 - .../diagnosticSettingsListSample.js | 30 - .../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 - ...EndpointConnectionsCreateOrUpdateSample.js | 42 - .../privateEndpointConnectionsDeleteSample.js | 35 - .../privateEndpointConnectionsGetSample.js | 35 - ...ConnectionsListByPrivateLinkScopeSample.js | 36 - .../privateLinkResourcesGetSample.js | 31 - ...nkResourcesListByPrivateLinkScopeSample.js | 36 - ...rivateLinkScopeOperationStatusGetSample.js | 33 - ...LinkScopedResourcesCreateOrUpdateSample.js | 40 - .../privateLinkScopedResourcesDeleteSample.js | 35 - .../privateLinkScopedResourcesGetSample.js | 31 - ...edResourcesListByPrivateLinkScopeSample.js | 36 - .../privateLinkScopesCreateOrUpdateSample.js | 63 - .../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 | 265 --- .../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 | 155 -- .../src/autoscaleSettingsDeleteSample.ts | 33 - .../src/autoscaleSettingsGetSample.ts | 33 - ...oscaleSettingsListByResourceGroupSample.ts | 34 - ...toscaleSettingsListBySubscriptionSample.ts | 31 - .../src/autoscaleSettingsUpdateSample.ts | 160 -- .../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 | 30 - .../diagnosticSettingsCreateOrUpdateSample.ts | 58 - .../src/diagnosticSettingsDeleteSample.ts | 31 - .../src/diagnosticSettingsGetSample.ts | 31 - .../src/diagnosticSettingsListSample.ts | 30 - .../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 - ...EndpointConnectionsCreateOrUpdateSample.ts | 42 - .../privateEndpointConnectionsDeleteSample.ts | 35 - .../privateEndpointConnectionsGetSample.ts | 35 - ...ConnectionsListByPrivateLinkScopeSample.ts | 36 - .../src/privateLinkResourcesGetSample.ts | 35 - ...nkResourcesListByPrivateLinkScopeSample.ts | 36 - ...rivateLinkScopeOperationStatusGetSample.ts | 33 - ...LinkScopedResourcesCreateOrUpdateSample.ts | 40 - .../privateLinkScopedResourcesDeleteSample.ts | 35 - .../privateLinkScopedResourcesGetSample.ts | 35 - ...edResourcesListByPrivateLinkScopeSample.ts | 36 - .../privateLinkScopesCreateOrUpdateSample.ts | 66 - .../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/models/index.ts | 700 +++--- sdk/monitor/arm-monitor/src/models/mappers.ts | 1037 +++++---- .../arm-monitor/src/models/parameters.ts | 18 +- .../src/operations/activityLogAlerts.ts | 16 +- .../src/operations/scheduledQueryRules.ts | 229 +- .../scheduledQueryRules.ts | 42 +- .../arm-monitor/test/monitor_examples.ts | 270 --- sdk/monitor/arm-monitor/test/sampleTest.ts | 43 + sdk/monitor/arm-monitor/tsconfig.json | 10 +- 337 files changed, 1404 insertions(+), 21150 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/sample.env 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/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/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/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 delete mode 100644 sdk/monitor/arm-monitor/test/monitor_examples.ts create mode 100644 sdk/monitor/arm-monitor/test/sampleTest.ts diff --git a/sdk/monitor/arm-monitor/CHANGELOG.md b/sdk/monitor/arm-monitor/CHANGELOG.md index 4dd026599f0e..54ac810edde0 100644 --- a/sdk/monitor/arm-monitor/CHANGELOG.md +++ b/sdk/monitor/arm-monitor/CHANGELOG.md @@ -1,16 +1,6 @@ # Release History - -## 8.0.0-beta.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 8.0.0-beta.1 (2022-06-10) + +## 8.0.0-beta.2 (2022-07-13) **Features** @@ -30,6 +20,7 @@ - Added Interface ActionGroupsGetTestNotificationsAtResourceGroupLevelOptionalParams - Added Interface ActionGroupsPostTestNotificationsHeaders - Added Interface ActionList + - Added Interface Actions - Added Interface ActivityLogAlertsListByResourceGroupNextOptionalParams - Added Interface ActivityLogAlertsListBySubscriptionIdNextOptionalParams - Added Interface AlertRuleAllOfCondition @@ -38,14 +29,22 @@ - Added Interface AlertRulePatchObject - Added Interface AzureResourceAutoGenerated - Added Interface ColumnDefinition + - Added Interface Condition + - Added Interface ConditionFailingPeriods - Added Interface DataCollectionRuleAssociationsListByDataCollectionEndpointNextOptionalParams - Added Interface DataCollectionRuleAssociationsListByDataCollectionEndpointOptionalParams - Added Interface ErrorResponseAutoGenerated + - Added Interface ErrorResponseAutoGenerated2 - Added Interface IisLogsDataSource - Added Interface LogFilesDataSource - Added Interface LogFileSettings - Added Interface LogFileTextSettings - Added Interface Metadata + - Added Interface ScheduledQueryRuleCriteria + - Added Interface ScheduledQueryRuleResourceCollection + - Added Interface ScheduledQueryRuleResourcePatch + - Added Interface ScheduledQueryRulesListByResourceGroupNextOptionalParams + - Added Interface ScheduledQueryRulesListBySubscriptionNextOptionalParams - Added Interface StreamDeclaration - Added Type Alias ActionGroupsCreateNotificationsAtActionGroupResourceLevelResponse - Added Type Alias ActionGroupsCreateNotificationsAtResourceGroupLevelResponse @@ -58,11 +57,18 @@ - Added Type Alias DataCollectionRuleAssociationsListByDataCollectionEndpointNextResponse - Added Type Alias DataCollectionRuleAssociationsListByDataCollectionEndpointResponse - Added Type Alias DataCollectionRuleMetadata + - Added Type Alias DimensionOperator + - Added Type Alias Kind - Added Type Alias KnownColumnDefinitionType - Added Type Alias KnownLogFilesDataSourceFormat - Added Type Alias KnownLogFileTextSettingsRecordStartTimestampFormat - Added Type Alias LogFilesDataSourceSettings - Added Type Alias LogFileSettingsText + - Added Type Alias ScheduledQueryRuleResource + - Added Type Alias ScheduledQueryRulesListByResourceGroupNextResponse + - Added Type Alias ScheduledQueryRulesListBySubscriptionNextResponse + - Added Type Alias TimeAggregation + - Added Type Alias TrackedResource - Interface DataCollectionRule has a new optional parameter dataCollectionEndpointId - Interface DataCollectionRule has a new optional parameter metadata - Interface DataCollectionRule has a new optional parameter streamDeclarations @@ -76,14 +82,31 @@ - Interface DataSourcesSpec has a new optional parameter iisLogs - Interface DataSourcesSpec has a new optional parameter logFiles - Add parameters of AzureResourceAutoGenerated to TypeAlias ActivityLogAlertResource + - Added Enum KnownDimensionOperator + - Added Enum KnownKind - Added Enum KnownKnownColumnDefinitionType - Added Enum KnownKnownLogFilesDataSourceFormat - Added Enum KnownKnownLogFileTextSettingsRecordStartTimestampFormat + - Added Enum KnownTimeAggregation **Breaking Changes** - Operation ActivityLogAlerts.update has a new signature + - Operation ScheduledQueryRules.createOrUpdate has a new signature + - Operation ScheduledQueryRules.update has a new signature + - Interface ResourceAutoGenerated no longer has parameter etag + - Interface ResourceAutoGenerated no longer has parameter kind + - Interface ResourceAutoGenerated no longer has parameter location + - Interface ResourceAutoGenerated no longer has parameter tags + - Interface ScheduledQueryRulesListByResourceGroupOptionalParams no longer has parameter filter + - Interface ScheduledQueryRulesListBySubscriptionOptionalParams no longer has parameter filter - Delete parameters of Resource in TypeAlias ActivityLogAlertResource + - Removed Enum KnownConditionalOperator + - Removed Enum KnownEnabled + - Removed Enum KnownMetricTriggerType + - Removed Enum KnownProvisioningState + - Removed Enum KnownQueryType + - Enum KnownOperator no longer has value Include ## 7.0.0 (2021-12-20) diff --git a/sdk/monitor/arm-monitor/_meta.json b/sdk/monitor/arm-monitor/_meta.json index 0e604e0780f0..52163db75379 100644 --- a/sdk/monitor/arm-monitor/_meta.json +++ b/sdk/monitor/arm-monitor/_meta.json @@ -1,8 +1,8 @@ { - "commit": "8ff65a981663fddf0027b1af7fcac127c2722788", + "commit": "a0946d9ace92c7a9b07470d269600b0cb10cbdfd", "readme": "specification/monitor/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\monitor\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-beta.20 --generate-sample=true", + "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=/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-alpha.19.20220425.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.3.0", - "use": "@autorest/typescript@6.0.0-beta.20" + "release_tool": "@azure-tools/js-sdk-release-tools@2.4.0", + "use": "@autorest/typescript@6.0.0-alpha.19.20220425.1" } \ No newline at end of file diff --git a/sdk/monitor/arm-monitor/package.json b/sdk/monitor/arm-monitor/package.json index 0913a6f4b68c..a8002f415b39 100644 --- a/sdk/monitor/arm-monitor/package.json +++ b/sdk/monitor/arm-monitor/package.json @@ -43,14 +43,8 @@ "@azure-tools/test-recorder": "^2.0.0", "@azure-tools/test-credential": "^1.0.0", "mocha": "^7.1.1", - "@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" + "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/monitor/arm-monitor", "repository": { @@ -114,13 +108,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 ce8725f9ef78..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_create_parameters_for_diagnosticsettings.json +++ /dev/null @@ -1,2052 +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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "0ca8b526-abe2-4b90-b2d8-6748f98aa3c4" - }, - "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": "Tue, 14 Jun 2022 07:42:30 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "2593d867-af64-4b9e-9e95-9614c45c295b", - "x-ms-ratelimit-remaining-subscription-writes": "1199", - "x-ms-request-id": "eastus:b9102598-8e46-4973-a10d-649f9db24635", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074231Z:2593d867-af64-4b9e-9e95-9614c45c295b" - }, - "ResponseBody": { - "properties": { - "provisioningState": "Succeeded", - "createdTime": "2022-06-14T07:42:29.5393306Z", - "changedTime": "2022-06-14T07:42:29.5381725Z", - "state": "Enabled", - "version": "08585464143359834857", - "accessEndpoint": "https://prod-71.eastus.logic.azure.com:443/workflows/1689c97552cb4dde99d90758424ffba3", - "definition": { - "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", - "contentVersion": "1.0.0.0", - "parameters": {}, - "triggers": {}, - "actions": {}, - "outputs": {} - }, - "parameters": {}, - "endpointsConfiguration": { - "workflow": { - "outgoingIpAddresses": [ - { - "address": "13.92.98.111" - }, - { - "address": "40.121.91.41" - }, - { - "address": "40.114.82.191" - }, - { - "address": "23.101.139.153" - }, - { - "address": "23.100.29.190" - }, - { - "address": "23.101.136.201" - }, - { - "address": "104.45.153.81" - }, - { - "address": "23.101.132.208" - }, - { - "address": "52.226.216.197" - }, - { - "address": "52.226.216.187" - }, - { - "address": "40.76.151.25" - }, - { - "address": "40.76.148.50" - }, - { - "address": "20.84.29.29" - }, - { - "address": "20.84.29.18" - }, - { - "address": "40.76.174.83" - }, - { - "address": "40.76.174.39" - } - ], - "accessEndpointIpAddresses": [ - { - "address": "137.135.106.54" - }, - { - "address": "40.117.99.79" - }, - { - "address": "40.117.100.228" - }, - { - "address": "137.116.126.165" - }, - { - "address": "52.226.216.209" - }, - { - "address": "40.76.151.124" - }, - { - "address": "20.84.29.150" - }, - { - "address": "40.76.174.148" - } - ] - }, - "connector": { - "outgoingIpAddresses": [ - { - "address": "40.71.249.139" - }, - { - "address": "40.71.249.205" - }, - { - "address": "40.114.40.132" - }, - { - "address": "40.71.11.80/28" - }, - { - "address": "40.71.15.160/27" - }, - { - "address": "52.188.157.160" - }, - { - "address": "20.88.153.176/28" - }, - { - "address": "20.88.153.192/27" - }, - { - "address": "52.151.221.184" - }, - { - "address": "52.151.221.119" - } - ] - } - } - }, - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Logic/workflows/myworkflowxxx", - "name": "myworkflowxxx", - "type": "Microsoft.Logic/workflows", - "location": "eastus" - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy?api-version=2021-09-01", - "RequestMethod": "PUT", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Length": "274", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-storage/17.2.1 core-rest-pipeline/1.9.1 Node/v16.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "c859722c-dcb8-4464-89e5-6fbb6620d3ba" - }, - "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": "Tue, 14 Jun 2022 07:42:35 GMT", - "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Storage/locations/eastus/asyncoperations/1a6dcae7-abca-4e5a-98fa-911941ccc72d?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": "363833c2-7579-4048-a36a-8294814ae35c", - "x-ms-ratelimit-remaining-subscription-writes": "1198", - "x-ms-request-id": "1a6dcae7-abca-4e5a-98fa-911941ccc72d", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074236Z:363833c2-7579-4048-a36a-8294814ae35c" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Storage/locations/eastus/asyncoperations/1a6dcae7-abca-4e5a-98fa-911941ccc72d?monitor=true\u0026api-version=2021-09-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-storage/17.2.1 core-rest-pipeline/1.9.1 Node/v16.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "edd123da-667a-456f-a8a6-51a07cfcb1de" - }, - "RequestBody": null, - "StatusCode": 202, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Content-Type": "text/plain; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:42:36 GMT", - "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Storage/locations/eastus/asyncoperations/1a6dcae7-abca-4e5a-98fa-911941ccc72d?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": "4607bc00-0a3c-4bd9-a827-5199d4751357", - "x-ms-ratelimit-remaining-subscription-reads": "11999", - "x-ms-request-id": "1d738983-f53a-4f19-9648-60403149723c", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074236Z:4607bc00-0a3c-4bd9-a827-5199d4751357" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Storage/locations/eastus/asyncoperations/1a6dcae7-abca-4e5a-98fa-911941ccc72d?monitor=true\u0026api-version=2021-09-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-storage/17.2.1 core-rest-pipeline/1.9.1 Node/v16.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "7121ca46-f6e4-4cb2-99b5-8a899f41a958" - }, - "RequestBody": null, - "StatusCode": 202, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Content-Type": "text/plain; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:42:36 GMT", - "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Storage/locations/eastus/asyncoperations/1a6dcae7-abca-4e5a-98fa-911941ccc72d?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": "5d506747-14c2-42ff-9138-3d13e65b97ee", - "x-ms-ratelimit-remaining-subscription-reads": "11998", - "x-ms-request-id": "336dbfe8-f61d-44c3-af79-5fb8e6e72285", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074236Z:5d506747-14c2-42ff-9138-3d13e65b97ee" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Storage/locations/eastus/asyncoperations/1a6dcae7-abca-4e5a-98fa-911941ccc72d?monitor=true\u0026api-version=2021-09-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-storage/17.2.1 core-rest-pipeline/1.9.1 Node/v16.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "60d2b37c-fd36-4ae1-b7fc-5f54d2c08065" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json", - "Date": "Tue, 14 Jun 2022 07:42:53 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": "bc1603b5-2dff-4864-a34a-d6d42483c23b", - "x-ms-ratelimit-remaining-subscription-reads": "11997", - "x-ms-request-id": "fb29e466-0432-48d0-a0df-f6725c38819c", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074254Z:bc1603b5-2dff-4864-a34a-d6d42483c23b" - }, - "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-06-14T07:42:34.4940080Z", - "key2": "2022-06-14T07:42:34.4940080Z" - }, - "privateEndpointConnections": [], - "minimumTlsVersion": "TLS1_0", - "allowBlobPublicAccess": true, - "networkAcls": { - "bypass": "AzureServices", - "virtualNetworkRules": [], - "ipRules": [], - "defaultAction": "Allow" - }, - "supportsHttpsTrafficOnly": true, - "encryption": { - "services": { - "file": { - "keyType": "Account", - "enabled": true, - "lastEnabledTime": "2022-06-14T07:42:34.5095914Z" - }, - "blob": { - "keyType": "Account", - "enabled": true, - "lastEnabledTime": "2022-06-14T07:42:34.5095914Z" - } - }, - "keySource": "Microsoft.Storage" - }, - "accessTier": "Hot", - "provisioningState": "Succeeded", - "creationTime": "2022-06-14T07:42:34.3689951Z", - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "a95769ac-6c3d-4825-afb3-9c2c26c8f996" - }, - "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": "Tue, 14 Jun 2022 07:42:57 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "ac3470a5-be51-4e8f-a579-7d8002a2fd08", - "x-ms-ratelimit-remaining-subscription-resource-requests": "49", - "x-ms-request-id": "d57d246d-968d-4378-ae87-8ed895d13e3c_M5CH3_M5CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074258Z:ac3470a5-be51-4e8f-a579-7d8002a2fd08" - }, - "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-06-14T07:42:56.533Z", - "updatedAt": "2022-06-14T07:42:56.533Z", - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "7cb9e9d9-bc87-4c55-923b-71e2c65924fa" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:42:58 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "1be13998-82bf-4d23-9b35-66b7b51aa956", - "x-ms-ratelimit-remaining-subscription-reads": "11996", - "x-ms-request-id": "27af7903-1a98-4161-a4c0-1d64cc7ba536_M7CH3_M7CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074258Z:1be13998-82bf-4d23-9b35-66b7b51aa956" - }, - "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-06-14T07:42:56.533Z", - "updatedAt": "2022-06-14T07:42:56.533Z", - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "05e29660-1e5d-454f-8332-a8132987e60e" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:42:59 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "9e863443-bc31-4a11-905a-445705f2ba0e", - "x-ms-ratelimit-remaining-subscription-reads": "11995", - "x-ms-request-id": "d7de5536-ae06-4e8f-9ddd-9292cea89a8d_M7CH3_M7CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074259Z:9e863443-bc31-4a11-905a-445705f2ba0e" - }, - "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-06-14T07:42:56.533Z", - "updatedAt": "2022-06-14T07:42:56.533Z", - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "657cfa7c-88cc-4f89-9897-7ac88554face" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:43:01 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "b2cf62a6-d8de-4286-bd9d-9628a442f557", - "x-ms-ratelimit-remaining-subscription-reads": "11994", - "x-ms-request-id": "bc1efb6c-c0c0-4b2b-8272-98859aa4a504_M5CH3_M5CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074302Z:b2cf62a6-d8de-4286-bd9d-9628a442f557" - }, - "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-06-14T07:42:56.533Z", - "updatedAt": "2022-06-14T07:42:56.533Z", - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "2c39a9e3-7599-45ad-bb6c-362a17fc8ce5" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:43:04 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "7f1fc272-9ed4-41ef-9ba2-dababdc955bc", - "x-ms-ratelimit-remaining-subscription-reads": "11993", - "x-ms-request-id": "bfb1ab36-5468-4ab1-9896-0d90d7929ac6_M7CH3_M7CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074304Z:7f1fc272-9ed4-41ef-9ba2-dababdc955bc" - }, - "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-06-14T07:42:56.533Z", - "updatedAt": "2022-06-14T07:42:56.533Z", - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "7d3e9ace-016e-4fec-954a-252fec8167a4" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:43:06 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "dcf63aa8-9e7a-48fb-aa26-c67639d61943", - "x-ms-ratelimit-remaining-subscription-reads": "11992", - "x-ms-request-id": "4c5e7ba1-d816-47c4-84dc-627cf57d8b7a_M7CH3_M7CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074307Z:dcf63aa8-9e7a-48fb-aa26-c67639d61943" - }, - "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-06-14T07:42:56.533Z", - "updatedAt": "2022-06-14T07:42:56.533Z", - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "717c8791-aab0-46f1-ad04-5d7cf3092f51" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:43:09 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "154c7580-0fdc-4ad0-83d4-492aecc48813", - "x-ms-ratelimit-remaining-subscription-reads": "11991", - "x-ms-request-id": "9cc9cb25-6fb4-45c8-b1f6-50cce871438e_M7CH3_M7CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074310Z:154c7580-0fdc-4ad0-83d4-492aecc48813" - }, - "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-06-14T07:42:56.533Z", - "updatedAt": "2022-06-14T07:42:56.533Z", - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "97c27520-b7f3-49e2-8c2f-a0d6b049923c" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:43:12 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "b20b7649-1cbf-477f-b926-692b42f53f6e", - "x-ms-ratelimit-remaining-subscription-reads": "11990", - "x-ms-request-id": "8bda0e4e-3949-4da0-a4ef-d9c8032637e2_M7CH3_M7CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074312Z:b20b7649-1cbf-477f-b926-692b42f53f6e" - }, - "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-06-14T07:42:56.533Z", - "updatedAt": "2022-06-14T07:42:56.533Z", - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "ca619b90-3107-4afd-a628-640042e3f467" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:43:15 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "995df567-0b18-4fa1-8b55-573f49c9f5f9", - "x-ms-ratelimit-remaining-subscription-reads": "11989", - "x-ms-request-id": "c10017fa-faec-41fc-a5cb-19e3c39b2dd8_M5CH3_M5CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074316Z:995df567-0b18-4fa1-8b55-573f49c9f5f9" - }, - "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-06-14T07:42:56.533Z", - "updatedAt": "2022-06-14T07:42:56.533Z", - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "9a24c25f-4ca2-4f70-8b54-37d03118abdc" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:43:17 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "41b29902-13bc-4e36-a73e-71550e853156", - "x-ms-ratelimit-remaining-subscription-reads": "11988", - "x-ms-request-id": "b1fd2868-edd1-40f2-8414-8a515a65a246_M5CH3_M5CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074318Z:41b29902-13bc-4e36-a73e-71550e853156" - }, - "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-06-14T07:42:56.533Z", - "updatedAt": "2022-06-14T07:42:56.533Z", - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "c26ef885-7782-4e51-b12a-dd1beb5bbb89" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:43:20 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "11a49681-90f2-4323-b3dc-25a7d993057b", - "x-ms-ratelimit-remaining-subscription-reads": "11987", - "x-ms-request-id": "f95b6e4c-4ccf-4193-b58c-2af7654dfd38_M5CH3_M5CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074321Z:11a49681-90f2-4323-b3dc-25a7d993057b" - }, - "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-06-14T07:42:56.533Z", - "updatedAt": "2022-06-14T07:42:56.533Z", - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "8f261039-9882-4a38-af66-39b304272de5" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:43:23 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "4bb44b5b-822b-4240-82bd-997faec4e8a4", - "x-ms-ratelimit-remaining-subscription-reads": "11986", - "x-ms-request-id": "2214db92-4884-4a14-bf40-67262dab4155_M7CH3_M7CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074323Z:4bb44b5b-822b-4240-82bd-997faec4e8a4" - }, - "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-06-14T07:42:56.533Z", - "updatedAt": "2022-06-14T07:42:56.533Z", - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "b9050d2e-cf8a-4f66-bb76-8e5608f145b3" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:43:25 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "046d93e8-6427-4307-818d-b4cae7905dcb", - "x-ms-ratelimit-remaining-subscription-reads": "11985", - "x-ms-request-id": "72119fb3-441a-4839-9d95-2dbce2f3ec53_M5CH3_M5CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074326Z:046d93e8-6427-4307-818d-b4cae7905dcb" - }, - "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-06-14T07:42:56.533Z", - "updatedAt": "2022-06-14T07:42:56.533Z", - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "1cb7c670-96b1-4f1d-9570-499b10813362" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:43:28 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "2de8074d-eccb-4eb2-ad44-512f63fc58f1", - "x-ms-ratelimit-remaining-subscription-reads": "11984", - "x-ms-request-id": "c4849379-65ac-4e6b-a461-b105b6e6233b_M5CH3_M5CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074329Z:2de8074d-eccb-4eb2-ad44-512f63fc58f1" - }, - "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-06-14T07:42:56.533Z", - "updatedAt": "2022-06-14T07:42:56.533Z", - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "eecccb3e-1932-4134-b8f1-8447cd32ad91" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:43:30 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "6f969bfd-eb25-4712-9797-f45079a17c02", - "x-ms-ratelimit-remaining-subscription-reads": "11983", - "x-ms-request-id": "e68476ba-d4a1-4de1-83c2-937b6ccbea66_M7CH3_M7CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074331Z:6f969bfd-eb25-4712-9797-f45079a17c02" - }, - "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-06-14T07:42:56.533Z", - "updatedAt": "2022-06-14T07:42:56.533Z", - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "5c69f293-a105-4f46-a044-133b9e85b9e7" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:43:33 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "2568585d-e319-46bd-b631-3c90dd8e5bc9", - "x-ms-ratelimit-remaining-subscription-reads": "11982", - "x-ms-request-id": "1a0fbb62-6781-4780-80b7-0ba83fde5917_M7CH3_M7CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074334Z:2568585d-e319-46bd-b631-3c90dd8e5bc9" - }, - "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-06-14T07:42:56.533Z", - "updatedAt": "2022-06-14T07:42:56.533Z", - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "3d1e664f-3ca7-48f5-b492-9b70e6a9476f" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:43:35 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "e5f75082-ed17-487d-82a4-dcdb41bcb655", - "x-ms-ratelimit-remaining-subscription-reads": "11981", - "x-ms-request-id": "86a766ec-5624-41c3-9271-02c2736a0724_M7CH3_M7CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074336Z:e5f75082-ed17-487d-82a4-dcdb41bcb655" - }, - "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-06-14T07:42:56.533Z", - "updatedAt": "2022-06-14T07:42:56.533Z", - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "ea220870-ea4a-4025-9096-ffb7f88255bf" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:43:38 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "b0ed1807-0279-4cdd-8303-63871e7c48df", - "x-ms-ratelimit-remaining-subscription-reads": "11980", - "x-ms-request-id": "7fc50c8f-8ae0-4531-9389-d69faf8de94e_M7CH3_M7CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074339Z:b0ed1807-0279-4cdd-8303-63871e7c48df" - }, - "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-06-14T07:42:56.533Z", - "updatedAt": "2022-06-14T07:42:56.533Z", - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "1311435c-ba79-4d11-a334-64cf2cde6068" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:43:41 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "10c7c928-fa1b-4243-bfcc-ec375c865575", - "x-ms-ratelimit-remaining-subscription-reads": "11979", - "x-ms-request-id": "56236bb5-46ba-4da2-b05c-4f1299dc9ea5_M7CH3_M7CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074342Z:10c7c928-fa1b-4243-bfcc-ec375c865575" - }, - "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-06-14T07:42:56.533Z", - "updatedAt": "2022-06-14T07:42:56.533Z", - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "fa75902d-64b3-4324-b55a-ef2b37ac7e8f" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:43:43 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "b6e527cf-923e-4b0e-8c86-1a15f1fa7c09", - "x-ms-ratelimit-remaining-subscription-reads": "11978", - "x-ms-request-id": "027b64a9-857d-41fd-9391-5973f8eb238b_M7CH3_M7CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074344Z:b6e527cf-923e-4b0e-8c86-1a15f1fa7c09" - }, - "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-06-14T07:42:56.533Z", - "updatedAt": "2022-06-14T07:42:56.533Z", - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "20cfe40d-209b-4575-b597-c64a379d7ae7" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:43:46 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "203d3c54-e959-4b3f-93c6-adc88447be63", - "x-ms-ratelimit-remaining-subscription-reads": "11977", - "x-ms-request-id": "c76119c2-c4d7-454d-9514-c5cfb49b164c_M5CH3_M5CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074347Z:203d3c54-e959-4b3f-93c6-adc88447be63" - }, - "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-06-14T07:42:56.533Z", - "updatedAt": "2022-06-14T07:42:56.533Z", - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "a2139a88-c25f-41d1-8022-1fc62ed062cb" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:43:49 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "57343251-f5d1-424e-844a-81c4af95ceb7", - "x-ms-ratelimit-remaining-subscription-reads": "11976", - "x-ms-request-id": "dbfb7546-6d64-4e89-894d-899470982bba_M5CH3_M5CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074349Z:57343251-f5d1-424e-844a-81c4af95ceb7" - }, - "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-06-14T07:42:56.533Z", - "updatedAt": "2022-06-14T07:43:47.673Z", - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "17534590-9912-4756-af87-04f5d717061d" - }, - "RequestBody": { - "properties": { - "rights": [ - "Listen", - "Send", - "Manage" - ] - } - }, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:43:55 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "a1a12309-bc9a-4039-95b7-272799e5240d", - "x-ms-ratelimit-remaining-subscription-writes": "1197", - "x-ms-request-id": "7409eb25-509b-4d05-b214-63b62c21ba9f_M5CH3_M5CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074356Z:a1a12309-bc9a-4039-95b7-272799e5240d" - }, - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "d2c941ee-6cdb-4fda-8c40-50b832b2bfad" - }, - "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": "Tue, 14 Jun 2022 07:43:58 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "3ec4b389-a4e8-4517-a5ef-339aa3637a41", - "x-ms-ratelimit-remaining-subscription-writes": "1196", - "x-ms-request-id": "53df2713-a96d-48bd-a10e-51663061ccf2_M7CH3_M7CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074359Z:3ec4b389-a4e8-4517-a5ef-339aa3637a41" - }, - "ResponseBody": { - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.EventHub/namespaces/mynamespacexxx/eventhubs/myeventhubxxx", - "name": "myeventhubxxx", - "type": "Microsoft.EventHub/Namespaces/EventHubs", - "location": "East US", - "properties": { - "messageRetentionInDays": 4, - "partitionCount": 4, - "status": "Active", - "createdAt": "2022-06-14T07:43:58.493Z", - "updatedAt": "2022-06-14T07:43:58.773Z", - "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.2 core-rest-pipeline/1.9.1 Node/v16.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "f180c5cd-8181-4bb1-b960-e9c7dd6833ac" - }, - "RequestBody": { - "tags": { - "tag1": "value1" - }, - "location": "eastus", - "properties": { - "sku": { - "name": "PerNode" - }, - "retentionInDays": 30 - } - }, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json", - "Date": "Tue, 14 Jun 2022 07:44:04 GMT", - "Pragma": "no-cache", - "Server": [ - "Microsoft-IIS/10.0", - "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": "98239493-4189-4b55-af58-c413244c2796", - "x-ms-ratelimit-remaining-subscription-writes": "1195", - "x-ms-request-id": "756d29a1-2a46-41f9-bc3f-63fe7e40c6d2", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074405Z:98239493-4189-4b55-af58-c413244c2796", - "X-Powered-By": [ - "ASP.NET", - "ASP.NET" - ] - }, - "ResponseBody": { - "properties": { - "source": "Azure", - "customerId": "26df03da-951c-4337-b534-a598f251a5cb", - "provisioningState": "Succeeded", - "sku": { - "name": "pergb2018", - "lastSkuUpdate": "Fri, 10 Jun 2022 09:26:59 GMT" - }, - "retentionInDays": 30, - "features": { - "legacy": 0, - "searchVersion": 1, - "enableLogAccessUsingOnlyResourcePermissions": true - }, - "workspaceCapping": { - "dailyQuotaGb": -1.0, - "quotaNextResetTime": "Tue, 14 Jun 2022 15:00:00 GMT", - "dataIngestionStatus": "RespectQuota" - }, - "publicNetworkAccessForIngestion": "Enabled", - "publicNetworkAccessForQuery": "Enabled", - "createdDate": "Fri, 10 Jun 2022 09:26:59 GMT", - "modifiedDate": "Tue, 14 Jun 2022 07:26:56 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 80de9f8526ee..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_delete_parameters_for_diagnosticsettings.json +++ /dev/null @@ -1,290 +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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "c851ed82-01b8-47bd-a648-40d59716017d" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Date": "Tue, 14 Jun 2022 07:44:34 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "80b1ec3f-ff1e-426c-94d7-c37d7112ec62", - "x-ms-ratelimit-remaining-subscription-deletes": "14998", - "x-ms-request-id": "eastus:10768136-5908-4416-b887-030de23f9307", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074434Z:80b1ec3f-ff1e-426c-94d7-c37d7112ec62" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountyyy?api-version=2021-09-01", - "RequestMethod": "DELETE", - "RequestHeaders": { - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-storage/17.2.1 core-rest-pipeline/1.9.1 Node/v16.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "dea76e3f-2670-4ff3-9b9d-990420081f4e" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Content-Type": "text/plain; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:44:39 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": "83ea4802-99db-4401-bc69-d94db4c6f679", - "x-ms-ratelimit-remaining-subscription-deletes": "14997", - "x-ms-request-id": "a27ca5cb-a1f9-4bc9-a7d4-0a1c3ac752ad", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074440Z:83ea4802-99db-4401-bc69-d94db4c6f679" - }, - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "ed6791cd-bb91-423a-af0f-74ab630ad7bd" - }, - "RequestBody": null, - "StatusCode": 202, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Date": "Tue, 14 Jun 2022 07:44:41 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": "1a52f799-cf07-4041-aa73-687229b89ab5", - "x-ms-ratelimit-remaining-subscription-deletes": "14996", - "x-ms-request-id": "949f8000-b511-45d2-b620-ce0f16a720d3_M1SN1_M1SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074442Z:1a52f799-cf07-4041-aa73-687229b89ab5" - }, - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "28ed5e4a-24c6-4fca-ab5c-d86a43eacf85" - }, - "RequestBody": null, - "StatusCode": 202, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "698", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:44:42 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": "44", - "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": "8d1fbbcc-191f-4cdd-9562-cc2144d648c5", - "x-ms-ratelimit-remaining-subscription-reads": "11970", - "x-ms-request-id": "b108a383-5452-4cdc-bc74-f1ea44d6c410_M1SN1_M1SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074442Z:8d1fbbcc-191f-4cdd-9562-cc2144d648c5" - }, - "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-06-14T07:42:56.533Z", - "updatedAt": "2022-06-14T07:44:41.583Z", - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "27053663-b5b3-444d-8add-39fe5aba84dc" - }, - "RequestBody": null, - "StatusCode": 202, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "698", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:44:43 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": "58", - "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": "16d779a3-0ad6-4026-a5bd-6f8174b00dd6", - "x-ms-ratelimit-remaining-subscription-reads": "11969", - "x-ms-request-id": "9d029cbe-206a-4ea0-8cc2-d99d682d18f7_M8SN1_M8SN1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074443Z:16d779a3-0ad6-4026-a5bd-6f8174b00dd6" - }, - "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-06-14T07:42:56.533Z", - "updatedAt": "2022-06-14T07:44:41.583Z", - "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.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "bdc9ed3d-b336-40b4-a2cf-7d8a0d974bad" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Date": "Tue, 14 Jun 2022 07:45:41 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": [ - "Service-Bus-Resource-Provider/CH3", - "Microsoft-HTTPAPI/2.0" - ], - "Server-SB": "Service-Bus-Resource-Provider/CH3", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "788ff406-997a-4e8b-804c-ed1f4dbde359", - "x-ms-ratelimit-remaining-subscription-reads": "11968", - "x-ms-request-id": "a6bdadab-52f6-417c-963d-9355e0654650_M5CH3_M5CH3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074542Z:788ff406-997a-4e8b-804c-ed1f4dbde359" - }, - "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.2 core-rest-pipeline/1.9.1 Node/v16.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "c9a3add3-da39-463d-bc1c-2f088bf89540" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Date": "Tue, 14 Jun 2022 07:45:51 GMT", - "Pragma": "no-cache", - "Server": [ - "Microsoft-IIS/10.0", - "Microsoft-IIS/10.0" - ], - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "2c0bee1e-a150-47bd-b807-14d06f9e4825", - "x-ms-ratelimit-remaining-subscription-deletes": "14995", - "x-ms-request-id": "964697b6-8cd2-43d8-933c-86b42e9cb31a", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074552Z:2c0bee1e-a150-47bd-b807-14d06f9e4825", - "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 bf2a86906853..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=2017-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.1 core-rest-pipeline/1.9.1 Node/v16.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "e3bc7039-4ebe-4ec8-80e4-91c23f5de035" - }, - "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": "Tue, 14 Jun 2022 07:44:13 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": "79f4e40b-2b51-4552-914f-c189e0ce3daa", - "x-ms-ratelimit-remaining-subscription-resource-requests": "149", - "x-ms-request-id": "82962ec8-2a70-4828-9b84-ad50a11e364b", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074413Z:79f4e40b-2b51-4552-914f-c189e0ce3daa" - }, - "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 781caa8c8a2f..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=2017-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.1 core-rest-pipeline/1.9.1 Node/v16.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "9c0ab5fd-4c37-4821-8e8c-c7d29e7910c8" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Date": "Tue, 14 Jun 2022 07:44:21 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": "e7d35548-143f-41c5-bac9-67714dddd643", - "x-ms-ratelimit-remaining-subscription-deletes": "14999", - "x-ms-request-id": "a0879495-a29e-43c5-b7e7-8ccbfd290f66", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074421Z:e7d35548-143f-41c5-bac9-67714dddd643" - }, - "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 2284f6913a4d..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=2017-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.1 core-rest-pipeline/1.9.1 Node/v16.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "3376a692-cf44-40a3-8631-382c132a6d12" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:44: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": "9a9048bd-bb0d-4786-91b6-42ed84306d51", - "x-ms-ratelimit-remaining-subscription-reads": "11975", - "x-ms-request-id": "b2934181-bebd-45e6-89df-0e5d0057c7f7", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074415Z:9a9048bd-bb0d-4786-91b6-42ed84306d51" - }, - "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 b1ea78fb3c5d..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_diagnosticsettings_list_test.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Logic/workflows/myworkflowxxx/providers/Microsoft.Insights/diagnosticSettings?api-version=2017-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.1 core-rest-pipeline/1.9.1 Node/v16.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "4c11f526-2a30-474d-9907-67373ef36291" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:44:16 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": "2480d372-f260-4b4c-bba0-a5e7cac41614", - "x-ms-ratelimit-remaining-subscription-reads": "11974", - "x-ms-request-id": "ddf63464-f46b-4372-ab34-63c07ca24036", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074416Z:2480d372-f260-4b4c-bba0-a5e7cac41614" - }, - "ResponseBody": { - "value": [ - { - "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_logprofiles_create_test.json b/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_create_test.json deleted file mode 100644 index b2c226dd8780..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.1 core-rest-pipeline/1.9.1 Node/v16.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "24e8472b-5c31-4c4f-af75-78414569e4be" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:44:22 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": "5cb5bf6d-f9b0-475b-8145-5dcb5cb51ba1", - "x-ms-ratelimit-remaining-subscription-reads": "11973", - "x-ms-request-id": "f6866077-8cc8-4e84-831f-dde8750c7d37", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074422Z:5cb5bf6d-f9b0-475b-8145-5dcb5cb51ba1" - }, - "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.1 core-rest-pipeline/1.9.1 Node/v16.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "3f07d34a-8218-417c-81ab-d5f32b5d5100" - }, - "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": "Tue, 14 Jun 2022 07:44:25 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": "d7e23efa-1acd-4f6c-973b-cdc122848325", - "x-ms-ratelimit-remaining-subscription-writes": "1194", - "x-ms-request-id": "4b990925-00a3-4835-b9b6-d50a48208347", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074425Z:d7e23efa-1acd-4f6c-973b-cdc122848325" - }, - "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 c777b86e547b..000000000000 --- a/sdk/monitor/arm-monitor/recordings/node/monitor_test/recording_logprofiles_delete_test.json +++ /dev/null @@ -1,67 +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.1 core-rest-pipeline/1.9.1 Node/v16.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "09a038fb-79e9-4690-9efd-149b8da2abd2" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Date": "Tue, 14 Jun 2022 07:45:54 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": "5ab6ada8-3f8b-457a-add7-034ce3226079", - "x-ms-ratelimit-remaining-subscription-deletes": "14994", - "x-ms-request-id": "42147f39-550b-48c3-b820-c69bf71fbb24", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074555Z:5ab6ada8-3f8b-457a-add7-034ce3226079" - }, - "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.1 core-rest-pipeline/1.9.1 Node/v16.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "5b9c66cc-b507-4294-90eb-6b9a13c83682" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:45:55 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": "819cb795-2492-432c-bbe1-6f7403268805", - "x-ms-ratelimit-remaining-subscription-reads": "11967", - "x-ms-request-id": "c5e8bee4-b9e0-44bb-b91f-3ef704b5d0e4", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074555Z:819cb795-2492-432c-bbe1-6f7403268805" - }, - "ResponseBody": { - "value": [] - } - } - ], - "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 f78f0b054320..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.1 core-rest-pipeline/1.9.1 Node/v16.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "539e3082-7924-42b1-bfa3-c91d620fb8fe" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:44: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": "1170c001-a238-4e19-8aa8-5b1060f9161d", - "x-ms-ratelimit-remaining-subscription-reads": "11972", - "x-ms-request-id": "033e8554-1f16-4fbb-8813-5114a6e07774", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074426Z:1170c001-a238-4e19-8aa8-5b1060f9161d" - }, - "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 0e5bf201d251..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.1 core-rest-pipeline/1.9.1 Node/v16.13.2 OS/(x64-Windows_NT-10.0.19044)", - "x-ms-client-request-id": "0a0355ec-1076-4498-975c-852c7ae211af" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 14 Jun 2022 07:44:27 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": "Microsoft-IIS/10.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "c471e4af-6f4a-4ca7-85e3-723344494f36", - "x-ms-ratelimit-remaining-subscription-reads": "11971", - "x-ms-request-id": "a4889967-c6ca-483c-ad2c-93efb8203824", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220614T074427Z:c471e4af-6f4a-4ca7-85e3-723344494f36" - }, - "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 17f1d63828bb..4457858c1269 100644 --- a/sdk/monitor/arm-monitor/review/arm-monitor.api.md +++ b/sdk/monitor/arm-monitor/review/arm-monitor.api.md @@ -10,11 +10,6 @@ import { PagedAsyncIterableIterator } from '@azure/core-paging'; import { PollerLike } from '@azure/core-lro'; import { PollOperationState } from '@azure/core-lro'; -// @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; @@ -195,8 +190,13 @@ 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 ActivityLogAlertResource = AzureResourceAutoGenerated & { @@ -297,15 +297,6 @@ export type AggregationType = "None" | "Average" | "Count" | "Minimum" | "Maximu // @public export type AggregationTypeEnum = string; -// @public -export type AlertingAction = Action & { - odataType: "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction"; - severity: AlertSeverity; - aznsAction?: AzNsActionGroup; - throttlingInMin?: number; - trigger: TriggerCondition; -}; - // @public export interface AlertRuleAllOfCondition { allOf: AlertRuleAnyOfOrLeafCondition[]; @@ -439,7 +430,7 @@ export interface AlertRulesUpdateOptionalParams extends coreClient.OperationOpti export type AlertRulesUpdateResponse = AlertRuleResource; // @public -export type AlertSeverity = string; +export type AlertSeverity = number; // @public export interface ArmRoleReceiver { @@ -567,13 +558,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; @@ -672,10 +656,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 { @@ -691,12 +691,6 @@ export interface Context { // @public export type CreatedByType = string; -// @public -export interface Criteria { - dimensions?: Dimension[]; - metricName: string; -} - // @public export type CriterionType = string; @@ -711,13 +705,13 @@ export interface DataCollectionEndpoint { } // @public -export type DataCollectionEndpointConfigurationAccess = ConfigurationAccessEndpointSpec; +export type DataCollectionEndpointConfigurationAccess = ConfigurationAccessEndpointSpec & {}; // @public -export type DataCollectionEndpointLogsIngestion = LogsIngestionEndpointSpec; +export type DataCollectionEndpointLogsIngestion = LogsIngestionEndpointSpec & {}; // @public -export type DataCollectionEndpointNetworkAcls = NetworkRuleSet; +export type DataCollectionEndpointNetworkAcls = NetworkRuleSet & {}; // @public export interface DataCollectionEndpointResource { @@ -746,10 +740,10 @@ export interface DataCollectionEndpointResourceListResult { } // @public -export type DataCollectionEndpointResourceProperties = DataCollectionEndpoint; +export type DataCollectionEndpointResourceProperties = DataCollectionEndpoint & {}; // @public -export type DataCollectionEndpointResourceSystemData = SystemData; +export type DataCollectionEndpointResourceSystemData = SystemData & {}; // @public export interface DataCollectionEndpoints { @@ -841,7 +835,7 @@ export interface DataCollectionRuleAssociation { } // @public -export type DataCollectionRuleAssociationMetadata = Metadata; +export type DataCollectionRuleAssociationMetadata = Metadata & {}; // @public export interface DataCollectionRuleAssociationProxyOnlyResource { @@ -864,10 +858,10 @@ export interface DataCollectionRuleAssociationProxyOnlyResourceListResult { } // @public -export type DataCollectionRuleAssociationProxyOnlyResourceProperties = DataCollectionRuleAssociation; +export type DataCollectionRuleAssociationProxyOnlyResourceProperties = DataCollectionRuleAssociation & {}; // @public -export type DataCollectionRuleAssociationProxyOnlyResourceSystemData = SystemData; +export type DataCollectionRuleAssociationProxyOnlyResourceSystemData = SystemData & {}; // @public export interface DataCollectionRuleAssociations { @@ -941,13 +935,13 @@ export interface DataCollectionRuleAssociationsListByRuleOptionalParams extends export type DataCollectionRuleAssociationsListByRuleResponse = DataCollectionRuleAssociationProxyOnlyResourceListResult; // @public -export type DataCollectionRuleDataSources = DataSourcesSpec; +export type DataCollectionRuleDataSources = DataSourcesSpec & {}; // @public -export type DataCollectionRuleDestinations = DestinationsSpec; +export type DataCollectionRuleDestinations = DestinationsSpec & {}; // @public -export type DataCollectionRuleMetadata = Metadata; +export type DataCollectionRuleMetadata = Metadata & {}; // @public export interface DataCollectionRuleResource { @@ -981,10 +975,10 @@ export interface DataCollectionRuleResourceListResult { } // @public -export type DataCollectionRuleResourceProperties = DataCollectionRule; +export type DataCollectionRuleResourceProperties = DataCollectionRule & {}; // @public -export type DataCollectionRuleResourceSystemData = SystemData; +export type DataCollectionRuleResourceSystemData = SystemData & {}; // @public export interface DataCollectionRules { @@ -1084,7 +1078,7 @@ export interface DestinationsSpec { } // @public -export type DestinationsSpecAzureMonitorMetrics = AzureMonitorMetricsDestination; +export type DestinationsSpecAzureMonitorMetrics = AzureMonitorMetricsDestination & {}; // @public export interface DiagnosticSettings { @@ -1169,10 +1163,13 @@ export interface DiagnosticSettingsResourceCollection { // @public export interface Dimension { name: string; - operator: Operator; + operator: DimensionOperator; values: string[]; } +// @public +export type DimensionOperator = string; + // @public export type DynamicMetricCriteria = MultiMetricCriteria & { criterionType: "DynamicThresholdCriterion"; @@ -1209,9 +1206,6 @@ export interface EmailReceiver { useCommonAlertSchema?: boolean; } -// @public -export type Enabled = string; - // @public export interface EnableRequest { receiverName: string; @@ -1225,7 +1219,7 @@ export interface ErrorAdditionalInfo { // @public export interface ErrorContract { - error?: ErrorResponse; + error?: ErrorResponseAutoGenerated; } // @public @@ -1251,6 +1245,15 @@ export interface ErrorResponse { // @public export interface ErrorResponseAutoGenerated { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorResponseAutoGenerated[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponseAutoGenerated2 { readonly code?: string; readonly message?: string; } @@ -1381,6 +1384,9 @@ export interface ItsmReceiver { workspaceId: string; } +// @public +export type Kind = string; + // @public export enum KnownAggregationTypeEnum { // (undocumented) @@ -1398,15 +1404,15 @@ export enum KnownAggregationTypeEnum { // @public export enum KnownAlertSeverity { // (undocumented) - Four = "4", + Four = 4, // (undocumented) - One = "1", + One = 1, // (undocumented) - Three = "3", + Three = 3, // (undocumented) - Two = "2", + Two = 2, // (undocumented) - Zero = "0" + Zero = 0 } // @public @@ -1422,20 +1428,6 @@ export enum KnownBaselineSensitivity { // @public export type KnownColumnDefinitionType = string; -// @public -export enum KnownConditionalOperator { - // (undocumented) - Equal = "Equal", - // (undocumented) - GreaterThan = "GreaterThan", - // (undocumented) - GreaterThanOrEqual = "GreaterThanOrEqual", - // (undocumented) - LessThan = "LessThan", - // (undocumented) - LessThanOrEqual = "LessThanOrEqual" -} - // @public export enum KnownCreatedByType { // (undocumented) @@ -1482,6 +1474,14 @@ export enum KnownDataStatus { Present = "present" } +// @public +export enum KnownDimensionOperator { + // (undocumented) + Exclude = "Exclude", + // (undocumented) + Include = "Include" +} + // @public export enum KnownDynamicThresholdOperator { // (undocumented) @@ -1503,16 +1503,16 @@ export enum KnownDynamicThresholdSensitivity { } // @public -export enum KnownEnabled { +export type KnownExtensionDataSourceStreams = string; + +// @public +export enum KnownKind { // (undocumented) - False = "false", + LogAlert = "LogAlert", // (undocumented) - True = "true" + LogToMetric = "LogToMetric" } -// @public -export type KnownExtensionDataSourceStreams = string; - // @public export enum KnownKnownColumnDefinitionType { // (undocumented) @@ -1763,14 +1763,6 @@ export enum KnownMetricClass { Transactions = "Transactions" } -// @public -export enum KnownMetricTriggerType { - // (undocumented) - Consecutive = "Consecutive", - // (undocumented) - Total = "Total" -} - // @public export enum KnownMetricUnit { // (undocumented) @@ -1840,8 +1832,6 @@ export enum KnownOperator { // (undocumented) GreaterThanOrEqual = "GreaterThanOrEqual", // (undocumented) - Include = "Include", - // (undocumented) LessThan = "LessThan", // (undocumented) LessThanOrEqual = "LessThanOrEqual" @@ -1850,27 +1840,9 @@ export enum KnownOperator { // @public export type KnownPerfCounterDataSourceStreams = string; -// @public -export enum KnownProvisioningState { - // (undocumented) - Canceled = "Canceled", - // (undocumented) - Deploying = "Deploying", - // (undocumented) - Failed = "Failed", - // (undocumented) - Succeeded = "Succeeded" -} - // @public export type KnownPublicNetworkAccessOptions = string; -// @public -export enum KnownQueryType { - // (undocumented) - ResultCount = "ResultCount" -} - // @public export enum KnownScaleRuleMetricDimensionOperationType { // (undocumented) @@ -1888,6 +1860,20 @@ export type KnownSyslogDataSourceLogLevels = string; // @public export type KnownSyslogDataSourceStreams = string; +// @public +export enum KnownTimeAggregation { + // (undocumented) + Average = "Average", + // (undocumented) + Count = "Count", + // (undocumented) + Maximum = "Maximum", + // (undocumented) + Minimum = "Minimum", + // (undocumented) + Total = "Total" +} + // @public export type KnownWindowsEventLogDataSourceStreams = string; @@ -1921,7 +1907,7 @@ export interface LogFilesDataSource { } // @public -export type LogFilesDataSourceSettings = LogFileSettings; +export type LogFilesDataSourceSettings = LogFileSettings & {}; // @public export interface LogFileSettings { @@ -1929,7 +1915,7 @@ export interface LogFileSettings { } // @public -export type LogFileSettingsText = LogFileTextSettings; +export type LogFileSettingsText = LogFileTextSettings & {}; // @public export interface LogFileTextSettings { @@ -1944,14 +1930,6 @@ export interface LogicAppReceiver { useCommonAlertSchema?: boolean; } -// @public -export interface LogMetricTrigger { - metricColumn?: string; - metricTriggerType?: MetricTriggerType; - threshold?: number; - thresholdOperator?: ConditionalOperator; -} - // @public export interface LogProfileCollection { value: LogProfileResource[]; @@ -2019,34 +1997,6 @@ export interface LogProfilesUpdateOptionalParams extends coreClient.OperationOpt // @public export type LogProfilesUpdateResponse = LogProfileResource; -// @public -export type LogSearchRuleResource = ResourceAutoGenerated & { - readonly createdWithApiVersion?: string; - readonly isLegacyLogAnalyticsRule?: boolean; - description?: string; - displayName?: string; - autoMitigate?: boolean; - enabled?: Enabled; - readonly lastUpdatedTime?: Date; - readonly provisioningState?: ProvisioningState; - source: Source; - schedule?: Schedule; - action: ActionUnion; -}; - -// @public -export interface LogSearchRuleResourceCollection { - value?: LogSearchRuleResource[]; -} - -// @public -export interface LogSearchRuleResourcePatch { - enabled?: Enabled; - tags?: { - [propertyName: string]: string; - }; -} - // @public export interface LogSettings { category?: string; @@ -2059,12 +2009,6 @@ export interface LogsIngestionEndpointSpec { readonly endpoint?: string; } -// @public -export type LogToMetricAction = Action & { - odataType: "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction"; - criteria: Criteria[]; -}; - // @public export interface ManagementEventAggregationCondition { operator?: ConditionOperator; @@ -2412,9 +2356,6 @@ export interface MetricTrigger { timeWindow: string; } -// @public -export type MetricTriggerType = string; - // @public export type MetricUnit = string; @@ -2841,9 +2782,6 @@ export interface PrivateLinkServiceConnectionStateProperty { status: string; } -// @public -export type ProvisioningState = string; - // @public export interface ProxyOnlyResource { readonly id?: string; @@ -2858,9 +2796,6 @@ export interface ProxyResource { readonly type?: string; } -// @public -export type QueryType = string; - // @public export type ReceiverStatus = "NotSpecified" | "Enabled" | "Disabled"; @@ -2894,14 +2829,8 @@ export interface Resource { // @public export interface ResourceAutoGenerated { - readonly etag?: string; readonly id?: string; - readonly kind?: string; - location: string; readonly name?: string; - tags?: { - [propertyName: string]: string; - }; readonly type?: string; } @@ -3045,19 +2974,74 @@ 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 type ScheduledQueryRuleResource = TrackedResource & { + kind?: Kind; + readonly etag?: string; + readonly systemData?: SystemData; + readonly createdWithApiVersion?: string; + readonly isLegacyLogAnalyticsRule?: boolean; + description?: string; + displayName?: string; + severity?: AlertSeverity; + enabled?: boolean; + scopes?: string[]; + evaluationFrequency?: string; + windowSize?: string; + overrideQueryTimeRange?: string; + targetResourceTypes?: string[]; + criteria?: ScheduledQueryRuleCriteria; + muteActionsDuration?: string; + actions?: Actions; + readonly isWorkspaceAlertsStorageConfigured?: boolean; + checkWorkspaceAlertsStorageConfigured?: boolean; + skipQueryValidation?: boolean; + autoMitigate?: boolean; +}; + +// @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; + readonly isLegacyLogAnalyticsRule?: boolean; + readonly isWorkspaceAlertsStorageConfigured?: boolean; + muteActionsDuration?: string; + overrideQueryTimeRange?: string; + 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 @@ -3065,7 +3049,7 @@ export interface ScheduledQueryRulesCreateOrUpdateOptionalParams extends coreCli } // @public -export type ScheduledQueryRulesCreateOrUpdateResponse = LogSearchRuleResource; +export type ScheduledQueryRulesCreateOrUpdateResponse = ScheduledQueryRuleResource; // @public export interface ScheduledQueryRulesDeleteOptionalParams extends coreClient.OperationOptions { @@ -3076,30 +3060,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 type ScopedResource = ProxyResource & { @@ -3146,14 +3142,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[]; @@ -3225,6 +3213,9 @@ export type ThresholdRuleCondition = RuleCondition & { timeAggregation?: TimeAggregationOperator; }; +// @public +export type TimeAggregation = string; + // @public export type TimeAggregationOperator = "Average" | "Minimum" | "Maximum" | "Total" | "Last"; @@ -3254,11 +3245,12 @@ export interface TimeWindow { } // @public -export interface TriggerCondition { - metricTrigger?: LogMetricTrigger; - threshold: number; - thresholdOperator: ConditionalOperator; -} +export type TrackedResource = ResourceAutoGenerated & { + tags?: { + [propertyName: string]: string; + }; + location: string; +}; // @public export interface VMInsights { diff --git a/sdk/monitor/arm-monitor/sample.env b/sdk/monitor/arm-monitor/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/monitor/arm-monitor/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-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 e04f96a1f731..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsCreateOrUpdateSample.ts +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { 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/2015-04-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" }] - } - ], - 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: {}, - 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 8d49bd695e5b..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/2015-04-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 259a466cbd33..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/2015-04-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 04b64b11b11c..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/2015-04-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 e25c994424f6..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/2015-04-01/examples/listAutoscaleSettingBySubscription.json - */ -async function listAutoscaleSettings() { - 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); -} - -listAutoscaleSettings().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 e40b7242e80f..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsUpdateSample.ts +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// 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/2015-04-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" }] - } - ], - 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: { - $type: - "Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary" - }, - 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 06272e6bc9f6..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/2017-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 12e5c007dc32..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCategoryListSample.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 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/2017-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 result = await client.diagnosticSettingsCategory.list(resourceUri); - console.log(result); -} - -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 6fa2f892b47d..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCreateOrUpdateSample.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -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/2017-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/eventhubs/myeventhub/authorizationrules/myrule", - eventHubName: "myeventhub", - logAnalyticsDestinationType: "Dedicated", - logs: [ - { - category: "WorkflowRuntime", - enabled: true, - retentionPolicy: { days: 0, enabled: false } - } - ], - 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); 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 81dbb6ecb822..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/2017-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 5fdb2c168237..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsGetSample.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 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/2017-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); 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 5870ba90b4b3..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsListSample.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 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/2017-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 result = await client.diagnosticSettings.list(resourceUri); - console.log(result); -} - -getsTheDiagnosticSetting().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/privateEndpointConnectionsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.ts deleted file mode 100644 index 428d68626435..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/2019-10-17-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 7000adc1396d..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/2019-10-17-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 46bdb2873e37..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/2019-10-17-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 c3131689799f..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsListByPrivateLinkScopeSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// 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/2019-10-17-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 resArray = new Array(); - for await (let item of client.privateEndpointConnections.listByPrivateLinkScope( - resourceGroupName, - scopeName - )) { - resArray.push(item); - } - console.log(resArray); -} - -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 9f3d578ad2f3..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/2019-10-17-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 968c40731005..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkResourcesListByPrivateLinkScopeSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// 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/2019-10-17-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 resArray = new Array(); - for await (let item of client.privateLinkResources.listByPrivateLinkScope( - resourceGroupName, - scopeName - )) { - resArray.push(item); - } - console.log(resArray); -} - -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 fbc659366e32..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/2019-10-17-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 6878cecdad91..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/2019-10-17-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 8ad05ff860ca..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/2019-10-17-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 6613c5534c4a..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/2019-10-17-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 910faa6ffd11..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/2019-10-17-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 f78060f8a6b8..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesCreateOrUpdateSample.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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/2019-10-17-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 = { - 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/2019-10-17-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 = { - 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 d94e50bc41b3..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/2019-10-17-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 1cd5aefa1a38..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/2019-10-17-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 1d7b4f002a03..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/2019-10-17-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 da347b2cd80c..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/2019-10-17-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 55b909ad32aa..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/2019-10-17-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 d161860329df..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/README.md +++ /dev/null @@ -1,252 +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/2015-04-01/examples/createOrUpdateAutoscaleSetting.json | -| [autoscaleSettingsDeleteSample.js][autoscalesettingsdeletesample] | Deletes and autoscale setting x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/deleteAutoscaleSetting.json | -| [autoscaleSettingsGetSample.js][autoscalesettingsgetsample] | Gets an autoscale setting x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-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/2015-04-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/2015-04-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/2015-04-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/2017-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/2017-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/2017-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/2017-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/2017-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/2017-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 | -| [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/2019-10-17-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/2019-10-17-preview/examples/PrivateEndpointConnectionDelete.json | -| [privateEndpointConnectionsGetSample.js][privateendpointconnectionsgetsample] | Gets a private endpoint connection. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2019-10-17-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/2019-10-17-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/2019-10-17-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/2019-10-17-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/2019-10-17-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/2019-10-17-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/2019-10-17-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/2019-10-17-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/2019-10-17-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/2019-10-17-preview/examples/PrivateLinkScopesCreate.json | -| [privateLinkScopesDeleteSample.js][privatelinkscopesdeletesample] | Deletes a Azure Monitor PrivateLinkScope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2019-10-17-preview/examples/PrivateLinkScopesDelete.json | -| [privateLinkScopesGetSample.js][privatelinkscopesgetsample] | Returns a Azure Monitor PrivateLinkScope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2019-10-17-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/2019-10-17-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/2019-10-17-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/2019-10-17-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://nodejs.org/about/releases/). - -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 -[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 b054ae08a63b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsCreateOrUpdateSample.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 autoscale setting. - * - * @summary Creates or updates an autoscale setting. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-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" }], - }, - ], - 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: {}, - 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 bed67aa4faa6..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/2015-04-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 347cd846c8d4..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/2015-04-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 2af1041c0e58..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/2015-04-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 2de09c3627ca..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/2015-04-01/examples/listAutoscaleSettingBySubscription.json - */ -async function listAutoscaleSettings() { - 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); -} - -listAutoscaleSettings().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 3ed89b6a9cf1..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsUpdateSample.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 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/2015-04-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" }], - }, - ], - 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: { - $type: "Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary", - }, - 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 bb38534cb6fd..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/2017-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 8159cc297940..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCategoryListSample.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 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/2017-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 result = await client.diagnosticSettingsCategory.list(resourceUri); - console.log(result); -} - -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 6c9873e5f5fa..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCreateOrUpdateSample.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 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/2017-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/eventhubs/myeventhub/authorizationrules/myrule", - eventHubName: "myeventhub", - logAnalyticsDestinationType: "Dedicated", - logs: [ - { - category: "WorkflowRuntime", - enabled: true, - retentionPolicy: { days: 0, enabled: false }, - }, - ], - 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); 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 bf92ef5faec0..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/2017-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 931cd946c08f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsGetSample.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 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/2017-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); 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 70506c8d6df4..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsListSample.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 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/2017-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 result = await client.diagnosticSettings.list(resourceUri); - console.log(result); -} - -getsTheDiagnosticSetting().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 e18cab3fbeed..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": ">=12.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/privateEndpointConnectionsCreateOrUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsCreateOrUpdateSample.js deleted file mode 100644 index 09fc2a8cd940..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/2019-10-17-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 0bf2b215457b..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/2019-10-17-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 8f297aa9cfe9..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/2019-10-17-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 7500faabe6d5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsListByPrivateLinkScopeSample.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/2019-10-17-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 resArray = new Array(); - for await (let item of client.privateEndpointConnections.listByPrivateLinkScope( - resourceGroupName, - scopeName - )) { - resArray.push(item); - } - console.log(resArray); -} - -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 d31e2056f910..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/2019-10-17-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 13c1c242d3dd..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkResourcesListByPrivateLinkScopeSample.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 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/2019-10-17-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 resArray = new Array(); - for await (let item of client.privateLinkResources.listByPrivateLinkScope( - resourceGroupName, - scopeName - )) { - resArray.push(item); - } - console.log(resArray); -} - -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 02239b075b4f..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/2019-10-17-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 269e5653609e..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/2019-10-17-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 ac73c4bf0ae9..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/2019-10-17-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 f9602556e06c..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/2019-10-17-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 bdedd509c009..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/2019-10-17-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 fe5de1905632..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesCreateOrUpdateSample.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 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/2019-10-17-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 = { - 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/2019-10-17-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 = { - 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 1f1b2aa95ad6..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/2019-10-17-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 b57a0fad77de..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/2019-10-17-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 61f5ed823f19..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/2019-10-17-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 98606a80df87..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/2019-10-17-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 e125dd5c94b1..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/2019-10-17-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 c1db098dbf32..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/README.md +++ /dev/null @@ -1,265 +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/2015-04-01/examples/createOrUpdateAutoscaleSetting.json | -| [autoscaleSettingsDeleteSample.ts][autoscalesettingsdeletesample] | Deletes and autoscale setting x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/deleteAutoscaleSetting.json | -| [autoscaleSettingsGetSample.ts][autoscalesettingsgetsample] | Gets an autoscale setting x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-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/2015-04-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/2015-04-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/2015-04-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/2017-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/2017-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/2017-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/2017-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/2017-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/2017-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 | -| [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/2019-10-17-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/2019-10-17-preview/examples/PrivateEndpointConnectionDelete.json | -| [privateEndpointConnectionsGetSample.ts][privateendpointconnectionsgetsample] | Gets a private endpoint connection. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2019-10-17-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/2019-10-17-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/2019-10-17-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/2019-10-17-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/2019-10-17-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/2019-10-17-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/2019-10-17-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/2019-10-17-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/2019-10-17-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/2019-10-17-preview/examples/PrivateLinkScopesCreate.json | -| [privateLinkScopesDeleteSample.ts][privatelinkscopesdeletesample] | Deletes a Azure Monitor PrivateLinkScope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2019-10-17-preview/examples/PrivateLinkScopesDelete.json | -| [privateLinkScopesGetSample.ts][privatelinkscopesgetsample] | Returns a Azure Monitor PrivateLinkScope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2019-10-17-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/2019-10-17-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/2019-10-17-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/2019-10-17-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://nodejs.org/about/releases/). - -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 -[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 2ff0c432717d..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": ">=12.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": "^12.0.0", - "typescript": "~4.4.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 e04f96a1f731..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsCreateOrUpdateSample.ts +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { 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/2015-04-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" }] - } - ], - 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: {}, - 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 8d49bd695e5b..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/2015-04-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 259a466cbd33..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/2015-04-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 04b64b11b11c..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/2015-04-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 e25c994424f6..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/2015-04-01/examples/listAutoscaleSettingBySubscription.json - */ -async function listAutoscaleSettings() { - 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); -} - -listAutoscaleSettings().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 e40b7242e80f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsUpdateSample.ts +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// 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/2015-04-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" }] - } - ], - 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: { - $type: - "Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary" - }, - 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 06272e6bc9f6..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/2017-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 12e5c007dc32..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCategoryListSample.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 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/2017-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 result = await client.diagnosticSettingsCategory.list(resourceUri); - console.log(result); -} - -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 6fa2f892b47d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCreateOrUpdateSample.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -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/2017-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/eventhubs/myeventhub/authorizationrules/myrule", - eventHubName: "myeventhub", - logAnalyticsDestinationType: "Dedicated", - logs: [ - { - category: "WorkflowRuntime", - enabled: true, - retentionPolicy: { days: 0, enabled: false } - } - ], - 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); 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 81dbb6ecb822..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/2017-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 5fdb2c168237..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsGetSample.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 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/2017-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); 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 5870ba90b4b3..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsListSample.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 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/2017-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 result = await client.diagnosticSettings.list(resourceUri); - console.log(result); -} - -getsTheDiagnosticSetting().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/privateEndpointConnectionsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.ts deleted file mode 100644 index 428d68626435..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/2019-10-17-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 7000adc1396d..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/2019-10-17-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 46bdb2873e37..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/2019-10-17-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 c3131689799f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsListByPrivateLinkScopeSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// 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/2019-10-17-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 resArray = new Array(); - for await (let item of client.privateEndpointConnections.listByPrivateLinkScope( - resourceGroupName, - scopeName - )) { - resArray.push(item); - } - console.log(resArray); -} - -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 9f3d578ad2f3..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/2019-10-17-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 968c40731005..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkResourcesListByPrivateLinkScopeSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// 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/2019-10-17-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 resArray = new Array(); - for await (let item of client.privateLinkResources.listByPrivateLinkScope( - resourceGroupName, - scopeName - )) { - resArray.push(item); - } - console.log(resArray); -} - -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 fbc659366e32..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/2019-10-17-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 6878cecdad91..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/2019-10-17-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 8ad05ff860ca..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/2019-10-17-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 6613c5534c4a..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/2019-10-17-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 910faa6ffd11..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/2019-10-17-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 f78060f8a6b8..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesCreateOrUpdateSample.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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/2019-10-17-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 = { - 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/2019-10-17-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 = { - 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 d94e50bc41b3..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/2019-10-17-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 1cd5aefa1a38..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/2019-10-17-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 1d7b4f002a03..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/2019-10-17-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 da347b2cd80c..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/2019-10-17-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 55b909ad32aa..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/2019-10-17-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/models/index.ts b/sdk/monitor/arm-monitor/src/models/index.ts index 8c5801185554..f60ab4477a58 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 @@ -1142,85 +1141,204 @@ export interface MetricAlertStatusProperties { timestamp?: Date; } -/** Specifies the log search query. */ -export interface Source { - /** Log search query. Required for action type - AlertingAction */ +/** 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; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +/** 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; - /** 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; + /** 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; } -/** 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; +/** 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[]; } -/** 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"; +/** 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; } -/** An azure resource object */ +/** 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 }; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ export interface ResourceAutoGenerated { /** - * 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 */ - tags?: { [propertyName: string]: string }; +} + +/** Describes the format of Error response. */ +export interface ErrorContract { + /** The error details. */ + error?: ErrorResponseAutoGenerated; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.) */ +export interface ErrorResponseAutoGenerated { /** - * 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 error code. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly kind?: string; + readonly code?: 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. + * The error message. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly etag?: string; + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorResponseAutoGenerated[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; } -/** Describes the format of Error response. */ -export interface ErrorContract { - /** The error details. */ - error?: ErrorResponse; +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly info?: Record; } -/** The log search rule resource for patch operations. */ -export interface LogSearchRuleResourcePatch { +/** The scheduled query rule resource for patch operations. */ +export interface ScheduledQueryRuleResourcePatch { /** 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; -} - -/** Represents a collection of Log Search rule resources. */ -export interface LogSearchRuleResourceCollection { - /** The values for the Log Search Rule resources. */ - value?: LogSearchRuleResource[]; + /** + * The api-version used when creating this alert rule + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly createdWithApiVersion?: string; + /** + * True if alert rule is legacy Log Analytic rule + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isLegacyLogAnalyticsRule?: boolean; + /** The description of the scheduled query rule. */ + description?: string; + /** The display name of the alert rule */ + displayName?: string; + /** Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules of the kind LogAlert. */ + severity?: AlertSeverity; + /** The flag which indicates whether this scheduled query rule is enabled. Value should be true or false */ + enabled?: boolean; + /** The list of resource id's that this scheduled query rule is scoped to. */ + scopes?: string[]; + /** How often the scheduled query rule is evaluated represented in ISO 8601 duration format. Relevant and required only for rules of the kind LogAlert. */ + evaluationFrequency?: string; + /** The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required only for rules of the kind LogAlert. */ + windowSize?: string; + /** If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert. */ + overrideQueryTimeRange?: string; + /** List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual machine in the resource group which meet the alert criteria. Relevant only for rules of the kind LogAlert */ + targetResourceTypes?: string[]; + /** The rule criteria that defines the conditions of the scheduled query rule. */ + criteria?: ScheduledQueryRuleCriteria; + /** Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. Relevant only for rules of the kind LogAlert. */ + muteActionsDuration?: string; + /** Actions to invoke when the alert fires. */ + actions?: Actions; + /** + * The flag which indicates whether this scheduled query rule has been configured to be stored in the customer's storage. The default is false. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isWorkspaceAlertsStorageConfigured?: boolean; + /** The flag which indicates whether this scheduled query rule should be stored in the customer's storage. The default is false. Relevant only for rules of the kind LogAlert. */ + checkWorkspaceAlertsStorageConfigured?: boolean; + /** The flag which indicates whether the provided query should be validated or not. The default is false. Relevant only for rules of the kind LogAlert. */ + skipQueryValidation?: boolean; + /** The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only for rules of the kind LogAlert. */ + autoMitigate?: boolean; } /** Represents collection of metric namespaces. */ @@ -1370,20 +1488,6 @@ export interface OperationStatus { error?: ErrorResponseCommon; } -/** The resource management error additional info. */ -export interface ErrorAdditionalInfo { - /** - * The additional info type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * The additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly info?: Record; -} - /** A list of private link resources */ export interface PrivateLinkResourceListResult { /** @@ -1486,7 +1590,7 @@ export interface AzureResourceAutoGenerated { } /** The error response. */ -export interface ErrorResponseAutoGenerated { +export interface ErrorResponseAutoGenerated2 { /** * The error code. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1616,22 +1720,6 @@ export interface NetworkRuleSet { publicNetworkAccess?: KnownPublicNetworkAccessOptions; } -/** Metadata pertaining to creation and last modification of the resource. */ -export interface SystemData { - /** The identity that created the resource. */ - createdBy?: string; - /** The type of identity that created the resource. */ - createdByType?: CreatedByType; - /** The timestamp of resource creation (UTC). */ - createdAt?: Date; - /** The identity that last modified the resource. */ - lastModifiedBy?: string; - /** The type of identity that last modified the resource. */ - lastModifiedByType?: CreatedByType; - /** The timestamp of resource last modification (UTC) */ - lastModifiedAt?: Date; -} - /** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ export interface ErrorResponseCommonV2 { /** The error object. */ @@ -2124,56 +2212,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 type AutoscaleSettingResource = Resource & { /** the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified. */ @@ -2445,64 +2483,21 @@ export type MetricAlertMultipleResourceMultipleMetricCriteria = MetricAlertCrite allOf?: MultiMetricCriteriaUnion[]; }; -/** Specify action need to be taken when rule type is Alert */ -export type AlertingAction = 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; -}; +/** Metadata pertaining to creation and last modification of the resource. */ +export type DataCollectionEndpointResourceSystemData = SystemData & {}; -/** Specify action need to be taken when rule type is converting log to metric */ -export type LogToMetricAction = 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[]; -}; +/** Metadata pertaining to creation and last modification of the resource. */ +export type DataCollectionRuleAssociationProxyOnlyResourceSystemData = SystemData & {}; -/** The Log Search Rule resource. */ -export type LogSearchRuleResource = ResourceAutoGenerated & { - /** - * 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; +/** Metadata pertaining to creation and last modification of the resource. */ +export type DataCollectionRuleResourceSystemData = SystemData & {}; + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export type TrackedResource = ResourceAutoGenerated & { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; }; /** VM Insights onboarding status for a resource. */ @@ -2599,55 +2594,46 @@ export type ActivityLogAlertResource = AzureResourceAutoGenerated & { }; /** Resource properties. */ -export type DataCollectionEndpointResourceProperties = DataCollectionEndpoint; +export type DataCollectionEndpointResourceProperties = DataCollectionEndpoint & {}; /** The endpoint used by clients to access their configuration. */ -export type DataCollectionEndpointConfigurationAccess = ConfigurationAccessEndpointSpec; +export type DataCollectionEndpointConfigurationAccess = ConfigurationAccessEndpointSpec & {}; /** The endpoint used by clients to ingest logs. */ -export type DataCollectionEndpointLogsIngestion = LogsIngestionEndpointSpec; +export type DataCollectionEndpointLogsIngestion = LogsIngestionEndpointSpec & {}; /** Network access control rules for the endpoints. */ -export type DataCollectionEndpointNetworkAcls = NetworkRuleSet; - -/** Metadata pertaining to creation and last modification of the resource. */ -export type DataCollectionEndpointResourceSystemData = SystemData; - -/** Metadata pertaining to creation and last modification of the resource. */ -export type DataCollectionRuleAssociationProxyOnlyResourceSystemData = SystemData; - -/** Metadata pertaining to creation and last modification of the resource. */ -export type DataCollectionRuleResourceSystemData = SystemData; +export type DataCollectionEndpointNetworkAcls = NetworkRuleSet & {}; /** Resource properties. */ -export type DataCollectionRuleAssociationProxyOnlyResourceProperties = DataCollectionRuleAssociation; +export type DataCollectionRuleAssociationProxyOnlyResourceProperties = DataCollectionRuleAssociation & {}; /** Metadata about the resource */ -export type DataCollectionRuleAssociationMetadata = Metadata; +export type DataCollectionRuleAssociationMetadata = Metadata & {}; /** Metadata about the resource */ -export type DataCollectionRuleMetadata = Metadata; +export type DataCollectionRuleMetadata = Metadata & {}; /** Resource properties. */ -export type DataCollectionRuleResourceProperties = DataCollectionRule; +export type DataCollectionRuleResourceProperties = DataCollectionRule & {}; /** * The specification of data sources. * This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint. */ -export type DataCollectionRuleDataSources = DataSourcesSpec; +export type DataCollectionRuleDataSources = DataSourcesSpec & {}; /** The log files specific settings. */ -export type LogFilesDataSourceSettings = LogFileSettings; +export type LogFilesDataSourceSettings = LogFileSettings & {}; /** Text settings */ -export type LogFileSettingsText = LogFileTextSettings; +export type LogFileSettingsText = LogFileTextSettings & {}; /** The specification of destinations. */ -export type DataCollectionRuleDestinations = DestinationsSpec; +export type DataCollectionRuleDestinations = DestinationsSpec & {}; /** Azure Monitor Metrics destination. */ -export type DestinationsSpecAzureMonitorMetrics = AzureMonitorMetricsDestination; +export type DestinationsSpecAzureMonitorMetrics = AzureMonitorMetricsDestination & {}; /** Criterion to filter metrics. */ export type MetricCriteria = MultiMetricCriteria & { @@ -2673,6 +2659,67 @@ export type DynamicMetricCriteria = MultiMetricCriteria & { ignoreDataBefore?: Date; }; +/** The scheduled query rule resource. */ +export type ScheduledQueryRuleResource = TrackedResource & { + /** Indicates the type of scheduled query rule. The default is LogAlert. */ + kind?: Kind; + /** + * The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly etag?: string; + /** + * SystemData of ScheduledQueryRule. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** + * The api-version used when creating this alert rule + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly createdWithApiVersion?: string; + /** + * True if alert rule is legacy Log Analytic rule + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isLegacyLogAnalyticsRule?: boolean; + /** The description of the scheduled query rule. */ + description?: string; + /** The display name of the alert rule */ + displayName?: string; + /** Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules of the kind LogAlert. */ + severity?: AlertSeverity; + /** The flag which indicates whether this scheduled query rule is enabled. Value should be true or false */ + enabled?: boolean; + /** The list of resource id's that this scheduled query rule is scoped to. */ + scopes?: string[]; + /** How often the scheduled query rule is evaluated represented in ISO 8601 duration format. Relevant and required only for rules of the kind LogAlert. */ + evaluationFrequency?: string; + /** The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required only for rules of the kind LogAlert. */ + windowSize?: string; + /** If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert. */ + overrideQueryTimeRange?: string; + /** List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual machine in the resource group which meet the alert criteria. Relevant only for rules of the kind LogAlert */ + targetResourceTypes?: string[]; + /** The rule criteria that defines the conditions of the scheduled query rule. */ + criteria?: ScheduledQueryRuleCriteria; + /** Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. Relevant only for rules of the kind LogAlert. */ + muteActionsDuration?: string; + /** Actions to invoke when the alert fires. */ + actions?: Actions; + /** + * The flag which indicates whether this scheduled query rule has been configured to be stored in the customer's storage. The default is false. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isWorkspaceAlertsStorageConfigured?: boolean; + /** The flag which indicates whether this scheduled query rule should be stored in the customer's storage. The default is false. Relevant only for rules of the kind LogAlert. */ + checkWorkspaceAlertsStorageConfigured?: boolean; + /** The flag which indicates whether the provided query should be validated or not. The default is false. Relevant only for rules of the kind LogAlert. */ + skipQueryValidation?: boolean; + /** The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only for rules of the kind LogAlert. */ + autoMitigate?: boolean; +}; + /** Defines headers for ActionGroups_postTestNotifications operation. */ export interface ActionGroupsPostTestNotificationsHeaders { /** The location header that has the polling uri. */ @@ -2803,55 +2850,101 @@ export enum KnownOdatatype { */ export type Odatatype = string; -/** Known values of {@link Enabled} that the service accepts. */ -export enum KnownEnabled { - True = "true", - False = "false" +/** Known values of {@link Kind} that the service accepts. */ +export enum KnownKind { + LogAlert = "LogAlert", + 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", - Deploying = "Deploying", - Canceled = "Canceled", - Failed = "Failed" +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + User = "User", + Application = "Application", + ManagedIdentity = "ManagedIdentity", + Key = "Key" } /** - * Defines values for ProvisioningState. \ - * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Succeeded** \ - * **Deploying** \ - * **Canceled** \ - * **Failed** + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type CreatedByType = string; + +/** Known values of {@link AlertSeverity} that the service accepts. */ +export enum KnownAlertSeverity { + Zero = 0, + One = 1, + Two = 2, + Three = 3, + 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 ProvisioningState = string; +export type AlertSeverity = number; -/** Known values of {@link QueryType} that the service accepts. */ -export enum KnownQueryType { - ResultCount = "ResultCount" +/** Known values of {@link TimeAggregation} that the service accepts. */ +export enum KnownTimeAggregation { + Count = "Count", + Average = "Average", + Minimum = "Minimum", + Maximum = "Maximum", + Total = "Total" } /** - * Defines values for QueryType. \ - * {@link KnownQueryType} can be used interchangeably with QueryType, + * 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 - * **ResultCount** + * **Count** \ + * **Average** \ + * **Minimum** \ + * **Maximum** \ + * **Total** */ -export type QueryType = string; +export type TimeAggregation = string; + +/** Known values of {@link DimensionOperator} that the service accepts. */ +export enum KnownDimensionOperator { + Include = "Include", + Exclude = "Exclude" +} + +/** + * Defines values for DimensionOperator. \ + * {@link KnownDimensionOperator} can be used interchangeably with DimensionOperator, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Include** \ + * **Exclude** + */ +export type DimensionOperator = string; /** Known values of {@link NamespaceClassification} that the service accepts. */ export enum KnownNamespaceClassification { @@ -2959,26 +3052,6 @@ export enum KnownKnownDataCollectionEndpointResourceKind { */ export type KnownDataCollectionEndpointResourceKind = string; -/** Known values of {@link CreatedByType} that the service accepts. */ -export enum KnownCreatedByType { - User = "User", - Application = "Application", - ManagedIdentity = "ManagedIdentity", - Key = "Key" -} - -/** - * Defines values for CreatedByType. \ - * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **User** \ - * **Application** \ - * **ManagedIdentity** \ - * **Key** - */ -export type CreatedByType = string; - /** Known values of {@link KnownDataCollectionRuleAssociationProvisioningState} that the service accepts. */ export enum KnownKnownDataCollectionRuleAssociationProvisioningState { Creating = "Creating", @@ -3289,8 +3362,7 @@ export enum KnownOperator { GreaterThan = "GreaterThan", GreaterThanOrEqual = "GreaterThanOrEqual", LessThan = "LessThan", - LessThanOrEqual = "LessThanOrEqual", - Include = "Include" + LessThanOrEqual = "LessThanOrEqual" } /** @@ -3302,8 +3374,7 @@ export enum KnownOperator { * **GreaterThan** \ * **GreaterThanOrEqual** \ * **LessThan** \ - * **LessThanOrEqual** \ - * **Include** + * **LessThanOrEqual** */ export type Operator = string; @@ -3380,66 +3451,6 @@ export enum KnownDynamicThresholdSensitivity { * **High** */ export type DynamicThresholdSensitivity = string; - -/** Known values of {@link ConditionalOperator} that the service accepts. */ -export enum KnownConditionalOperator { - GreaterThanOrEqual = "GreaterThanOrEqual", - LessThanOrEqual = "LessThanOrEqual", - GreaterThan = "GreaterThan", - LessThan = "LessThan", - 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", - 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 = "0", - One = "1", - Two = "2", - Three = "3", - 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. */ @@ -3502,7 +3513,8 @@ export type ConditionOperator = | "GreaterThan" | "GreaterThanOrEqual" | "LessThan" - | "LessThanOrEqual"; + | "LessThanOrEqual" + | "Equals"; /** Defines values for TimeAggregationOperator. */ export type TimeAggregationOperator = | "Average" @@ -3967,49 +3979,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 diff --git a/sdk/monitor/arm-monitor/src/models/mappers.ts b/sdk/monitor/arm-monitor/src/models/mappers.ts index 9e7d5b5bab51..bb6db8f0b07a 100644 --- a/sdk/monitor/arm-monitor/src/models/mappers.ts +++ b/sdk/monitor/arm-monitor/src/models/mappers.ts @@ -3271,10 +3271,104 @@ export const MetricAlertStatusProperties: coreClient.CompositeMapper = { } }; -export const Source: coreClient.CompositeMapper = { +export const ScheduledQueryRuleResourceCollection: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Source", + className: "ScheduledQueryRuleResourceCollection", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ScheduledQueryRuleResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } + } + } + } +}; + +export const ScheduledQueryRuleCriteria: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ScheduledQueryRuleCriteria", + modelProperties: { + allOf: { + serializedName: "allOf", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Condition" + } + } + } + } + } + } +}; + +export const Condition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Condition", modelProperties: { query: { serializedName: "query", @@ -3282,49 +3376,122 @@ export const Source: coreClient.CompositeMapper = { name: "String" } }, - authorizedResources: { - serializedName: "authorizedResources", + timeAggregation: { + serializedName: "timeAggregation", + type: { + name: "String" + } + }, + metricMeasureColumn: { + serializedName: "metricMeasureColumn", + type: { + name: "String" + } + }, + resourceIdColumn: { + serializedName: "resourceIdColumn", + type: { + name: "String" + } + }, + dimensions: { + serializedName: "dimensions", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "Dimension" } } } }, - dataSourceId: { - serializedName: "dataSourceId", + operator: { + serializedName: "operator", + type: { + name: "Enum", + allowedValues: [ + "GreaterThan", + "GreaterThanOrEqual", + "LessThan", + "LessThanOrEqual", + "Equals" + ] + } + }, + threshold: { + serializedName: "threshold", + type: { + name: "Number" + } + }, + failingPeriods: { + serializedName: "failingPeriods", + type: { + name: "Composite", + className: "ConditionFailingPeriods" + } + }, + metricName: { + serializedName: "metricName", + type: { + name: "String" + } + } + } + } +}; + +export const Dimension: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Dimension", + modelProperties: { + name: { + serializedName: "name", required: true, type: { name: "String" } }, - queryType: { - serializedName: "queryType", + operator: { + serializedName: "operator", + required: true, type: { name: "String" } + }, + values: { + serializedName: "values", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } } } } }; -export const Schedule: coreClient.CompositeMapper = { +export const ConditionFailingPeriods: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Schedule", + className: "ConditionFailingPeriods", modelProperties: { - frequencyInMinutes: { - serializedName: "frequencyInMinutes", - required: true, + numberOfEvaluationPeriods: { + defaultValue: 1, + serializedName: "numberOfEvaluationPeriods", type: { name: "Number" } }, - timeWindowInMinutes: { - serializedName: "timeWindowInMinutes", - required: true, + minFailingPeriodsToAlert: { + defaultValue: 1, + serializedName: "minFailingPeriodsToAlert", type: { name: "Number" } @@ -3333,21 +3500,27 @@ export const Schedule: coreClient.CompositeMapper = { } }; -export const Action: coreClient.CompositeMapper = { +export const Actions: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Action", - uberParent: "Action", - polymorphicDiscriminator: { - serializedName: "odata\\.type", - clientName: "odataType" - }, + className: "Actions", modelProperties: { - odataType: { - serializedName: "odata\\.type", - required: true, + actionGroups: { + serializedName: "actionGroups", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + customProperties: { + serializedName: "customProperties", + type: { + name: "Dictionary", + value: { type: { name: "String" } } } } } @@ -3379,59 +3552,111 @@ export const ResourceAutoGenerated: coreClient.CompositeMapper = { type: { name: "String" } - }, - location: { - serializedName: "location", - required: true, + } + } + } +}; + +export const ErrorContract: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorContract", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorResponseAutoGenerated" + } + } + } + } +}; + +export const ErrorResponseAutoGenerated: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponseAutoGenerated", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, type: { name: "String" } }, - tags: { - serializedName: "tags", + message: { + serializedName: "message", + readOnly: true, type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" } }, - kind: { - serializedName: "kind", + target: { + serializedName: "target", readOnly: true, type: { name: "String" } }, - etag: { - serializedName: "etag", + details: { + serializedName: "details", readOnly: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorResponseAutoGenerated" + } + } + } + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } } } } } }; -export const ErrorContract: coreClient.CompositeMapper = { +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorContract", + className: "ErrorAdditionalInfo", modelProperties: { - error: { - serializedName: "error", + type: { + serializedName: "type", + readOnly: true, type: { - name: "Composite", - className: "ErrorResponse" + name: "String" + } + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } } } } } } }; -export const LogSearchRuleResourcePatch: coreClient.CompositeMapper = { +export const ScheduledQueryRuleResourcePatch: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LogSearchRuleResourcePatch", + className: "ScheduledQueryRuleResourcePatch", modelProperties: { tags: { serializedName: "tags", @@ -3440,31 +3665,127 @@ export const LogSearchRuleResourcePatch: coreClient.CompositeMapper = { value: { type: { name: "String" } } } }, - enabled: { - serializedName: "properties.enabled", + createdWithApiVersion: { + serializedName: "properties.createdWithApiVersion", + readOnly: true, + type: { + name: "String" + } + }, + isLegacyLogAnalyticsRule: { + serializedName: "properties.isLegacyLogAnalyticsRule", + readOnly: true, + type: { + name: "Boolean" + } + }, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String" + } + }, + severity: { + serializedName: "properties.severity", + type: { + name: "Number" + } + }, + enabled: { + serializedName: "properties.enabled", + type: { + name: "Boolean" + } + }, + scopes: { + serializedName: "properties.scopes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + evaluationFrequency: { + serializedName: "properties.evaluationFrequency", + type: { + name: "TimeSpan" + } + }, + windowSize: { + serializedName: "properties.windowSize", + type: { + name: "TimeSpan" + } + }, + overrideQueryTimeRange: { + serializedName: "properties.overrideQueryTimeRange", + type: { + name: "TimeSpan" + } + }, + targetResourceTypes: { + serializedName: "properties.targetResourceTypes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + criteria: { + serializedName: "properties.criteria", + type: { + name: "Composite", + className: "ScheduledQueryRuleCriteria" + } + }, + muteActionsDuration: { + serializedName: "properties.muteActionsDuration", + type: { + name: "TimeSpan" + } + }, + actions: { + serializedName: "properties.actions", + type: { + name: "Composite", + className: "Actions" + } + }, + isWorkspaceAlertsStorageConfigured: { + serializedName: "properties.isWorkspaceAlertsStorageConfigured", + readOnly: true, + type: { + name: "Boolean" + } + }, + checkWorkspaceAlertsStorageConfigured: { + serializedName: "properties.checkWorkspaceAlertsStorageConfigured", + type: { + name: "Boolean" + } + }, + skipQueryValidation: { + serializedName: "properties.skipQueryValidation", type: { - name: "String" + name: "Boolean" } - } - } - } -}; - -export const LogSearchRuleResourceCollection: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LogSearchRuleResourceCollection", - modelProperties: { - value: { - serializedName: "value", + }, + autoMitigate: { + serializedName: "properties.autoMitigate", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "LogSearchRuleResource" - } - } + name: "Boolean" } } } @@ -3843,30 +4164,6 @@ export const OperationStatus: coreClient.CompositeMapper = { } }; -export const ErrorAdditionalInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - modelProperties: { - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String" - } - }, - info: { - serializedName: "info", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } -}; - export const PrivateLinkResourceListResult: coreClient.CompositeMapper = { type: { name: "Composite", @@ -4096,10 +4393,10 @@ export const AzureResourceAutoGenerated: coreClient.CompositeMapper = { } }; -export const ErrorResponseAutoGenerated: coreClient.CompositeMapper = { +export const ErrorResponseAutoGenerated2: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorResponseAutoGenerated", + className: "ErrorResponseAutoGenerated2", modelProperties: { code: { serializedName: "code", @@ -4397,51 +4694,6 @@ export const NetworkRuleSet: coreClient.CompositeMapper = { } }; -export const SystemData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SystemData", - modelProperties: { - createdBy: { - serializedName: "createdBy", - type: { - name: "String" - } - }, - createdByType: { - serializedName: "createdByType", - type: { - name: "String" - } - }, - createdAt: { - serializedName: "createdAt", - type: { - name: "DateTime" - } - }, - lastModifiedBy: { - serializedName: "lastModifiedBy", - type: { - name: "String" - } - }, - lastModifiedByType: { - serializedName: "lastModifiedByType", - type: { - name: "String" - } - }, - lastModifiedAt: { - serializedName: "lastModifiedAt", - type: { - name: "DateTime" - } - } - } - } -}; - export const ErrorResponseCommonV2: coreClient.CompositeMapper = { type: { name: "Composite", @@ -5491,7 +5743,8 @@ export const ManagementEventAggregationCondition: coreClient.CompositeMapper = { "GreaterThan", "GreaterThanOrEqual", "LessThan", - "LessThanOrEqual" + "LessThanOrEqual", + "Equals" ] } }, @@ -5637,167 +5890,6 @@ export const DynamicThresholdFailingPeriods: coreClient.CompositeMapper = { } }; -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", - type: { - name: "Number" - } - }, - metricTriggerType: { - defaultValue: "Consecutive", - serializedName: "metricTriggerType", - type: { - name: "String" - } - }, - metricColumn: { - serializedName: "metricColumn", - type: { - name: "String" - } - } - } - } -}; - -export const AzNsActionGroup: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AzNsActionGroup", - modelProperties: { - actionGroup: { - serializedName: "actionGroup", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - emailSubject: { - serializedName: "emailSubject", - type: { - name: "String" - } - }, - customWebhookPayload: { - serializedName: "customWebhookPayload", - type: { - name: "String" - } - } - } - } -}; - -export const Dimension: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Dimension", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String" - } - }, - operator: { - serializedName: "operator", - required: true, - type: { - name: "String" - } - }, - values: { - serializedName: "values", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } - } - } -}; - -export const Criteria: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Criteria", - modelProperties: { - metricName: { - serializedName: "metricName", - required: true, - type: { - name: "String" - } - }, - dimensions: { - serializedName: "dimensions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Dimension" - } - } - } - } - } - } -}; - export const AutoscaleSettingResource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -6145,7 +6237,8 @@ export const ThresholdRuleCondition: coreClient.CompositeMapper = { "GreaterThan", "GreaterThanOrEqual", "LessThan", - "LessThanOrEqual" + "LessThanOrEqual", + "Equals" ] } }, @@ -6704,153 +6797,55 @@ export const MetricAlertMultipleResourceMultipleMetricCriteria: coreClient.Compo } }; -export const AlertingAction: coreClient.CompositeMapper = { - serializedName: - "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", +export const DataCollectionEndpointResourceSystemData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AlertingAction", - uberParent: "Action", - polymorphicDiscriminator: Action.type.polymorphicDiscriminator, + className: "DataCollectionEndpointResourceSystemData", 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" - } - } + ...SystemData.type.modelProperties + } + } +}; + +export const DataCollectionRuleAssociationProxyOnlyResourceSystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataCollectionRuleAssociationProxyOnlyResourceSystemData", + modelProperties: { + ...SystemData.type.modelProperties } } }; -export const LogToMetricAction: coreClient.CompositeMapper = { - serializedName: - "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction", +export const DataCollectionRuleResourceSystemData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LogToMetricAction", - uberParent: "Action", - polymorphicDiscriminator: Action.type.polymorphicDiscriminator, + className: "DataCollectionRuleResourceSystemData", modelProperties: { - ...Action.type.modelProperties, - criteria: { - serializedName: "criteria", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Criteria" - } - } - } - } + ...SystemData.type.modelProperties } } }; -export const LogSearchRuleResource: coreClient.CompositeMapper = { +export const TrackedResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LogSearchRuleResource", + className: "TrackedResource", modelProperties: { ...ResourceAutoGenerated.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, + tags: { + serializedName: "tags", type: { - name: "DateTime" + name: "Dictionary", + value: { type: { name: "String" } } } }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, + location: { + serializedName: "location", + required: 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" - } } } } @@ -7119,36 +7114,6 @@ export const DataCollectionEndpointNetworkAcls: coreClient.CompositeMapper = { } }; -export const DataCollectionEndpointResourceSystemData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataCollectionEndpointResourceSystemData", - modelProperties: { - ...SystemData.type.modelProperties - } - } -}; - -export const DataCollectionRuleAssociationProxyOnlyResourceSystemData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataCollectionRuleAssociationProxyOnlyResourceSystemData", - modelProperties: { - ...SystemData.type.modelProperties - } - } -}; - -export const DataCollectionRuleResourceSystemData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataCollectionRuleResourceSystemData", - modelProperties: { - ...SystemData.type.modelProperties - } - } -}; - export const DataCollectionRuleAssociationProxyOnlyResourceProperties: coreClient.CompositeMapper = { type: { name: "Composite", @@ -7308,6 +7273,159 @@ export const DynamicMetricCriteria: coreClient.CompositeMapper = { } }; +export const ScheduledQueryRuleResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ScheduledQueryRuleResource", + modelProperties: { + ...TrackedResource.type.modelProperties, + kind: { + serializedName: "kind", + type: { + name: "String" + } + }, + etag: { + serializedName: "etag", + readOnly: true, + type: { + name: "String" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + createdWithApiVersion: { + serializedName: "properties.createdWithApiVersion", + readOnly: true, + type: { + name: "String" + } + }, + isLegacyLogAnalyticsRule: { + serializedName: "properties.isLegacyLogAnalyticsRule", + readOnly: true, + type: { + name: "Boolean" + } + }, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String" + } + }, + severity: { + serializedName: "properties.severity", + type: { + name: "Number" + } + }, + enabled: { + serializedName: "properties.enabled", + type: { + name: "Boolean" + } + }, + scopes: { + serializedName: "properties.scopes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + evaluationFrequency: { + serializedName: "properties.evaluationFrequency", + type: { + name: "TimeSpan" + } + }, + windowSize: { + serializedName: "properties.windowSize", + type: { + name: "TimeSpan" + } + }, + overrideQueryTimeRange: { + serializedName: "properties.overrideQueryTimeRange", + type: { + name: "TimeSpan" + } + }, + targetResourceTypes: { + serializedName: "properties.targetResourceTypes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + criteria: { + serializedName: "properties.criteria", + type: { + name: "Composite", + className: "ScheduledQueryRuleCriteria" + } + }, + muteActionsDuration: { + serializedName: "properties.muteActionsDuration", + type: { + name: "TimeSpan" + } + }, + actions: { + serializedName: "properties.actions", + type: { + name: "Composite", + className: "Actions" + } + }, + isWorkspaceAlertsStorageConfigured: { + serializedName: "properties.isWorkspaceAlertsStorageConfigured", + readOnly: true, + type: { + name: "Boolean" + } + }, + checkWorkspaceAlertsStorageConfigured: { + serializedName: "properties.checkWorkspaceAlertsStorageConfigured", + type: { + name: "Boolean" + } + }, + skipQueryValidation: { + serializedName: "properties.skipQueryValidation", + type: { + name: "Boolean" + } + }, + autoMitigate: { + serializedName: "properties.autoMitigate", + type: { + name: "Boolean" + } + } + } + } +}; + export const ActionGroupsPostTestNotificationsHeaders: coreClient.CompositeMapper = { type: { name: "Composite", @@ -7359,7 +7477,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, @@ -7371,8 +7488,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 be175a8b011e..58f54583c4a8 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, @@ -487,15 +487,10 @@ export const statusName: OperationURLParameter = { } }; -export const parameters6: OperationParameter = { - parameterPath: "parameters", - mapper: LogSearchRuleResourceMapper -}; - export const apiVersion7: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2018-04-16", + defaultValue: "2022-06-15", isConstant: true, serializedName: "api-version", type: { @@ -504,9 +499,14 @@ export const apiVersion7: OperationQueryParameter = { } }; +export const parameters6: OperationParameter = { + parameterPath: "parameters", + mapper: ScheduledQueryRuleResourceMapper +}; + export const parameters7: OperationParameter = { parameterPath: "parameters", - mapper: LogSearchRuleResourcePatchMapper + mapper: ScheduledQueryRuleResourcePatchMapper }; export const apiVersion8: OperationQueryParameter = { diff --git a/sdk/monitor/arm-monitor/src/operations/activityLogAlerts.ts b/sdk/monitor/arm-monitor/src/operations/activityLogAlerts.ts index 5796a784a4c2..d72725c85bb1 100644 --- a/sdk/monitor/arm-monitor/src/operations/activityLogAlerts.ts +++ b/sdk/monitor/arm-monitor/src/operations/activityLogAlerts.ts @@ -299,7 +299,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ActivityLogAlertResource }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated + bodyMapper: Mappers.ErrorResponseAutoGenerated2 } }, requestBody: Parameters.activityLogAlertRule, @@ -323,7 +323,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ActivityLogAlertResource }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated + bodyMapper: Mappers.ErrorResponseAutoGenerated2 } }, queryParameters: [Parameters.apiVersion11], @@ -344,7 +344,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated + bodyMapper: Mappers.ErrorResponseAutoGenerated2 } }, queryParameters: [Parameters.apiVersion11], @@ -366,7 +366,7 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ActivityLogAlertResource }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated + bodyMapper: Mappers.ErrorResponseAutoGenerated2 } }, requestBody: Parameters.activityLogAlertRulePatch, @@ -390,7 +390,7 @@ const listBySubscriptionIdOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AlertRuleList }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated + bodyMapper: Mappers.ErrorResponseAutoGenerated2 } }, queryParameters: [Parameters.apiVersion11], @@ -407,7 +407,7 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AlertRuleList }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated + bodyMapper: Mappers.ErrorResponseAutoGenerated2 } }, queryParameters: [Parameters.apiVersion11], @@ -427,7 +427,7 @@ const listBySubscriptionIdNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AlertRuleList }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated + bodyMapper: Mappers.ErrorResponseAutoGenerated2 } }, queryParameters: [Parameters.apiVersion11], @@ -447,7 +447,7 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AlertRuleList }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated + bodyMapper: Mappers.ErrorResponseAutoGenerated2 } }, queryParameters: [Parameters.apiVersion11], diff --git a/sdk/monitor/arm-monitor/src/operations/scheduledQueryRules.ts b/sdk/monitor/arm-monitor/src/operations/scheduledQueryRules.ts index 70c564955279..2381f812e166 100644 --- a/sdk/monitor/arm-monitor/src/operations/scheduledQueryRules.ts +++ b/sdk/monitor/arm-monitor/src/operations/scheduledQueryRules.ts @@ -13,19 +13,23 @@ import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { MonitorClient } from "../monitorClient"; import { - LogSearchRuleResource, + ScheduledQueryRuleResource, + ScheduledQueryRulesListBySubscriptionNextOptionalParams, ScheduledQueryRulesListBySubscriptionOptionalParams, + ScheduledQueryRulesListByResourceGroupNextOptionalParams, ScheduledQueryRulesListByResourceGroupOptionalParams, - ScheduledQueryRulesCreateOrUpdateOptionalParams, - ScheduledQueryRulesCreateOrUpdateResponse, + ScheduledQueryRulesListBySubscriptionResponse, + ScheduledQueryRulesListByResourceGroupResponse, ScheduledQueryRulesGetOptionalParams, ScheduledQueryRulesGetResponse, - LogSearchRuleResourcePatch, + ScheduledQueryRulesCreateOrUpdateOptionalParams, + ScheduledQueryRulesCreateOrUpdateResponse, + ScheduledQueryRuleResourcePatch, ScheduledQueryRulesUpdateOptionalParams, ScheduledQueryRulesUpdateResponse, ScheduledQueryRulesDeleteOptionalParams, - ScheduledQueryRulesListBySubscriptionResponse, - ScheduledQueryRulesListByResourceGroupResponse + ScheduledQueryRulesListBySubscriptionNextResponse, + ScheduledQueryRulesListByResourceGroupNextResponse } from "../models"; /// @@ -42,12 +46,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() { @@ -64,28 +68,34 @@ export class ScheduledQueryRulesImpl implements ScheduledQueryRules { private async *listBySubscriptionPagingPage( options?: ScheduledQueryRulesListBySubscriptionOptionalParams - ): AsyncIterableIterator { + ): AsyncIterableIterator { let result = await this._listBySubscription(options); yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } } 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() { @@ -103,15 +113,25 @@ export class ScheduledQueryRulesImpl implements ScheduledQueryRules { private async *listByResourceGroupPagingPage( resourceGroupName: string, options?: ScheduledQueryRulesListByResourceGroupOptionalParams - ): AsyncIterableIterator { + ): AsyncIterableIterator { let result = await this._listByResourceGroup(resourceGroupName, options); yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } } private async *listByResourceGroupPagingAll( resourceGroupName: string, options?: ScheduledQueryRulesListByResourceGroupOptionalParams - ): AsyncIterableIterator { + ): AsyncIterableIterator { for await (const page of this.listByResourceGroupPagingPage( resourceGroupName, options @@ -121,26 +141,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 +186,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 +214,7 @@ export class ScheduledQueryRulesImpl implements ScheduledQueryRules { update( resourceGroupName: string, ruleName: string, - parameters: LogSearchRuleResourcePatch, + parameters: ScheduledQueryRuleResourcePatch, options?: ScheduledQueryRulesUpdateOptionalParams ): Promise { return this.client.sendOperationRequest( @@ -176,7 +224,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 +241,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.apiVersion7], + 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.apiVersion7], 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 +335,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.apiVersion7], + 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 +388,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 +407,43 @@ 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.apiVersion7], - urlParameters: [Parameters.$host, Parameters.subscriptionId], + queryParameters: [Parameters.apiVersion7], + 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.apiVersion7], + queryParameters: [Parameters.apiVersion7], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.nextLink ], headerParameters: [Parameters.accept], serializer 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/test/monitor_examples.ts b/sdk/monitor/arm-monitor/test/monitor_examples.ts deleted file mode 100644 index 6853f541bf8f..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, 0); //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"