diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 77f2a9335fd9..1bf5c457a7f6 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -4533,7 +4533,7 @@ packages: dependencies: semver: 7.5.4 shelljs: 0.8.5 - typescript: 5.3.0-dev.20231025 + typescript: 5.3.0-dev.20231026 dev: false /eastasianwidth@0.2.0: @@ -8948,6 +8948,37 @@ packages: code-block-writer: 12.0.0 dev: false + /ts-node@10.9.1(@types/node@16.18.55)(typescript@5.0.4): + resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.9 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 16.18.55 + acorn: 8.10.0 + acorn-walk: 8.2.0 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.0.4 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + dev: false + /ts-node@10.9.1(@types/node@16.18.55)(typescript@5.2.2): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true @@ -9152,8 +9183,8 @@ packages: hasBin: true dev: false - /typescript@5.3.0-dev.20231025: - resolution: {integrity: sha512-DW0GNkWzKHnI9lcYCVIw5SO5nzlaZ9iHAdcN7zCxt/OJsKg7s33xRtEa5nmPTIC5qvKzLLZboWWBJ+KRD9cKFw==} + /typescript@5.3.0-dev.20231026: + resolution: {integrity: sha512-TPCRnvIO1nKy3PLJwVyXwZJAQ3silk51ktcvvk1NzYoPtS9p3xX7LNodMA6DDDndhbeMkjMlxb/PmPur2Z+zUQ==} engines: {node: '>=14.17'} hasBin: true dev: false @@ -14170,7 +14201,7 @@ packages: dev: false file:projects/arm-monitor.tgz: - resolution: {integrity: sha512-Kanhz7NmEp+WKQzUUEqoVb3SN40Q57TALgAHIBfWvqDXR5GRzO2WKULdZA5GBJ5855zwDdeV7fcQh+AwxUM8Ug==, tarball: file:projects/arm-monitor.tgz} + resolution: {integrity: sha512-vlFWoaWlHoIZYzJdkSnyTNGGYbbYlkM5jmET+ovz/GGy3qzeYpjz2zXgypWdnowTNs5oWg1587EMIF+SB7MgwQ==, tarball: file:projects/arm-monitor.tgz} name: '@rush-temp/arm-monitor' version: 0.0.0 dependencies: @@ -14180,18 +14211,20 @@ packages: '@rollup/plugin-multi-entry': 6.0.0(rollup@2.79.1) '@rollup/plugin-node-resolve': 13.3.0(rollup@2.79.1) '@types/chai': 4.3.6 + '@types/mocha': 10.0.2 '@types/node': 16.18.55 chai: 4.3.10 cross-env: 7.0.3 dotenv: 16.3.1 + esm: 3.2.25 mkdirp: 2.1.6 mocha: 10.2.0 - rimraf: 3.0.2 + rimraf: 5.0.5 rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3(@types/node@16.18.55)(rollup@2.79.1) - ts-node: 10.9.1(@types/node@16.18.55)(typescript@5.2.2) + ts-node: 10.9.1(@types/node@16.18.55)(typescript@5.0.4) tslib: 2.6.2 - typescript: 5.2.2 + typescript: 5.0.4 uglify-js: 3.17.4 transitivePeerDependencies: - '@swc/core' @@ -21080,7 +21113,7 @@ packages: dev: false file:projects/service-bus.tgz: - resolution: {integrity: sha512-GQi6OI2UWagiy4TeQ8ppMHNavRaQM+zw3ZfmnvzBt8ciXbKEvHGELPv8K7p+BoOvIuMBr07lRui/294fb+RNdQ==, tarball: file:projects/service-bus.tgz} + resolution: {integrity: sha512-B9HeR4c9MNUuwCw0IrbFkEsqgy4K1e1YOSQkmV5GBd9KQi5gfUQhjagQgzMFKn4cu78mnKghdD/IM/XyybMgyg==, tarball: file:projects/service-bus.tgz} name: '@rush-temp/service-bus' version: 0.0.0 dependencies: diff --git a/sdk/monitor/arm-monitor/CHANGELOG.md b/sdk/monitor/arm-monitor/CHANGELOG.md index 45444034548a..c9d8af3b98ba 100644 --- a/sdk/monitor/arm-monitor/CHANGELOG.md +++ b/sdk/monitor/arm-monitor/CHANGELOG.md @@ -1,16 +1,6 @@ # Release History - -## 8.0.0-beta.5 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 8.0.0-beta.4 (2023-02-13) + +## 8.0.0-beta.5 (2023-10-26) **Features** @@ -18,24 +8,21 @@ - Added operation group MetricsOperations - Added operation group MonitorOperations - Added operation group PredictiveMetric + - Added operation group TenantActionGroups - Added operation ActionGroups.beginCreateNotificationsAtActionGroupResourceLevel - Added operation ActionGroups.beginCreateNotificationsAtActionGroupResourceLevelAndWait - - Added operation ActionGroups.beginCreateNotificationsAtResourceGroupLevel - - Added operation ActionGroups.beginCreateNotificationsAtResourceGroupLevelAndWait - Added operation ActionGroups.getTestNotificationsAtActionGroupResourceLevel - - Added operation ActionGroups.getTestNotificationsAtResourceGroupLevel - Added operation DataCollectionRuleAssociations.listByDataCollectionEndpoint + - Added operation MetricDefinitions.listAtSubscriptionScope - Added Interface AccessModeSettings - Added Interface AccessModeSettingsExclusion + - Added Interface ActionDetailAutoGenerated - Added Interface ActionGroup + - Added Interface ActionGroupPatchBodyAutoGenerated - Added Interface ActionGroupResource - Added Interface ActionGroupsCreateNotificationsAtActionGroupResourceLevelHeaders - Added Interface ActionGroupsCreateNotificationsAtActionGroupResourceLevelOptionalParams - - Added Interface ActionGroupsCreateNotificationsAtResourceGroupLevelHeaders - - Added Interface ActionGroupsCreateNotificationsAtResourceGroupLevelOptionalParams - Added Interface ActionGroupsGetTestNotificationsAtActionGroupResourceLevelOptionalParams - - Added Interface ActionGroupsGetTestNotificationsAtResourceGroupLevelOptionalParams - - Added Interface ActionGroupsPostTestNotificationsHeaders - Added Interface ActionList - Added Interface Actions - Added Interface ActivityLogAlertResource @@ -50,6 +37,7 @@ - Added Interface AutoscaleErrorResponse - Added Interface AutoscaleErrorResponseError - Added Interface AutoscaleSettingResource + - Added Interface AzureAppPushReceiverAutoGenerated - Added Interface AzureMonitorPrivateLinkScope - Added Interface AzureMonitorWorkspace - Added Interface AzureMonitorWorkspaceDefaultIngestionSettings @@ -59,6 +47,7 @@ - Added Interface AzureMonitorWorkspaceResourceListResult - Added Interface AzureMonitorWorkspaceResourceProperties - Added Interface AzureMonitorWorkspacesCreateOptionalParams + - Added Interface AzureMonitorWorkspacesDeleteHeaders - Added Interface AzureMonitorWorkspacesDeleteOptionalParams - Added Interface AzureMonitorWorkspacesGetOptionalParams - Added Interface AzureMonitorWorkspacesListByResourceGroupNextOptionalParams @@ -70,9 +59,14 @@ - Added Interface ColumnDefinition - Added Interface Condition - Added Interface ConditionFailingPeriods + - Added Interface CreateNotificationsAtTenantActionGroupResourceLevelOptionalParams - Added Interface DataCollectionEndpointConfigurationAccess + - Added Interface DataCollectionEndpointFailoverConfiguration - Added Interface DataCollectionEndpointLogsIngestion + - Added Interface DataCollectionEndpointMetadata + - Added Interface DataCollectionEndpointMetricsIngestion - Added Interface DataCollectionEndpointNetworkAcls + - Added Interface DataCollectionEndpointResourceIdentity - Added Interface DataCollectionEndpointResourceProperties - Added Interface DataCollectionEndpointResourceSystemData - Added Interface DataCollectionRuleAssociationMetadata @@ -83,21 +77,34 @@ - Added Interface DataCollectionRuleDataSources - Added Interface DataCollectionRuleDestinations - Added Interface DataCollectionRuleMetadata + - Added Interface DataCollectionRuleResourceIdentity - Added Interface DataCollectionRuleResourceProperties - Added Interface DataCollectionRuleResourceSystemData + - Added Interface DataImportSources + - Added Interface DataImportSourcesEventHub + - Added Interface DataSourcesSpecDataImports - Added Interface DefaultErrorResponse - Added Interface DestinationsSpecAzureMonitorMetrics - Added Interface DiagnosticSettingsCategoryResource - Added Interface DiagnosticSettingsResource - Added Interface DynamicMetricCriteria + - Added Interface EmailReceiverAutoGenerated + - Added Interface ErrorContractAutoGenerated - Added Interface ErrorDetailAutoGenerated - Added Interface ErrorResponseAdditionalInfo - Added Interface ErrorResponseAutoGenerated - Added Interface ErrorResponseAutoGenerated2 + - Added Interface ErrorResponseAutoGenerated3 - Added Interface ErrorResponseDetails + - Added Interface EventHubDataSource + - Added Interface EventHubDestination + - Added Interface EventHubDirectDestination + - Added Interface FailoverConfigurationSpec + - Added Interface GetTestNotificationsAtTenantActionGroupResourceLevelOptionalParams - Added Interface Identity - Added Interface IisLogsDataSource - Added Interface IngestionSettings + - Added Interface LocationSpec - Added Interface LocationThresholdRuleCondition - Added Interface LogFilesDataSource - Added Interface LogFilesDataSourceSettings @@ -105,31 +112,45 @@ - Added Interface LogFileSettingsText - Added Interface LogFileTextSettings - Added Interface LogProfileResource + - Added Interface ManagedServiceIdentity - Added Interface ManagementEventRuleCondition - Added Interface Metadata - Added Interface MetricAlertMultipleResourceMultipleMetricCriteria - Added Interface MetricAlertResource - Added Interface MetricAlertSingleResourceMultipleMetricCriteria - Added Interface MetricCriteria + - Added Interface MetricDefinitionsListAtSubscriptionScopeOptionalParams - Added Interface Metrics + - Added Interface MetricsIngestionEndpointSpec + - Added Interface MetricsListAtSubscriptionScopeOptionalParams + - Added Interface MetricsListAtSubscriptionScopePostOptionalParams + - Added Interface MonitorClientCreateNotificationsAtTenantActionGroupResourceLevelHeaders + - Added Interface MonitoringAccountDestination - Added Interface MonitorOperationsListNextOptionalParams - Added Interface MonitorOperationsListOptionalParams - Added Interface OperationAutoGenerated - Added Interface OperationDisplayAutoGenerated - Added Interface OperationListResultAutoGenerated + - Added Interface PlatformTelemetryDataSource - Added Interface PredictiveAutoscalePolicy - Added Interface PredictiveMetricGetOptionalParams - Added Interface PredictiveResponse - Added Interface PredictiveValue - Added Interface PrivateEndpoint + - Added Interface PrivateEndpointAutoGenerated - Added Interface PrivateEndpointConnection + - Added Interface PrivateEndpointConnectionAutoGenerated - Added Interface PrivateLinkResource + - Added Interface PrivateLinkScopedResource - Added Interface PrivateLinkServiceConnectionState + - Added Interface PrometheusForwarderDataSource - Added Interface ProxyResourceAutoGenerated - Added Interface ResourceAutoGenerated2 - Added Interface ResourceAutoGenerated3 - Added Interface ResourceAutoGenerated4 - Added Interface ResourceAutoGenerated5 + - Added Interface ResourceAutoGenerated6 + - Added Interface ResourceForUpdateIdentity - Added Interface RuleEmailAction - Added Interface RuleManagementEventDataSource - Added Interface RuleMetricDataSource @@ -142,36 +163,66 @@ - Added Interface ScheduledQueryRulesListByResourceGroupNextOptionalParams - Added Interface ScheduledQueryRulesListBySubscriptionNextOptionalParams - Added Interface ScopedResource + - Added Interface SmsReceiverAutoGenerated + - Added Interface StorageBlobDestination + - Added Interface StorageTableDestination - Added Interface StreamDeclaration + - Added Interface SubscriptionScopeMetric + - Added Interface SubscriptionScopeMetricDefinition + - Added Interface SubscriptionScopeMetricDefinitionCollection + - Added Interface SubscriptionScopeMetricResponse + - Added Interface SubscriptionScopeMetricsRequestBodyParameters + - Added Interface TenantActionGroupList + - Added Interface TenantActionGroupResource + - Added Interface TenantActionGroupsCreateOrUpdateOptionalParams + - Added Interface TenantActionGroupsDeleteOptionalParams + - Added Interface TenantActionGroupsGetOptionalParams + - Added Interface TenantActionGroupsListByManagementGroupIdOptionalParams + - Added Interface TenantActionGroupsUpdateOptionalParams + - Added Interface TenantNotificationRequestBody + - Added Interface TestNotificationDetailsResponseAutoGenerated - Added Interface ThresholdRuleCondition - Added Interface TrackedResource - Added Interface TrackedResourceAutoGenerated + - Added Interface UserAssignedIdentity - Added Interface UserIdentityProperties - Added Interface VMInsightsOnboardingStatus + - Added Interface VoiceReceiverAutoGenerated + - Added Interface WebhookReceiverAutoGenerated - Added Interface WebtestLocationAvailabilityCriteria + - Added Interface WindowsFirewallLogsDataSource - Added Type Alias AccessMode - Added Type Alias ActionGroupsCreateNotificationsAtActionGroupResourceLevelResponse - - Added Type Alias ActionGroupsCreateNotificationsAtResourceGroupLevelResponse - Added Type Alias ActionGroupsGetTestNotificationsAtActionGroupResourceLevelResponse - - Added Type Alias ActionGroupsGetTestNotificationsAtResourceGroupLevelResponse - Added Type Alias ActionType - Added Type Alias ActivityLogAlertsListByResourceGroupNextResponse - Added Type Alias ActivityLogAlertsListBySubscriptionIdNextResponse - Added Type Alias AzureMonitorWorkspacesCreateResponse + - Added Type Alias AzureMonitorWorkspacesDeleteResponse - Added Type Alias AzureMonitorWorkspacesGetResponse - Added Type Alias AzureMonitorWorkspacesListByResourceGroupNextResponse - Added Type Alias AzureMonitorWorkspacesListByResourceGroupResponse - Added Type Alias AzureMonitorWorkspacesListBySubscriptionNextResponse - Added Type Alias AzureMonitorWorkspacesListBySubscriptionResponse - Added Type Alias AzureMonitorWorkspacesUpdateResponse + - Added Type Alias CreateNotificationsAtTenantActionGroupResourceLevelResponse - Added Type Alias DataCollectionRuleAssociationsListByDataCollectionEndpointNextResponse - Added Type Alias DataCollectionRuleAssociationsListByDataCollectionEndpointResponse - Added Type Alias DimensionOperator + - Added Type Alias GetTestNotificationsAtTenantActionGroupResourceLevelResponse - Added Type Alias IdentityType - Added Type Alias Kind - Added Type Alias KnownColumnDefinitionType + - Added Type Alias KnownLocationSpecProvisioningStatus - Added Type Alias KnownLogFilesDataSourceFormat - Added Type Alias KnownLogFileTextSettingsRecordStartTimestampFormat + - Added Type Alias KnownPrometheusForwarderDataSourceStreams + - Added Type Alias ManagedServiceIdentityType + - Added Type Alias MetricAggregationType + - Added Type Alias MetricDefinitionsListAtSubscriptionScopeResponse + - Added Type Alias MetricResultType + - Added Type Alias MetricsListAtSubscriptionScopePostResponse + - Added Type Alias MetricsListAtSubscriptionScopeResponse - Added Type Alias MonitorOperationsListNextResponse - Added Type Alias MonitorOperationsListResponse - Added Type Alias Origin @@ -182,35 +233,79 @@ - Added Type Alias PublicNetworkAccess - Added Type Alias ScheduledQueryRulesListByResourceGroupNextResponse - Added Type Alias ScheduledQueryRulesListBySubscriptionNextResponse + - Added Type Alias TenantActionGroupsCreateOrUpdateResponse + - Added Type Alias TenantActionGroupsGetResponse + - Added Type Alias TenantActionGroupsListByManagementGroupIdResponse + - Added Type Alias TenantActionGroupsUpdateResponse - Added Type Alias TimeAggregation + - Added Type Alias Unit - Interface AutoscaleSettingResourcePatch has a new optional parameter predictiveAutoscalePolicy + - Interface DataCollectionEndpoint has a new optional parameter failoverConfiguration + - Interface DataCollectionEndpoint has a new optional parameter metadata + - Interface DataCollectionEndpoint has a new optional parameter metricsIngestion + - Interface DataCollectionEndpoint has a new optional parameter privateLinkScopedResources + - Interface DataCollectionEndpointResource has a new optional parameter failoverConfiguration + - Interface DataCollectionEndpointResource has a new optional parameter identity + - Interface DataCollectionEndpointResource has a new optional parameter metadata + - Interface DataCollectionEndpointResource has a new optional parameter metricsIngestion + - Interface DataCollectionEndpointResource has a new optional parameter privateLinkScopedResources - Interface DataCollectionRule has a new optional parameter dataCollectionEndpointId - Interface DataCollectionRule has a new optional parameter metadata - Interface DataCollectionRule has a new optional parameter streamDeclarations - Interface DataCollectionRuleAssociation has a new optional parameter metadata - Interface DataCollectionRuleAssociationProxyOnlyResource has a new optional parameter metadata - Interface DataCollectionRuleResource has a new optional parameter dataCollectionEndpointId + - Interface DataCollectionRuleResource has a new optional parameter identity - Interface DataCollectionRuleResource has a new optional parameter metadata - Interface DataCollectionRuleResource has a new optional parameter streamDeclarations + - Interface DataFlow has a new optional parameter builtInTransform - Interface DataFlow has a new optional parameter outputStream - Interface DataFlow has a new optional parameter transformKql + - Interface DataSourcesSpec has a new optional parameter dataImports - Interface DataSourcesSpec has a new optional parameter iisLogs - Interface DataSourcesSpec has a new optional parameter logFiles + - Interface DataSourcesSpec has a new optional parameter platformTelemetry + - Interface DataSourcesSpec has a new optional parameter prometheusForwarder + - Interface DataSourcesSpec has a new optional parameter windowsFirewallLogs + - Interface DestinationsSpec has a new optional parameter eventHubs + - Interface DestinationsSpec has a new optional parameter eventHubsDirect + - Interface DestinationsSpec has a new optional parameter monitoringAccounts + - Interface DestinationsSpec has a new optional parameter storageAccounts + - Interface DestinationsSpec has a new optional parameter storageBlobsDirect + - Interface DestinationsSpec has a new optional parameter storageTablesDirect + - Interface ErrorResponse has a new optional parameter error - Interface LogSettings has a new optional parameter categoryGroup + - Interface MetricsListOptionalParams has a new optional parameter autoAdjustTimegrain + - Interface MetricsListOptionalParams has a new optional parameter validateDimensions + - Interface Operation has a new optional parameter actionType + - Interface Operation has a new optional parameter isDataAction + - Interface Operation has a new optional parameter origin + - Interface OperationDisplay has a new optional parameter description - Interface Resource has a new optional parameter systemData + - Interface ResourceAutoGenerated has a new optional parameter systemData + - Interface ResourceForUpdate has a new optional parameter identity - Added Enum KnownAccessMode - Added Enum KnownActionType - Added Enum KnownCategoryType - Added Enum KnownDimensionOperator - Added Enum KnownKind - Added Enum KnownKnownColumnDefinitionType + - Added Enum KnownKnownLocationSpecProvisioningStatus - Added Enum KnownKnownLogFilesDataSourceFormat - Added Enum KnownKnownLogFileTextSettingsRecordStartTimestampFormat + - Added Enum KnownKnownPrometheusForwarderDataSourceStreams + - Added Enum KnownManagedServiceIdentityType + - Added Enum KnownMetricAggregationType + - Added Enum KnownMetricResultType - Added Enum KnownOrigin - Added Enum KnownPrivateEndpointConnectionProvisioningState - Added Enum KnownPrivateEndpointServiceConnectionStatus - Added Enum KnownPublicNetworkAccess - Added Enum KnownTimeAggregation + - Enum KnownKnownDataCollectionEndpointProvisioningState has a new value Canceled + - Enum KnownKnownDataCollectionRuleAssociationProvisioningState has a new value Canceled + - Enum KnownKnownDataCollectionRuleProvisioningState has a new value Canceled + - Enum KnownKnownPublicNetworkAccessOptions has a new value SecuredByPerimeter - Enum KnownProvisioningState has a new value Creating - Enum KnownProvisioningState has a new value Deleting - Added function getContinuationToken @@ -218,23 +313,38 @@ **Breaking Changes** - Removed operation group Metrics + - Removed operation ActionGroups.beginPostTestNotifications + - Removed operation ActionGroups.beginPostTestNotificationsAndWait + - Removed operation ActionGroups.getTestNotifications - Operation ActivityLogAlerts.update has a new signature + - Operation PrivateEndpointConnections.beginCreateOrUpdate has a new signature + - Operation PrivateEndpointConnections.beginCreateOrUpdateAndWait has a new signature - Operation ScheduledQueryRules.createOrUpdate has a new signature - Operation ScheduledQueryRules.update has a new signature + - Class MonitorClient has a new signature - Interface ActivityLogsListNextOptionalParams no longer has parameter select - Interface AzureResource no longer has parameter identity - Interface AzureResource no longer has parameter kind + - Interface ErrorResponse no longer has parameter code + - Interface ErrorResponse no longer has parameter message - Interface PrivateEndpointConnectionListResult no longer has parameter nextLink - Interface PrivateLinkResourceListResult no longer has parameter nextLink + - Interface Resource no longer has parameter location + - Interface Resource no longer has parameter tags - Interface ResourceAutoGenerated no longer has parameter etag - Interface ResourceAutoGenerated no longer has parameter kind + - Interface ResourceAutoGenerated no longer has parameter location + - Interface ResourceAutoGenerated no longer has parameter tags - Interface ScheduledQueryRulesListByResourceGroupOptionalParams no longer has parameter filter - Interface ScheduledQueryRulesListBySubscriptionOptionalParams no longer has parameter filter - Interface TenantActivityLogsListNextOptionalParams no longer has parameter filter - Interface TenantActivityLogsListNextOptionalParams no longer has parameter select - Type of parameter operator of interface Dimension is changed from Operator to DimensionOperator - - Type of parameter error of interface ErrorContract is changed from ErrorResponse to ErrorResponseDetails - - Type of parameter error of interface OperationStatus is changed from ErrorResponseCommon to ErrorDetail + - Type of parameter error of interface ErrorContract is changed from ErrorResponse to ErrorResponseAutoGenerated + - Type of parameter error of interface ErrorResponseCommonV2 is changed from ErrorDetail to ErrorDetailAutoGenerated + - Type of parameter unit of interface Metric is changed from MetricUnit to Unit + - Type of parameter error of interface OperationStatus is changed from ErrorResponseCommon to ErrorDetailAutoGenerated + - Type of parameter value of interface PrivateEndpointConnectionListResult is changed from PrivateEndpointConnection[] to PrivateEndpointConnectionAutoGenerated[] - Class MonitorClient no longer has parameter metrics - Removed Enum KnownConditionalOperator - Removed Enum KnownEnabled @@ -243,385 +353,7 @@ - Enum KnownOperator no longer has value Include - Enum KnownProvisioningState no longer has value Deploying -## 8.0.0-beta.3 (2023-01-29) - -**Features** - - - Added operation group PredictiveMetric - - Added operation ActionGroups.beginCreateNotificationsAtActionGroupResourceLevel - - Added operation ActionGroups.beginCreateNotificationsAtActionGroupResourceLevelAndWait - - Added operation ActionGroups.beginCreateNotificationsAtResourceGroupLevel - - Added operation ActionGroups.beginCreateNotificationsAtResourceGroupLevelAndWait - - Added operation ActionGroups.getTestNotificationsAtActionGroupResourceLevel - - Added operation ActionGroups.getTestNotificationsAtResourceGroupLevel - - Added operation DataCollectionRuleAssociations.listByDataCollectionEndpoint - - Added Interface AccessModeSettings - - Added Interface AccessModeSettingsExclusion - - Added Interface ActionGroup - - Added Interface ActionGroupResource - - Added Interface ActionGroupsCreateNotificationsAtActionGroupResourceLevelHeaders - - Added Interface ActionGroupsCreateNotificationsAtActionGroupResourceLevelOptionalParams - - Added Interface ActionGroupsCreateNotificationsAtResourceGroupLevelHeaders - - Added Interface ActionGroupsCreateNotificationsAtResourceGroupLevelOptionalParams - - Added Interface ActionGroupsGetTestNotificationsAtActionGroupResourceLevelOptionalParams - - Added Interface ActionGroupsGetTestNotificationsAtResourceGroupLevelOptionalParams - - Added Interface ActionGroupsPostTestNotificationsHeaders - - Added Interface ActionList - - Added Interface ActivityLogAlertResource - - Added Interface ActivityLogAlertsListByResourceGroupNextOptionalParams - - Added Interface ActivityLogAlertsListBySubscriptionIdNextOptionalParams - - Added Interface AlertingAction - - Added Interface AlertRuleAllOfCondition - - Added Interface AlertRuleAnyOfOrLeafCondition - - Added Interface AlertRuleLeafCondition - - Added Interface AlertRuleList - - Added Interface AlertRulePatchObject - - Added Interface AlertRuleResource - - Added Interface AutoscaleErrorResponse - - Added Interface AutoscaleErrorResponseError - - Added Interface AutoscaleSettingResource - - Added Interface AzureMonitorPrivateLinkScope - - Added Interface AzureResourceAutoGenerated - - Added Interface ColumnDefinition - - Added Interface DataCollectionEndpointConfigurationAccess - - Added Interface DataCollectionEndpointLogsIngestion - - Added Interface DataCollectionEndpointNetworkAcls - - Added Interface DataCollectionEndpointResourceProperties - - Added Interface DataCollectionEndpointResourceSystemData - - Added Interface DataCollectionRuleAssociationMetadata - - Added Interface DataCollectionRuleAssociationProxyOnlyResourceProperties - - Added Interface DataCollectionRuleAssociationProxyOnlyResourceSystemData - - Added Interface DataCollectionRuleAssociationsListByDataCollectionEndpointNextOptionalParams - - Added Interface DataCollectionRuleAssociationsListByDataCollectionEndpointOptionalParams - - Added Interface DataCollectionRuleDataSources - - Added Interface DataCollectionRuleDestinations - - Added Interface DataCollectionRuleMetadata - - Added Interface DataCollectionRuleResourceProperties - - Added Interface DataCollectionRuleResourceSystemData - - Added Interface DefaultErrorResponse - - Added Interface DestinationsSpecAzureMonitorMetrics - - Added Interface DiagnosticSettingsCategoryResource - - Added Interface DiagnosticSettingsResource - - Added Interface DynamicMetricCriteria - - Added Interface ErrorResponseAutoGenerated - - Added Interface IisLogsDataSource - - Added Interface LocationThresholdRuleCondition - - Added Interface LogFilesDataSource - - Added Interface LogFilesDataSourceSettings - - Added Interface LogFileSettings - - Added Interface LogFileSettingsText - - Added Interface LogFileTextSettings - - Added Interface LogProfileResource - - Added Interface LogSearchRuleResource - - Added Interface LogToMetricAction - - Added Interface ManagementEventRuleCondition - - Added Interface Metadata - - Added Interface MetricAlertMultipleResourceMultipleMetricCriteria - - Added Interface MetricAlertResource - - Added Interface MetricAlertSingleResourceMultipleMetricCriteria - - Added Interface MetricCriteria - - Added Interface PredictiveAutoscalePolicy - - Added Interface PredictiveMetricGetOptionalParams - - Added Interface PredictiveResponse - - Added Interface PredictiveValue - - Added Interface PrivateEndpoint - - Added Interface PrivateEndpointConnection - - Added Interface PrivateLinkResource - - Added Interface PrivateLinkServiceConnectionState - - Added Interface ProxyResourceAutoGenerated - - Added Interface ResourceAutoGenerated2 - - Added Interface ResourceAutoGenerated3 - - Added Interface ResourceAutoGenerated4 - - Added Interface ResourceAutoGenerated5 - - Added Interface RuleEmailAction - - Added Interface RuleManagementEventDataSource - - Added Interface RuleMetricDataSource - - Added Interface RuleWebhookAction - - Added Interface ScopedResource - - Added Interface StreamDeclaration - - Added Interface ThresholdRuleCondition - - Added Interface TrackedResource - - Added Interface VMInsightsOnboardingStatus - - Added Interface WebtestLocationAvailabilityCriteria - - Added Type Alias AccessMode - - Added Type Alias ActionGroupsCreateNotificationsAtActionGroupResourceLevelResponse - - Added Type Alias ActionGroupsCreateNotificationsAtResourceGroupLevelResponse - - Added Type Alias ActionGroupsGetTestNotificationsAtActionGroupResourceLevelResponse - - Added Type Alias ActionGroupsGetTestNotificationsAtResourceGroupLevelResponse - - Added Type Alias ActivityLogAlertsListByResourceGroupNextResponse - - Added Type Alias ActivityLogAlertsListBySubscriptionIdNextResponse - - Added Type Alias DataCollectionRuleAssociationsListByDataCollectionEndpointNextResponse - - Added Type Alias DataCollectionRuleAssociationsListByDataCollectionEndpointResponse - - Added Type Alias KnownColumnDefinitionType - - Added Type Alias KnownLogFilesDataSourceFormat - - Added Type Alias KnownLogFileTextSettingsRecordStartTimestampFormat - - Added Type Alias PredictiveAutoscalePolicyScaleMode - - Added Type Alias PredictiveMetricGetResponse - - Added Type Alias PrivateEndpointConnectionProvisioningState - - Added Type Alias PrivateEndpointServiceConnectionStatus - - Interface AutoscaleSettingResourcePatch has a new optional parameter predictiveAutoscalePolicy - - Interface DataCollectionRule has a new optional parameter dataCollectionEndpointId - - Interface DataCollectionRule has a new optional parameter metadata - - Interface DataCollectionRule has a new optional parameter streamDeclarations - - Interface DataCollectionRuleAssociation has a new optional parameter metadata - - Interface DataCollectionRuleAssociationProxyOnlyResource has a new optional parameter metadata - - Interface DataCollectionRuleResource has a new optional parameter dataCollectionEndpointId - - Interface DataCollectionRuleResource has a new optional parameter metadata - - Interface DataCollectionRuleResource has a new optional parameter streamDeclarations - - Interface DataFlow has a new optional parameter outputStream - - Interface DataFlow has a new optional parameter transformKql - - Interface DataSourcesSpec has a new optional parameter iisLogs - - Interface DataSourcesSpec has a new optional parameter logFiles - - Interface LogSettings has a new optional parameter categoryGroup - - Interface Resource has a new optional parameter systemData - - Added Enum KnownAccessMode - - Added Enum KnownCategoryType - - Added Enum KnownKnownColumnDefinitionType - - Added Enum KnownKnownLogFilesDataSourceFormat - - Added Enum KnownKnownLogFileTextSettingsRecordStartTimestampFormat - - Added Enum KnownPrivateEndpointConnectionProvisioningState - - Added Enum KnownPrivateEndpointServiceConnectionStatus - - Added function getContinuationToken - -**Breaking Changes** - - - Operation ActivityLogAlerts.update has a new signature - - Interface ActivityLogsListNextOptionalParams no longer has parameter select - - Interface AzureResource no longer has parameter identity - - Interface AzureResource no longer has parameter kind - - Interface PrivateEndpointConnectionListResult no longer has parameter nextLink - - Interface PrivateLinkResourceListResult no longer has parameter nextLink - - Interface ResourceAutoGenerated no longer has parameter etag - - Interface ResourceAutoGenerated no longer has parameter kind - - Interface TenantActivityLogsListNextOptionalParams no longer has parameter filter - - Interface TenantActivityLogsListNextOptionalParams no longer has parameter select - - Type of parameter error of interface OperationStatus is changed from ErrorResponseCommon to ErrorDetail - -## 8.0.0-beta.2 (2022-07-29) - -**Features** - - - Added operation group PredictiveMetric - - Added operation ActionGroups.beginCreateNotificationsAtActionGroupResourceLevel - - Added operation ActionGroups.beginCreateNotificationsAtActionGroupResourceLevelAndWait - - Added operation ActionGroups.beginCreateNotificationsAtResourceGroupLevel - - Added operation ActionGroups.beginCreateNotificationsAtResourceGroupLevelAndWait - - Added operation ActionGroups.getTestNotificationsAtActionGroupResourceLevel - - Added operation ActionGroups.getTestNotificationsAtResourceGroupLevel - - Added operation DataCollectionRuleAssociations.listByDataCollectionEndpoint - - Added Interface AccessModeSettings - - Added Interface AccessModeSettingsExclusion - - Added Interface ActionGroup - - Added Interface ActionGroupResource - - Added Interface ActionGroupsCreateNotificationsAtActionGroupResourceLevelHeaders - - Added Interface ActionGroupsCreateNotificationsAtActionGroupResourceLevelOptionalParams - - Added Interface ActionGroupsCreateNotificationsAtResourceGroupLevelHeaders - - Added Interface ActionGroupsCreateNotificationsAtResourceGroupLevelOptionalParams - - Added Interface ActionGroupsGetTestNotificationsAtActionGroupResourceLevelOptionalParams - - Added Interface ActionGroupsGetTestNotificationsAtResourceGroupLevelOptionalParams - - Added Interface ActionGroupsPostTestNotificationsHeaders - - Added Interface ActionList - - Added Interface ActivityLogAlertResource - - Added Interface ActivityLogAlertsListByResourceGroupNextOptionalParams - - Added Interface ActivityLogAlertsListBySubscriptionIdNextOptionalParams - - Added Interface AlertingAction - - Added Interface AlertRuleAllOfCondition - - Added Interface AlertRuleAnyOfOrLeafCondition - - Added Interface AlertRuleLeafCondition - - Added Interface AlertRuleList - - Added Interface AlertRulePatchObject - - Added Interface AlertRuleResource - - Added Interface AutoscaleErrorResponse - - Added Interface AutoscaleErrorResponseError - - Added Interface AutoscaleSettingResource - - Added Interface AzureMonitorPrivateLinkScope - - Added Interface AzureResourceAutoGenerated - - Added Interface ColumnDefinition - - Added Interface DataCollectionEndpointConfigurationAccess - - Added Interface DataCollectionEndpointLogsIngestion - - Added Interface DataCollectionEndpointNetworkAcls - - Added Interface DataCollectionEndpointResourceProperties - - Added Interface DataCollectionEndpointResourceSystemData - - Added Interface DataCollectionRuleAssociationMetadata - - Added Interface DataCollectionRuleAssociationProxyOnlyResourceProperties - - Added Interface DataCollectionRuleAssociationProxyOnlyResourceSystemData - - Added Interface DataCollectionRuleAssociationsListByDataCollectionEndpointNextOptionalParams - - Added Interface DataCollectionRuleAssociationsListByDataCollectionEndpointOptionalParams - - Added Interface DataCollectionRuleDataSources - - Added Interface DataCollectionRuleDestinations - - Added Interface DataCollectionRuleMetadata - - Added Interface DataCollectionRuleResourceProperties - - Added Interface DataCollectionRuleResourceSystemData - - Added Interface DefaultErrorResponse - - Added Interface DestinationsSpecAzureMonitorMetrics - - Added Interface DiagnosticSettingsCategoryResource - - Added Interface DiagnosticSettingsResource - - Added Interface DynamicMetricCriteria - - Added Interface ErrorResponseAutoGenerated - - Added Interface IisLogsDataSource - - Added Interface LocationThresholdRuleCondition - - Added Interface LogFilesDataSource - - Added Interface LogFilesDataSourceSettings - - Added Interface LogFileSettings - - Added Interface LogFileSettingsText - - Added Interface LogFileTextSettings - - Added Interface LogProfileResource - - Added Interface LogSearchRuleResource - - Added Interface LogToMetricAction - - Added Interface ManagementEventRuleCondition - - Added Interface Metadata - - Added Interface MetricAlertMultipleResourceMultipleMetricCriteria - - Added Interface MetricAlertResource - - Added Interface MetricAlertSingleResourceMultipleMetricCriteria - - Added Interface MetricCriteria - - Added Interface PredictiveAutoscalePolicy - - Added Interface PredictiveMetricGetOptionalParams - - Added Interface PredictiveResponse - - Added Interface PredictiveValue - - Added Interface PrivateEndpoint - - Added Interface PrivateEndpointConnection - - Added Interface PrivateLinkResource - - Added Interface PrivateLinkServiceConnectionState - - Added Interface ProxyResourceAutoGenerated - - Added Interface ResourceAutoGenerated2 - - Added Interface ResourceAutoGenerated3 - - Added Interface ResourceAutoGenerated4 - - Added Interface ResourceAutoGenerated5 - - Added Interface RuleEmailAction - - Added Interface RuleManagementEventDataSource - - Added Interface RuleMetricDataSource - - Added Interface RuleWebhookAction - - Added Interface ScopedResource - - Added Interface StreamDeclaration - - Added Interface ThresholdRuleCondition - - Added Interface TrackedResource - - Added Interface VMInsightsOnboardingStatus - - Added Interface WebtestLocationAvailabilityCriteria - - Added Type Alias AccessMode - - Added Type Alias ActionGroupsCreateNotificationsAtActionGroupResourceLevelResponse - - Added Type Alias ActionGroupsCreateNotificationsAtResourceGroupLevelResponse - - Added Type Alias ActionGroupsGetTestNotificationsAtActionGroupResourceLevelResponse - - Added Type Alias ActionGroupsGetTestNotificationsAtResourceGroupLevelResponse - - Added Type Alias ActivityLogAlertsListByResourceGroupNextResponse - - Added Type Alias ActivityLogAlertsListBySubscriptionIdNextResponse - - Added Type Alias DataCollectionRuleAssociationsListByDataCollectionEndpointNextResponse - - Added Type Alias DataCollectionRuleAssociationsListByDataCollectionEndpointResponse - - Added Type Alias KnownColumnDefinitionType - - Added Type Alias KnownLogFilesDataSourceFormat - - Added Type Alias KnownLogFileTextSettingsRecordStartTimestampFormat - - Added Type Alias PredictiveAutoscalePolicyScaleMode - - Added Type Alias PredictiveMetricGetResponse - - Added Type Alias PrivateEndpointConnectionProvisioningState - - Added Type Alias PrivateEndpointServiceConnectionStatus - - Interface AutoscaleSettingResourcePatch has a new optional parameter predictiveAutoscalePolicy - - Interface DataCollectionRule has a new optional parameter dataCollectionEndpointId - - Interface DataCollectionRule has a new optional parameter metadata - - Interface DataCollectionRule has a new optional parameter streamDeclarations - - Interface DataCollectionRuleAssociation has a new optional parameter metadata - - Interface DataCollectionRuleAssociationProxyOnlyResource has a new optional parameter metadata - - Interface DataCollectionRuleResource has a new optional parameter dataCollectionEndpointId - - Interface DataCollectionRuleResource has a new optional parameter metadata - - Interface DataCollectionRuleResource has a new optional parameter streamDeclarations - - Interface DataFlow has a new optional parameter outputStream - - Interface DataFlow has a new optional parameter transformKql - - Interface DataSourcesSpec has a new optional parameter iisLogs - - Interface DataSourcesSpec has a new optional parameter logFiles - - Interface LogSettings has a new optional parameter categoryGroup - - Interface Resource has a new optional parameter systemData - - Class MonitorClient has a new parameter predictiveMetric - - Added Enum KnownAccessMode - - Added Enum KnownCategoryType - - Added Enum KnownKnownColumnDefinitionType - - Added Enum KnownKnownLogFilesDataSourceFormat - - Added Enum KnownKnownLogFileTextSettingsRecordStartTimestampFormat - - Added Enum KnownPrivateEndpointConnectionProvisioningState - - Added Enum KnownPrivateEndpointServiceConnectionStatus - -**Breaking Changes** - - - Operation ActivityLogAlerts.update has a new signature - - Interface AzureResource no longer has parameter identity - - Interface AzureResource no longer has parameter kind - - Interface PrivateEndpointConnectionListResult no longer has parameter nextLink - - Interface PrivateLinkResourceListResult no longer has parameter nextLink - - Interface ResourceAutoGenerated no longer has parameter etag - - Interface ResourceAutoGenerated no longer has parameter kind - -## 8.0.0-beta.1 (2022-06-10) -**Features** - - - Added operation ActionGroups.beginCreateNotificationsAtActionGroupResourceLevel - - Added operation ActionGroups.beginCreateNotificationsAtActionGroupResourceLevelAndWait - - Added operation ActionGroups.beginCreateNotificationsAtResourceGroupLevel - - Added operation ActionGroups.beginCreateNotificationsAtResourceGroupLevelAndWait - - Added operation ActionGroups.getTestNotificationsAtActionGroupResourceLevel - - Added operation ActionGroups.getTestNotificationsAtResourceGroupLevel - - Added operation DataCollectionRuleAssociations.listByDataCollectionEndpoint - - Added Interface ActionGroup - - Added Interface ActionGroupsCreateNotificationsAtActionGroupResourceLevelHeaders - - Added Interface ActionGroupsCreateNotificationsAtActionGroupResourceLevelOptionalParams - - Added Interface ActionGroupsCreateNotificationsAtResourceGroupLevelHeaders - - Added Interface ActionGroupsCreateNotificationsAtResourceGroupLevelOptionalParams - - Added Interface ActionGroupsGetTestNotificationsAtActionGroupResourceLevelOptionalParams - - Added Interface ActionGroupsGetTestNotificationsAtResourceGroupLevelOptionalParams - - Added Interface ActionGroupsPostTestNotificationsHeaders - - Added Interface ActionList - - Added Interface ActivityLogAlertsListByResourceGroupNextOptionalParams - - Added Interface ActivityLogAlertsListBySubscriptionIdNextOptionalParams - - Added Interface AlertRuleAllOfCondition - - Added Interface AlertRuleLeafCondition - - Added Interface AlertRuleList - - Added Interface AlertRulePatchObject - - Added Interface AzureResourceAutoGenerated - - Added Interface ColumnDefinition - - Added Interface DataCollectionRuleAssociationsListByDataCollectionEndpointNextOptionalParams - - Added Interface DataCollectionRuleAssociationsListByDataCollectionEndpointOptionalParams - - Added Interface ErrorResponseAutoGenerated - - Added Interface IisLogsDataSource - - Added Interface LogFilesDataSource - - Added Interface LogFileSettings - - Added Interface LogFileTextSettings - - Added Interface Metadata - - Added Interface StreamDeclaration - - Added Type Alias ActionGroupsCreateNotificationsAtActionGroupResourceLevelResponse - - Added Type Alias ActionGroupsCreateNotificationsAtResourceGroupLevelResponse - - Added Type Alias ActionGroupsGetTestNotificationsAtActionGroupResourceLevelResponse - - Added Type Alias ActionGroupsGetTestNotificationsAtResourceGroupLevelResponse - - Added Type Alias ActivityLogAlertsListByResourceGroupNextResponse - - Added Type Alias ActivityLogAlertsListBySubscriptionIdNextResponse - - Added Type Alias AlertRuleAnyOfOrLeafCondition - - Added Type Alias DataCollectionRuleAssociationMetadata - - Added Type Alias DataCollectionRuleAssociationsListByDataCollectionEndpointNextResponse - - Added Type Alias DataCollectionRuleAssociationsListByDataCollectionEndpointResponse - - Added Type Alias DataCollectionRuleMetadata - - Added Type Alias KnownColumnDefinitionType - - Added Type Alias KnownLogFilesDataSourceFormat - - Added Type Alias KnownLogFileTextSettingsRecordStartTimestampFormat - - Added Type Alias LogFilesDataSourceSettings - - Added Type Alias LogFileSettingsText - - Interface DataCollectionRule has a new optional parameter dataCollectionEndpointId - - Interface DataCollectionRule has a new optional parameter metadata - - Interface DataCollectionRule has a new optional parameter streamDeclarations - - Interface DataCollectionRuleAssociation has a new optional parameter metadata - - Interface DataCollectionRuleAssociationProxyOnlyResource has a new optional parameter metadata - - Interface DataCollectionRuleResource has a new optional parameter dataCollectionEndpointId - - Interface DataCollectionRuleResource has a new optional parameter metadata - - Interface DataCollectionRuleResource has a new optional parameter streamDeclarations - - Interface DataFlow has a new optional parameter outputStream - - Interface DataFlow has a new optional parameter transformKql - - 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 KnownKnownColumnDefinitionType - - Added Enum KnownKnownLogFilesDataSourceFormat - - Added Enum KnownKnownLogFileTextSettingsRecordStartTimestampFormat - -**Breaking Changes** - - - Operation ActivityLogAlerts.update has a new signature - - Delete parameters of Resource in TypeAlias ActivityLogAlertResource - ## 7.0.0 (2021-12-20) The package of @azure/arm-monitor is using our next generation design principles since version 7.0.0, which contains breaking changes. @@ -630,4 +362,4 @@ To understand the detail of the change, please refer to [Changelog](https://aka. To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). -To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). +To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/monitor/arm-monitor/_meta.json b/sdk/monitor/arm-monitor/_meta.json index 1a33dff7f205..a231a981c2b6 100644 --- a/sdk/monitor/arm-monitor/_meta.json +++ b/sdk/monitor/arm-monitor/_meta.json @@ -1,8 +1,8 @@ { - "commit": "dcf548aea9f776d166e8c53f8ecb8eff9beef2a5", + "commit": "cb7a4bf483687c0e6f636cbd46e0b8d4e9d952f0", "readme": "specification/monitor/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\monitor\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.8 --generate-sample=true", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/monitor/resource-manager/readme.md --use=@autorest/typescript@^6.0.11", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", - "use": "@autorest/typescript@6.0.0-rc.8" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.2", + "use": "@autorest/typescript@^6.0.11" } \ No newline at end of file diff --git a/sdk/monitor/arm-monitor/assets.json b/sdk/monitor/arm-monitor/assets.json deleted file mode 100644 index 3ad9f11f2017..000000000000 --- a/sdk/monitor/arm-monitor/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "js", - "TagPrefix": "js/monitor/arm-monitor", - "Tag": "js/monitor/arm-monitor_06883d5e17" -} diff --git a/sdk/monitor/arm-monitor/package.json b/sdk/monitor/arm-monitor/package.json index 2ddc9f473fdc..5d766bb1097f 100644 --- a/sdk/monitor/arm-monitor/package.json +++ b/sdk/monitor/arm-monitor/package.json @@ -8,12 +8,12 @@ "node": ">=16.0.0" }, "dependencies": { - "@azure/core-lro": "^2.5.0", + "@azure/core-lro": "^2.5.4", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-rest-pipeline": "^1.12.0", "tslib": "^2.2.0" }, "keywords": [ @@ -29,25 +29,29 @@ "types": "./types/arm-monitor.d.ts", "devDependencies": { "@microsoft/api-extractor": "^7.31.1", + "@rollup/plugin-commonjs": "^24.0.0", + "@rollup/plugin-json": "^6.0.0", + "@rollup/plugin-multi-entry": "^6.0.0", + "@rollup/plugin-node-resolve": "^13.1.3", "mkdirp": "^2.1.2", - "typescript": "~5.2.0", + "rollup": "^2.66.1", + "rollup-plugin-sourcemaps": "^0.6.3", + "typescript": "~5.0.0", "uglify-js": "^3.4.9", - "rimraf": "^3.0.0", + "rimraf": "^5.0.0", "dotenv": "^16.0.0", "@azure/identity": "^3.3.0", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", "mocha": "^10.0.0", + "@types/mocha": "^10.0.0", + "esm": "^3.2.18", "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^16.0.0", - "@azure/dev-tool": "^1.0.0", - "@azure/arm-eventhub": "5.2.0-beta.2", - "@azure/arm-logic": "^8.0.0", - "@azure/arm-operationalinsights": "^9.0.0", - "@azure/arm-storage": "^18.0.0", - "ts-node": "^10.0.0" + "ts-node": "^10.0.0", + "@azure/dev-tool": "^1.0.0" }, "repository": { "type": "git", @@ -68,20 +72,21 @@ "src/**/*.ts", "README.md", "LICENSE", + "rollup.config.js", "tsconfig.json", "review/*", "CHANGELOG.md", "types/*" ], "scripts": { - "build": "npm run clean && tsc && dev-tool run bundle && npm run minify && mkdirp ./review && npm run extract-api", + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", "prepack": "npm run build", "pack": "npm pack 2>&1", "extract-api": "api-extractor run --local", "lint": "echo skipped", "audit": "echo skipped", - "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", "build:browser": "echo skipped", "build:test": "echo skipped", @@ -109,13 +114,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/monitor/arm-monitor", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-monitor?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/monitor/arm-monitor" +} \ No newline at end of file diff --git a/sdk/monitor/arm-monitor/review/arm-monitor.api.md b/sdk/monitor/arm-monitor/review/arm-monitor.api.md index fd3bea84ffb9..9511af09b332 100644 --- a/sdk/monitor/arm-monitor/review/arm-monitor.api.md +++ b/sdk/monitor/arm-monitor/review/arm-monitor.api.md @@ -37,6 +37,16 @@ export interface ActionDetail { subState?: string; } +// @public +export interface ActionDetailAutoGenerated { + mechanismType?: string; + message?: string; + name?: string; + sendTime?: string; + status?: string; + subState?: string; +} + // @public export interface ActionGroup { actionGroupId: string; @@ -59,6 +69,14 @@ export interface ActionGroupPatchBody { }; } +// @public +export interface ActionGroupPatchBodyAutoGenerated { + enabled?: boolean; + tags?: { + [propertyName: string]: string; + }; +} + // @public export interface ActionGroupResource extends AzureResource { armRoleReceivers?: ArmRoleReceiver[]; @@ -80,17 +98,11 @@ export interface ActionGroupResource extends AzureResource { export interface ActionGroups { beginCreateNotificationsAtActionGroupResourceLevel(resourceGroupName: string, actionGroupName: string, notificationRequest: NotificationRequestBody, options?: ActionGroupsCreateNotificationsAtActionGroupResourceLevelOptionalParams): Promise, ActionGroupsCreateNotificationsAtActionGroupResourceLevelResponse>>; beginCreateNotificationsAtActionGroupResourceLevelAndWait(resourceGroupName: string, actionGroupName: string, notificationRequest: NotificationRequestBody, options?: ActionGroupsCreateNotificationsAtActionGroupResourceLevelOptionalParams): Promise; - beginCreateNotificationsAtResourceGroupLevel(resourceGroupName: string, notificationRequest: NotificationRequestBody, options?: ActionGroupsCreateNotificationsAtResourceGroupLevelOptionalParams): Promise, ActionGroupsCreateNotificationsAtResourceGroupLevelResponse>>; - beginCreateNotificationsAtResourceGroupLevelAndWait(resourceGroupName: string, notificationRequest: NotificationRequestBody, options?: ActionGroupsCreateNotificationsAtResourceGroupLevelOptionalParams): Promise; - beginPostTestNotifications(notificationRequest: NotificationRequestBody, options?: ActionGroupsPostTestNotificationsOptionalParams): Promise, ActionGroupsPostTestNotificationsResponse>>; - beginPostTestNotificationsAndWait(notificationRequest: NotificationRequestBody, options?: ActionGroupsPostTestNotificationsOptionalParams): Promise; createOrUpdate(resourceGroupName: string, actionGroupName: string, actionGroup: ActionGroupResource, options?: ActionGroupsCreateOrUpdateOptionalParams): Promise; delete(resourceGroupName: string, actionGroupName: string, options?: ActionGroupsDeleteOptionalParams): Promise; enableReceiver(resourceGroupName: string, actionGroupName: string, enableRequest: EnableRequest, options?: ActionGroupsEnableReceiverOptionalParams): Promise; get(resourceGroupName: string, actionGroupName: string, options?: ActionGroupsGetOptionalParams): Promise; - getTestNotifications(notificationId: string, options?: ActionGroupsGetTestNotificationsOptionalParams): Promise; getTestNotificationsAtActionGroupResourceLevel(resourceGroupName: string, actionGroupName: string, notificationId: string, options?: ActionGroupsGetTestNotificationsAtActionGroupResourceLevelOptionalParams): Promise; - getTestNotificationsAtResourceGroupLevel(resourceGroupName: string, notificationId: string, options?: ActionGroupsGetTestNotificationsAtResourceGroupLevelOptionalParams): Promise; listByResourceGroup(resourceGroupName: string, options?: ActionGroupsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; listBySubscriptionId(options?: ActionGroupsListBySubscriptionIdOptionalParams): PagedAsyncIterableIterator; update(resourceGroupName: string, actionGroupName: string, actionGroupPatch: ActionGroupPatchBody, options?: ActionGroupsUpdateOptionalParams): Promise; @@ -110,20 +122,6 @@ export interface ActionGroupsCreateNotificationsAtActionGroupResourceLevelOption // @public export type ActionGroupsCreateNotificationsAtActionGroupResourceLevelResponse = TestNotificationDetailsResponse; -// @public -export interface ActionGroupsCreateNotificationsAtResourceGroupLevelHeaders { - location?: string; -} - -// @public -export interface ActionGroupsCreateNotificationsAtResourceGroupLevelOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type ActionGroupsCreateNotificationsAtResourceGroupLevelResponse = TestNotificationDetailsResponse; - // @public export interface ActionGroupsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { } @@ -153,20 +151,6 @@ export interface ActionGroupsGetTestNotificationsAtActionGroupResourceLevelOptio // @public export type ActionGroupsGetTestNotificationsAtActionGroupResourceLevelResponse = TestNotificationDetailsResponse; -// @public -export interface ActionGroupsGetTestNotificationsAtResourceGroupLevelOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ActionGroupsGetTestNotificationsAtResourceGroupLevelResponse = TestNotificationDetailsResponse; - -// @public -export interface ActionGroupsGetTestNotificationsOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ActionGroupsGetTestNotificationsResponse = TestNotificationDetailsResponse; - // @public export interface ActionGroupsListByResourceGroupOptionalParams extends coreClient.OperationOptions { } @@ -181,20 +165,6 @@ export interface ActionGroupsListBySubscriptionIdOptionalParams extends coreClie // @public export type ActionGroupsListBySubscriptionIdResponse = ActionGroupList; -// @public -export interface ActionGroupsPostTestNotificationsHeaders { - location?: string; -} - -// @public -export interface ActionGroupsPostTestNotificationsOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type ActionGroupsPostTestNotificationsResponse = TestNotificationDetailsResponse; - // @public export interface ActionGroupsUpdateOptionalParams extends coreClient.OperationOptions { } @@ -368,7 +338,7 @@ export interface AlertRulePatchObject { } // @public -export interface AlertRuleResource extends ResourceAutoGenerated { +export interface AlertRuleResource extends ResourceAutoGenerated3 { action?: RuleActionUnion; actions?: RuleActionUnion[]; condition: RuleConditionUnion; @@ -500,7 +470,7 @@ export interface AutoscaleProfile { } // @public -export interface AutoscaleSettingResource extends Resource { +export interface AutoscaleSettingResource extends ResourceAutoGenerated2 { enabled?: boolean; namePropertiesName?: string; notifications?: AutoscaleNotification[]; @@ -599,6 +569,12 @@ export interface AzureAppPushReceiver { name: string; } +// @public +export interface AzureAppPushReceiverAutoGenerated { + emailAddress: string; + name: string; +} + // @public export interface AzureFunctionReceiver { functionAppResourceId: string; @@ -614,9 +590,9 @@ export interface AzureMonitorMetricsDestination { } // @public -export interface AzureMonitorPrivateLinkScope extends TrackedResource { +export interface AzureMonitorPrivateLinkScope extends TrackedResourceAutoGenerated { accessModeSettings: AccessModeSettings; - readonly privateEndpointConnections?: PrivateEndpointConnection[]; + readonly privateEndpointConnections?: PrivateEndpointConnectionAutoGenerated[]; readonly provisioningState?: string; readonly systemData?: SystemData; } @@ -632,7 +608,9 @@ export interface AzureMonitorWorkspace { readonly accountId?: string; readonly defaultIngestionSettings?: AzureMonitorWorkspaceDefaultIngestionSettings; readonly metrics?: AzureMonitorWorkspaceMetrics; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; readonly provisioningState?: ProvisioningState; + readonly publicNetworkAccess?: PublicNetworkAccess; } // @public @@ -644,12 +622,14 @@ export interface AzureMonitorWorkspaceMetrics extends Metrics { } // @public -export interface AzureMonitorWorkspaceResource extends TrackedResourceAutoGenerated { +export interface AzureMonitorWorkspaceResource extends TrackedResource { readonly accountId?: string; readonly defaultIngestionSettings?: AzureMonitorWorkspaceDefaultIngestionSettings; readonly etag?: string; readonly metrics?: AzureMonitorWorkspaceMetrics; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; readonly provisioningState?: ProvisioningState; + readonly publicNetworkAccess?: PublicNetworkAccess; } // @public @@ -671,8 +651,9 @@ export interface AzureMonitorWorkspaceResourceProperties extends AzureMonitorWor // @public export interface AzureMonitorWorkspaces { + beginDelete(resourceGroupName: string, azureMonitorWorkspaceName: string, options?: AzureMonitorWorkspacesDeleteOptionalParams): Promise, AzureMonitorWorkspacesDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, azureMonitorWorkspaceName: string, options?: AzureMonitorWorkspacesDeleteOptionalParams): Promise; create(resourceGroupName: string, azureMonitorWorkspaceName: string, azureMonitorWorkspaceProperties: AzureMonitorWorkspaceResource, options?: AzureMonitorWorkspacesCreateOptionalParams): Promise; - delete(resourceGroupName: string, azureMonitorWorkspaceName: string, options?: AzureMonitorWorkspacesDeleteOptionalParams): Promise; get(resourceGroupName: string, azureMonitorWorkspaceName: string, options?: AzureMonitorWorkspacesGetOptionalParams): Promise; listByResourceGroup(resourceGroupName: string, options?: AzureMonitorWorkspacesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; listBySubscription(options?: AzureMonitorWorkspacesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; @@ -686,10 +667,23 @@ export interface AzureMonitorWorkspacesCreateOptionalParams extends coreClient.O // @public export type AzureMonitorWorkspacesCreateResponse = AzureMonitorWorkspaceResource; +// @public +export interface AzureMonitorWorkspacesDeleteHeaders { + // (undocumented) + azureAsyncOperation?: string; + // (undocumented) + location?: string; +} + // @public export interface AzureMonitorWorkspacesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } +// @public +export type AzureMonitorWorkspacesDeleteResponse = AzureMonitorWorkspacesDeleteHeaders; + // @public export interface AzureMonitorWorkspacesGetOptionalParams extends coreClient.OperationOptions { } @@ -832,6 +826,15 @@ export interface Context { // @public export type CreatedByType = string; +// @public +export interface CreateNotificationsAtTenantActionGroupResourceLevelOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CreateNotificationsAtTenantActionGroupResourceLevelResponse = TestNotificationDetailsResponseAutoGenerated; + // @public export type CriterionType = string; @@ -839,9 +842,13 @@ export type CriterionType = string; export interface DataCollectionEndpoint { configurationAccess?: DataCollectionEndpointConfigurationAccess; description?: string; + readonly failoverConfiguration?: DataCollectionEndpointFailoverConfiguration; immutableId?: string; logsIngestion?: DataCollectionEndpointLogsIngestion; + readonly metadata?: DataCollectionEndpointMetadata; + metricsIngestion?: DataCollectionEndpointMetricsIngestion; networkAcls?: DataCollectionEndpointNetworkAcls; + readonly privateLinkScopedResources?: PrivateLinkScopedResource[]; readonly provisioningState?: KnownDataCollectionEndpointProvisioningState; } @@ -849,10 +856,22 @@ export interface DataCollectionEndpoint { export interface DataCollectionEndpointConfigurationAccess extends ConfigurationAccessEndpointSpec { } +// @public +export interface DataCollectionEndpointFailoverConfiguration extends FailoverConfigurationSpec { +} + // @public export interface DataCollectionEndpointLogsIngestion extends LogsIngestionEndpointSpec { } +// @public +export interface DataCollectionEndpointMetadata extends Metadata { +} + +// @public +export interface DataCollectionEndpointMetricsIngestion extends MetricsIngestionEndpointSpec { +} + // @public export interface DataCollectionEndpointNetworkAcls extends NetworkRuleSet { } @@ -862,13 +881,18 @@ export interface DataCollectionEndpointResource { configurationAccess?: DataCollectionEndpointConfigurationAccess; description?: string; readonly etag?: string; + readonly failoverConfiguration?: DataCollectionEndpointFailoverConfiguration; readonly id?: string; + identity?: DataCollectionEndpointResourceIdentity; immutableId?: string; kind?: KnownDataCollectionEndpointResourceKind; location: string; logsIngestion?: DataCollectionEndpointLogsIngestion; + readonly metadata?: DataCollectionEndpointMetadata; + metricsIngestion?: DataCollectionEndpointMetricsIngestion; readonly name?: string; networkAcls?: DataCollectionEndpointNetworkAcls; + readonly privateLinkScopedResources?: PrivateLinkScopedResource[]; readonly provisioningState?: KnownDataCollectionEndpointProvisioningState; readonly systemData?: DataCollectionEndpointResourceSystemData; tags?: { @@ -877,6 +901,10 @@ export interface DataCollectionEndpointResource { readonly type?: string; } +// @public +export interface DataCollectionEndpointResourceIdentity extends ManagedServiceIdentity { +} + // @public export interface DataCollectionEndpointResourceListResult { nextLink?: string; @@ -1104,6 +1132,7 @@ export interface DataCollectionRuleResource { destinations?: DataCollectionRuleDestinations; readonly etag?: string; readonly id?: string; + identity?: DataCollectionRuleResourceIdentity; readonly immutableId?: string; kind?: KnownDataCollectionRuleResourceKind; location: string; @@ -1120,6 +1149,10 @@ export interface DataCollectionRuleResource { readonly type?: string; } +// @public +export interface DataCollectionRuleResourceIdentity extends ManagedServiceIdentity { +} + // @public export interface DataCollectionRuleResourceListResult { nextLink?: string; @@ -1206,20 +1239,38 @@ export interface DataContainer { // @public export interface DataFlow { + builtInTransform?: string; destinations?: string[]; outputStream?: string; streams?: KnownDataFlowStreams[]; transformKql?: string; } +// @public (undocumented) +export interface DataImportSources { + eventHub?: DataImportSourcesEventHub; +} + +// @public +export interface DataImportSourcesEventHub extends EventHubDataSource { +} + // @public export interface DataSourcesSpec { + dataImports?: DataSourcesSpecDataImports; extensions?: ExtensionDataSource[]; iisLogs?: IisLogsDataSource[]; logFiles?: LogFilesDataSource[]; performanceCounters?: PerfCounterDataSource[]; + platformTelemetry?: PlatformTelemetryDataSource[]; + prometheusForwarder?: PrometheusForwarderDataSource[]; syslog?: SyslogDataSource[]; windowsEventLogs?: WindowsEventLogDataSource[]; + windowsFirewallLogs?: WindowsFirewallLogsDataSource[]; +} + +// @public +export interface DataSourcesSpecDataImports extends DataImportSources { } // @public @@ -1227,13 +1278,19 @@ export type DataStatus = string; // @public export interface DefaultErrorResponse { - error?: ErrorDetail; + error?: ErrorDetailAutoGenerated; } // @public export interface DestinationsSpec { azureMonitorMetrics?: DestinationsSpecAzureMonitorMetrics; + eventHubs?: EventHubDestination[]; + eventHubsDirect?: EventHubDirectDestination[]; logAnalytics?: LogAnalyticsDestination[]; + monitoringAccounts?: MonitoringAccountDestination[]; + storageAccounts?: StorageBlobDestination[]; + storageBlobsDirect?: StorageBlobDestination[]; + storageTablesDirect?: StorageTableDestination[]; } // @public @@ -1269,7 +1326,7 @@ export interface DiagnosticSettingsCategoryListOptionalParams extends coreClient export type DiagnosticSettingsCategoryListResponse = DiagnosticSettingsCategoryResourceCollection; // @public -export interface DiagnosticSettingsCategoryResource extends ResourceAutoGenerated3 { +export interface DiagnosticSettingsCategoryResource extends ResourceAutoGenerated5 { categoryGroups?: string[]; categoryType?: CategoryType; readonly systemData?: SystemData; @@ -1306,7 +1363,7 @@ export interface DiagnosticSettingsListOptionalParams extends coreClient.Operati export type DiagnosticSettingsListResponse = DiagnosticSettingsResourceCollection; // @public -export interface DiagnosticSettingsResource extends ResourceAutoGenerated3 { +export interface DiagnosticSettingsResource extends ResourceAutoGenerated5 { eventHubAuthorizationRuleId?: string; eventHubName?: string; logAnalyticsDestinationType?: string; @@ -1370,6 +1427,14 @@ export interface EmailReceiver { useCommonAlertSchema?: boolean; } +// @public +export interface EmailReceiverAutoGenerated { + emailAddress: string; + name: string; + readonly status?: ReceiverStatus; + useCommonAlertSchema?: boolean; +} + // @public export interface EnableRequest { receiverName: string; @@ -1383,6 +1448,11 @@ export interface ErrorAdditionalInfo { // @public export interface ErrorContract { + error?: ErrorResponseAutoGenerated; +} + +// @public +export interface ErrorContractAutoGenerated { error?: ErrorResponseDetails; } @@ -1412,8 +1482,7 @@ export interface ErrorModel { // @public export interface ErrorResponse { - code?: string; - message?: string; + error?: ErrorDetail; } // @public @@ -1424,8 +1493,8 @@ export interface ErrorResponseAdditionalInfo { // @public export interface ErrorResponseAutoGenerated { - readonly code?: string; - readonly message?: string; + code?: string; + message?: string; } // @public @@ -1433,9 +1502,15 @@ export interface ErrorResponseAutoGenerated2 { error?: ErrorDetailAutoGenerated; } +// @public +export interface ErrorResponseAutoGenerated3 { + readonly code?: string; + readonly message?: string; +} + // @public export interface ErrorResponseCommonV2 { - error?: ErrorDetail; + error?: ErrorDetailAutoGenerated; } // @public @@ -1502,6 +1577,25 @@ export interface EventDataCollection { value: EventData[]; } +// @public (undocumented) +export interface EventHubDataSource { + consumerGroup?: string; + name?: string; + stream?: string; +} + +// @public (undocumented) +export interface EventHubDestination { + eventHubResourceId?: string; + name?: string; +} + +// @public (undocumented) +export interface EventHubDirectDestination { + eventHubResourceId?: string; + name?: string; +} + // @public export interface EventHubReceiver { eventHubName: string; @@ -1524,9 +1618,22 @@ export interface ExtensionDataSource { streams?: KnownExtensionDataSourceStreams[]; } +// @public (undocumented) +export interface FailoverConfigurationSpec { + activeLocation?: string; + locations?: LocationSpec[]; +} + // @public export function getContinuationToken(page: unknown): string | undefined; +// @public +export interface GetTestNotificationsAtTenantActionGroupResourceLevelOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type GetTestNotificationsAtTenantActionGroupResourceLevelResponse = TestNotificationDetailsResponseAutoGenerated; + // @public export interface HttpRequestInfo { clientIpAddress?: string; @@ -1712,6 +1819,7 @@ export enum KnownKnownColumnDefinitionType { // @public export enum KnownKnownDataCollectionEndpointProvisioningState { + Canceled = "Canceled", Creating = "Creating", Deleting = "Deleting", Failed = "Failed", @@ -1727,6 +1835,7 @@ export enum KnownKnownDataCollectionEndpointResourceKind { // @public export enum KnownKnownDataCollectionRuleAssociationProvisioningState { + Canceled = "Canceled", Creating = "Creating", Deleting = "Deleting", Failed = "Failed", @@ -1736,6 +1845,7 @@ export enum KnownKnownDataCollectionRuleAssociationProvisioningState { // @public export enum KnownKnownDataCollectionRuleProvisioningState { + Canceled = "Canceled", Creating = "Creating", Deleting = "Deleting", Failed = "Failed", @@ -1767,6 +1877,16 @@ export enum KnownKnownExtensionDataSourceStreams { MicrosoftWindowsEvent = "Microsoft-WindowsEvent" } +// @public +export enum KnownKnownLocationSpecProvisioningStatus { + Canceled = "Canceled", + Creating = "Creating", + Deleting = "Deleting", + Failed = "Failed", + Succeeded = "Succeeded", + Updating = "Updating" +} + // @public export enum KnownKnownLogFilesDataSourceFormat { Text = "text" @@ -1791,10 +1911,16 @@ export enum KnownKnownPerfCounterDataSourceStreams { MicrosoftPerf = "Microsoft-Perf" } +// @public +export enum KnownKnownPrometheusForwarderDataSourceStreams { + MicrosoftPrometheusMetrics = "Microsoft-PrometheusMetrics" +} + // @public export enum KnownKnownPublicNetworkAccessOptions { Disabled = "Disabled", - Enabled = "Enabled" + Enabled = "Enabled", + SecuredByPerimeter = "SecuredByPerimeter" } // @public @@ -1846,12 +1972,33 @@ export enum KnownKnownWindowsEventLogDataSourceStreams { MicrosoftWindowsEvent = "Microsoft-WindowsEvent" } +// @public +export type KnownLocationSpecProvisioningStatus = string; + // @public export type KnownLogFilesDataSourceFormat = string; // @public export type KnownLogFileTextSettingsRecordStartTimestampFormat = string; +// @public +export enum KnownManagedServiceIdentityType { + None = "None", + SystemAssigned = "SystemAssigned", + SystemAssignedUserAssigned = "SystemAssigned,UserAssigned", + UserAssigned = "UserAssigned" +} + +// @public +export enum KnownMetricAggregationType { + Average = "Average", + Count = "Count", + Maximum = "Maximum", + Minimum = "Minimum", + None = "None", + Total = "Total" +} + // @public export enum KnownMetricClass { Availability = "Availability", @@ -1861,6 +2008,12 @@ export enum KnownMetricClass { Transactions = "Transactions" } +// @public +export enum KnownMetricResultType { + Data = "Data", + Metadata = "Metadata" +} + // @public export enum KnownMetricUnit { BitsPerSecond = "BitsPerSecond", @@ -1933,6 +2086,9 @@ export enum KnownPrivateEndpointServiceConnectionStatus { Rejected = "Rejected" } +// @public +export type KnownPrometheusForwarderDataSourceStreams = string; + // @public export enum KnownProvisioningState { Canceled = "Canceled", @@ -1985,6 +2141,12 @@ export interface LocalizableString { value: string; } +// @public (undocumented) +export interface LocationSpec { + location?: string; + provisioningStatus?: KnownLocationSpecProvisioningStatus; +} + // @public export interface LocationThresholdRuleCondition extends RuleCondition { failedLocationCount: number; @@ -2040,7 +2202,7 @@ export interface LogProfileCollection { } // @public -export interface LogProfileResource extends ResourceAutoGenerated2 { +export interface LogProfileResource extends ResourceAutoGenerated4 { categories: string[]; locations: string[]; retentionPolicy: RetentionPolicy; @@ -2114,6 +2276,19 @@ export interface LogsIngestionEndpointSpec { readonly endpoint?: string; } +// @public +export interface ManagedServiceIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type: ManagedServiceIdentityType; + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentity | null; + }; +} + +// @public +export type ManagedServiceIdentityType = string; + // @public export interface ManagementEventAggregationCondition { operator?: ConditionOperator; @@ -2130,6 +2305,7 @@ export interface ManagementEventRuleCondition extends RuleCondition { // @public export interface Metadata { readonly provisionedBy?: string; + readonly provisionedByResourceId?: string; } // @public @@ -2147,9 +2323,12 @@ export interface Metric { name: LocalizableString; timeseries: TimeSeriesElement[]; type: string; - unit: MetricUnit; + unit: Unit; } +// @public +export type MetricAggregationType = string; + // @public export interface MetricAlertAction { actionGroupId?: string; @@ -2174,7 +2353,7 @@ export interface MetricAlertMultipleResourceMultipleMetricCriteria extends Metri } // @public -export interface MetricAlertResource extends ResourceAutoGenerated4 { +export interface MetricAlertResource extends ResourceAutoGenerated6 { actions?: MetricAlertAction[]; autoMitigate?: boolean; criteria: MetricAlertCriteriaUnion; @@ -2358,8 +2537,17 @@ export interface MetricDefinitionCollection { // @public export interface MetricDefinitions { list(resourceUri: string, options?: MetricDefinitionsListOptionalParams): PagedAsyncIterableIterator; + listAtSubscriptionScope(region: string, options?: MetricDefinitionsListAtSubscriptionScopeOptionalParams): PagedAsyncIterableIterator; } +// @public +export interface MetricDefinitionsListAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { + metricnamespace?: string; +} + +// @public +export type MetricDefinitionsListAtSubscriptionScopeResponse = SubscriptionScopeMetricDefinitionCollection; + // @public export interface MetricDefinitionsListOptionalParams extends coreClient.OperationOptions { metricnamespace?: string; @@ -2407,6 +2595,9 @@ export interface MetricNamespacesListOptionalParams extends coreClient.Operation // @public export type MetricNamespacesListResponse = MetricNamespaceCollection; +// @public +export type MetricResultType = string; + // @public export interface Metrics { readonly internalId?: string; @@ -2421,15 +2612,58 @@ export interface MetricSettings { timeGrain?: string; } +// @public +export interface MetricsIngestionEndpointSpec { + readonly endpoint?: string; +} + // @public export interface MetricSingleDimension { name: string; value: string; } +// @public +export interface MetricsListAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { + aggregation?: string; + autoAdjustTimegrain?: boolean; + filter?: string; + interval?: string; + metricnames?: string; + metricnamespace?: string; + orderby?: string; + resultType?: MetricResultType; + timespan?: string; + top?: number; + validateDimensions?: boolean; +} + +// @public +export interface MetricsListAtSubscriptionScopePostOptionalParams extends coreClient.OperationOptions { + aggregation?: string; + autoAdjustTimegrain?: boolean; + body?: SubscriptionScopeMetricsRequestBodyParameters; + filter?: string; + interval?: string; + metricnames?: string; + metricnamespace?: string; + orderby?: string; + resultType?: MetricResultType; + timespan?: string; + top?: number; + validateDimensions?: boolean; +} + +// @public +export type MetricsListAtSubscriptionScopePostResponse = SubscriptionScopeMetricResponse; + +// @public +export type MetricsListAtSubscriptionScopeResponse = SubscriptionScopeMetricResponse; + // @public export interface MetricsListOptionalParams extends coreClient.OperationOptions { aggregation?: string; + autoAdjustTimegrain?: boolean; filter?: string; interval?: string; metricnames?: string; @@ -2438,6 +2672,7 @@ export interface MetricsListOptionalParams extends coreClient.OperationOptions { resultType?: ResultType; timespan?: string; top?: number; + validateDimensions?: boolean; } // @public @@ -2446,6 +2681,8 @@ export type MetricsListResponse = Response_2; // @public export interface MetricsOperations { list(resourceUri: string, options?: MetricsListOptionalParams): Promise; + listAtSubscriptionScope(region: string, options?: MetricsListAtSubscriptionScopeOptionalParams): Promise; + listAtSubscriptionScopePost(region: string, options?: MetricsListAtSubscriptionScopePostOptionalParams): Promise; } // @public @@ -2485,6 +2722,7 @@ export class MonitorClient extends coreClient.ServiceClient { // (undocumented) $host: string; constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: MonitorClientOptionalParams); + constructor(credentials: coreAuth.TokenCredential, options?: MonitorClientOptionalParams); // (undocumented) actionGroups: ActionGroups; // (undocumented) @@ -2501,6 +2739,8 @@ export class MonitorClient extends coreClient.ServiceClient { azureMonitorWorkspaces: AzureMonitorWorkspaces; // (undocumented) baselines: Baselines; + beginCreateNotificationsAtTenantActionGroupResourceLevel(managementGroupId: string, tenantActionGroupName: string, xMsClientTenantId: string, notificationRequest: TenantNotificationRequestBody, options?: CreateNotificationsAtTenantActionGroupResourceLevelOptionalParams): Promise, CreateNotificationsAtTenantActionGroupResourceLevelResponse>>; + beginCreateNotificationsAtTenantActionGroupResourceLevelAndWait(managementGroupId: string, tenantActionGroupName: string, xMsClientTenantId: string, notificationRequest: TenantNotificationRequestBody, options?: CreateNotificationsAtTenantActionGroupResourceLevelOptionalParams): Promise; // (undocumented) dataCollectionEndpoints: DataCollectionEndpoints; // (undocumented) @@ -2513,6 +2753,7 @@ export class MonitorClient extends coreClient.ServiceClient { diagnosticSettingsCategory: DiagnosticSettingsCategory; // (undocumented) eventCategories: EventCategories; + getTestNotificationsAtTenantActionGroupResourceLevel(managementGroupId: string, tenantActionGroupName: string, xMsClientTenantId: string, notificationId: string, options?: GetTestNotificationsAtTenantActionGroupResourceLevelOptionalParams): Promise; // (undocumented) logProfiles: LogProfiles; // (undocumented) @@ -2544,22 +2785,36 @@ export class MonitorClient extends coreClient.ServiceClient { // (undocumented) scheduledQueryRules: ScheduledQueryRules; // (undocumented) - subscriptionId: string; + subscriptionId?: string; + // (undocumented) + tenantActionGroups: TenantActionGroups; // (undocumented) tenantActivityLogs: TenantActivityLogs; // (undocumented) vMInsights: VMInsights; } +// @public +export interface MonitorClientCreateNotificationsAtTenantActionGroupResourceLevelHeaders { + location?: string; +} + // @public export interface MonitorClientOptionalParams extends coreClient.ServiceClientOptions { $host?: string; endpoint?: string; } +// @public +export interface MonitoringAccountDestination { + readonly accountId?: string; + accountResourceId?: string; + name?: string; +} + // @public export interface MonitorOperations { - list(options?: MonitorOperationsListOptionalParams): PagedAsyncIterableIterator; + list(options?: MonitorOperationsListOptionalParams): PagedAsyncIterableIterator; } // @public @@ -2567,14 +2822,14 @@ export interface MonitorOperationsListNextOptionalParams extends coreClient.Oper } // @public -export type MonitorOperationsListNextResponse = OperationListResultAutoGenerated; +export type MonitorOperationsListNextResponse = OperationListResult; // @public export interface MonitorOperationsListOptionalParams extends coreClient.OperationOptions { } // @public -export type MonitorOperationsListResponse = OperationListResultAutoGenerated; +export type MonitorOperationsListResponse = OperationListResult; // @public export interface MultiMetricCriteria { @@ -2623,44 +2878,44 @@ export type OnboardingStatus = string; // @public export interface Operation { - display?: OperationDisplay; - name?: string; -} - -// @public -export interface OperationAutoGenerated { readonly actionType?: ActionType; - display?: OperationDisplayAutoGenerated; + display?: OperationDisplay; readonly isDataAction?: boolean; readonly name?: string; readonly origin?: Origin; } // @public -export interface OperationDisplay { - operation?: string; - provider?: string; - resource?: string; +export interface OperationAutoGenerated { + display?: OperationDisplayAutoGenerated; + name?: string; } // @public -export interface OperationDisplayAutoGenerated { +export interface OperationDisplay { readonly description?: string; readonly operation?: string; readonly provider?: string; readonly resource?: string; } +// @public +export interface OperationDisplayAutoGenerated { + operation?: string; + provider?: string; + resource?: string; +} + // @public export interface OperationListResult { - nextLink?: string; - value?: Operation[]; + readonly nextLink?: string; + readonly value?: Operation[]; } // @public export interface OperationListResultAutoGenerated { - readonly nextLink?: string; - readonly value?: OperationAutoGenerated[]; + nextLink?: string; + value?: OperationAutoGenerated[]; } // @public @@ -2673,12 +2928,12 @@ export interface OperationsListOptionalParams extends coreClient.OperationOption } // @public -export type OperationsListResponse = OperationListResult; +export type OperationsListResponse = OperationListResultAutoGenerated; // @public export interface OperationStatus { endTime?: Date; - error?: ErrorDetail; + error?: ErrorDetailAutoGenerated; id?: string; name?: string; startTime?: Date; @@ -2699,6 +2954,12 @@ export interface PerfCounterDataSource { streams?: KnownPerfCounterDataSourceStreams[]; } +// @public +export interface PlatformTelemetryDataSource { + name?: string; + streams: string[]; +} + // @public export interface PredictiveAutoscalePolicy { scaleLookAheadTime?: string; @@ -2741,15 +3002,28 @@ export interface PrivateEndpoint { } // @public -export interface PrivateEndpointConnection extends ResourceAutoGenerated3 { +export interface PrivateEndpointAutoGenerated { + readonly id?: string; +} + +// @public +export interface PrivateEndpointConnection extends Resource { + readonly groupIds?: string[]; privateEndpoint?: PrivateEndpoint; privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; - readonly provisioningState?: PrivateEndpointConnectionProvisioningState; + provisioningState?: PrivateEndpointConnectionProvisioningState; +} + +// @public +export interface PrivateEndpointConnectionAutoGenerated extends ResourceAutoGenerated5 { + privateEndpoint?: PrivateEndpointAutoGenerated; + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; + provisioningState?: PrivateEndpointConnectionProvisioningState; } // @public export interface PrivateEndpointConnectionListResult { - value?: PrivateEndpointConnection[]; + value?: PrivateEndpointConnectionAutoGenerated[]; } // @public @@ -2757,8 +3031,8 @@ export type PrivateEndpointConnectionProvisioningState = string; // @public export interface PrivateEndpointConnections { - beginCreateOrUpdate(resourceGroupName: string, scopeName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams): Promise, PrivateEndpointConnectionsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, scopeName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams): Promise; + beginCreateOrUpdate(resourceGroupName: string, scopeName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnectionAutoGenerated, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams): Promise, PrivateEndpointConnectionsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, scopeName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnectionAutoGenerated, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams): Promise; beginDelete(resourceGroupName: string, scopeName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, scopeName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise; get(resourceGroupName: string, scopeName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; @@ -2772,7 +3046,7 @@ export interface PrivateEndpointConnectionsCreateOrUpdateOptionalParams extends } // @public -export type PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnection; +export type PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnectionAutoGenerated; // @public export interface PrivateEndpointConnectionsDeleteOptionalParams extends coreClient.OperationOptions { @@ -2785,7 +3059,7 @@ export interface PrivateEndpointConnectionsGetOptionalParams extends coreClient. } // @public -export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnectionAutoGenerated; // @public export interface PrivateEndpointConnectionsListByPrivateLinkScopeOptionalParams extends coreClient.OperationOptions { @@ -2798,7 +3072,7 @@ export type PrivateEndpointConnectionsListByPrivateLinkScopeResponse = PrivateEn export type PrivateEndpointServiceConnectionStatus = string; // @public -export interface PrivateLinkResource extends ResourceAutoGenerated3 { +export interface PrivateLinkResource extends ResourceAutoGenerated5 { readonly groupId?: string; readonly requiredMembers?: string[]; requiredZoneNames?: string[]; @@ -2829,6 +3103,12 @@ export interface PrivateLinkResourcesListByPrivateLinkScopeOptionalParams extend // @public export type PrivateLinkResourcesListByPrivateLinkScopeResponse = PrivateLinkResourceListResult; +// @public (undocumented) +export interface PrivateLinkScopedResource { + resourceId?: string; + scopeId?: string; +} + // @public export interface PrivateLinkScopedResources { beginCreateOrUpdate(resourceGroupName: string, scopeName: string, name: string, parameters: ScopedResource, options?: PrivateLinkScopedResourcesCreateOrUpdateOptionalParams): Promise, PrivateLinkScopedResourcesCreateOrUpdateResponse>>; @@ -2960,6 +3240,15 @@ export interface PrivateLinkServiceConnectionState { status?: PrivateEndpointServiceConnectionStatus; } +// @public +export interface PrometheusForwarderDataSource { + labelIncludeFilter?: { + [propertyName: string]: string; + }; + name?: string; + streams?: KnownPrometheusForwarderDataSourceStreams[]; +} + // @public export type ProvisioningState = string; @@ -2971,7 +3260,7 @@ export interface ProxyResource { } // @public -export interface ProxyResourceAutoGenerated extends ResourceAutoGenerated3 { +export interface ProxyResourceAutoGenerated extends ResourceAutoGenerated5 { } // @public @@ -3000,23 +3289,16 @@ export interface RecurrentSchedule { // @public export interface Resource { readonly id?: string; - location: string; readonly name?: string; readonly systemData?: SystemData; - tags?: { - [propertyName: string]: string; - }; readonly type?: string; } // @public export interface ResourceAutoGenerated { readonly id?: string; - location: string; readonly name?: string; - tags?: { - [propertyName: string]: string; - }; + readonly systemData?: SystemData; readonly type?: string; } @@ -3025,6 +3307,7 @@ export interface ResourceAutoGenerated2 { readonly id?: string; location: string; readonly name?: string; + readonly systemData?: SystemData; tags?: { [propertyName: string]: string; }; @@ -3034,7 +3317,11 @@ export interface ResourceAutoGenerated2 { // @public export interface ResourceAutoGenerated3 { readonly id?: string; + location: string; readonly name?: string; + tags?: { + [propertyName: string]: string; + }; readonly type?: string; } @@ -3053,17 +3340,32 @@ export interface ResourceAutoGenerated4 { export interface ResourceAutoGenerated5 { readonly id?: string; readonly name?: string; - readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface ResourceAutoGenerated6 { + readonly id?: string; + location: string; + readonly name?: string; + tags?: { + [propertyName: string]: string; + }; readonly type?: string; } // @public export interface ResourceForUpdate { + identity?: ResourceForUpdateIdentity; tags?: { [propertyName: string]: string; }; } +// @public +export interface ResourceForUpdateIdentity extends ManagedServiceIdentity { +} + // @public interface Response_2 { cost?: number; @@ -3385,11 +3687,93 @@ export interface SmsReceiver { readonly status?: ReceiverStatus; } +// @public +export interface SmsReceiverAutoGenerated { + countryCode: string; + name: string; + phoneNumber: string; + readonly status?: ReceiverStatus; +} + +// @public (undocumented) +export interface StorageBlobDestination { + containerName?: string; + name?: string; + storageAccountResourceId?: string; +} + +// @public (undocumented) +export interface StorageTableDestination { + name?: string; + storageAccountResourceId?: string; + tableName?: string; +} + // @public export interface StreamDeclaration { columns?: ColumnDefinition[]; } +// @public +export interface SubscriptionScopeMetric { + displayDescription?: string; + errorCode?: string; + errorMessage?: string; + id: string; + name: LocalizableString; + timeseries: TimeSeriesElement[]; + type: string; + unit: MetricUnit; +} + +// @public +export interface SubscriptionScopeMetricDefinition { + category?: string; + dimensions?: LocalizableString[]; + displayDescription?: string; + id?: string; + isDimensionRequired?: boolean; + metricAvailabilities?: MetricAvailability[]; + metricClass?: MetricClass; + name?: LocalizableString; + namespace?: string; + primaryAggregationType?: MetricAggregationType; + resourceId?: string; + supportedAggregationTypes?: MetricAggregationType[]; + unit?: MetricUnit; +} + +// @public +export interface SubscriptionScopeMetricDefinitionCollection { + value: SubscriptionScopeMetricDefinition[]; +} + +// @public +export interface SubscriptionScopeMetricResponse { + cost?: number; + interval?: string; + namespace?: string; + resourceregion?: string; + timespan: string; + value: SubscriptionScopeMetric[]; +} + +// @public +export interface SubscriptionScopeMetricsRequestBodyParameters { + aggregation?: string; + autoAdjustTimegrain?: boolean; + filter?: string; + interval?: string; + metricNames?: string; + metricNamespace?: string; + orderBy?: string; + resultType?: MetricResultType; + rollUpBy?: string; + timespan?: string; + top?: number; + validateDimensions?: boolean; +} + // @public export interface SyslogDataSource { facilityNames?: KnownSyslogDataSourceFacilityNames[]; @@ -3415,6 +3799,64 @@ export interface TagsResource { }; } +// @public +export interface TenantActionGroupList { + nextLink?: string; + value?: TenantActionGroupResource[]; +} + +// @public +export interface TenantActionGroupResource extends AzureResource { + azureAppPushReceivers?: AzureAppPushReceiverAutoGenerated[]; + emailReceivers?: EmailReceiverAutoGenerated[]; + enabled?: boolean; + groupShortName?: string; + smsReceivers?: SmsReceiverAutoGenerated[]; + voiceReceivers?: VoiceReceiverAutoGenerated[]; + webhookReceivers?: WebhookReceiverAutoGenerated[]; +} + +// @public +export interface TenantActionGroups { + createOrUpdate(managementGroupId: string, tenantActionGroupName: string, xMsClientTenantId: string, actionGroup: TenantActionGroupResource, options?: TenantActionGroupsCreateOrUpdateOptionalParams): Promise; + delete(managementGroupId: string, tenantActionGroupName: string, xMsClientTenantId: string, options?: TenantActionGroupsDeleteOptionalParams): Promise; + get(managementGroupId: string, tenantActionGroupName: string, xMsClientTenantId: string, options?: TenantActionGroupsGetOptionalParams): Promise; + listByManagementGroupId(managementGroupId: string, xMsClientTenantId: string, options?: TenantActionGroupsListByManagementGroupIdOptionalParams): PagedAsyncIterableIterator; + update(managementGroupId: string, tenantActionGroupName: string, xMsClientTenantId: string, tenantActionGroupPatch: ActionGroupPatchBodyAutoGenerated, options?: TenantActionGroupsUpdateOptionalParams): Promise; +} + +// @public +export interface TenantActionGroupsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TenantActionGroupsCreateOrUpdateResponse = TenantActionGroupResource; + +// @public +export interface TenantActionGroupsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface TenantActionGroupsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TenantActionGroupsGetResponse = TenantActionGroupResource; + +// @public +export interface TenantActionGroupsListByManagementGroupIdOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TenantActionGroupsListByManagementGroupIdResponse = TenantActionGroupList; + +// @public +export interface TenantActionGroupsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TenantActionGroupsUpdateResponse = TenantActionGroupResource; + // @public export interface TenantActivityLogs { list(options?: TenantActivityLogsListOptionalParams): PagedAsyncIterableIterator; @@ -3436,6 +3878,16 @@ export interface TenantActivityLogsListOptionalParams extends coreClient.Operati // @public export type TenantActivityLogsListResponse = EventDataCollection; +// @public +export interface TenantNotificationRequestBody { + alertType: string; + azureAppPushReceivers?: AzureAppPushReceiverAutoGenerated[]; + emailReceivers?: EmailReceiverAutoGenerated[]; + smsReceivers?: SmsReceiverAutoGenerated[]; + voiceReceivers?: VoiceReceiverAutoGenerated[]; + webhookReceivers?: WebhookReceiverAutoGenerated[]; +} + // @public export interface TestNotificationDetailsResponse { actionDetails?: ActionDetail[]; @@ -3445,6 +3897,15 @@ export interface TestNotificationDetailsResponse { state: string; } +// @public +export interface TestNotificationDetailsResponseAutoGenerated { + actionDetails?: ActionDetailAutoGenerated[]; + completedTime?: string; + context?: Context; + createdTime?: string; + state: string; +} + // @public export interface ThresholdRuleCondition extends RuleCondition { odataType: "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition"; @@ -3486,7 +3947,7 @@ export interface TimeWindow { } // @public -export interface TrackedResource extends ResourceAutoGenerated3 { +export interface TrackedResource extends ResourceAutoGenerated { location: string; tags?: { [propertyName: string]: string; @@ -3501,6 +3962,15 @@ export interface TrackedResourceAutoGenerated extends ResourceAutoGenerated5 { }; } +// @public +export type Unit = "Count" | "Bytes" | "Seconds" | "CountPerSecond" | "BytesPerSecond" | "Percent" | "MilliSeconds" | "ByteSeconds" | "Unspecified" | "Cores" | "MilliCores" | "NanoCores" | "BitsPerSecond"; + +// @public +export interface UserAssignedIdentity { + readonly clientId?: string; + readonly principalId?: string; +} + // @public export interface UserIdentityProperties { readonly clientId?: string; @@ -3534,6 +4004,13 @@ export interface VoiceReceiver { phoneNumber: string; } +// @public +export interface VoiceReceiverAutoGenerated { + countryCode: string; + name: string; + phoneNumber: string; +} + // @public export interface WebhookNotification { properties?: { @@ -3553,6 +4030,17 @@ export interface WebhookReceiver { useCommonAlertSchema?: boolean; } +// @public +export interface WebhookReceiverAutoGenerated { + identifierUri?: string; + name: string; + objectId?: string; + serviceUri: string; + tenantId?: string; + useAadAuth?: boolean; + useCommonAlertSchema?: boolean; +} + // @public export interface WebtestLocationAvailabilityCriteria extends MetricAlertCriteria { componentId: string; @@ -3568,6 +4056,12 @@ export interface WindowsEventLogDataSource { xPathQueries?: string[]; } +// @public +export interface WindowsFirewallLogsDataSource { + name?: string; + streams: string[]; +} + // @public export interface WorkspaceInfo { customerId: string; diff --git a/sdk/monitor/arm-monitor/rollup.config.js b/sdk/monitor/arm-monitor/rollup.config.js new file mode 100644 index 000000000000..3f89d7309da5 --- /dev/null +++ b/sdk/monitor/arm-monitor/rollup.config.js @@ -0,0 +1,122 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +// #region Warning Handler + +/** + * A function that can determine whether a rollup warning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEval(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependency(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] + }, + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs(), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false +}; + +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.ts deleted file mode 100644 index f675456f49f4..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.ts +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NotificationRequestBody, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Send test notifications to a set of provided receivers - * - * @summary Send test notifications to a set of provided receivers - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtActionGroupResourceLevel.json - */ -async function createNotificationsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "11111111-1111-1111-1111-111111111111"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestRgName"; - const actionGroupName = "TestAgName"; - const notificationRequest: NotificationRequestBody = { - alertType: "budget", - armRoleReceivers: [ - { - name: "ArmRole-Common", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: true - }, - { - name: "ArmRole-nonCommon", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: false - } - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "http://test.me", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084" - } - ], - azureAppPushReceivers: [ - { name: "Sample azureAppPush", emailAddress: "johndoe@email.com" } - ], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true - } - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true - } - ], - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84" - } - ], - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: - "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c" - } - ], - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false - } - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890" - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321" - } - ], - voiceReceivers: [ - { name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" } - ], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true - }, - { - name: "Sample webhook 2", - identifierUri: - "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true - } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.beginCreateNotificationsAtActionGroupResourceLevelAndWait( - resourceGroupName, - actionGroupName, - notificationRequest - ); - console.log(result); -} - -async function main() { - createNotificationsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateNotificationsAtResourceGroupLevelSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateNotificationsAtResourceGroupLevelSample.ts deleted file mode 100644 index ef9f52b11f34..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateNotificationsAtResourceGroupLevelSample.ts +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NotificationRequestBody, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Send test notifications to a set of provided receivers - * - * @summary Send test notifications to a set of provided receivers - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtResourceGroupLevel.json - */ -async function createNotificationsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-TestNotifications"; - const notificationRequest: NotificationRequestBody = { - alertType: "budget", - armRoleReceivers: [ - { - name: "ArmRole-Common", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: true - }, - { - name: "ArmRole-nonCommon", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: false - } - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "http://test.me", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084" - } - ], - azureAppPushReceivers: [ - { name: "Sample azureAppPush", emailAddress: "johndoe@email.com" } - ], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true - } - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true - } - ], - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84" - } - ], - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: - "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c" - } - ], - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false - } - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890" - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321" - } - ], - voiceReceivers: [ - { name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" } - ], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true - }, - { - name: "Sample webhook 2", - identifierUri: - "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true - } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.beginCreateNotificationsAtResourceGroupLevelAndWait( - resourceGroupName, - notificationRequest - ); - console.log(result); -} - -async function main() { - createNotificationsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateOrUpdateSample.ts deleted file mode 100644 index 0d8f5181c84d..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsCreateOrUpdateSample.ts +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ActionGroupResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a new action group or update an existing one. - * - * @summary Create a new action group or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/createOrUpdateActionGroup.json - */ -async function createOrUpdateAnActionGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const actionGroup: ActionGroupResource = { - armRoleReceivers: [ - { - name: "Sample armRole", - roleId: "8e3af657-a8ff-443c-a75c-2fe8c4bcb635", - useCommonAlertSchema: true - } - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084" - } - ], - azureAppPushReceivers: [ - { name: "Sample azureAppPush", emailAddress: "johndoe@email.com" } - ], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true - } - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true - } - ], - enabled: true, - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84" - } - ], - groupShortName: "sample", - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: - "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c" - } - ], - location: "Global", - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false - } - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890" - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321" - } - ], - tags: {}, - voiceReceivers: [ - { name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" } - ], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true - }, - { - name: "Sample webhook 2", - identifierUri: - "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true - } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.createOrUpdate( - resourceGroupName, - actionGroupName, - actionGroup - ); - console.log(result); -} - -async function main() { - createOrUpdateAnActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsDeleteSample.ts deleted file mode 100644 index 7b955a5715d2..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete an action group. - * - * @summary Delete an action group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/deleteActionGroup.json - */ -async function deleteAnActionGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.delete( - resourceGroupName, - actionGroupName - ); - console.log(result); -} - -async function main() { - deleteAnActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsEnableReceiverSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsEnableReceiverSample.ts deleted file mode 100644 index cff901ba8be7..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsEnableReceiverSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { EnableRequest, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation is only supported for Email or SMS receivers. - * - * @summary Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation is only supported for Email or SMS receivers. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/enableReceiver.json - */ -async function enableTheReceiver() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const enableRequest: EnableRequest = { receiverName: "John Doe's mobile" }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.enableReceiver( - resourceGroupName, - actionGroupName, - enableRequest - ); - console.log(result); -} - -async function main() { - enableTheReceiver(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetSample.ts deleted file mode 100644 index 39fe3b9fca0a..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get an action group. - * - * @summary Get an action group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getActionGroup.json - */ -async function getAnActionGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.get( - resourceGroupName, - actionGroupName - ); - console.log(result); -} - -async function main() { - getAnActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.ts deleted file mode 100644 index cf60c919b027..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the test notifications by the notification id - * - * @summary Get the test notifications by the notification id - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtActionGroupResourceLevel.json - */ -async function getNotificationDetailsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "11111111-1111-1111-1111-111111111111"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestRgName"; - const actionGroupName = "TestAgName"; - const notificationId = "11000222191287"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.getTestNotificationsAtActionGroupResourceLevel( - resourceGroupName, - actionGroupName, - notificationId - ); - console.log(result); -} - -async function main() { - getNotificationDetailsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.ts deleted file mode 100644 index 2d98821e1de7..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the test notifications by the notification id - * - * @summary Get the test notifications by the notification id - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtResourceGroupLevel.json - */ -async function getNotificationDetailsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-TestNotifications"; - const notificationId = "11000222191287"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.getTestNotificationsAtResourceGroupLevel( - resourceGroupName, - notificationId - ); - console.log(result); -} - -async function main() { - getNotificationDetailsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsSample.ts deleted file mode 100644 index 25cd9a72018c..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsGetTestNotificationsSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the test notifications by the notification id - * - * @summary Get the test notifications by the notification id - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotifications.json - */ -async function getNotificationDetailsAtSubscriptionLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const notificationId = "11000222191287"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.getTestNotifications(notificationId); - console.log(result); -} - -async function main() { - getNotificationDetailsAtSubscriptionLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsListByResourceGroupSample.ts deleted file mode 100644 index 505dc900d581..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a list of all action groups in a resource group. - * - * @summary Get a list of all action groups in a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json - */ -async function listActionGroupsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.actionGroups.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listActionGroupsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsListBySubscriptionIdSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsListBySubscriptionIdSample.ts deleted file mode 100644 index 1b40a18b9ef0..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsListBySubscriptionIdSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a list of all action groups in a subscription. - * - * @summary Get a list of all action groups in a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json - */ -async function listActionGroupsAtSubscriptionLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.actionGroups.listBySubscriptionId()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listActionGroupsAtSubscriptionLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsPostTestNotificationsSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsPostTestNotificationsSample.ts deleted file mode 100644 index 153ade7de654..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsPostTestNotificationsSample.ts +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NotificationRequestBody, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Send test notifications to a set of provided receivers - * - * @summary Send test notifications to a set of provided receivers - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotifications.json - */ -async function createNotificationsAtSubscriptionLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const notificationRequest: NotificationRequestBody = { - alertType: "budget", - armRoleReceivers: [ - { - name: "ArmRole-Common", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: true - }, - { - name: "ArmRole-nonCommon", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: false - } - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "http://test.me", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084" - } - ], - azureAppPushReceivers: [ - { name: "Sample azureAppPush", emailAddress: "johndoe@email.com" } - ], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true - } - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true - } - ], - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84" - } - ], - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: - "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c" - } - ], - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false - } - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890" - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321" - } - ], - voiceReceivers: [ - { name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" } - ], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true - }, - { - name: "Sample webhook 2", - identifierUri: - "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true - } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.beginPostTestNotificationsAndWait( - notificationRequest - ); - console.log(result); -} - -async function main() { - createNotificationsAtSubscriptionLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/actionGroupsUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/actionGroupsUpdateSample.ts deleted file mode 100644 index 80b2b49eabac..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/actionGroupsUpdateSample.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ActionGroupPatchBody, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/patchActionGroup.json - */ -async function patchAnActionGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const actionGroupPatch: ActionGroupPatchBody = { - enabled: false, - tags: { key1: "value1", key2: "value2" } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.update( - resourceGroupName, - actionGroupName, - actionGroupPatch - ); - console.log(result); -} - -async function main() { - patchAnActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsCreateOrUpdateSample.ts deleted file mode 100644 index b3c9a4e2f415..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsCreateOrUpdateSample.ts +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ActivityLogAlertResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a new Activity Log Alert rule or update an existing one. - * - * @summary Create a new Activity Log Alert rule or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_CreateOrUpdate.json - */ -async function createOrUpdateAnActivityLogAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRule"; - const activityLogAlertRule: ActivityLogAlertResource = { - description: "Description of sample Activity Log Alert rule.", - actions: { - actionGroups: [ - { - actionGroupId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup", - webhookProperties: { sampleWebhookProperty: "SamplePropertyValue" } - } - ] - }, - condition: { - allOf: [ - { equals: "Administrative", field: "category" }, - { equals: "Error", field: "level" } - ] - }, - enabled: true, - location: "Global", - scopes: ["/subscriptions/187f412d-1758-44d9-b052-169e2564721d"], - tags: {} - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.createOrUpdate( - resourceGroupName, - activityLogAlertName, - activityLogAlertRule - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a new Activity Log Alert rule or update an existing one. - * - * @summary Create a new Activity Log Alert rule or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_CreateOrUpdateRuleWithAnyOfCondition.json - */ -async function createOrUpdateAnActivityLogAlertRuleWithAnyOfCondition() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRuleWithAnyOfCondition"; - const activityLogAlertRule: ActivityLogAlertResource = { - description: - "Description of sample Activity Log Alert rule with 'anyOf' condition.", - actions: { - actionGroups: [ - { - actionGroupId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup", - webhookProperties: { sampleWebhookProperty: "SamplePropertyValue" } - } - ] - }, - condition: { - allOf: [ - { equals: "ServiceHealth", field: "category" }, - { - anyOf: [ - { equals: "Incident", field: "properties.incidentType" }, - { equals: "Maintenance", field: "properties.incidentType" } - ] - } - ] - }, - enabled: true, - location: "Global", - scopes: ["subscriptions/187f412d-1758-44d9-b052-169e2564721d"], - tags: {} - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.createOrUpdate( - resourceGroupName, - activityLogAlertName, - activityLogAlertRule - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a new Activity Log Alert rule or update an existing one. - * - * @summary Create a new Activity Log Alert rule or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_CreateOrUpdateRuleWithContainsAny.json - */ -async function createOrUpdateAnActivityLogAlertRuleWithContainsAny() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRuleWithContainsAny"; - const activityLogAlertRule: ActivityLogAlertResource = { - description: - "Description of sample Activity Log Alert rule with 'containsAny'.", - actions: { - actionGroups: [ - { - actionGroupId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup", - webhookProperties: { sampleWebhookProperty: "SamplePropertyValue" } - } - ] - }, - condition: { - allOf: [ - { equals: "ServiceHealth", field: "category" }, - { - containsAny: ["North Europe", "West Europe"], - field: "properties.impactedServices[*].ImpactedRegions[*].RegionName" - } - ] - }, - enabled: true, - location: "Global", - scopes: ["subscriptions/187f412d-1758-44d9-b052-169e2564721d"], - tags: {} - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.createOrUpdate( - resourceGroupName, - activityLogAlertName, - activityLogAlertRule - ); - console.log(result); -} - -async function main() { - createOrUpdateAnActivityLogAlertRule(); - createOrUpdateAnActivityLogAlertRuleWithAnyOfCondition(); - createOrUpdateAnActivityLogAlertRuleWithContainsAny(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsDeleteSample.ts deleted file mode 100644 index 15271385aee4..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete an Activity Log Alert rule. - * - * @summary Delete an Activity Log Alert rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Delete.json - */ -async function deleteAnActivityLogAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.delete( - resourceGroupName, - activityLogAlertName - ); - console.log(result); -} - -async function main() { - deleteAnActivityLogAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsGetSample.ts deleted file mode 100644 index 9e1909525bc2..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get an Activity Log Alert rule. - * - * @summary Get an Activity Log Alert rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Get.json - */ -async function getAnActivityLogAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.get( - resourceGroupName, - activityLogAlertName - ); - console.log(result); -} - -async function main() { - getAnActivityLogAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsListByResourceGroupSample.ts deleted file mode 100644 index a198638e54b2..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a list of all Activity Log Alert rules in a resource group. - * - * @summary Get a list of all Activity Log Alert rules in a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_ListByResourceGroupName.json - */ -async function listActivityLogAlerts() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.activityLogAlerts.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listActivityLogAlerts(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsListBySubscriptionIdSample.ts b/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsListBySubscriptionIdSample.ts deleted file mode 100644 index 173f96e013a3..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsListBySubscriptionIdSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a list of all Activity Log Alert rules in a subscription. - * - * @summary Get a list of all Activity Log Alert rules in a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_ListBySubscriptionId.json - */ -async function getListOfAllActivityLogAlertRulesUnderASubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.activityLogAlerts.listBySubscriptionId()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getListOfAllActivityLogAlertRulesUnderASubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsUpdateSample.ts deleted file mode 100644 index 54bd68fc2c84..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/activityLogAlertsUpdateSample.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AlertRulePatchObject, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. - * - * @summary Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Update.json - */ -async function patchAnActivityLogAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRule"; - const activityLogAlertRulePatch: AlertRulePatchObject = { - enabled: false, - tags: { key1: "value1", key2: "value2" } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.update( - resourceGroupName, - activityLogAlertName, - activityLogAlertRulePatch - ); - console.log(result); -} - -async function main() { - patchAnActivityLogAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/activityLogsListSample.ts b/sdk/monitor/arm-monitor/samples-dev/activityLogsListSample.ts deleted file mode 100644 index d58594916b8c..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/activityLogsListSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ActivityLogsListOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Provides the list of records from the activity logs. - * - * @summary Provides the list of records from the activity logs. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetActivityLogsFiltered.json - */ -async function getActivityLogsWithFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "089bd33f-d4ec-47fe-8ba5-0753aa5c5b33"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.activityLogs.list(filter)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Provides the list of records from the activity logs. - * - * @summary Provides the list of records from the activity logs. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetActivityLogsFilteredAndSelected.json - */ -async function getActivityLogsWithFilterAndSelect() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "089bd33f-d4ec-47fe-8ba5-0753aa5c5b33"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const select = - "eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level"; - const options: ActivityLogsListOptionalParams = { select }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.activityLogs.list(filter, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getActivityLogsWithFilter(); - getActivityLogsWithFilterAndSelect(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/alertRuleIncidentsGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/alertRuleIncidentsGetSample.ts deleted file mode 100644 index fb92424c0220..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRuleIncidentsGetSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets an incident associated to an alert rule - * - * @summary Gets an incident associated to an alert rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getAlertRuleIncident.json - */ -async function getASingleAlertRuleIncident() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "myRuleName"; - const incidentName = "Website_started"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRuleIncidents.get( - resourceGroupName, - ruleName, - incidentName - ); - console.log(result); -} - -async function main() { - getASingleAlertRuleIncident(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/alertRuleIncidentsListByAlertRuleSample.ts b/sdk/monitor/arm-monitor/samples-dev/alertRuleIncidentsListByAlertRuleSample.ts deleted file mode 100644 index 0dc8d87947d2..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRuleIncidentsListByAlertRuleSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a list of incidents associated to an alert rule - * - * @summary Gets a list of incidents associated to an alert rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRuleIncidents.json - */ -async function listAlertRuleIncidents() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "myRuleName"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.alertRuleIncidents.listByAlertRule( - resourceGroupName, - ruleName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAlertRuleIncidents(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/alertRulesCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/alertRulesCreateOrUpdateSample.ts deleted file mode 100644 index dfe78856925c..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRulesCreateOrUpdateSample.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AlertRuleResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates a classic metric alert rule. - * - * @summary Creates or updates a classic metric alert rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/createOrUpdateAlertRule.json - */ -async function createOrUpdateAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "chiricutin"; - const parameters: AlertRuleResource = { - namePropertiesName: "chiricutin", - description: "Pura Vida", - actions: [], - condition: { - dataSource: { - metricName: "Requests", - odataType: - "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource", - resourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest" - }, - odataType: - "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition", - operator: "GreaterThan", - threshold: 3, - timeAggregation: "Total", - windowSize: "PT5M" - }, - isEnabled: true, - location: "West US", - tags: {} - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/alertRulesDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/alertRulesDeleteSample.ts deleted file mode 100644 index 6bd0b7f8913b..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRulesDeleteSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a classic metric alert rule - * - * @summary Deletes a classic metric alert rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteAlertRule.json - */ -async function deleteAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRules.delete(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - deleteAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/alertRulesGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/alertRulesGetSample.ts deleted file mode 100644 index 1eed90dfd819..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRulesGetSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a classic metric alert rule - * - * @summary Gets a classic metric alert rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getAlertRule.json - */ -async function getAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRules.get(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - getAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/alertRulesListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples-dev/alertRulesListByResourceGroupSample.ts deleted file mode 100644 index 3b5450f105b0..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRulesListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the classic metric alert rules within a resource group. - * - * @summary List the classic metric alert rules within a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRule.json - */ -async function listAlertRules() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.alertRules.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAlertRules(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/alertRulesListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples-dev/alertRulesListBySubscriptionSample.ts deleted file mode 100644 index 04a8b5846cd7..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRulesListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the classic metric alert rules within a subscription. - * - * @summary List the classic metric alert rules within a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRuleBySubscription.json - */ -async function listAlertRules() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.alertRules.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAlertRules(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/alertRulesUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/alertRulesUpdateSample.ts deleted file mode 100644 index 5096a58eb37f..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/alertRulesUpdateSample.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AlertRuleResourcePatch, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/patchAlertRule.json - */ -async function patchAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "chiricutin"; - const alertRulesResource: AlertRuleResourcePatch = { - name: "chiricutin", - description: "Pura Vida", - actions: [], - condition: { - dataSource: { - metricName: "Requests", - odataType: - "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource", - resourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest" - }, - odataType: - "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition", - operator: "GreaterThan", - threshold: 3, - timeAggregation: "Total", - windowSize: "PT5M" - }, - isEnabled: true, - tags: { - $type: - "Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary" - } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRules.update( - resourceGroupName, - ruleName, - alertRulesResource - ); - console.log(result); -} - -async function main() { - patchAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsCreateOrUpdateSample.ts deleted file mode 100644 index 9c9021581f86..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsCreateOrUpdateSample.ts +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AutoscaleSettingResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates an autoscale setting. - * - * @summary Creates or updates an autoscale setting. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/createOrUpdateAutoscaleSetting.json - */ -async function createOrUpdateAnAutoscaleSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const autoscaleSettingName = "MySetting"; - const parameters: AutoscaleSettingResource = { - enabled: true, - location: "West US", - notifications: [ - { - email: { - customEmails: ["gu@ms.com", "ge@ns.net"], - sendToSubscriptionAdministrator: true, - sendToSubscriptionCoAdministrators: true - }, - operation: "Scale", - webhooks: [{ properties: {}, serviceUri: "http://myservice.com" }] - } - ], - predictiveAutoscalePolicy: { scaleMode: "Enabled" }, - profiles: [ - { - name: "adios", - capacity: { default: "1", maximum: "10", minimum: "1" }, - fixedDate: { - end: new Date("2015-03-05T14:30:00Z"), - start: new Date("2015-03-05T14:00:00Z"), - timeZone: "UTC" - }, - rules: [ - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 10, - timeAggregation: "Average", - timeGrain: "PT1M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT5M", - direction: "Increase", - value: "1" - } - }, - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 15, - timeAggregation: "Average", - timeGrain: "PT2M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT6M", - direction: "Decrease", - value: "2" - } - } - ] - }, - { - name: "saludos", - capacity: { default: "1", maximum: "10", minimum: "1" }, - recurrence: { - frequency: "Week", - schedule: { days: ["1"], hours: [5], minutes: [15], timeZone: "UTC" } - }, - rules: [ - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 10, - timeAggregation: "Average", - timeGrain: "PT1M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT5M", - direction: "Increase", - value: "1" - } - }, - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 15, - timeAggregation: "Average", - timeGrain: "PT2M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT6M", - direction: "Decrease", - value: "2" - } - } - ] - } - ], - tags: { key1: "value1", key2: "value2" }, - targetResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.autoscaleSettings.createOrUpdate( - resourceGroupName, - autoscaleSettingName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateAnAutoscaleSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsDeleteSample.ts deleted file mode 100644 index d40921fc31be..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes and autoscale setting - * - * @summary Deletes and autoscale setting - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/deleteAutoscaleSetting.json - */ -async function deleteAnAutoscaleSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const autoscaleSettingName = "MySetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.autoscaleSettings.delete( - resourceGroupName, - autoscaleSettingName - ); - console.log(result); -} - -async function main() { - deleteAnAutoscaleSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsGetSample.ts deleted file mode 100644 index 8d41ae5c506b..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets an autoscale setting - * - * @summary Gets an autoscale setting - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/getAutoscaleSetting.json - */ -async function getAnAutoscaleSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const autoscaleSettingName = "MySetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.autoscaleSettings.get( - resourceGroupName, - autoscaleSettingName - ); - console.log(result); -} - -async function main() { - getAnAutoscaleSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsListByResourceGroupSample.ts deleted file mode 100644 index 27a63fcea6f6..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the autoscale settings for a resource group - * - * @summary Lists the autoscale settings for a resource group - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/listAutoscaleSetting.json - */ -async function listAutoscaleSettings() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.autoscaleSettings.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAutoscaleSettings(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsListBySubscriptionSample.ts deleted file mode 100644 index 726e2114046d..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the autoscale settings for a subscription - * - * @summary Lists the autoscale settings for a subscription - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/listAutoscaleSettingBySubscription.json - */ -async function listAutoscaleSettingsBySubs() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.autoscaleSettings.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAutoscaleSettingsBySubs(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsUpdateSample.ts deleted file mode 100644 index 5b30e31e28df..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/autoscaleSettingsUpdateSample.ts +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AutoscaleSettingResourcePatch, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/patchAutoscaleSetting.json - */ -async function patchAnAutoscaleSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const autoscaleSettingName = "MySetting"; - const autoscaleSettingResource: AutoscaleSettingResourcePatch = { - enabled: true, - notifications: [ - { - email: { - customEmails: ["gu@ms.com", "ge@ns.net"], - sendToSubscriptionAdministrator: true, - sendToSubscriptionCoAdministrators: true - }, - operation: "Scale", - webhooks: [{ properties: {}, serviceUri: "http://myservice.com" }] - } - ], - predictiveAutoscalePolicy: { scaleMode: "Enabled" }, - profiles: [ - { - name: "adios", - capacity: { default: "1", maximum: "10", minimum: "1" }, - fixedDate: { - end: new Date("2015-03-05T14:30:00Z"), - start: new Date("2015-03-05T14:00:00Z"), - timeZone: "UTC" - }, - rules: [ - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 10, - timeAggregation: "Average", - timeGrain: "PT1M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT5M", - direction: "Increase", - value: "1" - } - }, - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 15, - timeAggregation: "Average", - timeGrain: "PT2M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT6M", - direction: "Decrease", - value: "2" - } - } - ] - }, - { - name: "saludos", - capacity: { default: "1", maximum: "10", minimum: "1" }, - recurrence: { - frequency: "Week", - schedule: { days: ["1"], hours: [5], minutes: [15], timeZone: "UTC" } - }, - rules: [ - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 10, - timeAggregation: "Average", - timeGrain: "PT1M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT5M", - direction: "Increase", - value: "1" - } - }, - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 15, - timeAggregation: "Average", - timeGrain: "PT2M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT6M", - direction: "Decrease", - value: "2" - } - } - ] - } - ], - tags: { key1: "value1" }, - targetResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.autoscaleSettings.update( - resourceGroupName, - autoscaleSettingName, - autoscaleSettingResource - ); - console.log(result); -} - -async function main() { - patchAnAutoscaleSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesCreateSample.ts b/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesCreateSample.ts deleted file mode 100644 index cd950812a39c..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesCreateSample.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AzureMonitorWorkspaceResource, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create or update a workspace - * - * @summary Create or update a workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesCreate.json - */ -async function createOrUpdateWorkspace() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const azureMonitorWorkspaceName = "myAzureMonitorWorkspace"; - const azureMonitorWorkspaceProperties: AzureMonitorWorkspaceResource = { - location: "eastus" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.azureMonitorWorkspaces.create( - resourceGroupName, - azureMonitorWorkspaceName, - azureMonitorWorkspaceProperties - ); - console.log(result); -} - -async function main() { - createOrUpdateWorkspace(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesDeleteSample.ts deleted file mode 100644 index 540b8c1a8c3e..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a workspace - * - * @summary Delete a workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesDelete.json - */ -async function deleteWorkspace() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const azureMonitorWorkspaceName = "myAzureMonitorWorkspace"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.azureMonitorWorkspaces.delete( - resourceGroupName, - azureMonitorWorkspaceName - ); - console.log(result); -} - -async function main() { - deleteWorkspace(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesGetSample.ts deleted file mode 100644 index 9d42224702c5..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns the specific Azure Monitor workspace - * - * @summary Returns the specific Azure Monitor workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesGet.json - */ -async function getWorkspace() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const azureMonitorWorkspaceName = "myAzureMonitorWorkspace"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.azureMonitorWorkspaces.get( - resourceGroupName, - azureMonitorWorkspaceName - ); - console.log(result); -} - -async function main() { - getWorkspace(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesListByResourceGroupSample.ts deleted file mode 100644 index d33e9e1033e5..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all workspaces in the specified resource group - * - * @summary Lists all workspaces in the specified resource group - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesListByResourceGroup.json - */ -async function listMonitorWorkspacesByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.azureMonitorWorkspaces.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listMonitorWorkspacesByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesListBySubscriptionSample.ts deleted file mode 100644 index 67073eac8ea5..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all workspaces in the specified subscription - * - * @summary Lists all workspaces in the specified subscription - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesListBySubscription.json - */ -async function listWorkspacesBySubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.azureMonitorWorkspaces.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listWorkspacesBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesUpdateSample.ts deleted file mode 100644 index 16f3bf41e057..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/azureMonitorWorkspacesUpdateSample.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AzureMonitorWorkspaceResourceForUpdate, - AzureMonitorWorkspacesUpdateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates part of a workspace - * - * @summary Updates part of a workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesUpdate.json - */ -async function updateWorkspace() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const azureMonitorWorkspaceName = "myAzureMonitorWorkspace"; - const azureMonitorWorkspaceProperties: AzureMonitorWorkspaceResourceForUpdate = { - tags: { tag1: "A", tag2: "B", tag3: "C" } - }; - const options: AzureMonitorWorkspacesUpdateOptionalParams = { - azureMonitorWorkspaceProperties - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.azureMonitorWorkspaces.update( - resourceGroupName, - azureMonitorWorkspaceName, - options - ); - console.log(result); -} - -async function main() { - updateWorkspace(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/baselinesListSample.ts b/sdk/monitor/arm-monitor/samples-dev/baselinesListSample.ts deleted file mode 100644 index 14eb069dd324..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/baselinesListSample.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BaselinesListOptionalParams, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to **Lists the metric baseline values for a resource**. - * - * @summary **Lists the metric baseline values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2019-03-01/examples/metricBaselines.json - */ -async function getMetricBaselines() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1"; - const timespan = "2019-03-12T11:00:00.000Z/2019-03-12T12:00:00.000Z"; - const interval = "PT1H"; - const aggregation = "average"; - const sensitivities = "Low,Medium"; - const options: BaselinesListOptionalParams = { - timespan, - interval, - aggregation, - sensitivities - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.baselines.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getMetricBaselines(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsCreateSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsCreateSample.ts deleted file mode 100644 index 519b967cab5f..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsCreateSample.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DataCollectionEndpointResource, - DataCollectionEndpointsCreateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates a data collection endpoint. - * - * @summary Creates or updates a data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsCreate.json - */ -async function createOrUpdateDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myCollectionEndpoint"; - const body: DataCollectionEndpointResource = { - location: "eastus", - networkAcls: { publicNetworkAccess: "Enabled" } - }; - const options: DataCollectionEndpointsCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionEndpoints.create( - resourceGroupName, - dataCollectionEndpointName, - options - ); - console.log(result); -} - -async function main() { - createOrUpdateDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsDeleteSample.ts deleted file mode 100644 index 7a0edbdcc6fb..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a data collection endpoint. - * - * @summary Deletes a data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsDelete.json - */ -async function deleteDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myCollectionEndpoint"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionEndpoints.delete( - resourceGroupName, - dataCollectionEndpointName - ); - console.log(result); -} - -async function main() { - deleteDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsGetSample.ts deleted file mode 100644 index 8b65d70d4b9f..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns the specified data collection endpoint. - * - * @summary Returns the specified data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsGet.json - */ -async function getDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myCollectionEndpoint"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionEndpoints.get( - resourceGroupName, - dataCollectionEndpointName - ); - console.log(result); -} - -async function main() { - getDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsListByResourceGroupSample.ts deleted file mode 100644 index 733401f8e149..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all data collection endpoints in the specified resource group. - * - * @summary Lists all data collection endpoints in the specified resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListByResourceGroup.json - */ -async function listDataCollectionEndpointsByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionEndpoints.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDataCollectionEndpointsByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsListBySubscriptionSample.ts deleted file mode 100644 index f9a0d214965b..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all data collection endpoints in the specified subscription - * - * @summary Lists all data collection endpoints in the specified subscription - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListBySubscription.json - */ -async function listDataCollectionEndpointsBySubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionEndpoints.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDataCollectionEndpointsBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsUpdateSample.ts deleted file mode 100644 index b0b5564c3a59..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionEndpointsUpdateSample.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ResourceForUpdate, - DataCollectionEndpointsUpdateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates part of a data collection endpoint. - * - * @summary Updates part of a data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsUpdate.json - */ -async function updateDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myCollectionEndpoint"; - const body: ResourceForUpdate = { tags: { tag1: "A", tag2: "B", tag3: "C" } }; - const options: DataCollectionEndpointsUpdateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionEndpoints.update( - resourceGroupName, - dataCollectionEndpointName, - options - ); - console.log(result); -} - -async function main() { - updateDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsCreateSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsCreateSample.ts deleted file mode 100644 index 758df428def8..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsCreateSample.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DataCollectionRuleAssociationProxyOnlyResource, - DataCollectionRuleAssociationsCreateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates an association. - * - * @summary Creates or updates an association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsCreate.json - */ -async function createOrUpdateAssociation() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const associationName = "myAssociation"; - const body: DataCollectionRuleAssociationProxyOnlyResource = { - dataCollectionRuleId: - "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule" - }; - const options: DataCollectionRuleAssociationsCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRuleAssociations.create( - resourceUri, - associationName, - options - ); - console.log(result); -} - -async function main() { - createOrUpdateAssociation(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsDeleteSample.ts deleted file mode 100644 index 1034e30e337a..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes an association. - * - * @summary Deletes an association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsDelete.json - */ -async function deleteAssociation() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const associationName = "myAssociation"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRuleAssociations.delete( - resourceUri, - associationName - ); - console.log(result); -} - -async function main() { - deleteAssociation(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsGetSample.ts deleted file mode 100644 index 35540040a92e..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns the specified association. - * - * @summary Returns the specified association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsGet.json - */ -async function getAssociation() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const associationName = "myAssociation"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRuleAssociations.get( - resourceUri, - associationName - ); - console.log(result); -} - -async function main() { - getAssociation(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.ts deleted file mode 100644 index 6d97bace404b..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists associations for the specified data collection endpoint. - * - * @summary Lists associations for the specified data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByDataCollectionEndpoint.json - */ -async function listAssociationsForSpecifiedDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myDataCollectionEndpointName"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRuleAssociations.listByDataCollectionEndpoint( - resourceGroupName, - dataCollectionEndpointName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAssociationsForSpecifiedDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsListByResourceSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsListByResourceSample.ts deleted file mode 100644 index 11ffcd21d8f5..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsListByResourceSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists associations for the specified resource. - * - * @summary Lists associations for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByResource.json - */ -async function listAssociationsForSpecifiedResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRuleAssociations.listByResource( - resourceUri - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAssociationsForSpecifiedResource(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsListByRuleSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsListByRuleSample.ts deleted file mode 100644 index 6cccd9d83a75..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRuleAssociationsListByRuleSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists associations for the specified data collection rule. - * - * @summary Lists associations for the specified data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByRule.json - */ -async function listAssociationsForSpecifiedDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRuleAssociations.listByRule( - resourceGroupName, - dataCollectionRuleName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAssociationsForSpecifiedDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesCreateSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesCreateSample.ts deleted file mode 100644 index db801c866f14..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesCreateSample.ts +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DataCollectionRuleResource, - DataCollectionRulesCreateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates a data collection rule. - * - * @summary Creates or updates a data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesCreate.json - */ -async function createOrUpdateDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const body: DataCollectionRuleResource = { - dataFlows: [ - { - destinations: ["centralWorkspace"], - streams: [ - "Microsoft-Perf", - "Microsoft-Syslog", - "Microsoft-WindowsEvent" - ] - } - ], - dataSources: { - performanceCounters: [ - { - name: "cloudTeamCoreCounters", - counterSpecifiers: [ - "\\Processor(_Total)\\% Processor Time", - "\\Memory\\Committed Bytes", - "\\LogicalDisk(_Total)\\Free Megabytes", - "\\PhysicalDisk(_Total)\\Avg. Disk Queue Length" - ], - samplingFrequencyInSeconds: 15, - streams: ["Microsoft-Perf"] - }, - { - name: "appTeamExtraCounters", - counterSpecifiers: ["\\Process(_Total)\\Thread Count"], - samplingFrequencyInSeconds: 30, - streams: ["Microsoft-Perf"] - } - ], - syslog: [ - { - name: "cronSyslog", - facilityNames: ["cron"], - logLevels: ["Debug", "Critical", "Emergency"], - streams: ["Microsoft-Syslog"] - }, - { - name: "syslogBase", - facilityNames: ["syslog"], - logLevels: ["Alert", "Critical", "Emergency"], - streams: ["Microsoft-Syslog"] - } - ], - windowsEventLogs: [ - { - name: "cloudSecurityTeamEvents", - streams: ["Microsoft-WindowsEvent"], - xPathQueries: ["Security!"] - }, - { - name: "appTeam1AppEvents", - streams: ["Microsoft-WindowsEvent"], - xPathQueries: [ - "System![System[(Level = 1 or Level = 2 or Level = 3)]]", - "Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]" - ] - } - ] - }, - destinations: { - logAnalytics: [ - { - name: "centralWorkspace", - workspaceResourceId: - "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/centralTeamWorkspace" - } - ] - }, - location: "eastus" - }; - const options: DataCollectionRulesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRules.create( - resourceGroupName, - dataCollectionRuleName, - options - ); - console.log(result); -} - -async function main() { - createOrUpdateDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesDeleteSample.ts deleted file mode 100644 index 4becc7faf8c8..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a data collection rule. - * - * @summary Deletes a data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesDelete.json - */ -async function deleteDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRules.delete( - resourceGroupName, - dataCollectionRuleName - ); - console.log(result); -} - -async function main() { - deleteDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesGetSample.ts deleted file mode 100644 index 833b20532bdb..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns the specified data collection rule. - * - * @summary Returns the specified data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesGet.json - */ -async function getDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRules.get( - resourceGroupName, - dataCollectionRuleName - ); - console.log(result); -} - -async function main() { - getDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesListByResourceGroupSample.ts deleted file mode 100644 index 3a5ad5f3084a..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all data collection rules in the specified resource group. - * - * @summary Lists all data collection rules in the specified resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListByResourceGroup.json - */ -async function listDataCollectionRulesByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRules.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDataCollectionRulesByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesListBySubscriptionSample.ts deleted file mode 100644 index 509f9ffdb351..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all data collection rules in the specified subscription. - * - * @summary Lists all data collection rules in the specified subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListBySubscription.json - */ -async function listDataCollectionRulesBySubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRules.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDataCollectionRulesBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesUpdateSample.ts deleted file mode 100644 index 3cedeb4a88a2..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/dataCollectionRulesUpdateSample.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ResourceForUpdate, - DataCollectionRulesUpdateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates part of a data collection rule. - * - * @summary Updates part of a data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesUpdate.json - */ -async function updateDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const body: ResourceForUpdate = { tags: { tag1: "A", tag2: "B", tag3: "C" } }; - const options: DataCollectionRulesUpdateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRules.update( - resourceGroupName, - dataCollectionRuleName, - options - ); - console.log(result); -} - -async function main() { - updateDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCategoryGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCategoryGetSample.ts deleted file mode 100644 index 769917b066a8..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCategoryGetSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the diagnostic settings category for the specified resource. - * - * @summary Gets the diagnostic settings category for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingsCategory.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "WorkflowRuntime"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettingsCategory.get(resourceUri, name); - console.log(result); -} - -async function main() { - getsTheDiagnosticSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCategoryListSample.ts b/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCategoryListSample.ts deleted file mode 100644 index a7d2472c1194..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCategoryListSample.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the diagnostic settings categories for the specified resource. - * - * @summary Lists the diagnostic settings categories for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettingsCategories.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.diagnosticSettingsCategory.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getsTheDiagnosticSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCreateOrUpdateSample.ts deleted file mode 100644 index 31843adcbddf..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsCreateOrUpdateSample.ts +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { DiagnosticSettingsResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates diagnostic settings for the specified resource. - * - * @summary Creates or updates diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateDiagnosticSetting.json - */ -async function createsOrUpdatesTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const parameters: DiagnosticSettingsResource = { - eventHubAuthorizationRuleId: - "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule", - eventHubName: "myeventhub", - logAnalyticsDestinationType: "Dedicated", - logs: [ - { - categoryGroup: "allLogs", - enabled: true, - retentionPolicy: { days: 0, enabled: false } - } - ], - marketplacePartnerId: - "/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1", - metrics: [ - { - category: "WorkflowMetrics", - enabled: true, - retentionPolicy: { days: 0, enabled: false } - } - ], - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1", - workspaceId: "" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.createOrUpdate( - resourceUri, - name, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates diagnostic settings for the specified resource. - * - * @summary Creates or updates diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateDiagnosticSettingCategory.json - */ -async function createsOrUpdatesTheDiagnosticSettingForCategory() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const parameters: DiagnosticSettingsResource = { - eventHubAuthorizationRuleId: - "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule", - eventHubName: "myeventhub", - logAnalyticsDestinationType: "Dedicated", - logs: [ - { - category: "WorkflowRuntime", - enabled: true, - retentionPolicy: { days: 0, enabled: false } - } - ], - marketplacePartnerId: - "/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1", - metrics: [ - { - category: "WorkflowMetrics", - enabled: true, - retentionPolicy: { days: 0, enabled: false } - } - ], - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1", - workspaceId: "" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.createOrUpdate( - resourceUri, - name, - parameters - ); - console.log(result); -} - -async function main() { - createsOrUpdatesTheDiagnosticSetting(); - createsOrUpdatesTheDiagnosticSettingForCategory(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsDeleteSample.ts deleted file mode 100644 index d99ca747b606..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsDeleteSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes existing diagnostic settings for the specified resource. - * - * @summary Deletes existing diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/deleteDiagnosticSetting.json - */ -async function deletesTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.delete(resourceUri, name); - console.log(result); -} - -async function main() { - deletesTheDiagnosticSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsGetSample.ts deleted file mode 100644 index 51552f38193b..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsGetSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the active diagnostic settings for the specified resource. - * - * @summary Gets the active diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSetting.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.get(resourceUri, name); - console.log(result); -} - -/** - * This sample demonstrates how to Gets the active diagnostic settings for the specified resource. - * - * @summary Gets the active diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingCategory.json - */ -async function getsTheDiagnosticSettingForCategory() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.get(resourceUri, name); - console.log(result); -} - -async function main() { - getsTheDiagnosticSetting(); - getsTheDiagnosticSettingForCategory(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsListSample.ts b/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsListSample.ts deleted file mode 100644 index 0927d272c404..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/diagnosticSettingsListSample.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the active diagnostic settings list for the specified resource. - * - * @summary Gets the active diagnostic settings list for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettings.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.diagnosticSettings.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the active diagnostic settings list for the specified resource. - * - * @summary Gets the active diagnostic settings list for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettingsCategory.json - */ -async function getsTheDiagnosticSettingForCategory() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.diagnosticSettings.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getsTheDiagnosticSetting(); - getsTheDiagnosticSettingForCategory(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/eventCategoriesListSample.ts b/sdk/monitor/arm-monitor/samples-dev/eventCategoriesListSample.ts deleted file mode 100644 index 43a5ac1c8845..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/eventCategoriesListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the list of available event categories supported in the Activity Logs Service.
The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. - * - * @summary Get the list of available event categories supported in the Activity Logs Service.
The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetEventCategories.json - */ -async function getEventCategories() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.eventCategories.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getEventCategories(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/logProfilesCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/logProfilesCreateOrUpdateSample.ts deleted file mode 100644 index ace58a8b0b8e..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/logProfilesCreateOrUpdateSample.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { LogProfileResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create or update a log profile in Azure Monitoring REST API. - * - * @summary Create or update a log profile in Azure Monitoring REST API. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/createOrUpdateLogProfile.json - */ -async function createOrUpdateALogProfile() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "df602c9c-7aa0-407d-a6fb-eb20c8bd1192"; - const logProfileName = "Rac46PostSwapRG"; - const parameters: LogProfileResource = { - categories: ["Write", "Delete", "Action"], - location: "", - locations: ["global"], - retentionPolicy: { days: 3, enabled: true }, - serviceBusRuleId: "", - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162", - tags: {} - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.logProfiles.createOrUpdate( - logProfileName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateALogProfile(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/logProfilesDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/logProfilesDeleteSample.ts deleted file mode 100644 index c264d326b6a3..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/logProfilesDeleteSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes the log profile. - * - * @summary Deletes the log profile. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteLogProfile.json - */ -async function deleteLogProfile() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const logProfileName = "Rac46PostSwapRG"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.logProfiles.delete(logProfileName); - console.log(result); -} - -async function main() { - deleteLogProfile(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/logProfilesGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/logProfilesGetSample.ts deleted file mode 100644 index 9e2f9f31105a..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/logProfilesGetSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the log profile. - * - * @summary Gets the log profile. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getLogProfile.json - */ -async function getLogProfile() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "df602c9c-7aa0-407d-a6fb-eb20c8bd1192"; - const logProfileName = "default"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.logProfiles.get(logProfileName); - console.log(result); -} - -async function main() { - getLogProfile(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/logProfilesListSample.ts b/sdk/monitor/arm-monitor/samples-dev/logProfilesListSample.ts deleted file mode 100644 index 717850be0c5a..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/logProfilesListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the log profiles. - * - * @summary List the log profiles. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listLogProfile.json - */ -async function listLogProfiles() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "df602c9c-7aa0-407d-a6fb-eb20c8bd1192"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.logProfiles.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listLogProfiles(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/logProfilesUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/logProfilesUpdateSample.ts deleted file mode 100644 index 32c9825f24f7..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/logProfilesUpdateSample.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { LogProfileResourcePatch, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/patchLogProfile.json - */ -async function patchALogProfile() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "df602c9c-7aa0-407d-a6fb-eb20c8bd1192"; - const logProfileName = "Rac46PostSwapRG"; - const logProfilesResource: LogProfileResourcePatch = { - categories: ["Write", "Delete", "Action"], - locations: ["global"], - retentionPolicy: { days: 3, enabled: true }, - serviceBusRuleId: "", - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162", - tags: { key1: "value1" } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.logProfiles.update( - logProfileName, - logProfilesResource - ); - console.log(result); -} - -async function main() { - patchALogProfile(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/metricAlertsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/metricAlertsCreateOrUpdateSample.ts deleted file mode 100644 index d609df81bd95..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsCreateOrUpdateSample.ts +++ /dev/null @@ -1,504 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MetricAlertResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateDynamicMetricAlertMultipleResource.json - */ -async function createOrUpdateADynamicAlertRuleForMultipleResources() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleResources"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - alertSensitivity: "Medium", - criterionType: "DynamicThresholdCriterion", - dimensions: [], - failingPeriods: { - minFailingPeriodsToAlert: 4, - numberOfEvaluationPeriods: 4 - }, - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterOrLessThan", - timeAggregation: "Average" - } - ], - odataType: - "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1", - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2" - ], - severity: 3, - tags: {}, - targetResourceRegion: "southcentralus", - targetResourceType: "Microsoft.Compute/virtualMachines", - windowSize: "PT15M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateDynamicMetricAlertSingleResource.json - */ -async function createOrUpdateADynamicAlertRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - alertSensitivity: "Medium", - criterionType: "DynamicThresholdCriterion", - dimensions: [], - failingPeriods: { - minFailingPeriodsToAlert: 4, - numberOfEvaluationPeriods: 4 - }, - ignoreDataBefore: new Date("2019-04-04T21:00:00.000Z"), - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterOrLessThan", - timeAggregation: "Average" - } - ], - odataType: - "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" - ], - severity: 3, - tags: {}, - windowSize: "PT15M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateWebTestMetricAlert.json - */ -async function createOrUpdateAWebTestAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "12345678-1234-1234-1234-123456789101"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "rg-example"; - const ruleName = "webtest-name-example"; - const parameters: MetricAlertResource = { - description: - 'Automatically created alert rule for availability test "component-example" a', - actions: [], - criteria: { - componentId: - "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example", - failedLocationCount: 2, - odataType: "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria", - webTestId: - "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example" - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example", - "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example" - ], - severity: 4, - tags: { - "hiddenLink:/subscriptions/12345678123412341234123456789101/resourcegroups/rgExample/providers/microsoftInsights/components/webtestNameExample": - "Resource", - "hiddenLink:/subscriptions/12345678123412341234123456789101/resourcegroups/rgExample/providers/microsoftInsights/webtests/componentExample": - "Resource" - }, - windowSize: "PT15M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertMultipleResource.json - */ -async function createOrUpdateAnAlertRuleForMultipleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleResources"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average" - } - ], - odataType: - "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1", - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2" - ], - severity: 3, - tags: {}, - targetResourceRegion: "southcentralus", - targetResourceType: "Microsoft.Compute/virtualMachines", - windowSize: "PT15M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertSingleResource.json - */ -async function createOrUpdateAnAlertRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "\\Processor(_Total)\\% Processor Time", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average" - } - ], - odataType: "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "Pt1m", - location: "global", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" - ], - severity: 3, - tags: {}, - windowSize: "Pt15m" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertResourceGroup.json - */ -async function createOrUpdateAnAlertRuleOnResourceGroupS() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest1"; - const ruleName = "MetricAlertAtResourceGroupLevel"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average" - } - ], - odataType: - "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1", - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest2" - ], - severity: 3, - tags: {}, - targetResourceRegion: "southcentralus", - targetResourceType: "Microsoft.Compute/virtualMachines", - windowSize: "PT15M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertSubscription.json - */ -async function createOrUpdateAnAlertRuleOnSubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertAtSubscriptionLevel"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average" - } - ], - odataType: - "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: ["/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"], - severity: 3, - tags: {}, - targetResourceRegion: "southcentralus", - targetResourceType: "Microsoft.Compute/virtualMachines", - windowSize: "PT15M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertWithDimensions.json - */ -async function createOrUpdateAnAlertRulesWithDimensions() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleDimensions"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "Metric1", - criterionType: "StaticThresholdCriterion", - dimensions: [ - { name: "ActivityName", operator: "Include", values: ["*"] }, - { name: "StatusCode", operator: "Include", values: ["200"] } - ], - metricName: "Availability", - metricNamespace: "Microsoft.KeyVault/vaults", - operator: "GreaterThan", - threshold: 55, - timeAggregation: "Average" - } - ], - odataType: - "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "PT1H", - location: "global", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.KeyVault/vaults/keyVaultResource" - ], - severity: 3, - tags: {}, - windowSize: "P1D" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateADynamicAlertRuleForMultipleResources(); - createOrUpdateADynamicAlertRuleForSingleResource(); - createOrUpdateAWebTestAlertRule(); - createOrUpdateAnAlertRuleForMultipleResource(); - createOrUpdateAnAlertRuleForSingleResource(); - createOrUpdateAnAlertRuleOnResourceGroupS(); - createOrUpdateAnAlertRuleOnSubscription(); - createOrUpdateAnAlertRulesWithDimensions(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/metricAlertsDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/metricAlertsDeleteSample.ts deleted file mode 100644 index 30628e3520d6..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsDeleteSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete an alert rule definition. - * - * @summary Delete an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/deleteMetricAlert.json - */ -async function deleteAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.delete(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - deleteAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/metricAlertsGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/metricAlertsGetSample.ts deleted file mode 100644 index c1b733567e66..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsGetSample.ts +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getDynamicMetricAlertMultipleResource.json - */ -async function getADynamicAlertRuleForMultipleResources() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleResources"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getDynamicMetricAlertSingleResource.json - */ -async function getADynamicAlertRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getWebTestMetricAlert.json - */ -async function getAWebTestAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "12345678-1234-1234-1234-123456789101"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "rg-example"; - const ruleName = "webtest-name-example"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertMultipleResource.json - */ -async function getAnAlertRuleForMultipleResources() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleResources"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertSingleResource.json - */ -async function getAnAlertRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertResourceGroup.json - */ -async function getAnAlertRuleOnResourceGroupS() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest1"; - const ruleName = "MetricAlertAtResourceGroupLevel"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertSubscription.json - */ -async function getAnAlertRuleOnSubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertAtSubscriptionLevel"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - getADynamicAlertRuleForMultipleResources(); - getADynamicAlertRuleForSingleResource(); - getAWebTestAlertRule(); - getAnAlertRuleForMultipleResources(); - getAnAlertRuleForSingleResource(); - getAnAlertRuleOnResourceGroupS(); - getAnAlertRuleOnSubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/metricAlertsListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples-dev/metricAlertsListByResourceGroupSample.ts deleted file mode 100644 index 3396a7fc63bf..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsListByResourceGroupSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve alert rule definitions in a resource group. - * - * @summary Retrieve alert rule definitions in a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/listMetricAlert.json - */ -async function listMetricAlertRules() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricAlerts.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listMetricAlertRules(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/metricAlertsListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples-dev/metricAlertsListBySubscriptionSample.ts deleted file mode 100644 index 8e5e162a5570..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve alert rule definitions in a subscription. - * - * @summary Retrieve alert rule definitions in a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/listMetricAlert.json - */ -async function listMetricAlertRules() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricAlerts.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listMetricAlertRules(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/metricAlertsStatusListByNameSample.ts b/sdk/monitor/arm-monitor/samples-dev/metricAlertsStatusListByNameSample.ts deleted file mode 100644 index 37c18dacacb1..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsStatusListByNameSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve an alert rule status. - * - * @summary Retrieve an alert rule status. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertStatusByName.json - */ -async function getAnAlertRuleStatus() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "009f6022-67ec-423e-9aa7-691182870588"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "EastUs"; - const ruleName = "custom1"; - const statusName = - "cmVzb3VyY2VJZD0vc3Vic2NyaXB0aW9ucy8xNGRkZjBjNS03N2M1LTRiNTMtODRmNi1lMWZhNDNhZDY4ZjcvcmVzb3VyY2VHcm91cHMvZ2lndGVzdC9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvdmlydHVhbE1hY2hpbmVzL2dpZ3dhZG1l"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlertsStatus.listByName( - resourceGroupName, - ruleName, - statusName - ); - console.log(result); -} - -async function main() { - getAnAlertRuleStatus(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/metricAlertsStatusListSample.ts b/sdk/monitor/arm-monitor/samples-dev/metricAlertsStatusListSample.ts deleted file mode 100644 index 250b43d4748c..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsStatusListSample.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve an alert rule status. - * - * @summary Retrieve an alert rule status. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertStatus.json - */ -async function getAnAlertRuleStatus() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlertsStatus.list( - resourceGroupName, - ruleName - ); - console.log(result); -} - -async function main() { - getAnAlertRuleStatus(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/metricAlertsUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/metricAlertsUpdateSample.ts deleted file mode 100644 index 28c118771553..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricAlertsUpdateSample.ts +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MetricAlertResourcePatch, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update an metric alert definition. - * - * @summary Update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/UpdateMetricAlert.json - */ -async function createOrUpdateAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const parameters: MetricAlertResourcePatch = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "\\Processor(_Total)\\% Processor Time", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average" - } - ], - odataType: "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "Pt1m", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" - ], - severity: 3, - tags: {}, - windowSize: "Pt15m" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.update( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/metricDefinitionsListSample.ts b/sdk/monitor/arm-monitor/samples-dev/metricDefinitionsListSample.ts deleted file mode 100644 index db4ec4a363d5..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricDefinitionsListSample.ts +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - MetricDefinitionsListOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the metric definitions for the resource. - * - * @summary Lists the metric definitions for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitionsApplicationInsights.json - */ -async function getApplicationInsightsMetricDefinitionsWithoutFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions"; - const metricnamespace = "microsoft.insights/components"; - const options: MetricDefinitionsListOptionalParams = { metricnamespace }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Lists the metric definitions for the resource. - * - * @summary Lists the metric definitions for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitions.json - */ -async function getMetricDefinitionsWithoutFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricDefinitions"; - const metricnamespace = "Microsoft.Web/sites"; - const options: MetricDefinitionsListOptionalParams = { metricnamespace }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Lists the metric definitions for the resource. - * - * @summary Lists the metric definitions for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitionsMetricClass.json - */ -async function getStorageCacheMetricDefinitionsWithMetricClass() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"; - const metricnamespace = "microsoft.storagecache/caches"; - const options: MetricDefinitionsListOptionalParams = { metricnamespace }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getApplicationInsightsMetricDefinitionsWithoutFilter(); - getMetricDefinitionsWithoutFilter(); - getStorageCacheMetricDefinitionsWithMetricClass(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/metricNamespacesListSample.ts b/sdk/monitor/arm-monitor/samples-dev/metricNamespacesListSample.ts deleted file mode 100644 index 3df200d50713..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricNamespacesListSample.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - MetricNamespacesListOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the metric namespaces for the resource. - * - * @summary Lists the metric namespaces for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/examples/GetMetricNamespaces.json - */ -async function getMetricNamespacesWithoutFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"; - const startTime = "2020-08-31T15:53:00Z"; - const options: MetricNamespacesListOptionalParams = { startTime }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricNamespaces.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getMetricNamespacesWithoutFilter(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/metricsListSample.ts b/sdk/monitor/arm-monitor/samples-dev/metricsListSample.ts deleted file mode 100644 index de1242962f04..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/metricsListSample.ts +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MetricsListOptionalParams, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to **Lists the metric values for a resource**. - * - * @summary **Lists the metric values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetric.json - */ -async function getMetricForData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default"; - const timespan = "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z"; - const interval = "PT1M"; - const aggregation = "Average,count"; - const top = 3; - const orderby = "Average asc"; - const filter = "BlobType eq '*'"; - const metricnamespace = "Microsoft.Storage/storageAccounts/blobServices"; - const options: MetricsListOptionalParams = { - timespan, - interval, - aggregation, - top, - orderby, - filter, - metricnamespace - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.list(resourceUri, options); - console.log(result); -} - -/** - * This sample demonstrates how to **Lists the metric values for a resource**. - * - * @summary **Lists the metric values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricMetadata.json - */ -async function getMetricForMetadata() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default"; - const timespan = "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z"; - const interval = "PT1M"; - const aggregation = "Average,count"; - const top = 3; - const orderby = "Average asc"; - const filter = "BlobType eq '*'"; - const metricnamespace = "Microsoft.Storage/storageAccounts/blobServices"; - const options: MetricsListOptionalParams = { - timespan, - interval, - aggregation, - top, - orderby, - filter, - metricnamespace - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.list(resourceUri, options); - console.log(result); -} - -/** - * This sample demonstrates how to **Lists the metric values for a resource**. - * - * @summary **Lists the metric values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricError.json - */ -async function getMetricWithError() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/ac41e21f-afd6-4a79-8070-f01eba278f97/resourceGroups/todking/providers/Microsoft.DocumentDb/databaseAccounts/tk-cosmos-mongo"; - const timespan = "2021-06-07T21:51:00Z/2021-06-08T01:51:00Z"; - const interval = "FULL"; - const metricnames = "MongoRequestsCount,MongoRequests"; - const aggregation = "average"; - const metricnamespace = "microsoft.documentdb/databaseaccounts"; - const options: MetricsListOptionalParams = { - timespan, - interval, - metricnames, - aggregation, - metricnamespace - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.list(resourceUri, options); - console.log(result); -} - -async function main() { - getMetricForData(); - getMetricForMetadata(); - getMetricWithError(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/monitorOperationsListSample.ts b/sdk/monitor/arm-monitor/samples-dev/monitorOperationsListSample.ts deleted file mode 100644 index c39df4e1ffa2..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/monitorOperationsListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists available Operations for this Resource Provider - * - * @summary Lists available Operations for this Resource Provider - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/OperationsGet.json - */ -async function getOperationsList() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitorOperations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getOperationsList(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/operationsListSample.ts b/sdk/monitor/arm-monitor/samples-dev/operationsListSample.ts deleted file mode 100644 index b286ddbb34f4..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/operationsListSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all of the available operations from Microsoft.Insights provider. - * - * @summary Lists all of the available operations from Microsoft.Insights provider. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/OperationList.json - */ -async function getAListOfOperationsForAResourceProvider() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.operations.list(); - console.log(result); -} - -async function main() { - getAListOfOperationsForAResourceProvider(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/predictiveMetricGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/predictiveMetricGetSample.ts deleted file mode 100644 index 46141b8812d7..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/predictiveMetricGetSample.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to get predictive autoscale metric future data - * - * @summary get predictive autoscale metric future data - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/GetPredictiveMetric.json - */ -async function getMetricForData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myRG"; - const autoscaleSettingName = "vmss1-Autoscale-775"; - const timespan = "2021-10-14T22:00:00.000Z/2021-10-16T22:00:00.000Z"; - const interval = "PT1H"; - const metricNamespace = "Microsoft.Compute/virtualMachineScaleSets"; - const metricName = "PercentageCPU"; - const aggregation = "Total"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.predictiveMetric.get( - resourceGroupName, - autoscaleSettingName, - timespan, - interval, - metricNamespace, - metricName, - aggregation - ); - console.log(result); -} - -async function main() { - getMetricForData(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.ts deleted file mode 100644 index 58c9ae6e5230..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { PrivateEndpointConnection, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Approve or reject a private endpoint connection with a given name. - * - * @summary Approve or reject a private endpoint connection with a given name. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionUpdate.json - */ -async function approveOrRejectAPrivateEndpointConnectionWithAGivenName() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const privateEndpointConnectionName = "private-endpoint-connection-name"; - const parameters: PrivateEndpointConnection = { - privateLinkServiceConnectionState: { - description: "Approved by johndoe@contoso.com", - status: "Approved" - } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginCreateOrUpdateAndWait( - resourceGroupName, - scopeName, - privateEndpointConnectionName, - parameters - ); - console.log(result); -} - -async function main() { - approveOrRejectAPrivateEndpointConnectionWithAGivenName(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsDeleteSample.ts deleted file mode 100644 index 3328788b882d..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsDeleteSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a private endpoint connection with a given name. - * - * @summary Deletes a private endpoint connection with a given name. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionDelete.json - */ -async function deletesAPrivateEndpointConnectionWithAGivenName() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const privateEndpointConnectionName = "private-endpoint-connection-name"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginDeleteAndWait( - resourceGroupName, - scopeName, - privateEndpointConnectionName - ); - console.log(result); -} - -async function main() { - deletesAPrivateEndpointConnectionWithAGivenName(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsGetSample.ts deleted file mode 100644 index 61b6812cba6a..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsGetSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a private endpoint connection. - * - * @summary Gets a private endpoint connection. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionGet.json - */ -async function getsPrivateEndpointConnection() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const privateEndpointConnectionName = "private-endpoint-connection-name"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.get( - resourceGroupName, - scopeName, - privateEndpointConnectionName - ); - console.log(result); -} - -async function main() { - getsPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsListByPrivateLinkScopeSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsListByPrivateLinkScopeSample.ts deleted file mode 100644 index 3ad2bbb647f0..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateEndpointConnectionsListByPrivateLinkScopeSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets all private endpoint connections on a private link scope. - * - * @summary Gets all private endpoint connections on a private link scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionList.json - */ -async function getsListOfPrivateEndpointConnectionsOnAPrivateLinkScope() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.listByPrivateLinkScope( - resourceGroupName, - scopeName - ); - console.log(result); -} - -async function main() { - getsListOfPrivateEndpointConnectionsOnAPrivateLinkScope(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateLinkResourcesGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateLinkResourcesGetSample.ts deleted file mode 100644 index a44ca23c11f4..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkResourcesGetSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @summary Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json - */ -async function getsPrivateEndpointConnection() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const groupName = "azuremonitor"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkResources.get( - resourceGroupName, - scopeName, - groupName - ); - console.log(result); -} - -async function main() { - getsPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateLinkResourcesListByPrivateLinkScopeSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateLinkResourcesListByPrivateLinkScopeSample.ts deleted file mode 100644 index b2d1f95086c2..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkResourcesListByPrivateLinkScopeSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @summary Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopePrivateLinkResourceListGet.json - */ -async function getsPrivateEndpointConnection() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkResources.listByPrivateLinkScope( - resourceGroupName, - scopeName - ); - console.log(result); -} - -async function main() { - getsPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopeOperationStatusGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateLinkScopeOperationStatusGetSample.ts deleted file mode 100644 index 8f40d8c5a8f5..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopeOperationStatusGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the status of an azure asynchronous operation associated with a private link scope operation. - * - * @summary Get the status of an azure asynchronous operation associated with a private link scope operation. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/privateLinkScopeOperationStatuses.json - */ -async function getSpecificOperationStatus() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "613192d7-503f-477a-9cfe-4efc3ee2bd60"; - const asyncOperationId = "713192d7-503f-477a-9cfe-4efc3ee2bd11"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopeOperationStatus.get( - asyncOperationId, - resourceGroupName - ); - console.log(result); -} - -async function main() { - getSpecificOperationStatus(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesCreateOrUpdateSample.ts deleted file mode 100644 index c0e06fc98bfb..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesCreateOrUpdateSample.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ScopedResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Approve or reject a private endpoint connection with a given name. - * - * @summary Approve or reject a private endpoint connection with a given name. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceUpdate.json - */ -async function updateAScopedResourceInAPrivateLinkScope() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const name = "scoped-resource-name"; - const parameters: ScopedResource = { - linkedResourceId: - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/components/my-component" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopedResources.beginCreateOrUpdateAndWait( - resourceGroupName, - scopeName, - name, - parameters - ); - console.log(result); -} - -async function main() { - updateAScopedResourceInAPrivateLinkScope(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesDeleteSample.ts deleted file mode 100644 index da8128cf28d5..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesDeleteSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a private endpoint connection with a given name. - * - * @summary Deletes a private endpoint connection with a given name. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceDelete.json - */ -async function deletesAScopedResourceWithAGivenName() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const name = "scoped-resource-name"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopedResources.beginDeleteAndWait( - resourceGroupName, - scopeName, - name - ); - console.log(result); -} - -async function main() { - deletesAScopedResourceWithAGivenName(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesGetSample.ts deleted file mode 100644 index 248dc344aea7..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesGetSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a scoped resource in a private link scope. - * - * @summary Gets a scoped resource in a private link scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceGet.json - */ -async function getsPrivateLinkScopedResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const name = "scoped-resource-name"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopedResources.get( - resourceGroupName, - scopeName, - name - ); - console.log(result); -} - -async function main() { - getsPrivateLinkScopedResource(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesListByPrivateLinkScopeSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesListByPrivateLinkScopeSample.ts deleted file mode 100644 index 2157e3c141ff..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopedResourcesListByPrivateLinkScopeSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets all private endpoint connections on a private link scope. - * - * @summary Gets all private endpoint connections on a private link scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceList.json - */ -async function getsListOfScopedResourcesInAPrivateLinkScope() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateLinkScopedResources.listByPrivateLinkScope( - resourceGroupName, - scopeName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getsListOfScopedResourcesInAPrivateLinkScope(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesCreateOrUpdateSample.ts deleted file mode 100644 index 484867612812..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesCreateOrUpdateSample.ts +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AzureMonitorPrivateLinkScope, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. - * - * @summary Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesCreate.json - */ -async function privateLinkScopeCreate() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const azureMonitorPrivateLinkScopePayload: AzureMonitorPrivateLinkScope = { - accessModeSettings: { - exclusions: [], - ingestionAccessMode: "Open", - queryAccessMode: "Open" - }, - location: "Global" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.createOrUpdate( - resourceGroupName, - scopeName, - azureMonitorPrivateLinkScopePayload - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. - * - * @summary Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesUpdate.json - */ -async function privateLinkScopeUpdate() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const azureMonitorPrivateLinkScopePayload: AzureMonitorPrivateLinkScope = { - accessModeSettings: { - exclusions: [], - ingestionAccessMode: "Open", - queryAccessMode: "Open" - }, - location: "Global", - tags: { tag1: "Value1" } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.createOrUpdate( - resourceGroupName, - scopeName, - azureMonitorPrivateLinkScopePayload - ); - console.log(result); -} - -async function main() { - privateLinkScopeCreate(); - privateLinkScopeUpdate(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesDeleteSample.ts deleted file mode 100644 index 72fa958e3561..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a Azure Monitor PrivateLinkScope. - * - * @summary Deletes a Azure Monitor PrivateLinkScope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesDelete.json - */ -async function privateLinkScopesDelete() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.beginDeleteAndWait( - resourceGroupName, - scopeName - ); - console.log(result); -} - -async function main() { - privateLinkScopesDelete(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesGetSample.ts deleted file mode 100644 index bc31e306902a..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns a Azure Monitor PrivateLinkScope. - * - * @summary Returns a Azure Monitor PrivateLinkScope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesGet.json - */ -async function privateLinkScopeGet() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.get( - resourceGroupName, - scopeName - ); - console.log(result); -} - -async function main() { - privateLinkScopeGet(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesListByResourceGroupSample.ts deleted file mode 100644 index e5c093f8e3de..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a list of Azure Monitor PrivateLinkScopes within a resource group. - * - * @summary Gets a list of Azure Monitor PrivateLinkScopes within a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesListByResourceGroup.json - */ -async function privateLinkScopeListByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateLinkScopes.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - privateLinkScopeListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesListSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesListSample.ts deleted file mode 100644 index 47d4083d2f79..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. - * - * @summary Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesList.json - */ -async function privateLinkScopesListJson() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateLinkScopes.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - privateLinkScopesListJson(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesUpdateTagsSample.ts b/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesUpdateTagsSample.ts deleted file mode 100644 index d6956ec9e02c..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/privateLinkScopesUpdateTagsSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { TagsResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesUpdateTagsOnly.json - */ -async function privateLinkScopeUpdateTagsOnly() { - const subscriptionId = process.env["MONITOR_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const privateLinkScopeTags: TagsResource = { - tags: { tag1: "Value1", tag2: "Value2" } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.updateTags( - resourceGroupName, - scopeName, - privateLinkScopeTags - ); - console.log(result); -} - -async function main() { - privateLinkScopeUpdateTagsOnly(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesCreateOrUpdateSample.ts deleted file mode 100644 index c22ab70cb00b..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesCreateOrUpdateSample.ts +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ScheduledQueryRuleResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates a scheduled query rule. - * - * @summary Creates or updates a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/createOrUpdateScheduledQueryRule.json - */ -async function createOrUpdateAScheduledQueryRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "perf"; - const parameters: ScheduledQueryRuleResource = { - description: "Performance rule", - actions: { - actionGroups: [ - "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" - ], - customProperties: { key11: "value11", key12: "value12" } - }, - checkWorkspaceAlertsStorageConfigured: true, - criteria: { - allOf: [ - { - dimensions: [ - { - name: "ComputerIp", - operator: "Exclude", - values: ["192.168.1.1"] - }, - { name: "OSType", operator: "Include", values: ["*"] } - ], - failingPeriods: { - minFailingPeriodsToAlert: 1, - numberOfEvaluationPeriods: 1 - }, - metricMeasureColumn: "% Processor Time", - operator: "GreaterThan", - query: 'Perf | where ObjectName == "Processor"', - resourceIdColumn: "resourceId", - threshold: 70, - timeAggregation: "Average" - } - ] - }, - enabled: true, - evaluationFrequency: "PT5M", - location: "eastus", - muteActionsDuration: "PT30M", - ruleResolveConfiguration: { autoResolved: true, timeToResolve: "PT10M" }, - scopes: [ - "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1" - ], - severity: 4, - skipQueryValidation: true, - windowSize: "PT10M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a scheduled query rule. - * - * @summary Creates or updates a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/createOrUpdateScheduledQueryRuleResourceGroup.json - */ -async function createOrUpdateAScheduledQueryRuleOnResourceGroupS() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "heartbeat"; - const parameters: ScheduledQueryRuleResource = { - description: "Health check rule", - actions: { - actionGroups: [ - "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" - ], - customProperties: { key11: "value11", key12: "value12" } - }, - checkWorkspaceAlertsStorageConfigured: true, - criteria: { - allOf: [ - { - dimensions: [], - failingPeriods: { - minFailingPeriodsToAlert: 1, - numberOfEvaluationPeriods: 1 - }, - operator: "GreaterThan", - query: "Heartbeat", - threshold: 360, - timeAggregation: "Count" - } - ] - }, - enabled: true, - evaluationFrequency: "PT5M", - location: "eastus", - muteActionsDuration: "PT30M", - ruleResolveConfiguration: { autoResolved: true, timeToResolve: "PT10M" }, - scopes: [ - "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1" - ], - severity: 4, - skipQueryValidation: true, - targetResourceTypes: ["Microsoft.Compute/virtualMachines"], - windowSize: "PT10M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a scheduled query rule. - * - * @summary Creates or updates a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/createOrUpdateScheduledQueryRuleSubscription.json - */ -async function createOrUpdateAScheduledQueryRuleOnSubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "perf"; - const parameters: ScheduledQueryRuleResource = { - description: "Performance rule", - actions: { - actionGroups: [ - "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" - ], - customProperties: { key11: "value11", key12: "value12" } - }, - checkWorkspaceAlertsStorageConfigured: true, - criteria: { - allOf: [ - { - dimensions: [ - { - name: "ComputerIp", - operator: "Exclude", - values: ["192.168.1.1"] - }, - { name: "OSType", operator: "Include", values: ["*"] } - ], - failingPeriods: { - minFailingPeriodsToAlert: 1, - numberOfEvaluationPeriods: 1 - }, - metricMeasureColumn: "% Processor Time", - operator: "GreaterThan", - query: 'Perf | where ObjectName == "Processor"', - resourceIdColumn: "resourceId", - threshold: 70, - timeAggregation: "Average" - } - ] - }, - enabled: true, - evaluationFrequency: "PT5M", - location: "eastus", - muteActionsDuration: "PT30M", - ruleResolveConfiguration: { autoResolved: true, timeToResolve: "PT10M" }, - scopes: ["/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147"], - severity: 4, - skipQueryValidation: true, - targetResourceTypes: ["Microsoft.Compute/virtualMachines"], - windowSize: "PT10M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateAScheduledQueryRuleForSingleResource(); - createOrUpdateAScheduledQueryRuleOnResourceGroupS(); - createOrUpdateAScheduledQueryRuleOnSubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesDeleteSample.ts b/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesDeleteSample.ts deleted file mode 100644 index 9e34f0b8d669..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a scheduled query rule. - * - * @summary Deletes a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/deleteScheduledQueryRule.json - */ -async function deleteAScheduledQueryRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "heartbeat"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.delete( - resourceGroupName, - ruleName - ); - console.log(result); -} - -async function main() { - deleteAScheduledQueryRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesGetSample.ts b/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesGetSample.ts deleted file mode 100644 index e77734253abe..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve an scheduled query rule definition. - * - * @summary Retrieve an scheduled query rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/getScheduledQueryRule.json - */ -async function getAScheduledQueryRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "perf"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.get( - resourceGroupName, - ruleName - ); - console.log(result); -} - -async function main() { - getAScheduledQueryRuleForSingleResource(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesListByResourceGroupSample.ts deleted file mode 100644 index f474165d969b..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve scheduled query rule definitions in a resource group. - * - * @summary Retrieve scheduled query rule definitions in a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/listScheduledQueryRulesByResourceGroup.json - */ -async function listScheduledQueryRulesByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.scheduledQueryRules.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listScheduledQueryRulesByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesListBySubscriptionSample.ts deleted file mode 100644 index ec1cce5bfe7b..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve a scheduled query rule definitions in a subscription. - * - * @summary Retrieve a scheduled query rule definitions in a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/listScheduledQueryRulesBySubscription.json - */ -async function listScheduledQueryRulesBySubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.scheduledQueryRules.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listScheduledQueryRulesBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesUpdateSample.ts b/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesUpdateSample.ts deleted file mode 100644 index ccadc3a95389..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/scheduledQueryRulesUpdateSample.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ScheduledQueryRuleResourcePatch, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update a scheduled query rule. - * - * @summary Update a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/patchScheduledQueryRule.json - */ -async function createOrUpdateAScheduledQueryRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "heartbeat"; - const parameters: ScheduledQueryRuleResourcePatch = { enabled: false }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.update( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateAScheduledQueryRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/tenantActivityLogsListSample.ts b/sdk/monitor/arm-monitor/samples-dev/tenantActivityLogsListSample.ts deleted file mode 100644 index 519961fabae5..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/tenantActivityLogsListSample.ts +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - TenantActivityLogsListOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsFiltered.json - */ -async function getTenantActivityLogsWithFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const options: TenantActivityLogsListOptionalParams = { filter }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsFilteredAndSelected.json - */ -async function getTenantActivityLogsWithFilterAndSelect() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const select = - "eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level"; - const options: TenantActivityLogsListOptionalParams = { filter, select }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsSelected.json - */ -async function getTenantActivityLogsWithSelect() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const select = - "eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level"; - const options: TenantActivityLogsListOptionalParams = { select }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsNoParams.json - */ -async function getTenantActivityLogsWithoutFilterOrSelect() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getTenantActivityLogsWithFilter(); - getTenantActivityLogsWithFilterAndSelect(); - getTenantActivityLogsWithSelect(); - getTenantActivityLogsWithoutFilterOrSelect(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples-dev/vmInsightsGetOnboardingStatusSample.ts b/sdk/monitor/arm-monitor/samples-dev/vmInsightsGetOnboardingStatusSample.ts deleted file mode 100644 index 96e4892e9ecc..000000000000 --- a/sdk/monitor/arm-monitor/samples-dev/vmInsightsGetOnboardingStatusSample.ts +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusVMScaleSet.json - */ -async function getStatusForAVMScaleSetThatIsActivelyReportingData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/my-service-cluster/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-01"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSingleVMUnknown.json - */ -async function getStatusForAVMThatHasNotYetReportedData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSingleVM.json - */ -async function getStatusForAVMThatIsActivelyReportingData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusResourceGroup.json - */ -async function getStatusForAResourceGroupThatHasAtLeastOneVMThatIsActivelyReportingData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/resource-group-with-vms"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSubscription.json - */ -async function getStatusForASubscriptionThatHasAtLeastOneVMThatIsActivelyReportingData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -async function main() { - getStatusForAVMScaleSetThatIsActivelyReportingData(); - getStatusForAVMThatHasNotYetReportedData(); - getStatusForAVMThatIsActivelyReportingData(); - getStatusForAResourceGroupThatHasAtLeastOneVMThatIsActivelyReportingData(); - getStatusForASubscriptionThatHasAtLeastOneVMThatIsActivelyReportingData(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/README.md b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/README.md deleted file mode 100644 index 64bef40833fb..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/README.md +++ /dev/null @@ -1,268 +0,0 @@ -# client library samples for JavaScript (Beta) - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| --------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.js][actiongroupscreatenotificationsatactiongroupresourcelevelsample] | Send test notifications to a set of provided receivers x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtActionGroupResourceLevel.json | -| [actionGroupsCreateNotificationsAtResourceGroupLevelSample.js][actiongroupscreatenotificationsatresourcegrouplevelsample] | Send test notifications to a set of provided receivers x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtResourceGroupLevel.json | -| [actionGroupsCreateOrUpdateSample.js][actiongroupscreateorupdatesample] | Create a new action group or update an existing one. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/createOrUpdateActionGroup.json | -| [actionGroupsDeleteSample.js][actiongroupsdeletesample] | Delete an action group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/deleteActionGroup.json | -| [actionGroupsEnableReceiverSample.js][actiongroupsenablereceiversample] | Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation is only supported for Email or SMS receivers. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/enableReceiver.json | -| [actionGroupsGetSample.js][actiongroupsgetsample] | Get an action group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getActionGroup.json | -| [actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.js][actiongroupsgettestnotificationsatactiongroupresourcelevelsample] | Get the test notifications by the notification id x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtActionGroupResourceLevel.json | -| [actionGroupsGetTestNotificationsAtResourceGroupLevelSample.js][actiongroupsgettestnotificationsatresourcegrouplevelsample] | Get the test notifications by the notification id x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtResourceGroupLevel.json | -| [actionGroupsGetTestNotificationsSample.js][actiongroupsgettestnotificationssample] | Get the test notifications by the notification id x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotifications.json | -| [actionGroupsListByResourceGroupSample.js][actiongroupslistbyresourcegroupsample] | Get a list of all action groups in a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json | -| [actionGroupsListBySubscriptionIdSample.js][actiongroupslistbysubscriptionidsample] | Get a list of all action groups in a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json | -| [actionGroupsPostTestNotificationsSample.js][actiongroupsposttestnotificationssample] | Send test notifications to a set of provided receivers x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotifications.json | -| [actionGroupsUpdateSample.js][actiongroupsupdatesample] | Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/patchActionGroup.json | -| [activityLogAlertsCreateOrUpdateSample.js][activitylogalertscreateorupdatesample] | Create a new Activity Log Alert rule or update an existing one. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_CreateOrUpdate.json | -| [activityLogAlertsDeleteSample.js][activitylogalertsdeletesample] | Delete an Activity Log Alert rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Delete.json | -| [activityLogAlertsGetSample.js][activitylogalertsgetsample] | Get an Activity Log Alert rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Get.json | -| [activityLogAlertsListByResourceGroupSample.js][activitylogalertslistbyresourcegroupsample] | Get a list of all Activity Log Alert rules in a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_ListByResourceGroupName.json | -| [activityLogAlertsListBySubscriptionIdSample.js][activitylogalertslistbysubscriptionidsample] | Get a list of all Activity Log Alert rules in a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_ListBySubscriptionId.json | -| [activityLogAlertsUpdateSample.js][activitylogalertsupdatesample] | Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Update.json | -| [activityLogsListSample.js][activitylogslistsample] | Provides the list of records from the activity logs. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetActivityLogsFiltered.json | -| [alertRuleIncidentsGetSample.js][alertruleincidentsgetsample] | Gets an incident associated to an alert rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getAlertRuleIncident.json | -| [alertRuleIncidentsListByAlertRuleSample.js][alertruleincidentslistbyalertrulesample] | Gets a list of incidents associated to an alert rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRuleIncidents.json | -| [alertRulesCreateOrUpdateSample.js][alertrulescreateorupdatesample] | Creates or updates a classic metric alert rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/createOrUpdateAlertRule.json | -| [alertRulesDeleteSample.js][alertrulesdeletesample] | Deletes a classic metric alert rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteAlertRule.json | -| [alertRulesGetSample.js][alertrulesgetsample] | Gets a classic metric alert rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getAlertRule.json | -| [alertRulesListByResourceGroupSample.js][alertruleslistbyresourcegroupsample] | List the classic metric alert rules within a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRule.json | -| [alertRulesListBySubscriptionSample.js][alertruleslistbysubscriptionsample] | List the classic metric alert rules within a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRuleBySubscription.json | -| [alertRulesUpdateSample.js][alertrulesupdatesample] | Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/patchAlertRule.json | -| [autoscaleSettingsCreateOrUpdateSample.js][autoscalesettingscreateorupdatesample] | Creates or updates an autoscale setting. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/createOrUpdateAutoscaleSetting.json | -| [autoscaleSettingsDeleteSample.js][autoscalesettingsdeletesample] | Deletes and autoscale setting x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/deleteAutoscaleSetting.json | -| [autoscaleSettingsGetSample.js][autoscalesettingsgetsample] | Gets an autoscale setting x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/getAutoscaleSetting.json | -| [autoscaleSettingsListByResourceGroupSample.js][autoscalesettingslistbyresourcegroupsample] | Lists the autoscale settings for a resource group x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/listAutoscaleSetting.json | -| [autoscaleSettingsListBySubscriptionSample.js][autoscalesettingslistbysubscriptionsample] | Lists the autoscale settings for a subscription x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/listAutoscaleSettingBySubscription.json | -| [autoscaleSettingsUpdateSample.js][autoscalesettingsupdatesample] | Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/patchAutoscaleSetting.json | -| [azureMonitorWorkspacesCreateSample.js][azuremonitorworkspacescreatesample] | Create or update a workspace x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesCreate.json | -| [azureMonitorWorkspacesDeleteSample.js][azuremonitorworkspacesdeletesample] | Delete a workspace x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesDelete.json | -| [azureMonitorWorkspacesGetSample.js][azuremonitorworkspacesgetsample] | Returns the specific Azure Monitor workspace x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesGet.json | -| [azureMonitorWorkspacesListByResourceGroupSample.js][azuremonitorworkspaceslistbyresourcegroupsample] | Lists all workspaces in the specified resource group x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesListByResourceGroup.json | -| [azureMonitorWorkspacesListBySubscriptionSample.js][azuremonitorworkspaceslistbysubscriptionsample] | Lists all workspaces in the specified subscription x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesListBySubscription.json | -| [azureMonitorWorkspacesUpdateSample.js][azuremonitorworkspacesupdatesample] | Updates part of a workspace x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesUpdate.json | -| [baselinesListSample.js][baselineslistsample] | **Lists the metric baseline values for a resource**. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2019-03-01/examples/metricBaselines.json | -| [dataCollectionEndpointsCreateSample.js][datacollectionendpointscreatesample] | Creates or updates a data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsCreate.json | -| [dataCollectionEndpointsDeleteSample.js][datacollectionendpointsdeletesample] | Deletes a data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsDelete.json | -| [dataCollectionEndpointsGetSample.js][datacollectionendpointsgetsample] | Returns the specified data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsGet.json | -| [dataCollectionEndpointsListByResourceGroupSample.js][datacollectionendpointslistbyresourcegroupsample] | Lists all data collection endpoints in the specified resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListByResourceGroup.json | -| [dataCollectionEndpointsListBySubscriptionSample.js][datacollectionendpointslistbysubscriptionsample] | Lists all data collection endpoints in the specified subscription x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListBySubscription.json | -| [dataCollectionEndpointsUpdateSample.js][datacollectionendpointsupdatesample] | Updates part of a data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsUpdate.json | -| [dataCollectionRuleAssociationsCreateSample.js][datacollectionruleassociationscreatesample] | Creates or updates an association. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsCreate.json | -| [dataCollectionRuleAssociationsDeleteSample.js][datacollectionruleassociationsdeletesample] | Deletes an association. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsDelete.json | -| [dataCollectionRuleAssociationsGetSample.js][datacollectionruleassociationsgetsample] | Returns the specified association. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsGet.json | -| [dataCollectionRuleAssociationsListByDataCollectionEndpointSample.js][datacollectionruleassociationslistbydatacollectionendpointsample] | Lists associations for the specified data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByDataCollectionEndpoint.json | -| [dataCollectionRuleAssociationsListByResourceSample.js][datacollectionruleassociationslistbyresourcesample] | Lists associations for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByResource.json | -| [dataCollectionRuleAssociationsListByRuleSample.js][datacollectionruleassociationslistbyrulesample] | Lists associations for the specified data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByRule.json | -| [dataCollectionRulesCreateSample.js][datacollectionrulescreatesample] | Creates or updates a data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesCreate.json | -| [dataCollectionRulesDeleteSample.js][datacollectionrulesdeletesample] | Deletes a data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesDelete.json | -| [dataCollectionRulesGetSample.js][datacollectionrulesgetsample] | Returns the specified data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesGet.json | -| [dataCollectionRulesListByResourceGroupSample.js][datacollectionruleslistbyresourcegroupsample] | Lists all data collection rules in the specified resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListByResourceGroup.json | -| [dataCollectionRulesListBySubscriptionSample.js][datacollectionruleslistbysubscriptionsample] | Lists all data collection rules in the specified subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListBySubscription.json | -| [dataCollectionRulesUpdateSample.js][datacollectionrulesupdatesample] | Updates part of a data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesUpdate.json | -| [diagnosticSettingsCategoryGetSample.js][diagnosticsettingscategorygetsample] | Gets the diagnostic settings category for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingsCategory.json | -| [diagnosticSettingsCategoryListSample.js][diagnosticsettingscategorylistsample] | Lists the diagnostic settings categories for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettingsCategories.json | -| [diagnosticSettingsCreateOrUpdateSample.js][diagnosticsettingscreateorupdatesample] | Creates or updates diagnostic settings for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateDiagnosticSetting.json | -| [diagnosticSettingsDeleteSample.js][diagnosticsettingsdeletesample] | Deletes existing diagnostic settings for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/deleteDiagnosticSetting.json | -| [diagnosticSettingsGetSample.js][diagnosticsettingsgetsample] | Gets the active diagnostic settings for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSetting.json | -| [diagnosticSettingsListSample.js][diagnosticsettingslistsample] | Gets the active diagnostic settings list for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettings.json | -| [eventCategoriesListSample.js][eventcategorieslistsample] | Get the list of available event categories supported in the Activity Logs Service.
The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetEventCategories.json | -| [logProfilesCreateOrUpdateSample.js][logprofilescreateorupdatesample] | Create or update a log profile in Azure Monitoring REST API. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/createOrUpdateLogProfile.json | -| [logProfilesDeleteSample.js][logprofilesdeletesample] | Deletes the log profile. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteLogProfile.json | -| [logProfilesGetSample.js][logprofilesgetsample] | Gets the log profile. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getLogProfile.json | -| [logProfilesListSample.js][logprofileslistsample] | List the log profiles. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listLogProfile.json | -| [logProfilesUpdateSample.js][logprofilesupdatesample] | Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/patchLogProfile.json | -| [metricAlertsCreateOrUpdateSample.js][metricalertscreateorupdatesample] | Create or update an metric alert definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateDynamicMetricAlertMultipleResource.json | -| [metricAlertsDeleteSample.js][metricalertsdeletesample] | Delete an alert rule definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/deleteMetricAlert.json | -| [metricAlertsGetSample.js][metricalertsgetsample] | Retrieve an alert rule definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getDynamicMetricAlertMultipleResource.json | -| [metricAlertsListByResourceGroupSample.js][metricalertslistbyresourcegroupsample] | Retrieve alert rule definitions in a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/listMetricAlert.json | -| [metricAlertsListBySubscriptionSample.js][metricalertslistbysubscriptionsample] | Retrieve alert rule definitions in a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/listMetricAlert.json | -| [metricAlertsStatusListByNameSample.js][metricalertsstatuslistbynamesample] | Retrieve an alert rule status. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertStatusByName.json | -| [metricAlertsStatusListSample.js][metricalertsstatuslistsample] | Retrieve an alert rule status. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertStatus.json | -| [metricAlertsUpdateSample.js][metricalertsupdatesample] | Update an metric alert definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/UpdateMetricAlert.json | -| [metricDefinitionsListSample.js][metricdefinitionslistsample] | Lists the metric definitions for the resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitionsApplicationInsights.json | -| [metricNamespacesListSample.js][metricnamespaceslistsample] | Lists the metric namespaces for the resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/examples/GetMetricNamespaces.json | -| [metricsListSample.js][metricslistsample] | **Lists the metric values for a resource**. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetric.json | -| [monitorOperationsListSample.js][monitoroperationslistsample] | Lists available Operations for this Resource Provider x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/OperationsGet.json | -| [operationsListSample.js][operationslistsample] | Lists all of the available operations from Microsoft.Insights provider. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/OperationList.json | -| [predictiveMetricGetSample.js][predictivemetricgetsample] | get predictive autoscale metric future data x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/GetPredictiveMetric.json | -| [privateEndpointConnectionsCreateOrUpdateSample.js][privateendpointconnectionscreateorupdatesample] | Approve or reject a private endpoint connection with a given name. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionUpdate.json | -| [privateEndpointConnectionsDeleteSample.js][privateendpointconnectionsdeletesample] | Deletes a private endpoint connection with a given name. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionDelete.json | -| [privateEndpointConnectionsGetSample.js][privateendpointconnectionsgetsample] | Gets a private endpoint connection. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionGet.json | -| [privateEndpointConnectionsListByPrivateLinkScopeSample.js][privateendpointconnectionslistbyprivatelinkscopesample] | Gets all private endpoint connections on a private link scope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionList.json | -| [privateLinkResourcesGetSample.js][privatelinkresourcesgetsample] | Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json | -| [privateLinkResourcesListByPrivateLinkScopeSample.js][privatelinkresourceslistbyprivatelinkscopesample] | Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopePrivateLinkResourceListGet.json | -| [privateLinkScopeOperationStatusGetSample.js][privatelinkscopeoperationstatusgetsample] | Get the status of an azure asynchronous operation associated with a private link scope operation. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/privateLinkScopeOperationStatuses.json | -| [privateLinkScopedResourcesCreateOrUpdateSample.js][privatelinkscopedresourcescreateorupdatesample] | Approve or reject a private endpoint connection with a given name. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceUpdate.json | -| [privateLinkScopedResourcesDeleteSample.js][privatelinkscopedresourcesdeletesample] | Deletes a private endpoint connection with a given name. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceDelete.json | -| [privateLinkScopedResourcesGetSample.js][privatelinkscopedresourcesgetsample] | Gets a scoped resource in a private link scope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceGet.json | -| [privateLinkScopedResourcesListByPrivateLinkScopeSample.js][privatelinkscopedresourceslistbyprivatelinkscopesample] | Gets all private endpoint connections on a private link scope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceList.json | -| [privateLinkScopesCreateOrUpdateSample.js][privatelinkscopescreateorupdatesample] | Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesCreate.json | -| [privateLinkScopesDeleteSample.js][privatelinkscopesdeletesample] | Deletes a Azure Monitor PrivateLinkScope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesDelete.json | -| [privateLinkScopesGetSample.js][privatelinkscopesgetsample] | Returns a Azure Monitor PrivateLinkScope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesGet.json | -| [privateLinkScopesListByResourceGroupSample.js][privatelinkscopeslistbyresourcegroupsample] | Gets a list of Azure Monitor PrivateLinkScopes within a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesListByResourceGroup.json | -| [privateLinkScopesListSample.js][privatelinkscopeslistsample] | Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesList.json | -| [privateLinkScopesUpdateTagsSample.js][privatelinkscopesupdatetagssample] | Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesUpdateTagsOnly.json | -| [scheduledQueryRulesCreateOrUpdateSample.js][scheduledqueryrulescreateorupdatesample] | Creates or updates a scheduled query rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/createOrUpdateScheduledQueryRule.json | -| [scheduledQueryRulesDeleteSample.js][scheduledqueryrulesdeletesample] | Deletes a scheduled query rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/deleteScheduledQueryRule.json | -| [scheduledQueryRulesGetSample.js][scheduledqueryrulesgetsample] | Retrieve an scheduled query rule definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/getScheduledQueryRule.json | -| [scheduledQueryRulesListByResourceGroupSample.js][scheduledqueryruleslistbyresourcegroupsample] | Retrieve scheduled query rule definitions in a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/listScheduledQueryRulesByResourceGroup.json | -| [scheduledQueryRulesListBySubscriptionSample.js][scheduledqueryruleslistbysubscriptionsample] | Retrieve a scheduled query rule definitions in a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/listScheduledQueryRulesBySubscription.json | -| [scheduledQueryRulesUpdateSample.js][scheduledqueryrulesupdatesample] | Update a scheduled query rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/patchScheduledQueryRule.json | -| [tenantActivityLogsListSample.js][tenantactivitylogslistsample] | Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does _not_ retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsFiltered.json | -| [vmInsightsGetOnboardingStatusSample.js][vminsightsgetonboardingstatussample] | Retrieves the VM Insights onboarding status for the specified resource or resource scope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusVMScaleSet.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env MONITOR_SUBSCRIPTION_ID="" MONITOR_RESOURCE_GROUP="" node actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[actiongroupscreatenotificationsatactiongroupresourcelevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.js -[actiongroupscreatenotificationsatresourcegrouplevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateNotificationsAtResourceGroupLevelSample.js -[actiongroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateOrUpdateSample.js -[actiongroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsDeleteSample.js -[actiongroupsenablereceiversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsEnableReceiverSample.js -[actiongroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetSample.js -[actiongroupsgettestnotificationsatactiongroupresourcelevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.js -[actiongroupsgettestnotificationsatresourcegrouplevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.js -[actiongroupsgettestnotificationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsSample.js -[actiongroupslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsListByResourceGroupSample.js -[actiongroupslistbysubscriptionidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsListBySubscriptionIdSample.js -[actiongroupsposttestnotificationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsPostTestNotificationsSample.js -[actiongroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsUpdateSample.js -[activitylogalertscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsCreateOrUpdateSample.js -[activitylogalertsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsDeleteSample.js -[activitylogalertsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsGetSample.js -[activitylogalertslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsListByResourceGroupSample.js -[activitylogalertslistbysubscriptionidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsListBySubscriptionIdSample.js -[activitylogalertsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsUpdateSample.js -[activitylogslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogsListSample.js -[alertruleincidentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRuleIncidentsGetSample.js -[alertruleincidentslistbyalertrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRuleIncidentsListByAlertRuleSample.js -[alertrulescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesCreateOrUpdateSample.js -[alertrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesDeleteSample.js -[alertrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesGetSample.js -[alertruleslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesListByResourceGroupSample.js -[alertruleslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesListBySubscriptionSample.js -[alertrulesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesUpdateSample.js -[autoscalesettingscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsCreateOrUpdateSample.js -[autoscalesettingsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsDeleteSample.js -[autoscalesettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsGetSample.js -[autoscalesettingslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsListByResourceGroupSample.js -[autoscalesettingslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsListBySubscriptionSample.js -[autoscalesettingsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsUpdateSample.js -[azuremonitorworkspacescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesCreateSample.js -[azuremonitorworkspacesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesDeleteSample.js -[azuremonitorworkspacesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesGetSample.js -[azuremonitorworkspaceslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesListByResourceGroupSample.js -[azuremonitorworkspaceslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesListBySubscriptionSample.js -[azuremonitorworkspacesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesUpdateSample.js -[baselineslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/baselinesListSample.js -[datacollectionendpointscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsCreateSample.js -[datacollectionendpointsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsDeleteSample.js -[datacollectionendpointsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsGetSample.js -[datacollectionendpointslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsListByResourceGroupSample.js -[datacollectionendpointslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsListBySubscriptionSample.js -[datacollectionendpointsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsUpdateSample.js -[datacollectionruleassociationscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsCreateSample.js -[datacollectionruleassociationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsDeleteSample.js -[datacollectionruleassociationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsGetSample.js -[datacollectionruleassociationslistbydatacollectionendpointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.js -[datacollectionruleassociationslistbyresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByResourceSample.js -[datacollectionruleassociationslistbyrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByRuleSample.js -[datacollectionrulescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesCreateSample.js -[datacollectionrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesDeleteSample.js -[datacollectionrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesGetSample.js -[datacollectionruleslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesListByResourceGroupSample.js -[datacollectionruleslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesListBySubscriptionSample.js -[datacollectionrulesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesUpdateSample.js -[diagnosticsettingscategorygetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCategoryGetSample.js -[diagnosticsettingscategorylistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCategoryListSample.js -[diagnosticsettingscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCreateOrUpdateSample.js -[diagnosticsettingsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsDeleteSample.js -[diagnosticsettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsGetSample.js -[diagnosticsettingslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsListSample.js -[eventcategorieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/eventCategoriesListSample.js -[logprofilescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesCreateOrUpdateSample.js -[logprofilesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesDeleteSample.js -[logprofilesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesGetSample.js -[logprofileslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesListSample.js -[logprofilesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesUpdateSample.js -[metricalertscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsCreateOrUpdateSample.js -[metricalertsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsDeleteSample.js -[metricalertsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsGetSample.js -[metricalertslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsListByResourceGroupSample.js -[metricalertslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsListBySubscriptionSample.js -[metricalertsstatuslistbynamesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsStatusListByNameSample.js -[metricalertsstatuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsStatusListSample.js -[metricalertsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsUpdateSample.js -[metricdefinitionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricDefinitionsListSample.js -[metricnamespaceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricNamespacesListSample.js -[metricslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricsListSample.js -[monitoroperationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/monitorOperationsListSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/operationsListSample.js -[predictivemetricgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/predictiveMetricGetSample.js -[privateendpointconnectionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsCreateOrUpdateSample.js -[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsDeleteSample.js -[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsGetSample.js -[privateendpointconnectionslistbyprivatelinkscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsListByPrivateLinkScopeSample.js -[privatelinkresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkResourcesGetSample.js -[privatelinkresourceslistbyprivatelinkscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkResourcesListByPrivateLinkScopeSample.js -[privatelinkscopeoperationstatusgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopeOperationStatusGetSample.js -[privatelinkscopedresourcescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesCreateOrUpdateSample.js -[privatelinkscopedresourcesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesDeleteSample.js -[privatelinkscopedresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesGetSample.js -[privatelinkscopedresourceslistbyprivatelinkscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesListByPrivateLinkScopeSample.js -[privatelinkscopescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesCreateOrUpdateSample.js -[privatelinkscopesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesDeleteSample.js -[privatelinkscopesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesGetSample.js -[privatelinkscopeslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesListByResourceGroupSample.js -[privatelinkscopeslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesListSample.js -[privatelinkscopesupdatetagssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesUpdateTagsSample.js -[scheduledqueryrulescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesCreateOrUpdateSample.js -[scheduledqueryrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesDeleteSample.js -[scheduledqueryrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesGetSample.js -[scheduledqueryruleslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesListByResourceGroupSample.js -[scheduledqueryruleslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesListBySubscriptionSample.js -[scheduledqueryrulesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesUpdateSample.js -[tenantactivitylogslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActivityLogsListSample.js -[vminsightsgetonboardingstatussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/javascript/vmInsightsGetOnboardingStatusSample.js -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-monitor?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/monitor/arm-monitor/README.md diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.js deleted file mode 100644 index 5a52f596baa0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.js +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Send test notifications to a set of provided receivers - * - * @summary Send test notifications to a set of provided receivers - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtActionGroupResourceLevel.json - */ -async function createNotificationsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "11111111-1111-1111-1111-111111111111"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "TestRgName"; - const actionGroupName = "TestAgName"; - const notificationRequest = { - alertType: "budget", - armRoleReceivers: [ - { - name: "ArmRole-Common", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: true, - }, - { - name: "ArmRole-nonCommon", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: false, - }, - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "http://test.me", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084", - }, - ], - azureAppPushReceivers: [{ name: "Sample azureAppPush", emailAddress: "johndoe@email.com" }], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true, - }, - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false, - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true, - }, - ], - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - }, - ], - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c", - }, - ], - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false, - }, - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890", - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321", - }, - ], - voiceReceivers: [{ name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" }], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true, - }, - { - name: "Sample webhook 2", - identifierUri: "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true, - }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = - await client.actionGroups.beginCreateNotificationsAtActionGroupResourceLevelAndWait( - resourceGroupName, - actionGroupName, - notificationRequest - ); - console.log(result); -} - -async function main() { - createNotificationsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateNotificationsAtResourceGroupLevelSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateNotificationsAtResourceGroupLevelSample.js deleted file mode 100644 index 992bd6331cb6..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateNotificationsAtResourceGroupLevelSample.js +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Send test notifications to a set of provided receivers - * - * @summary Send test notifications to a set of provided receivers - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtResourceGroupLevel.json - */ -async function createNotificationsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Default-TestNotifications"; - const notificationRequest = { - alertType: "budget", - armRoleReceivers: [ - { - name: "ArmRole-Common", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: true, - }, - { - name: "ArmRole-nonCommon", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: false, - }, - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "http://test.me", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084", - }, - ], - azureAppPushReceivers: [{ name: "Sample azureAppPush", emailAddress: "johndoe@email.com" }], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true, - }, - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false, - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true, - }, - ], - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - }, - ], - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c", - }, - ], - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false, - }, - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890", - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321", - }, - ], - voiceReceivers: [{ name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" }], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true, - }, - { - name: "Sample webhook 2", - identifierUri: "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true, - }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.beginCreateNotificationsAtResourceGroupLevelAndWait( - resourceGroupName, - notificationRequest - ); - console.log(result); -} - -async function main() { - createNotificationsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateOrUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateOrUpdateSample.js deleted file mode 100644 index a68ac594d015..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsCreateOrUpdateSample.js +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create a new action group or update an existing one. - * - * @summary Create a new action group or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/createOrUpdateActionGroup.json - */ -async function createOrUpdateAnActionGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const actionGroup = { - armRoleReceivers: [ - { - name: "Sample armRole", - roleId: "8e3af657-a8ff-443c-a75c-2fe8c4bcb635", - useCommonAlertSchema: true, - }, - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084", - }, - ], - azureAppPushReceivers: [{ name: "Sample azureAppPush", emailAddress: "johndoe@email.com" }], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true, - }, - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false, - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true, - }, - ], - enabled: true, - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - }, - ], - groupShortName: "sample", - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c", - }, - ], - location: "Global", - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false, - }, - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890", - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321", - }, - ], - tags: {}, - voiceReceivers: [{ name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" }], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true, - }, - { - name: "Sample webhook 2", - identifierUri: "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true, - }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.createOrUpdate( - resourceGroupName, - actionGroupName, - actionGroup - ); - console.log(result); -} - -async function main() { - createOrUpdateAnActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsDeleteSample.js deleted file mode 100644 index 7050154bbdf0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsDeleteSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Delete an action group. - * - * @summary Delete an action group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/deleteActionGroup.json - */ -async function deleteAnActionGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.delete(resourceGroupName, actionGroupName); - console.log(result); -} - -async function main() { - deleteAnActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsEnableReceiverSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsEnableReceiverSample.js deleted file mode 100644 index 880102065bb6..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsEnableReceiverSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation is only supported for Email or SMS receivers. - * - * @summary Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation is only supported for Email or SMS receivers. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/enableReceiver.json - */ -async function enableTheReceiver() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const enableRequest = { receiverName: "John Doe's mobile" }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.enableReceiver( - resourceGroupName, - actionGroupName, - enableRequest - ); - console.log(result); -} - -async function main() { - enableTheReceiver(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetSample.js deleted file mode 100644 index 93291912836d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get an action group. - * - * @summary Get an action group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getActionGroup.json - */ -async function getAnActionGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.get(resourceGroupName, actionGroupName); - console.log(result); -} - -async function main() { - getAnActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.js deleted file mode 100644 index 662e75a83b77..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get the test notifications by the notification id - * - * @summary Get the test notifications by the notification id - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtActionGroupResourceLevel.json - */ -async function getNotificationDetailsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "11111111-1111-1111-1111-111111111111"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "TestRgName"; - const actionGroupName = "TestAgName"; - const notificationId = "11000222191287"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.getTestNotificationsAtActionGroupResourceLevel( - resourceGroupName, - actionGroupName, - notificationId - ); - console.log(result); -} - -async function main() { - getNotificationDetailsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.js deleted file mode 100644 index 79dd880f282a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get the test notifications by the notification id - * - * @summary Get the test notifications by the notification id - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtResourceGroupLevel.json - */ -async function getNotificationDetailsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Default-TestNotifications"; - const notificationId = "11000222191287"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.getTestNotificationsAtResourceGroupLevel( - resourceGroupName, - notificationId - ); - console.log(result); -} - -async function main() { - getNotificationDetailsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsSample.js deleted file mode 100644 index 0e15f0c99d7c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsGetTestNotificationsSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get the test notifications by the notification id - * - * @summary Get the test notifications by the notification id - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotifications.json - */ -async function getNotificationDetailsAtSubscriptionLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const notificationId = "11000222191287"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.getTestNotifications(notificationId); - console.log(result); -} - -async function main() { - getNotificationDetailsAtSubscriptionLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsListByResourceGroupSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsListByResourceGroupSample.js deleted file mode 100644 index c9e459c348ca..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a list of all action groups in a resource group. - * - * @summary Get a list of all action groups in a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json - */ -async function listActionGroupsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.actionGroups.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listActionGroupsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsListBySubscriptionIdSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsListBySubscriptionIdSample.js deleted file mode 100644 index 4086184a645d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsListBySubscriptionIdSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a list of all action groups in a subscription. - * - * @summary Get a list of all action groups in a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json - */ -async function listActionGroupsAtSubscriptionLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.actionGroups.listBySubscriptionId()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listActionGroupsAtSubscriptionLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsPostTestNotificationsSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsPostTestNotificationsSample.js deleted file mode 100644 index a8301d68eff0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsPostTestNotificationsSample.js +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Send test notifications to a set of provided receivers - * - * @summary Send test notifications to a set of provided receivers - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotifications.json - */ -async function createNotificationsAtSubscriptionLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const notificationRequest = { - alertType: "budget", - armRoleReceivers: [ - { - name: "ArmRole-Common", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: true, - }, - { - name: "ArmRole-nonCommon", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: false, - }, - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "http://test.me", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084", - }, - ], - azureAppPushReceivers: [{ name: "Sample azureAppPush", emailAddress: "johndoe@email.com" }], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true, - }, - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false, - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true, - }, - ], - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - }, - ], - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c", - }, - ], - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false, - }, - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890", - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321", - }, - ], - voiceReceivers: [{ name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" }], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true, - }, - { - name: "Sample webhook 2", - identifierUri: "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true, - }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.beginPostTestNotificationsAndWait(notificationRequest); - console.log(result); -} - -async function main() { - createNotificationsAtSubscriptionLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsUpdateSample.js deleted file mode 100644 index bca93894e7bd..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/actionGroupsUpdateSample.js +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/patchActionGroup.json - */ -async function patchAnActionGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const actionGroupPatch = { - enabled: false, - tags: { key1: "value1", key2: "value2" }, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.update( - resourceGroupName, - actionGroupName, - actionGroupPatch - ); - console.log(result); -} - -async function main() { - patchAnActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsCreateOrUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsCreateOrUpdateSample.js deleted file mode 100644 index 75b001a678b6..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsCreateOrUpdateSample.js +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create a new Activity Log Alert rule or update an existing one. - * - * @summary Create a new Activity Log Alert rule or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_CreateOrUpdate.json - */ -async function createOrUpdateAnActivityLogAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRule"; - const activityLogAlertRule = { - description: "Description of sample Activity Log Alert rule.", - actions: { - actionGroups: [ - { - actionGroupId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup", - webhookProperties: { sampleWebhookProperty: "SamplePropertyValue" }, - }, - ], - }, - condition: { - allOf: [ - { equals: "Administrative", field: "category" }, - { equals: "Error", field: "level" }, - ], - }, - enabled: true, - location: "Global", - scopes: ["/subscriptions/187f412d-1758-44d9-b052-169e2564721d"], - tags: {}, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.createOrUpdate( - resourceGroupName, - activityLogAlertName, - activityLogAlertRule - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a new Activity Log Alert rule or update an existing one. - * - * @summary Create a new Activity Log Alert rule or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_CreateOrUpdateRuleWithAnyOfCondition.json - */ -async function createOrUpdateAnActivityLogAlertRuleWithAnyOfCondition() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRuleWithAnyOfCondition"; - const activityLogAlertRule = { - description: "Description of sample Activity Log Alert rule with 'anyOf' condition.", - actions: { - actionGroups: [ - { - actionGroupId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup", - webhookProperties: { sampleWebhookProperty: "SamplePropertyValue" }, - }, - ], - }, - condition: { - allOf: [ - { equals: "ServiceHealth", field: "category" }, - { - anyOf: [ - { equals: "Incident", field: "properties.incidentType" }, - { equals: "Maintenance", field: "properties.incidentType" }, - ], - }, - ], - }, - enabled: true, - location: "Global", - scopes: ["subscriptions/187f412d-1758-44d9-b052-169e2564721d"], - tags: {}, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.createOrUpdate( - resourceGroupName, - activityLogAlertName, - activityLogAlertRule - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a new Activity Log Alert rule or update an existing one. - * - * @summary Create a new Activity Log Alert rule or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_CreateOrUpdateRuleWithContainsAny.json - */ -async function createOrUpdateAnActivityLogAlertRuleWithContainsAny() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRuleWithContainsAny"; - const activityLogAlertRule = { - description: "Description of sample Activity Log Alert rule with 'containsAny'.", - actions: { - actionGroups: [ - { - actionGroupId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup", - webhookProperties: { sampleWebhookProperty: "SamplePropertyValue" }, - }, - ], - }, - condition: { - allOf: [ - { equals: "ServiceHealth", field: "category" }, - { - containsAny: ["North Europe", "West Europe"], - field: "properties.impactedServices[*].ImpactedRegions[*].RegionName", - }, - ], - }, - enabled: true, - location: "Global", - scopes: ["subscriptions/187f412d-1758-44d9-b052-169e2564721d"], - tags: {}, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.createOrUpdate( - resourceGroupName, - activityLogAlertName, - activityLogAlertRule - ); - console.log(result); -} - -async function main() { - createOrUpdateAnActivityLogAlertRule(); - createOrUpdateAnActivityLogAlertRuleWithAnyOfCondition(); - createOrUpdateAnActivityLogAlertRuleWithContainsAny(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsDeleteSample.js deleted file mode 100644 index 0006ad81aeab..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsDeleteSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Delete an Activity Log Alert rule. - * - * @summary Delete an Activity Log Alert rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Delete.json - */ -async function deleteAnActivityLogAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.delete(resourceGroupName, activityLogAlertName); - console.log(result); -} - -async function main() { - deleteAnActivityLogAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsGetSample.js deleted file mode 100644 index e2c065808c39..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get an Activity Log Alert rule. - * - * @summary Get an Activity Log Alert rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Get.json - */ -async function getAnActivityLogAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.get(resourceGroupName, activityLogAlertName); - console.log(result); -} - -async function main() { - getAnActivityLogAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsListByResourceGroupSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsListByResourceGroupSample.js deleted file mode 100644 index c79f88066689..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a list of all Activity Log Alert rules in a resource group. - * - * @summary Get a list of all Activity Log Alert rules in a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_ListByResourceGroupName.json - */ -async function listActivityLogAlerts() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.activityLogAlerts.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listActivityLogAlerts(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsListBySubscriptionIdSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsListBySubscriptionIdSample.js deleted file mode 100644 index 88aa27771f6e..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsListBySubscriptionIdSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a list of all Activity Log Alert rules in a subscription. - * - * @summary Get a list of all Activity Log Alert rules in a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_ListBySubscriptionId.json - */ -async function getListOfAllActivityLogAlertRulesUnderASubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.activityLogAlerts.listBySubscriptionId()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getListOfAllActivityLogAlertRulesUnderASubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsUpdateSample.js deleted file mode 100644 index 3cc897148665..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogAlertsUpdateSample.js +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. - * - * @summary Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Update.json - */ -async function patchAnActivityLogAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRule"; - const activityLogAlertRulePatch = { - enabled: false, - tags: { key1: "value1", key2: "value2" }, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.update( - resourceGroupName, - activityLogAlertName, - activityLogAlertRulePatch - ); - console.log(result); -} - -async function main() { - patchAnActivityLogAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogsListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogsListSample.js deleted file mode 100644 index 25c6022d9e77..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/activityLogsListSample.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Provides the list of records from the activity logs. - * - * @summary Provides the list of records from the activity logs. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetActivityLogsFiltered.json - */ -async function getActivityLogsWithFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "089bd33f-d4ec-47fe-8ba5-0753aa5c5b33"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.activityLogs.list(filter)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Provides the list of records from the activity logs. - * - * @summary Provides the list of records from the activity logs. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetActivityLogsFilteredAndSelected.json - */ -async function getActivityLogsWithFilterAndSelect() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "089bd33f-d4ec-47fe-8ba5-0753aa5c5b33"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const select = - "eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level"; - const options = { select }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.activityLogs.list(filter, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getActivityLogsWithFilter(); - getActivityLogsWithFilterAndSelect(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRuleIncidentsGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRuleIncidentsGetSample.js deleted file mode 100644 index 27878c579b1b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRuleIncidentsGetSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets an incident associated to an alert rule - * - * @summary Gets an incident associated to an alert rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getAlertRuleIncident.json - */ -async function getASingleAlertRuleIncident() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "myRuleName"; - const incidentName = "Website_started"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRuleIncidents.get(resourceGroupName, ruleName, incidentName); - console.log(result); -} - -async function main() { - getASingleAlertRuleIncident(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRuleIncidentsListByAlertRuleSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRuleIncidentsListByAlertRuleSample.js deleted file mode 100644 index 998d1a36e388..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRuleIncidentsListByAlertRuleSample.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a list of incidents associated to an alert rule - * - * @summary Gets a list of incidents associated to an alert rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRuleIncidents.json - */ -async function listAlertRuleIncidents() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "myRuleName"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.alertRuleIncidents.listByAlertRule(resourceGroupName, ruleName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAlertRuleIncidents(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesCreateOrUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesCreateOrUpdateSample.js deleted file mode 100644 index cff5b1937bbf..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesCreateOrUpdateSample.js +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates or updates a classic metric alert rule. - * - * @summary Creates or updates a classic metric alert rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/createOrUpdateAlertRule.json - */ -async function createOrUpdateAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "chiricutin"; - const parameters = { - namePropertiesName: "chiricutin", - description: "Pura Vida", - actions: [], - condition: { - dataSource: { - metricName: "Requests", - odataType: "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource", - resourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest", - }, - odataType: "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition", - operator: "GreaterThan", - threshold: 3, - timeAggregation: "Total", - windowSize: "PT5M", - }, - isEnabled: true, - location: "West US", - tags: {}, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRules.createOrUpdate(resourceGroupName, ruleName, parameters); - console.log(result); -} - -async function main() { - createOrUpdateAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesDeleteSample.js deleted file mode 100644 index 86473357c892..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesDeleteSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a classic metric alert rule - * - * @summary Deletes a classic metric alert rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteAlertRule.json - */ -async function deleteAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRules.delete(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - deleteAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesGetSample.js deleted file mode 100644 index 286f6d1533cc..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a classic metric alert rule - * - * @summary Gets a classic metric alert rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getAlertRule.json - */ -async function getAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRules.get(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - getAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesListByResourceGroupSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesListByResourceGroupSample.js deleted file mode 100644 index 9cd4c2966d03..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List the classic metric alert rules within a resource group. - * - * @summary List the classic metric alert rules within a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRule.json - */ -async function listAlertRules() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.alertRules.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAlertRules(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesListBySubscriptionSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesListBySubscriptionSample.js deleted file mode 100644 index b3d78051e5e8..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesListBySubscriptionSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List the classic metric alert rules within a subscription. - * - * @summary List the classic metric alert rules within a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRuleBySubscription.json - */ -async function listAlertRules() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.alertRules.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAlertRules(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesUpdateSample.js deleted file mode 100644 index 083f758ac6db..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/alertRulesUpdateSample.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/patchAlertRule.json - */ -async function patchAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "chiricutin"; - const alertRulesResource = { - name: "chiricutin", - description: "Pura Vida", - actions: [], - condition: { - dataSource: { - metricName: "Requests", - odataType: "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource", - resourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest", - }, - odataType: "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition", - operator: "GreaterThan", - threshold: 3, - timeAggregation: "Total", - windowSize: "PT5M", - }, - isEnabled: true, - tags: { - $type: "Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRules.update(resourceGroupName, ruleName, alertRulesResource); - console.log(result); -} - -async function main() { - patchAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsCreateOrUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsCreateOrUpdateSample.js deleted file mode 100644 index 966be13fce90..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsCreateOrUpdateSample.js +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates or updates an autoscale setting. - * - * @summary Creates or updates an autoscale setting. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/createOrUpdateAutoscaleSetting.json - */ -async function createOrUpdateAnAutoscaleSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const autoscaleSettingName = "MySetting"; - const parameters = { - enabled: true, - location: "West US", - notifications: [ - { - email: { - customEmails: ["gu@ms.com", "ge@ns.net"], - sendToSubscriptionAdministrator: true, - sendToSubscriptionCoAdministrators: true, - }, - operation: "Scale", - webhooks: [{ properties: {}, serviceUri: "http://myservice.com" }], - }, - ], - predictiveAutoscalePolicy: { scaleMode: "Enabled" }, - profiles: [ - { - name: "adios", - capacity: { default: "1", maximum: "10", minimum: "1" }, - fixedDate: { - end: new Date("2015-03-05T14:30:00Z"), - start: new Date("2015-03-05T14:00:00Z"), - timeZone: "UTC", - }, - rules: [ - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 10, - timeAggregation: "Average", - timeGrain: "PT1M", - timeWindow: "PT5M", - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT5M", - direction: "Increase", - value: "1", - }, - }, - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 15, - timeAggregation: "Average", - timeGrain: "PT2M", - timeWindow: "PT5M", - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT6M", - direction: "Decrease", - value: "2", - }, - }, - ], - }, - { - name: "saludos", - capacity: { default: "1", maximum: "10", minimum: "1" }, - recurrence: { - frequency: "Week", - schedule: { days: ["1"], hours: [5], minutes: [15], timeZone: "UTC" }, - }, - rules: [ - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 10, - timeAggregation: "Average", - timeGrain: "PT1M", - timeWindow: "PT5M", - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT5M", - direction: "Increase", - value: "1", - }, - }, - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 15, - timeAggregation: "Average", - timeGrain: "PT2M", - timeWindow: "PT5M", - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT6M", - direction: "Decrease", - value: "2", - }, - }, - ], - }, - ], - tags: { key1: "value1", key2: "value2" }, - targetResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.autoscaleSettings.createOrUpdate( - resourceGroupName, - autoscaleSettingName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateAnAutoscaleSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsDeleteSample.js deleted file mode 100644 index 851e06221fb8..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsDeleteSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes and autoscale setting - * - * @summary Deletes and autoscale setting - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/deleteAutoscaleSetting.json - */ -async function deleteAnAutoscaleSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const autoscaleSettingName = "MySetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.autoscaleSettings.delete(resourceGroupName, autoscaleSettingName); - console.log(result); -} - -async function main() { - deleteAnAutoscaleSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsGetSample.js deleted file mode 100644 index a401a3786e53..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets an autoscale setting - * - * @summary Gets an autoscale setting - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/getAutoscaleSetting.json - */ -async function getAnAutoscaleSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const autoscaleSettingName = "MySetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.autoscaleSettings.get(resourceGroupName, autoscaleSettingName); - console.log(result); -} - -async function main() { - getAnAutoscaleSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsListByResourceGroupSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsListByResourceGroupSample.js deleted file mode 100644 index 0cab2c2f0e83..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists the autoscale settings for a resource group - * - * @summary Lists the autoscale settings for a resource group - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/listAutoscaleSetting.json - */ -async function listAutoscaleSettings() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.autoscaleSettings.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAutoscaleSettings(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsListBySubscriptionSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsListBySubscriptionSample.js deleted file mode 100644 index 22063de883c5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsListBySubscriptionSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists the autoscale settings for a subscription - * - * @summary Lists the autoscale settings for a subscription - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/listAutoscaleSettingBySubscription.json - */ -async function listAutoscaleSettingsBySubs() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.autoscaleSettings.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAutoscaleSettingsBySubs(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsUpdateSample.js deleted file mode 100644 index 1b33cd3aee5a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/autoscaleSettingsUpdateSample.js +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/patchAutoscaleSetting.json - */ -async function patchAnAutoscaleSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const autoscaleSettingName = "MySetting"; - const autoscaleSettingResource = { - enabled: true, - notifications: [ - { - email: { - customEmails: ["gu@ms.com", "ge@ns.net"], - sendToSubscriptionAdministrator: true, - sendToSubscriptionCoAdministrators: true, - }, - operation: "Scale", - webhooks: [{ properties: {}, serviceUri: "http://myservice.com" }], - }, - ], - predictiveAutoscalePolicy: { scaleMode: "Enabled" }, - profiles: [ - { - name: "adios", - capacity: { default: "1", maximum: "10", minimum: "1" }, - fixedDate: { - end: new Date("2015-03-05T14:30:00Z"), - start: new Date("2015-03-05T14:00:00Z"), - timeZone: "UTC", - }, - rules: [ - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 10, - timeAggregation: "Average", - timeGrain: "PT1M", - timeWindow: "PT5M", - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT5M", - direction: "Increase", - value: "1", - }, - }, - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 15, - timeAggregation: "Average", - timeGrain: "PT2M", - timeWindow: "PT5M", - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT6M", - direction: "Decrease", - value: "2", - }, - }, - ], - }, - { - name: "saludos", - capacity: { default: "1", maximum: "10", minimum: "1" }, - recurrence: { - frequency: "Week", - schedule: { days: ["1"], hours: [5], minutes: [15], timeZone: "UTC" }, - }, - rules: [ - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 10, - timeAggregation: "Average", - timeGrain: "PT1M", - timeWindow: "PT5M", - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT5M", - direction: "Increase", - value: "1", - }, - }, - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 15, - timeAggregation: "Average", - timeGrain: "PT2M", - timeWindow: "PT5M", - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT6M", - direction: "Decrease", - value: "2", - }, - }, - ], - }, - ], - tags: { key1: "value1" }, - targetResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.autoscaleSettings.update( - resourceGroupName, - autoscaleSettingName, - autoscaleSettingResource - ); - console.log(result); -} - -async function main() { - patchAnAutoscaleSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesCreateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesCreateSample.js deleted file mode 100644 index 6ccbaf2fc0b0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesCreateSample.js +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create or update a workspace - * - * @summary Create or update a workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesCreate.json - */ -async function createOrUpdateWorkspace() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const azureMonitorWorkspaceName = "myAzureMonitorWorkspace"; - const azureMonitorWorkspaceProperties = { - location: "eastus", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.azureMonitorWorkspaces.create( - resourceGroupName, - azureMonitorWorkspaceName, - azureMonitorWorkspaceProperties - ); - console.log(result); -} - -async function main() { - createOrUpdateWorkspace(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesDeleteSample.js deleted file mode 100644 index f2c4c975135a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesDeleteSample.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Delete a workspace - * - * @summary Delete a workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesDelete.json - */ -async function deleteWorkspace() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const azureMonitorWorkspaceName = "myAzureMonitorWorkspace"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.azureMonitorWorkspaces.delete( - resourceGroupName, - azureMonitorWorkspaceName - ); - console.log(result); -} - -async function main() { - deleteWorkspace(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesGetSample.js deleted file mode 100644 index 4c02337ca6eb..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesGetSample.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Returns the specific Azure Monitor workspace - * - * @summary Returns the specific Azure Monitor workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesGet.json - */ -async function getWorkspace() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const azureMonitorWorkspaceName = "myAzureMonitorWorkspace"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.azureMonitorWorkspaces.get( - resourceGroupName, - azureMonitorWorkspaceName - ); - console.log(result); -} - -async function main() { - getWorkspace(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesListByResourceGroupSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesListByResourceGroupSample.js deleted file mode 100644 index 15f6de20ae33..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all workspaces in the specified resource group - * - * @summary Lists all workspaces in the specified resource group - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesListByResourceGroup.json - */ -async function listMonitorWorkspacesByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.azureMonitorWorkspaces.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listMonitorWorkspacesByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesListBySubscriptionSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesListBySubscriptionSample.js deleted file mode 100644 index cab701fb9827..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesListBySubscriptionSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all workspaces in the specified subscription - * - * @summary Lists all workspaces in the specified subscription - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesListBySubscription.json - */ -async function listWorkspacesBySubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.azureMonitorWorkspaces.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listWorkspacesBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesUpdateSample.js deleted file mode 100644 index c11397f1c433..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/azureMonitorWorkspacesUpdateSample.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates part of a workspace - * - * @summary Updates part of a workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesUpdate.json - */ -async function updateWorkspace() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const azureMonitorWorkspaceName = "myAzureMonitorWorkspace"; - const azureMonitorWorkspaceProperties = { - tags: { tag1: "A", tag2: "B", tag3: "C" }, - }; - const options = { - azureMonitorWorkspaceProperties, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.azureMonitorWorkspaces.update( - resourceGroupName, - azureMonitorWorkspaceName, - options - ); - console.log(result); -} - -async function main() { - updateWorkspace(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/baselinesListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/baselinesListSample.js deleted file mode 100644 index 25a1d22f7f6d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/baselinesListSample.js +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to **Lists the metric baseline values for a resource**. - * - * @summary **Lists the metric baseline values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2019-03-01/examples/metricBaselines.json - */ -async function getMetricBaselines() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1"; - const timespan = "2019-03-12T11:00:00.000Z/2019-03-12T12:00:00.000Z"; - const interval = "PT1H"; - const aggregation = "average"; - const sensitivities = "Low,Medium"; - const options = { - timespan, - interval, - aggregation, - sensitivities, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.baselines.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getMetricBaselines(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsCreateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsCreateSample.js deleted file mode 100644 index 685c3cbc4d21..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsCreateSample.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates or updates a data collection endpoint. - * - * @summary Creates or updates a data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsCreate.json - */ -async function createOrUpdateDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myCollectionEndpoint"; - const body = { - location: "eastus", - networkAcls: { publicNetworkAccess: "Enabled" }, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionEndpoints.create( - resourceGroupName, - dataCollectionEndpointName, - options - ); - console.log(result); -} - -async function main() { - createOrUpdateDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsDeleteSample.js deleted file mode 100644 index b77db1b10795..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsDeleteSample.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a data collection endpoint. - * - * @summary Deletes a data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsDelete.json - */ -async function deleteDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myCollectionEndpoint"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionEndpoints.delete( - resourceGroupName, - dataCollectionEndpointName - ); - console.log(result); -} - -async function main() { - deleteDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsGetSample.js deleted file mode 100644 index 0641017adb1b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsGetSample.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Returns the specified data collection endpoint. - * - * @summary Returns the specified data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsGet.json - */ -async function getDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myCollectionEndpoint"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionEndpoints.get( - resourceGroupName, - dataCollectionEndpointName - ); - console.log(result); -} - -async function main() { - getDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsListByResourceGroupSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsListByResourceGroupSample.js deleted file mode 100644 index eaf0afdf4fbb..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all data collection endpoints in the specified resource group. - * - * @summary Lists all data collection endpoints in the specified resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListByResourceGroup.json - */ -async function listDataCollectionEndpointsByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionEndpoints.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDataCollectionEndpointsByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsListBySubscriptionSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsListBySubscriptionSample.js deleted file mode 100644 index e53b5d2310e3..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsListBySubscriptionSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all data collection endpoints in the specified subscription - * - * @summary Lists all data collection endpoints in the specified subscription - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListBySubscription.json - */ -async function listDataCollectionEndpointsBySubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionEndpoints.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDataCollectionEndpointsBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsUpdateSample.js deleted file mode 100644 index d7eea337ea7f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionEndpointsUpdateSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates part of a data collection endpoint. - * - * @summary Updates part of a data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsUpdate.json - */ -async function updateDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myCollectionEndpoint"; - const body = { tags: { tag1: "A", tag2: "B", tag3: "C" } }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionEndpoints.update( - resourceGroupName, - dataCollectionEndpointName, - options - ); - console.log(result); -} - -async function main() { - updateDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsCreateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsCreateSample.js deleted file mode 100644 index a2b198184204..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsCreateSample.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates or updates an association. - * - * @summary Creates or updates an association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsCreate.json - */ -async function createOrUpdateAssociation() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const associationName = "myAssociation"; - const body = { - dataCollectionRuleId: - "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule", - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRuleAssociations.create( - resourceUri, - associationName, - options - ); - console.log(result); -} - -async function main() { - createOrUpdateAssociation(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsDeleteSample.js deleted file mode 100644 index f73ee007dfc0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsDeleteSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes an association. - * - * @summary Deletes an association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsDelete.json - */ -async function deleteAssociation() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const associationName = "myAssociation"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRuleAssociations.delete(resourceUri, associationName); - console.log(result); -} - -async function main() { - deleteAssociation(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsGetSample.js deleted file mode 100644 index d81af97194cf..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsGetSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Returns the specified association. - * - * @summary Returns the specified association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsGet.json - */ -async function getAssociation() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const associationName = "myAssociation"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRuleAssociations.get(resourceUri, associationName); - console.log(result); -} - -async function main() { - getAssociation(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.js deleted file mode 100644 index d8f9017cd175..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists associations for the specified data collection endpoint. - * - * @summary Lists associations for the specified data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByDataCollectionEndpoint.json - */ -async function listAssociationsForSpecifiedDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myDataCollectionEndpointName"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRuleAssociations.listByDataCollectionEndpoint( - resourceGroupName, - dataCollectionEndpointName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAssociationsForSpecifiedDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByResourceSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByResourceSample.js deleted file mode 100644 index d86b92317542..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByResourceSample.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists associations for the specified resource. - * - * @summary Lists associations for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByResource.json - */ -async function listAssociationsForSpecifiedResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRuleAssociations.listByResource(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAssociationsForSpecifiedResource(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByRuleSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByRuleSample.js deleted file mode 100644 index c630ec190d02..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRuleAssociationsListByRuleSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists associations for the specified data collection rule. - * - * @summary Lists associations for the specified data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByRule.json - */ -async function listAssociationsForSpecifiedDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRuleAssociations.listByRule( - resourceGroupName, - dataCollectionRuleName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAssociationsForSpecifiedDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesCreateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesCreateSample.js deleted file mode 100644 index 5df61b374364..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesCreateSample.js +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates or updates a data collection rule. - * - * @summary Creates or updates a data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesCreate.json - */ -async function createOrUpdateDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const body = { - dataFlows: [ - { - destinations: ["centralWorkspace"], - streams: ["Microsoft-Perf", "Microsoft-Syslog", "Microsoft-WindowsEvent"], - }, - ], - dataSources: { - performanceCounters: [ - { - name: "cloudTeamCoreCounters", - counterSpecifiers: [ - "\\Processor(_Total)\\% Processor Time", - "\\Memory\\Committed Bytes", - "\\LogicalDisk(_Total)\\Free Megabytes", - "\\PhysicalDisk(_Total)\\Avg. Disk Queue Length", - ], - samplingFrequencyInSeconds: 15, - streams: ["Microsoft-Perf"], - }, - { - name: "appTeamExtraCounters", - counterSpecifiers: ["\\Process(_Total)\\Thread Count"], - samplingFrequencyInSeconds: 30, - streams: ["Microsoft-Perf"], - }, - ], - syslog: [ - { - name: "cronSyslog", - facilityNames: ["cron"], - logLevels: ["Debug", "Critical", "Emergency"], - streams: ["Microsoft-Syslog"], - }, - { - name: "syslogBase", - facilityNames: ["syslog"], - logLevels: ["Alert", "Critical", "Emergency"], - streams: ["Microsoft-Syslog"], - }, - ], - windowsEventLogs: [ - { - name: "cloudSecurityTeamEvents", - streams: ["Microsoft-WindowsEvent"], - xPathQueries: ["Security!"], - }, - { - name: "appTeam1AppEvents", - streams: ["Microsoft-WindowsEvent"], - xPathQueries: [ - "System![System[(Level = 1 or Level = 2 or Level = 3)]]", - "Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]", - ], - }, - ], - }, - destinations: { - logAnalytics: [ - { - name: "centralWorkspace", - workspaceResourceId: - "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/centralTeamWorkspace", - }, - ], - }, - location: "eastus", - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRules.create( - resourceGroupName, - dataCollectionRuleName, - options - ); - console.log(result); -} - -async function main() { - createOrUpdateDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesDeleteSample.js deleted file mode 100644 index fb6b05bd317c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesDeleteSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a data collection rule. - * - * @summary Deletes a data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesDelete.json - */ -async function deleteDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRules.delete(resourceGroupName, dataCollectionRuleName); - console.log(result); -} - -async function main() { - deleteDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesGetSample.js deleted file mode 100644 index 134660caeb4f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Returns the specified data collection rule. - * - * @summary Returns the specified data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesGet.json - */ -async function getDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRules.get(resourceGroupName, dataCollectionRuleName); - console.log(result); -} - -async function main() { - getDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesListByResourceGroupSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesListByResourceGroupSample.js deleted file mode 100644 index b34207695013..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all data collection rules in the specified resource group. - * - * @summary Lists all data collection rules in the specified resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListByResourceGroup.json - */ -async function listDataCollectionRulesByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRules.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDataCollectionRulesByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesListBySubscriptionSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesListBySubscriptionSample.js deleted file mode 100644 index 486b8a7f2e7e..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesListBySubscriptionSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all data collection rules in the specified subscription. - * - * @summary Lists all data collection rules in the specified subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListBySubscription.json - */ -async function listDataCollectionRulesBySubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRules.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDataCollectionRulesBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesUpdateSample.js deleted file mode 100644 index ac743821267d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/dataCollectionRulesUpdateSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates part of a data collection rule. - * - * @summary Updates part of a data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesUpdate.json - */ -async function updateDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const body = { tags: { tag1: "A", tag2: "B", tag3: "C" } }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRules.update( - resourceGroupName, - dataCollectionRuleName, - options - ); - console.log(result); -} - -async function main() { - updateDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCategoryGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCategoryGetSample.js deleted file mode 100644 index 8065784f4508..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCategoryGetSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets the diagnostic settings category for the specified resource. - * - * @summary Gets the diagnostic settings category for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingsCategory.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "WorkflowRuntime"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettingsCategory.get(resourceUri, name); - console.log(result); -} - -async function main() { - getsTheDiagnosticSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCategoryListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCategoryListSample.js deleted file mode 100644 index d84db57d6349..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCategoryListSample.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists the diagnostic settings categories for the specified resource. - * - * @summary Lists the diagnostic settings categories for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettingsCategories.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.diagnosticSettingsCategory.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getsTheDiagnosticSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCreateOrUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCreateOrUpdateSample.js deleted file mode 100644 index 53ea6c13e1b3..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsCreateOrUpdateSample.js +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates or updates diagnostic settings for the specified resource. - * - * @summary Creates or updates diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateDiagnosticSetting.json - */ -async function createsOrUpdatesTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const parameters = { - eventHubAuthorizationRuleId: - "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule", - eventHubName: "myeventhub", - logAnalyticsDestinationType: "Dedicated", - logs: [ - { - categoryGroup: "allLogs", - enabled: true, - retentionPolicy: { days: 0, enabled: false }, - }, - ], - marketplacePartnerId: - "/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1", - metrics: [ - { - category: "WorkflowMetrics", - enabled: true, - retentionPolicy: { days: 0, enabled: false }, - }, - ], - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1", - workspaceId: "", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.createOrUpdate(resourceUri, name, parameters); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates diagnostic settings for the specified resource. - * - * @summary Creates or updates diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateDiagnosticSettingCategory.json - */ -async function createsOrUpdatesTheDiagnosticSettingForCategory() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const parameters = { - eventHubAuthorizationRuleId: - "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule", - eventHubName: "myeventhub", - logAnalyticsDestinationType: "Dedicated", - logs: [ - { - category: "WorkflowRuntime", - enabled: true, - retentionPolicy: { days: 0, enabled: false }, - }, - ], - marketplacePartnerId: - "/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1", - metrics: [ - { - category: "WorkflowMetrics", - enabled: true, - retentionPolicy: { days: 0, enabled: false }, - }, - ], - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1", - workspaceId: "", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.createOrUpdate(resourceUri, name, parameters); - console.log(result); -} - -async function main() { - createsOrUpdatesTheDiagnosticSetting(); - createsOrUpdatesTheDiagnosticSettingForCategory(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsDeleteSample.js deleted file mode 100644 index dbb827119fbf..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsDeleteSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes existing diagnostic settings for the specified resource. - * - * @summary Deletes existing diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/deleteDiagnosticSetting.json - */ -async function deletesTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.delete(resourceUri, name); - console.log(result); -} - -async function main() { - deletesTheDiagnosticSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsGetSample.js deleted file mode 100644 index dc2e6a87f1c9..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsGetSample.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets the active diagnostic settings for the specified resource. - * - * @summary Gets the active diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSetting.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.get(resourceUri, name); - console.log(result); -} - -/** - * This sample demonstrates how to Gets the active diagnostic settings for the specified resource. - * - * @summary Gets the active diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingCategory.json - */ -async function getsTheDiagnosticSettingForCategory() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.get(resourceUri, name); - console.log(result); -} - -async function main() { - getsTheDiagnosticSetting(); - getsTheDiagnosticSettingForCategory(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsListSample.js deleted file mode 100644 index 363dc3eb43dc..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/diagnosticSettingsListSample.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets the active diagnostic settings list for the specified resource. - * - * @summary Gets the active diagnostic settings list for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettings.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.diagnosticSettings.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the active diagnostic settings list for the specified resource. - * - * @summary Gets the active diagnostic settings list for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettingsCategory.json - */ -async function getsTheDiagnosticSettingForCategory() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.diagnosticSettings.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getsTheDiagnosticSetting(); - getsTheDiagnosticSettingForCategory(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/eventCategoriesListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/eventCategoriesListSample.js deleted file mode 100644 index eec32d8f4f43..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/eventCategoriesListSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get the list of available event categories supported in the Activity Logs Service.
The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. - * - * @summary Get the list of available event categories supported in the Activity Logs Service.
The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetEventCategories.json - */ -async function getEventCategories() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.eventCategories.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getEventCategories(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesCreateOrUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesCreateOrUpdateSample.js deleted file mode 100644 index da226d6f0f13..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesCreateOrUpdateSample.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create or update a log profile in Azure Monitoring REST API. - * - * @summary Create or update a log profile in Azure Monitoring REST API. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/createOrUpdateLogProfile.json - */ -async function createOrUpdateALogProfile() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "df602c9c-7aa0-407d-a6fb-eb20c8bd1192"; - const logProfileName = "Rac46PostSwapRG"; - const parameters = { - categories: ["Write", "Delete", "Action"], - location: "", - locations: ["global"], - retentionPolicy: { days: 3, enabled: true }, - serviceBusRuleId: "", - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162", - tags: {}, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.logProfiles.createOrUpdate(logProfileName, parameters); - console.log(result); -} - -async function main() { - createOrUpdateALogProfile(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesDeleteSample.js deleted file mode 100644 index 71389d1376de..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesDeleteSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes the log profile. - * - * @summary Deletes the log profile. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteLogProfile.json - */ -async function deleteLogProfile() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const logProfileName = "Rac46PostSwapRG"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.logProfiles.delete(logProfileName); - console.log(result); -} - -async function main() { - deleteLogProfile(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesGetSample.js deleted file mode 100644 index 9e9a7ec58562..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesGetSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets the log profile. - * - * @summary Gets the log profile. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getLogProfile.json - */ -async function getLogProfile() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "df602c9c-7aa0-407d-a6fb-eb20c8bd1192"; - const logProfileName = "default"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.logProfiles.get(logProfileName); - console.log(result); -} - -async function main() { - getLogProfile(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesListSample.js deleted file mode 100644 index b2b9b1ed3472..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesListSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List the log profiles. - * - * @summary List the log profiles. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listLogProfile.json - */ -async function listLogProfiles() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "df602c9c-7aa0-407d-a6fb-eb20c8bd1192"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.logProfiles.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listLogProfiles(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesUpdateSample.js deleted file mode 100644 index 102f0534f03e..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/logProfilesUpdateSample.js +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/patchLogProfile.json - */ -async function patchALogProfile() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "df602c9c-7aa0-407d-a6fb-eb20c8bd1192"; - const logProfileName = "Rac46PostSwapRG"; - const logProfilesResource = { - categories: ["Write", "Delete", "Action"], - locations: ["global"], - retentionPolicy: { days: 3, enabled: true }, - serviceBusRuleId: "", - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162", - tags: { key1: "value1" }, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.logProfiles.update(logProfileName, logProfilesResource); - console.log(result); -} - -async function main() { - patchALogProfile(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsCreateOrUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsCreateOrUpdateSample.js deleted file mode 100644 index 66374555c535..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsCreateOrUpdateSample.js +++ /dev/null @@ -1,454 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateDynamicMetricAlertMultipleResource.json - */ -async function createOrUpdateADynamicAlertRuleForMultipleResources() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleResources"; - const parameters = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" }, - }, - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - alertSensitivity: "Medium", - criterionType: "DynamicThresholdCriterion", - dimensions: [], - failingPeriods: { - minFailingPeriodsToAlert: 4, - numberOfEvaluationPeriods: 4, - }, - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterOrLessThan", - timeAggregation: "Average", - }, - ], - odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria", - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1", - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2", - ], - severity: 3, - tags: {}, - targetResourceRegion: "southcentralus", - targetResourceType: "Microsoft.Compute/virtualMachines", - windowSize: "PT15M", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate(resourceGroupName, ruleName, parameters); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateDynamicMetricAlertSingleResource.json - */ -async function createOrUpdateADynamicAlertRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const parameters = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" }, - }, - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - alertSensitivity: "Medium", - criterionType: "DynamicThresholdCriterion", - dimensions: [], - failingPeriods: { - minFailingPeriodsToAlert: 4, - numberOfEvaluationPeriods: 4, - }, - ignoreDataBefore: new Date("2019-04-04T21:00:00.000Z"), - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterOrLessThan", - timeAggregation: "Average", - }, - ], - odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria", - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme", - ], - severity: 3, - tags: {}, - windowSize: "PT15M", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate(resourceGroupName, ruleName, parameters); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateWebTestMetricAlert.json - */ -async function createOrUpdateAWebTestAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789101"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "rg-example"; - const ruleName = "webtest-name-example"; - const parameters = { - description: 'Automatically created alert rule for availability test "component-example" a', - actions: [], - criteria: { - componentId: - "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example", - failedLocationCount: 2, - odataType: "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria", - webTestId: - "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example", - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example", - "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example", - ], - severity: 4, - tags: { - "hiddenLink:/subscriptions/12345678123412341234123456789101/resourcegroups/rgExample/providers/microsoftInsights/components/webtestNameExample": - "Resource", - "hiddenLink:/subscriptions/12345678123412341234123456789101/resourcegroups/rgExample/providers/microsoftInsights/webtests/componentExample": - "Resource", - }, - windowSize: "PT15M", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate(resourceGroupName, ruleName, parameters); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertMultipleResource.json - */ -async function createOrUpdateAnAlertRuleForMultipleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleResources"; - const parameters = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" }, - }, - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average", - }, - ], - odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria", - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1", - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2", - ], - severity: 3, - tags: {}, - targetResourceRegion: "southcentralus", - targetResourceType: "Microsoft.Compute/virtualMachines", - windowSize: "PT15M", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate(resourceGroupName, ruleName, parameters); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertSingleResource.json - */ -async function createOrUpdateAnAlertRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const parameters = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" }, - }, - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "\\Processor(_Total)\\% Processor Time", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average", - }, - ], - odataType: "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", - }, - enabled: true, - evaluationFrequency: "Pt1m", - location: "global", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme", - ], - severity: 3, - tags: {}, - windowSize: "Pt15m", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate(resourceGroupName, ruleName, parameters); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertResourceGroup.json - */ -async function createOrUpdateAnAlertRuleOnResourceGroupS() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest1"; - const ruleName = "MetricAlertAtResourceGroupLevel"; - const parameters = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" }, - }, - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average", - }, - ], - odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria", - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1", - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest2", - ], - severity: 3, - tags: {}, - targetResourceRegion: "southcentralus", - targetResourceType: "Microsoft.Compute/virtualMachines", - windowSize: "PT15M", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate(resourceGroupName, ruleName, parameters); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertSubscription.json - */ -async function createOrUpdateAnAlertRuleOnSubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertAtSubscriptionLevel"; - const parameters = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" }, - }, - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average", - }, - ], - odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria", - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: ["/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"], - severity: 3, - tags: {}, - targetResourceRegion: "southcentralus", - targetResourceType: "Microsoft.Compute/virtualMachines", - windowSize: "PT15M", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate(resourceGroupName, ruleName, parameters); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertWithDimensions.json - */ -async function createOrUpdateAnAlertRulesWithDimensions() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleDimensions"; - const parameters = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" }, - }, - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "Metric1", - criterionType: "StaticThresholdCriterion", - dimensions: [ - { name: "ActivityName", operator: "Include", values: ["*"] }, - { name: "StatusCode", operator: "Include", values: ["200"] }, - ], - metricName: "Availability", - metricNamespace: "Microsoft.KeyVault/vaults", - operator: "GreaterThan", - threshold: 55, - timeAggregation: "Average", - }, - ], - odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria", - }, - enabled: true, - evaluationFrequency: "PT1H", - location: "global", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.KeyVault/vaults/keyVaultResource", - ], - severity: 3, - tags: {}, - windowSize: "P1D", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate(resourceGroupName, ruleName, parameters); - console.log(result); -} - -async function main() { - createOrUpdateADynamicAlertRuleForMultipleResources(); - createOrUpdateADynamicAlertRuleForSingleResource(); - createOrUpdateAWebTestAlertRule(); - createOrUpdateAnAlertRuleForMultipleResource(); - createOrUpdateAnAlertRuleForSingleResource(); - createOrUpdateAnAlertRuleOnResourceGroupS(); - createOrUpdateAnAlertRuleOnSubscription(); - createOrUpdateAnAlertRulesWithDimensions(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsDeleteSample.js deleted file mode 100644 index af4f20182481..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsDeleteSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Delete an alert rule definition. - * - * @summary Delete an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/deleteMetricAlert.json - */ -async function deleteAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.delete(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - deleteAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsGetSample.js deleted file mode 100644 index 5b1ae950a288..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsGetSample.js +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getDynamicMetricAlertMultipleResource.json - */ -async function getADynamicAlertRuleForMultipleResources() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleResources"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getDynamicMetricAlertSingleResource.json - */ -async function getADynamicAlertRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getWebTestMetricAlert.json - */ -async function getAWebTestAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789101"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "rg-example"; - const ruleName = "webtest-name-example"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertMultipleResource.json - */ -async function getAnAlertRuleForMultipleResources() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleResources"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertSingleResource.json - */ -async function getAnAlertRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertResourceGroup.json - */ -async function getAnAlertRuleOnResourceGroupS() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest1"; - const ruleName = "MetricAlertAtResourceGroupLevel"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertSubscription.json - */ -async function getAnAlertRuleOnSubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertAtSubscriptionLevel"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - getADynamicAlertRuleForMultipleResources(); - getADynamicAlertRuleForSingleResource(); - getAWebTestAlertRule(); - getAnAlertRuleForMultipleResources(); - getAnAlertRuleForSingleResource(); - getAnAlertRuleOnResourceGroupS(); - getAnAlertRuleOnSubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsListByResourceGroupSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsListByResourceGroupSample.js deleted file mode 100644 index 7d1b371822fa..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Retrieve alert rule definitions in a resource group. - * - * @summary Retrieve alert rule definitions in a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/listMetricAlert.json - */ -async function listMetricAlertRules() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricAlerts.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listMetricAlertRules(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsListBySubscriptionSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsListBySubscriptionSample.js deleted file mode 100644 index 9cb90b057f36..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsListBySubscriptionSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Retrieve alert rule definitions in a subscription. - * - * @summary Retrieve alert rule definitions in a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/listMetricAlert.json - */ -async function listMetricAlertRules() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricAlerts.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listMetricAlertRules(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsStatusListByNameSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsStatusListByNameSample.js deleted file mode 100644 index 70a242920273..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsStatusListByNameSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Retrieve an alert rule status. - * - * @summary Retrieve an alert rule status. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertStatusByName.json - */ -async function getAnAlertRuleStatus() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "009f6022-67ec-423e-9aa7-691182870588"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "EastUs"; - const ruleName = "custom1"; - const statusName = - "cmVzb3VyY2VJZD0vc3Vic2NyaXB0aW9ucy8xNGRkZjBjNS03N2M1LTRiNTMtODRmNi1lMWZhNDNhZDY4ZjcvcmVzb3VyY2VHcm91cHMvZ2lndGVzdC9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvdmlydHVhbE1hY2hpbmVzL2dpZ3dhZG1l"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlertsStatus.listByName( - resourceGroupName, - ruleName, - statusName - ); - console.log(result); -} - -async function main() { - getAnAlertRuleStatus(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsStatusListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsStatusListSample.js deleted file mode 100644 index 1536695c4c3a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsStatusListSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Retrieve an alert rule status. - * - * @summary Retrieve an alert rule status. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertStatus.json - */ -async function getAnAlertRuleStatus() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlertsStatus.list(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - getAnAlertRuleStatus(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsUpdateSample.js deleted file mode 100644 index 0dec52571b48..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricAlertsUpdateSample.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Update an metric alert definition. - * - * @summary Update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/UpdateMetricAlert.json - */ -async function createOrUpdateAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const parameters = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" }, - }, - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "\\Processor(_Total)\\% Processor Time", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average", - }, - ], - odataType: "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", - }, - enabled: true, - evaluationFrequency: "Pt1m", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme", - ], - severity: 3, - tags: {}, - windowSize: "Pt15m", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.update(resourceGroupName, ruleName, parameters); - console.log(result); -} - -async function main() { - createOrUpdateAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricDefinitionsListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricDefinitionsListSample.js deleted file mode 100644 index 6202da3422f9..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricDefinitionsListSample.js +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists the metric definitions for the resource. - * - * @summary Lists the metric definitions for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitionsApplicationInsights.json - */ -async function getApplicationInsightsMetricDefinitionsWithoutFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions"; - const metricnamespace = "microsoft.insights/components"; - const options = { metricnamespace }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Lists the metric definitions for the resource. - * - * @summary Lists the metric definitions for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitions.json - */ -async function getMetricDefinitionsWithoutFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricDefinitions"; - const metricnamespace = "Microsoft.Web/sites"; - const options = { metricnamespace }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Lists the metric definitions for the resource. - * - * @summary Lists the metric definitions for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitionsMetricClass.json - */ -async function getStorageCacheMetricDefinitionsWithMetricClass() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"; - const metricnamespace = "microsoft.storagecache/caches"; - const options = { metricnamespace }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getApplicationInsightsMetricDefinitionsWithoutFilter(); - getMetricDefinitionsWithoutFilter(); - getStorageCacheMetricDefinitionsWithMetricClass(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricNamespacesListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricNamespacesListSample.js deleted file mode 100644 index 6a26344dad5d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricNamespacesListSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists the metric namespaces for the resource. - * - * @summary Lists the metric namespaces for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/examples/GetMetricNamespaces.json - */ -async function getMetricNamespacesWithoutFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"; - const startTime = "2020-08-31T15:53:00Z"; - const options = { startTime }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricNamespaces.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getMetricNamespacesWithoutFilter(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricsListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricsListSample.js deleted file mode 100644 index f77166d5a2be..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/metricsListSample.js +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to **Lists the metric values for a resource**. - * - * @summary **Lists the metric values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetric.json - */ -async function getMetricForData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default"; - const timespan = "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z"; - const interval = "PT1M"; - const aggregation = "Average,count"; - const top = 3; - const orderby = "Average asc"; - const filter = "BlobType eq '*'"; - const metricnamespace = "Microsoft.Storage/storageAccounts/blobServices"; - const options = { - timespan, - interval, - aggregation, - top, - orderby, - filter, - metricnamespace, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.list(resourceUri, options); - console.log(result); -} - -/** - * This sample demonstrates how to **Lists the metric values for a resource**. - * - * @summary **Lists the metric values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricMetadata.json - */ -async function getMetricForMetadata() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default"; - const timespan = "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z"; - const interval = "PT1M"; - const aggregation = "Average,count"; - const top = 3; - const orderby = "Average asc"; - const filter = "BlobType eq '*'"; - const metricnamespace = "Microsoft.Storage/storageAccounts/blobServices"; - const options = { - timespan, - interval, - aggregation, - top, - orderby, - filter, - metricnamespace, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.list(resourceUri, options); - console.log(result); -} - -/** - * This sample demonstrates how to **Lists the metric values for a resource**. - * - * @summary **Lists the metric values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricError.json - */ -async function getMetricWithError() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/ac41e21f-afd6-4a79-8070-f01eba278f97/resourceGroups/todking/providers/Microsoft.DocumentDb/databaseAccounts/tk-cosmos-mongo"; - const timespan = "2021-06-07T21:51:00Z/2021-06-08T01:51:00Z"; - const interval = "FULL"; - const metricnames = "MongoRequestsCount,MongoRequests"; - const aggregation = "average"; - const metricnamespace = "microsoft.documentdb/databaseaccounts"; - const options = { - timespan, - interval, - metricnames, - aggregation, - metricnamespace, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.list(resourceUri, options); - console.log(result); -} - -async function main() { - getMetricForData(); - getMetricForMetadata(); - getMetricWithError(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/monitorOperationsListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/monitorOperationsListSample.js deleted file mode 100644 index 1630d667f7e0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/monitorOperationsListSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists available Operations for this Resource Provider - * - * @summary Lists available Operations for this Resource Provider - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/OperationsGet.json - */ -async function getOperationsList() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitorOperations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getOperationsList(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/operationsListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/operationsListSample.js deleted file mode 100644 index eee0a7a560b5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/operationsListSample.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all of the available operations from Microsoft.Insights provider. - * - * @summary Lists all of the available operations from Microsoft.Insights provider. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/OperationList.json - */ -async function getAListOfOperationsForAResourceProvider() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.operations.list(); - console.log(result); -} - -async function main() { - getAListOfOperationsForAResourceProvider(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/package.json b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/package.json deleted file mode 100644 index 30b0ff0205be..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": ">=16.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/monitor/arm-monitor" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/monitor/arm-monitor", - "dependencies": { - "@azure/arm-monitor": "next", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - } -} diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/predictiveMetricGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/predictiveMetricGetSample.js deleted file mode 100644 index fd19e832af2b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/predictiveMetricGetSample.js +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to get predictive autoscale metric future data - * - * @summary get predictive autoscale metric future data - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/GetPredictiveMetric.json - */ -async function getMetricForData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myRG"; - const autoscaleSettingName = "vmss1-Autoscale-775"; - const timespan = "2021-10-14T22:00:00.000Z/2021-10-16T22:00:00.000Z"; - const interval = "PT1H"; - const metricNamespace = "Microsoft.Compute/virtualMachineScaleSets"; - const metricName = "PercentageCPU"; - const aggregation = "Total"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.predictiveMetric.get( - resourceGroupName, - autoscaleSettingName, - timespan, - interval, - metricNamespace, - metricName, - aggregation - ); - console.log(result); -} - -async function main() { - getMetricForData(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsCreateOrUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsCreateOrUpdateSample.js deleted file mode 100644 index 50525c8b9cbd..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsCreateOrUpdateSample.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Approve or reject a private endpoint connection with a given name. - * - * @summary Approve or reject a private endpoint connection with a given name. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionUpdate.json - */ -async function approveOrRejectAPrivateEndpointConnectionWithAGivenName() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const privateEndpointConnectionName = "private-endpoint-connection-name"; - const parameters = { - privateLinkServiceConnectionState: { - description: "Approved by johndoe@contoso.com", - status: "Approved", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginCreateOrUpdateAndWait( - resourceGroupName, - scopeName, - privateEndpointConnectionName, - parameters - ); - console.log(result); -} - -async function main() { - approveOrRejectAPrivateEndpointConnectionWithAGivenName(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsDeleteSample.js deleted file mode 100644 index 96b6b6b8026f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsDeleteSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a private endpoint connection with a given name. - * - * @summary Deletes a private endpoint connection with a given name. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionDelete.json - */ -async function deletesAPrivateEndpointConnectionWithAGivenName() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const privateEndpointConnectionName = "private-endpoint-connection-name"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginDeleteAndWait( - resourceGroupName, - scopeName, - privateEndpointConnectionName - ); - console.log(result); -} - -async function main() { - deletesAPrivateEndpointConnectionWithAGivenName(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsGetSample.js deleted file mode 100644 index cd41b34b056b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsGetSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a private endpoint connection. - * - * @summary Gets a private endpoint connection. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionGet.json - */ -async function getsPrivateEndpointConnection() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const privateEndpointConnectionName = "private-endpoint-connection-name"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.get( - resourceGroupName, - scopeName, - privateEndpointConnectionName - ); - console.log(result); -} - -async function main() { - getsPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsListByPrivateLinkScopeSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsListByPrivateLinkScopeSample.js deleted file mode 100644 index 81eed1b5eb80..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateEndpointConnectionsListByPrivateLinkScopeSample.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets all private endpoint connections on a private link scope. - * - * @summary Gets all private endpoint connections on a private link scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionList.json - */ -async function getsListOfPrivateEndpointConnectionsOnAPrivateLinkScope() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.listByPrivateLinkScope( - resourceGroupName, - scopeName - ); - console.log(result); -} - -async function main() { - getsListOfPrivateEndpointConnectionsOnAPrivateLinkScope(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkResourcesGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkResourcesGetSample.js deleted file mode 100644 index 9c0fdbebf4e9..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkResourcesGetSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @summary Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json - */ -async function getsPrivateEndpointConnection() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const groupName = "azuremonitor"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkResources.get(resourceGroupName, scopeName, groupName); - console.log(result); -} - -async function main() { - getsPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkResourcesListByPrivateLinkScopeSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkResourcesListByPrivateLinkScopeSample.js deleted file mode 100644 index 2de8b3040e9f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkResourcesListByPrivateLinkScopeSample.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @summary Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopePrivateLinkResourceListGet.json - */ -async function getsPrivateEndpointConnection() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkResources.listByPrivateLinkScope( - resourceGroupName, - scopeName - ); - console.log(result); -} - -async function main() { - getsPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopeOperationStatusGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopeOperationStatusGetSample.js deleted file mode 100644 index cfc40d1cdefa..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopeOperationStatusGetSample.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get the status of an azure asynchronous operation associated with a private link scope operation. - * - * @summary Get the status of an azure asynchronous operation associated with a private link scope operation. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/privateLinkScopeOperationStatuses.json - */ -async function getSpecificOperationStatus() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "613192d7-503f-477a-9cfe-4efc3ee2bd60"; - const asyncOperationId = "713192d7-503f-477a-9cfe-4efc3ee2bd11"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopeOperationStatus.get( - asyncOperationId, - resourceGroupName - ); - console.log(result); -} - -async function main() { - getSpecificOperationStatus(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesCreateOrUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesCreateOrUpdateSample.js deleted file mode 100644 index a48efc0afbb8..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesCreateOrUpdateSample.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Approve or reject a private endpoint connection with a given name. - * - * @summary Approve or reject a private endpoint connection with a given name. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceUpdate.json - */ -async function updateAScopedResourceInAPrivateLinkScope() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const name = "scoped-resource-name"; - const parameters = { - linkedResourceId: - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/components/my-component", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopedResources.beginCreateOrUpdateAndWait( - resourceGroupName, - scopeName, - name, - parameters - ); - console.log(result); -} - -async function main() { - updateAScopedResourceInAPrivateLinkScope(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesDeleteSample.js deleted file mode 100644 index 49a7f819ecd1..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesDeleteSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a private endpoint connection with a given name. - * - * @summary Deletes a private endpoint connection with a given name. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceDelete.json - */ -async function deletesAScopedResourceWithAGivenName() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const name = "scoped-resource-name"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopedResources.beginDeleteAndWait( - resourceGroupName, - scopeName, - name - ); - console.log(result); -} - -async function main() { - deletesAScopedResourceWithAGivenName(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesGetSample.js deleted file mode 100644 index 754cef34ed3f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesGetSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a scoped resource in a private link scope. - * - * @summary Gets a scoped resource in a private link scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceGet.json - */ -async function getsPrivateLinkScopedResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const name = "scoped-resource-name"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopedResources.get(resourceGroupName, scopeName, name); - console.log(result); -} - -async function main() { - getsPrivateLinkScopedResource(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesListByPrivateLinkScopeSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesListByPrivateLinkScopeSample.js deleted file mode 100644 index f02e493cd82a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopedResourcesListByPrivateLinkScopeSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets all private endpoint connections on a private link scope. - * - * @summary Gets all private endpoint connections on a private link scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceList.json - */ -async function getsListOfScopedResourcesInAPrivateLinkScope() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateLinkScopedResources.listByPrivateLinkScope( - resourceGroupName, - scopeName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getsListOfScopedResourcesInAPrivateLinkScope(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesCreateOrUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesCreateOrUpdateSample.js deleted file mode 100644 index a66775e178ea..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesCreateOrUpdateSample.js +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. - * - * @summary Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesCreate.json - */ -async function privateLinkScopeCreate() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const azureMonitorPrivateLinkScopePayload = { - accessModeSettings: { - exclusions: [], - ingestionAccessMode: "Open", - queryAccessMode: "Open", - }, - location: "Global", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.createOrUpdate( - resourceGroupName, - scopeName, - azureMonitorPrivateLinkScopePayload - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. - * - * @summary Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesUpdate.json - */ -async function privateLinkScopeUpdate() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const azureMonitorPrivateLinkScopePayload = { - accessModeSettings: { - exclusions: [], - ingestionAccessMode: "Open", - queryAccessMode: "Open", - }, - location: "Global", - tags: { tag1: "Value1" }, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.createOrUpdate( - resourceGroupName, - scopeName, - azureMonitorPrivateLinkScopePayload - ); - console.log(result); -} - -async function main() { - privateLinkScopeCreate(); - privateLinkScopeUpdate(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesDeleteSample.js deleted file mode 100644 index fd34d4f16986..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesDeleteSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a Azure Monitor PrivateLinkScope. - * - * @summary Deletes a Azure Monitor PrivateLinkScope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesDelete.json - */ -async function privateLinkScopesDelete() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.beginDeleteAndWait(resourceGroupName, scopeName); - console.log(result); -} - -async function main() { - privateLinkScopesDelete(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesGetSample.js deleted file mode 100644 index f2888eddd30e..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Returns a Azure Monitor PrivateLinkScope. - * - * @summary Returns a Azure Monitor PrivateLinkScope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesGet.json - */ -async function privateLinkScopeGet() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.get(resourceGroupName, scopeName); - console.log(result); -} - -async function main() { - privateLinkScopeGet(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesListByResourceGroupSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesListByResourceGroupSample.js deleted file mode 100644 index 1ff733bc43a2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a list of Azure Monitor PrivateLinkScopes within a resource group. - * - * @summary Gets a list of Azure Monitor PrivateLinkScopes within a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesListByResourceGroup.json - */ -async function privateLinkScopeListByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateLinkScopes.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - privateLinkScopeListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesListSample.js deleted file mode 100644 index fe975a34a483..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesListSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. - * - * @summary Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesList.json - */ -async function privateLinkScopesListJson() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateLinkScopes.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - privateLinkScopesListJson(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesUpdateTagsSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesUpdateTagsSample.js deleted file mode 100644 index 6b5b91c39912..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/privateLinkScopesUpdateTagsSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesUpdateTagsOnly.json - */ -async function privateLinkScopeUpdateTagsOnly() { - const subscriptionId = process.env["MONITOR_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const privateLinkScopeTags = { - tags: { tag1: "Value1", tag2: "Value2" }, - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.updateTags( - resourceGroupName, - scopeName, - privateLinkScopeTags - ); - console.log(result); -} - -async function main() { - privateLinkScopeUpdateTagsOnly(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/sample.env b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesCreateOrUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesCreateOrUpdateSample.js deleted file mode 100644 index adc6a4af761c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesCreateOrUpdateSample.js +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates or updates a scheduled query rule. - * - * @summary Creates or updates a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/createOrUpdateScheduledQueryRule.json - */ -async function createOrUpdateAScheduledQueryRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "perf"; - const parameters = { - description: "Performance rule", - actions: { - actionGroups: [ - "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup", - ], - customProperties: { key11: "value11", key12: "value12" }, - }, - checkWorkspaceAlertsStorageConfigured: true, - criteria: { - allOf: [ - { - dimensions: [ - { - name: "ComputerIp", - operator: "Exclude", - values: ["192.168.1.1"], - }, - { name: "OSType", operator: "Include", values: ["*"] }, - ], - failingPeriods: { - minFailingPeriodsToAlert: 1, - numberOfEvaluationPeriods: 1, - }, - metricMeasureColumn: "% Processor Time", - operator: "GreaterThan", - query: 'Perf | where ObjectName == "Processor"', - resourceIdColumn: "resourceId", - threshold: 70, - timeAggregation: "Average", - }, - ], - }, - enabled: true, - evaluationFrequency: "PT5M", - location: "eastus", - muteActionsDuration: "PT30M", - ruleResolveConfiguration: { autoResolved: true, timeToResolve: "PT10M" }, - scopes: [ - "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1", - ], - severity: 4, - skipQueryValidation: true, - windowSize: "PT10M", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a scheduled query rule. - * - * @summary Creates or updates a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/createOrUpdateScheduledQueryRuleResourceGroup.json - */ -async function createOrUpdateAScheduledQueryRuleOnResourceGroupS() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "heartbeat"; - const parameters = { - description: "Health check rule", - actions: { - actionGroups: [ - "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup", - ], - customProperties: { key11: "value11", key12: "value12" }, - }, - checkWorkspaceAlertsStorageConfigured: true, - criteria: { - allOf: [ - { - dimensions: [], - failingPeriods: { - minFailingPeriodsToAlert: 1, - numberOfEvaluationPeriods: 1, - }, - operator: "GreaterThan", - query: "Heartbeat", - threshold: 360, - timeAggregation: "Count", - }, - ], - }, - enabled: true, - evaluationFrequency: "PT5M", - location: "eastus", - muteActionsDuration: "PT30M", - ruleResolveConfiguration: { autoResolved: true, timeToResolve: "PT10M" }, - scopes: [ - "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1", - ], - severity: 4, - skipQueryValidation: true, - targetResourceTypes: ["Microsoft.Compute/virtualMachines"], - windowSize: "PT10M", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a scheduled query rule. - * - * @summary Creates or updates a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/createOrUpdateScheduledQueryRuleSubscription.json - */ -async function createOrUpdateAScheduledQueryRuleOnSubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "perf"; - const parameters = { - description: "Performance rule", - actions: { - actionGroups: [ - "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup", - ], - customProperties: { key11: "value11", key12: "value12" }, - }, - checkWorkspaceAlertsStorageConfigured: true, - criteria: { - allOf: [ - { - dimensions: [ - { - name: "ComputerIp", - operator: "Exclude", - values: ["192.168.1.1"], - }, - { name: "OSType", operator: "Include", values: ["*"] }, - ], - failingPeriods: { - minFailingPeriodsToAlert: 1, - numberOfEvaluationPeriods: 1, - }, - metricMeasureColumn: "% Processor Time", - operator: "GreaterThan", - query: 'Perf | where ObjectName == "Processor"', - resourceIdColumn: "resourceId", - threshold: 70, - timeAggregation: "Average", - }, - ], - }, - enabled: true, - evaluationFrequency: "PT5M", - location: "eastus", - muteActionsDuration: "PT30M", - ruleResolveConfiguration: { autoResolved: true, timeToResolve: "PT10M" }, - scopes: ["/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147"], - severity: 4, - skipQueryValidation: true, - targetResourceTypes: ["Microsoft.Compute/virtualMachines"], - windowSize: "PT10M", - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateAScheduledQueryRuleForSingleResource(); - createOrUpdateAScheduledQueryRuleOnResourceGroupS(); - createOrUpdateAScheduledQueryRuleOnSubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesDeleteSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesDeleteSample.js deleted file mode 100644 index e40c3716fd63..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesDeleteSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a scheduled query rule. - * - * @summary Deletes a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/deleteScheduledQueryRule.json - */ -async function deleteAScheduledQueryRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "heartbeat"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.delete(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - deleteAScheduledQueryRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesGetSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesGetSample.js deleted file mode 100644 index 7f8c4c3817a5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Retrieve an scheduled query rule definition. - * - * @summary Retrieve an scheduled query rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/getScheduledQueryRule.json - */ -async function getAScheduledQueryRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "perf"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.get(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - getAScheduledQueryRuleForSingleResource(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesListByResourceGroupSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesListByResourceGroupSample.js deleted file mode 100644 index 90cc8d022ca2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Retrieve scheduled query rule definitions in a resource group. - * - * @summary Retrieve scheduled query rule definitions in a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/listScheduledQueryRulesByResourceGroup.json - */ -async function listScheduledQueryRulesByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.scheduledQueryRules.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listScheduledQueryRulesByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesListBySubscriptionSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesListBySubscriptionSample.js deleted file mode 100644 index 0a1cac0be413..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesListBySubscriptionSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Retrieve a scheduled query rule definitions in a subscription. - * - * @summary Retrieve a scheduled query rule definitions in a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/listScheduledQueryRulesBySubscription.json - */ -async function listScheduledQueryRulesBySubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.scheduledQueryRules.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listScheduledQueryRulesBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesUpdateSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesUpdateSample.js deleted file mode 100644 index 9e139d583a65..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/scheduledQueryRulesUpdateSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Update a scheduled query rule. - * - * @summary Update a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/patchScheduledQueryRule.json - */ -async function createOrUpdateAScheduledQueryRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "heartbeat"; - const parameters = { enabled: false }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.update(resourceGroupName, ruleName, parameters); - console.log(result); -} - -async function main() { - createOrUpdateAScheduledQueryRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActivityLogsListSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActivityLogsListSample.js deleted file mode 100644 index 24a6a7862256..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/tenantActivityLogsListSample.js +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsFiltered.json - */ -async function getTenantActivityLogsWithFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const options = { filter }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsFilteredAndSelected.json - */ -async function getTenantActivityLogsWithFilterAndSelect() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const select = - "eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level"; - const options = { filter, select }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsSelected.json - */ -async function getTenantActivityLogsWithSelect() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const select = - "eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level"; - const options = { select }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsNoParams.json - */ -async function getTenantActivityLogsWithoutFilterOrSelect() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getTenantActivityLogsWithFilter(); - getTenantActivityLogsWithFilterAndSelect(); - getTenantActivityLogsWithSelect(); - getTenantActivityLogsWithoutFilterOrSelect(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/vmInsightsGetOnboardingStatusSample.js b/sdk/monitor/arm-monitor/samples/v8-beta/javascript/vmInsightsGetOnboardingStatusSample.js deleted file mode 100644 index 21e123e29d8b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/javascript/vmInsightsGetOnboardingStatusSample.js +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MonitorClient } = require("@azure/arm-monitor"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusVMScaleSet.json - */ -async function getStatusForAVMScaleSetThatIsActivelyReportingData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/my-service-cluster/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-01"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSingleVMUnknown.json - */ -async function getStatusForAVMThatHasNotYetReportedData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSingleVM.json - */ -async function getStatusForAVMThatIsActivelyReportingData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusResourceGroup.json - */ -async function getStatusForAResourceGroupThatHasAtLeastOneVMThatIsActivelyReportingData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/resource-group-with-vms"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSubscription.json - */ -async function getStatusForASubscriptionThatHasAtLeastOneVMThatIsActivelyReportingData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceUri = "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -async function main() { - getStatusForAVMScaleSetThatIsActivelyReportingData(); - getStatusForAVMThatHasNotYetReportedData(); - getStatusForAVMThatIsActivelyReportingData(); - getStatusForAResourceGroupThatHasAtLeastOneVMThatIsActivelyReportingData(); - getStatusForASubscriptionThatHasAtLeastOneVMThatIsActivelyReportingData(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/README.md b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/README.md deleted file mode 100644 index cd1b8f3e333a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/README.md +++ /dev/null @@ -1,281 +0,0 @@ -# client library samples for TypeScript (Beta) - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| --------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.ts][actiongroupscreatenotificationsatactiongroupresourcelevelsample] | Send test notifications to a set of provided receivers x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtActionGroupResourceLevel.json | -| [actionGroupsCreateNotificationsAtResourceGroupLevelSample.ts][actiongroupscreatenotificationsatresourcegrouplevelsample] | Send test notifications to a set of provided receivers x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtResourceGroupLevel.json | -| [actionGroupsCreateOrUpdateSample.ts][actiongroupscreateorupdatesample] | Create a new action group or update an existing one. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/createOrUpdateActionGroup.json | -| [actionGroupsDeleteSample.ts][actiongroupsdeletesample] | Delete an action group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/deleteActionGroup.json | -| [actionGroupsEnableReceiverSample.ts][actiongroupsenablereceiversample] | Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation is only supported for Email or SMS receivers. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/enableReceiver.json | -| [actionGroupsGetSample.ts][actiongroupsgetsample] | Get an action group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getActionGroup.json | -| [actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.ts][actiongroupsgettestnotificationsatactiongroupresourcelevelsample] | Get the test notifications by the notification id x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtActionGroupResourceLevel.json | -| [actionGroupsGetTestNotificationsAtResourceGroupLevelSample.ts][actiongroupsgettestnotificationsatresourcegrouplevelsample] | Get the test notifications by the notification id x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtResourceGroupLevel.json | -| [actionGroupsGetTestNotificationsSample.ts][actiongroupsgettestnotificationssample] | Get the test notifications by the notification id x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotifications.json | -| [actionGroupsListByResourceGroupSample.ts][actiongroupslistbyresourcegroupsample] | Get a list of all action groups in a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json | -| [actionGroupsListBySubscriptionIdSample.ts][actiongroupslistbysubscriptionidsample] | Get a list of all action groups in a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json | -| [actionGroupsPostTestNotificationsSample.ts][actiongroupsposttestnotificationssample] | Send test notifications to a set of provided receivers x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotifications.json | -| [actionGroupsUpdateSample.ts][actiongroupsupdatesample] | Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/patchActionGroup.json | -| [activityLogAlertsCreateOrUpdateSample.ts][activitylogalertscreateorupdatesample] | Create a new Activity Log Alert rule or update an existing one. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_CreateOrUpdate.json | -| [activityLogAlertsDeleteSample.ts][activitylogalertsdeletesample] | Delete an Activity Log Alert rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Delete.json | -| [activityLogAlertsGetSample.ts][activitylogalertsgetsample] | Get an Activity Log Alert rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Get.json | -| [activityLogAlertsListByResourceGroupSample.ts][activitylogalertslistbyresourcegroupsample] | Get a list of all Activity Log Alert rules in a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_ListByResourceGroupName.json | -| [activityLogAlertsListBySubscriptionIdSample.ts][activitylogalertslistbysubscriptionidsample] | Get a list of all Activity Log Alert rules in a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_ListBySubscriptionId.json | -| [activityLogAlertsUpdateSample.ts][activitylogalertsupdatesample] | Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Update.json | -| [activityLogsListSample.ts][activitylogslistsample] | Provides the list of records from the activity logs. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetActivityLogsFiltered.json | -| [alertRuleIncidentsGetSample.ts][alertruleincidentsgetsample] | Gets an incident associated to an alert rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getAlertRuleIncident.json | -| [alertRuleIncidentsListByAlertRuleSample.ts][alertruleincidentslistbyalertrulesample] | Gets a list of incidents associated to an alert rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRuleIncidents.json | -| [alertRulesCreateOrUpdateSample.ts][alertrulescreateorupdatesample] | Creates or updates a classic metric alert rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/createOrUpdateAlertRule.json | -| [alertRulesDeleteSample.ts][alertrulesdeletesample] | Deletes a classic metric alert rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteAlertRule.json | -| [alertRulesGetSample.ts][alertrulesgetsample] | Gets a classic metric alert rule x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getAlertRule.json | -| [alertRulesListByResourceGroupSample.ts][alertruleslistbyresourcegroupsample] | List the classic metric alert rules within a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRule.json | -| [alertRulesListBySubscriptionSample.ts][alertruleslistbysubscriptionsample] | List the classic metric alert rules within a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRuleBySubscription.json | -| [alertRulesUpdateSample.ts][alertrulesupdatesample] | Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/patchAlertRule.json | -| [autoscaleSettingsCreateOrUpdateSample.ts][autoscalesettingscreateorupdatesample] | Creates or updates an autoscale setting. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/createOrUpdateAutoscaleSetting.json | -| [autoscaleSettingsDeleteSample.ts][autoscalesettingsdeletesample] | Deletes and autoscale setting x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/deleteAutoscaleSetting.json | -| [autoscaleSettingsGetSample.ts][autoscalesettingsgetsample] | Gets an autoscale setting x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/getAutoscaleSetting.json | -| [autoscaleSettingsListByResourceGroupSample.ts][autoscalesettingslistbyresourcegroupsample] | Lists the autoscale settings for a resource group x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/listAutoscaleSetting.json | -| [autoscaleSettingsListBySubscriptionSample.ts][autoscalesettingslistbysubscriptionsample] | Lists the autoscale settings for a subscription x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/listAutoscaleSettingBySubscription.json | -| [autoscaleSettingsUpdateSample.ts][autoscalesettingsupdatesample] | Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/patchAutoscaleSetting.json | -| [azureMonitorWorkspacesCreateSample.ts][azuremonitorworkspacescreatesample] | Create or update a workspace x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesCreate.json | -| [azureMonitorWorkspacesDeleteSample.ts][azuremonitorworkspacesdeletesample] | Delete a workspace x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesDelete.json | -| [azureMonitorWorkspacesGetSample.ts][azuremonitorworkspacesgetsample] | Returns the specific Azure Monitor workspace x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesGet.json | -| [azureMonitorWorkspacesListByResourceGroupSample.ts][azuremonitorworkspaceslistbyresourcegroupsample] | Lists all workspaces in the specified resource group x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesListByResourceGroup.json | -| [azureMonitorWorkspacesListBySubscriptionSample.ts][azuremonitorworkspaceslistbysubscriptionsample] | Lists all workspaces in the specified subscription x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesListBySubscription.json | -| [azureMonitorWorkspacesUpdateSample.ts][azuremonitorworkspacesupdatesample] | Updates part of a workspace x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesUpdate.json | -| [baselinesListSample.ts][baselineslistsample] | **Lists the metric baseline values for a resource**. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2019-03-01/examples/metricBaselines.json | -| [dataCollectionEndpointsCreateSample.ts][datacollectionendpointscreatesample] | Creates or updates a data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsCreate.json | -| [dataCollectionEndpointsDeleteSample.ts][datacollectionendpointsdeletesample] | Deletes a data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsDelete.json | -| [dataCollectionEndpointsGetSample.ts][datacollectionendpointsgetsample] | Returns the specified data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsGet.json | -| [dataCollectionEndpointsListByResourceGroupSample.ts][datacollectionendpointslistbyresourcegroupsample] | Lists all data collection endpoints in the specified resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListByResourceGroup.json | -| [dataCollectionEndpointsListBySubscriptionSample.ts][datacollectionendpointslistbysubscriptionsample] | Lists all data collection endpoints in the specified subscription x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListBySubscription.json | -| [dataCollectionEndpointsUpdateSample.ts][datacollectionendpointsupdatesample] | Updates part of a data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsUpdate.json | -| [dataCollectionRuleAssociationsCreateSample.ts][datacollectionruleassociationscreatesample] | Creates or updates an association. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsCreate.json | -| [dataCollectionRuleAssociationsDeleteSample.ts][datacollectionruleassociationsdeletesample] | Deletes an association. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsDelete.json | -| [dataCollectionRuleAssociationsGetSample.ts][datacollectionruleassociationsgetsample] | Returns the specified association. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsGet.json | -| [dataCollectionRuleAssociationsListByDataCollectionEndpointSample.ts][datacollectionruleassociationslistbydatacollectionendpointsample] | Lists associations for the specified data collection endpoint. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByDataCollectionEndpoint.json | -| [dataCollectionRuleAssociationsListByResourceSample.ts][datacollectionruleassociationslistbyresourcesample] | Lists associations for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByResource.json | -| [dataCollectionRuleAssociationsListByRuleSample.ts][datacollectionruleassociationslistbyrulesample] | Lists associations for the specified data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByRule.json | -| [dataCollectionRulesCreateSample.ts][datacollectionrulescreatesample] | Creates or updates a data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesCreate.json | -| [dataCollectionRulesDeleteSample.ts][datacollectionrulesdeletesample] | Deletes a data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesDelete.json | -| [dataCollectionRulesGetSample.ts][datacollectionrulesgetsample] | Returns the specified data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesGet.json | -| [dataCollectionRulesListByResourceGroupSample.ts][datacollectionruleslistbyresourcegroupsample] | Lists all data collection rules in the specified resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListByResourceGroup.json | -| [dataCollectionRulesListBySubscriptionSample.ts][datacollectionruleslistbysubscriptionsample] | Lists all data collection rules in the specified subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListBySubscription.json | -| [dataCollectionRulesUpdateSample.ts][datacollectionrulesupdatesample] | Updates part of a data collection rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesUpdate.json | -| [diagnosticSettingsCategoryGetSample.ts][diagnosticsettingscategorygetsample] | Gets the diagnostic settings category for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingsCategory.json | -| [diagnosticSettingsCategoryListSample.ts][diagnosticsettingscategorylistsample] | Lists the diagnostic settings categories for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettingsCategories.json | -| [diagnosticSettingsCreateOrUpdateSample.ts][diagnosticsettingscreateorupdatesample] | Creates or updates diagnostic settings for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateDiagnosticSetting.json | -| [diagnosticSettingsDeleteSample.ts][diagnosticsettingsdeletesample] | Deletes existing diagnostic settings for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/deleteDiagnosticSetting.json | -| [diagnosticSettingsGetSample.ts][diagnosticsettingsgetsample] | Gets the active diagnostic settings for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSetting.json | -| [diagnosticSettingsListSample.ts][diagnosticsettingslistsample] | Gets the active diagnostic settings list for the specified resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettings.json | -| [eventCategoriesListSample.ts][eventcategorieslistsample] | Get the list of available event categories supported in the Activity Logs Service.
The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetEventCategories.json | -| [logProfilesCreateOrUpdateSample.ts][logprofilescreateorupdatesample] | Create or update a log profile in Azure Monitoring REST API. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/createOrUpdateLogProfile.json | -| [logProfilesDeleteSample.ts][logprofilesdeletesample] | Deletes the log profile. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteLogProfile.json | -| [logProfilesGetSample.ts][logprofilesgetsample] | Gets the log profile. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getLogProfile.json | -| [logProfilesListSample.ts][logprofileslistsample] | List the log profiles. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listLogProfile.json | -| [logProfilesUpdateSample.ts][logprofilesupdatesample] | Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/patchLogProfile.json | -| [metricAlertsCreateOrUpdateSample.ts][metricalertscreateorupdatesample] | Create or update an metric alert definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateDynamicMetricAlertMultipleResource.json | -| [metricAlertsDeleteSample.ts][metricalertsdeletesample] | Delete an alert rule definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/deleteMetricAlert.json | -| [metricAlertsGetSample.ts][metricalertsgetsample] | Retrieve an alert rule definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getDynamicMetricAlertMultipleResource.json | -| [metricAlertsListByResourceGroupSample.ts][metricalertslistbyresourcegroupsample] | Retrieve alert rule definitions in a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/listMetricAlert.json | -| [metricAlertsListBySubscriptionSample.ts][metricalertslistbysubscriptionsample] | Retrieve alert rule definitions in a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/listMetricAlert.json | -| [metricAlertsStatusListByNameSample.ts][metricalertsstatuslistbynamesample] | Retrieve an alert rule status. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertStatusByName.json | -| [metricAlertsStatusListSample.ts][metricalertsstatuslistsample] | Retrieve an alert rule status. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertStatus.json | -| [metricAlertsUpdateSample.ts][metricalertsupdatesample] | Update an metric alert definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/UpdateMetricAlert.json | -| [metricDefinitionsListSample.ts][metricdefinitionslistsample] | Lists the metric definitions for the resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitionsApplicationInsights.json | -| [metricNamespacesListSample.ts][metricnamespaceslistsample] | Lists the metric namespaces for the resource. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/examples/GetMetricNamespaces.json | -| [metricsListSample.ts][metricslistsample] | **Lists the metric values for a resource**. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetric.json | -| [monitorOperationsListSample.ts][monitoroperationslistsample] | Lists available Operations for this Resource Provider x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/OperationsGet.json | -| [operationsListSample.ts][operationslistsample] | Lists all of the available operations from Microsoft.Insights provider. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/OperationList.json | -| [predictiveMetricGetSample.ts][predictivemetricgetsample] | get predictive autoscale metric future data x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/GetPredictiveMetric.json | -| [privateEndpointConnectionsCreateOrUpdateSample.ts][privateendpointconnectionscreateorupdatesample] | Approve or reject a private endpoint connection with a given name. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionUpdate.json | -| [privateEndpointConnectionsDeleteSample.ts][privateendpointconnectionsdeletesample] | Deletes a private endpoint connection with a given name. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionDelete.json | -| [privateEndpointConnectionsGetSample.ts][privateendpointconnectionsgetsample] | Gets a private endpoint connection. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionGet.json | -| [privateEndpointConnectionsListByPrivateLinkScopeSample.ts][privateendpointconnectionslistbyprivatelinkscopesample] | Gets all private endpoint connections on a private link scope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionList.json | -| [privateLinkResourcesGetSample.ts][privatelinkresourcesgetsample] | Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json | -| [privateLinkResourcesListByPrivateLinkScopeSample.ts][privatelinkresourceslistbyprivatelinkscopesample] | Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopePrivateLinkResourceListGet.json | -| [privateLinkScopeOperationStatusGetSample.ts][privatelinkscopeoperationstatusgetsample] | Get the status of an azure asynchronous operation associated with a private link scope operation. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/privateLinkScopeOperationStatuses.json | -| [privateLinkScopedResourcesCreateOrUpdateSample.ts][privatelinkscopedresourcescreateorupdatesample] | Approve or reject a private endpoint connection with a given name. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceUpdate.json | -| [privateLinkScopedResourcesDeleteSample.ts][privatelinkscopedresourcesdeletesample] | Deletes a private endpoint connection with a given name. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceDelete.json | -| [privateLinkScopedResourcesGetSample.ts][privatelinkscopedresourcesgetsample] | Gets a scoped resource in a private link scope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceGet.json | -| [privateLinkScopedResourcesListByPrivateLinkScopeSample.ts][privatelinkscopedresourceslistbyprivatelinkscopesample] | Gets all private endpoint connections on a private link scope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceList.json | -| [privateLinkScopesCreateOrUpdateSample.ts][privatelinkscopescreateorupdatesample] | Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesCreate.json | -| [privateLinkScopesDeleteSample.ts][privatelinkscopesdeletesample] | Deletes a Azure Monitor PrivateLinkScope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesDelete.json | -| [privateLinkScopesGetSample.ts][privatelinkscopesgetsample] | Returns a Azure Monitor PrivateLinkScope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesGet.json | -| [privateLinkScopesListByResourceGroupSample.ts][privatelinkscopeslistbyresourcegroupsample] | Gets a list of Azure Monitor PrivateLinkScopes within a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesListByResourceGroup.json | -| [privateLinkScopesListSample.ts][privatelinkscopeslistsample] | Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesList.json | -| [privateLinkScopesUpdateTagsSample.ts][privatelinkscopesupdatetagssample] | Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesUpdateTagsOnly.json | -| [scheduledQueryRulesCreateOrUpdateSample.ts][scheduledqueryrulescreateorupdatesample] | Creates or updates a scheduled query rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/createOrUpdateScheduledQueryRule.json | -| [scheduledQueryRulesDeleteSample.ts][scheduledqueryrulesdeletesample] | Deletes a scheduled query rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/deleteScheduledQueryRule.json | -| [scheduledQueryRulesGetSample.ts][scheduledqueryrulesgetsample] | Retrieve an scheduled query rule definition. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/getScheduledQueryRule.json | -| [scheduledQueryRulesListByResourceGroupSample.ts][scheduledqueryruleslistbyresourcegroupsample] | Retrieve scheduled query rule definitions in a resource group. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/listScheduledQueryRulesByResourceGroup.json | -| [scheduledQueryRulesListBySubscriptionSample.ts][scheduledqueryruleslistbysubscriptionsample] | Retrieve a scheduled query rule definitions in a subscription. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/listScheduledQueryRulesBySubscription.json | -| [scheduledQueryRulesUpdateSample.ts][scheduledqueryrulesupdatesample] | Update a scheduled query rule. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/patchScheduledQueryRule.json | -| [tenantActivityLogsListSample.ts][tenantactivitylogslistsample] | Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does _not_ retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsFiltered.json | -| [vmInsightsGetOnboardingStatusSample.ts][vminsightsgetonboardingstatussample] | Retrieves the VM Insights onboarding status for the specified resource or resource scope. x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusVMScaleSet.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env MONITOR_SUBSCRIPTION_ID="" MONITOR_RESOURCE_GROUP="" node dist/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[actiongroupscreatenotificationsatactiongroupresourcelevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.ts -[actiongroupscreatenotificationsatresourcegrouplevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateNotificationsAtResourceGroupLevelSample.ts -[actiongroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateOrUpdateSample.ts -[actiongroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsDeleteSample.ts -[actiongroupsenablereceiversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsEnableReceiverSample.ts -[actiongroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetSample.ts -[actiongroupsgettestnotificationsatactiongroupresourcelevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.ts -[actiongroupsgettestnotificationsatresourcegrouplevelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.ts -[actiongroupsgettestnotificationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsSample.ts -[actiongroupslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsListByResourceGroupSample.ts -[actiongroupslistbysubscriptionidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsListBySubscriptionIdSample.ts -[actiongroupsposttestnotificationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsPostTestNotificationsSample.ts -[actiongroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsUpdateSample.ts -[activitylogalertscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsCreateOrUpdateSample.ts -[activitylogalertsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsDeleteSample.ts -[activitylogalertsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsGetSample.ts -[activitylogalertslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsListByResourceGroupSample.ts -[activitylogalertslistbysubscriptionidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsListBySubscriptionIdSample.ts -[activitylogalertsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsUpdateSample.ts -[activitylogslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogsListSample.ts -[alertruleincidentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRuleIncidentsGetSample.ts -[alertruleincidentslistbyalertrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRuleIncidentsListByAlertRuleSample.ts -[alertrulescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesCreateOrUpdateSample.ts -[alertrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesDeleteSample.ts -[alertrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesGetSample.ts -[alertruleslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesListByResourceGroupSample.ts -[alertruleslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesListBySubscriptionSample.ts -[alertrulesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesUpdateSample.ts -[autoscalesettingscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsCreateOrUpdateSample.ts -[autoscalesettingsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsDeleteSample.ts -[autoscalesettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsGetSample.ts -[autoscalesettingslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsListByResourceGroupSample.ts -[autoscalesettingslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsListBySubscriptionSample.ts -[autoscalesettingsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsUpdateSample.ts -[azuremonitorworkspacescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesCreateSample.ts -[azuremonitorworkspacesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesDeleteSample.ts -[azuremonitorworkspacesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesGetSample.ts -[azuremonitorworkspaceslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesListByResourceGroupSample.ts -[azuremonitorworkspaceslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesListBySubscriptionSample.ts -[azuremonitorworkspacesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesUpdateSample.ts -[baselineslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/baselinesListSample.ts -[datacollectionendpointscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsCreateSample.ts -[datacollectionendpointsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsDeleteSample.ts -[datacollectionendpointsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsGetSample.ts -[datacollectionendpointslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsListByResourceGroupSample.ts -[datacollectionendpointslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsListBySubscriptionSample.ts -[datacollectionendpointsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsUpdateSample.ts -[datacollectionruleassociationscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsCreateSample.ts -[datacollectionruleassociationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsDeleteSample.ts -[datacollectionruleassociationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsGetSample.ts -[datacollectionruleassociationslistbydatacollectionendpointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.ts -[datacollectionruleassociationslistbyresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByResourceSample.ts -[datacollectionruleassociationslistbyrulesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByRuleSample.ts -[datacollectionrulescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesCreateSample.ts -[datacollectionrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesDeleteSample.ts -[datacollectionrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesGetSample.ts -[datacollectionruleslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesListByResourceGroupSample.ts -[datacollectionruleslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesListBySubscriptionSample.ts -[datacollectionrulesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesUpdateSample.ts -[diagnosticsettingscategorygetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCategoryGetSample.ts -[diagnosticsettingscategorylistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCategoryListSample.ts -[diagnosticsettingscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCreateOrUpdateSample.ts -[diagnosticsettingsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsDeleteSample.ts -[diagnosticsettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsGetSample.ts -[diagnosticsettingslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsListSample.ts -[eventcategorieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/eventCategoriesListSample.ts -[logprofilescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesCreateOrUpdateSample.ts -[logprofilesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesDeleteSample.ts -[logprofilesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesGetSample.ts -[logprofileslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesListSample.ts -[logprofilesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesUpdateSample.ts -[metricalertscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsCreateOrUpdateSample.ts -[metricalertsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsDeleteSample.ts -[metricalertsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsGetSample.ts -[metricalertslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsListByResourceGroupSample.ts -[metricalertslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsListBySubscriptionSample.ts -[metricalertsstatuslistbynamesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsStatusListByNameSample.ts -[metricalertsstatuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsStatusListSample.ts -[metricalertsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsUpdateSample.ts -[metricdefinitionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricDefinitionsListSample.ts -[metricnamespaceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricNamespacesListSample.ts -[metricslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricsListSample.ts -[monitoroperationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/monitorOperationsListSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/operationsListSample.ts -[predictivemetricgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/predictiveMetricGetSample.ts -[privateendpointconnectionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.ts -[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts -[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsGetSample.ts -[privateendpointconnectionslistbyprivatelinkscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsListByPrivateLinkScopeSample.ts -[privatelinkresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkResourcesGetSample.ts -[privatelinkresourceslistbyprivatelinkscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkResourcesListByPrivateLinkScopeSample.ts -[privatelinkscopeoperationstatusgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopeOperationStatusGetSample.ts -[privatelinkscopedresourcescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesCreateOrUpdateSample.ts -[privatelinkscopedresourcesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesDeleteSample.ts -[privatelinkscopedresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesGetSample.ts -[privatelinkscopedresourceslistbyprivatelinkscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesListByPrivateLinkScopeSample.ts -[privatelinkscopescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesCreateOrUpdateSample.ts -[privatelinkscopesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesDeleteSample.ts -[privatelinkscopesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesGetSample.ts -[privatelinkscopeslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesListByResourceGroupSample.ts -[privatelinkscopeslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesListSample.ts -[privatelinkscopesupdatetagssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesUpdateTagsSample.ts -[scheduledqueryrulescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesCreateOrUpdateSample.ts -[scheduledqueryrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesDeleteSample.ts -[scheduledqueryrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesGetSample.ts -[scheduledqueryruleslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesListByResourceGroupSample.ts -[scheduledqueryruleslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesListBySubscriptionSample.ts -[scheduledqueryrulesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesUpdateSample.ts -[tenantactivitylogslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActivityLogsListSample.ts -[vminsightsgetonboardingstatussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/vmInsightsGetOnboardingStatusSample.ts -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-monitor?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/monitor/arm-monitor/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/package.json b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/package.json deleted file mode 100644 index bf914dc4f804..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": ">=16.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": "^16.0.0", - "typescript": "~5.2.0", - "rimraf": "latest" - } -} diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/sample.env b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.ts deleted file mode 100644 index f675456f49f4..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateNotificationsAtActionGroupResourceLevelSample.ts +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NotificationRequestBody, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Send test notifications to a set of provided receivers - * - * @summary Send test notifications to a set of provided receivers - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtActionGroupResourceLevel.json - */ -async function createNotificationsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "11111111-1111-1111-1111-111111111111"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestRgName"; - const actionGroupName = "TestAgName"; - const notificationRequest: NotificationRequestBody = { - alertType: "budget", - armRoleReceivers: [ - { - name: "ArmRole-Common", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: true - }, - { - name: "ArmRole-nonCommon", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: false - } - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "http://test.me", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084" - } - ], - azureAppPushReceivers: [ - { name: "Sample azureAppPush", emailAddress: "johndoe@email.com" } - ], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true - } - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true - } - ], - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84" - } - ], - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: - "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c" - } - ], - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false - } - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890" - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321" - } - ], - voiceReceivers: [ - { name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" } - ], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true - }, - { - name: "Sample webhook 2", - identifierUri: - "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true - } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.beginCreateNotificationsAtActionGroupResourceLevelAndWait( - resourceGroupName, - actionGroupName, - notificationRequest - ); - console.log(result); -} - -async function main() { - createNotificationsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateNotificationsAtResourceGroupLevelSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateNotificationsAtResourceGroupLevelSample.ts deleted file mode 100644 index ef9f52b11f34..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateNotificationsAtResourceGroupLevelSample.ts +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NotificationRequestBody, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Send test notifications to a set of provided receivers - * - * @summary Send test notifications to a set of provided receivers - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotificationsAtResourceGroupLevel.json - */ -async function createNotificationsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-TestNotifications"; - const notificationRequest: NotificationRequestBody = { - alertType: "budget", - armRoleReceivers: [ - { - name: "ArmRole-Common", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: true - }, - { - name: "ArmRole-nonCommon", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: false - } - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "http://test.me", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084" - } - ], - azureAppPushReceivers: [ - { name: "Sample azureAppPush", emailAddress: "johndoe@email.com" } - ], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true - } - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true - } - ], - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84" - } - ], - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: - "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c" - } - ], - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false - } - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890" - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321" - } - ], - voiceReceivers: [ - { name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" } - ], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true - }, - { - name: "Sample webhook 2", - identifierUri: - "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true - } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.beginCreateNotificationsAtResourceGroupLevelAndWait( - resourceGroupName, - notificationRequest - ); - console.log(result); -} - -async function main() { - createNotificationsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateOrUpdateSample.ts deleted file mode 100644 index 0d8f5181c84d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsCreateOrUpdateSample.ts +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ActionGroupResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a new action group or update an existing one. - * - * @summary Create a new action group or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/createOrUpdateActionGroup.json - */ -async function createOrUpdateAnActionGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const actionGroup: ActionGroupResource = { - armRoleReceivers: [ - { - name: "Sample armRole", - roleId: "8e3af657-a8ff-443c-a75c-2fe8c4bcb635", - useCommonAlertSchema: true - } - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084" - } - ], - azureAppPushReceivers: [ - { name: "Sample azureAppPush", emailAddress: "johndoe@email.com" } - ], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true - } - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true - } - ], - enabled: true, - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84" - } - ], - groupShortName: "sample", - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: - "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c" - } - ], - location: "Global", - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false - } - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890" - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321" - } - ], - tags: {}, - voiceReceivers: [ - { name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" } - ], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true - }, - { - name: "Sample webhook 2", - identifierUri: - "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true - } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.createOrUpdate( - resourceGroupName, - actionGroupName, - actionGroup - ); - console.log(result); -} - -async function main() { - createOrUpdateAnActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsDeleteSample.ts deleted file mode 100644 index 7b955a5715d2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete an action group. - * - * @summary Delete an action group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/deleteActionGroup.json - */ -async function deleteAnActionGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.delete( - resourceGroupName, - actionGroupName - ); - console.log(result); -} - -async function main() { - deleteAnActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsEnableReceiverSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsEnableReceiverSample.ts deleted file mode 100644 index cff901ba8be7..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsEnableReceiverSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { EnableRequest, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation is only supported for Email or SMS receivers. - * - * @summary Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation is only supported for Email or SMS receivers. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/enableReceiver.json - */ -async function enableTheReceiver() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const enableRequest: EnableRequest = { receiverName: "John Doe's mobile" }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.enableReceiver( - resourceGroupName, - actionGroupName, - enableRequest - ); - console.log(result); -} - -async function main() { - enableTheReceiver(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetSample.ts deleted file mode 100644 index 39fe3b9fca0a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get an action group. - * - * @summary Get an action group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getActionGroup.json - */ -async function getAnActionGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.get( - resourceGroupName, - actionGroupName - ); - console.log(result); -} - -async function main() { - getAnActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.ts deleted file mode 100644 index cf60c919b027..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsAtActionGroupResourceLevelSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the test notifications by the notification id - * - * @summary Get the test notifications by the notification id - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtActionGroupResourceLevel.json - */ -async function getNotificationDetailsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "11111111-1111-1111-1111-111111111111"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestRgName"; - const actionGroupName = "TestAgName"; - const notificationId = "11000222191287"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.getTestNotificationsAtActionGroupResourceLevel( - resourceGroupName, - actionGroupName, - notificationId - ); - console.log(result); -} - -async function main() { - getNotificationDetailsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.ts deleted file mode 100644 index 2d98821e1de7..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsAtResourceGroupLevelSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the test notifications by the notification id - * - * @summary Get the test notifications by the notification id - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotificationsAtResourceGroupLevel.json - */ -async function getNotificationDetailsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-TestNotifications"; - const notificationId = "11000222191287"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.getTestNotificationsAtResourceGroupLevel( - resourceGroupName, - notificationId - ); - console.log(result); -} - -async function main() { - getNotificationDetailsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsSample.ts deleted file mode 100644 index 25cd9a72018c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsGetTestNotificationsSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the test notifications by the notification id - * - * @summary Get the test notifications by the notification id - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/getTestNotifications.json - */ -async function getNotificationDetailsAtSubscriptionLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const notificationId = "11000222191287"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.getTestNotifications(notificationId); - console.log(result); -} - -async function main() { - getNotificationDetailsAtSubscriptionLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsListByResourceGroupSample.ts deleted file mode 100644 index 505dc900d581..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a list of all action groups in a resource group. - * - * @summary Get a list of all action groups in a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json - */ -async function listActionGroupsAtResourceGroupLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.actionGroups.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listActionGroupsAtResourceGroupLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsListBySubscriptionIdSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsListBySubscriptionIdSample.ts deleted file mode 100644 index 1b40a18b9ef0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsListBySubscriptionIdSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a list of all action groups in a subscription. - * - * @summary Get a list of all action groups in a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/listActionGroups.json - */ -async function listActionGroupsAtSubscriptionLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.actionGroups.listBySubscriptionId()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listActionGroupsAtSubscriptionLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsPostTestNotificationsSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsPostTestNotificationsSample.ts deleted file mode 100644 index 153ade7de654..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsPostTestNotificationsSample.ts +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NotificationRequestBody, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Send test notifications to a set of provided receivers - * - * @summary Send test notifications to a set of provided receivers - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/postTestNotifications.json - */ -async function createNotificationsAtSubscriptionLevel() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const notificationRequest: NotificationRequestBody = { - alertType: "budget", - armRoleReceivers: [ - { - name: "ArmRole-Common", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: true - }, - { - name: "ArmRole-nonCommon", - roleId: "11111111-1111-1111-1111-111111111111", - useCommonAlertSchema: false - } - ], - automationRunbookReceivers: [ - { - name: "testRunbook", - automationAccountId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", - isGlobalRunbook: false, - runbookName: "Sample runbook", - serviceUri: "http://test.me", - useCommonAlertSchema: true, - webhookResourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084" - } - ], - azureAppPushReceivers: [ - { name: "Sample azureAppPush", emailAddress: "johndoe@email.com" } - ], - azureFunctionReceivers: [ - { - name: "Sample azureFunction", - functionAppResourceId: - "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", - functionName: "HttpTriggerCSharp1", - httpTriggerUrl: "http://test.me", - useCommonAlertSchema: true - } - ], - emailReceivers: [ - { - name: "John Doe's email", - emailAddress: "johndoe@email.com", - useCommonAlertSchema: false - }, - { - name: "Jane Smith's email", - emailAddress: "janesmith@email.com", - useCommonAlertSchema: true - } - ], - eventHubReceivers: [ - { - name: "Sample eventHub", - eventHubName: "testEventHub", - eventHubNameSpace: "testEventHubNameSpace", - subscriptionId: "187f412d-1758-44d9-b052-169e2564721d", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84" - } - ], - itsmReceivers: [ - { - name: "Sample itsm", - connectionId: "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", - region: "westcentralus", - ticketConfiguration: - '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', - workspaceId: - "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c" - } - ], - logicAppReceivers: [ - { - name: "Sample logicApp", - callbackUrl: - "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w", - resourceId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", - useCommonAlertSchema: false - } - ], - smsReceivers: [ - { - name: "John Doe's mobile", - countryCode: "1", - phoneNumber: "1234567890" - }, - { - name: "Jane Smith's mobile", - countryCode: "1", - phoneNumber: "0987654321" - } - ], - voiceReceivers: [ - { name: "Sample voice", countryCode: "1", phoneNumber: "1234567890" } - ], - webhookReceivers: [ - { - name: "Sample webhook 1", - serviceUri: "http://www.example.com/webhook1", - useCommonAlertSchema: true - }, - { - name: "Sample webhook 2", - identifierUri: - "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", - objectId: "d3bb868c-fe44-452c-aa26-769a6538c808", - serviceUri: "http://www.example.com/webhook2", - tenantId: "68a4459a-ccb8-493c-b9da-dd30457d1b84", - useAadAuth: true, - useCommonAlertSchema: true - } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.beginPostTestNotificationsAndWait( - notificationRequest - ); - console.log(result); -} - -async function main() { - createNotificationsAtSubscriptionLevel(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsUpdateSample.ts deleted file mode 100644 index 80b2b49eabac..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/actionGroupsUpdateSample.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ActionGroupPatchBody, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/patchActionGroup.json - */ -async function patchAnActionGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Default-NotificationRules"; - const actionGroupName = "SampleActionGroup"; - const actionGroupPatch: ActionGroupPatchBody = { - enabled: false, - tags: { key1: "value1", key2: "value2" } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.actionGroups.update( - resourceGroupName, - actionGroupName, - actionGroupPatch - ); - console.log(result); -} - -async function main() { - patchAnActionGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsCreateOrUpdateSample.ts deleted file mode 100644 index b3c9a4e2f415..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsCreateOrUpdateSample.ts +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ActivityLogAlertResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a new Activity Log Alert rule or update an existing one. - * - * @summary Create a new Activity Log Alert rule or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_CreateOrUpdate.json - */ -async function createOrUpdateAnActivityLogAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRule"; - const activityLogAlertRule: ActivityLogAlertResource = { - description: "Description of sample Activity Log Alert rule.", - actions: { - actionGroups: [ - { - actionGroupId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup", - webhookProperties: { sampleWebhookProperty: "SamplePropertyValue" } - } - ] - }, - condition: { - allOf: [ - { equals: "Administrative", field: "category" }, - { equals: "Error", field: "level" } - ] - }, - enabled: true, - location: "Global", - scopes: ["/subscriptions/187f412d-1758-44d9-b052-169e2564721d"], - tags: {} - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.createOrUpdate( - resourceGroupName, - activityLogAlertName, - activityLogAlertRule - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a new Activity Log Alert rule or update an existing one. - * - * @summary Create a new Activity Log Alert rule or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_CreateOrUpdateRuleWithAnyOfCondition.json - */ -async function createOrUpdateAnActivityLogAlertRuleWithAnyOfCondition() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRuleWithAnyOfCondition"; - const activityLogAlertRule: ActivityLogAlertResource = { - description: - "Description of sample Activity Log Alert rule with 'anyOf' condition.", - actions: { - actionGroups: [ - { - actionGroupId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup", - webhookProperties: { sampleWebhookProperty: "SamplePropertyValue" } - } - ] - }, - condition: { - allOf: [ - { equals: "ServiceHealth", field: "category" }, - { - anyOf: [ - { equals: "Incident", field: "properties.incidentType" }, - { equals: "Maintenance", field: "properties.incidentType" } - ] - } - ] - }, - enabled: true, - location: "Global", - scopes: ["subscriptions/187f412d-1758-44d9-b052-169e2564721d"], - tags: {} - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.createOrUpdate( - resourceGroupName, - activityLogAlertName, - activityLogAlertRule - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a new Activity Log Alert rule or update an existing one. - * - * @summary Create a new Activity Log Alert rule or update an existing one. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_CreateOrUpdateRuleWithContainsAny.json - */ -async function createOrUpdateAnActivityLogAlertRuleWithContainsAny() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRuleWithContainsAny"; - const activityLogAlertRule: ActivityLogAlertResource = { - description: - "Description of sample Activity Log Alert rule with 'containsAny'.", - actions: { - actionGroups: [ - { - actionGroupId: - "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup", - webhookProperties: { sampleWebhookProperty: "SamplePropertyValue" } - } - ] - }, - condition: { - allOf: [ - { equals: "ServiceHealth", field: "category" }, - { - containsAny: ["North Europe", "West Europe"], - field: "properties.impactedServices[*].ImpactedRegions[*].RegionName" - } - ] - }, - enabled: true, - location: "Global", - scopes: ["subscriptions/187f412d-1758-44d9-b052-169e2564721d"], - tags: {} - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.createOrUpdate( - resourceGroupName, - activityLogAlertName, - activityLogAlertRule - ); - console.log(result); -} - -async function main() { - createOrUpdateAnActivityLogAlertRule(); - createOrUpdateAnActivityLogAlertRuleWithAnyOfCondition(); - createOrUpdateAnActivityLogAlertRuleWithContainsAny(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsDeleteSample.ts deleted file mode 100644 index 15271385aee4..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete an Activity Log Alert rule. - * - * @summary Delete an Activity Log Alert rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Delete.json - */ -async function deleteAnActivityLogAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.delete( - resourceGroupName, - activityLogAlertName - ); - console.log(result); -} - -async function main() { - deleteAnActivityLogAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsGetSample.ts deleted file mode 100644 index 9e1909525bc2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get an Activity Log Alert rule. - * - * @summary Get an Activity Log Alert rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Get.json - */ -async function getAnActivityLogAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.get( - resourceGroupName, - activityLogAlertName - ); - console.log(result); -} - -async function main() { - getAnActivityLogAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsListByResourceGroupSample.ts deleted file mode 100644 index a198638e54b2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a list of all Activity Log Alert rules in a resource group. - * - * @summary Get a list of all Activity Log Alert rules in a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_ListByResourceGroupName.json - */ -async function listActivityLogAlerts() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.activityLogAlerts.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listActivityLogAlerts(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsListBySubscriptionIdSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsListBySubscriptionIdSample.ts deleted file mode 100644 index 173f96e013a3..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsListBySubscriptionIdSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a list of all Activity Log Alert rules in a subscription. - * - * @summary Get a list of all Activity Log Alert rules in a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_ListBySubscriptionId.json - */ -async function getListOfAllActivityLogAlertRulesUnderASubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.activityLogAlerts.listBySubscriptionId()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getListOfAllActivityLogAlertRulesUnderASubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsUpdateSample.ts deleted file mode 100644 index 54bd68fc2c84..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogAlertsUpdateSample.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AlertRulePatchObject, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. - * - * @summary Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Update.json - */ -async function patchAnActivityLogAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "187f412d-1758-44d9-b052-169e2564721d"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const activityLogAlertName = "SampleActivityLogAlertRule"; - const activityLogAlertRulePatch: AlertRulePatchObject = { - enabled: false, - tags: { key1: "value1", key2: "value2" } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.activityLogAlerts.update( - resourceGroupName, - activityLogAlertName, - activityLogAlertRulePatch - ); - console.log(result); -} - -async function main() { - patchAnActivityLogAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogsListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogsListSample.ts deleted file mode 100644 index d58594916b8c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/activityLogsListSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ActivityLogsListOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Provides the list of records from the activity logs. - * - * @summary Provides the list of records from the activity logs. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetActivityLogsFiltered.json - */ -async function getActivityLogsWithFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "089bd33f-d4ec-47fe-8ba5-0753aa5c5b33"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.activityLogs.list(filter)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Provides the list of records from the activity logs. - * - * @summary Provides the list of records from the activity logs. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetActivityLogsFilteredAndSelected.json - */ -async function getActivityLogsWithFilterAndSelect() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "089bd33f-d4ec-47fe-8ba5-0753aa5c5b33"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const select = - "eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level"; - const options: ActivityLogsListOptionalParams = { select }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.activityLogs.list(filter, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getActivityLogsWithFilter(); - getActivityLogsWithFilterAndSelect(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRuleIncidentsGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRuleIncidentsGetSample.ts deleted file mode 100644 index fb92424c0220..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRuleIncidentsGetSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets an incident associated to an alert rule - * - * @summary Gets an incident associated to an alert rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getAlertRuleIncident.json - */ -async function getASingleAlertRuleIncident() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "myRuleName"; - const incidentName = "Website_started"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRuleIncidents.get( - resourceGroupName, - ruleName, - incidentName - ); - console.log(result); -} - -async function main() { - getASingleAlertRuleIncident(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRuleIncidentsListByAlertRuleSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRuleIncidentsListByAlertRuleSample.ts deleted file mode 100644 index 0dc8d87947d2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRuleIncidentsListByAlertRuleSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a list of incidents associated to an alert rule - * - * @summary Gets a list of incidents associated to an alert rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRuleIncidents.json - */ -async function listAlertRuleIncidents() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "myRuleName"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.alertRuleIncidents.listByAlertRule( - resourceGroupName, - ruleName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAlertRuleIncidents(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesCreateOrUpdateSample.ts deleted file mode 100644 index dfe78856925c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesCreateOrUpdateSample.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AlertRuleResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates a classic metric alert rule. - * - * @summary Creates or updates a classic metric alert rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/createOrUpdateAlertRule.json - */ -async function createOrUpdateAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "chiricutin"; - const parameters: AlertRuleResource = { - namePropertiesName: "chiricutin", - description: "Pura Vida", - actions: [], - condition: { - dataSource: { - metricName: "Requests", - odataType: - "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource", - resourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest" - }, - odataType: - "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition", - operator: "GreaterThan", - threshold: 3, - timeAggregation: "Total", - windowSize: "PT5M" - }, - isEnabled: true, - location: "West US", - tags: {} - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesDeleteSample.ts deleted file mode 100644 index 6bd0b7f8913b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesDeleteSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a classic metric alert rule - * - * @summary Deletes a classic metric alert rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteAlertRule.json - */ -async function deleteAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRules.delete(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - deleteAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesGetSample.ts deleted file mode 100644 index 1eed90dfd819..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesGetSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a classic metric alert rule - * - * @summary Gets a classic metric alert rule - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getAlertRule.json - */ -async function getAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRules.get(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - getAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesListByResourceGroupSample.ts deleted file mode 100644 index 3b5450f105b0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the classic metric alert rules within a resource group. - * - * @summary List the classic metric alert rules within a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRule.json - */ -async function listAlertRules() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.alertRules.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAlertRules(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesListBySubscriptionSample.ts deleted file mode 100644 index 04a8b5846cd7..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the classic metric alert rules within a subscription. - * - * @summary List the classic metric alert rules within a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRuleBySubscription.json - */ -async function listAlertRules() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.alertRules.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAlertRules(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesUpdateSample.ts deleted file mode 100644 index 5096a58eb37f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/alertRulesUpdateSample.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AlertRuleResourcePatch, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/patchAlertRule.json - */ -async function patchAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG"; - const ruleName = "chiricutin"; - const alertRulesResource: AlertRuleResourcePatch = { - name: "chiricutin", - description: "Pura Vida", - actions: [], - condition: { - dataSource: { - metricName: "Requests", - odataType: - "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource", - resourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest" - }, - odataType: - "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition", - operator: "GreaterThan", - threshold: 3, - timeAggregation: "Total", - windowSize: "PT5M" - }, - isEnabled: true, - tags: { - $type: - "Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary" - } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.alertRules.update( - resourceGroupName, - ruleName, - alertRulesResource - ); - console.log(result); -} - -async function main() { - patchAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsCreateOrUpdateSample.ts deleted file mode 100644 index 9c9021581f86..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsCreateOrUpdateSample.ts +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AutoscaleSettingResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates an autoscale setting. - * - * @summary Creates or updates an autoscale setting. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/createOrUpdateAutoscaleSetting.json - */ -async function createOrUpdateAnAutoscaleSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const autoscaleSettingName = "MySetting"; - const parameters: AutoscaleSettingResource = { - enabled: true, - location: "West US", - notifications: [ - { - email: { - customEmails: ["gu@ms.com", "ge@ns.net"], - sendToSubscriptionAdministrator: true, - sendToSubscriptionCoAdministrators: true - }, - operation: "Scale", - webhooks: [{ properties: {}, serviceUri: "http://myservice.com" }] - } - ], - predictiveAutoscalePolicy: { scaleMode: "Enabled" }, - profiles: [ - { - name: "adios", - capacity: { default: "1", maximum: "10", minimum: "1" }, - fixedDate: { - end: new Date("2015-03-05T14:30:00Z"), - start: new Date("2015-03-05T14:00:00Z"), - timeZone: "UTC" - }, - rules: [ - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 10, - timeAggregation: "Average", - timeGrain: "PT1M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT5M", - direction: "Increase", - value: "1" - } - }, - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 15, - timeAggregation: "Average", - timeGrain: "PT2M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT6M", - direction: "Decrease", - value: "2" - } - } - ] - }, - { - name: "saludos", - capacity: { default: "1", maximum: "10", minimum: "1" }, - recurrence: { - frequency: "Week", - schedule: { days: ["1"], hours: [5], minutes: [15], timeZone: "UTC" } - }, - rules: [ - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 10, - timeAggregation: "Average", - timeGrain: "PT1M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT5M", - direction: "Increase", - value: "1" - } - }, - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 15, - timeAggregation: "Average", - timeGrain: "PT2M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT6M", - direction: "Decrease", - value: "2" - } - } - ] - } - ], - tags: { key1: "value1", key2: "value2" }, - targetResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.autoscaleSettings.createOrUpdate( - resourceGroupName, - autoscaleSettingName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateAnAutoscaleSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsDeleteSample.ts deleted file mode 100644 index d40921fc31be..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes and autoscale setting - * - * @summary Deletes and autoscale setting - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/deleteAutoscaleSetting.json - */ -async function deleteAnAutoscaleSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const autoscaleSettingName = "MySetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.autoscaleSettings.delete( - resourceGroupName, - autoscaleSettingName - ); - console.log(result); -} - -async function main() { - deleteAnAutoscaleSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsGetSample.ts deleted file mode 100644 index 8d41ae5c506b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets an autoscale setting - * - * @summary Gets an autoscale setting - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/getAutoscaleSetting.json - */ -async function getAnAutoscaleSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const autoscaleSettingName = "MySetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.autoscaleSettings.get( - resourceGroupName, - autoscaleSettingName - ); - console.log(result); -} - -async function main() { - getAnAutoscaleSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsListByResourceGroupSample.ts deleted file mode 100644 index 27a63fcea6f6..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the autoscale settings for a resource group - * - * @summary Lists the autoscale settings for a resource group - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/listAutoscaleSetting.json - */ -async function listAutoscaleSettings() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.autoscaleSettings.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAutoscaleSettings(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsListBySubscriptionSample.ts deleted file mode 100644 index 726e2114046d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the autoscale settings for a subscription - * - * @summary Lists the autoscale settings for a subscription - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/listAutoscaleSettingBySubscription.json - */ -async function listAutoscaleSettingsBySubs() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.autoscaleSettings.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAutoscaleSettingsBySubs(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsUpdateSample.ts deleted file mode 100644 index 5b30e31e28df..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/autoscaleSettingsUpdateSample.ts +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AutoscaleSettingResourcePatch, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/patchAutoscaleSetting.json - */ -async function patchAnAutoscaleSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "TestingMetricsScaleSet"; - const autoscaleSettingName = "MySetting"; - const autoscaleSettingResource: AutoscaleSettingResourcePatch = { - enabled: true, - notifications: [ - { - email: { - customEmails: ["gu@ms.com", "ge@ns.net"], - sendToSubscriptionAdministrator: true, - sendToSubscriptionCoAdministrators: true - }, - operation: "Scale", - webhooks: [{ properties: {}, serviceUri: "http://myservice.com" }] - } - ], - predictiveAutoscalePolicy: { scaleMode: "Enabled" }, - profiles: [ - { - name: "adios", - capacity: { default: "1", maximum: "10", minimum: "1" }, - fixedDate: { - end: new Date("2015-03-05T14:30:00Z"), - start: new Date("2015-03-05T14:00:00Z"), - timeZone: "UTC" - }, - rules: [ - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 10, - timeAggregation: "Average", - timeGrain: "PT1M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT5M", - direction: "Increase", - value: "1" - } - }, - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 15, - timeAggregation: "Average", - timeGrain: "PT2M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT6M", - direction: "Decrease", - value: "2" - } - } - ] - }, - { - name: "saludos", - capacity: { default: "1", maximum: "10", minimum: "1" }, - recurrence: { - frequency: "Week", - schedule: { days: ["1"], hours: [5], minutes: [15], timeZone: "UTC" } - }, - rules: [ - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 10, - timeAggregation: "Average", - timeGrain: "PT1M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT5M", - direction: "Increase", - value: "1" - } - }, - { - metricTrigger: { - dividePerInstance: false, - metricName: "Percentage CPU", - metricResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", - operator: "GreaterThan", - statistic: "Average", - threshold: 15, - timeAggregation: "Average", - timeGrain: "PT2M", - timeWindow: "PT5M" - }, - scaleAction: { - type: "ChangeCount", - cooldown: "PT6M", - direction: "Decrease", - value: "2" - } - } - ] - } - ], - tags: { key1: "value1" }, - targetResourceUri: - "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.autoscaleSettings.update( - resourceGroupName, - autoscaleSettingName, - autoscaleSettingResource - ); - console.log(result); -} - -async function main() { - patchAnAutoscaleSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesCreateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesCreateSample.ts deleted file mode 100644 index cd950812a39c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesCreateSample.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AzureMonitorWorkspaceResource, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create or update a workspace - * - * @summary Create or update a workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesCreate.json - */ -async function createOrUpdateWorkspace() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const azureMonitorWorkspaceName = "myAzureMonitorWorkspace"; - const azureMonitorWorkspaceProperties: AzureMonitorWorkspaceResource = { - location: "eastus" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.azureMonitorWorkspaces.create( - resourceGroupName, - azureMonitorWorkspaceName, - azureMonitorWorkspaceProperties - ); - console.log(result); -} - -async function main() { - createOrUpdateWorkspace(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesDeleteSample.ts deleted file mode 100644 index 540b8c1a8c3e..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a workspace - * - * @summary Delete a workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesDelete.json - */ -async function deleteWorkspace() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const azureMonitorWorkspaceName = "myAzureMonitorWorkspace"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.azureMonitorWorkspaces.delete( - resourceGroupName, - azureMonitorWorkspaceName - ); - console.log(result); -} - -async function main() { - deleteWorkspace(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesGetSample.ts deleted file mode 100644 index 9d42224702c5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns the specific Azure Monitor workspace - * - * @summary Returns the specific Azure Monitor workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesGet.json - */ -async function getWorkspace() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const azureMonitorWorkspaceName = "myAzureMonitorWorkspace"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.azureMonitorWorkspaces.get( - resourceGroupName, - azureMonitorWorkspaceName - ); - console.log(result); -} - -async function main() { - getWorkspace(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesListByResourceGroupSample.ts deleted file mode 100644 index d33e9e1033e5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all workspaces in the specified resource group - * - * @summary Lists all workspaces in the specified resource group - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesListByResourceGroup.json - */ -async function listMonitorWorkspacesByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.azureMonitorWorkspaces.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listMonitorWorkspacesByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesListBySubscriptionSample.ts deleted file mode 100644 index 67073eac8ea5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all workspaces in the specified subscription - * - * @summary Lists all workspaces in the specified subscription - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesListBySubscription.json - */ -async function listWorkspacesBySubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.azureMonitorWorkspaces.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listWorkspacesBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesUpdateSample.ts deleted file mode 100644 index 16f3bf41e057..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/azureMonitorWorkspacesUpdateSample.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AzureMonitorWorkspaceResourceForUpdate, - AzureMonitorWorkspacesUpdateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates part of a workspace - * - * @summary Updates part of a workspace - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesUpdate.json - */ -async function updateWorkspace() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const azureMonitorWorkspaceName = "myAzureMonitorWorkspace"; - const azureMonitorWorkspaceProperties: AzureMonitorWorkspaceResourceForUpdate = { - tags: { tag1: "A", tag2: "B", tag3: "C" } - }; - const options: AzureMonitorWorkspacesUpdateOptionalParams = { - azureMonitorWorkspaceProperties - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.azureMonitorWorkspaces.update( - resourceGroupName, - azureMonitorWorkspaceName, - options - ); - console.log(result); -} - -async function main() { - updateWorkspace(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/baselinesListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/baselinesListSample.ts deleted file mode 100644 index 14eb069dd324..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/baselinesListSample.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BaselinesListOptionalParams, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to **Lists the metric baseline values for a resource**. - * - * @summary **Lists the metric baseline values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2019-03-01/examples/metricBaselines.json - */ -async function getMetricBaselines() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1"; - const timespan = "2019-03-12T11:00:00.000Z/2019-03-12T12:00:00.000Z"; - const interval = "PT1H"; - const aggregation = "average"; - const sensitivities = "Low,Medium"; - const options: BaselinesListOptionalParams = { - timespan, - interval, - aggregation, - sensitivities - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.baselines.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getMetricBaselines(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsCreateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsCreateSample.ts deleted file mode 100644 index 519b967cab5f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsCreateSample.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DataCollectionEndpointResource, - DataCollectionEndpointsCreateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates a data collection endpoint. - * - * @summary Creates or updates a data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsCreate.json - */ -async function createOrUpdateDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myCollectionEndpoint"; - const body: DataCollectionEndpointResource = { - location: "eastus", - networkAcls: { publicNetworkAccess: "Enabled" } - }; - const options: DataCollectionEndpointsCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionEndpoints.create( - resourceGroupName, - dataCollectionEndpointName, - options - ); - console.log(result); -} - -async function main() { - createOrUpdateDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsDeleteSample.ts deleted file mode 100644 index 7a0edbdcc6fb..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a data collection endpoint. - * - * @summary Deletes a data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsDelete.json - */ -async function deleteDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myCollectionEndpoint"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionEndpoints.delete( - resourceGroupName, - dataCollectionEndpointName - ); - console.log(result); -} - -async function main() { - deleteDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsGetSample.ts deleted file mode 100644 index 8b65d70d4b9f..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns the specified data collection endpoint. - * - * @summary Returns the specified data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsGet.json - */ -async function getDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myCollectionEndpoint"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionEndpoints.get( - resourceGroupName, - dataCollectionEndpointName - ); - console.log(result); -} - -async function main() { - getDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsListByResourceGroupSample.ts deleted file mode 100644 index 733401f8e149..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all data collection endpoints in the specified resource group. - * - * @summary Lists all data collection endpoints in the specified resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListByResourceGroup.json - */ -async function listDataCollectionEndpointsByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionEndpoints.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDataCollectionEndpointsByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsListBySubscriptionSample.ts deleted file mode 100644 index f9a0d214965b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all data collection endpoints in the specified subscription - * - * @summary Lists all data collection endpoints in the specified subscription - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsListBySubscription.json - */ -async function listDataCollectionEndpointsBySubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionEndpoints.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDataCollectionEndpointsBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsUpdateSample.ts deleted file mode 100644 index b0b5564c3a59..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionEndpointsUpdateSample.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ResourceForUpdate, - DataCollectionEndpointsUpdateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates part of a data collection endpoint. - * - * @summary Updates part of a data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionEndpointsUpdate.json - */ -async function updateDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myCollectionEndpoint"; - const body: ResourceForUpdate = { tags: { tag1: "A", tag2: "B", tag3: "C" } }; - const options: DataCollectionEndpointsUpdateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionEndpoints.update( - resourceGroupName, - dataCollectionEndpointName, - options - ); - console.log(result); -} - -async function main() { - updateDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsCreateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsCreateSample.ts deleted file mode 100644 index 758df428def8..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsCreateSample.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DataCollectionRuleAssociationProxyOnlyResource, - DataCollectionRuleAssociationsCreateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates an association. - * - * @summary Creates or updates an association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsCreate.json - */ -async function createOrUpdateAssociation() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const associationName = "myAssociation"; - const body: DataCollectionRuleAssociationProxyOnlyResource = { - dataCollectionRuleId: - "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule" - }; - const options: DataCollectionRuleAssociationsCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRuleAssociations.create( - resourceUri, - associationName, - options - ); - console.log(result); -} - -async function main() { - createOrUpdateAssociation(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsDeleteSample.ts deleted file mode 100644 index 1034e30e337a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes an association. - * - * @summary Deletes an association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsDelete.json - */ -async function deleteAssociation() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const associationName = "myAssociation"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRuleAssociations.delete( - resourceUri, - associationName - ); - console.log(result); -} - -async function main() { - deleteAssociation(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsGetSample.ts deleted file mode 100644 index 35540040a92e..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns the specified association. - * - * @summary Returns the specified association. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsGet.json - */ -async function getAssociation() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const associationName = "myAssociation"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRuleAssociations.get( - resourceUri, - associationName - ); - console.log(result); -} - -async function main() { - getAssociation(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.ts deleted file mode 100644 index 6d97bace404b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByDataCollectionEndpointSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists associations for the specified data collection endpoint. - * - * @summary Lists associations for the specified data collection endpoint. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByDataCollectionEndpoint.json - */ -async function listAssociationsForSpecifiedDataCollectionEndpoint() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionEndpointName = "myDataCollectionEndpointName"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRuleAssociations.listByDataCollectionEndpoint( - resourceGroupName, - dataCollectionEndpointName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAssociationsForSpecifiedDataCollectionEndpoint(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByResourceSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByResourceSample.ts deleted file mode 100644 index 11ffcd21d8f5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByResourceSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists associations for the specified resource. - * - * @summary Lists associations for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByResource.json - */ -async function listAssociationsForSpecifiedResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRuleAssociations.listByResource( - resourceUri - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAssociationsForSpecifiedResource(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByRuleSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByRuleSample.ts deleted file mode 100644 index 6cccd9d83a75..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRuleAssociationsListByRuleSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists associations for the specified data collection rule. - * - * @summary Lists associations for the specified data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRuleAssociationsListByRule.json - */ -async function listAssociationsForSpecifiedDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRuleAssociations.listByRule( - resourceGroupName, - dataCollectionRuleName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAssociationsForSpecifiedDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesCreateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesCreateSample.ts deleted file mode 100644 index db801c866f14..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesCreateSample.ts +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DataCollectionRuleResource, - DataCollectionRulesCreateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates a data collection rule. - * - * @summary Creates or updates a data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesCreate.json - */ -async function createOrUpdateDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const body: DataCollectionRuleResource = { - dataFlows: [ - { - destinations: ["centralWorkspace"], - streams: [ - "Microsoft-Perf", - "Microsoft-Syslog", - "Microsoft-WindowsEvent" - ] - } - ], - dataSources: { - performanceCounters: [ - { - name: "cloudTeamCoreCounters", - counterSpecifiers: [ - "\\Processor(_Total)\\% Processor Time", - "\\Memory\\Committed Bytes", - "\\LogicalDisk(_Total)\\Free Megabytes", - "\\PhysicalDisk(_Total)\\Avg. Disk Queue Length" - ], - samplingFrequencyInSeconds: 15, - streams: ["Microsoft-Perf"] - }, - { - name: "appTeamExtraCounters", - counterSpecifiers: ["\\Process(_Total)\\Thread Count"], - samplingFrequencyInSeconds: 30, - streams: ["Microsoft-Perf"] - } - ], - syslog: [ - { - name: "cronSyslog", - facilityNames: ["cron"], - logLevels: ["Debug", "Critical", "Emergency"], - streams: ["Microsoft-Syslog"] - }, - { - name: "syslogBase", - facilityNames: ["syslog"], - logLevels: ["Alert", "Critical", "Emergency"], - streams: ["Microsoft-Syslog"] - } - ], - windowsEventLogs: [ - { - name: "cloudSecurityTeamEvents", - streams: ["Microsoft-WindowsEvent"], - xPathQueries: ["Security!"] - }, - { - name: "appTeam1AppEvents", - streams: ["Microsoft-WindowsEvent"], - xPathQueries: [ - "System![System[(Level = 1 or Level = 2 or Level = 3)]]", - "Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]" - ] - } - ] - }, - destinations: { - logAnalytics: [ - { - name: "centralWorkspace", - workspaceResourceId: - "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/centralTeamWorkspace" - } - ] - }, - location: "eastus" - }; - const options: DataCollectionRulesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRules.create( - resourceGroupName, - dataCollectionRuleName, - options - ); - console.log(result); -} - -async function main() { - createOrUpdateDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesDeleteSample.ts deleted file mode 100644 index 4becc7faf8c8..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a data collection rule. - * - * @summary Deletes a data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesDelete.json - */ -async function deleteDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRules.delete( - resourceGroupName, - dataCollectionRuleName - ); - console.log(result); -} - -async function main() { - deleteDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesGetSample.ts deleted file mode 100644 index 833b20532bdb..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns the specified data collection rule. - * - * @summary Returns the specified data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesGet.json - */ -async function getDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRules.get( - resourceGroupName, - dataCollectionRuleName - ); - console.log(result); -} - -async function main() { - getDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesListByResourceGroupSample.ts deleted file mode 100644 index 3a5ad5f3084a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all data collection rules in the specified resource group. - * - * @summary Lists all data collection rules in the specified resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListByResourceGroup.json - */ -async function listDataCollectionRulesByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRules.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDataCollectionRulesByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesListBySubscriptionSample.ts deleted file mode 100644 index 509f9ffdb351..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all data collection rules in the specified subscription. - * - * @summary Lists all data collection rules in the specified subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesListBySubscription.json - */ -async function listDataCollectionRulesBySubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.dataCollectionRules.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDataCollectionRulesBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesUpdateSample.ts deleted file mode 100644 index 3cedeb4a88a2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/dataCollectionRulesUpdateSample.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ResourceForUpdate, - DataCollectionRulesUpdateOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates part of a data collection rule. - * - * @summary Updates part of a data collection rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/examples/DataCollectionRulesUpdate.json - */ -async function updateDataCollectionRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "703362b3-f278-4e4b-9179-c76eaf41ffc2"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "myResourceGroup"; - const dataCollectionRuleName = "myCollectionRule"; - const body: ResourceForUpdate = { tags: { tag1: "A", tag2: "B", tag3: "C" } }; - const options: DataCollectionRulesUpdateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.dataCollectionRules.update( - resourceGroupName, - dataCollectionRuleName, - options - ); - console.log(result); -} - -async function main() { - updateDataCollectionRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCategoryGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCategoryGetSample.ts deleted file mode 100644 index 769917b066a8..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCategoryGetSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the diagnostic settings category for the specified resource. - * - * @summary Gets the diagnostic settings category for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingsCategory.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "WorkflowRuntime"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettingsCategory.get(resourceUri, name); - console.log(result); -} - -async function main() { - getsTheDiagnosticSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCategoryListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCategoryListSample.ts deleted file mode 100644 index a7d2472c1194..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCategoryListSample.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the diagnostic settings categories for the specified resource. - * - * @summary Lists the diagnostic settings categories for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettingsCategories.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.diagnosticSettingsCategory.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getsTheDiagnosticSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCreateOrUpdateSample.ts deleted file mode 100644 index 31843adcbddf..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsCreateOrUpdateSample.ts +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { DiagnosticSettingsResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates diagnostic settings for the specified resource. - * - * @summary Creates or updates diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateDiagnosticSetting.json - */ -async function createsOrUpdatesTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const parameters: DiagnosticSettingsResource = { - eventHubAuthorizationRuleId: - "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule", - eventHubName: "myeventhub", - logAnalyticsDestinationType: "Dedicated", - logs: [ - { - categoryGroup: "allLogs", - enabled: true, - retentionPolicy: { days: 0, enabled: false } - } - ], - marketplacePartnerId: - "/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1", - metrics: [ - { - category: "WorkflowMetrics", - enabled: true, - retentionPolicy: { days: 0, enabled: false } - } - ], - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1", - workspaceId: "" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.createOrUpdate( - resourceUri, - name, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates diagnostic settings for the specified resource. - * - * @summary Creates or updates diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateDiagnosticSettingCategory.json - */ -async function createsOrUpdatesTheDiagnosticSettingForCategory() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const parameters: DiagnosticSettingsResource = { - eventHubAuthorizationRuleId: - "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule", - eventHubName: "myeventhub", - logAnalyticsDestinationType: "Dedicated", - logs: [ - { - category: "WorkflowRuntime", - enabled: true, - retentionPolicy: { days: 0, enabled: false } - } - ], - marketplacePartnerId: - "/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1", - metrics: [ - { - category: "WorkflowMetrics", - enabled: true, - retentionPolicy: { days: 0, enabled: false } - } - ], - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1", - workspaceId: "" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.createOrUpdate( - resourceUri, - name, - parameters - ); - console.log(result); -} - -async function main() { - createsOrUpdatesTheDiagnosticSetting(); - createsOrUpdatesTheDiagnosticSettingForCategory(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsDeleteSample.ts deleted file mode 100644 index d99ca747b606..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsDeleteSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes existing diagnostic settings for the specified resource. - * - * @summary Deletes existing diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/deleteDiagnosticSetting.json - */ -async function deletesTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.delete(resourceUri, name); - console.log(result); -} - -async function main() { - deletesTheDiagnosticSetting(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsGetSample.ts deleted file mode 100644 index 51552f38193b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsGetSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the active diagnostic settings for the specified resource. - * - * @summary Gets the active diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSetting.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.get(resourceUri, name); - console.log(result); -} - -/** - * This sample demonstrates how to Gets the active diagnostic settings for the specified resource. - * - * @summary Gets the active diagnostic settings for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingCategory.json - */ -async function getsTheDiagnosticSettingForCategory() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const name = "mysetting"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.diagnosticSettings.get(resourceUri, name); - console.log(result); -} - -async function main() { - getsTheDiagnosticSetting(); - getsTheDiagnosticSettingForCategory(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsListSample.ts deleted file mode 100644 index 0927d272c404..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/diagnosticSettingsListSample.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the active diagnostic settings list for the specified resource. - * - * @summary Gets the active diagnostic settings list for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettings.json - */ -async function getsTheDiagnosticSetting() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.diagnosticSettings.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the active diagnostic settings list for the specified resource. - * - * @summary Gets the active diagnostic settings list for the specified resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettingsCategory.json - */ -async function getsTheDiagnosticSettingForCategory() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.diagnosticSettings.list(resourceUri)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getsTheDiagnosticSetting(); - getsTheDiagnosticSettingForCategory(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/eventCategoriesListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/eventCategoriesListSample.ts deleted file mode 100644 index 43a5ac1c8845..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/eventCategoriesListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the list of available event categories supported in the Activity Logs Service.
The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. - * - * @summary Get the list of available event categories supported in the Activity Logs Service.
The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetEventCategories.json - */ -async function getEventCategories() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.eventCategories.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getEventCategories(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesCreateOrUpdateSample.ts deleted file mode 100644 index ace58a8b0b8e..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesCreateOrUpdateSample.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { LogProfileResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create or update a log profile in Azure Monitoring REST API. - * - * @summary Create or update a log profile in Azure Monitoring REST API. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/createOrUpdateLogProfile.json - */ -async function createOrUpdateALogProfile() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "df602c9c-7aa0-407d-a6fb-eb20c8bd1192"; - const logProfileName = "Rac46PostSwapRG"; - const parameters: LogProfileResource = { - categories: ["Write", "Delete", "Action"], - location: "", - locations: ["global"], - retentionPolicy: { days: 3, enabled: true }, - serviceBusRuleId: "", - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162", - tags: {} - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.logProfiles.createOrUpdate( - logProfileName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateALogProfile(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesDeleteSample.ts deleted file mode 100644 index c264d326b6a3..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesDeleteSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes the log profile. - * - * @summary Deletes the log profile. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteLogProfile.json - */ -async function deleteLogProfile() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "b67f7fec-69fc-4974-9099-a26bd6ffeda3"; - const logProfileName = "Rac46PostSwapRG"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.logProfiles.delete(logProfileName); - console.log(result); -} - -async function main() { - deleteLogProfile(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesGetSample.ts deleted file mode 100644 index 9e2f9f31105a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesGetSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the log profile. - * - * @summary Gets the log profile. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getLogProfile.json - */ -async function getLogProfile() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "df602c9c-7aa0-407d-a6fb-eb20c8bd1192"; - const logProfileName = "default"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.logProfiles.get(logProfileName); - console.log(result); -} - -async function main() { - getLogProfile(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesListSample.ts deleted file mode 100644 index 717850be0c5a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the log profiles. - * - * @summary List the log profiles. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listLogProfile.json - */ -async function listLogProfiles() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "df602c9c-7aa0-407d-a6fb-eb20c8bd1192"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.logProfiles.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listLogProfiles(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesUpdateSample.ts deleted file mode 100644 index 32c9825f24f7..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/logProfilesUpdateSample.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { LogProfileResourcePatch, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/patchLogProfile.json - */ -async function patchALogProfile() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "df602c9c-7aa0-407d-a6fb-eb20c8bd1192"; - const logProfileName = "Rac46PostSwapRG"; - const logProfilesResource: LogProfileResourcePatch = { - categories: ["Write", "Delete", "Action"], - locations: ["global"], - retentionPolicy: { days: 3, enabled: true }, - serviceBusRuleId: "", - storageAccountId: - "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162", - tags: { key1: "value1" } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.logProfiles.update( - logProfileName, - logProfilesResource - ); - console.log(result); -} - -async function main() { - patchALogProfile(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsCreateOrUpdateSample.ts deleted file mode 100644 index d609df81bd95..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsCreateOrUpdateSample.ts +++ /dev/null @@ -1,504 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MetricAlertResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateDynamicMetricAlertMultipleResource.json - */ -async function createOrUpdateADynamicAlertRuleForMultipleResources() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleResources"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - alertSensitivity: "Medium", - criterionType: "DynamicThresholdCriterion", - dimensions: [], - failingPeriods: { - minFailingPeriodsToAlert: 4, - numberOfEvaluationPeriods: 4 - }, - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterOrLessThan", - timeAggregation: "Average" - } - ], - odataType: - "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1", - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2" - ], - severity: 3, - tags: {}, - targetResourceRegion: "southcentralus", - targetResourceType: "Microsoft.Compute/virtualMachines", - windowSize: "PT15M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateDynamicMetricAlertSingleResource.json - */ -async function createOrUpdateADynamicAlertRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - alertSensitivity: "Medium", - criterionType: "DynamicThresholdCriterion", - dimensions: [], - failingPeriods: { - minFailingPeriodsToAlert: 4, - numberOfEvaluationPeriods: 4 - }, - ignoreDataBefore: new Date("2019-04-04T21:00:00.000Z"), - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterOrLessThan", - timeAggregation: "Average" - } - ], - odataType: - "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" - ], - severity: 3, - tags: {}, - windowSize: "PT15M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateWebTestMetricAlert.json - */ -async function createOrUpdateAWebTestAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "12345678-1234-1234-1234-123456789101"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "rg-example"; - const ruleName = "webtest-name-example"; - const parameters: MetricAlertResource = { - description: - 'Automatically created alert rule for availability test "component-example" a', - actions: [], - criteria: { - componentId: - "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example", - failedLocationCount: 2, - odataType: "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria", - webTestId: - "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example" - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example", - "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example" - ], - severity: 4, - tags: { - "hiddenLink:/subscriptions/12345678123412341234123456789101/resourcegroups/rgExample/providers/microsoftInsights/components/webtestNameExample": - "Resource", - "hiddenLink:/subscriptions/12345678123412341234123456789101/resourcegroups/rgExample/providers/microsoftInsights/webtests/componentExample": - "Resource" - }, - windowSize: "PT15M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertMultipleResource.json - */ -async function createOrUpdateAnAlertRuleForMultipleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleResources"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average" - } - ], - odataType: - "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1", - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2" - ], - severity: 3, - tags: {}, - targetResourceRegion: "southcentralus", - targetResourceType: "Microsoft.Compute/virtualMachines", - windowSize: "PT15M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertSingleResource.json - */ -async function createOrUpdateAnAlertRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "\\Processor(_Total)\\% Processor Time", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average" - } - ], - odataType: "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "Pt1m", - location: "global", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" - ], - severity: 3, - tags: {}, - windowSize: "Pt15m" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertResourceGroup.json - */ -async function createOrUpdateAnAlertRuleOnResourceGroupS() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest1"; - const ruleName = "MetricAlertAtResourceGroupLevel"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average" - } - ], - odataType: - "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1", - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest2" - ], - severity: 3, - tags: {}, - targetResourceRegion: "southcentralus", - targetResourceType: "Microsoft.Compute/virtualMachines", - windowSize: "PT15M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertSubscription.json - */ -async function createOrUpdateAnAlertRuleOnSubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertAtSubscriptionLevel"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "Percentage CPU", - metricNamespace: "microsoft.compute/virtualmachines", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average" - } - ], - odataType: - "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "PT1M", - location: "global", - scopes: ["/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"], - severity: 3, - tags: {}, - targetResourceRegion: "southcentralus", - targetResourceType: "Microsoft.Compute/virtualMachines", - windowSize: "PT15M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an metric alert definition. - * - * @summary Create or update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertWithDimensions.json - */ -async function createOrUpdateAnAlertRulesWithDimensions() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleDimensions"; - const parameters: MetricAlertResource = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "Metric1", - criterionType: "StaticThresholdCriterion", - dimensions: [ - { name: "ActivityName", operator: "Include", values: ["*"] }, - { name: "StatusCode", operator: "Include", values: ["200"] } - ], - metricName: "Availability", - metricNamespace: "Microsoft.KeyVault/vaults", - operator: "GreaterThan", - threshold: 55, - timeAggregation: "Average" - } - ], - odataType: - "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "PT1H", - location: "global", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.KeyVault/vaults/keyVaultResource" - ], - severity: 3, - tags: {}, - windowSize: "P1D" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateADynamicAlertRuleForMultipleResources(); - createOrUpdateADynamicAlertRuleForSingleResource(); - createOrUpdateAWebTestAlertRule(); - createOrUpdateAnAlertRuleForMultipleResource(); - createOrUpdateAnAlertRuleForSingleResource(); - createOrUpdateAnAlertRuleOnResourceGroupS(); - createOrUpdateAnAlertRuleOnSubscription(); - createOrUpdateAnAlertRulesWithDimensions(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsDeleteSample.ts deleted file mode 100644 index 30628e3520d6..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsDeleteSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete an alert rule definition. - * - * @summary Delete an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/deleteMetricAlert.json - */ -async function deleteAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.delete(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - deleteAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsGetSample.ts deleted file mode 100644 index c1b733567e66..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsGetSample.ts +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getDynamicMetricAlertMultipleResource.json - */ -async function getADynamicAlertRuleForMultipleResources() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleResources"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getDynamicMetricAlertSingleResource.json - */ -async function getADynamicAlertRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getWebTestMetricAlert.json - */ -async function getAWebTestAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "12345678-1234-1234-1234-123456789101"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "rg-example"; - const ruleName = "webtest-name-example"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertMultipleResource.json - */ -async function getAnAlertRuleForMultipleResources() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertOnMultipleResources"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertSingleResource.json - */ -async function getAnAlertRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertResourceGroup.json - */ -async function getAnAlertRuleOnResourceGroupS() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest1"; - const ruleName = "MetricAlertAtResourceGroupLevel"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieve an alert rule definition. - * - * @summary Retrieve an alert rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertSubscription.json - */ -async function getAnAlertRuleOnSubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "MetricAlertAtSubscriptionLevel"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.get(resourceGroupName, ruleName); - console.log(result); -} - -async function main() { - getADynamicAlertRuleForMultipleResources(); - getADynamicAlertRuleForSingleResource(); - getAWebTestAlertRule(); - getAnAlertRuleForMultipleResources(); - getAnAlertRuleForSingleResource(); - getAnAlertRuleOnResourceGroupS(); - getAnAlertRuleOnSubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsListByResourceGroupSample.ts deleted file mode 100644 index 3396a7fc63bf..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsListByResourceGroupSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve alert rule definitions in a resource group. - * - * @summary Retrieve alert rule definitions in a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/listMetricAlert.json - */ -async function listMetricAlertRules() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricAlerts.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listMetricAlertRules(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsListBySubscriptionSample.ts deleted file mode 100644 index 8e5e162a5570..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve alert rule definitions in a subscription. - * - * @summary Retrieve alert rule definitions in a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/listMetricAlert.json - */ -async function listMetricAlertRules() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricAlerts.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listMetricAlertRules(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsStatusListByNameSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsStatusListByNameSample.ts deleted file mode 100644 index 37c18dacacb1..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsStatusListByNameSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve an alert rule status. - * - * @summary Retrieve an alert rule status. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertStatusByName.json - */ -async function getAnAlertRuleStatus() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "009f6022-67ec-423e-9aa7-691182870588"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "EastUs"; - const ruleName = "custom1"; - const statusName = - "cmVzb3VyY2VJZD0vc3Vic2NyaXB0aW9ucy8xNGRkZjBjNS03N2M1LTRiNTMtODRmNi1lMWZhNDNhZDY4ZjcvcmVzb3VyY2VHcm91cHMvZ2lndGVzdC9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvdmlydHVhbE1hY2hpbmVzL2dpZ3dhZG1l"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlertsStatus.listByName( - resourceGroupName, - ruleName, - statusName - ); - console.log(result); -} - -async function main() { - getAnAlertRuleStatus(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsStatusListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsStatusListSample.ts deleted file mode 100644 index 250b43d4748c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsStatusListSample.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve an alert rule status. - * - * @summary Retrieve an alert rule status. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertStatus.json - */ -async function getAnAlertRuleStatus() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlertsStatus.list( - resourceGroupName, - ruleName - ); - console.log(result); -} - -async function main() { - getAnAlertRuleStatus(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsUpdateSample.ts deleted file mode 100644 index 28c118771553..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricAlertsUpdateSample.ts +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MetricAlertResourcePatch, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update an metric alert definition. - * - * @summary Update an metric alert definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/UpdateMetricAlert.json - */ -async function createOrUpdateAnAlertRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "gigtest"; - const ruleName = "chiricutin"; - const parameters: MetricAlertResourcePatch = { - description: "This is the description of the rule1", - actions: [ - { - actionGroupId: - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2", - webHookProperties: { key11: "value11", key12: "value12" } - } - ], - autoMitigate: true, - criteria: { - allOf: [ - { - name: "High_CPU_80", - criterionType: "StaticThresholdCriterion", - dimensions: [], - metricName: "\\Processor(_Total)\\% Processor Time", - operator: "GreaterThan", - threshold: 80.5, - timeAggregation: "Average" - } - ], - odataType: "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria" - }, - enabled: true, - evaluationFrequency: "Pt1m", - scopes: [ - "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme" - ], - severity: 3, - tags: {}, - windowSize: "Pt15m" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricAlerts.update( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateAnAlertRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricDefinitionsListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricDefinitionsListSample.ts deleted file mode 100644 index db4ec4a363d5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricDefinitionsListSample.ts +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - MetricDefinitionsListOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the metric definitions for the resource. - * - * @summary Lists the metric definitions for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitionsApplicationInsights.json - */ -async function getApplicationInsightsMetricDefinitionsWithoutFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions"; - const metricnamespace = "microsoft.insights/components"; - const options: MetricDefinitionsListOptionalParams = { metricnamespace }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Lists the metric definitions for the resource. - * - * @summary Lists the metric definitions for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitions.json - */ -async function getMetricDefinitionsWithoutFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricDefinitions"; - const metricnamespace = "Microsoft.Web/sites"; - const options: MetricDefinitionsListOptionalParams = { metricnamespace }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Lists the metric definitions for the resource. - * - * @summary Lists the metric definitions for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricDefinitionsMetricClass.json - */ -async function getStorageCacheMetricDefinitionsWithMetricClass() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"; - const metricnamespace = "microsoft.storagecache/caches"; - const options: MetricDefinitionsListOptionalParams = { metricnamespace }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricDefinitions.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getApplicationInsightsMetricDefinitionsWithoutFilter(); - getMetricDefinitionsWithoutFilter(); - getStorageCacheMetricDefinitionsWithMetricClass(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricNamespacesListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricNamespacesListSample.ts deleted file mode 100644 index 3df200d50713..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricNamespacesListSample.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - MetricNamespacesListOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the metric namespaces for the resource. - * - * @summary Lists the metric namespaces for the resource. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/examples/GetMetricNamespaces.json - */ -async function getMetricNamespacesWithoutFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"; - const startTime = "2020-08-31T15:53:00Z"; - const options: MetricNamespacesListOptionalParams = { startTime }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.metricNamespaces.list(resourceUri, options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getMetricNamespacesWithoutFilter(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricsListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricsListSample.ts deleted file mode 100644 index de1242962f04..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/metricsListSample.ts +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MetricsListOptionalParams, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to **Lists the metric values for a resource**. - * - * @summary **Lists the metric values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetric.json - */ -async function getMetricForData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default"; - const timespan = "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z"; - const interval = "PT1M"; - const aggregation = "Average,count"; - const top = 3; - const orderby = "Average asc"; - const filter = "BlobType eq '*'"; - const metricnamespace = "Microsoft.Storage/storageAccounts/blobServices"; - const options: MetricsListOptionalParams = { - timespan, - interval, - aggregation, - top, - orderby, - filter, - metricnamespace - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.list(resourceUri, options); - console.log(result); -} - -/** - * This sample demonstrates how to **Lists the metric values for a resource**. - * - * @summary **Lists the metric values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricMetadata.json - */ -async function getMetricForMetadata() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default"; - const timespan = "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z"; - const interval = "PT1M"; - const aggregation = "Average,count"; - const top = 3; - const orderby = "Average asc"; - const filter = "BlobType eq '*'"; - const metricnamespace = "Microsoft.Storage/storageAccounts/blobServices"; - const options: MetricsListOptionalParams = { - timespan, - interval, - aggregation, - top, - orderby, - filter, - metricnamespace - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.list(resourceUri, options); - console.log(result); -} - -/** - * This sample demonstrates how to **Lists the metric values for a resource**. - * - * @summary **Lists the metric values for a resource**. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricError.json - */ -async function getMetricWithError() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/ac41e21f-afd6-4a79-8070-f01eba278f97/resourceGroups/todking/providers/Microsoft.DocumentDb/databaseAccounts/tk-cosmos-mongo"; - const timespan = "2021-06-07T21:51:00Z/2021-06-08T01:51:00Z"; - const interval = "FULL"; - const metricnames = "MongoRequestsCount,MongoRequests"; - const aggregation = "average"; - const metricnamespace = "microsoft.documentdb/databaseaccounts"; - const options: MetricsListOptionalParams = { - timespan, - interval, - metricnames, - aggregation, - metricnamespace - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.metricsOperations.list(resourceUri, options); - console.log(result); -} - -async function main() { - getMetricForData(); - getMetricForMetadata(); - getMetricWithError(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/monitorOperationsListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/monitorOperationsListSample.ts deleted file mode 100644 index c39df4e1ffa2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/monitorOperationsListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists available Operations for this Resource Provider - * - * @summary Lists available Operations for this Resource Provider - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/OperationsGet.json - */ -async function getOperationsList() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitorOperations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getOperationsList(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/operationsListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/operationsListSample.ts deleted file mode 100644 index b286ddbb34f4..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all of the available operations from Microsoft.Insights provider. - * - * @summary Lists all of the available operations from Microsoft.Insights provider. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/OperationList.json - */ -async function getAListOfOperationsForAResourceProvider() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.operations.list(); - console.log(result); -} - -async function main() { - getAListOfOperationsForAResourceProvider(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/predictiveMetricGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/predictiveMetricGetSample.ts deleted file mode 100644 index 46141b8812d7..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/predictiveMetricGetSample.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to get predictive autoscale metric future data - * - * @summary get predictive autoscale metric future data - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/GetPredictiveMetric.json - */ -async function getMetricForData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "myRG"; - const autoscaleSettingName = "vmss1-Autoscale-775"; - const timespan = "2021-10-14T22:00:00.000Z/2021-10-16T22:00:00.000Z"; - const interval = "PT1H"; - const metricNamespace = "Microsoft.Compute/virtualMachineScaleSets"; - const metricName = "PercentageCPU"; - const aggregation = "Total"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.predictiveMetric.get( - resourceGroupName, - autoscaleSettingName, - timespan, - interval, - metricNamespace, - metricName, - aggregation - ); - console.log(result); -} - -async function main() { - getMetricForData(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.ts deleted file mode 100644 index 58c9ae6e5230..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { PrivateEndpointConnection, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Approve or reject a private endpoint connection with a given name. - * - * @summary Approve or reject a private endpoint connection with a given name. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionUpdate.json - */ -async function approveOrRejectAPrivateEndpointConnectionWithAGivenName() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const privateEndpointConnectionName = "private-endpoint-connection-name"; - const parameters: PrivateEndpointConnection = { - privateLinkServiceConnectionState: { - description: "Approved by johndoe@contoso.com", - status: "Approved" - } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginCreateOrUpdateAndWait( - resourceGroupName, - scopeName, - privateEndpointConnectionName, - parameters - ); - console.log(result); -} - -async function main() { - approveOrRejectAPrivateEndpointConnectionWithAGivenName(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts deleted file mode 100644 index 3328788b882d..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a private endpoint connection with a given name. - * - * @summary Deletes a private endpoint connection with a given name. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionDelete.json - */ -async function deletesAPrivateEndpointConnectionWithAGivenName() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const privateEndpointConnectionName = "private-endpoint-connection-name"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginDeleteAndWait( - resourceGroupName, - scopeName, - privateEndpointConnectionName - ); - console.log(result); -} - -async function main() { - deletesAPrivateEndpointConnectionWithAGivenName(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsGetSample.ts deleted file mode 100644 index 61b6812cba6a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsGetSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a private endpoint connection. - * - * @summary Gets a private endpoint connection. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionGet.json - */ -async function getsPrivateEndpointConnection() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const privateEndpointConnectionName = "private-endpoint-connection-name"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.get( - resourceGroupName, - scopeName, - privateEndpointConnectionName - ); - console.log(result); -} - -async function main() { - getsPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsListByPrivateLinkScopeSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsListByPrivateLinkScopeSample.ts deleted file mode 100644 index 3ad2bbb647f0..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateEndpointConnectionsListByPrivateLinkScopeSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets all private endpoint connections on a private link scope. - * - * @summary Gets all private endpoint connections on a private link scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionList.json - */ -async function getsListOfPrivateEndpointConnectionsOnAPrivateLinkScope() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.listByPrivateLinkScope( - resourceGroupName, - scopeName - ); - console.log(result); -} - -async function main() { - getsListOfPrivateEndpointConnectionsOnAPrivateLinkScope(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkResourcesGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkResourcesGetSample.ts deleted file mode 100644 index a44ca23c11f4..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkResourcesGetSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @summary Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json - */ -async function getsPrivateEndpointConnection() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const groupName = "azuremonitor"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkResources.get( - resourceGroupName, - scopeName, - groupName - ); - console.log(result); -} - -async function main() { - getsPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkResourcesListByPrivateLinkScopeSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkResourcesListByPrivateLinkScopeSample.ts deleted file mode 100644 index b2d1f95086c2..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkResourcesListByPrivateLinkScopeSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * - * @summary Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopePrivateLinkResourceListGet.json - */ -async function getsPrivateEndpointConnection() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkResources.listByPrivateLinkScope( - resourceGroupName, - scopeName - ); - console.log(result); -} - -async function main() { - getsPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopeOperationStatusGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopeOperationStatusGetSample.ts deleted file mode 100644 index 8f40d8c5a8f5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopeOperationStatusGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the status of an azure asynchronous operation associated with a private link scope operation. - * - * @summary Get the status of an azure asynchronous operation associated with a private link scope operation. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/privateLinkScopeOperationStatuses.json - */ -async function getSpecificOperationStatus() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "613192d7-503f-477a-9cfe-4efc3ee2bd60"; - const asyncOperationId = "713192d7-503f-477a-9cfe-4efc3ee2bd11"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopeOperationStatus.get( - asyncOperationId, - resourceGroupName - ); - console.log(result); -} - -async function main() { - getSpecificOperationStatus(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesCreateOrUpdateSample.ts deleted file mode 100644 index c0e06fc98bfb..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesCreateOrUpdateSample.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ScopedResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Approve or reject a private endpoint connection with a given name. - * - * @summary Approve or reject a private endpoint connection with a given name. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceUpdate.json - */ -async function updateAScopedResourceInAPrivateLinkScope() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const name = "scoped-resource-name"; - const parameters: ScopedResource = { - linkedResourceId: - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/components/my-component" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopedResources.beginCreateOrUpdateAndWait( - resourceGroupName, - scopeName, - name, - parameters - ); - console.log(result); -} - -async function main() { - updateAScopedResourceInAPrivateLinkScope(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesDeleteSample.ts deleted file mode 100644 index da8128cf28d5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesDeleteSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a private endpoint connection with a given name. - * - * @summary Deletes a private endpoint connection with a given name. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceDelete.json - */ -async function deletesAScopedResourceWithAGivenName() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const name = "scoped-resource-name"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopedResources.beginDeleteAndWait( - resourceGroupName, - scopeName, - name - ); - console.log(result); -} - -async function main() { - deletesAScopedResourceWithAGivenName(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesGetSample.ts deleted file mode 100644 index 248dc344aea7..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesGetSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a scoped resource in a private link scope. - * - * @summary Gets a scoped resource in a private link scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceGet.json - */ -async function getsPrivateLinkScopedResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const name = "scoped-resource-name"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopedResources.get( - resourceGroupName, - scopeName, - name - ); - console.log(result); -} - -async function main() { - getsPrivateLinkScopedResource(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesListByPrivateLinkScopeSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesListByPrivateLinkScopeSample.ts deleted file mode 100644 index 2157e3c141ff..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopedResourcesListByPrivateLinkScopeSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets all private endpoint connections on a private link scope. - * - * @summary Gets all private endpoint connections on a private link scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceList.json - */ -async function getsListOfScopedResourcesInAPrivateLinkScope() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "MyResourceGroup"; - const scopeName = "MyPrivateLinkScope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateLinkScopedResources.listByPrivateLinkScope( - resourceGroupName, - scopeName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getsListOfScopedResourcesInAPrivateLinkScope(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesCreateOrUpdateSample.ts deleted file mode 100644 index 484867612812..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesCreateOrUpdateSample.ts +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AzureMonitorPrivateLinkScope, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. - * - * @summary Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesCreate.json - */ -async function privateLinkScopeCreate() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const azureMonitorPrivateLinkScopePayload: AzureMonitorPrivateLinkScope = { - accessModeSettings: { - exclusions: [], - ingestionAccessMode: "Open", - queryAccessMode: "Open" - }, - location: "Global" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.createOrUpdate( - resourceGroupName, - scopeName, - azureMonitorPrivateLinkScopePayload - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. - * - * @summary Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesUpdate.json - */ -async function privateLinkScopeUpdate() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const azureMonitorPrivateLinkScopePayload: AzureMonitorPrivateLinkScope = { - accessModeSettings: { - exclusions: [], - ingestionAccessMode: "Open", - queryAccessMode: "Open" - }, - location: "Global", - tags: { tag1: "Value1" } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.createOrUpdate( - resourceGroupName, - scopeName, - azureMonitorPrivateLinkScopePayload - ); - console.log(result); -} - -async function main() { - privateLinkScopeCreate(); - privateLinkScopeUpdate(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesDeleteSample.ts deleted file mode 100644 index 72fa958e3561..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a Azure Monitor PrivateLinkScope. - * - * @summary Deletes a Azure Monitor PrivateLinkScope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesDelete.json - */ -async function privateLinkScopesDelete() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.beginDeleteAndWait( - resourceGroupName, - scopeName - ); - console.log(result); -} - -async function main() { - privateLinkScopesDelete(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesGetSample.ts deleted file mode 100644 index bc31e306902a..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns a Azure Monitor PrivateLinkScope. - * - * @summary Returns a Azure Monitor PrivateLinkScope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesGet.json - */ -async function privateLinkScopeGet() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.get( - resourceGroupName, - scopeName - ); - console.log(result); -} - -async function main() { - privateLinkScopeGet(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesListByResourceGroupSample.ts deleted file mode 100644 index e5c093f8e3de..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a list of Azure Monitor PrivateLinkScopes within a resource group. - * - * @summary Gets a list of Azure Monitor PrivateLinkScopes within a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesListByResourceGroup.json - */ -async function privateLinkScopeListByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateLinkScopes.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - privateLinkScopeListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesListSample.ts deleted file mode 100644 index 47d4083d2f79..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. - * - * @summary Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesList.json - */ -async function privateLinkScopesListJson() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "86dc51d3-92ed-4d7e-947a-775ea79b4919"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateLinkScopes.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - privateLinkScopesListJson(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesUpdateTagsSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesUpdateTagsSample.ts deleted file mode 100644 index d6956ec9e02c..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/privateLinkScopesUpdateTagsSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { TagsResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. - * - * @summary Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesUpdateTagsOnly.json - */ -async function privateLinkScopeUpdateTagsOnly() { - const subscriptionId = process.env["MONITOR_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "my-resource-group"; - const scopeName = "my-privatelinkscope"; - const privateLinkScopeTags: TagsResource = { - tags: { tag1: "Value1", tag2: "Value2" } - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.privateLinkScopes.updateTags( - resourceGroupName, - scopeName, - privateLinkScopeTags - ); - console.log(result); -} - -async function main() { - privateLinkScopeUpdateTagsOnly(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesCreateOrUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesCreateOrUpdateSample.ts deleted file mode 100644 index c22ab70cb00b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesCreateOrUpdateSample.ts +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ScheduledQueryRuleResource, MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates a scheduled query rule. - * - * @summary Creates or updates a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/createOrUpdateScheduledQueryRule.json - */ -async function createOrUpdateAScheduledQueryRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "perf"; - const parameters: ScheduledQueryRuleResource = { - description: "Performance rule", - actions: { - actionGroups: [ - "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" - ], - customProperties: { key11: "value11", key12: "value12" } - }, - checkWorkspaceAlertsStorageConfigured: true, - criteria: { - allOf: [ - { - dimensions: [ - { - name: "ComputerIp", - operator: "Exclude", - values: ["192.168.1.1"] - }, - { name: "OSType", operator: "Include", values: ["*"] } - ], - failingPeriods: { - minFailingPeriodsToAlert: 1, - numberOfEvaluationPeriods: 1 - }, - metricMeasureColumn: "% Processor Time", - operator: "GreaterThan", - query: 'Perf | where ObjectName == "Processor"', - resourceIdColumn: "resourceId", - threshold: 70, - timeAggregation: "Average" - } - ] - }, - enabled: true, - evaluationFrequency: "PT5M", - location: "eastus", - muteActionsDuration: "PT30M", - ruleResolveConfiguration: { autoResolved: true, timeToResolve: "PT10M" }, - scopes: [ - "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1" - ], - severity: 4, - skipQueryValidation: true, - windowSize: "PT10M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a scheduled query rule. - * - * @summary Creates or updates a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/createOrUpdateScheduledQueryRuleResourceGroup.json - */ -async function createOrUpdateAScheduledQueryRuleOnResourceGroupS() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "heartbeat"; - const parameters: ScheduledQueryRuleResource = { - description: "Health check rule", - actions: { - actionGroups: [ - "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" - ], - customProperties: { key11: "value11", key12: "value12" } - }, - checkWorkspaceAlertsStorageConfigured: true, - criteria: { - allOf: [ - { - dimensions: [], - failingPeriods: { - minFailingPeriodsToAlert: 1, - numberOfEvaluationPeriods: 1 - }, - operator: "GreaterThan", - query: "Heartbeat", - threshold: 360, - timeAggregation: "Count" - } - ] - }, - enabled: true, - evaluationFrequency: "PT5M", - location: "eastus", - muteActionsDuration: "PT30M", - ruleResolveConfiguration: { autoResolved: true, timeToResolve: "PT10M" }, - scopes: [ - "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1" - ], - severity: 4, - skipQueryValidation: true, - targetResourceTypes: ["Microsoft.Compute/virtualMachines"], - windowSize: "PT10M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a scheduled query rule. - * - * @summary Creates or updates a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/createOrUpdateScheduledQueryRuleSubscription.json - */ -async function createOrUpdateAScheduledQueryRuleOnSubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "perf"; - const parameters: ScheduledQueryRuleResource = { - description: "Performance rule", - actions: { - actionGroups: [ - "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" - ], - customProperties: { key11: "value11", key12: "value12" } - }, - checkWorkspaceAlertsStorageConfigured: true, - criteria: { - allOf: [ - { - dimensions: [ - { - name: "ComputerIp", - operator: "Exclude", - values: ["192.168.1.1"] - }, - { name: "OSType", operator: "Include", values: ["*"] } - ], - failingPeriods: { - minFailingPeriodsToAlert: 1, - numberOfEvaluationPeriods: 1 - }, - metricMeasureColumn: "% Processor Time", - operator: "GreaterThan", - query: 'Perf | where ObjectName == "Processor"', - resourceIdColumn: "resourceId", - threshold: 70, - timeAggregation: "Average" - } - ] - }, - enabled: true, - evaluationFrequency: "PT5M", - location: "eastus", - muteActionsDuration: "PT30M", - ruleResolveConfiguration: { autoResolved: true, timeToResolve: "PT10M" }, - scopes: ["/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147"], - severity: 4, - skipQueryValidation: true, - targetResourceTypes: ["Microsoft.Compute/virtualMachines"], - windowSize: "PT10M" - }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.createOrUpdate( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateAScheduledQueryRuleForSingleResource(); - createOrUpdateAScheduledQueryRuleOnResourceGroupS(); - createOrUpdateAScheduledQueryRuleOnSubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesDeleteSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesDeleteSample.ts deleted file mode 100644 index 9e34f0b8d669..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a scheduled query rule. - * - * @summary Deletes a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/deleteScheduledQueryRule.json - */ -async function deleteAScheduledQueryRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "heartbeat"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.delete( - resourceGroupName, - ruleName - ); - console.log(result); -} - -async function main() { - deleteAScheduledQueryRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesGetSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesGetSample.ts deleted file mode 100644 index e77734253abe..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve an scheduled query rule definition. - * - * @summary Retrieve an scheduled query rule definition. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/getScheduledQueryRule.json - */ -async function getAScheduledQueryRuleForSingleResource() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "perf"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.get( - resourceGroupName, - ruleName - ); - console.log(result); -} - -async function main() { - getAScheduledQueryRuleForSingleResource(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesListByResourceGroupSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesListByResourceGroupSample.ts deleted file mode 100644 index f474165d969b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve scheduled query rule definitions in a resource group. - * - * @summary Retrieve scheduled query rule definitions in a resource group. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/listScheduledQueryRulesByResourceGroup.json - */ -async function listScheduledQueryRulesByResourceGroup() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.scheduledQueryRules.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listScheduledQueryRulesByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesListBySubscriptionSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesListBySubscriptionSample.ts deleted file mode 100644 index ec1cce5bfe7b..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieve a scheduled query rule definitions in a subscription. - * - * @summary Retrieve a scheduled query rule definitions in a subscription. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/listScheduledQueryRulesBySubscription.json - */ -async function listScheduledQueryRulesBySubscription() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.scheduledQueryRules.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listScheduledQueryRulesBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesUpdateSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesUpdateSample.ts deleted file mode 100644 index ccadc3a95389..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/scheduledQueryRulesUpdateSample.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ScheduledQueryRuleResourcePatch, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update a scheduled query rule. - * - * @summary Update a scheduled query rule. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/patchScheduledQueryRule.json - */ -async function createOrUpdateAScheduledQueryRule() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "dd4bfc94-a096-412b-9c43-4bd13e35afbc"; - const resourceGroupName = - process.env["MONITOR_RESOURCE_GROUP"] || "QueryResourceGroupName"; - const ruleName = "heartbeat"; - const parameters: ScheduledQueryRuleResourcePatch = { enabled: false }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.scheduledQueryRules.update( - resourceGroupName, - ruleName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateAScheduledQueryRule(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActivityLogsListSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActivityLogsListSample.ts deleted file mode 100644 index 519961fabae5..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/tenantActivityLogsListSample.ts +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - TenantActivityLogsListOptionalParams, - MonitorClient -} from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsFiltered.json - */ -async function getTenantActivityLogsWithFilter() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const options: TenantActivityLogsListOptionalParams = { filter }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsFilteredAndSelected.json - */ -async function getTenantActivityLogsWithFilterAndSelect() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const filter = - "eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"; - const select = - "eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level"; - const options: TenantActivityLogsListOptionalParams = { filter, select }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsSelected.json - */ -async function getTenantActivityLogsWithSelect() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const select = - "eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level"; - const options: TenantActivityLogsListOptionalParams = { select }; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * - * @summary Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsNoParams.json - */ -async function getTenantActivityLogsWithoutFilterOrSelect() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantActivityLogs.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - getTenantActivityLogsWithFilter(); - getTenantActivityLogsWithFilterAndSelect(); - getTenantActivityLogsWithSelect(); - getTenantActivityLogsWithoutFilterOrSelect(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/vmInsightsGetOnboardingStatusSample.ts b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/vmInsightsGetOnboardingStatusSample.ts deleted file mode 100644 index 96e4892e9ecc..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/src/vmInsightsGetOnboardingStatusSample.ts +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MonitorClient } from "@azure/arm-monitor"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusVMScaleSet.json - */ -async function getStatusForAVMScaleSetThatIsActivelyReportingData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/my-service-cluster/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-01"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSingleVMUnknown.json - */ -async function getStatusForAVMThatHasNotYetReportedData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSingleVM.json - */ -async function getStatusForAVMThatIsActivelyReportingData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusResourceGroup.json - */ -async function getStatusForAResourceGroupThatHasAtLeastOneVMThatIsActivelyReportingData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = - "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/resource-group-with-vms"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * - * @summary Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSubscription.json - */ -async function getStatusForASubscriptionThatHasAtLeastOneVMThatIsActivelyReportingData() { - const subscriptionId = - process.env["MONITOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceUri = "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87"; - const credential = new DefaultAzureCredential(); - const client = new MonitorClient(credential, subscriptionId); - const result = await client.vMInsights.getOnboardingStatus(resourceUri); - console.log(result); -} - -async function main() { - getStatusForAVMScaleSetThatIsActivelyReportingData(); - getStatusForAVMThatHasNotYetReportedData(); - getStatusForAVMThatIsActivelyReportingData(); - getStatusForAResourceGroupThatHasAtLeastOneVMThatIsActivelyReportingData(); - getStatusForASubscriptionThatHasAtLeastOneVMThatIsActivelyReportingData(); -} - -main().catch(console.error); diff --git a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/tsconfig.json b/sdk/monitor/arm-monitor/samples/v8-beta/typescript/tsconfig.json deleted file mode 100644 index e26ce2a6d8f7..000000000000 --- a/sdk/monitor/arm-monitor/samples/v8-beta/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020", - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "alwaysStrict": true, - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**.ts" - ] -} diff --git a/sdk/monitor/arm-monitor/src/models/index.ts b/sdk/monitor/arm-monitor/src/models/index.ts index dc51201fb334..838da8239522 100644 --- a/sdk/monitor/arm-monitor/src/models/index.ts +++ b/sdk/monitor/arm-monitor/src/models/index.ts @@ -28,6 +28,278 @@ export type MultiMetricCriteriaUnion = | MetricCriteria | DynamicMetricCriteria; +/** A pageable list of resources */ +export interface AzureMonitorWorkspaceResourceListResult { + /** A list of resources */ + value: AzureMonitorWorkspaceResource[]; + /** The URL to use for getting the next set of results */ + nextLink?: string; +} + +/** Properties of an Azure Monitor Workspace */ +export interface AzureMonitorWorkspace { + /** + * The immutable Id of the Azure Monitor Workspace. This property is read-only. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly accountId?: string; + /** + * Properties related to the metrics container in the Azure Monitor Workspace + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly metrics?: AzureMonitorWorkspaceMetrics; + /** + * The provisioning state of the Azure Monitor Workspace. Set to Succeeded if everything is healthy. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** + * The Data Collection Rule and Endpoint used for ingestion by default. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly defaultIngestionSettings?: AzureMonitorWorkspaceDefaultIngestionSettings; + /** + * List of private endpoint connections + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + /** + * Gets or sets allow or disallow public network access to Azure Monitor Workspace + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly publicNetworkAccess?: PublicNetworkAccess; +} + +/** Properties related to the metrics container in the Azure Monitor Workspace */ +export interface Metrics { + /** + * The Prometheus query endpoint for the Azure Monitor Workspace + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly prometheusQueryEndpoint?: string; + /** + * An internal identifier for the metrics container. Only to be used by the system + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly internalId?: string; +} + +/** Settings for data ingestion */ +export interface IngestionSettings { + /** + * The Azure resource Id of the default data collection rule for this Azure Monitor Workspace. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly dataCollectionRuleResourceId?: string; + /** + * The Azure resource Id of the default data collection endpoint for this Azure Monitor Workspace. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly dataCollectionEndpointResourceId?: string; +} + +/** The private endpoint resource. */ +export interface PrivateEndpoint { + /** + * The ARM identifier for private endpoint. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; +} + +/** A collection of information about the state of the connection between service consumer and provider. */ +export interface PrivateLinkServiceConnectionState { + /** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ + status?: PrivateEndpointServiceConnectionStatus; + /** The reason for approval/rejection of the connection. */ + description?: string; + /** A message indicating if changes on the service provider require any updates on the consumer. */ + actionsRequired?: string; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** + * Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface ResourceAutoGenerated { + /** + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { + /** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly info?: Record; +} + +/** Definition of ARM tracked top level resource properties for the Update operation */ +export interface AzureMonitorWorkspaceResourceForUpdate { + /** Resource tags */ + tags?: { [propertyName: string]: string }; +} + +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface OperationListResult { + /** + * List of operations supported by the resource provider + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Operation[]; + /** + * URL to get the next set of operation list results (if there are any). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { + /** + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; + /** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly origin?: Origin; + /** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly actionType?: ActionType; +} + +/** Localized display information for this particular operation. */ +export interface OperationDisplay { + /** + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provider?: string; + /** + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resource?: string; + /** + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operation?: string; + /** + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; +} + /** Represents a collection of autoscale setting resources. */ export interface AutoscaleSettingResourceCollection { /** the values for the autoscale setting resources. */ @@ -185,7 +457,7 @@ export interface PredictiveAutoscalePolicy { } /** The autoscale setting resource. */ -export interface Resource { +export interface ResourceAutoGenerated2 { /** * Azure resource Id * NOTE: This property will not be serialized. It can only be populated by the server. @@ -212,22 +484,6 @@ export interface Resource { readonly systemData?: SystemData; } -/** Metadata pertaining to creation and last modification of the resource. */ -export interface SystemData { - /** The identity that created the resource. */ - createdBy?: string; - /** The type of identity that created the resource. */ - createdByType?: CreatedByType; - /** The timestamp of resource creation (UTC). */ - createdAt?: Date; - /** The identity that last modified the resource. */ - lastModifiedBy?: string; - /** The type of identity that last modified the resource. */ - lastModifiedByType?: CreatedByType; - /** The timestamp of resource last modification (UTC) */ - lastModifiedAt?: Date; -} - /** Describes the format of Error response. */ export interface AutoscaleErrorResponse { /** The error object. */ @@ -294,23 +550,23 @@ export interface PredictiveValue { } /** Result of the request to list Microsoft.Insights operations. It contains a list of operations and a URL link to get the next set of results. */ -export interface OperationListResult { +export interface OperationListResultAutoGenerated { /** List of operations supported by the Microsoft.Insights provider. */ - value?: Operation[]; + value?: OperationAutoGenerated[]; /** URL to get the next set of operation list results if there are any. */ nextLink?: string; } /** Microsoft Insights API operation definition. */ -export interface Operation { +export interface OperationAutoGenerated { /** Operation name: {provider}/{resource}/{operation} */ name?: string; /** Display metadata associated with the operation. */ - display?: OperationDisplay; + display?: OperationDisplayAutoGenerated; } /** Display metadata associated with the operation. */ -export interface OperationDisplay { +export interface OperationDisplayAutoGenerated { /** Service provider: Microsoft.Insights */ provider?: string; /** Resource on which the operation is performed: AlertRules, Autoscale, etc. */ @@ -349,7 +605,7 @@ export interface Incident { } /** Describes the format of Error response. */ -export interface ErrorResponse { +export interface ErrorResponseAutoGenerated { /** Error code */ code?: string; /** Error message indicating why the operation failed. */ @@ -398,7 +654,7 @@ export interface RuleAction { } /** An azure resource object */ -export interface ResourceAutoGenerated { +export interface ResourceAutoGenerated3 { /** * Azure resource Id * NOTE: This property will not be serialized. It can only be populated by the server. @@ -460,7 +716,7 @@ export interface RetentionPolicy { } /** An azure resource object */ -export interface ResourceAutoGenerated2 { +export interface ResourceAutoGenerated4 { /** * Azure resource Id * NOTE: This property will not be serialized. It can only be populated by the server. @@ -529,7 +785,7 @@ export interface LogSettings { } /** Common fields that are returned in the response for all Azure Resource Manager resources */ -export interface ResourceAutoGenerated3 { +export interface ResourceAutoGenerated5 { /** * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} * NOTE: This property will not be serialized. It can only be populated by the server. @@ -820,6 +1076,169 @@ export interface EnableRequest { receiverName: string; } +/** An email receiver. */ +export interface EmailReceiverAutoGenerated { + /** The name of the email receiver. Names must be unique across all receivers within a tenant action group. */ + name: string; + /** The email address of this receiver. */ + emailAddress: string; + /** Indicates whether to use common alert schema. */ + useCommonAlertSchema?: boolean; + /** + * The receiver status of the e-mail. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: ReceiverStatus; +} + +/** An SMS receiver. */ +export interface SmsReceiverAutoGenerated { + /** The name of the SMS receiver. Names must be unique across all receivers within a tenant action group. */ + name: string; + /** The country code of the SMS receiver. */ + countryCode: string; + /** The phone number of the SMS receiver. */ + phoneNumber: string; + /** + * The status of the receiver. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: ReceiverStatus; +} + +/** A webhook receiver. */ +export interface WebhookReceiverAutoGenerated { + /** The name of the webhook receiver. Names must be unique across all receivers within a tenant action group. */ + name: string; + /** The URI where webhooks should be sent. */ + serviceUri: string; + /** Indicates whether to use common alert schema. */ + useCommonAlertSchema?: boolean; + /** Indicates whether or not use AAD authentication. */ + useAadAuth?: boolean; + /** Indicates the webhook app object Id for aad auth. */ + objectId?: string; + /** Indicates the identifier uri for aad auth. */ + identifierUri?: string; + /** Indicates the tenant id for aad auth. */ + tenantId?: string; +} + +/** The Azure mobile App push notification receiver. */ +export interface AzureAppPushReceiverAutoGenerated { + /** The name of the Azure mobile app push receiver. Names must be unique across all receivers within a tenant action group. */ + name: string; + /** The email address registered for the Azure mobile app. */ + emailAddress: string; +} + +/** A voice receiver. */ +export interface VoiceReceiverAutoGenerated { + /** The name of the voice receiver. Names must be unique across all receivers within a tenant action group. */ + name: string; + /** The country code of the voice receiver. */ + countryCode: string; + /** The phone number of the voice receiver. */ + phoneNumber: string; +} + +/** A tenant action group object for the body of patch operations. */ +export interface ActionGroupPatchBodyAutoGenerated { + /** Resource tags */ + tags?: { [propertyName: string]: string }; + /** Indicates whether this tenant action group is enabled. If a tenant action group is not enabled, then none of its actions will be activated. */ + enabled?: boolean; +} + +/** A list of tenant action groups. */ +export interface TenantActionGroupList { + /** The list of tenant action groups. */ + value?: TenantActionGroupResource[]; + /** Provides the link to retrieve the next set of elements. */ + nextLink?: string; +} + +/** The request body which contain contact detail metadata */ +export interface TenantNotificationRequestBody { + /** The value of the supported alert type. Supported alert type value is: servicehealth */ + alertType: string; + /** The list of email receivers that are part of this action group. */ + emailReceivers?: EmailReceiverAutoGenerated[]; + /** The list of SMS receivers that are part of this action group. */ + smsReceivers?: SmsReceiverAutoGenerated[]; + /** The list of webhook receivers that are part of this action group. */ + webhookReceivers?: WebhookReceiverAutoGenerated[]; + /** The list of AzureAppPush receivers that are part of this action group. */ + azureAppPushReceivers?: AzureAppPushReceiverAutoGenerated[]; + /** The list of voice receivers that are part of this action group. */ + voiceReceivers?: VoiceReceiverAutoGenerated[]; +} + +/** The details of the test notification results. */ +export interface TestNotificationDetailsResponseAutoGenerated { + /** The context info */ + context?: Context; + /** The overall state */ + state: string; + /** The completed time */ + completedTime?: string; + /** The created time */ + createdTime?: string; + /** The list of action detail */ + actionDetails?: ActionDetailAutoGenerated[]; +} + +/** The action detail */ +export interface ActionDetailAutoGenerated { + /** The mechanism type */ + mechanismType?: string; + /** The name of the action */ + name?: string; + /** The status of the action */ + status?: string; + /** The substatus of the action */ + subState?: string; + /** The send time */ + sendTime?: string; + /** The detail of the friendly error message */ + message?: string; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponseAutoGenerated2 { + /** The error object. */ + error?: ErrorDetailAutoGenerated; +} + +/** The error detail. */ +export interface ErrorDetailAutoGenerated { + /** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDetailAutoGenerated[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + /** Represents collection of events. */ export interface EventDataCollection { /** this list that includes the Azure audit logs. */ @@ -989,13 +1408,13 @@ export interface EventCategoryCollection { } /** Represents collection of metric definitions. */ -export interface MetricDefinitionCollection { - /** the values for the metric definitions. */ - value: MetricDefinition[]; +export interface SubscriptionScopeMetricDefinitionCollection { + /** The values for the metric definitions. */ + value: SubscriptionScopeMetricDefinition[]; } /** Metric definition class specifies the metadata for a metric. */ -export interface MetricDefinition { +export interface SubscriptionScopeMetricDefinition { /** Flag to indicate whether the dimension is required. */ isDimensionRequired?: boolean; /** the resource identifier of the resource that emitted the metric. */ @@ -1010,12 +1429,12 @@ export interface MetricDefinition { category?: string; /** The class of the metric. */ metricClass?: MetricClass; - /** The unit of the metric. */ + /** the unit of the metric. */ unit?: MetricUnit; /** the primary aggregation type value defining how to use the values for display. */ - primaryAggregationType?: AggregationType; + primaryAggregationType?: MetricAggregationType; /** the collection of what aggregation types are supported. */ - supportedAggregationTypes?: AggregationType[]; + supportedAggregationTypes?: MetricAggregationType[]; /** the collection of what aggregation intervals are available to be queried. */ metricAvailabilities?: MetricAvailability[]; /** the resource identifier of the metric definition. */ @@ -1032,8 +1451,50 @@ export interface MetricAvailability { retention?: string; } -/** The response to a metrics query. */ -export interface Response { +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.) */ +export interface ErrorContract { + /** The error object. */ + error?: ErrorResponseAutoGenerated; +} + +/** Represents collection of metric definitions. */ +export interface MetricDefinitionCollection { + /** the values for the metric definitions. */ + value: MetricDefinition[]; +} + +/** Metric definition class specifies the metadata for a metric. */ +export interface MetricDefinition { + /** Flag to indicate whether the dimension is required. */ + isDimensionRequired?: boolean; + /** the resource identifier of the resource that emitted the metric. */ + resourceId?: string; + /** the namespace the metric belongs to. */ + namespace?: string; + /** the name and the display name of the metric, i.e. it is a localizable string. */ + name?: LocalizableString; + /** Detailed description of this metric. */ + displayDescription?: string; + /** Custom category name for this metric. */ + category?: string; + /** The class of the metric. */ + metricClass?: MetricClass; + /** the unit of the metric. */ + unit?: MetricUnit; + /** the primary aggregation type value defining how to use the values for display. */ + primaryAggregationType?: AggregationType; + /** the collection of what aggregation types are supported. */ + supportedAggregationTypes?: AggregationType[]; + /** the collection of what aggregation intervals are available to be queried. */ + metricAvailabilities?: MetricAvailability[]; + /** the resource identifier of the metric definition. */ + id?: string; + /** the name and the display name of the dimension, i.e. it is a localizable string. */ + dimensions?: LocalizableString[]; +} + +/** The response to a subscription scope metrics query. */ +export interface SubscriptionScopeMetricResponse { /** The integer value representing the relative cost of the query. */ cost?: number; /** The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by '/'. This may be adjusted in the future and returned back from what was originally requested. */ @@ -1045,11 +1506,11 @@ export interface Response { /** The region of the resource being queried for metrics. */ resourceregion?: string; /** the value of the collection. */ - value: Metric[]; + value: SubscriptionScopeMetric[]; } /** The result data of a query. */ -export interface Metric { +export interface SubscriptionScopeMetric { /** the metric Id. */ id: string; /** the resource type of the metric resource. */ @@ -1100,22 +1561,97 @@ export interface MetricValue { count?: number; } -/** A list of metric baselines. */ -export interface MetricBaselinesResponse { - /** The list of metric baselines. */ - value?: SingleMetricBaseline[]; +/** Query parameters can also be specified in the body, specifying the same parameter in both the body and query parameters will result in an error. */ +export interface SubscriptionScopeMetricsRequestBodyParameters { + /** + * The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'. + * This value should be an ISO-8601 formatted string representing time. E.g. "HH:MM:SS" or "HH:MM:SS.mm". + */ + timespan?: string; + /** The interval (i.e. timegrain) of the query. */ + interval?: string; + /** The names of the metrics (comma separated) to retrieve. */ + metricNames?: string; + /** The list of aggregation types (comma separated) to retrieve. */ + aggregation?: string; + /** The **$filter** is used to reduce the set of metric data returned.
Example:
Metric contains metadata A, B and C.
- Return all time series of C where A = a1 and B = b1 or b2
**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**
- Invalid variant:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**
This is invalid because the logical or operator cannot separate two different metadata names.
- Return all time series where A = a1, B = b1 and C = c1:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**
- Return all time series where A = a1
**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. */ + filter?: string; + /** + * The maximum number of records to retrieve. + * Valid only if $filter is specified. + * Defaults to 10. + */ + top?: number; + /** + * The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * Examples: sum asc. + */ + orderBy?: string; + /** Dimension name(s) to rollup results by. For example if you only want to see metric values with a filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. */ + rollUpBy?: string; + /** Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details. */ + resultType?: MetricResultType; + /** Metric namespace where the metrics you want reside. */ + metricNamespace?: string; + /** When set to true, if the timespan passed in is not supported by this metric, the API will return the result using the closest supported timespan. When set to false, an error is returned for invalid timespan parameters. Defaults to false. */ + autoAdjustTimegrain?: boolean; + /** When set to false, invalid filter parameter values will be ignored. When set to true, an error is returned for invalid filter parameters. Defaults to true. */ + validateDimensions?: boolean; } -/** The baseline results of a single metric. */ -export interface SingleMetricBaseline { - /** The metric baseline Id. */ - id: string; - /** The resource type of the metric baseline resource. */ - type: string; - /** The name of the metric for which the baselines were retrieved. */ - name: string; - /** The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by '/'. This may be adjusted in the future and returned back from what was originally requested. */ - timespan: string; +/** The response to a metrics query. */ +export interface Response { + /** The integer value representing the relative cost of the query. */ + cost?: number; + /** The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by '/'. This may be adjusted in the future and returned back from what was originally requested. */ + timespan: string; + /** The interval (window size) for which the metric data was returned in. This may be adjusted in the future and returned back from what was originally requested. This is not present if a metadata request was made. */ + interval?: string; + /** The namespace of the metrics being queried */ + namespace?: string; + /** The region of the resource being queried for metrics. */ + resourceregion?: string; + /** the value of the collection. */ + value: Metric[]; +} + +/** The result data of a query. */ +export interface Metric { + /** the metric Id. */ + id: string; + /** the resource type of the metric resource. */ + type: string; + /** the name and the display name of the metric, i.e. it is localizable string. */ + name: LocalizableString; + /** Detailed description of this metric. */ + displayDescription?: string; + /** 'Success' or the error details on query failures for this metric. */ + errorCode?: string; + /** Error message encountered querying this specific metric. */ + errorMessage?: string; + /** The unit of the metric. */ + unit: Unit; + /** the time series returned when a data query is performed. */ + timeseries: TimeSeriesElement[]; +} + +/** A list of metric baselines. */ +export interface MetricBaselinesResponse { + /** The list of metric baselines. */ + value?: SingleMetricBaseline[]; +} + +/** The baseline results of a single metric. */ +export interface SingleMetricBaseline { + /** The metric baseline Id. */ + id: string; + /** The resource type of the metric baseline resource. */ + type: string; + /** The name of the metric for which the baselines were retrieved. */ + name: string; + /** The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by '/'. This may be adjusted in the future and returned back from what was originally requested. */ + timespan: string; /** The interval (window size) for which the metric data was returned in. This may be adjusted in the future and returned back from what was originally requested. This is not present if a metadata request was made. */ interval: string; /** The namespace of the metrics been queried. */ @@ -1190,7 +1726,7 @@ export interface MetricAlertAction { } /** An azure resource object */ -export interface ResourceAutoGenerated4 { +export interface ResourceAutoGenerated6 { /** * Azure resource Id * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1470,7 +2006,7 @@ export interface RuleResolveConfiguration { } /** Describes the format of Error response. */ -export interface ErrorContract { +export interface ErrorContractAutoGenerated { /** The error details. */ error?: ErrorResponseDetails; } @@ -1659,7 +2195,7 @@ export interface AzureMonitorPrivateLinkScopeListResult { } /** The Private Endpoint resource. */ -export interface PrivateEndpoint { +export interface PrivateEndpointAutoGenerated { /** * The ARM identifier for Private Endpoint * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1667,16 +2203,6 @@ export interface PrivateEndpoint { readonly id?: string; } -/** A collection of information about the state of the connection between service consumer and provider. */ -export interface PrivateLinkServiceConnectionState { - /** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ - status?: PrivateEndpointServiceConnectionStatus; - /** The reason for approval/rejection of the connection. */ - description?: string; - /** A message indicating if changes on the service provider require any updates on the consumer. */ - actionsRequired?: string; -} - /** Properties that define the scope private link mode settings. */ export interface AccessModeSettings { /** Specifies the default access mode of queries through associated private endpoints in scope. If not specified default value is 'Open'. You can override this default setting for a specific private endpoint connection by adding an exclusion in the 'exclusions' array. */ @@ -1700,50 +2226,7 @@ export interface AccessModeSettingsExclusion { /** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ export interface DefaultErrorResponse { /** The error object. */ - error?: ErrorDetail; -} - -/** The error detail. */ -export interface ErrorDetail { - /** - * The error code. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly code?: string; - /** - * The error message. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly message?: string; - /** - * The error target. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly target?: string; - /** - * The error details. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly details?: ErrorDetail[]; - /** - * The error additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly additionalInfo?: ErrorAdditionalInfo[]; -} - -/** The resource management error additional info. */ -export interface ErrorAdditionalInfo { - /** - * The additional info type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * The additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly info?: Record; + error?: ErrorDetailAutoGenerated; } /** A container holding only the Tags for a resource, allowing the user to update the tags on a PrivateLinkScope instance. */ @@ -1765,7 +2248,7 @@ export interface OperationStatus { /** The status of the operation. */ status?: string; /** The error detail of the operation if any. */ - error?: ErrorDetail; + error?: ErrorDetailAutoGenerated; } /** A list of private link resources */ @@ -1777,7 +2260,7 @@ export interface PrivateLinkResourceListResult { /** List of private endpoint connection associated with the specified storage account */ export interface PrivateEndpointConnectionListResult { /** Array of private endpoint connections */ - value?: PrivateEndpointConnection[]; + value?: PrivateEndpointConnectionAutoGenerated[]; } /** A list of scoped resources in a private link scope. */ @@ -1854,7 +2337,7 @@ export interface AzureResourceAutoGenerated { } /** The error response. */ -export interface ErrorResponseAutoGenerated { +export interface ErrorResponseAutoGenerated3 { /** * The error code. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1899,6 +2382,8 @@ export interface DataCollectionEndpointResource { tags?: { [propertyName: string]: string }; /** The kind of the resource. */ kind?: KnownDataCollectionEndpointResourceKind; + /** Managed service identity of the resource. */ + identity?: DataCollectionEndpointResourceIdentity; /** * Fully qualified ID of the resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1932,6 +2417,8 @@ export interface DataCollectionEndpointResource { configurationAccess?: DataCollectionEndpointConfigurationAccess; /** The endpoint used by clients to ingest logs. */ logsIngestion?: DataCollectionEndpointLogsIngestion; + /** The endpoint used by clients to ingest metrics. */ + metricsIngestion?: DataCollectionEndpointMetricsIngestion; /** Network access control rules for the endpoints. */ networkAcls?: DataCollectionEndpointNetworkAcls; /** @@ -1939,6 +2426,21 @@ export interface DataCollectionEndpointResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: KnownDataCollectionEndpointProvisioningState; + /** + * List of Azure Monitor Private Link Scope Resources to which this data collection endpoint resource is associated. This property is READ-ONLY. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateLinkScopedResources?: PrivateLinkScopedResource[]; + /** + * Failover configuration on this endpoint. This property is READ-ONLY. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly failoverConfiguration?: DataCollectionEndpointFailoverConfiguration; + /** + * Metadata for the resource. This property is READ-ONLY. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly metadata?: DataCollectionEndpointMetadata; } /** Definition of data collection endpoint. */ @@ -1951,6 +2453,8 @@ export interface DataCollectionEndpoint { configurationAccess?: DataCollectionEndpointConfigurationAccess; /** The endpoint used by clients to ingest logs. */ logsIngestion?: DataCollectionEndpointLogsIngestion; + /** The endpoint used by clients to ingest metrics. */ + metricsIngestion?: DataCollectionEndpointMetricsIngestion; /** Network access control rules for the endpoints. */ networkAcls?: DataCollectionEndpointNetworkAcls; /** @@ -1958,6 +2462,21 @@ export interface DataCollectionEndpoint { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: KnownDataCollectionEndpointProvisioningState; + /** + * List of Azure Monitor Private Link Scope Resources to which this data collection endpoint resource is associated. This property is READ-ONLY. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateLinkScopedResources?: PrivateLinkScopedResource[]; + /** + * Failover configuration on this endpoint. This property is READ-ONLY. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly failoverConfiguration?: DataCollectionEndpointFailoverConfiguration; + /** + * Metadata for the resource. This property is READ-ONLY. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly metadata?: DataCollectionEndpointMetadata; } /** Definition of the endpoint used for accessing configuration. */ @@ -1978,22 +2497,102 @@ export interface LogsIngestionEndpointSpec { readonly endpoint?: string; } +/** Definition of the endpoint used for ingesting metrics. */ +export interface MetricsIngestionEndpointSpec { + /** + * The endpoint. This property is READ-ONLY. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly endpoint?: string; +} + /** Definition of the network rules. */ export interface NetworkRuleSet { /** The configuration to set whether network access from public internet to the endpoints are allowed. */ publicNetworkAccess?: KnownPublicNetworkAccessOptions; } +export interface PrivateLinkScopedResource { + /** The resourceId of the Azure Monitor Private Link Scope Scoped Resource through which this DCE is associated with a Azure Monitor Private Link Scope. */ + resourceId?: string; + /** The immutableId of the Azure Monitor Private Link Scope Resource to which the association is. */ + scopeId?: string; +} + +export interface FailoverConfigurationSpec { + /** Active location where data flow will occur. */ + activeLocation?: string; + /** Locations that are configured for failover. */ + locations?: LocationSpec[]; +} + +export interface LocationSpec { + /** Name of location. */ + location?: string; + /** The resource provisioning state in this location. */ + provisioningStatus?: KnownLocationSpecProvisioningStatus; +} + +/** Metadata about the resource */ +export interface Metadata { + /** + * Azure offering managing this resource on-behalf-of customer. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisionedBy?: string; + /** + * Resource Id of azure offering managing this resource on-behalf-of customer. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisionedByResourceId?: string; +} + +/** Managed service identity (system assigned and/or user assigned identities) */ +export interface ManagedServiceIdentity { + /** + * The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ + type: ManagedServiceIdentityType; + /** The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. */ + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentity | null; + }; +} + +/** User assigned identity properties */ +export interface UserAssignedIdentity { + /** + * The principal ID of the assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The client ID of the assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clientId?: string; +} + /** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ export interface ErrorResponseCommonV2 { /** The error object. */ - error?: ErrorDetail; + error?: ErrorDetailAutoGenerated; } /** Definition of ARM tracked top level resource properties for update operation. */ export interface ResourceForUpdate { /** Resource tags. */ tags?: { [propertyName: string]: string }; + /** Managed Service Identity. */ + identity?: ResourceForUpdateIdentity; } /** A pageable list of resources. */ @@ -2069,15 +2668,6 @@ export interface DataCollectionRuleAssociation { readonly metadata?: DataCollectionRuleAssociationMetadata; } -/** Metadata about the resource */ -export interface Metadata { - /** - * Azure offering managing this resource on-behalf-of customer. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisionedBy?: string; -} - /** A pageable list of resources. */ export interface DataCollectionRuleResourceListResult { /** A list of resources. */ @@ -2094,6 +2684,8 @@ export interface DataCollectionRuleResource { tags?: { [propertyName: string]: string }; /** The kind of the resource. */ kind?: KnownDataCollectionRuleResourceKind; + /** Managed service identity of the resource. */ + identity?: DataCollectionRuleResourceIdentity; /** * Fully qualified ID of the resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -2213,6 +2805,14 @@ export interface DataSourcesSpec { logFiles?: LogFilesDataSource[]; /** The list of IIS logs source configurations. */ iisLogs?: IisLogsDataSource[]; + /** The list of Windows Firewall logs source configurations. */ + windowsFirewallLogs?: WindowsFirewallLogsDataSource[]; + /** The list of Prometheus forwarder data source configurations. */ + prometheusForwarder?: PrometheusForwarderDataSource[]; + /** The list of platform telemetry configurations */ + platformTelemetry?: PlatformTelemetryDataSource[]; + /** Specifications of pull based data sources */ + dataImports?: DataSourcesSpecDataImports; } /** @@ -2348,238 +2948,179 @@ export interface IisLogsDataSource { name?: string; } -/** Specification of destinations that can be used in data flows. */ -export interface DestinationsSpec { - /** List of Log Analytics destinations. */ - logAnalytics?: LogAnalyticsDestination[]; - /** Azure Monitor Metrics destination. */ - azureMonitorMetrics?: DestinationsSpecAzureMonitorMetrics; +/** Enables Firewall logs to be collected by this data collection rule. */ +export interface WindowsFirewallLogsDataSource { + /** Firewall logs streams */ + streams: string[]; + /** + * A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + */ + name?: string; } -/** Log Analytics destination. */ -export interface LogAnalyticsDestination { - /** The resource ID of the Log Analytics workspace. */ - workspaceResourceId?: string; +/** Definition of Prometheus metrics forwarding configuration. */ +export interface PrometheusForwarderDataSource { + /** List of streams that this data source will be sent to. */ + streams?: KnownPrometheusForwarderDataSourceStreams[]; /** - * The Customer ID of the Log Analytics workspace. - * NOTE: This property will not be serialized. It can only be populated by the server. + * The list of label inclusion filters in the form of label "name-value" pairs. + * Currently only one label is supported: 'microsoft_metrics_include_label'. + * Label values are matched case-insensitively. */ - readonly workspaceId?: string; + labelIncludeFilter?: { [propertyName: string]: string }; /** - * A friendly name for the destination. - * This name should be unique across all destinations (regardless of type) within the data collection rule. + * A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. */ name?: string; } -/** Azure Monitor Metrics destination. */ -export interface AzureMonitorMetricsDestination { +/** Definition of platform telemetry data source configuration */ +export interface PlatformTelemetryDataSource { + /** List of platform telemetry streams to collect */ + streams: string[]; /** - * A friendly name for the destination. - * This name should be unique across all destinations (regardless of type) within the data collection rule. + * A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. */ name?: string; } -/** Definition of which streams are sent to which destinations. */ -export interface DataFlow { - /** List of streams for this data flow. */ - streams?: KnownDataFlowStreams[]; - /** List of destinations for this data flow. */ - destinations?: string[]; - /** The KQL query to transform stream data. */ - transformKql?: string; - /** The output stream of the transform. Only required if the transform changes data to a different stream. */ - outputStream?: string; -} - -/** A pageable list of resources */ -export interface AzureMonitorWorkspaceResourceListResult { - /** A list of resources */ - value: AzureMonitorWorkspaceResource[]; - /** The URL to use for getting the next set of results */ - nextLink?: string; +export interface DataImportSources { + /** Definition of Event Hub configuration. */ + eventHub?: DataImportSourcesEventHub; } -/** Properties of an Azure Monitor workspace */ -export interface AzureMonitorWorkspace { +export interface EventHubDataSource { /** - * The immutable ID of the Azure Monitor workspace. This property is read-only. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly accountId?: string; - /** - * Information about metrics for the Azure Monitor workspace - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly metrics?: AzureMonitorWorkspaceMetrics; - /** - * The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningState; - /** - * The Data Collection Rule and Endpoint used for ingestion by default. - * NOTE: This property will not be serialized. It can only be populated by the server. + * A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. */ - readonly defaultIngestionSettings?: AzureMonitorWorkspaceDefaultIngestionSettings; + name?: string; + /** Event Hub consumer group name */ + consumerGroup?: string; + /** The stream to collect from EventHub */ + stream?: string; } -/** Information about metrics for the workspace */ -export interface Metrics { - /** - * The Prometheus query endpoint for the workspace - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly prometheusQueryEndpoint?: string; - /** - * An internal identifier for the metrics container. Only to be used by the system - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly internalId?: string; +/** Specification of destinations that can be used in data flows. */ +export interface DestinationsSpec { + /** List of Log Analytics destinations. */ + logAnalytics?: LogAnalyticsDestination[]; + /** List of monitoring account destinations. */ + monitoringAccounts?: MonitoringAccountDestination[]; + /** Azure Monitor Metrics destination. */ + azureMonitorMetrics?: DestinationsSpecAzureMonitorMetrics; + /** List of Event Hubs destinations. */ + eventHubs?: EventHubDestination[]; + /** List of Event Hubs Direct destinations. */ + eventHubsDirect?: EventHubDirectDestination[]; + /** List of Storage Blob Direct destinations. To be used only for sending data directly to store from the agent. */ + storageBlobsDirect?: StorageBlobDestination[]; + /** List of Storage Table Direct destinations. */ + storageTablesDirect?: StorageTableDestination[]; + /** List of storage accounts destinations. */ + storageAccounts?: StorageBlobDestination[]; } -/** Settings for data ingestion */ -export interface IngestionSettings { +/** Log Analytics destination. */ +export interface LogAnalyticsDestination { + /** The resource ID of the Log Analytics workspace. */ + workspaceResourceId?: string; /** - * The Azure resource Id of the default data collection rule for this workspace. + * The Customer ID of the Log Analytics workspace. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly dataCollectionRuleResourceId?: string; + readonly workspaceId?: string; /** - * The Azure resource Id of the default data collection endpoint for this workspace. - * NOTE: This property will not be serialized. It can only be populated by the server. + * A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. */ - readonly dataCollectionEndpointResourceId?: string; + name?: string; } -/** Common fields that are returned in the response for all Azure Resource Manager resources */ -export interface ResourceAutoGenerated5 { - /** - * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; +/** Monitoring account destination. */ +export interface MonitoringAccountDestination { + /** The resource ID of the monitoring account. */ + accountResourceId?: string; /** - * The name of the resource + * The immutable ID of the account. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; - /** - * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; + readonly accountId?: string; /** - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - * NOTE: This property will not be serialized. It can only be populated by the server. + * A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. */ - readonly systemData?: SystemData; -} - -/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ -export interface ErrorResponseAutoGenerated2 { - /** The error object. */ - error?: ErrorDetailAutoGenerated; + name?: string; } -/** The error detail. */ -export interface ErrorDetailAutoGenerated { - /** - * The error code. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly code?: string; - /** - * The error message. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly message?: string; - /** - * The error target. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly target?: string; - /** - * The error details. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly details?: ErrorDetailAutoGenerated[]; +/** Azure Monitor Metrics destination. */ +export interface AzureMonitorMetricsDestination { /** - * The error additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. + * A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. */ - readonly additionalInfo?: ErrorAdditionalInfo[]; -} - -/** Definition of ARM tracked top level resource properties for update operation */ -export interface AzureMonitorWorkspaceResourceForUpdate { - /** Resource tags */ - tags?: { [propertyName: string]: string }; + name?: string; } -/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ -export interface OperationListResultAutoGenerated { +export interface EventHubDestination { + /** The resource ID of the event hub. */ + eventHubResourceId?: string; /** - * List of operations supported by the resource provider - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: OperationAutoGenerated[]; - /** - * URL to get the next set of operation list results (if there are any). - * NOTE: This property will not be serialized. It can only be populated by the server. + * A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. */ - readonly nextLink?: string; + name?: string; } -/** Details of a REST API operation, returned from the Resource Provider Operations API */ -export interface OperationAutoGenerated { - /** - * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; +export interface EventHubDirectDestination { + /** The resource ID of the event hub. */ + eventHubResourceId?: string; /** - * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isDataAction?: boolean; - /** Localized display information for this particular operation. */ - display?: OperationDisplayAutoGenerated; - /** - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly origin?: Origin; - /** - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - * NOTE: This property will not be serialized. It can only be populated by the server. + * A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. */ - readonly actionType?: ActionType; + name?: string; } -/** Localized display information for this particular operation. */ -export interface OperationDisplayAutoGenerated { - /** - * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provider?: string; - /** - * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resource?: string; +export interface StorageBlobDestination { + /** The container name of the Storage Blob. */ + containerName?: string; + /** The resource ID of the storage account. */ + storageAccountResourceId?: string; /** - * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - * NOTE: This property will not be serialized. It can only be populated by the server. + * A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. */ - readonly operation?: string; + name?: string; +} + +export interface StorageTableDestination { + /** The name of the Storage Table. */ + tableName?: string; + /** The resource ID of the storage account. */ + storageAccountResourceId?: string; /** - * The short, localized friendly description of the operation; suitable for tool tips and detailed views. - * NOTE: This property will not be serialized. It can only be populated by the server. + * A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. */ - readonly description?: string; + name?: string; +} + +/** Definition of which streams are sent to which destinations. */ +export interface DataFlow { + /** List of streams for this data flow. */ + streams?: KnownDataFlowStreams[]; + /** List of destinations for this data flow. */ + destinations?: string[]; + /** The KQL query to transform stream data. */ + transformKql?: string; + /** The output stream of the transform. Only required if the transform changes data to a different stream. */ + outputStream?: string; + /** The builtIn transform to transform stream data */ + builtInTransform?: string; } /** The claims for a rule management event data source. */ @@ -2636,8 +3177,52 @@ export interface DynamicThresholdFailingPeriods { minFailingPeriodsToAlert: number; } +/** Resource properties */ +export interface AzureMonitorWorkspaceResourceProperties + extends AzureMonitorWorkspace {} + +/** Properties related to the metrics container in the Azure Monitor Workspace */ +export interface AzureMonitorWorkspaceMetrics extends Metrics {} + +/** The Data Collection Rule and Endpoint used for ingestion by default. */ +export interface AzureMonitorWorkspaceDefaultIngestionSettings + extends IngestionSettings {} + +/** The private endpoint connection resource. */ +export interface PrivateEndpointConnection extends Resource { + /** + * The group ids for the private endpoint resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly groupIds?: string[]; + /** The private endpoint resource. */ + privateEndpoint?: PrivateEndpoint; + /** A collection of information about the state of the connection between service consumer and provider. */ + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; + /** The provisioning state of the private endpoint connection resource. */ + provisioningState?: PrivateEndpointConnectionProvisioningState; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface DataCollectionEndpointResourceSystemData extends SystemData {} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface DataCollectionRuleAssociationProxyOnlyResourceSystemData + extends SystemData {} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface DataCollectionRuleResourceSystemData extends SystemData {} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends ResourceAutoGenerated { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +} + /** The autoscale setting resource. */ -export interface AutoscaleSettingResource extends Resource { +export interface AutoscaleSettingResource extends ResourceAutoGenerated2 { /** the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified. */ profiles: AutoscaleProfile[]; /** the collection of notifications. */ @@ -2654,16 +3239,6 @@ export interface AutoscaleSettingResource extends Resource { targetResourceLocation?: string; } -/** Metadata pertaining to creation and last modification of the resource. */ -export interface DataCollectionEndpointResourceSystemData extends SystemData {} - -/** Metadata pertaining to creation and last modification of the resource. */ -export interface DataCollectionRuleAssociationProxyOnlyResourceSystemData - extends SystemData {} - -/** Metadata pertaining to creation and last modification of the resource. */ -export interface DataCollectionRuleResourceSystemData extends SystemData {} - /** A rule condition based on a metric crossing a threshold. */ export interface ThresholdRuleCondition extends RuleCondition { /** Polymorphic discriminator, which specifies the different types this object can be */ @@ -2749,7 +3324,7 @@ export interface RuleWebhookAction extends RuleAction { } /** The alert rule resource. */ -export interface AlertRuleResource extends ResourceAutoGenerated { +export interface AlertRuleResource extends ResourceAutoGenerated3 { /** the name of the alert rule. */ namePropertiesName: string; /** the description of the alert rule that will be included in the alert email. */ @@ -2772,7 +3347,7 @@ export interface AlertRuleResource extends ResourceAutoGenerated { } /** The log profile resource. */ -export interface LogProfileResource extends ResourceAutoGenerated2 { +export interface LogProfileResource extends ResourceAutoGenerated4 { /** the resource id of the storage account to which you would like to send the Activity Log. */ storageAccountId?: string; /** The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming the Activity Log. The rule ID is of the format: '{service bus resource ID}/authorizationrules/{key name}'. */ @@ -2786,7 +3361,7 @@ export interface LogProfileResource extends ResourceAutoGenerated2 { } /** The diagnostic setting resource. */ -export interface DiagnosticSettingsResource extends ResourceAutoGenerated3 { +export interface DiagnosticSettingsResource extends ResourceAutoGenerated5 { /** * The system metadata related to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -2814,7 +3389,7 @@ export interface DiagnosticSettingsResource extends ResourceAutoGenerated3 { /** The diagnostic settings category resource. */ export interface DiagnosticSettingsCategoryResource - extends ResourceAutoGenerated3 { + extends ResourceAutoGenerated5 { /** * The system metadata related to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -2827,20 +3402,18 @@ export interface DiagnosticSettingsCategoryResource } /** The Private Endpoint Connection resource. */ -export interface PrivateEndpointConnection extends ResourceAutoGenerated3 { +export interface PrivateEndpointConnectionAutoGenerated + extends ResourceAutoGenerated5 { /** The resource of private end point. */ - privateEndpoint?: PrivateEndpoint; + privateEndpoint?: PrivateEndpointAutoGenerated; /** A collection of information about the state of the connection between service consumer and provider. */ privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; - /** - * The provisioning state of the private endpoint connection resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: PrivateEndpointConnectionProvisioningState; + /** The provisioning state of the private endpoint connection resource. */ + provisioningState?: PrivateEndpointConnectionProvisioningState; } /** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ -export interface TrackedResource extends ResourceAutoGenerated3 { +export interface TrackedResourceAutoGenerated extends ResourceAutoGenerated5 { /** Resource tags. */ tags?: { [propertyName: string]: string }; /** The geo-location where the resource lives */ @@ -2848,7 +3421,7 @@ export interface TrackedResource extends ResourceAutoGenerated3 { } /** A private link resource */ -export interface PrivateLinkResource extends ResourceAutoGenerated3 { +export interface PrivateLinkResource extends ResourceAutoGenerated5 { /** * The private link resource group id. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -2864,7 +3437,7 @@ export interface PrivateLinkResource extends ResourceAutoGenerated3 { } /** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ -export interface ProxyResourceAutoGenerated extends ResourceAutoGenerated3 {} +export interface ProxyResourceAutoGenerated extends ResourceAutoGenerated5 {} /** An action group resource. */ export interface ActionGroupResource extends AzureResource { @@ -2896,6 +3469,24 @@ export interface ActionGroupResource extends AzureResource { eventHubReceivers?: EventHubReceiver[]; } +/** A tenant action group resource. */ +export interface TenantActionGroupResource extends AzureResource { + /** The short name of the action group. This will be used in SMS messages. */ + groupShortName?: string; + /** Indicates whether this tenant action group is enabled. If a tenant action group is not enabled, then none of its receivers will receive communications. */ + enabled?: boolean; + /** The list of email receivers that are part of this tenant action group. */ + emailReceivers?: EmailReceiverAutoGenerated[]; + /** The list of SMS receivers that are part of this tenant action group. */ + smsReceivers?: SmsReceiverAutoGenerated[]; + /** The list of webhook receivers that are part of this tenant action group. */ + webhookReceivers?: WebhookReceiverAutoGenerated[]; + /** The list of AzureAppPush receivers that are part of this tenant action group. */ + azureAppPushReceivers?: AzureAppPushReceiverAutoGenerated[]; + /** The list of voice receivers that are part of this tenant action group. */ + voiceReceivers?: VoiceReceiverAutoGenerated[]; +} + /** Specifies the metric alert criteria for a single resource that has multiple metric criteria. */ export interface MetricAlertSingleResourceMultipleMetricCriteria extends MetricAlertCriteria { @@ -2928,7 +3519,7 @@ export interface MetricAlertMultipleResourceMultipleMetricCriteria } /** The metric alert resource. */ -export interface MetricAlertResource extends ResourceAutoGenerated4 { +export interface MetricAlertResource extends ResourceAutoGenerated6 { /** the description of the metric alert that will be included in the alert email. */ description?: string; /** Alert severity {0, 1, 2, 3, 4} */ @@ -3016,12 +3607,19 @@ export interface DataCollectionEndpointConfigurationAccess export interface DataCollectionEndpointLogsIngestion extends LogsIngestionEndpointSpec {} +/** The endpoint used by clients to ingest metrics. */ +export interface DataCollectionEndpointMetricsIngestion + extends MetricsIngestionEndpointSpec {} + /** Network access control rules for the endpoints. */ export interface DataCollectionEndpointNetworkAcls extends NetworkRuleSet {} -/** Resource properties. */ -export interface DataCollectionRuleAssociationProxyOnlyResourceProperties - extends DataCollectionRuleAssociation {} +/** Failover configuration on this endpoint. This property is READ-ONLY. */ +export interface DataCollectionEndpointFailoverConfiguration + extends FailoverConfigurationSpec {} + +/** Metadata for the resource. This property is READ-ONLY. */ +export interface DataCollectionEndpointMetadata extends Metadata {} /** Metadata about the resource */ export interface DataCollectionRuleAssociationMetadata extends Metadata {} @@ -3029,6 +3627,21 @@ export interface DataCollectionRuleAssociationMetadata extends Metadata {} /** Metadata about the resource */ export interface DataCollectionRuleMetadata extends Metadata {} +/** Managed service identity of the resource. */ +export interface DataCollectionEndpointResourceIdentity + extends ManagedServiceIdentity {} + +/** Managed Service Identity. */ +export interface ResourceForUpdateIdentity extends ManagedServiceIdentity {} + +/** Managed service identity of the resource. */ +export interface DataCollectionRuleResourceIdentity + extends ManagedServiceIdentity {} + +/** Resource properties. */ +export interface DataCollectionRuleAssociationProxyOnlyResourceProperties + extends DataCollectionRuleAssociation {} + /** Resource properties. */ export interface DataCollectionRuleResourceProperties extends DataCollectionRule {} @@ -3045,6 +3658,12 @@ export interface LogFilesDataSourceSettings extends LogFileSettings {} /** Text settings */ export interface LogFileSettingsText extends LogFileTextSettings {} +/** Specifications of pull based data sources */ +export interface DataSourcesSpecDataImports extends DataImportSources {} + +/** Definition of Event Hub configuration. */ +export interface DataImportSourcesEventHub extends EventHubDataSource {} + /** The specification of destinations. */ export interface DataCollectionRuleDestinations extends DestinationsSpec {} @@ -3052,25 +3671,6 @@ export interface DataCollectionRuleDestinations extends DestinationsSpec {} export interface DestinationsSpecAzureMonitorMetrics extends AzureMonitorMetricsDestination {} -/** Resource properties */ -export interface AzureMonitorWorkspaceResourceProperties - extends AzureMonitorWorkspace {} - -/** Information about metrics for the Azure Monitor workspace */ -export interface AzureMonitorWorkspaceMetrics extends Metrics {} - -/** The Data Collection Rule and Endpoint used for ingestion by default. */ -export interface AzureMonitorWorkspaceDefaultIngestionSettings - extends IngestionSettings {} - -/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ -export interface TrackedResourceAutoGenerated extends ResourceAutoGenerated5 { - /** Resource tags. */ - tags?: { [propertyName: string]: string }; - /** The geo-location where the resource lives */ - location: string; -} - /** Criterion to filter metrics. */ export interface MetricCriteria extends MultiMetricCriteria { /** Polymorphic discriminator, which specifies the different types this object can be */ @@ -3095,8 +3695,48 @@ export interface DynamicMetricCriteria extends MultiMetricCriteria { ignoreDataBefore?: Date; } +/** An Azure Monitor Workspace definition */ +export interface AzureMonitorWorkspaceResource extends TrackedResource { + /** + * Resource entity tag (ETag) + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly etag?: string; + /** + * The immutable Id of the Azure Monitor Workspace. This property is read-only. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly accountId?: string; + /** + * Properties related to the metrics container in the Azure Monitor Workspace + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly metrics?: AzureMonitorWorkspaceMetrics; + /** + * The provisioning state of the Azure Monitor Workspace. Set to Succeeded if everything is healthy. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** + * The Data Collection Rule and Endpoint used for ingestion by default. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly defaultIngestionSettings?: AzureMonitorWorkspaceDefaultIngestionSettings; + /** + * List of private endpoint connections + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + /** + * Gets or sets allow or disallow public network access to Azure Monitor Workspace + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly publicNetworkAccess?: PublicNetworkAccess; +} + /** An Azure Monitor PrivateLinkScope definition. */ -export interface AzureMonitorPrivateLinkScope extends TrackedResource { +export interface AzureMonitorPrivateLinkScope + extends TrackedResourceAutoGenerated { /** * System data * NOTE: This property will not be serialized. It can only be populated by the server. @@ -3111,7 +3751,7 @@ export interface AzureMonitorPrivateLinkScope extends TrackedResource { * List of private endpoint connections. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly privateEndpointConnections?: PrivateEndpointConnection[]; + readonly privateEndpointConnections?: PrivateEndpointConnectionAutoGenerated[]; /** Access mode settings */ accessModeSettings: AccessModeSettings; } @@ -3132,53 +3772,176 @@ export interface ScopedResource extends ProxyResourceAutoGenerated { readonly provisioningState?: string; } -/** An Azure Monitor Workspace definition */ -export interface AzureMonitorWorkspaceResource - extends TrackedResourceAutoGenerated { - /** - * Resource entity tag (ETag) - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly etag?: string; - /** - * The immutable ID of the Azure Monitor workspace. This property is read-only. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly accountId?: string; - /** - * Information about metrics for the Azure Monitor workspace - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly metrics?: AzureMonitorWorkspaceMetrics; - /** - * The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningState; - /** - * The Data Collection Rule and Endpoint used for ingestion by default. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly defaultIngestionSettings?: AzureMonitorWorkspaceDefaultIngestionSettings; +/** Defines headers for AzureMonitorWorkspaces_delete operation. */ +export interface AzureMonitorWorkspacesDeleteHeaders { + azureAsyncOperation?: string; + location?: string; } -/** Defines headers for ActionGroups_postTestNotifications operation. */ -export interface ActionGroupsPostTestNotificationsHeaders { +/** Defines headers for ActionGroups_createNotificationsAtActionGroupResourceLevel operation. */ +export interface ActionGroupsCreateNotificationsAtActionGroupResourceLevelHeaders { + /** The location header that has the polling uri. */ + location?: string; +} + +/** Defines headers for MonitorClient_createNotificationsAtTenantActionGroupResourceLevel operation. */ +export interface MonitorClientCreateNotificationsAtTenantActionGroupResourceLevelHeaders { /** The location header that has the polling uri. */ location?: string; } -/** Defines headers for ActionGroups_createNotificationsAtResourceGroupLevel operation. */ -export interface ActionGroupsCreateNotificationsAtResourceGroupLevelHeaders { - /** The location header that has the polling uri. */ - location?: string; +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + /** Creating */ + Creating = "Creating", + /** Succeeded */ + Succeeded = "Succeeded", + /** Deleting */ + Deleting = "Deleting", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled" +} + +/** + * Defines values for ProvisioningState. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Creating** \ + * **Succeeded** \ + * **Deleting** \ + * **Failed** \ + * **Canceled** + */ +export type ProvisioningState = string; + +/** Known values of {@link PrivateEndpointServiceConnectionStatus} that the service accepts. */ +export enum KnownPrivateEndpointServiceConnectionStatus { + /** Pending */ + Pending = "Pending", + /** Approved */ + Approved = "Approved", + /** Rejected */ + Rejected = "Rejected" +} + +/** + * Defines values for PrivateEndpointServiceConnectionStatus. \ + * {@link KnownPrivateEndpointServiceConnectionStatus} can be used interchangeably with PrivateEndpointServiceConnectionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Pending** \ + * **Approved** \ + * **Rejected** + */ +export type PrivateEndpointServiceConnectionStatus = string; + +/** Known values of {@link PrivateEndpointConnectionProvisioningState} that the service accepts. */ +export enum KnownPrivateEndpointConnectionProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Creating */ + Creating = "Creating", + /** Deleting */ + Deleting = "Deleting", + /** Failed */ + Failed = "Failed" +} + +/** + * Defines values for PrivateEndpointConnectionProvisioningState. \ + * {@link KnownPrivateEndpointConnectionProvisioningState} can be used interchangeably with PrivateEndpointConnectionProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Creating** \ + * **Deleting** \ + * **Failed** + */ +export type PrivateEndpointConnectionProvisioningState = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + /** User */ + User = "User", + /** Application */ + Application = "Application", + /** ManagedIdentity */ + ManagedIdentity = "ManagedIdentity", + /** Key */ + Key = "Key" +} + +/** + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type CreatedByType = string; + +/** Known values of {@link PublicNetworkAccess} that the service accepts. */ +export enum KnownPublicNetworkAccess { + /** Enabled */ + Enabled = "Enabled", + /** Disabled */ + Disabled = "Disabled", + /** SecuredByPerimeter */ + SecuredByPerimeter = "SecuredByPerimeter" +} + +/** + * Defines values for PublicNetworkAccess. \ + * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** \ + * **SecuredByPerimeter** + */ +export type PublicNetworkAccess = string; + +/** Known values of {@link Origin} that the service accepts. */ +export enum KnownOrigin { + /** User */ + User = "user", + /** System */ + System = "system", + /** UserSystem */ + UserSystem = "user,system" +} + +/** + * Defines values for Origin. \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user** \ + * **system** \ + * **user,system** + */ +export type Origin = string; + +/** Known values of {@link ActionType} that the service accepts. */ +export enum KnownActionType { + /** Internal */ + Internal = "Internal" } -/** Defines headers for ActionGroups_createNotificationsAtActionGroupResourceLevel operation. */ -export interface ActionGroupsCreateNotificationsAtActionGroupResourceLevelHeaders { - /** The location header that has the polling uri. */ - location?: string; -} +/** + * Defines values for ActionType. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal** + */ +export type ActionType = string; /** Known values of {@link ScaleRuleMetricDimensionOperationType} that the service accepts. */ export enum KnownScaleRuleMetricDimensionOperationType { @@ -3198,30 +3961,6 @@ export enum KnownScaleRuleMetricDimensionOperationType { */ export type ScaleRuleMetricDimensionOperationType = string; -/** Known values of {@link CreatedByType} that the service accepts. */ -export enum KnownCreatedByType { - /** User */ - User = "User", - /** Application */ - Application = "Application", - /** ManagedIdentity */ - ManagedIdentity = "ManagedIdentity", - /** Key */ - Key = "Key" -} - -/** - * Defines values for CreatedByType. \ - * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **User** \ - * **Application** \ - * **ManagedIdentity** \ - * **Key** - */ -export type CreatedByType = string; - /** Known values of {@link CategoryType} that the service accepts. */ export enum KnownCategoryType { /** Metrics */ @@ -3318,6 +4057,54 @@ export enum KnownMetricUnit { */ export type MetricUnit = string; +/** Known values of {@link MetricAggregationType} that the service accepts. */ +export enum KnownMetricAggregationType { + /** None */ + None = "None", + /** Average */ + Average = "Average", + /** Count */ + Count = "Count", + /** Minimum */ + Minimum = "Minimum", + /** Maximum */ + Maximum = "Maximum", + /** Total */ + Total = "Total" +} + +/** + * Defines values for MetricAggregationType. \ + * {@link KnownMetricAggregationType} can be used interchangeably with MetricAggregationType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Average** \ + * **Count** \ + * **Minimum** \ + * **Maximum** \ + * **Total** + */ +export type MetricAggregationType = string; + +/** Known values of {@link MetricResultType} that the service accepts. */ +export enum KnownMetricResultType { + /** Data */ + Data = "Data", + /** Metadata */ + Metadata = "Metadata" +} + +/** + * Defines values for MetricResultType. \ + * {@link KnownMetricResultType} can be used interchangeably with MetricResultType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Data** \ + * **Metadata** + */ +export type MetricResultType = string; + /** Known values of {@link BaselineSensitivity} that the service accepts. */ export enum KnownBaselineSensitivity { /** Low */ @@ -3405,27 +4192,6 @@ export enum KnownAlertSeverity { */ export type AlertSeverity = number; -/** Known values of {@link PublicNetworkAccess} that the service accepts. */ -export enum KnownPublicNetworkAccess { - /** Enabled */ - Enabled = "Enabled", - /** Disabled */ - Disabled = "Disabled", - /** SecuredByPerimeter */ - SecuredByPerimeter = "SecuredByPerimeter" -} - -/** - * Defines values for PublicNetworkAccess. \ - * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Enabled** \ - * **Disabled** \ - * **SecuredByPerimeter** - */ -export type PublicNetworkAccess = string; - /** Known values of {@link TimeAggregation} that the service accepts. */ export enum KnownTimeAggregation { /** Count */ @@ -3531,51 +4297,6 @@ export enum KnownDataStatus { */ export type DataStatus = string; -/** Known values of {@link PrivateEndpointServiceConnectionStatus} that the service accepts. */ -export enum KnownPrivateEndpointServiceConnectionStatus { - /** Pending */ - Pending = "Pending", - /** Approved */ - Approved = "Approved", - /** Rejected */ - Rejected = "Rejected" -} - -/** - * Defines values for PrivateEndpointServiceConnectionStatus. \ - * {@link KnownPrivateEndpointServiceConnectionStatus} can be used interchangeably with PrivateEndpointServiceConnectionStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Pending** \ - * **Approved** \ - * **Rejected** - */ -export type PrivateEndpointServiceConnectionStatus = string; - -/** Known values of {@link PrivateEndpointConnectionProvisioningState} that the service accepts. */ -export enum KnownPrivateEndpointConnectionProvisioningState { - /** Succeeded */ - Succeeded = "Succeeded", - /** Creating */ - Creating = "Creating", - /** Deleting */ - Deleting = "Deleting", - /** Failed */ - Failed = "Failed" -} - -/** - * Defines values for PrivateEndpointConnectionProvisioningState. \ - * {@link KnownPrivateEndpointConnectionProvisioningState} can be used interchangeably with PrivateEndpointConnectionProvisioningState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Succeeded** \ - * **Creating** \ - * **Deleting** \ - * **Failed** - */ -export type PrivateEndpointConnectionProvisioningState = string; - /** Known values of {@link AccessMode} that the service accepts. */ export enum KnownAccessMode { /** Open */ @@ -3599,7 +4320,9 @@ export enum KnownKnownPublicNetworkAccessOptions { /** Enabled */ Enabled = "Enabled", /** Disabled */ - Disabled = "Disabled" + Disabled = "Disabled", + /** SecuredByPerimeter */ + SecuredByPerimeter = "SecuredByPerimeter" } /** @@ -3608,7 +4331,8 @@ export enum KnownKnownPublicNetworkAccessOptions { * this enum contains the known values that the service supports. * ### Known values supported by the service * **Enabled** \ - * **Disabled** + * **Disabled** \ + * **SecuredByPerimeter** */ export type KnownPublicNetworkAccessOptions = string; @@ -3622,6 +4346,8 @@ export enum KnownKnownDataCollectionEndpointProvisioningState { Deleting = "Deleting", /** Succeeded */ Succeeded = "Succeeded", + /** Canceled */ + Canceled = "Canceled", /** Failed */ Failed = "Failed" } @@ -3635,10 +4361,41 @@ export enum KnownKnownDataCollectionEndpointProvisioningState { * **Updating** \ * **Deleting** \ * **Succeeded** \ + * **Canceled** \ * **Failed** */ export type KnownDataCollectionEndpointProvisioningState = string; +/** Known values of {@link KnownLocationSpecProvisioningStatus} that the service accepts. */ +export enum KnownKnownLocationSpecProvisioningStatus { + /** Creating */ + Creating = "Creating", + /** Updating */ + Updating = "Updating", + /** Deleting */ + Deleting = "Deleting", + /** Succeeded */ + Succeeded = "Succeeded", + /** Canceled */ + Canceled = "Canceled", + /** Failed */ + Failed = "Failed" +} + +/** + * Defines values for KnownLocationSpecProvisioningStatus. \ + * {@link KnownKnownLocationSpecProvisioningStatus} can be used interchangeably with KnownLocationSpecProvisioningStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Creating** \ + * **Updating** \ + * **Deleting** \ + * **Succeeded** \ + * **Canceled** \ + * **Failed** + */ +export type KnownLocationSpecProvisioningStatus = string; + /** Known values of {@link KnownDataCollectionEndpointResourceKind} that the service accepts. */ export enum KnownKnownDataCollectionEndpointResourceKind { /** Linux */ @@ -3657,6 +4414,30 @@ export enum KnownKnownDataCollectionEndpointResourceKind { */ export type KnownDataCollectionEndpointResourceKind = string; +/** Known values of {@link ManagedServiceIdentityType} that the service accepts. */ +export enum KnownManagedServiceIdentityType { + /** None */ + None = "None", + /** SystemAssigned */ + SystemAssigned = "SystemAssigned", + /** UserAssigned */ + UserAssigned = "UserAssigned", + /** SystemAssignedUserAssigned */ + SystemAssignedUserAssigned = "SystemAssigned,UserAssigned" +} + +/** + * Defines values for ManagedServiceIdentityType. \ + * {@link KnownManagedServiceIdentityType} can be used interchangeably with ManagedServiceIdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **SystemAssigned** \ + * **UserAssigned** \ + * **SystemAssigned,UserAssigned** + */ +export type ManagedServiceIdentityType = string; + /** Known values of {@link KnownDataCollectionRuleAssociationProvisioningState} that the service accepts. */ export enum KnownKnownDataCollectionRuleAssociationProvisioningState { /** Creating */ @@ -3667,6 +4448,8 @@ export enum KnownKnownDataCollectionRuleAssociationProvisioningState { Deleting = "Deleting", /** Succeeded */ Succeeded = "Succeeded", + /** Canceled */ + Canceled = "Canceled", /** Failed */ Failed = "Failed" } @@ -3680,6 +4463,7 @@ export enum KnownKnownDataCollectionRuleAssociationProvisioningState { * **Updating** \ * **Deleting** \ * **Succeeded** \ + * **Canceled** \ * **Failed** */ export type KnownDataCollectionRuleAssociationProvisioningState = string; @@ -3963,6 +4747,21 @@ export enum KnownKnownLogFileTextSettingsRecordStartTimestampFormat { */ export type KnownLogFileTextSettingsRecordStartTimestampFormat = string; +/** Known values of {@link KnownPrometheusForwarderDataSourceStreams} that the service accepts. */ +export enum KnownKnownPrometheusForwarderDataSourceStreams { + /** MicrosoftPrometheusMetrics */ + MicrosoftPrometheusMetrics = "Microsoft-PrometheusMetrics" +} + +/** + * Defines values for KnownPrometheusForwarderDataSourceStreams. \ + * {@link KnownKnownPrometheusForwarderDataSourceStreams} can be used interchangeably with KnownPrometheusForwarderDataSourceStreams, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Microsoft-PrometheusMetrics** + */ +export type KnownPrometheusForwarderDataSourceStreams = string; + /** Known values of {@link KnownDataFlowStreams} that the service accepts. */ export enum KnownKnownDataFlowStreams { /** MicrosoftEvent */ @@ -4000,6 +4799,8 @@ export enum KnownKnownDataCollectionRuleProvisioningState { Deleting = "Deleting", /** Succeeded */ Succeeded = "Succeeded", + /** Canceled */ + Canceled = "Canceled", /** Failed */ Failed = "Failed" } @@ -4013,6 +4814,7 @@ export enum KnownKnownDataCollectionRuleProvisioningState { * **Updating** \ * **Deleting** \ * **Succeeded** \ + * **Canceled** \ * **Failed** */ export type KnownDataCollectionRuleProvisioningState = string; @@ -4035,69 +4837,6 @@ export enum KnownKnownDataCollectionRuleResourceKind { */ export type KnownDataCollectionRuleResourceKind = string; -/** Known values of {@link ProvisioningState} that the service accepts. */ -export enum KnownProvisioningState { - /** Creating */ - Creating = "Creating", - /** Succeeded */ - Succeeded = "Succeeded", - /** Deleting */ - Deleting = "Deleting", - /** Failed */ - Failed = "Failed", - /** Canceled */ - Canceled = "Canceled" -} - -/** - * Defines values for ProvisioningState. \ - * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Creating** \ - * **Succeeded** \ - * **Deleting** \ - * **Failed** \ - * **Canceled** - */ -export type ProvisioningState = string; - -/** Known values of {@link Origin} that the service accepts. */ -export enum KnownOrigin { - /** User */ - User = "user", - /** System */ - System = "system", - /** UserSystem */ - UserSystem = "user,system" -} - -/** - * Defines values for Origin. \ - * {@link KnownOrigin} can be used interchangeably with Origin, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **user** \ - * **system** \ - * **user,system** - */ -export type Origin = string; - -/** Known values of {@link ActionType} that the service accepts. */ -export enum KnownActionType { - /** Internal */ - Internal = "Internal" -} - -/** - * Defines values for ActionType. \ - * {@link KnownActionType} can be used interchangeably with ActionType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Internal** - */ -export type ActionType = string; - /** Known values of {@link Operator} that the service accepts. */ export enum KnownOperator { /** Equals */ @@ -4271,6 +5010,21 @@ export type AggregationType = | "Total"; /** Defines values for ResultType. */ export type ResultType = "Data" | "Metadata"; +/** Defines values for Unit. */ +export type Unit = + | "Count" + | "Bytes" + | "Seconds" + | "CountPerSecond" + | "BytesPerSecond" + | "Percent" + | "MilliSeconds" + | "ByteSeconds" + | "Unspecified" + | "Cores" + | "MilliCores" + | "NanoCores" + | "BitsPerSecond"; /** Defines values for IdentityType. */ export type IdentityType = "SystemAssigned" | "UserAssigned" | "None"; /** Defines values for ConditionOperator. */ @@ -4288,6 +5042,84 @@ export type TimeAggregationOperator = | "Total" | "Last"; +/** Optional parameters. */ +export interface AzureMonitorWorkspacesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type AzureMonitorWorkspacesListByResourceGroupResponse = AzureMonitorWorkspaceResourceListResult; + +/** Optional parameters. */ +export interface AzureMonitorWorkspacesListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type AzureMonitorWorkspacesListBySubscriptionResponse = AzureMonitorWorkspaceResourceListResult; + +/** Optional parameters. */ +export interface AzureMonitorWorkspacesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type AzureMonitorWorkspacesGetResponse = AzureMonitorWorkspaceResource; + +/** Optional parameters. */ +export interface AzureMonitorWorkspacesCreateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the create operation. */ +export type AzureMonitorWorkspacesCreateResponse = AzureMonitorWorkspaceResource; + +/** Optional parameters. */ +export interface AzureMonitorWorkspacesUpdateOptionalParams + extends coreClient.OperationOptions { + /** The payload */ + azureMonitorWorkspaceProperties?: AzureMonitorWorkspaceResourceForUpdate; +} + +/** Contains response data for the update operation. */ +export type AzureMonitorWorkspacesUpdateResponse = AzureMonitorWorkspaceResource; + +/** Optional parameters. */ +export interface AzureMonitorWorkspacesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type AzureMonitorWorkspacesDeleteResponse = AzureMonitorWorkspacesDeleteHeaders; + +/** Optional parameters. */ +export interface AzureMonitorWorkspacesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type AzureMonitorWorkspacesListByResourceGroupNextResponse = AzureMonitorWorkspaceResourceListResult; + +/** Optional parameters. */ +export interface AzureMonitorWorkspacesListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type AzureMonitorWorkspacesListBySubscriptionNextResponse = AzureMonitorWorkspaceResourceListResult; + +/** Optional parameters. */ +export interface MonitorOperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type MonitorOperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface MonitorOperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type MonitorOperationsListNextResponse = OperationListResult; + /** Optional parameters. */ export interface AutoscaleSettingsListByResourceGroupOptionalParams extends coreClient.OperationOptions {} @@ -4353,7 +5185,7 @@ export interface OperationsListOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the list operation. */ -export type OperationsListResponse = OperationListResult; +export type OperationsListResponse = OperationListResultAutoGenerated; /** Optional parameters. */ export interface AlertRuleIncidentsGetOptionalParams @@ -4505,7 +5337,7 @@ export interface ActionGroupsUpdateOptionalParams export type ActionGroupsUpdateResponse = ActionGroupResource; /** Optional parameters. */ -export interface ActionGroupsPostTestNotificationsOptionalParams +export interface ActionGroupsCreateNotificationsAtActionGroupResourceLevelOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; @@ -4513,72 +5345,85 @@ export interface ActionGroupsPostTestNotificationsOptionalParams resumeFrom?: string; } -/** Contains response data for the postTestNotifications operation. */ -export type ActionGroupsPostTestNotificationsResponse = TestNotificationDetailsResponse; +/** Contains response data for the createNotificationsAtActionGroupResourceLevel operation. */ +export type ActionGroupsCreateNotificationsAtActionGroupResourceLevelResponse = TestNotificationDetailsResponse; /** Optional parameters. */ -export interface ActionGroupsCreateNotificationsAtResourceGroupLevelOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} +export interface ActionGroupsGetTestNotificationsAtActionGroupResourceLevelOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the createNotificationsAtResourceGroupLevel operation. */ -export type ActionGroupsCreateNotificationsAtResourceGroupLevelResponse = TestNotificationDetailsResponse; +/** Contains response data for the getTestNotificationsAtActionGroupResourceLevel operation. */ +export type ActionGroupsGetTestNotificationsAtActionGroupResourceLevelResponse = TestNotificationDetailsResponse; /** Optional parameters. */ -export interface ActionGroupsCreateNotificationsAtActionGroupResourceLevelOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} +export interface ActionGroupsListBySubscriptionIdOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the createNotificationsAtActionGroupResourceLevel operation. */ -export type ActionGroupsCreateNotificationsAtActionGroupResourceLevelResponse = TestNotificationDetailsResponse; +/** Contains response data for the listBySubscriptionId operation. */ +export type ActionGroupsListBySubscriptionIdResponse = ActionGroupList; /** Optional parameters. */ -export interface ActionGroupsGetTestNotificationsOptionalParams +export interface ActionGroupsListByResourceGroupOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the getTestNotifications operation. */ -export type ActionGroupsGetTestNotificationsResponse = TestNotificationDetailsResponse; +/** Contains response data for the listByResourceGroup operation. */ +export type ActionGroupsListByResourceGroupResponse = ActionGroupList; + +/** Optional parameters. */ +export interface ActionGroupsEnableReceiverOptionalParams + extends coreClient.OperationOptions {} /** Optional parameters. */ -export interface ActionGroupsGetTestNotificationsAtResourceGroupLevelOptionalParams +export interface TenantActionGroupsCreateOrUpdateOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the getTestNotificationsAtResourceGroupLevel operation. */ -export type ActionGroupsGetTestNotificationsAtResourceGroupLevelResponse = TestNotificationDetailsResponse; +/** Contains response data for the createOrUpdate operation. */ +export type TenantActionGroupsCreateOrUpdateResponse = TenantActionGroupResource; /** Optional parameters. */ -export interface ActionGroupsGetTestNotificationsAtActionGroupResourceLevelOptionalParams +export interface TenantActionGroupsGetOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the getTestNotificationsAtActionGroupResourceLevel operation. */ -export type ActionGroupsGetTestNotificationsAtActionGroupResourceLevelResponse = TestNotificationDetailsResponse; +/** Contains response data for the get operation. */ +export type TenantActionGroupsGetResponse = TenantActionGroupResource; /** Optional parameters. */ -export interface ActionGroupsListBySubscriptionIdOptionalParams +export interface TenantActionGroupsDeleteOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listBySubscriptionId operation. */ -export type ActionGroupsListBySubscriptionIdResponse = ActionGroupList; +/** Optional parameters. */ +export interface TenantActionGroupsUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type TenantActionGroupsUpdateResponse = TenantActionGroupResource; /** Optional parameters. */ -export interface ActionGroupsListByResourceGroupOptionalParams +export interface TenantActionGroupsListByManagementGroupIdOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByResourceGroup operation. */ -export type ActionGroupsListByResourceGroupResponse = ActionGroupList; +/** Contains response data for the listByManagementGroupId operation. */ +export type TenantActionGroupsListByManagementGroupIdResponse = TenantActionGroupList; /** Optional parameters. */ -export interface ActionGroupsEnableReceiverOptionalParams +export interface CreateNotificationsAtTenantActionGroupResourceLevelOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createNotificationsAtTenantActionGroupResourceLevel operation. */ +export type CreateNotificationsAtTenantActionGroupResourceLevelResponse = TestNotificationDetailsResponseAutoGenerated; + +/** Optional parameters. */ +export interface GetTestNotificationsAtTenantActionGroupResourceLevelOptionalParams extends coreClient.OperationOptions {} +/** Contains response data for the getTestNotificationsAtTenantActionGroupResourceLevel operation. */ +export type GetTestNotificationsAtTenantActionGroupResourceLevelResponse = TestNotificationDetailsResponseAutoGenerated; + /** Optional parameters. */ export interface ActivityLogsListOptionalParams extends coreClient.OperationOptions { @@ -4622,27 +5467,115 @@ export interface TenantActivityLogsListNextOptionalParams /** Contains response data for the listNext operation. */ export type TenantActivityLogsListNextResponse = EventDataCollection; +/** Optional parameters. */ +export interface MetricDefinitionsListAtSubscriptionScopeOptionalParams + extends coreClient.OperationOptions { + /** Metric namespace where the metrics you want reside. */ + metricnamespace?: string; +} + +/** Contains response data for the listAtSubscriptionScope operation. */ +export type MetricDefinitionsListAtSubscriptionScopeResponse = SubscriptionScopeMetricDefinitionCollection; + /** Optional parameters. */ export interface MetricDefinitionsListOptionalParams extends coreClient.OperationOptions { - /** Metric namespace to query metric definitions for. */ + /** Metric namespace where the metrics you want reside. */ metricnamespace?: string; } /** Contains response data for the list operation. */ export type MetricDefinitionsListResponse = MetricDefinitionCollection; +/** Optional parameters. */ +export interface MetricsListAtSubscriptionScopeOptionalParams + extends coreClient.OperationOptions { + /** The **$filter** is used to reduce the set of metric data returned.
Example:
Metric contains metadata A, B and C.
- Return all time series of C where A = a1 and B = b1 or b2
**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**
- Invalid variant:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**
This is invalid because the logical or operator cannot separate two different metadata names.
- Return all time series where A = a1, B = b1 and C = c1:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**
- Return all time series where A = a1
**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. */ + filter?: string; + /** Metric namespace where the metrics you want reside. */ + metricnamespace?: string; + /** The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'. */ + timespan?: string; + /** The interval (i.e. timegrain) of the query. */ + interval?: string; + /** The names of the metrics (comma separated) to retrieve. */ + metricnames?: string; + /** The list of aggregation types (comma separated) to retrieve. */ + aggregation?: string; + /** + * The maximum number of records to retrieve. + * Valid only if $filter is specified. + * Defaults to 10. + */ + top?: number; + /** + * The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * Examples: sum asc. + */ + orderby?: string; + /** Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details. */ + resultType?: MetricResultType; + /** When set to true, if the timespan passed in is not supported by this metric, the API will return the result using the closest supported timespan. When set to false, an error is returned for invalid timespan parameters. Defaults to false. */ + autoAdjustTimegrain?: boolean; + /** When set to false, invalid filter parameter values will be ignored. When set to true, an error is returned for invalid filter parameters. Defaults to true. */ + validateDimensions?: boolean; +} + +/** Contains response data for the listAtSubscriptionScope operation. */ +export type MetricsListAtSubscriptionScopeResponse = SubscriptionScopeMetricResponse; + +/** Optional parameters. */ +export interface MetricsListAtSubscriptionScopePostOptionalParams + extends coreClient.OperationOptions { + /** The **$filter** is used to reduce the set of metric data returned.
Example:
Metric contains metadata A, B and C.
- Return all time series of C where A = a1 and B = b1 or b2
**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**
- Invalid variant:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**
This is invalid because the logical or operator cannot separate two different metadata names.
- Return all time series where A = a1, B = b1 and C = c1:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**
- Return all time series where A = a1
**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. */ + filter?: string; + /** Metric namespace where the metrics you want reside. */ + metricnamespace?: string; + /** The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'. */ + timespan?: string; + /** The interval (i.e. timegrain) of the query. */ + interval?: string; + /** The names of the metrics (comma separated) to retrieve. */ + metricnames?: string; + /** The list of aggregation types (comma separated) to retrieve. */ + aggregation?: string; + /** + * The maximum number of records to retrieve. + * Valid only if $filter is specified. + * Defaults to 10. + */ + top?: number; + /** + * The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * Examples: sum asc. + */ + orderby?: string; + /** Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details. */ + resultType?: MetricResultType; + /** When set to true, if the timespan passed in is not supported by this metric, the API will return the result using the closest supported timespan. When set to false, an error is returned for invalid timespan parameters. Defaults to false. */ + autoAdjustTimegrain?: boolean; + /** When set to false, invalid filter parameter values will be ignored. When set to true, an error is returned for invalid filter parameters. Defaults to true. */ + validateDimensions?: boolean; + /** Parameters serialized in the body */ + body?: SubscriptionScopeMetricsRequestBodyParameters; +} + +/** Contains response data for the listAtSubscriptionScopePost operation. */ +export type MetricsListAtSubscriptionScopePostResponse = SubscriptionScopeMetricResponse; + /** Optional parameters. */ export interface MetricsListOptionalParams extends coreClient.OperationOptions { - /** The **$filter** is used to reduce the set of metric data returned. Example: Metric contains metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = 'b2'** This is invalid because the logical or operator cannot separate two different metadata names. - Return all time series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return all time series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension name or dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using $filter= "dim (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim (test) 3** and dimension value is **dim3 (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) val' " use **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "** */ + /** The **$filter** is used to reduce the set of metric data returned.
Example:
Metric contains metadata A, B and C.
- Return all time series of C where A = a1 and B = b1 or b2
**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**
- Invalid variant:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**
This is invalid because the logical or operator cannot separate two different metadata names.
- Return all time series where A = a1, B = b1 and C = c1:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**
- Return all time series where A = a1
**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. */ filter?: string; - /** Metric namespace to query metric definitions for. */ + /** Metric namespace where the metrics you want reside. */ metricnamespace?: string; /** The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'. */ timespan?: string; /** The interval (i.e. timegrain) of the query. */ interval?: string; - /** The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'** */ + /** The names of the metrics (comma separated) to retrieve. */ metricnames?: string; /** The list of aggregation types (comma separated) to retrieve. */ aggregation?: string; @@ -4658,6 +5591,10 @@ export interface MetricsListOptionalParams extends coreClient.OperationOptions { * Examples: sum asc. */ orderby?: string; + /** When set to true, if the timespan passed in is not supported by this metric, the API will return the result using the closest supported timespan. When set to false, an error is returned for invalid timespan parameters. Defaults to false. */ + autoAdjustTimegrain?: boolean; + /** When set to false, invalid filter parameter values will be ignored. When set to true, an error is returned for invalid filter parameters. Defaults to true. */ + validateDimensions?: boolean; /** Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details. */ resultType?: ResultType; } @@ -4896,7 +5833,7 @@ export interface PrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ -export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnectionAutoGenerated; /** Optional parameters. */ export interface PrivateEndpointConnectionsCreateOrUpdateOptionalParams @@ -4908,7 +5845,7 @@ export interface PrivateEndpointConnectionsCreateOrUpdateOptionalParams } /** Contains response data for the createOrUpdate operation. */ -export type PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnection; +export type PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnectionAutoGenerated; /** Optional parameters. */ export interface PrivateEndpointConnectionsDeleteOptionalParams @@ -5202,76 +6139,6 @@ export interface DataCollectionRulesListBySubscriptionNextOptionalParams /** Contains response data for the listBySubscriptionNext operation. */ export type DataCollectionRulesListBySubscriptionNextResponse = DataCollectionRuleResourceListResult; -/** Optional parameters. */ -export interface AzureMonitorWorkspacesListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type AzureMonitorWorkspacesListByResourceGroupResponse = AzureMonitorWorkspaceResourceListResult; - -/** Optional parameters. */ -export interface AzureMonitorWorkspacesListBySubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscription operation. */ -export type AzureMonitorWorkspacesListBySubscriptionResponse = AzureMonitorWorkspaceResourceListResult; - -/** Optional parameters. */ -export interface AzureMonitorWorkspacesGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type AzureMonitorWorkspacesGetResponse = AzureMonitorWorkspaceResource; - -/** Optional parameters. */ -export interface AzureMonitorWorkspacesCreateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the create operation. */ -export type AzureMonitorWorkspacesCreateResponse = AzureMonitorWorkspaceResource; - -/** Optional parameters. */ -export interface AzureMonitorWorkspacesUpdateOptionalParams - extends coreClient.OperationOptions { - /** The payload */ - azureMonitorWorkspaceProperties?: AzureMonitorWorkspaceResourceForUpdate; -} - -/** Contains response data for the update operation. */ -export type AzureMonitorWorkspacesUpdateResponse = AzureMonitorWorkspaceResource; - -/** Optional parameters. */ -export interface AzureMonitorWorkspacesDeleteOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface AzureMonitorWorkspacesListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type AzureMonitorWorkspacesListByResourceGroupNextResponse = AzureMonitorWorkspaceResourceListResult; - -/** Optional parameters. */ -export interface AzureMonitorWorkspacesListBySubscriptionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscriptionNext operation. */ -export type AzureMonitorWorkspacesListBySubscriptionNextResponse = AzureMonitorWorkspaceResourceListResult; - -/** Optional parameters. */ -export interface MonitorOperationsListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type MonitorOperationsListResponse = OperationListResultAutoGenerated; - -/** Optional parameters. */ -export interface MonitorOperationsListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type MonitorOperationsListNextResponse = OperationListResultAutoGenerated; - /** Optional parameters. */ export interface MonitorClientOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/monitor/arm-monitor/src/models/mappers.ts b/sdk/monitor/arm-monitor/src/models/mappers.ts index 55b873ac7999..ada9379aba4c 100644 --- a/sdk/monitor/arm-monitor/src/models/mappers.ts +++ b/sdk/monitor/arm-monitor/src/models/mappers.ts @@ -8,10 +8,10 @@ import * as coreClient from "@azure/core-client"; -export const AutoscaleSettingResourceCollection: coreClient.CompositeMapper = { +export const AzureMonitorWorkspaceResourceListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AutoscaleSettingResourceCollection", + className: "AzureMonitorWorkspaceResourceListResult", modelProperties: { value: { serializedName: "value", @@ -21,7 +21,7 @@ export const AutoscaleSettingResourceCollection: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "AutoscaleSettingResource" + className: "AzureMonitorWorkspaceResource" } } } @@ -36,78 +36,101 @@ export const AutoscaleSettingResourceCollection: coreClient.CompositeMapper = { } }; -export const AutoscaleProfile: coreClient.CompositeMapper = { +export const AzureMonitorWorkspace: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AutoscaleProfile", + className: "AzureMonitorWorkspace", modelProperties: { - name: { - serializedName: "name", - required: true, + accountId: { + serializedName: "accountId", + readOnly: true, type: { name: "String" } }, - capacity: { - serializedName: "capacity", + metrics: { + serializedName: "metrics", type: { name: "Composite", - className: "ScaleCapacity" + className: "AzureMonitorWorkspaceMetrics" } }, - rules: { - serializedName: "rules", - required: true, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + defaultIngestionSettings: { + serializedName: "defaultIngestionSettings", + type: { + name: "Composite", + className: "AzureMonitorWorkspaceDefaultIngestionSettings" + } + }, + privateEndpointConnections: { + serializedName: "privateEndpointConnections", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "ScaleRule" + className: "PrivateEndpointConnection" } } } }, - fixedDate: { - serializedName: "fixedDate", - type: { - name: "Composite", - className: "TimeWindow" - } - }, - recurrence: { - serializedName: "recurrence", + publicNetworkAccess: { + serializedName: "publicNetworkAccess", + readOnly: true, type: { - name: "Composite", - className: "Recurrence" + name: "String" } } } } }; -export const ScaleCapacity: coreClient.CompositeMapper = { +export const Metrics: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ScaleCapacity", + className: "Metrics", modelProperties: { - minimum: { - serializedName: "minimum", - required: true, + prometheusQueryEndpoint: { + serializedName: "prometheusQueryEndpoint", + readOnly: true, type: { name: "String" } }, - maximum: { - serializedName: "maximum", - required: true, + internalId: { + serializedName: "internalId", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const IngestionSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IngestionSettings", + modelProperties: { + dataCollectionRuleResourceId: { + serializedName: "dataCollectionRuleResourceId", + readOnly: true, type: { name: "String" } }, - default: { - serializedName: "default", - required: true, + dataCollectionEndpointResourceId: { + serializedName: "dataCollectionEndpointResourceId", + readOnly: true, type: { name: "String" } @@ -116,241 +139,1303 @@ export const ScaleCapacity: coreClient.CompositeMapper = { } }; -export const ScaleRule: coreClient.CompositeMapper = { +export const PrivateEndpoint: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ScaleRule", + className: "PrivateEndpoint", modelProperties: { - metricTrigger: { - serializedName: "metricTrigger", - type: { - name: "Composite", - className: "MetricTrigger" - } - }, - scaleAction: { - serializedName: "scaleAction", + id: { + serializedName: "id", + readOnly: true, type: { - name: "Composite", - className: "ScaleAction" + name: "String" } } } } }; -export const MetricTrigger: coreClient.CompositeMapper = { +export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricTrigger", + className: "PrivateLinkServiceConnectionState", modelProperties: { - metricName: { - serializedName: "metricName", - required: true, + status: { + serializedName: "status", type: { name: "String" } }, - metricNamespace: { - serializedName: "metricNamespace", + description: { + serializedName: "description", type: { name: "String" } }, - metricResourceUri: { - serializedName: "metricResourceUri", - required: true, + actionsRequired: { + serializedName: "actionsRequired", type: { name: "String" } - }, - metricResourceLocation: { - serializedName: "metricResourceLocation", + } + } + } +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - timeGrain: { - serializedName: "timeGrain", - required: true, + name: { + serializedName: "name", + readOnly: true, type: { - name: "TimeSpan" + name: "String" } }, - statistic: { - serializedName: "statistic", - required: true, + type: { + serializedName: "type", + readOnly: true, type: { - name: "Enum", - allowedValues: ["Average", "Min", "Max", "Sum", "Count"] + name: "String" } }, - timeWindow: { - serializedName: "timeWindow", - required: true, + systemData: { + serializedName: "systemData", type: { - name: "TimeSpan" + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" } }, - timeAggregation: { - serializedName: "timeAggregation", - required: true, + createdByType: { + serializedName: "createdByType", type: { - name: "Enum", - allowedValues: [ - "Average", - "Minimum", - "Maximum", - "Total", - "Count", - "Last" - ] + name: "String" } }, - operator: { - serializedName: "operator", - required: true, + createdAt: { + serializedName: "createdAt", type: { - name: "Enum", - allowedValues: [ - "Equals", - "NotEquals", - "GreaterThan", - "GreaterThanOrEqual", - "LessThan", - "LessThanOrEqual" - ] + name: "DateTime" } }, - threshold: { - serializedName: "threshold", - required: true, + lastModifiedBy: { + serializedName: "lastModifiedBy", type: { - name: "Number" + name: "String" } }, - dimensions: { - serializedName: "dimensions", + lastModifiedByType: { + serializedName: "lastModifiedByType", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ScaleRuleMetricDimension" - } - } + name: "String" } }, - dividePerInstance: { - serializedName: "dividePerInstance", + lastModifiedAt: { + serializedName: "lastModifiedAt", type: { - name: "Boolean" + name: "DateTime" } } } } }; -export const ScaleRuleMetricDimension: coreClient.CompositeMapper = { +export const ResourceAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ScaleRuleMetricDimension", + className: "ResourceAutoGenerated", modelProperties: { - dimensionName: { - serializedName: "DimensionName", - required: true, + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - operator: { - serializedName: "Operator", + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String" + } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const AzureMonitorWorkspaceResourceForUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureMonitorWorkspaceResourceForUpdate", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const OperationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + readOnly: true, + type: { + name: "Boolean" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + readOnly: true, + type: { + name: "String" + } + }, + actionType: { + serializedName: "actionType", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + readOnly: true, + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + readOnly: true, + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const AutoscaleSettingResourceCollection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AutoscaleSettingResourceCollection", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AutoscaleSettingResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const AutoscaleProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AutoscaleProfile", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + capacity: { + serializedName: "capacity", + type: { + name: "Composite", + className: "ScaleCapacity" + } + }, + rules: { + serializedName: "rules", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ScaleRule" + } + } + } + }, + fixedDate: { + serializedName: "fixedDate", + type: { + name: "Composite", + className: "TimeWindow" + } + }, + recurrence: { + serializedName: "recurrence", + type: { + name: "Composite", + className: "Recurrence" + } + } + } + } +}; + +export const ScaleCapacity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ScaleCapacity", + modelProperties: { + minimum: { + serializedName: "minimum", + required: true, + type: { + name: "String" + } + }, + maximum: { + serializedName: "maximum", + required: true, + type: { + name: "String" + } + }, + default: { + serializedName: "default", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ScaleRule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ScaleRule", + modelProperties: { + metricTrigger: { + serializedName: "metricTrigger", + type: { + name: "Composite", + className: "MetricTrigger" + } + }, + scaleAction: { + serializedName: "scaleAction", + type: { + name: "Composite", + className: "ScaleAction" + } + } + } + } +}; + +export const MetricTrigger: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricTrigger", + modelProperties: { + metricName: { + serializedName: "metricName", + required: true, + type: { + name: "String" + } + }, + metricNamespace: { + serializedName: "metricNamespace", + type: { + name: "String" + } + }, + metricResourceUri: { + serializedName: "metricResourceUri", + required: true, + type: { + name: "String" + } + }, + metricResourceLocation: { + serializedName: "metricResourceLocation", + type: { + name: "String" + } + }, + timeGrain: { + serializedName: "timeGrain", + required: true, + type: { + name: "TimeSpan" + } + }, + statistic: { + serializedName: "statistic", + required: true, + type: { + name: "Enum", + allowedValues: ["Average", "Min", "Max", "Sum", "Count"] + } + }, + timeWindow: { + serializedName: "timeWindow", + required: true, + type: { + name: "TimeSpan" + } + }, + timeAggregation: { + serializedName: "timeAggregation", + required: true, + type: { + name: "Enum", + allowedValues: [ + "Average", + "Minimum", + "Maximum", + "Total", + "Count", + "Last" + ] + } + }, + operator: { + serializedName: "operator", + required: true, + type: { + name: "Enum", + allowedValues: [ + "Equals", + "NotEquals", + "GreaterThan", + "GreaterThanOrEqual", + "LessThan", + "LessThanOrEqual" + ] + } + }, + threshold: { + serializedName: "threshold", + required: true, + type: { + name: "Number" + } + }, + dimensions: { + serializedName: "dimensions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ScaleRuleMetricDimension" + } + } + } + }, + dividePerInstance: { + serializedName: "dividePerInstance", + type: { + name: "Boolean" + } + } + } + } +}; + +export const ScaleRuleMetricDimension: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ScaleRuleMetricDimension", + modelProperties: { + dimensionName: { + serializedName: "DimensionName", + 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 ScaleAction: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ScaleAction", + modelProperties: { + direction: { + serializedName: "direction", + required: true, + type: { + name: "Enum", + allowedValues: ["None", "Increase", "Decrease"] + } + }, + type: { + serializedName: "type", + required: true, + type: { + name: "Enum", + allowedValues: [ + "ChangeCount", + "PercentChangeCount", + "ExactCount", + "ServiceAllowedNextValue" + ] + } + }, + value: { + defaultValue: "1", + serializedName: "value", + type: { + name: "String" + } + }, + cooldown: { + serializedName: "cooldown", + required: true, + type: { + name: "TimeSpan" + } + } + } + } +}; + +export const TimeWindow: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TimeWindow", + modelProperties: { + timeZone: { + serializedName: "timeZone", + type: { + name: "String" + } + }, + start: { + serializedName: "start", + required: true, + type: { + name: "DateTime" + } + }, + end: { + serializedName: "end", + required: true, + type: { + name: "DateTime" + } + } + } + } +}; + +export const Recurrence: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Recurrence", + modelProperties: { + frequency: { + serializedName: "frequency", + required: true, + type: { + name: "Enum", + allowedValues: [ + "None", + "Second", + "Minute", + "Hour", + "Day", + "Week", + "Month", + "Year" + ] + } + }, + schedule: { + serializedName: "schedule", + type: { + name: "Composite", + className: "RecurrentSchedule" + } + } + } + } +}; + +export const RecurrentSchedule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RecurrentSchedule", + modelProperties: { + timeZone: { + serializedName: "timeZone", + required: true, + type: { + name: "String" + } + }, + days: { + serializedName: "days", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + hours: { + serializedName: "hours", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Number" + } + } + } + }, + minutes: { + serializedName: "minutes", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Number" + } + } + } + } + } + } +}; + +export const AutoscaleNotification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AutoscaleNotification", + modelProperties: { + operation: { + defaultValue: "Scale", + isConstant: true, + serializedName: "operation", + type: { + name: "String" + } + }, + email: { + serializedName: "email", + type: { + name: "Composite", + className: "EmailNotification" + } + }, + webhooks: { + serializedName: "webhooks", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "WebhookNotification" + } + } + } + } + } + } +}; + +export const EmailNotification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EmailNotification", + modelProperties: { + sendToSubscriptionAdministrator: { + defaultValue: false, + serializedName: "sendToSubscriptionAdministrator", + type: { + name: "Boolean" + } + }, + sendToSubscriptionCoAdministrators: { + defaultValue: false, + serializedName: "sendToSubscriptionCoAdministrators", + type: { + name: "Boolean" + } + }, + customEmails: { + serializedName: "customEmails", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const WebhookNotification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WebhookNotification", + modelProperties: { + serviceUri: { + serializedName: "serviceUri", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const PredictiveAutoscalePolicy: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PredictiveAutoscalePolicy", + modelProperties: { + scaleMode: { + serializedName: "scaleMode", + required: true, + type: { + name: "Enum", + allowedValues: ["Disabled", "ForecastOnly", "Enabled"] + } + }, + scaleLookAheadTime: { + serializedName: "scaleLookAheadTime", + type: { + name: "TimeSpan" + } + } + } + } +}; + +export const ResourceAutoGenerated2: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceAutoGenerated2", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + location: { + serializedName: "location", required: true, type: { name: "String" } }, - values: { - serializedName: "Values", + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const AutoscaleErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AutoscaleErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "AutoscaleErrorResponseError" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const AutoscaleErrorResponseError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AutoscaleErrorResponseError", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + }, + target: { + serializedName: "target", + type: { + name: "String" + } + }, + details: { + serializedName: "details", + type: { + name: "String" + } + } + } + } +}; + +export const AutoscaleSettingResourcePatch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AutoscaleSettingResourcePatch", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + profiles: { + constraints: { + MaxItems: 20 + }, + serializedName: "properties.profiles", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AutoscaleProfile" + } + } + } + }, + notifications: { + serializedName: "properties.notifications", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AutoscaleNotification" + } + } + } + }, + enabled: { + defaultValue: false, + serializedName: "properties.enabled", + type: { + name: "Boolean" + } + }, + predictiveAutoscalePolicy: { + serializedName: "properties.predictiveAutoscalePolicy", + type: { + name: "Composite", + className: "PredictiveAutoscalePolicy" + } + }, + name: { + serializedName: "properties.name", + type: { + name: "String" + } + }, + targetResourceUri: { + serializedName: "properties.targetResourceUri", + type: { + name: "String" + } + }, + targetResourceLocation: { + serializedName: "properties.targetResourceLocation", + type: { + name: "String" + } + } + } + } +}; + +export const PredictiveResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PredictiveResponse", + modelProperties: { + timespan: { + serializedName: "timespan", + type: { + name: "String" + } + }, + interval: { + serializedName: "interval", + type: { + name: "TimeSpan" + } + }, + metricName: { + serializedName: "metricName", + type: { + name: "String" + } + }, + targetResourceId: { + serializedName: "targetResourceId", + type: { + name: "String" + } + }, + data: { + serializedName: "data", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PredictiveValue" + } + } + } + } + } + } +}; + +export const PredictiveValue: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PredictiveValue", + modelProperties: { + timeStamp: { + serializedName: "timeStamp", + required: true, + type: { + name: "DateTime" + } + }, + value: { + serializedName: "value", required: true, + type: { + name: "Number" + } + } + } + } +}; + +export const OperationListResultAutoGenerated: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationListResultAutoGenerated", + modelProperties: { + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "OperationAutoGenerated" } } } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const OperationAutoGenerated: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationAutoGenerated", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplayAutoGenerated" + } } } } }; -export const ScaleAction: coreClient.CompositeMapper = { +export const OperationDisplayAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ScaleAction", + className: "OperationDisplayAutoGenerated", modelProperties: { - direction: { - serializedName: "direction", - required: true, - type: { - name: "Enum", - allowedValues: ["None", "Increase", "Decrease"] - } - }, - type: { - serializedName: "type", - required: true, + provider: { + serializedName: "provider", type: { - name: "Enum", - allowedValues: [ - "ChangeCount", - "PercentChangeCount", - "ExactCount", - "ServiceAllowedNextValue" - ] + name: "String" } }, - value: { - defaultValue: "1", - serializedName: "value", + resource: { + serializedName: "resource", type: { name: "String" } }, - cooldown: { - serializedName: "cooldown", - required: true, + operation: { + serializedName: "operation", type: { - name: "TimeSpan" + name: "String" } } } } }; -export const TimeWindow: coreClient.CompositeMapper = { +export const Incident: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TimeWindow", + className: "Incident", modelProperties: { - timeZone: { - serializedName: "timeZone", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - start: { - serializedName: "start", - required: true, + ruleName: { + serializedName: "ruleName", + readOnly: true, + type: { + name: "String" + } + }, + isActive: { + serializedName: "isActive", + readOnly: true, + type: { + name: "Boolean" + } + }, + activatedTime: { + serializedName: "activatedTime", + readOnly: true, type: { name: "DateTime" } }, - end: { - serializedName: "end", - required: true, + resolvedTime: { + serializedName: "resolvedTime", + readOnly: true, type: { name: "DateTime" } @@ -359,83 +1444,40 @@ export const TimeWindow: coreClient.CompositeMapper = { } }; -export const Recurrence: coreClient.CompositeMapper = { +export const ErrorResponseAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Recurrence", + className: "ErrorResponseAutoGenerated", modelProperties: { - frequency: { - serializedName: "frequency", - required: true, + code: { + serializedName: "code", type: { - name: "Enum", - allowedValues: [ - "None", - "Second", - "Minute", - "Hour", - "Day", - "Week", - "Month", - "Year" - ] + name: "String" } }, - schedule: { - serializedName: "schedule", + message: { + serializedName: "message", type: { - name: "Composite", - className: "RecurrentSchedule" + name: "String" } } } } }; -export const RecurrentSchedule: coreClient.CompositeMapper = { +export const IncidentListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RecurrentSchedule", + className: "IncidentListResult", modelProperties: { - timeZone: { - serializedName: "timeZone", - required: true, - type: { - name: "String" - } - }, - days: { - serializedName: "days", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - hours: { - serializedName: "hours", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Number" - } - } - } - }, - minutes: { - serializedName: "minutes", - required: true, + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { - name: "Number" + name: "Composite", + className: "Incident" } } } @@ -444,125 +1486,104 @@ export const RecurrentSchedule: coreClient.CompositeMapper = { } }; -export const AutoscaleNotification: coreClient.CompositeMapper = { +export const RuleCondition: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AutoscaleNotification", + className: "RuleCondition", + uberParent: "RuleCondition", + polymorphicDiscriminator: { + serializedName: "odata\\.type", + clientName: "odataType" + }, modelProperties: { - operation: { - defaultValue: "Scale", - isConstant: true, - serializedName: "operation", + odataType: { + serializedName: "odata\\.type", + required: true, type: { name: "String" } }, - email: { - serializedName: "email", + dataSource: { + serializedName: "dataSource", type: { name: "Composite", - className: "EmailNotification" - } - }, - webhooks: { - serializedName: "webhooks", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "WebhookNotification" - } - } + className: "RuleDataSource" } } } } }; -export const EmailNotification: coreClient.CompositeMapper = { +export const RuleDataSource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EmailNotification", + className: "RuleDataSource", + uberParent: "RuleDataSource", + polymorphicDiscriminator: { + serializedName: "odata\\.type", + clientName: "odataType" + }, modelProperties: { - sendToSubscriptionAdministrator: { - defaultValue: false, - serializedName: "sendToSubscriptionAdministrator", + odataType: { + serializedName: "odata\\.type", + required: true, type: { - name: "Boolean" + name: "String" } }, - sendToSubscriptionCoAdministrators: { - defaultValue: false, - serializedName: "sendToSubscriptionCoAdministrators", + resourceUri: { + serializedName: "resourceUri", type: { - name: "Boolean" + name: "String" } }, - customEmails: { - serializedName: "customEmails", + legacyResourceId: { + serializedName: "legacyResourceId", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } - } - } - } -}; - -export const WebhookNotification: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "WebhookNotification", - modelProperties: { - serviceUri: { - serializedName: "serviceUri", + }, + resourceLocation: { + serializedName: "resourceLocation", type: { name: "String" } }, - properties: { - serializedName: "properties", + metricNamespace: { + serializedName: "metricNamespace", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" } } } } }; -export const PredictiveAutoscalePolicy: coreClient.CompositeMapper = { +export const RuleAction: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PredictiveAutoscalePolicy", + className: "RuleAction", + uberParent: "RuleAction", + polymorphicDiscriminator: { + serializedName: "odata\\.type", + clientName: "odataType" + }, modelProperties: { - scaleMode: { - serializedName: "scaleMode", + odataType: { + serializedName: "odata\\.type", required: true, type: { - name: "Enum", - allowedValues: ["Disabled", "ForecastOnly", "Enabled"] - } - }, - scaleLookAheadTime: { - serializedName: "scaleLookAheadTime", - type: { - name: "TimeSpan" + name: "String" } } } } }; -export const Resource: coreClient.CompositeMapper = { +export const ResourceAutoGenerated3: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "ResourceAutoGenerated3", modelProperties: { id: { serializedName: "id", @@ -598,55 +1619,76 @@ export const Resource: coreClient.CompositeMapper = { name: "Dictionary", value: { type: { name: "String" } } } - }, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData" - } } } } }; -export const SystemData: coreClient.CompositeMapper = { +export const AlertRuleResourcePatch: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SystemData", + className: "AlertRuleResourcePatch", modelProperties: { - createdBy: { - serializedName: "createdBy", + tags: { + serializedName: "tags", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } }, - createdByType: { - serializedName: "createdByType", + name: { + serializedName: "properties.name", type: { name: "String" } }, - createdAt: { - serializedName: "createdAt", + description: { + serializedName: "properties.description", type: { - name: "DateTime" + name: "String" } }, - lastModifiedBy: { - serializedName: "lastModifiedBy", + provisioningState: { + serializedName: "properties.provisioningState", type: { name: "String" } }, - lastModifiedByType: { - serializedName: "lastModifiedByType", + isEnabled: { + serializedName: "properties.isEnabled", type: { - name: "String" + name: "Boolean" } }, - lastModifiedAt: { - serializedName: "lastModifiedAt", + condition: { + serializedName: "properties.condition", + type: { + name: "Composite", + className: "RuleCondition" + } + }, + action: { + serializedName: "properties.action", + type: { + name: "Composite", + className: "RuleAction" + } + }, + actions: { + serializedName: "properties.actions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RuleAction" + } + } + } + }, + lastUpdatedTime: { + serializedName: "properties.lastUpdatedTime", + readOnly: true, type: { name: "DateTime" } @@ -655,350 +1697,301 @@ export const SystemData: coreClient.CompositeMapper = { } }; -export const AutoscaleErrorResponse: coreClient.CompositeMapper = { +export const AlertRuleResourceCollection: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AutoscaleErrorResponse", + className: "AlertRuleResourceCollection", modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "AutoscaleErrorResponseError" - } - }, - systemData: { - serializedName: "systemData", + value: { + serializedName: "value", type: { - name: "Composite", - className: "SystemData" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AlertRuleResource" + } + } } } } } }; -export const AutoscaleErrorResponseError: coreClient.CompositeMapper = { +export const RetentionPolicy: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AutoscaleErrorResponseError", + className: "RetentionPolicy", modelProperties: { - code: { - serializedName: "code", - type: { - name: "String" - } - }, - message: { - serializedName: "message", - type: { - name: "String" - } - }, - target: { - serializedName: "target", + enabled: { + serializedName: "enabled", + required: true, type: { - name: "String" + name: "Boolean" } }, - details: { - serializedName: "details", + days: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "days", + required: true, type: { - name: "String" + name: "Number" } } } } }; -export const AutoscaleSettingResourcePatch: coreClient.CompositeMapper = { +export const ResourceAutoGenerated4: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AutoscaleSettingResourcePatch", + className: "ResourceAutoGenerated4", modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - }, - profiles: { - constraints: { - MaxItems: 20 - }, - serializedName: "properties.profiles", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AutoscaleProfile" - } - } - } - }, - notifications: { - serializedName: "properties.notifications", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AutoscaleNotification" - } - } - } - }, - enabled: { - defaultValue: false, - serializedName: "properties.enabled", + id: { + serializedName: "id", + readOnly: true, type: { - name: "Boolean" + name: "String" } }, - predictiveAutoscalePolicy: { - serializedName: "properties.predictiveAutoscalePolicy", + name: { + serializedName: "name", + readOnly: true, type: { - name: "Composite", - className: "PredictiveAutoscalePolicy" + name: "String" } }, - name: { - serializedName: "properties.name", + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } }, - targetResourceUri: { - serializedName: "properties.targetResourceUri", + location: { + serializedName: "location", + required: true, type: { name: "String" } }, - targetResourceLocation: { - serializedName: "properties.targetResourceLocation", + tags: { + serializedName: "tags", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const PredictiveResponse: coreClient.CompositeMapper = { +export const LogProfileResourcePatch: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PredictiveResponse", + className: "LogProfileResourcePatch", modelProperties: { - timespan: { - serializedName: "timespan", - type: { - name: "String" - } - }, - interval: { - serializedName: "interval", + tags: { + serializedName: "tags", type: { - name: "TimeSpan" + name: "Dictionary", + value: { type: { name: "String" } } } }, - metricName: { - serializedName: "metricName", + storageAccountId: { + serializedName: "properties.storageAccountId", type: { name: "String" } }, - targetResourceId: { - serializedName: "targetResourceId", + serviceBusRuleId: { + serializedName: "properties.serviceBusRuleId", type: { name: "String" } }, - data: { - serializedName: "data", + locations: { + serializedName: "properties.locations", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "PredictiveValue" + name: "String" } } } - } - } - } -}; - -export const PredictiveValue: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PredictiveValue", - modelProperties: { - timeStamp: { - serializedName: "timeStamp", - required: true, + }, + categories: { + serializedName: "properties.categories", type: { - name: "DateTime" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - value: { - serializedName: "value", - required: true, + retentionPolicy: { + serializedName: "properties.retentionPolicy", type: { - name: "Number" + name: "Composite", + className: "RetentionPolicy" } } } } }; -export const OperationListResult: coreClient.CompositeMapper = { +export const LogProfileCollection: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationListResult", + className: "LogProfileCollection", modelProperties: { value: { serializedName: "value", + required: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "Operation" + className: "LogProfileResource" } } } - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } } } } }; -export const Operation: coreClient.CompositeMapper = { +export const MetricSettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Operation", + className: "MetricSettings", modelProperties: { - name: { - serializedName: "name", + timeGrain: { + serializedName: "timeGrain", + type: { + name: "TimeSpan" + } + }, + category: { + serializedName: "category", type: { name: "String" } }, - display: { - serializedName: "display", + enabled: { + serializedName: "enabled", + required: true, + type: { + name: "Boolean" + } + }, + retentionPolicy: { + serializedName: "retentionPolicy", type: { name: "Composite", - className: "OperationDisplay" + className: "RetentionPolicy" } } } } }; -export const OperationDisplay: coreClient.CompositeMapper = { +export const LogSettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationDisplay", + className: "LogSettings", modelProperties: { - provider: { - serializedName: "provider", + category: { + serializedName: "category", type: { name: "String" } }, - resource: { - serializedName: "resource", + categoryGroup: { + serializedName: "categoryGroup", type: { name: "String" } }, - operation: { - serializedName: "operation", + enabled: { + serializedName: "enabled", + required: true, type: { - name: "String" + name: "Boolean" + } + }, + retentionPolicy: { + serializedName: "retentionPolicy", + type: { + name: "Composite", + className: "RetentionPolicy" } } } } }; -export const Incident: coreClient.CompositeMapper = { +export const ResourceAutoGenerated5: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Incident", + className: "ResourceAutoGenerated5", modelProperties: { - name: { - serializedName: "name", + id: { + serializedName: "id", readOnly: true, type: { name: "String" } }, - ruleName: { - serializedName: "ruleName", + name: { + serializedName: "name", readOnly: true, type: { name: "String" } }, - isActive: { - serializedName: "isActive", - readOnly: true, - type: { - name: "Boolean" - } - }, - activatedTime: { - serializedName: "activatedTime", - readOnly: true, - type: { - name: "DateTime" - } - }, - resolvedTime: { - serializedName: "resolvedTime", + type: { + serializedName: "type", readOnly: true, type: { - name: "DateTime" + name: "String" } } } } }; -export const ErrorResponse: coreClient.CompositeMapper = { +export const DiagnosticSettingsResourceCollection: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorResponse", + className: "DiagnosticSettingsResourceCollection", modelProperties: { - code: { - serializedName: "code", - type: { - name: "String" - } - }, - message: { - serializedName: "message", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DiagnosticSettingsResource" + } + } } } } } }; -export const IncidentListResult: coreClient.CompositeMapper = { +export const DiagnosticSettingsCategoryResourceCollection: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IncidentListResult", + className: "DiagnosticSettingsCategoryResourceCollection", modelProperties: { value: { serializedName: "value", @@ -1007,7 +2000,7 @@ export const IncidentListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Incident" + className: "DiagnosticSettingsCategoryResource" } } } @@ -1016,461 +2009,455 @@ export const IncidentListResult: coreClient.CompositeMapper = { } }; -export const RuleCondition: coreClient.CompositeMapper = { +export const EmailReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RuleCondition", - uberParent: "RuleCondition", - polymorphicDiscriminator: { - serializedName: "odata\\.type", - clientName: "odataType" - }, + className: "EmailReceiver", modelProperties: { - odataType: { - serializedName: "odata\\.type", + name: { + serializedName: "name", required: true, type: { name: "String" } }, - dataSource: { - serializedName: "dataSource", + emailAddress: { + serializedName: "emailAddress", + required: true, type: { - name: "Composite", - className: "RuleDataSource" + name: "String" + } + }, + useCommonAlertSchema: { + defaultValue: false, + serializedName: "useCommonAlertSchema", + type: { + name: "Boolean" + } + }, + status: { + serializedName: "status", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["NotSpecified", "Enabled", "Disabled"] } } } } }; -export const RuleDataSource: coreClient.CompositeMapper = { +export const SmsReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RuleDataSource", - uberParent: "RuleDataSource", - polymorphicDiscriminator: { - serializedName: "odata\\.type", - clientName: "odataType" - }, + className: "SmsReceiver", modelProperties: { - odataType: { - serializedName: "odata\\.type", + name: { + serializedName: "name", required: true, type: { name: "String" } }, - resourceUri: { - serializedName: "resourceUri", - type: { - name: "String" - } - }, - legacyResourceId: { - serializedName: "legacyResourceId", + countryCode: { + serializedName: "countryCode", + required: true, type: { name: "String" } }, - resourceLocation: { - serializedName: "resourceLocation", + phoneNumber: { + serializedName: "phoneNumber", + required: true, type: { name: "String" } }, - metricNamespace: { - serializedName: "metricNamespace", + status: { + serializedName: "status", + readOnly: true, type: { - name: "String" + name: "Enum", + allowedValues: ["NotSpecified", "Enabled", "Disabled"] } } } } }; -export const RuleAction: coreClient.CompositeMapper = { +export const WebhookReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RuleAction", - uberParent: "RuleAction", - polymorphicDiscriminator: { - serializedName: "odata\\.type", - clientName: "odataType" - }, + className: "WebhookReceiver", modelProperties: { - odataType: { - serializedName: "odata\\.type", + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + serviceUri: { + serializedName: "serviceUri", required: true, type: { name: "String" } + }, + useCommonAlertSchema: { + defaultValue: false, + serializedName: "useCommonAlertSchema", + type: { + name: "Boolean" + } + }, + useAadAuth: { + defaultValue: false, + serializedName: "useAadAuth", + type: { + name: "Boolean" + } + }, + objectId: { + serializedName: "objectId", + type: { + name: "String" + } + }, + identifierUri: { + serializedName: "identifierUri", + type: { + name: "String" + } + }, + tenantId: { + serializedName: "tenantId", + type: { + name: "String" + } } } } }; -export const ResourceAutoGenerated: coreClient.CompositeMapper = { +export const ItsmReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceAutoGenerated", + className: "ItsmReceiver", modelProperties: { - id: { - serializedName: "id", - readOnly: true, + name: { + serializedName: "name", + required: true, type: { name: "String" } }, - name: { - serializedName: "name", - readOnly: true, + workspaceId: { + serializedName: "workspaceId", + required: true, type: { name: "String" } }, - type: { - serializedName: "type", - readOnly: true, + connectionId: { + serializedName: "connectionId", + required: true, type: { name: "String" } }, - location: { - serializedName: "location", + ticketConfiguration: { + serializedName: "ticketConfiguration", required: true, type: { name: "String" } }, - tags: { - serializedName: "tags", + region: { + serializedName: "region", + required: true, type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" } } } } }; -export const AlertRuleResourcePatch: coreClient.CompositeMapper = { +export const AzureAppPushReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AlertRuleResourcePatch", + className: "AzureAppPushReceiver", modelProperties: { - tags: { - serializedName: "tags", + name: { + serializedName: "name", + required: true, type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" } }, - name: { - serializedName: "properties.name", + emailAddress: { + serializedName: "emailAddress", + required: true, type: { name: "String" } - }, - description: { - serializedName: "properties.description", + } + } + } +}; + +export const AutomationRunbookReceiver: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AutomationRunbookReceiver", + modelProperties: { + automationAccountId: { + serializedName: "automationAccountId", + required: true, type: { name: "String" } }, - provisioningState: { - serializedName: "properties.provisioningState", + runbookName: { + serializedName: "runbookName", + required: true, type: { name: "String" } }, - isEnabled: { - serializedName: "properties.isEnabled", + webhookResourceId: { + serializedName: "webhookResourceId", + required: true, type: { - name: "Boolean" + name: "String" } }, - condition: { - serializedName: "properties.condition", + isGlobalRunbook: { + serializedName: "isGlobalRunbook", + required: true, type: { - name: "Composite", - className: "RuleCondition" + name: "Boolean" } }, - action: { - serializedName: "properties.action", + name: { + serializedName: "name", type: { - name: "Composite", - className: "RuleAction" + name: "String" } }, - actions: { - serializedName: "properties.actions", + serviceUri: { + serializedName: "serviceUri", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RuleAction" - } - } + name: "String" } }, - lastUpdatedTime: { - serializedName: "properties.lastUpdatedTime", - readOnly: true, + useCommonAlertSchema: { + defaultValue: false, + serializedName: "useCommonAlertSchema", type: { - name: "DateTime" + name: "Boolean" } } } } }; -export const AlertRuleResourceCollection: coreClient.CompositeMapper = { +export const VoiceReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AlertRuleResourceCollection", + className: "VoiceReceiver", modelProperties: { - value: { - serializedName: "value", + name: { + serializedName: "name", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AlertRuleResource" - } - } + name: "String" } - } - } - } -}; - -export const RetentionPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RetentionPolicy", - modelProperties: { - enabled: { - serializedName: "enabled", + }, + countryCode: { + serializedName: "countryCode", required: true, type: { - name: "Boolean" + name: "String" } }, - days: { - constraints: { - InclusiveMinimum: 0 - }, - serializedName: "days", + phoneNumber: { + serializedName: "phoneNumber", required: true, type: { - name: "Number" + name: "String" } } } } }; -export const ResourceAutoGenerated2: coreClient.CompositeMapper = { +export const LogicAppReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceAutoGenerated2", + className: "LogicAppReceiver", modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String" - } - }, name: { serializedName: "name", - readOnly: true, + required: true, type: { name: "String" } }, - type: { - serializedName: "type", - readOnly: true, + resourceId: { + serializedName: "resourceId", + required: true, type: { name: "String" } }, - location: { - serializedName: "location", + callbackUrl: { + serializedName: "callbackUrl", required: true, type: { name: "String" } }, - tags: { - serializedName: "tags", + useCommonAlertSchema: { + defaultValue: false, + serializedName: "useCommonAlertSchema", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "Boolean" } } } } }; -export const LogProfileResourcePatch: coreClient.CompositeMapper = { +export const AzureFunctionReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LogProfileResourcePatch", + className: "AzureFunctionReceiver", modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - }, - storageAccountId: { - serializedName: "properties.storageAccountId", + name: { + serializedName: "name", + required: true, type: { name: "String" } }, - serviceBusRuleId: { - serializedName: "properties.serviceBusRuleId", + functionAppResourceId: { + serializedName: "functionAppResourceId", + required: true, type: { name: "String" } }, - locations: { - serializedName: "properties.locations", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - categories: { - serializedName: "properties.categories", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - retentionPolicy: { - serializedName: "properties.retentionPolicy", - type: { - name: "Composite", - className: "RetentionPolicy" - } - } - } - } -}; - -export const LogProfileCollection: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LogProfileCollection", - modelProperties: { - value: { - serializedName: "value", + functionName: { + serializedName: "functionName", required: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "LogProfileResource" - } - } + name: "String" + } + }, + httpTriggerUrl: { + serializedName: "httpTriggerUrl", + required: true, + type: { + name: "String" + } + }, + useCommonAlertSchema: { + defaultValue: false, + serializedName: "useCommonAlertSchema", + type: { + name: "Boolean" } } } } }; -export const MetricSettings: coreClient.CompositeMapper = { +export const ArmRoleReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricSettings", + className: "ArmRoleReceiver", modelProperties: { - timeGrain: { - serializedName: "timeGrain", - type: { - name: "TimeSpan" - } - }, - category: { - serializedName: "category", + name: { + serializedName: "name", + required: true, type: { name: "String" } }, - enabled: { - serializedName: "enabled", + roleId: { + serializedName: "roleId", required: true, type: { - name: "Boolean" + name: "String" } }, - retentionPolicy: { - serializedName: "retentionPolicy", + useCommonAlertSchema: { + defaultValue: false, + serializedName: "useCommonAlertSchema", type: { - name: "Composite", - className: "RetentionPolicy" + name: "Boolean" } } } } }; -export const LogSettings: coreClient.CompositeMapper = { +export const EventHubReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LogSettings", + className: "EventHubReceiver", modelProperties: { - category: { - serializedName: "category", + name: { + serializedName: "name", + required: true, type: { name: "String" } }, - categoryGroup: { - serializedName: "categoryGroup", + eventHubNameSpace: { + serializedName: "eventHubNameSpace", + required: true, type: { name: "String" } }, - enabled: { - serializedName: "enabled", + eventHubName: { + serializedName: "eventHubName", required: true, + type: { + name: "String" + } + }, + useCommonAlertSchema: { + defaultValue: false, + serializedName: "useCommonAlertSchema", type: { name: "Boolean" } }, - retentionPolicy: { - serializedName: "retentionPolicy", + tenantId: { + serializedName: "tenantId", type: { - name: "Composite", - className: "RetentionPolicy" + name: "String" + } + }, + subscriptionId: { + serializedName: "subscriptionId", + required: true, + type: { + name: "String" } } } } }; -export const ResourceAutoGenerated3: coreClient.CompositeMapper = { +export const AzureResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceAutoGenerated3", + className: "AzureResource", modelProperties: { id: { serializedName: "id", @@ -1492,243 +2479,259 @@ export const ResourceAutoGenerated3: coreClient.CompositeMapper = { type: { name: "String" } - } - } - } -}; - -export const DiagnosticSettingsResourceCollection: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiagnosticSettingsResourceCollection", - modelProperties: { - value: { - serializedName: "value", + }, + location: { + serializedName: "location", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DiagnosticSettingsResource" - } - } + name: "String" } - } - } - } -}; - -export const DiagnosticSettingsCategoryResourceCollection: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiagnosticSettingsCategoryResourceCollection", - modelProperties: { - value: { - serializedName: "value", + }, + tags: { + serializedName: "tags", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DiagnosticSettingsCategoryResource" - } - } + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const EmailReceiver: coreClient.CompositeMapper = { +export const ActionGroupPatchBody: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EmailReceiver", + className: "ActionGroupPatchBody", modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String" - } - }, - emailAddress: { - serializedName: "emailAddress", - required: true, + tags: { + serializedName: "tags", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } }, - useCommonAlertSchema: { - defaultValue: false, - serializedName: "useCommonAlertSchema", + enabled: { + defaultValue: true, + serializedName: "properties.enabled", type: { name: "Boolean" } - }, - status: { - serializedName: "status", - readOnly: true, - type: { - name: "Enum", - allowedValues: ["NotSpecified", "Enabled", "Disabled"] - } } } } }; -export const SmsReceiver: coreClient.CompositeMapper = { +export const NotificationRequestBody: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SmsReceiver", + className: "NotificationRequestBody", modelProperties: { - name: { - serializedName: "name", + alertType: { + constraints: { + MaxLength: 30 + }, + serializedName: "alertType", required: true, type: { name: "String" } }, - countryCode: { - serializedName: "countryCode", - required: true, + emailReceivers: { + serializedName: "emailReceivers", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EmailReceiver" + } + } } }, - phoneNumber: { - serializedName: "phoneNumber", - required: true, + smsReceivers: { + serializedName: "smsReceivers", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SmsReceiver" + } + } } }, - status: { - serializedName: "status", - readOnly: true, + webhookReceivers: { + serializedName: "webhookReceivers", type: { - name: "Enum", - allowedValues: ["NotSpecified", "Enabled", "Disabled"] + name: "Sequence", + element: { + type: { + name: "Composite", + className: "WebhookReceiver" + } + } } - } - } - } -}; - -export const WebhookReceiver: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "WebhookReceiver", - modelProperties: { - name: { - serializedName: "name", - required: true, + }, + itsmReceivers: { + serializedName: "itsmReceivers", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ItsmReceiver" + } + } + } + }, + azureAppPushReceivers: { + serializedName: "azureAppPushReceivers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AzureAppPushReceiver" + } + } } }, - serviceUri: { - serializedName: "serviceUri", - required: true, + automationRunbookReceivers: { + serializedName: "automationRunbookReceivers", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AutomationRunbookReceiver" + } + } } }, - useCommonAlertSchema: { - defaultValue: false, - serializedName: "useCommonAlertSchema", + voiceReceivers: { + serializedName: "voiceReceivers", type: { - name: "Boolean" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VoiceReceiver" + } + } } }, - useAadAuth: { - defaultValue: false, - serializedName: "useAadAuth", + logicAppReceivers: { + serializedName: "logicAppReceivers", type: { - name: "Boolean" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LogicAppReceiver" + } + } } }, - objectId: { - serializedName: "objectId", + azureFunctionReceivers: { + serializedName: "azureFunctionReceivers", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AzureFunctionReceiver" + } + } } }, - identifierUri: { - serializedName: "identifierUri", + armRoleReceivers: { + serializedName: "armRoleReceivers", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ArmRoleReceiver" + } + } } }, - tenantId: { - serializedName: "tenantId", + eventHubReceivers: { + serializedName: "eventHubReceivers", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EventHubReceiver" + } + } } } } } }; -export const ItsmReceiver: coreClient.CompositeMapper = { +export const TestNotificationDetailsResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ItsmReceiver", + className: "TestNotificationDetailsResponse", modelProperties: { - name: { - serializedName: "name", - required: true, + context: { + serializedName: "context", type: { - name: "String" + name: "Composite", + className: "Context" } }, - workspaceId: { - serializedName: "workspaceId", + state: { + serializedName: "state", required: true, type: { name: "String" } }, - connectionId: { - serializedName: "connectionId", - required: true, + completedTime: { + serializedName: "completedTime", type: { name: "String" } }, - ticketConfiguration: { - serializedName: "ticketConfiguration", - required: true, + createdTime: { + serializedName: "createdTime", type: { name: "String" } }, - region: { - serializedName: "region", - required: true, + actionDetails: { + serializedName: "actionDetails", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ActionDetail" + } + } } } } } }; -export const AzureAppPushReceiver: coreClient.CompositeMapper = { +export const Context: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureAppPushReceiver", + className: "Context", modelProperties: { - name: { - serializedName: "name", - required: true, + notificationSource: { + serializedName: "notificationSource", type: { name: "String" } }, - emailAddress: { - serializedName: "emailAddress", - required: true, + contextType: { + serializedName: "contextType", type: { name: "String" } @@ -1737,84 +2740,70 @@ export const AzureAppPushReceiver: coreClient.CompositeMapper = { } }; -export const AutomationRunbookReceiver: coreClient.CompositeMapper = { +export const ActionDetail: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AutomationRunbookReceiver", + className: "ActionDetail", modelProperties: { - automationAccountId: { - serializedName: "automationAccountId", - required: true, + mechanismType: { + serializedName: "MechanismType", type: { name: "String" } }, - runbookName: { - serializedName: "runbookName", - required: true, + name: { + serializedName: "Name", type: { name: "String" } }, - webhookResourceId: { - serializedName: "webhookResourceId", - required: true, + status: { + serializedName: "Status", type: { name: "String" } }, - isGlobalRunbook: { - serializedName: "isGlobalRunbook", - required: true, - type: { - name: "Boolean" - } - }, - name: { - serializedName: "name", + subState: { + serializedName: "SubState", type: { name: "String" } }, - serviceUri: { - serializedName: "serviceUri", + sendTime: { + serializedName: "SendTime", type: { name: "String" } }, - useCommonAlertSchema: { - defaultValue: false, - serializedName: "useCommonAlertSchema", + detail: { + serializedName: "Detail", type: { - name: "Boolean" + name: "String" } } } } }; -export const VoiceReceiver: coreClient.CompositeMapper = { +export const ActionGroupList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "VoiceReceiver", + className: "ActionGroupList", modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String" - } - }, - countryCode: { - serializedName: "countryCode", - required: true, + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ActionGroupResource" + } + } } }, - phoneNumber: { - serializedName: "phoneNumber", - required: true, + nextLink: { + serializedName: "nextLink", type: { name: "String" } @@ -1823,71 +2812,36 @@ export const VoiceReceiver: coreClient.CompositeMapper = { } }; -export const LogicAppReceiver: coreClient.CompositeMapper = { +export const EnableRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LogicAppReceiver", + className: "EnableRequest", modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String" - } - }, - resourceId: { - serializedName: "resourceId", - required: true, - type: { - name: "String" - } - }, - callbackUrl: { - serializedName: "callbackUrl", + receiverName: { + serializedName: "receiverName", required: true, type: { name: "String" } - }, - useCommonAlertSchema: { - defaultValue: false, - serializedName: "useCommonAlertSchema", - type: { - name: "Boolean" - } } } } -}; - -export const AzureFunctionReceiver: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AzureFunctionReceiver", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String" - } - }, - functionAppResourceId: { - serializedName: "functionAppResourceId", - required: true, - type: { - name: "String" - } - }, - functionName: { - serializedName: "functionName", +}; + +export const EmailReceiverAutoGenerated: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EmailReceiverAutoGenerated", + modelProperties: { + name: { + serializedName: "name", required: true, type: { name: "String" } }, - httpTriggerUrl: { - serializedName: "httpTriggerUrl", + emailAddress: { + serializedName: "emailAddress", required: true, type: { name: "String" @@ -1899,15 +2853,23 @@ export const AzureFunctionReceiver: coreClient.CompositeMapper = { type: { name: "Boolean" } + }, + status: { + serializedName: "status", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["NotSpecified", "Enabled", "Disabled"] + } } } } }; -export const ArmRoleReceiver: coreClient.CompositeMapper = { +export const SmsReceiverAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ArmRoleReceiver", + className: "SmsReceiverAutoGenerated", modelProperties: { name: { serializedName: "name", @@ -1916,28 +2878,36 @@ export const ArmRoleReceiver: coreClient.CompositeMapper = { name: "String" } }, - roleId: { - serializedName: "roleId", + countryCode: { + serializedName: "countryCode", required: true, type: { name: "String" } }, - useCommonAlertSchema: { - defaultValue: false, - serializedName: "useCommonAlertSchema", + phoneNumber: { + serializedName: "phoneNumber", + required: true, type: { - name: "Boolean" + name: "String" + } + }, + status: { + serializedName: "status", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["NotSpecified", "Enabled", "Disabled"] } } } } }; -export const EventHubReceiver: coreClient.CompositeMapper = { +export const WebhookReceiverAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EventHubReceiver", + className: "WebhookReceiverAutoGenerated", modelProperties: { name: { serializedName: "name", @@ -1946,36 +2916,41 @@ export const EventHubReceiver: coreClient.CompositeMapper = { name: "String" } }, - eventHubNameSpace: { - serializedName: "eventHubNameSpace", + serviceUri: { + serializedName: "serviceUri", required: true, type: { name: "String" } }, - eventHubName: { - serializedName: "eventHubName", - required: true, + useCommonAlertSchema: { + defaultValue: false, + serializedName: "useCommonAlertSchema", type: { - name: "String" + name: "Boolean" } }, - useCommonAlertSchema: { + useAadAuth: { defaultValue: false, - serializedName: "useCommonAlertSchema", + serializedName: "useAadAuth", type: { name: "Boolean" } }, - tenantId: { - serializedName: "tenantId", + objectId: { + serializedName: "objectId", type: { name: "String" } }, - subscriptionId: { - serializedName: "subscriptionId", - required: true, + identifierUri: { + serializedName: "identifierUri", + type: { + name: "String" + } + }, + tenantId: { + serializedName: "tenantId", type: { name: "String" } @@ -1984,54 +2959,63 @@ export const EventHubReceiver: coreClient.CompositeMapper = { } }; -export const AzureResource: coreClient.CompositeMapper = { +export const AzureAppPushReceiverAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureResource", + className: "AzureAppPushReceiverAutoGenerated", modelProperties: { - id: { - serializedName: "id", - readOnly: true, + name: { + serializedName: "name", + required: true, type: { name: "String" } }, - name: { - serializedName: "name", - readOnly: true, + emailAddress: { + serializedName: "emailAddress", + required: true, type: { name: "String" } - }, - type: { - serializedName: "type", - readOnly: true, + } + } + } +}; + +export const VoiceReceiverAutoGenerated: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VoiceReceiverAutoGenerated", + modelProperties: { + name: { + serializedName: "name", + required: true, type: { name: "String" } }, - location: { - serializedName: "location", + countryCode: { + serializedName: "countryCode", required: true, type: { name: "String" } }, - tags: { - serializedName: "tags", + phoneNumber: { + serializedName: "phoneNumber", + required: true, type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" } } } } }; -export const ActionGroupPatchBody: coreClient.CompositeMapper = { +export const ActionGroupPatchBodyAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ActionGroupPatchBody", + className: "ActionGroupPatchBodyAutoGenerated", modelProperties: { tags: { serializedName: "tags", @@ -2051,10 +3035,37 @@ export const ActionGroupPatchBody: coreClient.CompositeMapper = { } }; -export const NotificationRequestBody: coreClient.CompositeMapper = { +export const TenantActionGroupList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NotificationRequestBody", + className: "TenantActionGroupList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TenantActionGroupResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const TenantNotificationRequestBody: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TenantNotificationRequestBody", modelProperties: { alertType: { constraints: { @@ -2073,7 +3084,7 @@ export const NotificationRequestBody: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "EmailReceiver" + className: "EmailReceiverAutoGenerated" } } } @@ -2085,7 +3096,7 @@ export const NotificationRequestBody: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "SmsReceiver" + className: "SmsReceiverAutoGenerated" } } } @@ -2097,19 +3108,7 @@ export const NotificationRequestBody: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "WebhookReceiver" - } - } - } - }, - itsmReceivers: { - serializedName: "itsmReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ItsmReceiver" + className: "WebhookReceiverAutoGenerated" } } } @@ -2121,19 +3120,7 @@ export const NotificationRequestBody: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "AzureAppPushReceiver" - } - } - } - }, - automationRunbookReceivers: { - serializedName: "automationRunbookReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AutomationRunbookReceiver" + className: "AzureAppPushReceiverAutoGenerated" } } } @@ -2145,55 +3132,7 @@ export const NotificationRequestBody: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "VoiceReceiver" - } - } - } - }, - logicAppReceivers: { - serializedName: "logicAppReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "LogicAppReceiver" - } - } - } - }, - azureFunctionReceivers: { - serializedName: "azureFunctionReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AzureFunctionReceiver" - } - } - } - }, - armRoleReceivers: { - serializedName: "armRoleReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ArmRoleReceiver" - } - } - } - }, - eventHubReceivers: { - serializedName: "eventHubReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "EventHubReceiver" + className: "VoiceReceiverAutoGenerated" } } } @@ -2202,10 +3141,10 @@ export const NotificationRequestBody: coreClient.CompositeMapper = { } }; -export const TestNotificationDetailsResponse: coreClient.CompositeMapper = { +export const TestNotificationDetailsResponseAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TestNotificationDetailsResponse", + className: "TestNotificationDetailsResponseAutoGenerated", modelProperties: { context: { serializedName: "context", @@ -2222,91 +3161,70 @@ export const TestNotificationDetailsResponse: coreClient.CompositeMapper = { } }, completedTime: { - serializedName: "completedTime", - type: { - name: "String" - } - }, - createdTime: { - serializedName: "createdTime", - type: { - name: "String" - } - }, - actionDetails: { - serializedName: "actionDetails", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ActionDetail" - } - } - } - } - } - } -}; - -export const Context: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Context", - modelProperties: { - notificationSource: { - serializedName: "notificationSource", + serializedName: "completedTime", type: { name: "String" } }, - contextType: { - serializedName: "contextType", + createdTime: { + serializedName: "createdTime", type: { name: "String" } + }, + actionDetails: { + serializedName: "actionDetails", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ActionDetailAutoGenerated" + } + } + } } } } }; -export const ActionDetail: coreClient.CompositeMapper = { +export const ActionDetailAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ActionDetail", + className: "ActionDetailAutoGenerated", modelProperties: { mechanismType: { - serializedName: "MechanismType", + serializedName: "mechanismType", type: { name: "String" } }, name: { - serializedName: "Name", + serializedName: "name", type: { name: "String" } }, status: { - serializedName: "Status", + serializedName: "status", type: { name: "String" } }, subState: { - serializedName: "SubState", + serializedName: "subState", type: { name: "String" } }, sendTime: { - serializedName: "SendTime", + serializedName: "sendTime", type: { name: "String" } }, - detail: { - serializedName: "Detail", + message: { + serializedName: "message", type: { name: "String" } @@ -2315,44 +3233,73 @@ export const ActionDetail: coreClient.CompositeMapper = { } }; -export const ActionGroupList: coreClient.CompositeMapper = { +export const ErrorResponseAutoGenerated2: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ActionGroupList", + className: "ErrorResponseAutoGenerated2", modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ActionGroupResource" - } - } - } - }, - nextLink: { - serializedName: "nextLink", + error: { + serializedName: "error", type: { - name: "String" + name: "Composite", + className: "ErrorDetailAutoGenerated" } } } } }; -export const EnableRequest: coreClient.CompositeMapper = { +export const ErrorDetailAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EnableRequest", + className: "ErrorDetailAutoGenerated", modelProperties: { - receiverName: { - serializedName: "receiverName", - required: true, + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + readOnly: true, type: { name: "String" } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetailAutoGenerated" + } + } + } + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } } } } @@ -2676,6 +3623,170 @@ export const EventCategoryCollection: coreClient.CompositeMapper = { } }; +export const SubscriptionScopeMetricDefinitionCollection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SubscriptionScopeMetricDefinitionCollection", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SubscriptionScopeMetricDefinition" + } + } + } + } + } + } +}; + +export const SubscriptionScopeMetricDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SubscriptionScopeMetricDefinition", + modelProperties: { + isDimensionRequired: { + serializedName: "isDimensionRequired", + type: { + name: "Boolean" + } + }, + resourceId: { + serializedName: "resourceId", + type: { + name: "String" + } + }, + namespace: { + serializedName: "namespace", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "Composite", + className: "LocalizableString" + } + }, + displayDescription: { + serializedName: "displayDescription", + type: { + name: "String" + } + }, + category: { + serializedName: "category", + type: { + name: "String" + } + }, + metricClass: { + serializedName: "metricClass", + type: { + name: "String" + } + }, + unit: { + serializedName: "unit", + type: { + name: "String" + } + }, + primaryAggregationType: { + serializedName: "primaryAggregationType", + type: { + name: "String" + } + }, + supportedAggregationTypes: { + serializedName: "supportedAggregationTypes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + metricAvailabilities: { + serializedName: "metricAvailabilities", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricAvailability" + } + } + } + }, + id: { + serializedName: "id", + type: { + name: "String" + } + }, + dimensions: { + serializedName: "dimensions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LocalizableString" + } + } + } + } + } + } +}; + +export const MetricAvailability: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricAvailability", + modelProperties: { + timeGrain: { + serializedName: "timeGrain", + type: { + name: "TimeSpan" + } + }, + retention: { + serializedName: "retention", + type: { + name: "TimeSpan" + } + } + } + } +}; + +export const ErrorContract: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorContract", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorResponseAutoGenerated" + } + } + } + } +}; + export const MetricDefinitionCollection: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2819,31 +3930,10 @@ export const MetricDefinition: coreClient.CompositeMapper = { } }; -export const MetricAvailability: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MetricAvailability", - modelProperties: { - timeGrain: { - serializedName: "timeGrain", - type: { - name: "TimeSpan" - } - }, - retention: { - serializedName: "retention", - type: { - name: "TimeSpan" - } - } - } - } -}; - -export const Response: coreClient.CompositeMapper = { +export const SubscriptionScopeMetricResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Response", + className: "SubscriptionScopeMetricResponse", modelProperties: { cost: { constraints: { @@ -2887,7 +3977,7 @@ export const Response: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Metric" + className: "SubscriptionScopeMetric" } } } @@ -2896,10 +3986,10 @@ export const Response: coreClient.CompositeMapper = { } }; -export const Metric: coreClient.CompositeMapper = { +export const SubscriptionScopeMetric: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Metric", + className: "SubscriptionScopeMetric", modelProperties: { id: { serializedName: "id", @@ -3065,6 +4155,226 @@ export const MetricValue: coreClient.CompositeMapper = { } }; +export const SubscriptionScopeMetricsRequestBodyParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SubscriptionScopeMetricsRequestBodyParameters", + modelProperties: { + timespan: { + serializedName: "timespan", + type: { + name: "String" + } + }, + interval: { + serializedName: "interval", + type: { + name: "TimeSpan" + } + }, + metricNames: { + serializedName: "metricNames", + type: { + name: "String" + } + }, + aggregation: { + serializedName: "aggregation", + type: { + name: "String" + } + }, + filter: { + serializedName: "filter", + type: { + name: "String" + } + }, + top: { + serializedName: "top", + type: { + name: "Number" + } + }, + orderBy: { + serializedName: "orderBy", + type: { + name: "String" + } + }, + rollUpBy: { + serializedName: "rollUpBy", + type: { + name: "String" + } + }, + resultType: { + serializedName: "resultType", + type: { + name: "String" + } + }, + metricNamespace: { + serializedName: "metricNamespace", + type: { + name: "String" + } + }, + autoAdjustTimegrain: { + serializedName: "autoAdjustTimegrain", + type: { + name: "Boolean" + } + }, + validateDimensions: { + serializedName: "validateDimensions", + type: { + name: "Boolean" + } + } + } + } +}; + +export const Response: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Response", + modelProperties: { + cost: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "cost", + type: { + name: "Number" + } + }, + timespan: { + serializedName: "timespan", + required: true, + type: { + name: "String" + } + }, + interval: { + serializedName: "interval", + type: { + name: "TimeSpan" + } + }, + namespace: { + serializedName: "namespace", + type: { + name: "String" + } + }, + resourceregion: { + serializedName: "resourceregion", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Metric" + } + } + } + } + } + } +}; + +export const Metric: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Metric", + modelProperties: { + id: { + serializedName: "id", + required: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + required: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "Composite", + className: "LocalizableString" + } + }, + displayDescription: { + serializedName: "displayDescription", + type: { + name: "String" + } + }, + errorCode: { + serializedName: "errorCode", + type: { + name: "String" + } + }, + errorMessage: { + serializedName: "errorMessage", + type: { + name: "String" + } + }, + unit: { + serializedName: "unit", + required: true, + type: { + name: "Enum", + allowedValues: [ + "Count", + "Bytes", + "Seconds", + "CountPerSecond", + "BytesPerSecond", + "Percent", + "MilliSeconds", + "ByteSeconds", + "Unspecified", + "Cores", + "MilliCores", + "NanoCores", + "BitsPerSecond" + ] + } + }, + timeseries: { + serializedName: "timeseries", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TimeSeriesElement" + } + } + } + } + } + } +}; + export const MetricBaselinesResponse: coreClient.CompositeMapper = { type: { name: "Composite", @@ -3366,10 +4676,10 @@ export const MetricAlertAction: coreClient.CompositeMapper = { } }; -export const ResourceAutoGenerated4: coreClient.CompositeMapper = { +export const ResourceAutoGenerated6: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceAutoGenerated4", + className: "ResourceAutoGenerated6", modelProperties: { id: { serializedName: "id", @@ -3735,7 +5045,6 @@ export const ScheduledQueryRuleResource: coreClient.CompositeMapper = { } }, publicNetworkAccess: { - defaultValue: "Enabled", serializedName: "properties.publicNetworkAccess", type: { name: "String" @@ -4104,10 +5413,10 @@ export const RuleResolveConfiguration: coreClient.CompositeMapper = { } }; -export const ErrorContract: coreClient.CompositeMapper = { +export const ErrorContractAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorContract", + className: "ErrorContractAutoGenerated", modelProperties: { error: { serializedName: "error", @@ -4258,7 +5567,6 @@ export const ScheduledQueryRuleResourcePatch: coreClient.CompositeMapper = { } }, publicNetworkAccess: { - defaultValue: "Enabled", serializedName: "properties.publicNetworkAccess", type: { name: "String" @@ -4579,41 +5887,14 @@ export const AzureMonitorPrivateLinkScopeListResult: coreClient.CompositeMapper } }; -export const PrivateEndpoint: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpoint", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { +export const PrivateEndpointAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateLinkServiceConnectionState", + className: "PrivateEndpointAutoGenerated", modelProperties: { - status: { - serializedName: "status", - type: { - name: "String" - } - }, - description: { - serializedName: "description", - type: { - name: "String" - } - }, - actionsRequired: { - serializedName: "actionsRequired", + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } @@ -4693,87 +5974,7 @@ export const DefaultErrorResponse: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorDetail" - } - } - } - } -}; - -export const ErrorDetail: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorDetail", - modelProperties: { - code: { - serializedName: "code", - readOnly: true, - type: { - name: "String" - } - }, - message: { - serializedName: "message", - readOnly: true, - type: { - name: "String" - } - }, - target: { - serializedName: "target", - readOnly: true, - type: { - name: "String" - } - }, - details: { - serializedName: "details", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorDetail" - } - } - } - }, - additionalInfo: { - serializedName: "additionalInfo", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } -}; - -export const ErrorAdditionalInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - modelProperties: { - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String" - } - }, - info: { - serializedName: "info", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "any" } } + className: "ErrorDetailAutoGenerated" } } } @@ -4837,7 +6038,7 @@ export const OperationStatus: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorDetail" + className: "ErrorDetailAutoGenerated" } } } @@ -4877,7 +6078,7 @@ export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "PrivateEndpointConnection" + className: "PrivateEndpointConnectionAutoGenerated" } } } @@ -5057,10 +6258,10 @@ export const AzureResourceAutoGenerated: coreClient.CompositeMapper = { } }; -export const ErrorResponseAutoGenerated: coreClient.CompositeMapper = { +export const ErrorResponseAutoGenerated3: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorResponseAutoGenerated", + className: "ErrorResponseAutoGenerated3", modelProperties: { code: { serializedName: "code", @@ -5183,6 +6384,13 @@ export const DataCollectionEndpointResource: coreClient.CompositeMapper = { name: "String" } }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "DataCollectionEndpointResourceIdentity" + } + }, id: { serializedName: "id", readOnly: true, @@ -5244,6 +6452,13 @@ export const DataCollectionEndpointResource: coreClient.CompositeMapper = { className: "DataCollectionEndpointLogsIngestion" } }, + metricsIngestion: { + serializedName: "properties.metricsIngestion", + type: { + name: "Composite", + className: "DataCollectionEndpointMetricsIngestion" + } + }, networkAcls: { serializedName: "properties.networkAcls", type: { @@ -5257,6 +6472,33 @@ export const DataCollectionEndpointResource: coreClient.CompositeMapper = { type: { name: "String" } + }, + privateLinkScopedResources: { + serializedName: "properties.privateLinkScopedResources", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateLinkScopedResource" + } + } + } + }, + failoverConfiguration: { + serializedName: "properties.failoverConfiguration", + type: { + name: "Composite", + className: "DataCollectionEndpointFailoverConfiguration" + } + }, + metadata: { + serializedName: "properties.metadata", + type: { + name: "Composite", + className: "DataCollectionEndpointMetadata" + } } } } @@ -5292,17 +6534,183 @@ export const DataCollectionEndpoint: coreClient.CompositeMapper = { name: "Composite", className: "DataCollectionEndpointLogsIngestion" } - }, - networkAcls: { - serializedName: "networkAcls", + }, + metricsIngestion: { + serializedName: "metricsIngestion", + type: { + name: "Composite", + className: "DataCollectionEndpointMetricsIngestion" + } + }, + networkAcls: { + serializedName: "networkAcls", + type: { + name: "Composite", + className: "DataCollectionEndpointNetworkAcls" + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + privateLinkScopedResources: { + serializedName: "privateLinkScopedResources", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateLinkScopedResource" + } + } + } + }, + failoverConfiguration: { + serializedName: "failoverConfiguration", + type: { + name: "Composite", + className: "DataCollectionEndpointFailoverConfiguration" + } + }, + metadata: { + serializedName: "metadata", + type: { + name: "Composite", + className: "DataCollectionEndpointMetadata" + } + } + } + } +}; + +export const ConfigurationAccessEndpointSpec: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConfigurationAccessEndpointSpec", + modelProperties: { + endpoint: { + serializedName: "endpoint", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const LogsIngestionEndpointSpec: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LogsIngestionEndpointSpec", + modelProperties: { + endpoint: { + serializedName: "endpoint", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const MetricsIngestionEndpointSpec: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricsIngestionEndpointSpec", + modelProperties: { + endpoint: { + serializedName: "endpoint", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const NetworkRuleSet: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkRuleSet", + modelProperties: { + publicNetworkAccess: { + serializedName: "publicNetworkAccess", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateLinkScopedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkScopedResource", + modelProperties: { + resourceId: { + serializedName: "resourceId", + type: { + name: "String" + } + }, + scopeId: { + serializedName: "scopeId", + type: { + name: "String" + } + } + } + } +}; + +export const FailoverConfigurationSpec: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FailoverConfigurationSpec", + modelProperties: { + activeLocation: { + serializedName: "activeLocation", + type: { + name: "String" + } + }, + locations: { + serializedName: "locations", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LocationSpec" + } + } + } + } + } + } +}; + +export const LocationSpec: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LocationSpec", + modelProperties: { + location: { + serializedName: "location", type: { - name: "Composite", - className: "DataCollectionEndpointNetworkAcls" + name: "String" } }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, + provisioningStatus: { + serializedName: "provisioningStatus", type: { name: "String" } @@ -5311,13 +6719,20 @@ export const DataCollectionEndpoint: coreClient.CompositeMapper = { } }; -export const ConfigurationAccessEndpointSpec: coreClient.CompositeMapper = { +export const Metadata: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ConfigurationAccessEndpointSpec", + className: "Metadata", modelProperties: { - endpoint: { - serializedName: "endpoint", + provisionedBy: { + serializedName: "provisionedBy", + readOnly: true, + type: { + name: "String" + } + }, + provisionedByResourceId: { + serializedName: "provisionedByResourceId", readOnly: true, type: { name: "String" @@ -5327,31 +6742,62 @@ export const ConfigurationAccessEndpointSpec: coreClient.CompositeMapper = { } }; -export const LogsIngestionEndpointSpec: coreClient.CompositeMapper = { +export const ManagedServiceIdentity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LogsIngestionEndpointSpec", + className: "ManagedServiceIdentity", modelProperties: { - endpoint: { - serializedName: "endpoint", + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "Uuid" + } + }, + tenantId: { + serializedName: "tenantId", readOnly: true, + type: { + name: "Uuid" + } + }, + type: { + serializedName: "type", + required: true, type: { name: "String" } + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { name: "Composite", className: "UserAssignedIdentity" } + } + } } } } }; -export const NetworkRuleSet: coreClient.CompositeMapper = { +export const UserAssignedIdentity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NetworkRuleSet", + className: "UserAssignedIdentity", modelProperties: { - publicNetworkAccess: { - serializedName: "publicNetworkAccess", + principalId: { + serializedName: "principalId", + readOnly: true, type: { - name: "String" + name: "Uuid" + } + }, + clientId: { + serializedName: "clientId", + readOnly: true, + type: { + name: "Uuid" } } } @@ -5367,7 +6813,7 @@ export const ErrorResponseCommonV2: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorDetail" + className: "ErrorDetailAutoGenerated" } } } @@ -5385,6 +6831,13 @@ export const ResourceForUpdate: coreClient.CompositeMapper = { name: "Dictionary", value: { type: { name: "String" } } } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ResourceForUpdateIdentity" + } } } } @@ -5535,22 +6988,6 @@ export const DataCollectionRuleAssociation: coreClient.CompositeMapper = { } }; -export const Metadata: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Metadata", - modelProperties: { - provisionedBy: { - serializedName: "provisionedBy", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - export const DataCollectionRuleResourceListResult: coreClient.CompositeMapper = { type: { name: "Composite", @@ -5604,6 +7041,13 @@ export const DataCollectionRuleResource: coreClient.CompositeMapper = { name: "String" } }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "DataCollectionRuleResourceIdentity" + } + }, id: { serializedName: "id", readOnly: true, @@ -5902,6 +7346,49 @@ export const DataSourcesSpec: coreClient.CompositeMapper = { } } } + }, + windowsFirewallLogs: { + serializedName: "windowsFirewallLogs", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "WindowsFirewallLogsDataSource" + } + } + } + }, + prometheusForwarder: { + serializedName: "prometheusForwarder", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrometheusForwarderDataSource" + } + } + } + }, + platformTelemetry: { + serializedName: "platformTelemetry", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PlatformTelemetryDataSource" + } + } + } + }, + dataImports: { + serializedName: "dataImports", + type: { + name: "Composite", + className: "DataSourcesSpecDataImports" + } } } } @@ -6135,143 +7622,34 @@ export const LogFilesDataSource: coreClient.CompositeMapper = { name: "String" } } - } - } -}; - -export const LogFileSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LogFileSettings", - modelProperties: { - text: { - serializedName: "text", - type: { - name: "Composite", - className: "LogFileSettingsText" - } - } - } - } -}; - -export const LogFileTextSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LogFileTextSettings", - modelProperties: { - recordStartTimestampFormat: { - serializedName: "recordStartTimestampFormat", - required: true, - type: { - name: "String" - } - } - } - } -}; - -export const IisLogsDataSource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "IisLogsDataSource", - modelProperties: { - streams: { - serializedName: "streams", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - logDirectories: { - serializedName: "logDirectories", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - name: { - serializedName: "name", - type: { - name: "String" - } - } - } - } -}; - -export const DestinationsSpec: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DestinationsSpec", - modelProperties: { - logAnalytics: { - serializedName: "logAnalytics", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "LogAnalyticsDestination" - } - } - } - }, - azureMonitorMetrics: { - serializedName: "azureMonitorMetrics", - type: { - name: "Composite", - className: "DestinationsSpecAzureMonitorMetrics" - } - } - } - } -}; - -export const LogAnalyticsDestination: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LogAnalyticsDestination", - modelProperties: { - workspaceResourceId: { - serializedName: "workspaceResourceId", - type: { - name: "String" - } - }, - workspaceId: { - serializedName: "workspaceId", - readOnly: true, - type: { - name: "String" - } - }, - name: { - serializedName: "name", + } + } +}; + +export const LogFileSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LogFileSettings", + modelProperties: { + text: { + serializedName: "text", type: { - name: "String" + name: "Composite", + className: "LogFileSettingsText" } } } } }; -export const AzureMonitorMetricsDestination: coreClient.CompositeMapper = { +export const LogFileTextSettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureMonitorMetricsDestination", + className: "LogFileTextSettings", modelProperties: { - name: { - serializedName: "name", + recordStartTimestampFormat: { + serializedName: "recordStartTimestampFormat", + required: true, type: { name: "String" } @@ -6280,13 +7658,14 @@ export const AzureMonitorMetricsDestination: coreClient.CompositeMapper = { } }; -export const DataFlow: coreClient.CompositeMapper = { +export const IisLogsDataSource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataFlow", + className: "IisLogsDataSource", modelProperties: { streams: { serializedName: "streams", + required: true, type: { name: "Sequence", element: { @@ -6296,8 +7675,8 @@ export const DataFlow: coreClient.CompositeMapper = { } } }, - destinations: { - serializedName: "destinations", + logDirectories: { + serializedName: "logDirectories", type: { name: "Sequence", element: { @@ -6307,14 +7686,8 @@ export const DataFlow: coreClient.CompositeMapper = { } } }, - transformKql: { - serializedName: "transformKql", - type: { - name: "String" - } - }, - outputStream: { - serializedName: "outputStream", + name: { + serializedName: "name", type: { name: "String" } @@ -6323,26 +7696,25 @@ export const DataFlow: coreClient.CompositeMapper = { } }; -export const AzureMonitorWorkspaceResourceListResult: coreClient.CompositeMapper = { +export const WindowsFirewallLogsDataSource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureMonitorWorkspaceResourceListResult", + className: "WindowsFirewallLogsDataSource", modelProperties: { - value: { - serializedName: "value", + streams: { + serializedName: "streams", required: true, type: { name: "Sequence", element: { type: { - name: "Composite", - className: "AzureMonitorWorkspaceResource" + name: "String" } } } }, - nextLink: { - serializedName: "nextLink", + name: { + serializedName: "name", type: { name: "String" } @@ -6351,58 +7723,58 @@ export const AzureMonitorWorkspaceResourceListResult: coreClient.CompositeMapper } }; -export const AzureMonitorWorkspace: coreClient.CompositeMapper = { +export const PrometheusForwarderDataSource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureMonitorWorkspace", + className: "PrometheusForwarderDataSource", modelProperties: { - accountId: { - serializedName: "accountId", - readOnly: true, + streams: { + serializedName: "streams", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - metrics: { - serializedName: "metrics", + labelIncludeFilter: { + serializedName: "labelIncludeFilter", type: { - name: "Composite", - className: "AzureMonitorWorkspaceMetrics" + name: "Dictionary", + value: { type: { name: "String" } } } }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, + name: { + serializedName: "name", type: { name: "String" } - }, - defaultIngestionSettings: { - serializedName: "defaultIngestionSettings", - type: { - name: "Composite", - className: "AzureMonitorWorkspaceDefaultIngestionSettings" - } } } } }; -export const Metrics: coreClient.CompositeMapper = { +export const PlatformTelemetryDataSource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Metrics", + className: "PlatformTelemetryDataSource", modelProperties: { - prometheusQueryEndpoint: { - serializedName: "prometheusQueryEndpoint", - readOnly: true, + streams: { + serializedName: "streams", + required: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - internalId: { - serializedName: "internalId", - readOnly: true, + name: { + serializedName: "name", type: { name: "String" } @@ -6411,175 +7783,233 @@ export const Metrics: coreClient.CompositeMapper = { } }; -export const IngestionSettings: coreClient.CompositeMapper = { +export const DataImportSources: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IngestionSettings", + className: "DataImportSources", modelProperties: { - dataCollectionRuleResourceId: { - serializedName: "dataCollectionRuleResourceId", - readOnly: true, + eventHub: { + serializedName: "eventHub", type: { - name: "String" - } - }, - dataCollectionEndpointResourceId: { - serializedName: "dataCollectionEndpointResourceId", - readOnly: true, - type: { - name: "String" + name: "Composite", + className: "DataImportSourcesEventHub" } } } } }; -export const ResourceAutoGenerated5: coreClient.CompositeMapper = { +export const EventHubDataSource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceAutoGenerated5", + className: "EventHubDataSource", modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String" - } - }, name: { serializedName: "name", - readOnly: true, type: { name: "String" } }, - type: { - serializedName: "type", - readOnly: true, + consumerGroup: { + serializedName: "consumerGroup", type: { name: "String" } }, - systemData: { - serializedName: "systemData", + stream: { + serializedName: "stream", type: { - name: "Composite", - className: "SystemData" + name: "String" } } } } }; -export const ErrorResponseAutoGenerated2: coreClient.CompositeMapper = { +export const DestinationsSpec: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorResponseAutoGenerated2", + className: "DestinationsSpec", modelProperties: { - error: { - serializedName: "error", + logAnalytics: { + serializedName: "logAnalytics", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LogAnalyticsDestination" + } + } + } + }, + monitoringAccounts: { + serializedName: "monitoringAccounts", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MonitoringAccountDestination" + } + } + } + }, + azureMonitorMetrics: { + serializedName: "azureMonitorMetrics", type: { name: "Composite", - className: "ErrorDetailAutoGenerated" + className: "DestinationsSpecAzureMonitorMetrics" + } + }, + eventHubs: { + serializedName: "eventHubs", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EventHubDestination" + } + } + } + }, + eventHubsDirect: { + serializedName: "eventHubsDirect", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EventHubDirectDestination" + } + } + } + }, + storageBlobsDirect: { + serializedName: "storageBlobsDirect", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StorageBlobDestination" + } + } + } + }, + storageTablesDirect: { + serializedName: "storageTablesDirect", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StorageTableDestination" + } + } + } + }, + storageAccounts: { + serializedName: "storageAccounts", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StorageBlobDestination" + } + } } } } } }; -export const ErrorDetailAutoGenerated: coreClient.CompositeMapper = { +export const LogAnalyticsDestination: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorDetailAutoGenerated", + className: "LogAnalyticsDestination", modelProperties: { - code: { - serializedName: "code", - readOnly: true, + workspaceResourceId: { + serializedName: "workspaceResourceId", type: { name: "String" } }, - message: { - serializedName: "message", + workspaceId: { + serializedName: "workspaceId", readOnly: true, type: { name: "String" } }, - target: { - serializedName: "target", - readOnly: true, + name: { + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const MonitoringAccountDestination: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoringAccountDestination", + modelProperties: { + accountResourceId: { + serializedName: "accountResourceId", type: { name: "String" } }, - details: { - serializedName: "details", + accountId: { + serializedName: "accountId", readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorDetailAutoGenerated" - } - } + type: { + name: "String" } }, - additionalInfo: { - serializedName: "additionalInfo", - readOnly: true, + name: { + serializedName: "name", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorAdditionalInfo" - } - } + name: "String" } } } } }; -export const AzureMonitorWorkspaceResourceForUpdate: coreClient.CompositeMapper = { +export const AzureMonitorMetricsDestination: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureMonitorWorkspaceResourceForUpdate", + className: "AzureMonitorMetricsDestination", modelProperties: { - tags: { - serializedName: "tags", + name: { + serializedName: "name", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" } } } } }; -export const OperationListResultAutoGenerated: coreClient.CompositeMapper = { +export const EventHubDestination: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationListResultAutoGenerated", + className: "EventHubDestination", modelProperties: { - value: { - serializedName: "value", - readOnly: true, + eventHubResourceId: { + serializedName: "eventHubResourceId", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "OperationAutoGenerated" - } - } + name: "String" } }, - nextLink: { - serializedName: "nextLink", - readOnly: true, + name: { + serializedName: "name", type: { name: "String" } @@ -6588,42 +8018,73 @@ export const OperationListResultAutoGenerated: coreClient.CompositeMapper = { } }; -export const OperationAutoGenerated: coreClient.CompositeMapper = { +export const EventHubDirectDestination: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationAutoGenerated", + className: "EventHubDirectDestination", modelProperties: { + eventHubResourceId: { + serializedName: "eventHubResourceId", + type: { + name: "String" + } + }, name: { serializedName: "name", - readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const StorageBlobDestination: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageBlobDestination", + modelProperties: { + containerName: { + serializedName: "containerName", type: { name: "String" } }, - isDataAction: { - serializedName: "isDataAction", - readOnly: true, + storageAccountResourceId: { + serializedName: "storageAccountResourceId", type: { - name: "Boolean" + name: "String" } }, - display: { - serializedName: "display", + name: { + serializedName: "name", type: { - name: "Composite", - className: "OperationDisplayAutoGenerated" + name: "String" + } + } + } + } +}; + +export const StorageTableDestination: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageTableDestination", + modelProperties: { + tableName: { + serializedName: "tableName", + type: { + name: "String" } }, - origin: { - serializedName: "origin", - readOnly: true, + storageAccountResourceId: { + serializedName: "storageAccountResourceId", type: { name: "String" } }, - actionType: { - serializedName: "actionType", - readOnly: true, + name: { + serializedName: "name", type: { name: "String" } @@ -6632,35 +8093,47 @@ export const OperationAutoGenerated: coreClient.CompositeMapper = { } }; -export const OperationDisplayAutoGenerated: coreClient.CompositeMapper = { +export const DataFlow: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationDisplayAutoGenerated", + className: "DataFlow", modelProperties: { - provider: { - serializedName: "provider", - readOnly: true, + streams: { + serializedName: "streams", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - resource: { - serializedName: "resource", - readOnly: true, + destinations: { + serializedName: "destinations", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + transformKql: { + serializedName: "transformKql", type: { name: "String" } }, - operation: { - serializedName: "operation", - readOnly: true, + outputStream: { + serializedName: "outputStream", type: { name: "String" } }, - description: { - serializedName: "description", - readOnly: true, + builtInTransform: { + serializedName: "builtInTransform", type: { name: "String" } @@ -6754,90 +8227,216 @@ export const MultiMetricCriteria: coreClient.CompositeMapper = { metricNamespace: { serializedName: "metricNamespace", type: { - name: "String" + name: "String" + } + }, + timeAggregation: { + serializedName: "timeAggregation", + required: true, + type: { + name: "String" + } + }, + dimensions: { + serializedName: "dimensions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricDimension" + } + } + } + }, + skipMetricValidation: { + serializedName: "skipMetricValidation", + type: { + name: "Boolean" + } + } + } + } +}; + +export const MetricDimension: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricDimension", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + operator: { + serializedName: "operator", + required: true, + type: { + name: "String" + } + }, + values: { + serializedName: "values", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const DynamicThresholdFailingPeriods: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DynamicThresholdFailingPeriods", + modelProperties: { + numberOfEvaluationPeriods: { + serializedName: "numberOfEvaluationPeriods", + required: true, + type: { + name: "Number" + } + }, + minFailingPeriodsToAlert: { + serializedName: "minFailingPeriodsToAlert", + required: true, + type: { + name: "Number" + } + } + } + } +}; + +export const AzureMonitorWorkspaceResourceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureMonitorWorkspaceResourceProperties", + modelProperties: { + ...AzureMonitorWorkspace.type.modelProperties + } + } +}; + +export const AzureMonitorWorkspaceMetrics: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureMonitorWorkspaceMetrics", + modelProperties: { + ...Metrics.type.modelProperties + } + } +}; + +export const AzureMonitorWorkspaceDefaultIngestionSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureMonitorWorkspaceDefaultIngestionSettings", + modelProperties: { + ...IngestionSettings.type.modelProperties + } + } +}; + +export const PrivateEndpointConnection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnection", + modelProperties: { + ...Resource.type.modelProperties, + groupIds: { + serializedName: "properties.groupIds", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - timeAggregation: { - serializedName: "timeAggregation", - required: true, + privateEndpoint: { + serializedName: "properties.privateEndpoint", type: { - name: "String" + name: "Composite", + className: "PrivateEndpoint" } }, - dimensions: { - serializedName: "dimensions", + privateLinkServiceConnectionState: { + serializedName: "properties.privateLinkServiceConnectionState", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricDimension" - } - } + name: "Composite", + className: "PrivateLinkServiceConnectionState" } }, - skipMetricValidation: { - serializedName: "skipMetricValidation", + provisioningState: { + serializedName: "properties.provisioningState", type: { - name: "Boolean" + name: "String" } } } } }; -export const MetricDimension: coreClient.CompositeMapper = { +export const DataCollectionEndpointResourceSystemData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricDimension", + className: "DataCollectionEndpointResourceSystemData", modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String" - } - }, - operator: { - serializedName: "operator", - required: true, - type: { - name: "String" - } - }, - values: { - serializedName: "values", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } + ...SystemData.type.modelProperties } } }; -export const DynamicThresholdFailingPeriods: coreClient.CompositeMapper = { +export const DataCollectionRuleAssociationProxyOnlyResourceSystemData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DynamicThresholdFailingPeriods", + className: "DataCollectionRuleAssociationProxyOnlyResourceSystemData", modelProperties: { - numberOfEvaluationPeriods: { - serializedName: "numberOfEvaluationPeriods", - required: true, + ...SystemData.type.modelProperties + } + } +}; + +export const DataCollectionRuleResourceSystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataCollectionRuleResourceSystemData", + modelProperties: { + ...SystemData.type.modelProperties + } + } +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...ResourceAutoGenerated.type.modelProperties, + tags: { + serializedName: "tags", type: { - name: "Number" + name: "Dictionary", + value: { type: { name: "String" } } } }, - minFailingPeriodsToAlert: { - serializedName: "minFailingPeriodsToAlert", + location: { + serializedName: "location", required: true, type: { - name: "Number" + name: "String" } } } @@ -6849,7 +8448,7 @@ export const AutoscaleSettingResource: coreClient.CompositeMapper = { name: "Composite", className: "AutoscaleSettingResource", modelProperties: { - ...Resource.type.modelProperties, + ...ResourceAutoGenerated2.type.modelProperties, profiles: { constraints: { MaxItems: 20 @@ -6914,36 +8513,6 @@ export const AutoscaleSettingResource: coreClient.CompositeMapper = { } }; -export const DataCollectionEndpointResourceSystemData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataCollectionEndpointResourceSystemData", - modelProperties: { - ...SystemData.type.modelProperties - } - } -}; - -export const DataCollectionRuleAssociationProxyOnlyResourceSystemData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataCollectionRuleAssociationProxyOnlyResourceSystemData", - modelProperties: { - ...SystemData.type.modelProperties - } - } -}; - -export const DataCollectionRuleResourceSystemData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataCollectionRuleResourceSystemData", - modelProperties: { - ...SystemData.type.modelProperties - } - } -}; - export const ThresholdRuleCondition: coreClient.CompositeMapper = { serializedName: "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition", @@ -7194,7 +8763,7 @@ export const AlertRuleResource: coreClient.CompositeMapper = { name: "Composite", className: "AlertRuleResource", modelProperties: { - ...ResourceAutoGenerated.type.modelProperties, + ...ResourceAutoGenerated3.type.modelProperties, namePropertiesName: { serializedName: "properties.name", required: true, @@ -7263,7 +8832,7 @@ export const LogProfileResource: coreClient.CompositeMapper = { name: "Composite", className: "LogProfileResource", modelProperties: { - ...ResourceAutoGenerated2.type.modelProperties, + ...ResourceAutoGenerated4.type.modelProperties, storageAccountId: { serializedName: "properties.storageAccountId", type: { @@ -7316,7 +8885,7 @@ export const DiagnosticSettingsResource: coreClient.CompositeMapper = { name: "Composite", className: "DiagnosticSettingsResource", modelProperties: { - ...ResourceAutoGenerated3.type.modelProperties, + ...ResourceAutoGenerated5.type.modelProperties, systemData: { serializedName: "systemData", type: { @@ -7399,7 +8968,7 @@ export const DiagnosticSettingsCategoryResource: coreClient.CompositeMapper = { name: "Composite", className: "DiagnosticSettingsCategoryResource", modelProperties: { - ...ResourceAutoGenerated3.type.modelProperties, + ...ResourceAutoGenerated5.type.modelProperties, systemData: { serializedName: "systemData", type: { @@ -7428,17 +8997,17 @@ export const DiagnosticSettingsCategoryResource: coreClient.CompositeMapper = { } }; -export const PrivateEndpointConnection: coreClient.CompositeMapper = { +export const PrivateEndpointConnectionAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateEndpointConnection", + className: "PrivateEndpointConnectionAutoGenerated", modelProperties: { - ...ResourceAutoGenerated3.type.modelProperties, + ...ResourceAutoGenerated5.type.modelProperties, privateEndpoint: { serializedName: "properties.privateEndpoint", type: { name: "Composite", - className: "PrivateEndpoint" + className: "PrivateEndpointAutoGenerated" } }, privateLinkServiceConnectionState: { @@ -7450,7 +9019,6 @@ export const PrivateEndpointConnection: coreClient.CompositeMapper = { }, provisioningState: { serializedName: "properties.provisioningState", - readOnly: true, type: { name: "String" } @@ -7459,12 +9027,12 @@ export const PrivateEndpointConnection: coreClient.CompositeMapper = { } }; -export const TrackedResource: coreClient.CompositeMapper = { +export const TrackedResourceAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TrackedResource", + className: "TrackedResourceAutoGenerated", modelProperties: { - ...ResourceAutoGenerated3.type.modelProperties, + ...ResourceAutoGenerated5.type.modelProperties, tags: { serializedName: "tags", type: { @@ -7488,7 +9056,7 @@ export const PrivateLinkResource: coreClient.CompositeMapper = { name: "Composite", className: "PrivateLinkResource", modelProperties: { - ...ResourceAutoGenerated3.type.modelProperties, + ...ResourceAutoGenerated5.type.modelProperties, groupId: { serializedName: "properties.groupId", readOnly: true, @@ -7528,7 +9096,7 @@ export const ProxyResourceAutoGenerated: coreClient.CompositeMapper = { name: "Composite", className: "ProxyResourceAutoGenerated", modelProperties: { - ...ResourceAutoGenerated3.type.modelProperties + ...ResourceAutoGenerated5.type.modelProperties } } }; @@ -7606,83 +9174,169 @@ export const ActionGroupResource: coreClient.CompositeMapper = { azureAppPushReceivers: { serializedName: "properties.azureAppPushReceivers", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AzureAppPushReceiver" - } - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AzureAppPushReceiver" + } + } + } + }, + automationRunbookReceivers: { + serializedName: "properties.automationRunbookReceivers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AutomationRunbookReceiver" + } + } + } + }, + voiceReceivers: { + serializedName: "properties.voiceReceivers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VoiceReceiver" + } + } + } + }, + logicAppReceivers: { + serializedName: "properties.logicAppReceivers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LogicAppReceiver" + } + } + } + }, + azureFunctionReceivers: { + serializedName: "properties.azureFunctionReceivers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AzureFunctionReceiver" + } + } + } + }, + armRoleReceivers: { + serializedName: "properties.armRoleReceivers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ArmRoleReceiver" + } + } + } + }, + eventHubReceivers: { + serializedName: "properties.eventHubReceivers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EventHubReceiver" + } + } + } + } + } + } +}; + +export const TenantActionGroupResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TenantActionGroupResource", + modelProperties: { + ...AzureResource.type.modelProperties, + groupShortName: { + constraints: { + MaxLength: 12 + }, + serializedName: "properties.groupShortName", + type: { + name: "String" } }, - automationRunbookReceivers: { - serializedName: "properties.automationRunbookReceivers", + enabled: { + defaultValue: true, + serializedName: "properties.enabled", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AutomationRunbookReceiver" - } - } + name: "Boolean" } }, - voiceReceivers: { - serializedName: "properties.voiceReceivers", + emailReceivers: { + serializedName: "properties.emailReceivers", type: { name: "Sequence", element: { type: { name: "Composite", - className: "VoiceReceiver" + className: "EmailReceiverAutoGenerated" } } } }, - logicAppReceivers: { - serializedName: "properties.logicAppReceivers", + smsReceivers: { + serializedName: "properties.smsReceivers", type: { name: "Sequence", element: { type: { name: "Composite", - className: "LogicAppReceiver" + className: "SmsReceiverAutoGenerated" } } } }, - azureFunctionReceivers: { - serializedName: "properties.azureFunctionReceivers", + webhookReceivers: { + serializedName: "properties.webhookReceivers", type: { name: "Sequence", element: { type: { name: "Composite", - className: "AzureFunctionReceiver" + className: "WebhookReceiverAutoGenerated" } } } }, - armRoleReceivers: { - serializedName: "properties.armRoleReceivers", + azureAppPushReceivers: { + serializedName: "properties.azureAppPushReceivers", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ArmRoleReceiver" + className: "AzureAppPushReceiverAutoGenerated" } } } }, - eventHubReceivers: { - serializedName: "properties.eventHubReceivers", + voiceReceivers: { + serializedName: "properties.voiceReceivers", type: { name: "Sequence", element: { type: { name: "Composite", - className: "EventHubReceiver" + className: "VoiceReceiverAutoGenerated" } } } @@ -7785,7 +9439,7 @@ export const MetricAlertResource: coreClient.CompositeMapper = { name: "Composite", className: "MetricAlertResource", modelProperties: { - ...ResourceAutoGenerated4.type.modelProperties, + ...ResourceAutoGenerated6.type.modelProperties, description: { serializedName: "properties.description", type: { @@ -8027,6 +9681,16 @@ export const DataCollectionEndpointLogsIngestion: coreClient.CompositeMapper = { } }; +export const DataCollectionEndpointMetricsIngestion: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataCollectionEndpointMetricsIngestion", + modelProperties: { + ...MetricsIngestionEndpointSpec.type.modelProperties + } + } +}; + export const DataCollectionEndpointNetworkAcls: coreClient.CompositeMapper = { type: { name: "Composite", @@ -8037,12 +9701,22 @@ export const DataCollectionEndpointNetworkAcls: coreClient.CompositeMapper = { } }; -export const DataCollectionRuleAssociationProxyOnlyResourceProperties: coreClient.CompositeMapper = { +export const DataCollectionEndpointFailoverConfiguration: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataCollectionRuleAssociationProxyOnlyResourceProperties", + className: "DataCollectionEndpointFailoverConfiguration", modelProperties: { - ...DataCollectionRuleAssociation.type.modelProperties + ...FailoverConfigurationSpec.type.modelProperties + } + } +}; + +export const DataCollectionEndpointMetadata: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataCollectionEndpointMetadata", + modelProperties: { + ...Metadata.type.modelProperties } } }; @@ -8067,116 +9741,122 @@ export const DataCollectionRuleMetadata: coreClient.CompositeMapper = { } }; -export const DataCollectionRuleResourceProperties: coreClient.CompositeMapper = { +export const DataCollectionEndpointResourceIdentity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataCollectionRuleResourceProperties", + className: "DataCollectionEndpointResourceIdentity", modelProperties: { - ...DataCollectionRule.type.modelProperties + ...ManagedServiceIdentity.type.modelProperties } } }; -export const DataCollectionRuleDataSources: coreClient.CompositeMapper = { +export const ResourceForUpdateIdentity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataCollectionRuleDataSources", + className: "ResourceForUpdateIdentity", modelProperties: { - ...DataSourcesSpec.type.modelProperties + ...ManagedServiceIdentity.type.modelProperties } } }; -export const LogFilesDataSourceSettings: coreClient.CompositeMapper = { +export const DataCollectionRuleResourceIdentity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LogFilesDataSourceSettings", + className: "DataCollectionRuleResourceIdentity", modelProperties: { - ...LogFileSettings.type.modelProperties + ...ManagedServiceIdentity.type.modelProperties } } }; -export const LogFileSettingsText: coreClient.CompositeMapper = { +export const DataCollectionRuleAssociationProxyOnlyResourceProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LogFileSettingsText", + className: "DataCollectionRuleAssociationProxyOnlyResourceProperties", modelProperties: { - ...LogFileTextSettings.type.modelProperties + ...DataCollectionRuleAssociation.type.modelProperties } } }; -export const DataCollectionRuleDestinations: coreClient.CompositeMapper = { +export const DataCollectionRuleResourceProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataCollectionRuleDestinations", + className: "DataCollectionRuleResourceProperties", modelProperties: { - ...DestinationsSpec.type.modelProperties + ...DataCollectionRule.type.modelProperties } } }; -export const DestinationsSpecAzureMonitorMetrics: coreClient.CompositeMapper = { +export const DataCollectionRuleDataSources: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DestinationsSpecAzureMonitorMetrics", + className: "DataCollectionRuleDataSources", modelProperties: { - ...AzureMonitorMetricsDestination.type.modelProperties + ...DataSourcesSpec.type.modelProperties } } }; -export const AzureMonitorWorkspaceResourceProperties: coreClient.CompositeMapper = { +export const LogFilesDataSourceSettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureMonitorWorkspaceResourceProperties", + className: "LogFilesDataSourceSettings", modelProperties: { - ...AzureMonitorWorkspace.type.modelProperties + ...LogFileSettings.type.modelProperties } } }; -export const AzureMonitorWorkspaceMetrics: coreClient.CompositeMapper = { +export const LogFileSettingsText: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureMonitorWorkspaceMetrics", + className: "LogFileSettingsText", modelProperties: { - ...Metrics.type.modelProperties + ...LogFileTextSettings.type.modelProperties } } }; -export const AzureMonitorWorkspaceDefaultIngestionSettings: coreClient.CompositeMapper = { +export const DataSourcesSpecDataImports: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureMonitorWorkspaceDefaultIngestionSettings", + className: "DataSourcesSpecDataImports", modelProperties: { - ...IngestionSettings.type.modelProperties + ...DataImportSources.type.modelProperties } } }; -export const TrackedResourceAutoGenerated: coreClient.CompositeMapper = { +export const DataImportSourcesEventHub: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TrackedResourceAutoGenerated", + className: "DataImportSourcesEventHub", modelProperties: { - ...ResourceAutoGenerated5.type.modelProperties, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - }, - location: { - serializedName: "location", - required: true, - type: { - name: "String" - } - } + ...EventHubDataSource.type.modelProperties + } + } +}; + +export const DataCollectionRuleDestinations: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataCollectionRuleDestinations", + modelProperties: { + ...DestinationsSpec.type.modelProperties + } + } +}; + +export const DestinationsSpecAzureMonitorMetrics: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DestinationsSpecAzureMonitorMetrics", + modelProperties: { + ...AzureMonitorMetricsDestination.type.modelProperties } } }; @@ -8250,17 +9930,31 @@ export const DynamicMetricCriteria: coreClient.CompositeMapper = { } }; -export const AzureMonitorPrivateLinkScope: coreClient.CompositeMapper = { +export const AzureMonitorWorkspaceResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureMonitorPrivateLinkScope", + className: "AzureMonitorWorkspaceResource", modelProperties: { ...TrackedResource.type.modelProperties, - systemData: { - serializedName: "systemData", + etag: { + serializedName: "etag", + readOnly: true, + type: { + name: "String" + } + }, + accountId: { + serializedName: "properties.accountId", + readOnly: true, + type: { + name: "String" + } + }, + metrics: { + serializedName: "properties.metrics", type: { name: "Composite", - className: "SystemData" + className: "AzureMonitorWorkspaceMetrics" } }, provisioningState: { @@ -8270,6 +9964,13 @@ export const AzureMonitorPrivateLinkScope: coreClient.CompositeMapper = { name: "String" } }, + defaultIngestionSettings: { + serializedName: "properties.defaultIngestionSettings", + type: { + name: "Composite", + className: "AzureMonitorWorkspaceDefaultIngestionSettings" + } + }, privateEndpointConnections: { serializedName: "properties.privateEndpointConnections", readOnly: true, @@ -8283,23 +9984,23 @@ export const AzureMonitorPrivateLinkScope: coreClient.CompositeMapper = { } } }, - accessModeSettings: { - serializedName: "properties.accessModeSettings", + publicNetworkAccess: { + serializedName: "properties.publicNetworkAccess", + readOnly: true, type: { - name: "Composite", - className: "AccessModeSettings" + name: "String" } } } } }; -export const ScopedResource: coreClient.CompositeMapper = { +export const AzureMonitorPrivateLinkScope: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ScopedResource", + className: "AzureMonitorPrivateLinkScope", modelProperties: { - ...ProxyResourceAutoGenerated.type.modelProperties, + ...TrackedResourceAutoGenerated.type.modelProperties, systemData: { serializedName: "systemData", type: { @@ -8307,73 +10008,78 @@ export const ScopedResource: coreClient.CompositeMapper = { className: "SystemData" } }, - linkedResourceId: { - serializedName: "properties.linkedResourceId", + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, type: { name: "String" } }, - provisioningState: { - serializedName: "properties.provisioningState", + privateEndpointConnections: { + serializedName: "properties.privateEndpointConnections", readOnly: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnectionAutoGenerated" + } + } + } + }, + accessModeSettings: { + serializedName: "properties.accessModeSettings", + type: { + name: "Composite", + className: "AccessModeSettings" } } } } }; -export const AzureMonitorWorkspaceResource: coreClient.CompositeMapper = { +export const ScopedResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureMonitorWorkspaceResource", + className: "ScopedResource", modelProperties: { - ...TrackedResourceAutoGenerated.type.modelProperties, - etag: { - serializedName: "etag", - readOnly: true, + ...ProxyResourceAutoGenerated.type.modelProperties, + systemData: { + serializedName: "systemData", type: { - name: "String" + name: "Composite", + className: "SystemData" } }, - accountId: { - serializedName: "properties.accountId", - readOnly: true, + linkedResourceId: { + serializedName: "properties.linkedResourceId", type: { name: "String" } }, - metrics: { - serializedName: "properties.metrics", - type: { - name: "Composite", - className: "AzureMonitorWorkspaceMetrics" - } - }, provisioningState: { serializedName: "properties.provisioningState", readOnly: true, type: { name: "String" } - }, - defaultIngestionSettings: { - serializedName: "properties.defaultIngestionSettings", - type: { - name: "Composite", - className: "AzureMonitorWorkspaceDefaultIngestionSettings" - } } } } }; -export const ActionGroupsPostTestNotificationsHeaders: coreClient.CompositeMapper = { +export const AzureMonitorWorkspacesDeleteHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ActionGroupsPostTestNotificationsHeaders", + className: "AzureMonitorWorkspacesDeleteHeaders", modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + }, location: { serializedName: "location", type: { @@ -8384,10 +10090,11 @@ export const ActionGroupsPostTestNotificationsHeaders: coreClient.CompositeMappe } }; -export const ActionGroupsCreateNotificationsAtResourceGroupLevelHeaders: coreClient.CompositeMapper = { +export const ActionGroupsCreateNotificationsAtActionGroupResourceLevelHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ActionGroupsCreateNotificationsAtResourceGroupLevelHeaders", + className: + "ActionGroupsCreateNotificationsAtActionGroupResourceLevelHeaders", modelProperties: { location: { serializedName: "location", @@ -8399,11 +10106,11 @@ export const ActionGroupsCreateNotificationsAtResourceGroupLevelHeaders: coreCli } }; -export const ActionGroupsCreateNotificationsAtActionGroupResourceLevelHeaders: coreClient.CompositeMapper = { +export const MonitorClientCreateNotificationsAtTenantActionGroupResourceLevelHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: - "ActionGroupsCreateNotificationsAtActionGroupResourceLevelHeaders", + "MonitorClientCreateNotificationsAtTenantActionGroupResourceLevelHeaders", modelProperties: { location: { serializedName: "location", diff --git a/sdk/monitor/arm-monitor/src/models/parameters.ts b/sdk/monitor/arm-monitor/src/models/parameters.ts index 720e12797aa6..c330e1266d16 100644 --- a/sdk/monitor/arm-monitor/src/models/parameters.ts +++ b/sdk/monitor/arm-monitor/src/models/parameters.ts @@ -12,6 +12,8 @@ import { OperationQueryParameter } from "@azure/core-client"; import { + AzureMonitorWorkspaceResource as AzureMonitorWorkspaceResourceMapper, + AzureMonitorWorkspaceResourceForUpdate as AzureMonitorWorkspaceResourceForUpdateMapper, AutoscaleSettingResource as AutoscaleSettingResourceMapper, AutoscaleSettingResourcePatch as AutoscaleSettingResourcePatchMapper, AlertRuleResource as AlertRuleResourceMapper, @@ -23,22 +25,24 @@ import { ActionGroupPatchBody as ActionGroupPatchBodyMapper, NotificationRequestBody as NotificationRequestBodyMapper, EnableRequest as EnableRequestMapper, + TenantActionGroupResource as TenantActionGroupResourceMapper, + ActionGroupPatchBodyAutoGenerated as ActionGroupPatchBodyAutoGeneratedMapper, + TenantNotificationRequestBody as TenantNotificationRequestBodyMapper, + SubscriptionScopeMetricsRequestBodyParameters as SubscriptionScopeMetricsRequestBodyParametersMapper, MetricAlertResource as MetricAlertResourceMapper, MetricAlertResourcePatch as MetricAlertResourcePatchMapper, ScheduledQueryRuleResource as ScheduledQueryRuleResourceMapper, ScheduledQueryRuleResourcePatch as ScheduledQueryRuleResourcePatchMapper, AzureMonitorPrivateLinkScope as AzureMonitorPrivateLinkScopeMapper, TagsResource as TagsResourceMapper, - PrivateEndpointConnection as PrivateEndpointConnectionMapper, + PrivateEndpointConnectionAutoGenerated as PrivateEndpointConnectionAutoGeneratedMapper, ScopedResource as ScopedResourceMapper, ActivityLogAlertResource as ActivityLogAlertResourceMapper, AlertRulePatchObject as AlertRulePatchObjectMapper, DataCollectionEndpointResource as DataCollectionEndpointResourceMapper, ResourceForUpdate as ResourceForUpdateMapper, DataCollectionRuleAssociationProxyOnlyResource as DataCollectionRuleAssociationProxyOnlyResourceMapper, - DataCollectionRuleResource as DataCollectionRuleResourceMapper, - AzureMonitorWorkspaceResource as AzureMonitorWorkspaceResourceMapper, - AzureMonitorWorkspaceResourceForUpdate as AzureMonitorWorkspaceResourceForUpdateMapper + DataCollectionRuleResource as DataCollectionRuleResourceMapper } from "../models/mappers"; export const accept: OperationParameter = { @@ -65,6 +69,20 @@ export const $host: OperationURLParameter = { skipEncoding: true }; +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "subscriptionId", + required: true, + type: { + name: "String" + } + } +}; + export const resourceGroupName: OperationURLParameter = { parameterPath: "resourceGroupName", mapper: { @@ -83,7 +101,7 @@ export const resourceGroupName: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-10-01", + defaultValue: "2023-04-03", isConstant: true, serializedName: "api-version", type: { @@ -92,13 +110,13 @@ export const apiVersion: OperationQueryParameter = { } }; -export const subscriptionId: OperationURLParameter = { - parameterPath: "subscriptionId", +export const azureMonitorWorkspaceName: OperationURLParameter = { + parameterPath: "azureMonitorWorkspaceName", mapper: { constraints: { - MinLength: 1 + Pattern: new RegExp("^(?!-)[a-zA-Z0-9-]+[^-]$") }, - serializedName: "subscriptionId", + serializedName: "azureMonitorWorkspaceName", required: true, type: { name: "String" @@ -118,6 +136,40 @@ export const contentType: OperationParameter = { } }; +export const azureMonitorWorkspaceProperties: OperationParameter = { + parameterPath: "azureMonitorWorkspaceProperties", + mapper: AzureMonitorWorkspaceResourceMapper +}; + +export const azureMonitorWorkspaceProperties1: OperationParameter = { + parameterPath: ["options", "azureMonitorWorkspaceProperties"], + mapper: AzureMonitorWorkspaceResourceForUpdateMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const apiVersion1: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2022-10-01", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + export const parameters: OperationParameter = { parameterPath: "parameters", mapper: AutoscaleSettingResourceMapper @@ -139,18 +191,6 @@ export const autoscaleSettingResource: OperationParameter = { mapper: AutoscaleSettingResourcePatchMapper }; -export const nextLink: OperationURLParameter = { - parameterPath: "nextLink", - mapper: { - serializedName: "nextLink", - required: true, - type: { - name: "String" - } - }, - skipEncoding: true -}; - export const timespan: OperationQueryParameter = { parameterPath: "timespan", mapper: { @@ -206,7 +246,7 @@ export const aggregation: OperationQueryParameter = { } }; -export const apiVersion1: OperationQueryParameter = { +export const apiVersion2: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { defaultValue: "2015-04-01", @@ -240,7 +280,7 @@ export const incidentName: OperationURLParameter = { } }; -export const apiVersion2: OperationQueryParameter = { +export const apiVersion3: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { defaultValue: "2016-03-01", @@ -295,7 +335,7 @@ export const resourceUri: OperationURLParameter = { skipEncoding: true }; -export const apiVersion3: OperationQueryParameter = { +export const apiVersion4: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { defaultValue: "2021-05-01-preview", @@ -339,10 +379,10 @@ export const actionGroupName: OperationURLParameter = { } }; -export const apiVersion4: OperationQueryParameter = { +export const apiVersion5: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-06-01", + defaultValue: "2023-01-01", isConstant: true, serializedName: "api-version", type: { @@ -377,6 +417,71 @@ export const enableRequest: OperationParameter = { mapper: EnableRequestMapper }; +export const actionGroup1: OperationParameter = { + parameterPath: "actionGroup", + mapper: TenantActionGroupResourceMapper +}; + +export const managementGroupId: OperationURLParameter = { + parameterPath: "managementGroupId", + mapper: { + serializedName: "managementGroupId", + required: true, + type: { + name: "String" + } + } +}; + +export const tenantActionGroupName: OperationURLParameter = { + parameterPath: "tenantActionGroupName", + mapper: { + constraints: { + Pattern: new RegExp("^[A-Za-z][A-Za-z0-9]*$"), + MaxLength: 260, + MinLength: 1 + }, + serializedName: "tenantActionGroupName", + required: true, + type: { + name: "String" + } + } +}; + +export const xMsClientTenantId: OperationParameter = { + parameterPath: "xMsClientTenantId", + mapper: { + serializedName: "x-ms-client-tenant-id", + required: true, + type: { + name: "String" + } + } +}; + +export const apiVersion6: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2023-05-01-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const tenantActionGroupPatch: OperationParameter = { + parameterPath: "tenantActionGroupPatch", + mapper: ActionGroupPatchBodyAutoGeneratedMapper +}; + +export const notificationRequest1: OperationParameter = { + parameterPath: "notificationRequest", + mapper: TenantNotificationRequestBodyMapper +}; + export const filter: OperationQueryParameter = { parameterPath: "filter", mapper: { @@ -408,10 +513,10 @@ export const filter1: OperationQueryParameter = { } }; -export const apiVersion5: OperationQueryParameter = { +export const apiVersion7: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2018-01-01", + defaultValue: "2021-05-01", isConstant: true, serializedName: "api-version", type: { @@ -420,6 +525,17 @@ export const apiVersion5: OperationQueryParameter = { } }; +export const region: OperationQueryParameter = { + parameterPath: "region", + mapper: { + serializedName: "region", + required: true, + type: { + name: "String" + } + } +}; + export const metricnamespace: OperationQueryParameter = { parameterPath: ["options", "metricnamespace"], mapper: { @@ -491,6 +607,41 @@ export const orderby: OperationQueryParameter = { }; export const resultType: OperationQueryParameter = { + parameterPath: ["options", "resultType"], + mapper: { + serializedName: "resultType", + type: { + name: "String" + } + } +}; + +export const autoAdjustTimegrain: OperationQueryParameter = { + parameterPath: ["options", "autoAdjustTimegrain"], + mapper: { + serializedName: "AutoAdjustTimegrain", + type: { + name: "Boolean" + } + } +}; + +export const validateDimensions: OperationQueryParameter = { + parameterPath: ["options", "validateDimensions"], + mapper: { + serializedName: "ValidateDimensions", + type: { + name: "Boolean" + } + } +}; + +export const body: OperationParameter = { + parameterPath: ["options", "body"], + mapper: SubscriptionScopeMetricsRequestBodyParametersMapper +}; + +export const resultType1: OperationQueryParameter = { parameterPath: ["options", "resultType"], mapper: { serializedName: "resultType", @@ -511,7 +662,7 @@ export const sensitivities: OperationQueryParameter = { } }; -export const apiVersion6: OperationQueryParameter = { +export const apiVersion8: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { defaultValue: "2019-03-01", @@ -523,7 +674,7 @@ export const apiVersion6: OperationQueryParameter = { } }; -export const apiVersion7: OperationQueryParameter = { +export const apiVersion9: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { defaultValue: "2018-03-01", @@ -556,7 +707,7 @@ export const statusName: OperationURLParameter = { } }; -export const apiVersion8: OperationQueryParameter = { +export const apiVersion10: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { defaultValue: "2022-08-01-preview", @@ -578,7 +729,7 @@ export const parameters7: OperationParameter = { mapper: ScheduledQueryRuleResourcePatchMapper }; -export const apiVersion9: OperationQueryParameter = { +export const apiVersion11: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { defaultValue: "2017-12-01-preview", @@ -600,7 +751,7 @@ export const startTime: OperationQueryParameter = { } }; -export const apiVersion10: OperationQueryParameter = { +export const apiVersion12: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { defaultValue: "2018-11-27-preview", @@ -612,7 +763,7 @@ export const apiVersion10: OperationQueryParameter = { } }; -export const apiVersion11: OperationQueryParameter = { +export const apiVersion13: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { defaultValue: "2021-07-01-preview", @@ -680,7 +831,7 @@ export const privateEndpointConnectionName: OperationURLParameter = { export const parameters8: OperationParameter = { parameterPath: "parameters", - mapper: PrivateEndpointConnectionMapper + mapper: PrivateEndpointConnectionAutoGeneratedMapper }; export const parameters9: OperationParameter = { @@ -704,7 +855,7 @@ export const activityLogAlertName: OperationURLParameter = { } }; -export const apiVersion12: OperationQueryParameter = { +export const apiVersion14: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { defaultValue: "2020-10-01", @@ -721,10 +872,10 @@ export const activityLogAlertRulePatch: OperationParameter = { mapper: AlertRulePatchObjectMapper }; -export const apiVersion13: OperationQueryParameter = { +export const apiVersion15: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-09-01-preview", + defaultValue: "2022-06-01", isConstant: true, serializedName: "api-version", type: { @@ -744,12 +895,12 @@ export const dataCollectionEndpointName: OperationURLParameter = { } }; -export const body: OperationParameter = { +export const body1: OperationParameter = { parameterPath: ["options", "body"], mapper: DataCollectionEndpointResourceMapper }; -export const body1: OperationParameter = { +export const body2: OperationParameter = { parameterPath: ["options", "body"], mapper: ResourceForUpdateMapper }; @@ -791,48 +942,12 @@ export const associationName: OperationURLParameter = { } }; -export const body2: OperationParameter = { +export const body3: OperationParameter = { parameterPath: ["options", "body"], mapper: DataCollectionRuleAssociationProxyOnlyResourceMapper }; -export const body3: OperationParameter = { +export const body4: OperationParameter = { parameterPath: ["options", "body"], mapper: DataCollectionRuleResourceMapper }; - -export const apiVersion14: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2021-06-03-preview", - isConstant: true, - serializedName: "api-version", - type: { - name: "String" - } - } -}; - -export const azureMonitorWorkspaceName: OperationURLParameter = { - parameterPath: "azureMonitorWorkspaceName", - mapper: { - constraints: { - Pattern: new RegExp("^(?!-)[a-zA-Z0-9-]+[^-]$") - }, - serializedName: "azureMonitorWorkspaceName", - required: true, - type: { - name: "String" - } - } -}; - -export const azureMonitorWorkspaceProperties: OperationParameter = { - parameterPath: "azureMonitorWorkspaceProperties", - mapper: AzureMonitorWorkspaceResourceMapper -}; - -export const azureMonitorWorkspaceProperties1: OperationParameter = { - parameterPath: ["options", "azureMonitorWorkspaceProperties"], - mapper: AzureMonitorWorkspaceResourceForUpdateMapper -}; diff --git a/sdk/monitor/arm-monitor/src/monitorClient.ts b/sdk/monitor/arm-monitor/src/monitorClient.ts index 8484a12bf8d9..8479ff780b72 100644 --- a/sdk/monitor/arm-monitor/src/monitorClient.ts +++ b/sdk/monitor/arm-monitor/src/monitorClient.ts @@ -10,6 +10,14 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "./lroImpl"; +import { + AzureMonitorWorkspacesImpl, + MonitorOperationsImpl, AutoscaleSettingsImpl, PredictiveMetricImpl, OperationsImpl, @@ -19,6 +27,7 @@ import { DiagnosticSettingsImpl, DiagnosticSettingsCategoryImpl, ActionGroupsImpl, + TenantActionGroupsImpl, ActivityLogsImpl, EventCategoriesImpl, TenantActivityLogsImpl, @@ -38,11 +47,11 @@ import { ActivityLogAlertsImpl, DataCollectionEndpointsImpl, DataCollectionRuleAssociationsImpl, - DataCollectionRulesImpl, - AzureMonitorWorkspacesImpl, - MonitorOperationsImpl + DataCollectionRulesImpl } from "./operations"; import { + AzureMonitorWorkspaces, + MonitorOperations, AutoscaleSettings, PredictiveMetric, Operations, @@ -52,6 +61,7 @@ import { DiagnosticSettings, DiagnosticSettingsCategory, ActionGroups, + TenantActionGroups, ActivityLogs, EventCategories, TenantActivityLogs, @@ -71,15 +81,22 @@ import { ActivityLogAlerts, DataCollectionEndpoints, DataCollectionRuleAssociations, - DataCollectionRules, - AzureMonitorWorkspaces, - MonitorOperations + DataCollectionRules } from "./operationsInterfaces"; -import { MonitorClientOptionalParams } from "./models"; +import * as Parameters from "./models/parameters"; +import * as Mappers from "./models/mappers"; +import { + MonitorClientOptionalParams, + TenantNotificationRequestBody, + CreateNotificationsAtTenantActionGroupResourceLevelOptionalParams, + CreateNotificationsAtTenantActionGroupResourceLevelResponse, + GetTestNotificationsAtTenantActionGroupResourceLevelOptionalParams, + GetTestNotificationsAtTenantActionGroupResourceLevelResponse +} from "./models"; export class MonitorClient extends coreClient.ServiceClient { $host: string; - subscriptionId: string; + subscriptionId?: string; /** * Initializes a new instance of the MonitorClient class. @@ -91,12 +108,26 @@ export class MonitorClient extends coreClient.ServiceClient { credentials: coreAuth.TokenCredential, subscriptionId: string, options?: MonitorClientOptionalParams + ); + constructor( + credentials: coreAuth.TokenCredential, + options?: MonitorClientOptionalParams + ); + constructor( + credentials: coreAuth.TokenCredential, + subscriptionIdOrOptions?: MonitorClientOptionalParams | string, + options?: MonitorClientOptionalParams ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); } - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); + + let subscriptionId: string | undefined; + + if (typeof subscriptionIdOrOptions === "string") { + subscriptionId = subscriptionIdOrOptions; + } else if (typeof subscriptionIdOrOptions === "object") { + options = subscriptionIdOrOptions; } // Initializing default values for options @@ -161,6 +192,8 @@ export class MonitorClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; + this.azureMonitorWorkspaces = new AzureMonitorWorkspacesImpl(this); + this.monitorOperations = new MonitorOperationsImpl(this); this.autoscaleSettings = new AutoscaleSettingsImpl(this); this.predictiveMetric = new PredictiveMetricImpl(this); this.operations = new OperationsImpl(this); @@ -170,6 +203,7 @@ export class MonitorClient extends coreClient.ServiceClient { this.diagnosticSettings = new DiagnosticSettingsImpl(this); this.diagnosticSettingsCategory = new DiagnosticSettingsCategoryImpl(this); this.actionGroups = new ActionGroupsImpl(this); + this.tenantActionGroups = new TenantActionGroupsImpl(this); this.activityLogs = new ActivityLogsImpl(this); this.eventCategories = new EventCategoriesImpl(this); this.tenantActivityLogs = new TenantActivityLogsImpl(this); @@ -194,10 +228,148 @@ export class MonitorClient extends coreClient.ServiceClient { this ); this.dataCollectionRules = new DataCollectionRulesImpl(this); - this.azureMonitorWorkspaces = new AzureMonitorWorkspacesImpl(this); - this.monitorOperations = new MonitorOperationsImpl(this); } + /** + * Send test notifications to a set of provided receivers + * @param managementGroupId The management group id. + * @param tenantActionGroupName The name of the action group. + * @param xMsClientTenantId The tenant ID of the client making the request. + * @param notificationRequest The notification request body which includes the contact details + * @param options The options parameters. + */ + async beginCreateNotificationsAtTenantActionGroupResourceLevel( + managementGroupId: string, + tenantActionGroupName: string, + xMsClientTenantId: string, + notificationRequest: TenantNotificationRequestBody, + options?: CreateNotificationsAtTenantActionGroupResourceLevelOptionalParams + ): Promise< + SimplePollerLike< + OperationState< + CreateNotificationsAtTenantActionGroupResourceLevelResponse + >, + CreateNotificationsAtTenantActionGroupResourceLevelResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + managementGroupId, + tenantActionGroupName, + xMsClientTenantId, + notificationRequest, + options + }, + spec: createNotificationsAtTenantActionGroupResourceLevelOperationSpec + }); + const poller = await createHttpPoller< + CreateNotificationsAtTenantActionGroupResourceLevelResponse, + OperationState< + CreateNotificationsAtTenantActionGroupResourceLevelResponse + > + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Send test notifications to a set of provided receivers + * @param managementGroupId The management group id. + * @param tenantActionGroupName The name of the action group. + * @param xMsClientTenantId The tenant ID of the client making the request. + * @param notificationRequest The notification request body which includes the contact details + * @param options The options parameters. + */ + async beginCreateNotificationsAtTenantActionGroupResourceLevelAndWait( + managementGroupId: string, + tenantActionGroupName: string, + xMsClientTenantId: string, + notificationRequest: TenantNotificationRequestBody, + options?: CreateNotificationsAtTenantActionGroupResourceLevelOptionalParams + ): Promise { + const poller = await this.beginCreateNotificationsAtTenantActionGroupResourceLevel( + managementGroupId, + tenantActionGroupName, + xMsClientTenantId, + notificationRequest, + options + ); + return poller.pollUntilDone(); + } + + /** + * Get the test notifications by the notification id + * @param managementGroupId The management group id. + * @param tenantActionGroupName The name of the action group. + * @param xMsClientTenantId The tenant ID of the client making the request. + * @param notificationId The notification id + * @param options The options parameters. + */ + getTestNotificationsAtTenantActionGroupResourceLevel( + managementGroupId: string, + tenantActionGroupName: string, + xMsClientTenantId: string, + notificationId: string, + options?: GetTestNotificationsAtTenantActionGroupResourceLevelOptionalParams + ): Promise { + return this.sendOperationRequest( + { + managementGroupId, + tenantActionGroupName, + xMsClientTenantId, + notificationId, + options + }, + getTestNotificationsAtTenantActionGroupResourceLevelOperationSpec + ); + } + + azureMonitorWorkspaces: AzureMonitorWorkspaces; + monitorOperations: MonitorOperations; autoscaleSettings: AutoscaleSettings; predictiveMetric: PredictiveMetric; operations: Operations; @@ -207,6 +379,7 @@ export class MonitorClient extends coreClient.ServiceClient { diagnosticSettings: DiagnosticSettings; diagnosticSettingsCategory: DiagnosticSettingsCategory; actionGroups: ActionGroups; + tenantActionGroups: TenantActionGroups; activityLogs: ActivityLogs; eventCategories: EventCategories; tenantActivityLogs: TenantActivityLogs; @@ -227,6 +400,65 @@ export class MonitorClient extends coreClient.ServiceClient { dataCollectionEndpoints: DataCollectionEndpoints; dataCollectionRuleAssociations: DataCollectionRuleAssociations; dataCollectionRules: DataCollectionRules; - azureMonitorWorkspaces: AzureMonitorWorkspaces; - monitorOperations: MonitorOperations; } +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createNotificationsAtTenantActionGroupResourceLevelOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Insights/tenantActionGroups/{tenantActionGroupName}/createNotifications", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.TestNotificationDetailsResponseAutoGenerated + }, + 201: { + bodyMapper: Mappers.TestNotificationDetailsResponseAutoGenerated + }, + 202: { + bodyMapper: Mappers.TestNotificationDetailsResponseAutoGenerated + }, + 204: { + bodyMapper: Mappers.TestNotificationDetailsResponseAutoGenerated + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated2 + } + }, + requestBody: Parameters.notificationRequest1, + queryParameters: [Parameters.apiVersion6], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupId, + Parameters.tenantActionGroupName + ], + headerParameters: [ + Parameters.accept, + Parameters.contentType, + Parameters.xMsClientTenantId + ], + mediaType: "json", + serializer +}; +const getTestNotificationsAtTenantActionGroupResourceLevelOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Insights/tenantActionGroups/{tenantActionGroupName}/notificationStatus/{notificationId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TestNotificationDetailsResponseAutoGenerated + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + queryParameters: [Parameters.apiVersion6], + urlParameters: [ + Parameters.$host, + Parameters.notificationId, + Parameters.managementGroupId, + Parameters.tenantActionGroupName + ], + headerParameters: [Parameters.accept, Parameters.xMsClientTenantId], + serializer +}; diff --git a/sdk/monitor/arm-monitor/src/operations/actionGroups.ts b/sdk/monitor/arm-monitor/src/operations/actionGroups.ts index 586c206a12e9..6862bea6c5bd 100644 --- a/sdk/monitor/arm-monitor/src/operations/actionGroups.ts +++ b/sdk/monitor/arm-monitor/src/operations/actionGroups.ts @@ -33,16 +33,8 @@ import { ActionGroupsUpdateOptionalParams, ActionGroupsUpdateResponse, NotificationRequestBody, - ActionGroupsPostTestNotificationsOptionalParams, - ActionGroupsPostTestNotificationsResponse, - ActionGroupsCreateNotificationsAtResourceGroupLevelOptionalParams, - ActionGroupsCreateNotificationsAtResourceGroupLevelResponse, ActionGroupsCreateNotificationsAtActionGroupResourceLevelOptionalParams, ActionGroupsCreateNotificationsAtActionGroupResourceLevelResponse, - ActionGroupsGetTestNotificationsOptionalParams, - ActionGroupsGetTestNotificationsResponse, - ActionGroupsGetTestNotificationsAtResourceGroupLevelOptionalParams, - ActionGroupsGetTestNotificationsAtResourceGroupLevelResponse, ActionGroupsGetTestNotificationsAtActionGroupResourceLevelOptionalParams, ActionGroupsGetTestNotificationsAtActionGroupResourceLevelResponse, EnableRequest, @@ -227,187 +219,6 @@ export class ActionGroupsImpl implements ActionGroups { ); } - /** - * Send test notifications to a set of provided receivers - * @param notificationRequest The notification request body which includes the contact details - * @param options The options parameters. - */ - async beginPostTestNotifications( - notificationRequest: NotificationRequestBody, - options?: ActionGroupsPostTestNotificationsOptionalParams - ): Promise< - SimplePollerLike< - OperationState, - ActionGroupsPostTestNotificationsResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback - } - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { notificationRequest, options }, - spec: postTestNotificationsOperationSpec - }); - const poller = await createHttpPoller< - ActionGroupsPostTestNotificationsResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location" - }); - await poller.poll(); - return poller; - } - - /** - * Send test notifications to a set of provided receivers - * @param notificationRequest The notification request body which includes the contact details - * @param options The options parameters. - */ - async beginPostTestNotificationsAndWait( - notificationRequest: NotificationRequestBody, - options?: ActionGroupsPostTestNotificationsOptionalParams - ): Promise { - const poller = await this.beginPostTestNotifications( - notificationRequest, - options - ); - return poller.pollUntilDone(); - } - - /** - * Send test notifications to a set of provided receivers - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param notificationRequest The notification request body which includes the contact details - * @param options The options parameters. - */ - async beginCreateNotificationsAtResourceGroupLevel( - resourceGroupName: string, - notificationRequest: NotificationRequestBody, - options?: ActionGroupsCreateNotificationsAtResourceGroupLevelOptionalParams - ): Promise< - SimplePollerLike< - OperationState< - ActionGroupsCreateNotificationsAtResourceGroupLevelResponse - >, - ActionGroupsCreateNotificationsAtResourceGroupLevelResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback - } - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, notificationRequest, options }, - spec: createNotificationsAtResourceGroupLevelOperationSpec - }); - const poller = await createHttpPoller< - ActionGroupsCreateNotificationsAtResourceGroupLevelResponse, - OperationState< - ActionGroupsCreateNotificationsAtResourceGroupLevelResponse - > - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location" - }); - await poller.poll(); - return poller; - } - - /** - * Send test notifications to a set of provided receivers - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param notificationRequest The notification request body which includes the contact details - * @param options The options parameters. - */ - async beginCreateNotificationsAtResourceGroupLevelAndWait( - resourceGroupName: string, - notificationRequest: NotificationRequestBody, - options?: ActionGroupsCreateNotificationsAtResourceGroupLevelOptionalParams - ): Promise { - const poller = await this.beginCreateNotificationsAtResourceGroupLevel( - resourceGroupName, - notificationRequest, - options - ); - return poller.pollUntilDone(); - } - /** * Send test notifications to a set of provided receivers * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -515,38 +326,6 @@ export class ActionGroupsImpl implements ActionGroups { return poller.pollUntilDone(); } - /** - * Get the test notifications by the notification id - * @param notificationId The notification id - * @param options The options parameters. - */ - getTestNotifications( - notificationId: string, - options?: ActionGroupsGetTestNotificationsOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { notificationId, options }, - getTestNotificationsOperationSpec - ); - } - - /** - * Get the test notifications by the notification id - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param notificationId The notification id - * @param options The options parameters. - */ - getTestNotificationsAtResourceGroupLevel( - resourceGroupName: string, - notificationId: string, - options?: ActionGroupsGetTestNotificationsAtResourceGroupLevelOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, notificationId, options }, - getTestNotificationsAtResourceGroupLevelOperationSpec - ); - } - /** * Get the test notifications by the notification id * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -631,15 +410,15 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ActionGroupResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.actionGroup, - queryParameters: [Parameters.apiVersion4], + queryParameters: [Parameters.apiVersion5], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.actionGroupName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -655,14 +434,14 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ActionGroupResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion4], + queryParameters: [Parameters.apiVersion5], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.actionGroupName ], headerParameters: [Parameters.accept], @@ -676,14 +455,14 @@ const deleteOperationSpec: coreClient.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion4], + queryParameters: [Parameters.apiVersion5], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.actionGroupName ], headerParameters: [Parameters.accept], @@ -698,76 +477,16 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ActionGroupResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.actionGroupPatch, - queryParameters: [Parameters.apiVersion4], + queryParameters: [Parameters.apiVersion5], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.actionGroupName - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const postTestNotificationsOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/createNotifications", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.TestNotificationDetailsResponse - }, - 201: { - bodyMapper: Mappers.TestNotificationDetailsResponse - }, - 202: { - bodyMapper: Mappers.TestNotificationDetailsResponse - }, - 204: { - bodyMapper: Mappers.TestNotificationDetailsResponse - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.notificationRequest, - queryParameters: [Parameters.apiVersion4], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const createNotificationsAtResourceGroupLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/createNotifications", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.TestNotificationDetailsResponse - }, - 201: { - bodyMapper: Mappers.TestNotificationDetailsResponse - }, - 202: { - bodyMapper: Mappers.TestNotificationDetailsResponse - }, - 204: { - bodyMapper: Mappers.TestNotificationDetailsResponse - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.notificationRequest, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.actionGroupName ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", @@ -791,64 +510,21 @@ const createNotificationsAtActionGroupResourceLevelOperationSpec: coreClient.Ope bodyMapper: Mappers.TestNotificationDetailsResponse }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.notificationRequest, - queryParameters: [Parameters.apiVersion4], + queryParameters: [Parameters.apiVersion5], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.actionGroupName ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; -const getTestNotificationsOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/notificationStatus/{notificationId}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.TestNotificationDetailsResponse - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.notificationId - ], - headerParameters: [Parameters.accept], - serializer -}; -const getTestNotificationsAtResourceGroupLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/notificationStatus/{notificationId}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.TestNotificationDetailsResponse - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.notificationId - ], - headerParameters: [Parameters.accept], - serializer -}; const getTestNotificationsAtActionGroupResourceLevelOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/actionGroups/{actionGroupName}/notificationStatus/{notificationId}", @@ -858,14 +534,14 @@ const getTestNotificationsAtActionGroupResourceLevelOperationSpec: coreClient.Op bodyMapper: Mappers.TestNotificationDetailsResponse }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion4], + queryParameters: [Parameters.apiVersion5], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.actionGroupName, Parameters.notificationId ], @@ -881,10 +557,10 @@ const listBySubscriptionIdOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ActionGroupList }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion4], + queryParameters: [Parameters.apiVersion5], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer @@ -898,14 +574,14 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ActionGroupList }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion4], + queryParameters: [Parameters.apiVersion5], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName ], headerParameters: [Parameters.accept], serializer @@ -920,15 +596,15 @@ const enableReceiverOperationSpec: coreClient.OperationSpec = { isError: true }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.enableRequest, - queryParameters: [Parameters.apiVersion4], + queryParameters: [Parameters.apiVersion5], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.actionGroupName ], headerParameters: [Parameters.accept, Parameters.contentType], diff --git a/sdk/monitor/arm-monitor/src/operations/activityLogAlerts.ts b/sdk/monitor/arm-monitor/src/operations/activityLogAlerts.ts index 87d37e3a8af9..d38f909a8195 100644 --- a/sdk/monitor/arm-monitor/src/operations/activityLogAlerts.ts +++ b/sdk/monitor/arm-monitor/src/operations/activityLogAlerts.ts @@ -328,15 +328,15 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ActivityLogAlertResource }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated + bodyMapper: Mappers.ErrorResponseAutoGenerated3 } }, requestBody: Parameters.activityLogAlertRule, - queryParameters: [Parameters.apiVersion12], + queryParameters: [Parameters.apiVersion14], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.activityLogAlertName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -352,14 +352,14 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ActivityLogAlertResource }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated + bodyMapper: Mappers.ErrorResponseAutoGenerated3 } }, - queryParameters: [Parameters.apiVersion12], + queryParameters: [Parameters.apiVersion14], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.activityLogAlertName ], headerParameters: [Parameters.accept], @@ -373,14 +373,14 @@ const deleteOperationSpec: coreClient.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated + bodyMapper: Mappers.ErrorResponseAutoGenerated3 } }, - queryParameters: [Parameters.apiVersion12], + queryParameters: [Parameters.apiVersion14], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.activityLogAlertName ], headerParameters: [Parameters.accept], @@ -395,15 +395,15 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ActivityLogAlertResource }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated + bodyMapper: Mappers.ErrorResponseAutoGenerated3 } }, requestBody: Parameters.activityLogAlertRulePatch, - queryParameters: [Parameters.apiVersion12], + queryParameters: [Parameters.apiVersion14], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.activityLogAlertName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -419,10 +419,10 @@ const listBySubscriptionIdOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AlertRuleList }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated + bodyMapper: Mappers.ErrorResponseAutoGenerated3 } }, - queryParameters: [Parameters.apiVersion12], + queryParameters: [Parameters.apiVersion14], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer @@ -436,14 +436,14 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AlertRuleList }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated + bodyMapper: Mappers.ErrorResponseAutoGenerated3 } }, - queryParameters: [Parameters.apiVersion12], + queryParameters: [Parameters.apiVersion14], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName ], headerParameters: [Parameters.accept], serializer @@ -456,7 +456,7 @@ const listBySubscriptionIdNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AlertRuleList }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated + bodyMapper: Mappers.ErrorResponseAutoGenerated3 } }, urlParameters: [ @@ -475,13 +475,13 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AlertRuleList }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated + bodyMapper: Mappers.ErrorResponseAutoGenerated3 } }, urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.nextLink ], headerParameters: [Parameters.accept], diff --git a/sdk/monitor/arm-monitor/src/operations/activityLogs.ts b/sdk/monitor/arm-monitor/src/operations/activityLogs.ts index ad27be0e79fc..8f5faf294e3f 100644 --- a/sdk/monitor/arm-monitor/src/operations/activityLogs.ts +++ b/sdk/monitor/arm-monitor/src/operations/activityLogs.ts @@ -158,11 +158,11 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.EventDataCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, queryParameters: [ - Parameters.apiVersion1, + Parameters.apiVersion2, Parameters.filter, Parameters.select ], @@ -178,7 +178,7 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.EventDataCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, urlParameters: [ diff --git a/sdk/monitor/arm-monitor/src/operations/alertRuleIncidents.ts b/sdk/monitor/arm-monitor/src/operations/alertRuleIncidents.ts index 80aa7721e864..16cb785ce4b1 100644 --- a/sdk/monitor/arm-monitor/src/operations/alertRuleIncidents.ts +++ b/sdk/monitor/arm-monitor/src/operations/alertRuleIncidents.ts @@ -143,14 +143,14 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.Incident }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName, Parameters.incidentName ], @@ -166,11 +166,11 @@ const listByAlertRuleOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.IncidentListResult } }, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept], diff --git a/sdk/monitor/arm-monitor/src/operations/alertRules.ts b/sdk/monitor/arm-monitor/src/operations/alertRules.ts index a9c71c40c9b7..3eff6c431802 100644 --- a/sdk/monitor/arm-monitor/src/operations/alertRules.ts +++ b/sdk/monitor/arm-monitor/src/operations/alertRules.ts @@ -250,15 +250,15 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AlertRuleResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.parameters1, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -273,14 +273,14 @@ const deleteOperationSpec: coreClient.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept], @@ -295,14 +295,14 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AlertRuleResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept], @@ -320,15 +320,15 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AlertRuleResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.alertRulesResource, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -344,14 +344,14 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AlertRuleResourceCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName ], headerParameters: [Parameters.accept], serializer @@ -365,10 +365,10 @@ const listBySubscriptionOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AlertRuleResourceCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer diff --git a/sdk/monitor/arm-monitor/src/operations/autoscaleSettings.ts b/sdk/monitor/arm-monitor/src/operations/autoscaleSettings.ts index f4930cf25476..78bb9e9ed2e7 100644 --- a/sdk/monitor/arm-monitor/src/operations/autoscaleSettings.ts +++ b/sdk/monitor/arm-monitor/src/operations/autoscaleSettings.ts @@ -321,11 +321,11 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AutoscaleErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName ], headerParameters: [Parameters.accept], serializer @@ -346,11 +346,11 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { } }, requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.autoscaleSettingName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -368,11 +368,11 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AutoscaleErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.autoscaleSettingName ], headerParameters: [Parameters.accept], @@ -390,11 +390,11 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AutoscaleErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.autoscaleSettingName ], headerParameters: [Parameters.accept], @@ -413,11 +413,11 @@ const updateOperationSpec: coreClient.OperationSpec = { } }, requestBody: Parameters.autoscaleSettingResource, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.autoscaleSettingName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -436,7 +436,7 @@ const listBySubscriptionOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AutoscaleErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer @@ -454,8 +454,8 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { }, urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.nextLink ], headerParameters: [Parameters.accept], diff --git a/sdk/monitor/arm-monitor/src/operations/azureMonitorWorkspaces.ts b/sdk/monitor/arm-monitor/src/operations/azureMonitorWorkspaces.ts index 607208075284..d36462118050 100644 --- a/sdk/monitor/arm-monitor/src/operations/azureMonitorWorkspaces.ts +++ b/sdk/monitor/arm-monitor/src/operations/azureMonitorWorkspaces.ts @@ -13,6 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { MonitorClient } from "../monitorClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { AzureMonitorWorkspaceResource, AzureMonitorWorkspacesListByResourceGroupNextOptionalParams, @@ -28,6 +34,7 @@ import { AzureMonitorWorkspacesUpdateOptionalParams, AzureMonitorWorkspacesUpdateResponse, AzureMonitorWorkspacesDeleteOptionalParams, + AzureMonitorWorkspacesDeleteResponse, AzureMonitorWorkspacesListByResourceGroupNextResponse, AzureMonitorWorkspacesListBySubscriptionNextResponse } from "../models"; @@ -46,7 +53,7 @@ export class AzureMonitorWorkspacesImpl implements AzureMonitorWorkspaces { } /** - * Lists all workspaces in the specified resource group + * Lists all Azure Monitor Workspaces in the specified resource group * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ @@ -115,7 +122,7 @@ export class AzureMonitorWorkspacesImpl implements AzureMonitorWorkspaces { } /** - * Lists all workspaces in the specified subscription + * Lists all Azure Monitor Workspaces in the specified subscription * @param options The options parameters. */ public listBySubscription( @@ -169,7 +176,7 @@ export class AzureMonitorWorkspacesImpl implements AzureMonitorWorkspaces { } /** - * Lists all workspaces in the specified resource group + * Lists all Azure Monitor Workspaces in the specified resource group * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ @@ -184,7 +191,7 @@ export class AzureMonitorWorkspacesImpl implements AzureMonitorWorkspaces { } /** - * Lists all workspaces in the specified subscription + * Lists all Azure Monitor Workspaces in the specified subscription * @param options The options parameters. */ private _listBySubscription( @@ -197,9 +204,9 @@ export class AzureMonitorWorkspacesImpl implements AzureMonitorWorkspaces { } /** - * Returns the specific Azure Monitor workspace + * Returns the specified Azure Monitor Workspace * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param azureMonitorWorkspaceName The name of the Azure Monitor workspace. The name is case + * @param azureMonitorWorkspaceName The name of the Azure Monitor Workspace. The name is case * insensitive * @param options The options parameters. */ @@ -215,12 +222,12 @@ export class AzureMonitorWorkspacesImpl implements AzureMonitorWorkspaces { } /** - * Create or update a workspace + * Creates or updates an Azure Monitor Workspace * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param azureMonitorWorkspaceName The name of the Azure Monitor workspace. The name is case + * @param azureMonitorWorkspaceName The name of the Azure Monitor Workspace. The name is case * insensitive - * @param azureMonitorWorkspaceProperties Properties that need to be specified to create a new - * workspace + * @param azureMonitorWorkspaceProperties Properties that need to be specified to create a new Azure + * Monitor Workspace * @param options The options parameters. */ create( @@ -241,9 +248,9 @@ export class AzureMonitorWorkspacesImpl implements AzureMonitorWorkspaces { } /** - * Updates part of a workspace + * Updates part of an Azure Monitor Workspace * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param azureMonitorWorkspaceName The name of the Azure Monitor workspace. The name is case + * @param azureMonitorWorkspaceName The name of the Azure Monitor Workspace. The name is case * insensitive * @param options The options parameters. */ @@ -259,21 +266,96 @@ export class AzureMonitorWorkspacesImpl implements AzureMonitorWorkspaces { } /** - * Delete a workspace + * Deletes an Azure Monitor Workspace * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param azureMonitorWorkspaceName The name of the Azure Monitor workspace. The name is case + * @param azureMonitorWorkspaceName The name of the Azure Monitor Workspace. The name is case * insensitive * @param options The options parameters. */ - delete( + async beginDelete( resourceGroupName: string, azureMonitorWorkspaceName: string, options?: AzureMonitorWorkspacesDeleteOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, azureMonitorWorkspaceName, options }, - deleteOperationSpec + ): Promise< + SimplePollerLike< + OperationState, + AzureMonitorWorkspacesDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, azureMonitorWorkspaceName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller< + AzureMonitorWorkspacesDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes an Azure Monitor Workspace + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureMonitorWorkspaceName The name of the Azure Monitor Workspace. The name is case + * insensitive + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + azureMonitorWorkspaceName: string, + options?: AzureMonitorWorkspacesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + azureMonitorWorkspaceName, + options ); + return poller.pollUntilDone(); } /** @@ -320,14 +402,14 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AzureMonitorWorkspaceResourceListResult }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 + bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion14], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName ], headerParameters: [Parameters.accept], serializer @@ -340,10 +422,10 @@ const listBySubscriptionOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AzureMonitorWorkspaceResourceListResult }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 + bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion14], + queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer @@ -357,14 +439,14 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AzureMonitorWorkspaceResource }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 + bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion14], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.azureMonitorWorkspaceName ], headerParameters: [Parameters.accept], @@ -382,15 +464,15 @@ const createOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AzureMonitorWorkspaceResource }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 + bodyMapper: Mappers.ErrorResponse } }, requestBody: Parameters.azureMonitorWorkspaceProperties, - queryParameters: [Parameters.apiVersion14], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.azureMonitorWorkspaceName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -406,15 +488,15 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AzureMonitorWorkspaceResource }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 + bodyMapper: Mappers.ErrorResponse } }, requestBody: Parameters.azureMonitorWorkspaceProperties1, - queryParameters: [Parameters.apiVersion14], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.azureMonitorWorkspaceName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -426,17 +508,27 @@ const deleteOperationSpec: coreClient.OperationSpec = { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}", httpMethod: "DELETE", responses: { - 200: {}, - 204: {}, + 200: { + headersMapper: Mappers.AzureMonitorWorkspacesDeleteHeaders + }, + 201: { + headersMapper: Mappers.AzureMonitorWorkspacesDeleteHeaders + }, + 202: { + headersMapper: Mappers.AzureMonitorWorkspacesDeleteHeaders + }, + 204: { + headersMapper: Mappers.AzureMonitorWorkspacesDeleteHeaders + }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 + bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion14], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.azureMonitorWorkspaceName ], headerParameters: [Parameters.accept], @@ -450,13 +542,13 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AzureMonitorWorkspaceResourceListResult }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 + bodyMapper: Mappers.ErrorResponse } }, urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.nextLink ], headerParameters: [Parameters.accept], @@ -470,7 +562,7 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AzureMonitorWorkspaceResourceListResult }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 + bodyMapper: Mappers.ErrorResponse } }, urlParameters: [ diff --git a/sdk/monitor/arm-monitor/src/operations/baselines.ts b/sdk/monitor/arm-monitor/src/operations/baselines.ts index 5c7c5fa1abab..433840a3520e 100644 --- a/sdk/monitor/arm-monitor/src/operations/baselines.ts +++ b/sdk/monitor/arm-monitor/src/operations/baselines.ts @@ -102,7 +102,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.MetricBaselinesResponse }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, queryParameters: [ @@ -112,9 +112,9 @@ const listOperationSpec: coreClient.OperationSpec = { Parameters.interval1, Parameters.metricnames, Parameters.aggregation1, - Parameters.resultType, + Parameters.resultType1, Parameters.sensitivities, - Parameters.apiVersion6 + Parameters.apiVersion8 ], urlParameters: [Parameters.$host, Parameters.resourceUri], headerParameters: [Parameters.accept], diff --git a/sdk/monitor/arm-monitor/src/operations/dataCollectionEndpoints.ts b/sdk/monitor/arm-monitor/src/operations/dataCollectionEndpoints.ts index 7bc434d0a6f3..8eb5a79d3113 100644 --- a/sdk/monitor/arm-monitor/src/operations/dataCollectionEndpoints.ts +++ b/sdk/monitor/arm-monitor/src/operations/dataCollectionEndpoints.ts @@ -315,11 +315,11 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName ], headerParameters: [Parameters.accept], serializer @@ -336,7 +336,7 @@ const listBySubscriptionOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], + queryParameters: [Parameters.apiVersion15], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer @@ -353,11 +353,11 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.dataCollectionEndpointName ], headerParameters: [Parameters.accept], @@ -378,12 +378,12 @@ const createOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - requestBody: Parameters.body, - queryParameters: [Parameters.apiVersion13], + requestBody: Parameters.body1, + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.dataCollectionEndpointName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -402,12 +402,12 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - requestBody: Parameters.body1, - queryParameters: [Parameters.apiVersion13], + requestBody: Parameters.body2, + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.dataCollectionEndpointName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -425,11 +425,11 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.dataCollectionEndpointName ], headerParameters: [Parameters.accept], @@ -448,8 +448,8 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { }, urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.nextLink ], headerParameters: [Parameters.accept], diff --git a/sdk/monitor/arm-monitor/src/operations/dataCollectionRuleAssociations.ts b/sdk/monitor/arm-monitor/src/operations/dataCollectionRuleAssociations.ts index 51bceb3ab96d..989c3315bdb1 100644 --- a/sdk/monitor/arm-monitor/src/operations/dataCollectionRuleAssociations.ts +++ b/sdk/monitor/arm-monitor/src/operations/dataCollectionRuleAssociations.ts @@ -466,7 +466,7 @@ const listByResourceOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], + queryParameters: [Parameters.apiVersion15], urlParameters: [Parameters.$host, Parameters.resourceUri1], headerParameters: [Parameters.accept], serializer @@ -484,11 +484,11 @@ const listByRuleOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.dataCollectionRuleName ], headerParameters: [Parameters.accept], @@ -507,11 +507,11 @@ const listByDataCollectionEndpointOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.dataCollectionEndpointName ], headerParameters: [Parameters.accept], @@ -529,7 +529,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, Parameters.resourceUri1, @@ -553,8 +553,8 @@ const createOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - requestBody: Parameters.body2, - queryParameters: [Parameters.apiVersion13], + requestBody: Parameters.body3, + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, Parameters.resourceUri1, @@ -575,7 +575,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, Parameters.resourceUri1, @@ -618,8 +618,8 @@ const listByRuleNextOperationSpec: coreClient.OperationSpec = { }, urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.nextLink, Parameters.dataCollectionRuleName ], @@ -640,8 +640,8 @@ const listByDataCollectionEndpointNextOperationSpec: coreClient.OperationSpec = }, urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.nextLink, Parameters.dataCollectionEndpointName ], diff --git a/sdk/monitor/arm-monitor/src/operations/dataCollectionRules.ts b/sdk/monitor/arm-monitor/src/operations/dataCollectionRules.ts index df8ae456aef4..05716e374f2c 100644 --- a/sdk/monitor/arm-monitor/src/operations/dataCollectionRules.ts +++ b/sdk/monitor/arm-monitor/src/operations/dataCollectionRules.ts @@ -311,11 +311,11 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName ], headerParameters: [Parameters.accept], serializer @@ -332,7 +332,7 @@ const listBySubscriptionOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], + queryParameters: [Parameters.apiVersion15], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer @@ -349,11 +349,11 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.dataCollectionRuleName ], headerParameters: [Parameters.accept], @@ -374,12 +374,12 @@ const createOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - requestBody: Parameters.body3, - queryParameters: [Parameters.apiVersion13], + requestBody: Parameters.body4, + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.dataCollectionRuleName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -398,12 +398,12 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - requestBody: Parameters.body1, - queryParameters: [Parameters.apiVersion13], + requestBody: Parameters.body2, + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.dataCollectionRuleName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -421,11 +421,11 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponseCommonV2 } }, - queryParameters: [Parameters.apiVersion13], + queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.dataCollectionRuleName ], headerParameters: [Parameters.accept], @@ -444,8 +444,8 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { }, urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.nextLink ], headerParameters: [Parameters.accept], diff --git a/sdk/monitor/arm-monitor/src/operations/diagnosticSettings.ts b/sdk/monitor/arm-monitor/src/operations/diagnosticSettings.ts index 416c6f18f6d5..ada8204a1cce 100644 --- a/sdk/monitor/arm-monitor/src/operations/diagnosticSettings.ts +++ b/sdk/monitor/arm-monitor/src/operations/diagnosticSettings.ts @@ -160,10 +160,10 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DiagnosticSettingsResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion3], + queryParameters: [Parameters.apiVersion4], urlParameters: [Parameters.$host, Parameters.resourceUri, Parameters.name], headerParameters: [Parameters.accept], serializer @@ -176,11 +176,11 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DiagnosticSettingsResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.parameters3, - queryParameters: [Parameters.apiVersion3], + queryParameters: [Parameters.apiVersion4], urlParameters: [Parameters.$host, Parameters.resourceUri, Parameters.name], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", @@ -193,10 +193,10 @@ const deleteOperationSpec: coreClient.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion3], + queryParameters: [Parameters.apiVersion4], urlParameters: [Parameters.$host, Parameters.resourceUri, Parameters.name], headerParameters: [Parameters.accept], serializer @@ -209,10 +209,10 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DiagnosticSettingsResourceCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion3], + queryParameters: [Parameters.apiVersion4], urlParameters: [Parameters.$host, Parameters.resourceUri], headerParameters: [Parameters.accept], serializer diff --git a/sdk/monitor/arm-monitor/src/operations/diagnosticSettingsCategory.ts b/sdk/monitor/arm-monitor/src/operations/diagnosticSettingsCategory.ts index 19bdf9571d7a..e4496038d14a 100644 --- a/sdk/monitor/arm-monitor/src/operations/diagnosticSettingsCategory.ts +++ b/sdk/monitor/arm-monitor/src/operations/diagnosticSettingsCategory.ts @@ -123,10 +123,10 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DiagnosticSettingsCategoryResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion3], + queryParameters: [Parameters.apiVersion4], urlParameters: [Parameters.$host, Parameters.resourceUri, Parameters.name], headerParameters: [Parameters.accept], serializer @@ -140,10 +140,10 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DiagnosticSettingsCategoryResourceCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion3], + queryParameters: [Parameters.apiVersion4], urlParameters: [Parameters.$host, Parameters.resourceUri], headerParameters: [Parameters.accept], serializer diff --git a/sdk/monitor/arm-monitor/src/operations/eventCategories.ts b/sdk/monitor/arm-monitor/src/operations/eventCategories.ts index 06b81c9146b1..fe972023b825 100644 --- a/sdk/monitor/arm-monitor/src/operations/eventCategories.ts +++ b/sdk/monitor/arm-monitor/src/operations/eventCategories.ts @@ -95,10 +95,10 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.EventCategoryCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion2], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], serializer diff --git a/sdk/monitor/arm-monitor/src/operations/index.ts b/sdk/monitor/arm-monitor/src/operations/index.ts index 772a7d4d63ff..e92a77600bc0 100644 --- a/sdk/monitor/arm-monitor/src/operations/index.ts +++ b/sdk/monitor/arm-monitor/src/operations/index.ts @@ -6,6 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +export * from "./azureMonitorWorkspaces"; +export * from "./monitorOperations"; export * from "./autoscaleSettings"; export * from "./predictiveMetric"; export * from "./operations"; @@ -15,6 +17,7 @@ export * from "./logProfiles"; export * from "./diagnosticSettings"; export * from "./diagnosticSettingsCategory"; export * from "./actionGroups"; +export * from "./tenantActionGroups"; export * from "./activityLogs"; export * from "./eventCategories"; export * from "./tenantActivityLogs"; @@ -35,5 +38,3 @@ export * from "./activityLogAlerts"; export * from "./dataCollectionEndpoints"; export * from "./dataCollectionRuleAssociations"; export * from "./dataCollectionRules"; -export * from "./azureMonitorWorkspaces"; -export * from "./monitorOperations"; diff --git a/sdk/monitor/arm-monitor/src/operations/logProfiles.ts b/sdk/monitor/arm-monitor/src/operations/logProfiles.ts index 4fb57d8e48b5..654d9743f8dd 100644 --- a/sdk/monitor/arm-monitor/src/operations/logProfiles.ts +++ b/sdk/monitor/arm-monitor/src/operations/logProfiles.ts @@ -162,7 +162,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName}", httpMethod: "DELETE", responses: { 200: {} }, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -179,10 +179,10 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.LogProfileResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -201,7 +201,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { } }, requestBody: Parameters.parameters2, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -220,11 +220,11 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.LogProfileResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.logProfilesResource, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -243,7 +243,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.LogProfileCollection } }, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer diff --git a/sdk/monitor/arm-monitor/src/operations/metricAlerts.ts b/sdk/monitor/arm-monitor/src/operations/metricAlerts.ts index a47b7e6616e3..5459d6b26611 100644 --- a/sdk/monitor/arm-monitor/src/operations/metricAlerts.ts +++ b/sdk/monitor/arm-monitor/src/operations/metricAlerts.ts @@ -246,10 +246,10 @@ const listBySubscriptionOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.MetricAlertResourceCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion7], + queryParameters: [Parameters.apiVersion9], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer @@ -263,14 +263,14 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.MetricAlertResourceCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion7], + queryParameters: [Parameters.apiVersion9], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName ], headerParameters: [Parameters.accept], serializer @@ -284,14 +284,14 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.MetricAlertResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion7], + queryParameters: [Parameters.apiVersion9], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept], @@ -306,15 +306,15 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.MetricAlertResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.parameters4, - queryParameters: [Parameters.apiVersion7], + queryParameters: [Parameters.apiVersion9], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -330,15 +330,15 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.MetricAlertResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.parameters5, - queryParameters: [Parameters.apiVersion7], + queryParameters: [Parameters.apiVersion9], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -353,14 +353,14 @@ const deleteOperationSpec: coreClient.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion7], + queryParameters: [Parameters.apiVersion9], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept], diff --git a/sdk/monitor/arm-monitor/src/operations/metricAlertsStatus.ts b/sdk/monitor/arm-monitor/src/operations/metricAlertsStatus.ts index 65d81ff00171..ff53b1843605 100644 --- a/sdk/monitor/arm-monitor/src/operations/metricAlertsStatus.ts +++ b/sdk/monitor/arm-monitor/src/operations/metricAlertsStatus.ts @@ -78,14 +78,14 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.MetricAlertStatusCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion7], + queryParameters: [Parameters.apiVersion9], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept], @@ -100,14 +100,14 @@ const listByNameOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.MetricAlertStatusCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion7], + queryParameters: [Parameters.apiVersion9], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName, Parameters.statusName ], diff --git a/sdk/monitor/arm-monitor/src/operations/metricDefinitions.ts b/sdk/monitor/arm-monitor/src/operations/metricDefinitions.ts index e63fa4aab82d..fdee6c2fd803 100644 --- a/sdk/monitor/arm-monitor/src/operations/metricDefinitions.ts +++ b/sdk/monitor/arm-monitor/src/operations/metricDefinitions.ts @@ -13,6 +13,9 @@ import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { MonitorClient } from "../monitorClient"; import { + SubscriptionScopeMetricDefinition, + MetricDefinitionsListAtSubscriptionScopeOptionalParams, + MetricDefinitionsListAtSubscriptionScopeResponse, MetricDefinition, MetricDefinitionsListOptionalParams, MetricDefinitionsListResponse @@ -31,6 +34,58 @@ export class MetricDefinitionsImpl implements MetricDefinitions { this.client = client; } + /** + * Lists the metric definitions for the subscription. + * @param region The region where the metrics you want reside. + * @param options The options parameters. + */ + public listAtSubscriptionScope( + region: string, + options?: MetricDefinitionsListAtSubscriptionScopeOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAtSubscriptionScopePagingAll(region, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listAtSubscriptionScopePagingPage( + region, + options, + settings + ); + } + }; + } + + private async *listAtSubscriptionScopePagingPage( + region: string, + options?: MetricDefinitionsListAtSubscriptionScopeOptionalParams, + _settings?: PageSettings + ): AsyncIterableIterator { + let result: MetricDefinitionsListAtSubscriptionScopeResponse; + result = await this._listAtSubscriptionScope(region, options); + yield result.value || []; + } + + private async *listAtSubscriptionScopePagingAll( + region: string, + options?: MetricDefinitionsListAtSubscriptionScopeOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAtSubscriptionScopePagingPage( + region, + options + )) { + yield* page; + } + } + /** * Lists the metric definitions for the resource. * @param resourceUri The identifier of the resource. @@ -76,6 +131,21 @@ export class MetricDefinitionsImpl implements MetricDefinitions { } } + /** + * Lists the metric definitions for the subscription. + * @param region The region where the metrics you want reside. + * @param options The options parameters. + */ + private _listAtSubscriptionScope( + region: string, + options?: MetricDefinitionsListAtSubscriptionScopeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { region, options }, + listAtSubscriptionScopeOperationSpec + ); + } + /** * Lists the metric definitions for the resource. * @param resourceUri The identifier of the resource. @@ -94,6 +164,27 @@ export class MetricDefinitionsImpl implements MetricDefinitions { // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); +const listAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metricDefinitions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SubscriptionScopeMetricDefinitionCollection + }, + default: { + bodyMapper: Mappers.ErrorContract + } + }, + queryParameters: [ + Parameters.apiVersion7, + Parameters.region, + Parameters.metricnamespace + ], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; const listOperationSpec: coreClient.OperationSpec = { path: "/{resourceUri}/providers/Microsoft.Insights/metricDefinitions", httpMethod: "GET", @@ -102,10 +193,10 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.MetricDefinitionCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion5, Parameters.metricnamespace], + queryParameters: [Parameters.apiVersion7, Parameters.metricnamespace], urlParameters: [Parameters.$host, Parameters.resourceUri], headerParameters: [Parameters.accept], serializer diff --git a/sdk/monitor/arm-monitor/src/operations/metricNamespaces.ts b/sdk/monitor/arm-monitor/src/operations/metricNamespaces.ts index 65ef9597becc..1155dd3e243d 100644 --- a/sdk/monitor/arm-monitor/src/operations/metricNamespaces.ts +++ b/sdk/monitor/arm-monitor/src/operations/metricNamespaces.ts @@ -102,10 +102,10 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.MetricNamespaceCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, - queryParameters: [Parameters.apiVersion9, Parameters.startTime], + queryParameters: [Parameters.apiVersion11, Parameters.startTime], urlParameters: [Parameters.$host, Parameters.resourceUri], headerParameters: [Parameters.accept], serializer diff --git a/sdk/monitor/arm-monitor/src/operations/metricsOperations.ts b/sdk/monitor/arm-monitor/src/operations/metricsOperations.ts index 257b46781186..637036388d3c 100644 --- a/sdk/monitor/arm-monitor/src/operations/metricsOperations.ts +++ b/sdk/monitor/arm-monitor/src/operations/metricsOperations.ts @@ -11,7 +11,14 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { MonitorClient } from "../monitorClient"; -import { MetricsListOptionalParams, MetricsListResponse } from "../models"; +import { + MetricsListAtSubscriptionScopeOptionalParams, + MetricsListAtSubscriptionScopeResponse, + MetricsListAtSubscriptionScopePostOptionalParams, + MetricsListAtSubscriptionScopePostResponse, + MetricsListOptionalParams, + MetricsListResponse +} from "../models"; /** Class containing MetricsOperations operations. */ export class MetricsOperationsImpl implements MetricsOperations { @@ -25,6 +32,37 @@ export class MetricsOperationsImpl implements MetricsOperations { this.client = client; } + /** + * **Lists the metric data for a subscription**. + * @param region The region where the metrics you want reside. + * @param options The options parameters. + */ + listAtSubscriptionScope( + region: string, + options?: MetricsListAtSubscriptionScopeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { region, options }, + listAtSubscriptionScopeOperationSpec + ); + } + + /** + * **Lists the metric data for a subscription**. Parameters can be specified on either query params or + * the body. + * @param region The region where the metrics you want reside. + * @param options The options parameters. + */ + listAtSubscriptionScopePost( + region: string, + options?: MetricsListAtSubscriptionScopePostOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { region, options }, + listAtSubscriptionScopePostOperationSpec + ); + } + /** * **Lists the metric values for a resource**. * @param resourceUri The identifier of the resource. @@ -43,6 +81,68 @@ export class MetricsOperationsImpl implements MetricsOperations { // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); +const listAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metrics", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SubscriptionScopeMetricResponse + }, + default: { + bodyMapper: Mappers.ErrorContract + } + }, + queryParameters: [ + Parameters.filter1, + Parameters.apiVersion7, + Parameters.region, + Parameters.metricnamespace, + Parameters.timespan1, + Parameters.interval1, + Parameters.metricnames, + Parameters.aggregation1, + Parameters.top, + Parameters.orderby, + Parameters.resultType, + Parameters.autoAdjustTimegrain, + Parameters.validateDimensions + ], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listAtSubscriptionScopePostOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metrics", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.SubscriptionScopeMetricResponse + }, + default: { + bodyMapper: Mappers.ErrorContract + } + }, + requestBody: Parameters.body, + queryParameters: [ + Parameters.filter1, + Parameters.apiVersion7, + Parameters.region, + Parameters.metricnamespace, + Parameters.timespan1, + Parameters.interval1, + Parameters.metricnames, + Parameters.aggregation1, + Parameters.top, + Parameters.orderby, + Parameters.resultType, + Parameters.autoAdjustTimegrain, + Parameters.validateDimensions + ], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; const listOperationSpec: coreClient.OperationSpec = { path: "/{resourceUri}/providers/Microsoft.Insights/metrics", httpMethod: "GET", @@ -51,12 +151,12 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.Response }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, queryParameters: [ Parameters.filter1, - Parameters.apiVersion5, + Parameters.apiVersion7, Parameters.metricnamespace, Parameters.timespan1, Parameters.interval1, @@ -64,7 +164,9 @@ const listOperationSpec: coreClient.OperationSpec = { Parameters.aggregation1, Parameters.top, Parameters.orderby, - Parameters.resultType + Parameters.autoAdjustTimegrain, + Parameters.validateDimensions, + Parameters.resultType1 ], urlParameters: [Parameters.$host, Parameters.resourceUri], headerParameters: [Parameters.accept], diff --git a/sdk/monitor/arm-monitor/src/operations/monitorOperations.ts b/sdk/monitor/arm-monitor/src/operations/monitorOperations.ts index bed37b715908..45d82add9318 100644 --- a/sdk/monitor/arm-monitor/src/operations/monitorOperations.ts +++ b/sdk/monitor/arm-monitor/src/operations/monitorOperations.ts @@ -14,7 +14,7 @@ import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { MonitorClient } from "../monitorClient"; import { - OperationAutoGenerated, + Operation, MonitorOperationsListNextOptionalParams, MonitorOperationsListOptionalParams, MonitorOperationsListResponse, @@ -40,7 +40,7 @@ export class MonitorOperationsImpl implements MonitorOperations { */ public list( options?: MonitorOperationsListOptionalParams - ): PagedAsyncIterableIterator { + ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { next() { @@ -61,7 +61,7 @@ export class MonitorOperationsImpl implements MonitorOperations { private async *listPagingPage( options?: MonitorOperationsListOptionalParams, settings?: PageSettings - ): AsyncIterableIterator { + ): AsyncIterableIterator { let result: MonitorOperationsListResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { @@ -82,7 +82,7 @@ export class MonitorOperationsImpl implements MonitorOperations { private async *listPagingAll( options?: MonitorOperationsListOptionalParams - ): AsyncIterableIterator { + ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; } @@ -121,13 +121,13 @@ const listOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResultAutoGenerated + bodyMapper: Mappers.OperationListResult }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 + bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion14], + queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], serializer @@ -137,10 +137,10 @@ const listNextOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResultAutoGenerated + bodyMapper: Mappers.OperationListResult }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 + bodyMapper: Mappers.ErrorResponse } }, urlParameters: [Parameters.$host, Parameters.nextLink], diff --git a/sdk/monitor/arm-monitor/src/operations/operations.ts b/sdk/monitor/arm-monitor/src/operations/operations.ts index d9c5ceca0a06..cc024f9309b8 100644 --- a/sdk/monitor/arm-monitor/src/operations/operations.ts +++ b/sdk/monitor/arm-monitor/src/operations/operations.ts @@ -46,10 +46,10 @@ const listOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResultAutoGenerated } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion2], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], serializer diff --git a/sdk/monitor/arm-monitor/src/operations/predictiveMetric.ts b/sdk/monitor/arm-monitor/src/operations/predictiveMetric.ts index 2aebcbf6ba75..ff907fd3e61a 100644 --- a/sdk/monitor/arm-monitor/src/operations/predictiveMetric.ts +++ b/sdk/monitor/arm-monitor/src/operations/predictiveMetric.ts @@ -83,7 +83,7 @@ const getOperationSpec: coreClient.OperationSpec = { } }, queryParameters: [ - Parameters.apiVersion, + Parameters.apiVersion1, Parameters.timespan, Parameters.interval, Parameters.metricNamespace, @@ -92,8 +92,8 @@ const getOperationSpec: coreClient.OperationSpec = { ], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.autoscaleSettingName ], headerParameters: [Parameters.accept], diff --git a/sdk/monitor/arm-monitor/src/operations/privateEndpointConnections.ts b/sdk/monitor/arm-monitor/src/operations/privateEndpointConnections.ts index 172bd4ed24ed..089d9e951a52 100644 --- a/sdk/monitor/arm-monitor/src/operations/privateEndpointConnections.ts +++ b/sdk/monitor/arm-monitor/src/operations/privateEndpointConnections.ts @@ -20,7 +20,7 @@ import { createLroSpec } from "../lroImpl"; import { PrivateEndpointConnectionsGetOptionalParams, PrivateEndpointConnectionsGetResponse, - PrivateEndpointConnection, + PrivateEndpointConnectionAutoGenerated, PrivateEndpointConnectionsCreateOrUpdateOptionalParams, PrivateEndpointConnectionsCreateOrUpdateResponse, PrivateEndpointConnectionsDeleteOptionalParams, @@ -72,7 +72,7 @@ export class PrivateEndpointConnectionsImpl resourceGroupName: string, scopeName: string, privateEndpointConnectionName: string, - parameters: PrivateEndpointConnection, + parameters: PrivateEndpointConnectionAutoGenerated, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams ): Promise< SimplePollerLike< @@ -153,7 +153,7 @@ export class PrivateEndpointConnectionsImpl resourceGroupName: string, scopeName: string, privateEndpointConnectionName: string, - parameters: PrivateEndpointConnection, + parameters: PrivateEndpointConnectionAutoGenerated, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams ): Promise { const poller = await this.beginCreateOrUpdate( @@ -284,17 +284,17 @@ const getOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PrivateEndpointConnection + bodyMapper: Mappers.PrivateEndpointConnectionAutoGenerated }, default: { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.scopeName, Parameters.privateEndpointConnectionName ], @@ -307,27 +307,27 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.PrivateEndpointConnection + bodyMapper: Mappers.PrivateEndpointConnectionAutoGenerated }, 201: { - bodyMapper: Mappers.PrivateEndpointConnection + bodyMapper: Mappers.PrivateEndpointConnectionAutoGenerated }, 202: { - bodyMapper: Mappers.PrivateEndpointConnection + bodyMapper: Mappers.PrivateEndpointConnectionAutoGenerated }, 204: { - bodyMapper: Mappers.PrivateEndpointConnection + bodyMapper: Mappers.PrivateEndpointConnectionAutoGenerated }, default: { bodyMapper: Mappers.DefaultErrorResponse } }, requestBody: Parameters.parameters8, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.scopeName, Parameters.privateEndpointConnectionName ], @@ -348,11 +348,11 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.scopeName, Parameters.privateEndpointConnectionName ], @@ -371,11 +371,11 @@ const listByPrivateLinkScopeOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.scopeName ], headerParameters: [Parameters.accept], diff --git a/sdk/monitor/arm-monitor/src/operations/privateLinkResources.ts b/sdk/monitor/arm-monitor/src/operations/privateLinkResources.ts index 8d83df363410..12b7547e027e 100644 --- a/sdk/monitor/arm-monitor/src/operations/privateLinkResources.ts +++ b/sdk/monitor/arm-monitor/src/operations/privateLinkResources.ts @@ -81,11 +81,11 @@ const listByPrivateLinkScopeOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.scopeName ], headerParameters: [Parameters.accept], @@ -103,11 +103,11 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.scopeName, Parameters.groupName ], diff --git a/sdk/monitor/arm-monitor/src/operations/privateLinkScopeOperationStatus.ts b/sdk/monitor/arm-monitor/src/operations/privateLinkScopeOperationStatus.ts index 17aeeea26cfb..6c4cb6c4e4dc 100644 --- a/sdk/monitor/arm-monitor/src/operations/privateLinkScopeOperationStatus.ts +++ b/sdk/monitor/arm-monitor/src/operations/privateLinkScopeOperationStatus.ts @@ -61,11 +61,11 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.asyncOperationId ], headerParameters: [Parameters.accept], diff --git a/sdk/monitor/arm-monitor/src/operations/privateLinkScopedResources.ts b/sdk/monitor/arm-monitor/src/operations/privateLinkScopedResources.ts index 3f86e1345fb4..20e219800fad 100644 --- a/sdk/monitor/arm-monitor/src/operations/privateLinkScopedResources.ts +++ b/sdk/monitor/arm-monitor/src/operations/privateLinkScopedResources.ts @@ -387,11 +387,11 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.name, Parameters.scopeName ], @@ -420,11 +420,11 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { } }, requestBody: Parameters.parameters9, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.name, Parameters.scopeName ], @@ -445,11 +445,11 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.name, Parameters.scopeName ], @@ -468,11 +468,11 @@ const listByPrivateLinkScopeOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.scopeName ], headerParameters: [Parameters.accept], @@ -491,8 +491,8 @@ const listByPrivateLinkScopeNextOperationSpec: coreClient.OperationSpec = { }, urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.nextLink, Parameters.scopeName ], diff --git a/sdk/monitor/arm-monitor/src/operations/privateLinkScopes.ts b/sdk/monitor/arm-monitor/src/operations/privateLinkScopes.ts index 8589c22dc234..e5e95360e401 100644 --- a/sdk/monitor/arm-monitor/src/operations/privateLinkScopes.ts +++ b/sdk/monitor/arm-monitor/src/operations/privateLinkScopes.ts @@ -391,7 +391,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer @@ -408,11 +408,11 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName ], headerParameters: [Parameters.accept], serializer @@ -430,11 +430,11 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.scopeName ], headerParameters: [Parameters.accept], @@ -452,11 +452,11 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DefaultErrorResponse } }, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.scopeName ], headerParameters: [Parameters.accept], @@ -478,11 +478,11 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { } }, requestBody: Parameters.azureMonitorPrivateLinkScopePayload, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.scopeName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -502,11 +502,11 @@ const updateTagsOperationSpec: coreClient.OperationSpec = { } }, requestBody: Parameters.privateLinkScopeTags, - queryParameters: [Parameters.apiVersion11], + queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.scopeName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -545,8 +545,8 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { }, urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.nextLink ], headerParameters: [Parameters.accept], diff --git a/sdk/monitor/arm-monitor/src/operations/scheduledQueryRules.ts b/sdk/monitor/arm-monitor/src/operations/scheduledQueryRules.ts index cad03c26e444..3bac07d0c4db 100644 --- a/sdk/monitor/arm-monitor/src/operations/scheduledQueryRules.ts +++ b/sdk/monitor/arm-monitor/src/operations/scheduledQueryRules.ts @@ -313,10 +313,10 @@ const listBySubscriptionOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ScheduledQueryRuleResourceCollection }, default: { - bodyMapper: Mappers.ErrorContract + bodyMapper: Mappers.ErrorContractAutoGenerated } }, - queryParameters: [Parameters.apiVersion8], + queryParameters: [Parameters.apiVersion10], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer @@ -330,14 +330,14 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ScheduledQueryRuleResourceCollection }, default: { - bodyMapper: Mappers.ErrorContract + bodyMapper: Mappers.ErrorContractAutoGenerated } }, - queryParameters: [Parameters.apiVersion8], + queryParameters: [Parameters.apiVersion10], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName ], headerParameters: [Parameters.accept], serializer @@ -351,14 +351,14 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ScheduledQueryRuleResource }, default: { - bodyMapper: Mappers.ErrorContract + bodyMapper: Mappers.ErrorContractAutoGenerated } }, - queryParameters: [Parameters.apiVersion8], + queryParameters: [Parameters.apiVersion10], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept], @@ -376,15 +376,15 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ScheduledQueryRuleResource }, default: { - bodyMapper: Mappers.ErrorContract + bodyMapper: Mappers.ErrorContractAutoGenerated } }, requestBody: Parameters.parameters6, - queryParameters: [Parameters.apiVersion8], + queryParameters: [Parameters.apiVersion10], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -400,15 +400,15 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ScheduledQueryRuleResource }, default: { - bodyMapper: Mappers.ErrorContract + bodyMapper: Mappers.ErrorContractAutoGenerated } }, requestBody: Parameters.parameters7, - queryParameters: [Parameters.apiVersion8], + queryParameters: [Parameters.apiVersion10], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -423,14 +423,14 @@ const deleteOperationSpec: coreClient.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorContract + bodyMapper: Mappers.ErrorContractAutoGenerated } }, - queryParameters: [Parameters.apiVersion8], + queryParameters: [Parameters.apiVersion10], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.ruleName ], headerParameters: [Parameters.accept], @@ -444,7 +444,7 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ScheduledQueryRuleResourceCollection }, default: { - bodyMapper: Mappers.ErrorContract + bodyMapper: Mappers.ErrorContractAutoGenerated } }, urlParameters: [ @@ -463,13 +463,13 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ScheduledQueryRuleResourceCollection }, default: { - bodyMapper: Mappers.ErrorContract + bodyMapper: Mappers.ErrorContractAutoGenerated } }, urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.nextLink ], headerParameters: [Parameters.accept], diff --git a/sdk/monitor/arm-monitor/src/operations/tenantActionGroups.ts b/sdk/monitor/arm-monitor/src/operations/tenantActionGroups.ts new file mode 100644 index 000000000000..432fda5aa863 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operations/tenantActionGroups.ts @@ -0,0 +1,335 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { TenantActionGroups } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MonitorClient } from "../monitorClient"; +import { + TenantActionGroupResource, + TenantActionGroupsListByManagementGroupIdOptionalParams, + TenantActionGroupsListByManagementGroupIdResponse, + TenantActionGroupsCreateOrUpdateOptionalParams, + TenantActionGroupsCreateOrUpdateResponse, + TenantActionGroupsGetOptionalParams, + TenantActionGroupsGetResponse, + TenantActionGroupsDeleteOptionalParams, + ActionGroupPatchBodyAutoGenerated, + TenantActionGroupsUpdateOptionalParams, + TenantActionGroupsUpdateResponse +} from "../models"; + +/// +/** Class containing TenantActionGroups operations. */ +export class TenantActionGroupsImpl implements TenantActionGroups { + private readonly client: MonitorClient; + + /** + * Initialize a new instance of the class TenantActionGroups class. + * @param client Reference to the service client + */ + constructor(client: MonitorClient) { + this.client = client; + } + + /** + * Get a list of all tenant action groups in a management group. + * @param managementGroupId The management group id. + * @param xMsClientTenantId The tenant ID of the client making the request. + * @param options The options parameters. + */ + public listByManagementGroupId( + managementGroupId: string, + xMsClientTenantId: string, + options?: TenantActionGroupsListByManagementGroupIdOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByManagementGroupIdPagingAll( + managementGroupId, + xMsClientTenantId, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByManagementGroupIdPagingPage( + managementGroupId, + xMsClientTenantId, + options, + settings + ); + } + }; + } + + private async *listByManagementGroupIdPagingPage( + managementGroupId: string, + xMsClientTenantId: string, + options?: TenantActionGroupsListByManagementGroupIdOptionalParams, + _settings?: PageSettings + ): AsyncIterableIterator { + let result: TenantActionGroupsListByManagementGroupIdResponse; + result = await this._listByManagementGroupId( + managementGroupId, + xMsClientTenantId, + options + ); + yield result.value || []; + } + + private async *listByManagementGroupIdPagingAll( + managementGroupId: string, + xMsClientTenantId: string, + options?: TenantActionGroupsListByManagementGroupIdOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByManagementGroupIdPagingPage( + managementGroupId, + xMsClientTenantId, + options + )) { + yield* page; + } + } + + /** + * Create a new tenant action group or update an existing one. + * @param managementGroupId The management group id. + * @param tenantActionGroupName The name of the action group. + * @param xMsClientTenantId The tenant ID of the client making the request. + * @param actionGroup The tenant action group to create or use for the update. + * @param options The options parameters. + */ + createOrUpdate( + managementGroupId: string, + tenantActionGroupName: string, + xMsClientTenantId: string, + actionGroup: TenantActionGroupResource, + options?: TenantActionGroupsCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + managementGroupId, + tenantActionGroupName, + xMsClientTenantId, + actionGroup, + options + }, + createOrUpdateOperationSpec + ); + } + + /** + * Get a tenant action group. + * @param managementGroupId The management group id. + * @param tenantActionGroupName The name of the action group. + * @param xMsClientTenantId The tenant ID of the client making the request. + * @param options The options parameters. + */ + get( + managementGroupId: string, + tenantActionGroupName: string, + xMsClientTenantId: string, + options?: TenantActionGroupsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { managementGroupId, tenantActionGroupName, xMsClientTenantId, options }, + getOperationSpec + ); + } + + /** + * Delete a tenant action group. + * @param managementGroupId The management group id. + * @param tenantActionGroupName The name of the action group. + * @param xMsClientTenantId The tenant ID of the client making the request. + * @param options The options parameters. + */ + delete( + managementGroupId: string, + tenantActionGroupName: string, + xMsClientTenantId: string, + options?: TenantActionGroupsDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { managementGroupId, tenantActionGroupName, xMsClientTenantId, options }, + deleteOperationSpec + ); + } + + /** + * Updates an existing tenant action group's tags. To update other fields use the CreateOrUpdate + * method. + * @param managementGroupId The management group id. + * @param tenantActionGroupName The name of the action group. + * @param xMsClientTenantId The tenant ID of the client making the request. + * @param tenantActionGroupPatch Parameters supplied to the operation. + * @param options The options parameters. + */ + update( + managementGroupId: string, + tenantActionGroupName: string, + xMsClientTenantId: string, + tenantActionGroupPatch: ActionGroupPatchBodyAutoGenerated, + options?: TenantActionGroupsUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + managementGroupId, + tenantActionGroupName, + xMsClientTenantId, + tenantActionGroupPatch, + options + }, + updateOperationSpec + ); + } + + /** + * Get a list of all tenant action groups in a management group. + * @param managementGroupId The management group id. + * @param xMsClientTenantId The tenant ID of the client making the request. + * @param options The options parameters. + */ + private _listByManagementGroupId( + managementGroupId: string, + xMsClientTenantId: string, + options?: TenantActionGroupsListByManagementGroupIdOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { managementGroupId, xMsClientTenantId, options }, + listByManagementGroupIdOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Insights/tenantActionGroups/{tenantActionGroupName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.TenantActionGroupResource + }, + 201: { + bodyMapper: Mappers.TenantActionGroupResource + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + requestBody: Parameters.actionGroup1, + queryParameters: [Parameters.apiVersion6], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupId, + Parameters.tenantActionGroupName + ], + headerParameters: [ + Parameters.accept, + Parameters.contentType, + Parameters.xMsClientTenantId + ], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Insights/tenantActionGroups/{tenantActionGroupName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TenantActionGroupResource + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + queryParameters: [Parameters.apiVersion6], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupId, + Parameters.tenantActionGroupName + ], + headerParameters: [Parameters.accept, Parameters.xMsClientTenantId], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Insights/tenantActionGroups/{tenantActionGroupName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + queryParameters: [Parameters.apiVersion6], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupId, + Parameters.tenantActionGroupName + ], + headerParameters: [Parameters.accept, Parameters.xMsClientTenantId], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Insights/tenantActionGroups/{tenantActionGroupName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.TenantActionGroupResource + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + requestBody: Parameters.tenantActionGroupPatch, + queryParameters: [Parameters.apiVersion6], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupId, + Parameters.tenantActionGroupName + ], + headerParameters: [ + Parameters.accept, + Parameters.contentType, + Parameters.xMsClientTenantId + ], + mediaType: "json", + serializer +}; +const listByManagementGroupIdOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Insights/tenantActionGroups", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TenantActionGroupList + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + queryParameters: [Parameters.apiVersion6], + urlParameters: [Parameters.$host, Parameters.managementGroupId], + headerParameters: [Parameters.accept, Parameters.xMsClientTenantId], + serializer +}; diff --git a/sdk/monitor/arm-monitor/src/operations/tenantActivityLogs.ts b/sdk/monitor/arm-monitor/src/operations/tenantActivityLogs.ts index 9ad3a25eca1a..c5e8bb4484fa 100644 --- a/sdk/monitor/arm-monitor/src/operations/tenantActivityLogs.ts +++ b/sdk/monitor/arm-monitor/src/operations/tenantActivityLogs.ts @@ -130,11 +130,11 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.EventDataCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, queryParameters: [ - Parameters.apiVersion1, + Parameters.apiVersion2, Parameters.select, Parameters.filter1 ], @@ -150,7 +150,7 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.EventDataCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, urlParameters: [Parameters.$host, Parameters.nextLink], diff --git a/sdk/monitor/arm-monitor/src/operations/vMInsights.ts b/sdk/monitor/arm-monitor/src/operations/vMInsights.ts index 01ce4a4a57fd..84b592f800c3 100644 --- a/sdk/monitor/arm-monitor/src/operations/vMInsights.ts +++ b/sdk/monitor/arm-monitor/src/operations/vMInsights.ts @@ -59,7 +59,7 @@ const getOnboardingStatusOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ResponseWithError } }, - queryParameters: [Parameters.apiVersion10], + queryParameters: [Parameters.apiVersion12], urlParameters: [Parameters.$host, Parameters.resourceUri], headerParameters: [Parameters.accept], serializer diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/actionGroups.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/actionGroups.ts index 4c7654b5a4a9..c613fd4135b0 100644 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/actionGroups.ts +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/actionGroups.ts @@ -21,16 +21,8 @@ import { ActionGroupsUpdateOptionalParams, ActionGroupsUpdateResponse, NotificationRequestBody, - ActionGroupsPostTestNotificationsOptionalParams, - ActionGroupsPostTestNotificationsResponse, - ActionGroupsCreateNotificationsAtResourceGroupLevelOptionalParams, - ActionGroupsCreateNotificationsAtResourceGroupLevelResponse, ActionGroupsCreateNotificationsAtActionGroupResourceLevelOptionalParams, ActionGroupsCreateNotificationsAtActionGroupResourceLevelResponse, - ActionGroupsGetTestNotificationsOptionalParams, - ActionGroupsGetTestNotificationsResponse, - ActionGroupsGetTestNotificationsAtResourceGroupLevelOptionalParams, - ActionGroupsGetTestNotificationsAtResourceGroupLevelResponse, ActionGroupsGetTestNotificationsAtActionGroupResourceLevelOptionalParams, ActionGroupsGetTestNotificationsAtActionGroupResourceLevelResponse, EnableRequest, @@ -104,58 +96,6 @@ export interface ActionGroups { actionGroupPatch: ActionGroupPatchBody, options?: ActionGroupsUpdateOptionalParams ): Promise; - /** - * Send test notifications to a set of provided receivers - * @param notificationRequest The notification request body which includes the contact details - * @param options The options parameters. - */ - beginPostTestNotifications( - notificationRequest: NotificationRequestBody, - options?: ActionGroupsPostTestNotificationsOptionalParams - ): Promise< - SimplePollerLike< - OperationState, - ActionGroupsPostTestNotificationsResponse - > - >; - /** - * Send test notifications to a set of provided receivers - * @param notificationRequest The notification request body which includes the contact details - * @param options The options parameters. - */ - beginPostTestNotificationsAndWait( - notificationRequest: NotificationRequestBody, - options?: ActionGroupsPostTestNotificationsOptionalParams - ): Promise; - /** - * Send test notifications to a set of provided receivers - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param notificationRequest The notification request body which includes the contact details - * @param options The options parameters. - */ - beginCreateNotificationsAtResourceGroupLevel( - resourceGroupName: string, - notificationRequest: NotificationRequestBody, - options?: ActionGroupsCreateNotificationsAtResourceGroupLevelOptionalParams - ): Promise< - SimplePollerLike< - OperationState< - ActionGroupsCreateNotificationsAtResourceGroupLevelResponse - >, - ActionGroupsCreateNotificationsAtResourceGroupLevelResponse - > - >; - /** - * Send test notifications to a set of provided receivers - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param notificationRequest The notification request body which includes the contact details - * @param options The options parameters. - */ - beginCreateNotificationsAtResourceGroupLevelAndWait( - resourceGroupName: string, - notificationRequest: NotificationRequestBody, - options?: ActionGroupsCreateNotificationsAtResourceGroupLevelOptionalParams - ): Promise; /** * Send test notifications to a set of provided receivers * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -189,26 +129,6 @@ export interface ActionGroups { notificationRequest: NotificationRequestBody, options?: ActionGroupsCreateNotificationsAtActionGroupResourceLevelOptionalParams ): Promise; - /** - * Get the test notifications by the notification id - * @param notificationId The notification id - * @param options The options parameters. - */ - getTestNotifications( - notificationId: string, - options?: ActionGroupsGetTestNotificationsOptionalParams - ): Promise; - /** - * Get the test notifications by the notification id - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param notificationId The notification id - * @param options The options parameters. - */ - getTestNotificationsAtResourceGroupLevel( - resourceGroupName: string, - notificationId: string, - options?: ActionGroupsGetTestNotificationsAtResourceGroupLevelOptionalParams - ): Promise; /** * Get the test notifications by the notification id * @param resourceGroupName The name of the resource group. The name is case insensitive. diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/azureMonitorWorkspaces.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/azureMonitorWorkspaces.ts index 8d0b3a72260b..4c3b1dd5a44c 100644 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/azureMonitorWorkspaces.ts +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/azureMonitorWorkspaces.ts @@ -7,6 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { AzureMonitorWorkspaceResource, AzureMonitorWorkspacesListByResourceGroupOptionalParams, @@ -17,14 +18,15 @@ import { AzureMonitorWorkspacesCreateResponse, AzureMonitorWorkspacesUpdateOptionalParams, AzureMonitorWorkspacesUpdateResponse, - AzureMonitorWorkspacesDeleteOptionalParams + AzureMonitorWorkspacesDeleteOptionalParams, + AzureMonitorWorkspacesDeleteResponse } from "../models"; /// /** Interface representing a AzureMonitorWorkspaces. */ export interface AzureMonitorWorkspaces { /** - * Lists all workspaces in the specified resource group + * Lists all Azure Monitor Workspaces in the specified resource group * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ @@ -33,16 +35,16 @@ export interface AzureMonitorWorkspaces { options?: AzureMonitorWorkspacesListByResourceGroupOptionalParams ): PagedAsyncIterableIterator; /** - * Lists all workspaces in the specified subscription + * Lists all Azure Monitor Workspaces in the specified subscription * @param options The options parameters. */ listBySubscription( options?: AzureMonitorWorkspacesListBySubscriptionOptionalParams ): PagedAsyncIterableIterator; /** - * Returns the specific Azure Monitor workspace + * Returns the specified Azure Monitor Workspace * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param azureMonitorWorkspaceName The name of the Azure Monitor workspace. The name is case + * @param azureMonitorWorkspaceName The name of the Azure Monitor Workspace. The name is case * insensitive * @param options The options parameters. */ @@ -52,12 +54,12 @@ export interface AzureMonitorWorkspaces { options?: AzureMonitorWorkspacesGetOptionalParams ): Promise; /** - * Create or update a workspace + * Creates or updates an Azure Monitor Workspace * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param azureMonitorWorkspaceName The name of the Azure Monitor workspace. The name is case + * @param azureMonitorWorkspaceName The name of the Azure Monitor Workspace. The name is case * insensitive - * @param azureMonitorWorkspaceProperties Properties that need to be specified to create a new - * workspace + * @param azureMonitorWorkspaceProperties Properties that need to be specified to create a new Azure + * Monitor Workspace * @param options The options parameters. */ create( @@ -67,9 +69,9 @@ export interface AzureMonitorWorkspaces { options?: AzureMonitorWorkspacesCreateOptionalParams ): Promise; /** - * Updates part of a workspace + * Updates part of an Azure Monitor Workspace * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param azureMonitorWorkspaceName The name of the Azure Monitor workspace. The name is case + * @param azureMonitorWorkspaceName The name of the Azure Monitor Workspace. The name is case * insensitive * @param options The options parameters. */ @@ -79,15 +81,32 @@ export interface AzureMonitorWorkspaces { options?: AzureMonitorWorkspacesUpdateOptionalParams ): Promise; /** - * Delete a workspace + * Deletes an Azure Monitor Workspace * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param azureMonitorWorkspaceName The name of the Azure Monitor workspace. The name is case + * @param azureMonitorWorkspaceName The name of the Azure Monitor Workspace. The name is case * insensitive * @param options The options parameters. */ - delete( + beginDelete( resourceGroupName: string, azureMonitorWorkspaceName: string, options?: AzureMonitorWorkspacesDeleteOptionalParams - ): Promise; + ): Promise< + SimplePollerLike< + OperationState, + AzureMonitorWorkspacesDeleteResponse + > + >; + /** + * Deletes an Azure Monitor Workspace + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureMonitorWorkspaceName The name of the Azure Monitor Workspace. The name is case + * insensitive + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + azureMonitorWorkspaceName: string, + options?: AzureMonitorWorkspacesDeleteOptionalParams + ): Promise; } diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/index.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/index.ts index 772a7d4d63ff..e92a77600bc0 100644 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/index.ts +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/index.ts @@ -6,6 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +export * from "./azureMonitorWorkspaces"; +export * from "./monitorOperations"; export * from "./autoscaleSettings"; export * from "./predictiveMetric"; export * from "./operations"; @@ -15,6 +17,7 @@ export * from "./logProfiles"; export * from "./diagnosticSettings"; export * from "./diagnosticSettingsCategory"; export * from "./actionGroups"; +export * from "./tenantActionGroups"; export * from "./activityLogs"; export * from "./eventCategories"; export * from "./tenantActivityLogs"; @@ -35,5 +38,3 @@ export * from "./activityLogAlerts"; export * from "./dataCollectionEndpoints"; export * from "./dataCollectionRuleAssociations"; export * from "./dataCollectionRules"; -export * from "./azureMonitorWorkspaces"; -export * from "./monitorOperations"; diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/metricDefinitions.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/metricDefinitions.ts index 1a98f35a1568..73b2983e9b49 100644 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/metricDefinitions.ts +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/metricDefinitions.ts @@ -8,6 +8,8 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { + SubscriptionScopeMetricDefinition, + MetricDefinitionsListAtSubscriptionScopeOptionalParams, MetricDefinition, MetricDefinitionsListOptionalParams } from "../models"; @@ -15,6 +17,15 @@ import { /// /** Interface representing a MetricDefinitions. */ export interface MetricDefinitions { + /** + * Lists the metric definitions for the subscription. + * @param region The region where the metrics you want reside. + * @param options The options parameters. + */ + listAtSubscriptionScope( + region: string, + options?: MetricDefinitionsListAtSubscriptionScopeOptionalParams + ): PagedAsyncIterableIterator; /** * Lists the metric definitions for the resource. * @param resourceUri The identifier of the resource. diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/metricsOperations.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/metricsOperations.ts index a9b3f7a4756a..b424c42e513c 100644 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/metricsOperations.ts +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/metricsOperations.ts @@ -6,10 +6,36 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { MetricsListOptionalParams, MetricsListResponse } from "../models"; +import { + MetricsListAtSubscriptionScopeOptionalParams, + MetricsListAtSubscriptionScopeResponse, + MetricsListAtSubscriptionScopePostOptionalParams, + MetricsListAtSubscriptionScopePostResponse, + MetricsListOptionalParams, + MetricsListResponse +} from "../models"; /** Interface representing a MetricsOperations. */ export interface MetricsOperations { + /** + * **Lists the metric data for a subscription**. + * @param region The region where the metrics you want reside. + * @param options The options parameters. + */ + listAtSubscriptionScope( + region: string, + options?: MetricsListAtSubscriptionScopeOptionalParams + ): Promise; + /** + * **Lists the metric data for a subscription**. Parameters can be specified on either query params or + * the body. + * @param region The region where the metrics you want reside. + * @param options The options parameters. + */ + listAtSubscriptionScopePost( + region: string, + options?: MetricsListAtSubscriptionScopePostOptionalParams + ): Promise; /** * **Lists the metric values for a resource**. * @param resourceUri The identifier of the resource. diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/monitorOperations.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/monitorOperations.ts index af36a9b0beca..5764a4019298 100644 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/monitorOperations.ts +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/monitorOperations.ts @@ -7,10 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - OperationAutoGenerated, - MonitorOperationsListOptionalParams -} from "../models"; +import { Operation, MonitorOperationsListOptionalParams } from "../models"; /// /** Interface representing a MonitorOperations. */ @@ -21,5 +18,5 @@ export interface MonitorOperations { */ list( options?: MonitorOperationsListOptionalParams - ): PagedAsyncIterableIterator; + ): PagedAsyncIterableIterator; } diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/privateEndpointConnections.ts index a5661bf7e3ba..81ea039795e6 100644 --- a/sdk/monitor/arm-monitor/src/operationsInterfaces/privateEndpointConnections.ts +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/privateEndpointConnections.ts @@ -10,7 +10,7 @@ import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { PrivateEndpointConnectionsGetOptionalParams, PrivateEndpointConnectionsGetResponse, - PrivateEndpointConnection, + PrivateEndpointConnectionAutoGenerated, PrivateEndpointConnectionsCreateOrUpdateOptionalParams, PrivateEndpointConnectionsCreateOrUpdateResponse, PrivateEndpointConnectionsDeleteOptionalParams, @@ -45,7 +45,7 @@ export interface PrivateEndpointConnections { resourceGroupName: string, scopeName: string, privateEndpointConnectionName: string, - parameters: PrivateEndpointConnection, + parameters: PrivateEndpointConnectionAutoGenerated, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams ): Promise< SimplePollerLike< @@ -65,7 +65,7 @@ export interface PrivateEndpointConnections { resourceGroupName: string, scopeName: string, privateEndpointConnectionName: string, - parameters: PrivateEndpointConnection, + parameters: PrivateEndpointConnectionAutoGenerated, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams ): Promise; /** diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/tenantActionGroups.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/tenantActionGroups.ts new file mode 100644 index 000000000000..5300652dfee8 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/tenantActionGroups.ts @@ -0,0 +1,94 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + TenantActionGroupResource, + TenantActionGroupsListByManagementGroupIdOptionalParams, + TenantActionGroupsCreateOrUpdateOptionalParams, + TenantActionGroupsCreateOrUpdateResponse, + TenantActionGroupsGetOptionalParams, + TenantActionGroupsGetResponse, + TenantActionGroupsDeleteOptionalParams, + ActionGroupPatchBodyAutoGenerated, + TenantActionGroupsUpdateOptionalParams, + TenantActionGroupsUpdateResponse +} from "../models"; + +/// +/** Interface representing a TenantActionGroups. */ +export interface TenantActionGroups { + /** + * Get a list of all tenant action groups in a management group. + * @param managementGroupId The management group id. + * @param xMsClientTenantId The tenant ID of the client making the request. + * @param options The options parameters. + */ + listByManagementGroupId( + managementGroupId: string, + xMsClientTenantId: string, + options?: TenantActionGroupsListByManagementGroupIdOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create a new tenant action group or update an existing one. + * @param managementGroupId The management group id. + * @param tenantActionGroupName The name of the action group. + * @param xMsClientTenantId The tenant ID of the client making the request. + * @param actionGroup The tenant action group to create or use for the update. + * @param options The options parameters. + */ + createOrUpdate( + managementGroupId: string, + tenantActionGroupName: string, + xMsClientTenantId: string, + actionGroup: TenantActionGroupResource, + options?: TenantActionGroupsCreateOrUpdateOptionalParams + ): Promise; + /** + * Get a tenant action group. + * @param managementGroupId The management group id. + * @param tenantActionGroupName The name of the action group. + * @param xMsClientTenantId The tenant ID of the client making the request. + * @param options The options parameters. + */ + get( + managementGroupId: string, + tenantActionGroupName: string, + xMsClientTenantId: string, + options?: TenantActionGroupsGetOptionalParams + ): Promise; + /** + * Delete a tenant action group. + * @param managementGroupId The management group id. + * @param tenantActionGroupName The name of the action group. + * @param xMsClientTenantId The tenant ID of the client making the request. + * @param options The options parameters. + */ + delete( + managementGroupId: string, + tenantActionGroupName: string, + xMsClientTenantId: string, + options?: TenantActionGroupsDeleteOptionalParams + ): Promise; + /** + * Updates an existing tenant action group's tags. To update other fields use the CreateOrUpdate + * method. + * @param managementGroupId The management group id. + * @param tenantActionGroupName The name of the action group. + * @param xMsClientTenantId The tenant ID of the client making the request. + * @param tenantActionGroupPatch Parameters supplied to the operation. + * @param options The options parameters. + */ + update( + managementGroupId: string, + tenantActionGroupName: string, + xMsClientTenantId: string, + tenantActionGroupPatch: ActionGroupPatchBodyAutoGenerated, + options?: TenantActionGroupsUpdateOptionalParams + ): Promise; +} diff --git a/sdk/monitor/arm-monitor/test/monitor_examples.ts b/sdk/monitor/arm-monitor/test/monitor_examples.ts deleted file mode 100644 index 3fb28c689829..000000000000 --- a/sdk/monitor/arm-monitor/test/monitor_examples.ts +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - env, - Recorder, - RecorderStartOptions, - delay, - isPlaybackMode, -} from "@azure-tools/test-recorder"; -import { createTestCredential } from "@azure-tools/test-credential"; -import { assert } from "chai"; -import { Context } from "mocha"; -import { MonitorClient } from "../src/monitorClient"; -import { LogicManagementClient } from "@azure/arm-logic"; -import { StorageManagementClient } from "@azure/arm-storage"; -import { EventHubManagementClient } from "@azure/arm-eventhub"; -import { OperationalInsightsManagementClient } from "@azure/arm-operationalinsights"; - -const replaceableVariables: Record = { - AZURE_CLIENT_ID: "azure_client_id", - AZURE_CLIENT_SECRET: "azure_client_secret", - AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", - SUBSCRIPTION_ID: "azure_subscription_id" -}; - -const recorderOptions: RecorderStartOptions = { - envSetupForPlayback: replaceableVariables -}; - -export const testPollingOptions = { - updateIntervalInMs: isPlaybackMode() ? 0 : undefined, -}; - -describe("Monitor test", () => { - let recorder: Recorder; - let subscriptionId: string; - let client: MonitorClient; - let location: string; - let resourceGroup: string; - let workflowName: string; - let storageAccountName: string; - let namespaceName: string; - let authorizationRuleName: string; - let eventhubName: string; - let workspaceName: string; - let logProfileName: string; - let diagnosticName: string; - let logic_client: LogicManagementClient; - let storage_client: StorageManagementClient; - let eventhub_client: EventHubManagementClient; - let op_client: OperationalInsightsManagementClient; - let workflowsId: string; - let storageId: string; - let authorizationId: string; - let workspaceId: string; - let azureMonitorWorkspaceName: string; - - beforeEach(async function (this: Context) { - recorder = new Recorder(this.currentTest); - await recorder.start(recorderOptions); - subscriptionId = env.SUBSCRIPTION_ID || ''; - // This is an example of how the environment variables are used - const credential = createTestCredential(); - client = new MonitorClient(credential, subscriptionId, recorder.configureClientOptions({})); - logic_client = new LogicManagementClient(credential, subscriptionId, recorder.configureClientOptions({})); - storage_client = new StorageManagementClient(credential, subscriptionId, recorder.configureClientOptions({})); - eventhub_client = new EventHubManagementClient(credential, subscriptionId, recorder.configureClientOptions({})); - op_client = new OperationalInsightsManagementClient(credential, subscriptionId, recorder.configureClientOptions({})); - location = "eastus"; - resourceGroup = "myjstest"; - workflowName = "myworkflowxxx"; - storageAccountName = "mystorageaccountyyy"; - namespaceName = "mynamespacexxx"; - eventhubName = "myeventhubxxx"; - workspaceName = "myworkspacexxx"; - authorizationRuleName = "myauthorizationRulexxx"; - logProfileName = "mylogProfilexxx"; - diagnosticName = "mydiagnosticxxxx"; - azureMonitorWorkspaceName = "myAzureMonitorWorkspace" - }); - - afterEach(async function () { - await recorder.stop(); - }); - - it("create parameters for diagnosticSettings", async function () { - //workflows.createOrUpdate - const res = await logic_client.workflows.createOrUpdate(resourceGroup, workflowName, { - location: location, - definition: { - "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", - "contentVersion": "1.0.0.0", - "parameters": {}, - "triggers": {}, - "actions": {}, - "outputs": {} - } - }); - workflowsId = (res.id || "/").substring(1); - - //storageAccounts.beginCreateAndWait - const storageaccount = await storage_client.storageAccounts.beginCreateAndWait(resourceGroup, storageAccountName, { - sku: { - name: "Standard_GRS", - }, - kind: "StorageV2", - location: "eastus", - encryption: { - services: { - file: { - keyType: "Account", - enabled: true, - }, - blob: { - keyType: "Account", - enabled: true, - }, - }, - keySource: "Microsoft.Storage", - }, - tags: { - key1: "value1", - key2: "value2", - } - }, testPollingOptions); - 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", - } - }, testPollingOptions) - //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" - } - }, testPollingOptions) - workspaceId = workspace.id || ""; - }); - - it("diagnosticSettings create test", async function () { - const res = await client.diagnosticSettings.createOrUpdate(workflowsId, diagnosticName, { - storageAccountId: storageId, - workspaceId: workspaceId, - eventHubAuthorizationRuleId: authorizationId, - eventHubName: eventhubName, - metrics: [], - logs: [ - { - category: "WorkflowRuntime", - enabled: true, - retentionPolicy: { - enabled: false, - days: 0 - } - } - ] - }) - assert.equal(res.name, diagnosticName); - }); - - it("diagnosticSettings get test", async function () { - const res = await client.diagnosticSettings.get(workflowsId, diagnosticName); - assert.equal(res.name, diagnosticName); - }); - - it("diagnosticSettings list test", async function () { - const res = await client.diagnosticSettings.list(workflowsId); - }); - - it("diagnosticSettings delete test", async function () { - const res = await client.diagnosticSettings.delete(workflowsId, diagnosticName); - }); - - it("logProfiles create test", async function () { - //delete sample logfile - const resArray = new Array(); - for await (let item of client.logProfiles.list()) { - resArray.push(item); - } - if (resArray.length >= 1) { - await client.logProfiles.delete("sample-log-profile") - } - const res = await client.logProfiles.createOrUpdate(logProfileName, { - location: "", - locations: [ - "global" - ], - categories: [ - "Write", - "Delete", - "Action" - ], - retentionPolicy: { - enabled: true, - days: 3 - }, - storageAccountId: storageId - }) - assert.equal(res.name, logProfileName); - }); - - it("logProfiles get test", async function () { - const res = await client.logProfiles.get(logProfileName); - assert.equal(res.name, logProfileName); - }); - - it("logProfiles list test", async function () { - const resArray = new Array(); - for await (let item of client.logProfiles.list()) { - resArray.push(item); - } - assert.equal(resArray.length, 1); - }); - - it("workspace create test", async function () { - const res = await client.azureMonitorWorkspaces.create( - resourceGroup, - azureMonitorWorkspaceName, - { - location - }); - assert.equal(res.name, azureMonitorWorkspaceName); - }); - - it("workspace get test", async function () { - const res = await client.azureMonitorWorkspaces.get(resourceGroup, azureMonitorWorkspaceName); - assert.equal(res.name, azureMonitorWorkspaceName); - }); - - it("workspace list test", async function () { - const resArray = new Array(); - for await (let item of client.azureMonitorWorkspaces.listByResourceGroup(resourceGroup)) { - resArray.push(item); - } - assert.equal(resArray.length, 1); - }); - - it("workspace delete test", async function () { - const resArray = new Array(); - const res = await client.azureMonitorWorkspaces.delete(resourceGroup, azureMonitorWorkspaceName) - for await (let item of client.azureMonitorWorkspaces.listByResourceGroup(resourceGroup)) { - resArray.push(item); - } - assert.equal(resArray.length, 0); - }); - - it("delete parameters for diagnosticSettings", async function () { - const workflowDlete = await logic_client.workflows.delete(resourceGroup, workflowName); - const storageDelete = await storage_client.storageAccounts.delete(resourceGroup, storageAccountName); - const namespaceDelete = await eventhub_client.namespaces.beginDeleteAndWait(resourceGroup, namespaceName, testPollingOptions); - const workspaceDelete = await op_client.workspaces.beginDeleteAndWait(resourceGroup, workspaceName, testPollingOptions); - }); - - it("logProfiles delete test", async function () { - const res = await client.logProfiles.delete(logProfileName); - const resArray = new Array(); - for await (let item of client.logProfiles.list()) { - resArray.push(item); - } - assert.equal(resArray.length, 1); //still exist sample logfile - }); -}); diff --git a/sdk/monitor/arm-monitor/test/sampleTest.ts b/sdk/monitor/arm-monitor/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/monitor/arm-monitor/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/monitor/arm-monitor/tsconfig.json b/sdk/monitor/arm-monitor/tsconfig.json index 293df9ae64ce..3e6ae96443f3 100644 --- a/sdk/monitor/arm-monitor/tsconfig.json +++ b/sdk/monitor/arm-monitor/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-monitor": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"