diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index aed591ffa9d7..c1e39d596998 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -40,6 +40,7 @@ specifiers: '@rush-temp/arm-managedapplications': file:./projects/arm-managedapplications.tgz '@rush-temp/arm-managementgroups': file:./projects/arm-managementgroups.tgz '@rush-temp/arm-mediaservices': file:./projects/arm-mediaservices.tgz + '@rush-temp/arm-monitor': file:./projects/arm-monitor.tgz '@rush-temp/arm-mysql': file:./projects/arm-mysql.tgz '@rush-temp/arm-network': file:./projects/arm-network.tgz '@rush-temp/arm-notificationhubs': file:./projects/arm-notificationhubs.tgz @@ -209,6 +210,7 @@ dependencies: '@rush-temp/arm-managedapplications': file:projects/arm-managedapplications.tgz '@rush-temp/arm-managementgroups': file:projects/arm-managementgroups.tgz '@rush-temp/arm-mediaservices': file:projects/arm-mediaservices.tgz + '@rush-temp/arm-monitor': file:projects/arm-monitor.tgz '@rush-temp/arm-mysql': file:projects/arm-mysql.tgz '@rush-temp/arm-network': file:projects/arm-network.tgz '@rush-temp/arm-notificationhubs': file:projects/arm-notificationhubs.tgz @@ -1568,6 +1570,7 @@ packages: /@opentelemetry/node/0.22.0_@opentelemetry+api@1.0.3: resolution: {integrity: sha512-+HhGbDruQ7cwejVOIYyxRa28uosnG8W95NiQZ6qE8PXXPsDSyGeftAPbtYpGit0H2f5hrVcMlwmWHeAo9xkSLA==} engines: {node: '>=8.0.0'} + deprecated: Package renamed to @opentelemetry/sdk-trace-node peerDependencies: '@opentelemetry/api': ^1.0.0 dependencies: @@ -8828,6 +8831,27 @@ packages: uglify-js: 3.14.3 dev: false + file:projects/arm-monitor.tgz: + resolution: {integrity: sha512-h9sSF27PKmqDxF9ZPTwrf/LtsBpFWrztpIGPZhU99Fr6uS6UXKpxw+fE34TqW5PcTLuTjE4bEciOcV+eOGwKfQ==, tarball: file:projects/arm-monitor.tgz} + name: '@rush-temp/arm-monitor' + version: 0.0.0 + dependencies: + '@microsoft/api-extractor': 7.18.19 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + tslib: 2.3.1 + typescript: 4.2.4 + uglify-js: 3.14.3 + dev: false + file:projects/arm-mysql.tgz: resolution: {integrity: sha512-G1rIuwXFpp85iI0UUUZLh0SJ4QNNOyYsjqoqiO4wWiVMC20X/3dt6TYMzbvks2tCAZSGpMSDeIFgu59k0+J1Ug==, tarball: file:projects/arm-mysql.tgz} name: '@rush-temp/arm-mysql' diff --git a/rush.json b/rush.json index 0bdf615ba0d5..d4173419e17b 100644 --- a/rush.json +++ b/rush.json @@ -1,7 +1,7 @@ /** * This is the main configuration file for Rush. * For full documentation, please see https://rushjs.io - */ { + */{ "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json", /** * (Required) This specifies the version of the Rush engine to be used in this repo. @@ -1155,6 +1155,11 @@ "packageName": "@azure/arm-relay", "projectFolder": "sdk/relay/arm-relay", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-monitor", + "projectFolder": "sdk/monitor/arm-monitor", + "versionPolicyName": "management" } ] -} +} \ No newline at end of file diff --git a/sdk/monitor/arm-monitor/CHANGELOG.md b/sdk/monitor/arm-monitor/CHANGELOG.md new file mode 100644 index 000000000000..00313afad414 --- /dev/null +++ b/sdk/monitor/arm-monitor/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 7.0.0-beta.1 (2021-12-16) + +The package of @azure/arm-monitor is using our next generation design principles since version 7.0.0-beta.1, which contains breaking changes. + +To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). + +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/js-track2-quickstart). diff --git a/sdk/monitor/arm-monitor/LICENSE.txt b/sdk/monitor/arm-monitor/LICENSE similarity index 96% rename from sdk/monitor/arm-monitor/LICENSE.txt rename to sdk/monitor/arm-monitor/LICENSE index b73b4a1293c3..ccb63b166732 100644 --- a/sdk/monitor/arm-monitor/LICENSE.txt +++ b/sdk/monitor/arm-monitor/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2019 Microsoft +Copyright (c) 2021 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/sdk/monitor/arm-monitor/README.md b/sdk/monitor/arm-monitor/README.md index a79d520da9e0..8c86f13c0fd2 100644 --- a/sdk/monitor/arm-monitor/README.md +++ b/sdk/monitor/arm-monitor/README.md @@ -1,101 +1,98 @@ -## Azure MonitorManagementClient SDK for JavaScript +# Azure Monitor client library for JavaScript -This package contains an isomorphic SDK for MonitorManagementClient. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Monitor client. + +Monitor Management Client + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/monitor/arm-monitor) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-monitor) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-monitor) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-monitor` package -### How to Install +Install the Azure Monitor client library for JavaScript with `npm`: ```bash npm install @azure/arm-monitor ``` -### How to use +### Create and authenticate a `MonitorClient` -#### nodejs - Authentication, client creation and listByResourceGroup autoscaleSettings as an example written in TypeScript. +To create a client object to access the Azure Monitor API, you will need the `endpoint` of your Azure Monitor resource and a `credential`. The Azure Monitor client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure Monitor resource in the [Azure Portal][azure_portal]. -##### Install @azure/ms-rest-nodeauth +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: -- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. ```bash -npm install @azure/ms-rest-nodeauth@"^3.0.0" +npm install @azure/identity ``` -##### Sample code - -```typescript -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; -import { MonitorManagementClient, MonitorManagementModels, MonitorManagementMappers } from "@azure/arm-monitor"; -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -msRestNodeAuth.interactiveLogin().then((creds) => { - const client = new MonitorManagementClient(creds, subscriptionId); - const resourceGroupName = "testresourceGroupName"; - client.autoscaleSettings.listByResourceGroup(resourceGroupName).then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.error(err); -}); +You will also need to **register a new AAD application and grant access to Azure Monitor** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. + +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). + +```javascript +const { MonitorClient } = require("@azure/arm-monitor"); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new MonitorClient(new DefaultAzureCredential(), subscriptionId); ``` -#### browser - Authentication, client creation and listByResourceGroup autoscaleSettings as an example written in JavaScript. -##### Install @azure/ms-rest-browserauth +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). -```bash -npm install @azure/ms-rest-browserauth -``` +## Key concepts -##### Sample code - -See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. - -- index.html -```html - - - - @azure/arm-monitor sample - - - - - - - - +### MonitorClient + +`MonitorClient` is the primary interface for developers using the Azure Monitor client library. Explore the methods on this client object to understand the different features of the Azure Monitor service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); ``` +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + ## Related projects -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fmonitor%2Farm-monitor%2FREADME.png) + +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/monitor/arm-monitor/_meta.json b/sdk/monitor/arm-monitor/_meta.json new file mode 100644 index 000000000000..6d17be0b67b0 --- /dev/null +++ b/sdk/monitor/arm-monitor/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "b0f48ad950e29525d407607c336b549bcfb15333", + "readme": "specification/monitor/resource-manager/readme.md", + "autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/monitor/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20211130.1", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "use": "@autorest/typescript@6.0.0-alpha.16.20211130.1" +} \ No newline at end of file diff --git a/sdk/monitor/arm-monitor/api-extractor.json b/sdk/monitor/arm-monitor/api-extractor.json new file mode 100644 index 000000000000..fcc25e17568a --- /dev/null +++ b/sdk/monitor/arm-monitor/api-extractor.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { "enabled": true }, + "apiReport": { "enabled": true, "reportFolder": "./review" }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-monitor.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/monitor/arm-monitor/package.json b/sdk/monitor/arm-monitor/package.json index 2b40038fbd88..09d3d96afc38 100644 --- a/sdk/monitor/arm-monitor/package.json +++ b/sdk/monitor/arm-monitor/package.json @@ -1,57 +1,91 @@ { "name": "@azure/arm-monitor", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "MonitorManagementClient Library with typescript type definitions for node.js and browser.", - "version": "6.0.0", + "description": "A generated SDK for MonitorClient.", + "version": "7.0.0-beta.1", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^2.0.1", - "@azure/ms-rest-js": "^2.0.4", - "tslib": "^1.10.0" + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], "license": "MIT", - "main": "./dist/arm-monitor.js", - "module": "./esm/monitorManagementClient.js", - "types": "./esm/monitorManagementClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-monitor.d.ts", "devDependencies": { - "typescript": "^3.5.3", - "rollup": "^1.18.0", - "rollup-plugin-node-resolve": "^5.2.0", + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", - "uglify-js": "^3.6.0" + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/monitor/arm-monitor", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" }, - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, + "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", "dist/**/*.js.map", "dist/**/*.d.ts", "dist/**/*.d.ts.map", - "esm/**/*.js", - "esm/**/*.js.map", - "esm/**/*.d.ts", - "esm/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", "src/**/*.ts", "README.md", + "LICENSE", "rollup.config.js", - "tsconfig.json" + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" ], "scripts": { - "build": "tsc && rollup -c rollup.config.js && npm run minify", - "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-monitor.js.map'\" -o ./dist/arm-monitor.min.js ./dist/arm-monitor.js", - "prepack": "npm install && npm run build" + "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", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:browser": "echo skipped", + "docs": "echo skipped" }, "sideEffects": false, "autoPublish": true diff --git a/sdk/monitor/arm-monitor/review/arm-monitor.api.md b/sdk/monitor/arm-monitor/review/arm-monitor.api.md new file mode 100644 index 000000000000..d52a01ce9267 --- /dev/null +++ b/sdk/monitor/arm-monitor/review/arm-monitor.api.md @@ -0,0 +1,3110 @@ +## API Report File for "@azure/arm-monitor" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export interface Action { + odataType: "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction" | "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction"; +} + +// @public +export interface ActionDetail { + detail?: string; + mechanismType?: string; + name?: string; + sendTime?: string; + status?: string; + subState?: string; +} + +// @public +export interface ActionGroupList { + nextLink?: string; + value?: ActionGroupResource[]; +} + +// @public +export interface ActionGroupPatchBody { + enabled?: boolean; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type ActionGroupResource = AzureResource & { + groupShortName?: string; + enabled?: boolean; + emailReceivers?: EmailReceiver[]; + smsReceivers?: SmsReceiver[]; + webhookReceivers?: WebhookReceiver[]; + itsmReceivers?: ItsmReceiver[]; + azureAppPushReceivers?: AzureAppPushReceiver[]; + automationRunbookReceivers?: AutomationRunbookReceiver[]; + voiceReceivers?: VoiceReceiver[]; + logicAppReceivers?: LogicAppReceiver[]; + azureFunctionReceivers?: AzureFunctionReceiver[]; + armRoleReceivers?: ArmRoleReceiver[]; + eventHubReceivers?: EventHubReceiver[]; +}; + +// @public +export interface ActionGroups { + 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; + listByResourceGroup(resourceGroupName: string, options?: ActionGroupsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscriptionId(options?: ActionGroupsListBySubscriptionIdOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, actionGroupName: string, actionGroupPatch: ActionGroupPatchBody, options?: ActionGroupsUpdateOptionalParams): Promise; +} + +// @public +export interface ActionGroupsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ActionGroupsCreateOrUpdateResponse = ActionGroupResource; + +// @public +export interface ActionGroupsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ActionGroupsEnableReceiverOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ActionGroupsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ActionGroupsGetResponse = ActionGroupResource; + +// @public +export interface ActionGroupsGetTestNotificationsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ActionGroupsGetTestNotificationsResponse = TestNotificationDetailsResponse; + +// @public +export interface ActionGroupsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ActionGroupsListByResourceGroupResponse = ActionGroupList; + +// @public +export interface ActionGroupsListBySubscriptionIdOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ActionGroupsListBySubscriptionIdResponse = ActionGroupList; + +// @public +export interface ActionGroupsPostTestNotificationsOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ActionGroupsPostTestNotificationsResponse = TestNotificationResponse; + +// @public +export interface ActionGroupsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ActionGroupsUpdateResponse = ActionGroupResource; + +// @public (undocumented) +export type ActionUnion = Action | AlertingAction | LogToMetricAction; + +// @public +export interface ActivityLogAlertActionGroup { + actionGroupId: string; + webhookProperties?: { + [propertyName: string]: string; + }; +} + +// @public +export interface ActivityLogAlertActionList { + actionGroups?: ActivityLogAlertActionGroup[]; +} + +// @public +export interface ActivityLogAlertAllOfCondition { + allOf: ActivityLogAlertLeafCondition[]; +} + +// @public +export interface ActivityLogAlertLeafCondition { + equals: string; + field: string; +} + +// @public +export interface ActivityLogAlertList { + nextLink?: string; + value?: ActivityLogAlertResource[]; +} + +// @public +export interface ActivityLogAlertPatchBody { + enabled?: boolean; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type ActivityLogAlertResource = Resource & { + scopes?: string[]; + enabled?: boolean; + condition?: ActivityLogAlertAllOfCondition; + actions?: ActivityLogAlertActionList; + description?: string; +}; + +// @public +export interface ActivityLogAlerts { + createOrUpdate(resourceGroupName: string, activityLogAlertName: string, activityLogAlert: ActivityLogAlertResource, options?: ActivityLogAlertsCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, activityLogAlertName: string, options?: ActivityLogAlertsDeleteOptionalParams): Promise; + get(resourceGroupName: string, activityLogAlertName: string, options?: ActivityLogAlertsGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: ActivityLogAlertsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscriptionId(options?: ActivityLogAlertsListBySubscriptionIdOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, activityLogAlertName: string, activityLogAlertPatch: ActivityLogAlertPatchBody, options?: ActivityLogAlertsUpdateOptionalParams): Promise; +} + +// @public +export interface ActivityLogAlertsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ActivityLogAlertsCreateOrUpdateResponse = ActivityLogAlertResource; + +// @public +export interface ActivityLogAlertsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ActivityLogAlertsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ActivityLogAlertsGetResponse = ActivityLogAlertResource; + +// @public +export interface ActivityLogAlertsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ActivityLogAlertsListByResourceGroupResponse = ActivityLogAlertList; + +// @public +export interface ActivityLogAlertsListBySubscriptionIdOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ActivityLogAlertsListBySubscriptionIdResponse = ActivityLogAlertList; + +// @public +export interface ActivityLogAlertsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ActivityLogAlertsUpdateResponse = ActivityLogAlertResource; + +// @public +export interface ActivityLogs { + list(filter: string, options?: ActivityLogsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ActivityLogsListNextOptionalParams extends coreClient.OperationOptions { + select?: string; +} + +// @public +export type ActivityLogsListNextResponse = EventDataCollection; + +// @public +export interface ActivityLogsListOptionalParams extends coreClient.OperationOptions { + select?: string; +} + +// @public +export type ActivityLogsListResponse = EventDataCollection; + +// @public +export type AggregationType = "None" | "Average" | "Count" | "Minimum" | "Maximum" | "Total"; + +// @public +export type AggregationTypeEnum = string; + +// @public +export type AlertingAction = Action & { + odataType: "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction"; + severity: AlertSeverity; + aznsAction?: AzNsActionGroup; + throttlingInMin?: number; + trigger: TriggerCondition; +}; + +// @public +export interface AlertRuleIncidents { + get(resourceGroupName: string, ruleName: string, incidentName: string, options?: AlertRuleIncidentsGetOptionalParams): Promise; + listByAlertRule(resourceGroupName: string, ruleName: string, options?: AlertRuleIncidentsListByAlertRuleOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface AlertRuleIncidentsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AlertRuleIncidentsGetResponse = Incident; + +// @public +export interface AlertRuleIncidentsListByAlertRuleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AlertRuleIncidentsListByAlertRuleResponse = IncidentListResult; + +// @public +export type AlertRuleResource = Resource & { + namePropertiesName: string; + description?: string; + provisioningState?: string; + isEnabled: boolean; + condition: RuleConditionUnion; + action?: RuleActionUnion; + actions?: RuleActionUnion[]; + readonly lastUpdatedTime?: Date; +}; + +// @public +export interface AlertRuleResourceCollection { + value?: AlertRuleResource[]; +} + +// @public +export interface AlertRuleResourcePatch { + action?: RuleActionUnion; + actions?: RuleActionUnion[]; + condition?: RuleConditionUnion; + description?: string; + isEnabled?: boolean; + readonly lastUpdatedTime?: Date; + name?: string; + provisioningState?: string; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface AlertRules { + createOrUpdate(resourceGroupName: string, ruleName: string, parameters: AlertRuleResource, options?: AlertRulesCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, ruleName: string, options?: AlertRulesDeleteOptionalParams): Promise; + get(resourceGroupName: string, ruleName: string, options?: AlertRulesGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: AlertRulesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: AlertRulesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, ruleName: string, alertRulesResource: AlertRuleResourcePatch, options?: AlertRulesUpdateOptionalParams): Promise; +} + +// @public +export interface AlertRulesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AlertRulesCreateOrUpdateResponse = AlertRuleResource; + +// @public +export interface AlertRulesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface AlertRulesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AlertRulesGetResponse = AlertRuleResource; + +// @public +export interface AlertRulesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AlertRulesListByResourceGroupResponse = AlertRuleResourceCollection; + +// @public +export interface AlertRulesListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AlertRulesListBySubscriptionResponse = AlertRuleResourceCollection; + +// @public +export interface AlertRulesUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AlertRulesUpdateResponse = AlertRuleResource; + +// @public +export type AlertSeverity = string; + +// @public +export interface ArmRoleReceiver { + name: string; + roleId: string; + useCommonAlertSchema?: boolean; +} + +// @public +export interface AutomationRunbookReceiver { + automationAccountId: string; + isGlobalRunbook: boolean; + name?: string; + runbookName: string; + serviceUri?: string; + useCommonAlertSchema?: boolean; + webhookResourceId: string; +} + +// @public +export interface AutoscaleNotification { + email?: EmailNotification; + operation: "Scale"; + webhooks?: WebhookNotification[]; +} + +// @public +export interface AutoscaleProfile { + capacity: ScaleCapacity; + fixedDate?: TimeWindow; + name: string; + recurrence?: Recurrence; + rules: ScaleRule[]; +} + +// @public +export type AutoscaleSettingResource = Resource & { + profiles: AutoscaleProfile[]; + notifications?: AutoscaleNotification[]; + enabled?: boolean; + namePropertiesName?: string; + targetResourceUri?: string; + targetResourceLocation?: string; +}; + +// @public +export interface AutoscaleSettingResourceCollection { + nextLink?: string; + value: AutoscaleSettingResource[]; +} + +// @public +export interface AutoscaleSettingResourcePatch { + enabled?: boolean; + name?: string; + notifications?: AutoscaleNotification[]; + profiles?: AutoscaleProfile[]; + tags?: { + [propertyName: string]: string; + }; + targetResourceLocation?: string; + targetResourceUri?: string; +} + +// @public +export interface AutoscaleSettings { + createOrUpdate(resourceGroupName: string, autoscaleSettingName: string, parameters: AutoscaleSettingResource, options?: AutoscaleSettingsCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, autoscaleSettingName: string, options?: AutoscaleSettingsDeleteOptionalParams): Promise; + get(resourceGroupName: string, autoscaleSettingName: string, options?: AutoscaleSettingsGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: AutoscaleSettingsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: AutoscaleSettingsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, autoscaleSettingName: string, autoscaleSettingResource: AutoscaleSettingResourcePatch, options?: AutoscaleSettingsUpdateOptionalParams): Promise; +} + +// @public +export interface AutoscaleSettingsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AutoscaleSettingsCreateOrUpdateResponse = AutoscaleSettingResource; + +// @public +export interface AutoscaleSettingsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface AutoscaleSettingsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AutoscaleSettingsGetResponse = AutoscaleSettingResource; + +// @public +export interface AutoscaleSettingsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AutoscaleSettingsListByResourceGroupNextResponse = AutoscaleSettingResourceCollection; + +// @public +export interface AutoscaleSettingsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AutoscaleSettingsListByResourceGroupResponse = AutoscaleSettingResourceCollection; + +// @public +export interface AutoscaleSettingsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AutoscaleSettingsListBySubscriptionNextResponse = AutoscaleSettingResourceCollection; + +// @public +export interface AutoscaleSettingsListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AutoscaleSettingsListBySubscriptionResponse = AutoscaleSettingResourceCollection; + +// @public +export interface AutoscaleSettingsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AutoscaleSettingsUpdateResponse = AutoscaleSettingResource; + +// @public +export interface AzNsActionGroup { + actionGroup?: string[]; + customWebhookPayload?: string; + emailSubject?: string; +} + +// @public +export interface AzureAppPushReceiver { + emailAddress: string; + name: string; +} + +// @public +export interface AzureFunctionReceiver { + functionAppResourceId: string; + functionName: string; + httpTriggerUrl: string; + name: string; + useCommonAlertSchema?: boolean; +} + +// @public +export interface AzureMonitorMetricsDestination { + name?: string; +} + +// @public +export type AzureMonitorPrivateLinkScope = PrivateLinkScopesResource & { + readonly provisioningState?: string; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; +}; + +// @public +export interface AzureMonitorPrivateLinkScopeListResult { + nextLink?: string; + value: AzureMonitorPrivateLinkScope[]; +} + +// @public +export interface AzureResource { + readonly id?: string; + readonly identity?: string; + readonly kind?: string; + location: string; + readonly name?: string; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export interface BaselineMetadata { + name: string; + value: string; +} + +// @public +export interface Baselines { + list(resourceUri: string, options?: BaselinesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export type BaselineSensitivity = string; + +// @public +export interface BaselinesListOptionalParams extends coreClient.OperationOptions { + aggregation?: string; + filter?: string; + interval?: string; + metricnames?: string; + metricnamespace?: string; + resultType?: ResultType; + sensitivities?: string; + timespan?: string; +} + +// @public +export type BaselinesListResponse = MetricBaselinesResponse; + +// @public +export type CategoryType = "Metrics" | "Logs"; + +// @public +export type ComparisonOperationType = "Equals" | "NotEquals" | "GreaterThan" | "GreaterThanOrEqual" | "LessThan" | "LessThanOrEqual"; + +// @public +export type ConditionalOperator = string; + +// @public +export type ConditionOperator = "GreaterThan" | "GreaterThanOrEqual" | "LessThan" | "LessThanOrEqual"; + +// @public +export interface ConfigurationAccessEndpointSpec { + readonly endpoint?: string; +} + +// @public +export interface Context { + contextType?: string; + notificationSource?: string; +} + +// @public +export type CreatedByType = string; + +// @public +export interface Criteria { + dimensions?: Dimension[]; + metricName: string; +} + +// @public +export type CriterionType = string; + +// @public +export interface DataCollectionEndpoint { + configurationAccess?: DataCollectionEndpointConfigurationAccess; + description?: string; + immutableId?: string; + logsIngestion?: DataCollectionEndpointLogsIngestion; + networkAcls?: DataCollectionEndpointNetworkAcls; + readonly provisioningState?: KnownDataCollectionEndpointProvisioningState; +} + +// @public +export type DataCollectionEndpointConfigurationAccess = ConfigurationAccessEndpointSpec & {}; + +// @public +export type DataCollectionEndpointLogsIngestion = LogsIngestionEndpointSpec & {}; + +// @public +export type DataCollectionEndpointNetworkAcls = NetworkRuleSet & {}; + +// @public +export interface DataCollectionEndpointResource { + configurationAccess?: DataCollectionEndpointConfigurationAccess; + description?: string; + readonly etag?: string; + readonly id?: string; + immutableId?: string; + kind?: KnownDataCollectionEndpointResourceKind; + location: string; + logsIngestion?: DataCollectionEndpointLogsIngestion; + readonly name?: string; + networkAcls?: DataCollectionEndpointNetworkAcls; + readonly provisioningState?: KnownDataCollectionEndpointProvisioningState; + readonly systemData?: DataCollectionEndpointResourceSystemData; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export interface DataCollectionEndpointResourceListResult { + nextLink?: string; + value: DataCollectionEndpointResource[]; +} + +// @public +export type DataCollectionEndpointResourceProperties = DataCollectionEndpoint & {}; + +// @public +export type DataCollectionEndpointResourceSystemData = SystemData & {}; + +// @public +export interface DataCollectionEndpoints { + create(resourceGroupName: string, dataCollectionEndpointName: string, options?: DataCollectionEndpointsCreateOptionalParams): Promise; + delete(resourceGroupName: string, dataCollectionEndpointName: string, options?: DataCollectionEndpointsDeleteOptionalParams): Promise; + get(resourceGroupName: string, dataCollectionEndpointName: string, options?: DataCollectionEndpointsGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: DataCollectionEndpointsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: DataCollectionEndpointsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, dataCollectionEndpointName: string, options?: DataCollectionEndpointsUpdateOptionalParams): Promise; +} + +// @public +export interface DataCollectionEndpointsCreateOptionalParams extends coreClient.OperationOptions { + body?: DataCollectionEndpointResource; +} + +// @public +export type DataCollectionEndpointsCreateResponse = DataCollectionEndpointResource; + +// @public +export interface DataCollectionEndpointsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface DataCollectionEndpointsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataCollectionEndpointsGetResponse = DataCollectionEndpointResource; + +// @public +export interface DataCollectionEndpointsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataCollectionEndpointsListByResourceGroupNextResponse = DataCollectionEndpointResourceListResult; + +// @public +export interface DataCollectionEndpointsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataCollectionEndpointsListByResourceGroupResponse = DataCollectionEndpointResourceListResult; + +// @public +export interface DataCollectionEndpointsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataCollectionEndpointsListBySubscriptionNextResponse = DataCollectionEndpointResourceListResult; + +// @public +export interface DataCollectionEndpointsListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataCollectionEndpointsListBySubscriptionResponse = DataCollectionEndpointResourceListResult; + +// @public +export interface DataCollectionEndpointsUpdateOptionalParams extends coreClient.OperationOptions { + body?: ResourceForUpdate; +} + +// @public +export type DataCollectionEndpointsUpdateResponse = DataCollectionEndpointResource; + +// @public +export interface DataCollectionRule { + dataFlows?: DataFlow[]; + dataSources?: DataCollectionRuleDataSources; + description?: string; + destinations?: DataCollectionRuleDestinations; + readonly immutableId?: string; + readonly provisioningState?: KnownDataCollectionRuleProvisioningState; +} + +// @public +export interface DataCollectionRuleAssociation { + dataCollectionEndpointId?: string; + dataCollectionRuleId?: string; + description?: string; + readonly provisioningState?: KnownDataCollectionRuleAssociationProvisioningState; +} + +// @public +export interface DataCollectionRuleAssociationProxyOnlyResource { + dataCollectionEndpointId?: string; + dataCollectionRuleId?: string; + description?: string; + readonly etag?: string; + readonly id?: string; + readonly name?: string; + readonly provisioningState?: KnownDataCollectionRuleAssociationProvisioningState; + readonly systemData?: DataCollectionRuleAssociationProxyOnlyResourceSystemData; + readonly type?: string; +} + +// @public +export interface DataCollectionRuleAssociationProxyOnlyResourceListResult { + nextLink?: string; + value: DataCollectionRuleAssociationProxyOnlyResource[]; +} + +// @public +export type DataCollectionRuleAssociationProxyOnlyResourceProperties = DataCollectionRuleAssociation & {}; + +// @public +export type DataCollectionRuleAssociationProxyOnlyResourceSystemData = SystemData & {}; + +// @public +export interface DataCollectionRuleAssociations { + create(resourceUri: string, associationName: string, options?: DataCollectionRuleAssociationsCreateOptionalParams): Promise; + delete(resourceUri: string, associationName: string, options?: DataCollectionRuleAssociationsDeleteOptionalParams): Promise; + get(resourceUri: string, associationName: string, options?: DataCollectionRuleAssociationsGetOptionalParams): Promise; + listByResource(resourceUri: string, options?: DataCollectionRuleAssociationsListByResourceOptionalParams): PagedAsyncIterableIterator; + listByRule(resourceGroupName: string, dataCollectionRuleName: string, options?: DataCollectionRuleAssociationsListByRuleOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface DataCollectionRuleAssociationsCreateOptionalParams extends coreClient.OperationOptions { + body?: DataCollectionRuleAssociationProxyOnlyResource; +} + +// @public +export type DataCollectionRuleAssociationsCreateResponse = DataCollectionRuleAssociationProxyOnlyResource; + +// @public +export interface DataCollectionRuleAssociationsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface DataCollectionRuleAssociationsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataCollectionRuleAssociationsGetResponse = DataCollectionRuleAssociationProxyOnlyResource; + +// @public +export interface DataCollectionRuleAssociationsListByResourceNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataCollectionRuleAssociationsListByResourceNextResponse = DataCollectionRuleAssociationProxyOnlyResourceListResult; + +// @public +export interface DataCollectionRuleAssociationsListByResourceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataCollectionRuleAssociationsListByResourceResponse = DataCollectionRuleAssociationProxyOnlyResourceListResult; + +// @public +export interface DataCollectionRuleAssociationsListByRuleNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataCollectionRuleAssociationsListByRuleNextResponse = DataCollectionRuleAssociationProxyOnlyResourceListResult; + +// @public +export interface DataCollectionRuleAssociationsListByRuleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataCollectionRuleAssociationsListByRuleResponse = DataCollectionRuleAssociationProxyOnlyResourceListResult; + +// @public +export type DataCollectionRuleDataSources = DataSourcesSpec & {}; + +// @public +export type DataCollectionRuleDestinations = DestinationsSpec & {}; + +// @public +export interface DataCollectionRuleResource { + dataFlows?: DataFlow[]; + dataSources?: DataCollectionRuleDataSources; + description?: string; + destinations?: DataCollectionRuleDestinations; + readonly etag?: string; + readonly id?: string; + readonly immutableId?: string; + kind?: KnownDataCollectionRuleResourceKind; + location: string; + readonly name?: string; + readonly provisioningState?: KnownDataCollectionRuleProvisioningState; + readonly systemData?: DataCollectionRuleResourceSystemData; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export interface DataCollectionRuleResourceListResult { + nextLink?: string; + value: DataCollectionRuleResource[]; +} + +// @public +export type DataCollectionRuleResourceProperties = DataCollectionRule & {}; + +// @public +export type DataCollectionRuleResourceSystemData = SystemData & {}; + +// @public +export interface DataCollectionRules { + create(resourceGroupName: string, dataCollectionRuleName: string, options?: DataCollectionRulesCreateOptionalParams): Promise; + delete(resourceGroupName: string, dataCollectionRuleName: string, options?: DataCollectionRulesDeleteOptionalParams): Promise; + get(resourceGroupName: string, dataCollectionRuleName: string, options?: DataCollectionRulesGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: DataCollectionRulesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: DataCollectionRulesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, dataCollectionRuleName: string, options?: DataCollectionRulesUpdateOptionalParams): Promise; +} + +// @public +export interface DataCollectionRulesCreateOptionalParams extends coreClient.OperationOptions { + body?: DataCollectionRuleResource; +} + +// @public +export type DataCollectionRulesCreateResponse = DataCollectionRuleResource; + +// @public +export interface DataCollectionRulesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface DataCollectionRulesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataCollectionRulesGetResponse = DataCollectionRuleResource; + +// @public +export interface DataCollectionRulesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataCollectionRulesListByResourceGroupNextResponse = DataCollectionRuleResourceListResult; + +// @public +export interface DataCollectionRulesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataCollectionRulesListByResourceGroupResponse = DataCollectionRuleResourceListResult; + +// @public +export interface DataCollectionRulesListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataCollectionRulesListBySubscriptionNextResponse = DataCollectionRuleResourceListResult; + +// @public +export interface DataCollectionRulesListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataCollectionRulesListBySubscriptionResponse = DataCollectionRuleResourceListResult; + +// @public +export interface DataCollectionRulesUpdateOptionalParams extends coreClient.OperationOptions { + body?: ResourceForUpdate; +} + +// @public +export type DataCollectionRulesUpdateResponse = DataCollectionRuleResource; + +// @public +export interface DataContainer { + workspace: WorkspaceInfo; +} + +// @public +export interface DataFlow { + destinations?: string[]; + streams?: KnownDataFlowStreams[]; +} + +// @public +export interface DataSourcesSpec { + extensions?: ExtensionDataSource[]; + performanceCounters?: PerfCounterDataSource[]; + syslog?: SyslogDataSource[]; + windowsEventLogs?: WindowsEventLogDataSource[]; +} + +// @public +export type DataStatus = string; + +// @public +export interface DestinationsSpec { + azureMonitorMetrics?: DestinationsSpecAzureMonitorMetrics; + logAnalytics?: LogAnalyticsDestination[]; +} + +// @public +export type DestinationsSpecAzureMonitorMetrics = AzureMonitorMetricsDestination & {}; + +// @public +export interface DiagnosticSettings { + createOrUpdate(resourceUri: string, name: string, parameters: DiagnosticSettingsResource, options?: DiagnosticSettingsCreateOrUpdateOptionalParams): Promise; + delete(resourceUri: string, name: string, options?: DiagnosticSettingsDeleteOptionalParams): Promise; + get(resourceUri: string, name: string, options?: DiagnosticSettingsGetOptionalParams): Promise; + list(resourceUri: string, options?: DiagnosticSettingsListOptionalParams): Promise; +} + +// @public +export interface DiagnosticSettingsCategory { + get(resourceUri: string, name: string, options?: DiagnosticSettingsCategoryGetOptionalParams): Promise; + list(resourceUri: string, options?: DiagnosticSettingsCategoryListOptionalParams): Promise; +} + +// @public +export interface DiagnosticSettingsCategoryGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DiagnosticSettingsCategoryGetResponse = DiagnosticSettingsCategoryResource; + +// @public +export interface DiagnosticSettingsCategoryListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DiagnosticSettingsCategoryListResponse = DiagnosticSettingsCategoryResourceCollection; + +// @public +export type DiagnosticSettingsCategoryResource = ProxyOnlyResource & { + categoryType?: CategoryType; +}; + +// @public +export interface DiagnosticSettingsCategoryResourceCollection { + value?: DiagnosticSettingsCategoryResource[]; +} + +// @public +export interface DiagnosticSettingsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DiagnosticSettingsCreateOrUpdateResponse = DiagnosticSettingsResource; + +// @public +export interface DiagnosticSettingsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface DiagnosticSettingsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DiagnosticSettingsGetResponse = DiagnosticSettingsResource; + +// @public +export interface DiagnosticSettingsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DiagnosticSettingsListResponse = DiagnosticSettingsResourceCollection; + +// @public +export type DiagnosticSettingsResource = ProxyOnlyResource & { + storageAccountId?: string; + serviceBusRuleId?: string; + eventHubAuthorizationRuleId?: string; + eventHubName?: string; + metrics?: MetricSettings[]; + logs?: LogSettings[]; + workspaceId?: string; + logAnalyticsDestinationType?: string; +}; + +// @public +export interface DiagnosticSettingsResourceCollection { + value?: DiagnosticSettingsResource[]; +} + +// @public +export interface Dimension { + name: string; + operator: Operator; + values: string[]; +} + +// @public +export type DynamicMetricCriteria = MultiMetricCriteria & { + criterionType: "DynamicThresholdCriterion"; + operator: DynamicThresholdOperator; + alertSensitivity: DynamicThresholdSensitivity; + failingPeriods: DynamicThresholdFailingPeriods; + ignoreDataBefore?: Date; +}; + +// @public +export interface DynamicThresholdFailingPeriods { + minFailingPeriodsToAlert: number; + numberOfEvaluationPeriods: number; +} + +// @public +export type DynamicThresholdOperator = string; + +// @public +export type DynamicThresholdSensitivity = string; + +// @public +export interface EmailNotification { + customEmails?: string[]; + sendToSubscriptionAdministrator?: boolean; + sendToSubscriptionCoAdministrators?: boolean; +} + +// @public +export interface EmailReceiver { + emailAddress: string; + name: string; + readonly status?: ReceiverStatus; + useCommonAlertSchema?: boolean; +} + +// @public +export type Enabled = string; + +// @public +export interface EnableRequest { + receiverName: string; +} + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorContract { + error?: ErrorResponse; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorModel { + code: string; + message?: string; +} + +// @public +export interface ErrorResponse { + code?: string; + message?: string; +} + +// @public +export type ErrorResponseCommon = ErrorResponse & { + readonly details?: ErrorResponseCommon[]; + readonly additionalInfo?: ErrorAdditionalInfo[]; +}; + +// @public +export interface ErrorResponseCommonV2 { + error?: ErrorDetail; +} + +// @public +export interface EventCategories { + list(options?: EventCategoriesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface EventCategoriesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EventCategoriesListResponse = EventCategoryCollection; + +// @public +export interface EventCategoryCollection { + value: LocalizableString[]; +} + +// @public +export interface EventData { + readonly authorization?: SenderAuthorization; + readonly caller?: string; + readonly category?: LocalizableString; + readonly claims?: { + [propertyName: string]: string; + }; + readonly correlationId?: string; + readonly description?: string; + readonly eventDataId?: string; + readonly eventName?: LocalizableString; + readonly eventTimestamp?: Date; + readonly httpRequest?: HttpRequestInfo; + readonly id?: string; + readonly level?: EventLevel; + readonly operationId?: string; + readonly operationName?: LocalizableString; + readonly properties?: { + [propertyName: string]: string; + }; + readonly resourceGroupName?: string; + readonly resourceId?: string; + readonly resourceProviderName?: LocalizableString; + readonly resourceType?: LocalizableString; + readonly status?: LocalizableString; + readonly submissionTimestamp?: Date; + readonly subscriptionId?: string; + readonly subStatus?: LocalizableString; + readonly tenantId?: string; +} + +// @public +export interface EventDataCollection { + nextLink?: string; + value: EventData[]; +} + +// @public +export interface EventHubReceiver { + eventHubName: string; + eventHubNameSpace: string; + name: string; + subscriptionId: string; + tenantId?: string; + useCommonAlertSchema?: boolean; +} + +// @public +export type EventLevel = "Critical" | "Error" | "Warning" | "Informational" | "Verbose"; + +// @public +export interface ExtensionDataSource { + extensionName: string; + extensionSettings?: Record; + inputDataSources?: string[]; + name?: string; + streams?: KnownExtensionDataSourceStreams[]; +} + +// @public +export interface HttpRequestInfo { + clientIpAddress?: string; + clientRequestId?: string; + method?: string; + uri?: string; +} + +// @public +export interface Incident { + readonly activatedTime?: Date; + readonly isActive?: boolean; + readonly name?: string; + readonly resolvedTime?: Date; + readonly ruleName?: string; +} + +// @public +export interface IncidentListResult { + value?: Incident[]; +} + +// @public +export interface ItsmReceiver { + connectionId: string; + name: string; + region: string; + ticketConfiguration: string; + workspaceId: string; +} + +// @public +export enum KnownAggregationTypeEnum { + // (undocumented) + Average = "Average", + // (undocumented) + Count = "Count", + // (undocumented) + Maximum = "Maximum", + // (undocumented) + Minimum = "Minimum", + // (undocumented) + Total = "Total" +} + +// @public +export enum KnownAlertSeverity { + // (undocumented) + Four = "4", + // (undocumented) + One = "1", + // (undocumented) + Three = "3", + // (undocumented) + Two = "2", + // (undocumented) + Zero = "0" +} + +// @public +export enum KnownBaselineSensitivity { + // (undocumented) + High = "High", + // (undocumented) + Low = "Low", + // (undocumented) + Medium = "Medium" +} + +// @public +export enum KnownConditionalOperator { + // (undocumented) + Equal = "Equal", + // (undocumented) + GreaterThan = "GreaterThan", + // (undocumented) + GreaterThanOrEqual = "GreaterThanOrEqual", + // (undocumented) + LessThan = "LessThan", + // (undocumented) + LessThanOrEqual = "LessThanOrEqual" +} + +// @public +export enum KnownCreatedByType { + // (undocumented) + Application = "Application", + // (undocumented) + Key = "Key", + // (undocumented) + ManagedIdentity = "ManagedIdentity", + // (undocumented) + User = "User" +} + +// @public +export enum KnownCriterionType { + // (undocumented) + DynamicThresholdCriterion = "DynamicThresholdCriterion", + // (undocumented) + StaticThresholdCriterion = "StaticThresholdCriterion" +} + +// @public +export type KnownDataCollectionEndpointProvisioningState = string; + +// @public +export type KnownDataCollectionEndpointResourceKind = string; + +// @public +export type KnownDataCollectionRuleAssociationProvisioningState = string; + +// @public +export type KnownDataCollectionRuleProvisioningState = string; + +// @public +export type KnownDataCollectionRuleResourceKind = string; + +// @public +export type KnownDataFlowStreams = string; + +// @public +export enum KnownDataStatus { + // (undocumented) + NotPresent = "notPresent", + // (undocumented) + Present = "present" +} + +// @public +export enum KnownDynamicThresholdOperator { + // (undocumented) + GreaterOrLessThan = "GreaterOrLessThan", + // (undocumented) + GreaterThan = "GreaterThan", + // (undocumented) + LessThan = "LessThan" +} + +// @public +export enum KnownDynamicThresholdSensitivity { + // (undocumented) + High = "High", + // (undocumented) + Low = "Low", + // (undocumented) + Medium = "Medium" +} + +// @public +export enum KnownEnabled { + // (undocumented) + False = "false", + // (undocumented) + True = "true" +} + +// @public +export type KnownExtensionDataSourceStreams = string; + +// @public +export enum KnownKnownDataCollectionEndpointProvisioningState { + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Updating = "Updating" +} + +// @public +export enum KnownKnownDataCollectionEndpointResourceKind { + // (undocumented) + Linux = "Linux", + // (undocumented) + Windows = "Windows" +} + +// @public +export enum KnownKnownDataCollectionRuleAssociationProvisioningState { + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Updating = "Updating" +} + +// @public +export enum KnownKnownDataCollectionRuleProvisioningState { + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Updating = "Updating" +} + +// @public +export enum KnownKnownDataCollectionRuleResourceKind { + // (undocumented) + Linux = "Linux", + // (undocumented) + Windows = "Windows" +} + +// @public +export enum KnownKnownDataFlowStreams { + // (undocumented) + MicrosoftEvent = "Microsoft-Event", + // (undocumented) + MicrosoftInsightsMetrics = "Microsoft-InsightsMetrics", + // (undocumented) + MicrosoftPerf = "Microsoft-Perf", + // (undocumented) + MicrosoftSyslog = "Microsoft-Syslog", + // (undocumented) + MicrosoftWindowsEvent = "Microsoft-WindowsEvent" +} + +// @public +export enum KnownKnownExtensionDataSourceStreams { + // (undocumented) + MicrosoftEvent = "Microsoft-Event", + // (undocumented) + MicrosoftInsightsMetrics = "Microsoft-InsightsMetrics", + // (undocumented) + MicrosoftPerf = "Microsoft-Perf", + // (undocumented) + MicrosoftSyslog = "Microsoft-Syslog", + // (undocumented) + MicrosoftWindowsEvent = "Microsoft-WindowsEvent" +} + +// @public +export enum KnownKnownPerfCounterDataSourceStreams { + // (undocumented) + MicrosoftInsightsMetrics = "Microsoft-InsightsMetrics", + // (undocumented) + MicrosoftPerf = "Microsoft-Perf" +} + +// @public +export enum KnownKnownPublicNetworkAccessOptions { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled" +} + +// @public +export enum KnownKnownSyslogDataSourceFacilityNames { + // (undocumented) + Asterisk = "*", + // (undocumented) + Auth = "auth", + // (undocumented) + Authpriv = "authpriv", + // (undocumented) + Cron = "cron", + // (undocumented) + Daemon = "daemon", + // (undocumented) + Kern = "kern", + // (undocumented) + Local0 = "local0", + // (undocumented) + Local1 = "local1", + // (undocumented) + Local2 = "local2", + // (undocumented) + Local3 = "local3", + // (undocumented) + Local4 = "local4", + // (undocumented) + Local5 = "local5", + // (undocumented) + Local6 = "local6", + // (undocumented) + Local7 = "local7", + // (undocumented) + Lpr = "lpr", + // (undocumented) + Mail = "mail", + // (undocumented) + Mark = "mark", + // (undocumented) + News = "news", + // (undocumented) + Syslog = "syslog", + // (undocumented) + User = "user", + // (undocumented) + Uucp = "uucp" +} + +// @public +export enum KnownKnownSyslogDataSourceLogLevels { + // (undocumented) + Alert = "Alert", + // (undocumented) + Asterisk = "*", + // (undocumented) + Critical = "Critical", + // (undocumented) + Debug = "Debug", + // (undocumented) + Emergency = "Emergency", + // (undocumented) + Error = "Error", + // (undocumented) + Info = "Info", + // (undocumented) + Notice = "Notice", + // (undocumented) + Warning = "Warning" +} + +// @public +export enum KnownKnownSyslogDataSourceStreams { + // (undocumented) + MicrosoftSyslog = "Microsoft-Syslog" +} + +// @public +export enum KnownKnownWindowsEventLogDataSourceStreams { + // (undocumented) + MicrosoftEvent = "Microsoft-Event", + // (undocumented) + MicrosoftWindowsEvent = "Microsoft-WindowsEvent" +} + +// @public +export enum KnownMetricClass { + // (undocumented) + Availability = "Availability", + // (undocumented) + Errors = "Errors", + // (undocumented) + Latency = "Latency", + // (undocumented) + Saturation = "Saturation", + // (undocumented) + Transactions = "Transactions" +} + +// @public +export enum KnownMetricTriggerType { + // (undocumented) + Consecutive = "Consecutive", + // (undocumented) + Total = "Total" +} + +// @public +export enum KnownMetricUnit { + // (undocumented) + BitsPerSecond = "BitsPerSecond", + // (undocumented) + Bytes = "Bytes", + // (undocumented) + ByteSeconds = "ByteSeconds", + // (undocumented) + BytesPerSecond = "BytesPerSecond", + // (undocumented) + Cores = "Cores", + // (undocumented) + Count = "Count", + // (undocumented) + CountPerSecond = "CountPerSecond", + // (undocumented) + MilliCores = "MilliCores", + // (undocumented) + MilliSeconds = "MilliSeconds", + // (undocumented) + NanoCores = "NanoCores", + // (undocumented) + Percent = "Percent", + // (undocumented) + Seconds = "Seconds", + // (undocumented) + Unspecified = "Unspecified" +} + +// @public +export enum KnownNamespaceClassification { + // (undocumented) + Custom = "Custom", + // (undocumented) + Platform = "Platform", + // (undocumented) + Qos = "Qos" +} + +// @public +export enum KnownOdatatype { + // (undocumented) + MicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria", + // (undocumented) + MicrosoftAzureMonitorSingleResourceMultipleMetricCriteria = "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", + // (undocumented) + MicrosoftAzureMonitorWebtestLocationAvailabilityCriteria = "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria" +} + +// @public +export enum KnownOnboardingStatus { + // (undocumented) + NotOnboarded = "notOnboarded", + // (undocumented) + Onboarded = "onboarded", + // (undocumented) + Unknown = "unknown" +} + +// @public +export enum KnownOperator { + // (undocumented) + Equals = "Equals", + // (undocumented) + GreaterThan = "GreaterThan", + // (undocumented) + GreaterThanOrEqual = "GreaterThanOrEqual", + // (undocumented) + Include = "Include", + // (undocumented) + LessThan = "LessThan", + // (undocumented) + LessThanOrEqual = "LessThanOrEqual" +} + +// @public +export type KnownPerfCounterDataSourceStreams = string; + +// @public +export enum KnownProvisioningState { + // (undocumented) + Canceled = "Canceled", + // (undocumented) + Deploying = "Deploying", + // (undocumented) + Failed = "Failed", + // (undocumented) + Succeeded = "Succeeded" +} + +// @public +export type KnownPublicNetworkAccessOptions = string; + +// @public +export enum KnownQueryType { + // (undocumented) + ResultCount = "ResultCount" +} + +// @public +export enum KnownScaleRuleMetricDimensionOperationType { + // (undocumented) + Equals = "Equals", + // (undocumented) + NotEquals = "NotEquals" +} + +// @public +export type KnownSyslogDataSourceFacilityNames = string; + +// @public +export type KnownSyslogDataSourceLogLevels = string; + +// @public +export type KnownSyslogDataSourceStreams = string; + +// @public +export type KnownWindowsEventLogDataSourceStreams = string; + +// @public +export interface LocalizableString { + localizedValue?: string; + value: string; +} + +// @public +export type LocationThresholdRuleCondition = RuleCondition & { + odataType: "Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition"; + windowSize?: string; + failedLocationCount: number; +}; + +// @public +export interface LogAnalyticsDestination { + name?: string; + readonly workspaceId?: string; + workspaceResourceId?: string; +} + +// @public +export interface LogicAppReceiver { + callbackUrl: string; + name: string; + resourceId: string; + useCommonAlertSchema?: boolean; +} + +// @public +export interface LogMetricTrigger { + metricColumn?: string; + metricTriggerType?: MetricTriggerType; + threshold?: number; + thresholdOperator?: ConditionalOperator; +} + +// @public +export interface LogProfileCollection { + value: LogProfileResource[]; +} + +// @public +export type LogProfileResource = Resource & { + storageAccountId?: string; + serviceBusRuleId?: string; + locations: string[]; + categories: string[]; + retentionPolicy: RetentionPolicy; +}; + +// @public +export interface LogProfileResourcePatch { + categories?: string[]; + locations?: string[]; + retentionPolicy?: RetentionPolicy; + serviceBusRuleId?: string; + storageAccountId?: string; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface LogProfiles { + createOrUpdate(logProfileName: string, parameters: LogProfileResource, options?: LogProfilesCreateOrUpdateOptionalParams): Promise; + delete(logProfileName: string, options?: LogProfilesDeleteOptionalParams): Promise; + get(logProfileName: string, options?: LogProfilesGetOptionalParams): Promise; + list(options?: LogProfilesListOptionalParams): PagedAsyncIterableIterator; + update(logProfileName: string, logProfilesResource: LogProfileResourcePatch, options?: LogProfilesUpdateOptionalParams): Promise; +} + +// @public +export interface LogProfilesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LogProfilesCreateOrUpdateResponse = LogProfileResource; + +// @public +export interface LogProfilesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface LogProfilesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LogProfilesGetResponse = LogProfileResource; + +// @public +export interface LogProfilesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LogProfilesListResponse = LogProfileCollection; + +// @public +export interface LogProfilesUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LogProfilesUpdateResponse = LogProfileResource; + +// @public +export type LogSearchRuleResource = ResourceAutoGenerated & { + readonly createdWithApiVersion?: string; + readonly isLegacyLogAnalyticsRule?: boolean; + description?: string; + displayName?: string; + autoMitigate?: boolean; + enabled?: Enabled; + readonly lastUpdatedTime?: Date; + readonly provisioningState?: ProvisioningState; + source: Source; + schedule?: Schedule; + action: ActionUnion; +}; + +// @public +export interface LogSearchRuleResourceCollection { + value?: LogSearchRuleResource[]; +} + +// @public +export interface LogSearchRuleResourcePatch { + enabled?: Enabled; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface LogSettings { + category?: string; + enabled: boolean; + retentionPolicy?: RetentionPolicy; +} + +// @public +export interface LogsIngestionEndpointSpec { + readonly endpoint?: string; +} + +// @public +export type LogToMetricAction = Action & { + odataType: "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction"; + criteria: Criteria[]; +}; + +// @public +export interface ManagementEventAggregationCondition { + operator?: ConditionOperator; + threshold?: number; + windowSize?: string; +} + +// @public +export type ManagementEventRuleCondition = RuleCondition & { + odataType: "Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition"; + aggregation?: ManagementEventAggregationCondition; +}; + +// @public +export interface MetadataValue { + name?: LocalizableString; + value?: string; +} + +// @public +export interface Metric { + displayDescription?: string; + errorCode?: string; + errorMessage?: string; + id: string; + name: LocalizableString; + timeseries: TimeSeriesElement[]; + type: string; + unit: MetricUnit; +} + +// @public +export interface MetricAlertAction { + actionGroupId?: string; + webHookProperties?: { + [propertyName: string]: string; + }; +} + +// @public +export interface MetricAlertCriteria { + [property: string]: any; + odataType: "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria" | "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria" | "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria"; +} + +// @public (undocumented) +export type MetricAlertCriteriaUnion = MetricAlertCriteria | MetricAlertSingleResourceMultipleMetricCriteria | WebtestLocationAvailabilityCriteria | MetricAlertMultipleResourceMultipleMetricCriteria; + +// @public +export type MetricAlertMultipleResourceMultipleMetricCriteria = MetricAlertCriteria & { + odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria"; + allOf?: MultiMetricCriteriaUnion[]; +}; + +// @public +export type MetricAlertResource = Resource & { + description?: string; + severity: number; + enabled: boolean; + scopes: string[]; + evaluationFrequency: string; + windowSize: string; + targetResourceType?: string; + targetResourceRegion?: string; + criteria: MetricAlertCriteriaUnion; + autoMitigate?: boolean; + actions?: MetricAlertAction[]; + readonly lastUpdatedTime?: Date; + readonly isMigrated?: boolean; +}; + +// @public +export interface MetricAlertResourceCollection { + value?: MetricAlertResource[]; +} + +// @public +export interface MetricAlertResourcePatch { + actions?: MetricAlertAction[]; + autoMitigate?: boolean; + criteria?: MetricAlertCriteriaUnion; + description?: string; + enabled?: boolean; + evaluationFrequency?: string; + readonly isMigrated?: boolean; + readonly lastUpdatedTime?: Date; + scopes?: string[]; + severity?: number; + tags?: { + [propertyName: string]: string; + }; + targetResourceRegion?: string; + targetResourceType?: string; + windowSize?: string; +} + +// @public +export interface MetricAlerts { + createOrUpdate(resourceGroupName: string, ruleName: string, parameters: MetricAlertResource, options?: MetricAlertsCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, ruleName: string, options?: MetricAlertsDeleteOptionalParams): Promise; + get(resourceGroupName: string, ruleName: string, options?: MetricAlertsGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: MetricAlertsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: MetricAlertsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, ruleName: string, parameters: MetricAlertResourcePatch, options?: MetricAlertsUpdateOptionalParams): Promise; +} + +// @public +export interface MetricAlertsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MetricAlertsCreateOrUpdateResponse = MetricAlertResource; + +// @public +export interface MetricAlertsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface MetricAlertsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MetricAlertsGetResponse = MetricAlertResource; + +// @public +export type MetricAlertSingleResourceMultipleMetricCriteria = MetricAlertCriteria & { + odataType: "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria"; + allOf?: MetricCriteria[]; +}; + +// @public +export interface MetricAlertsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MetricAlertsListByResourceGroupResponse = MetricAlertResourceCollection; + +// @public +export interface MetricAlertsListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MetricAlertsListBySubscriptionResponse = MetricAlertResourceCollection; + +// @public +export interface MetricAlertsStatus { + list(resourceGroupName: string, ruleName: string, options?: MetricAlertsStatusListOptionalParams): Promise; + listByName(resourceGroupName: string, ruleName: string, statusName: string, options?: MetricAlertsStatusListByNameOptionalParams): Promise; +} + +// @public +export interface MetricAlertsStatusListByNameOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MetricAlertsStatusListByNameResponse = MetricAlertStatusCollection; + +// @public +export interface MetricAlertsStatusListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MetricAlertsStatusListResponse = MetricAlertStatusCollection; + +// @public +export interface MetricAlertStatus { + id?: string; + name?: string; + properties?: MetricAlertStatusProperties; + type?: string; +} + +// @public +export interface MetricAlertStatusCollection { + value?: MetricAlertStatus[]; +} + +// @public +export interface MetricAlertStatusProperties { + dimensions?: { + [propertyName: string]: string; + }; + status?: string; + timestamp?: Date; +} + +// @public +export interface MetricAlertsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MetricAlertsUpdateResponse = MetricAlertResource; + +// @public +export interface MetricAvailability { + retention?: string; + timeGrain?: string; +} + +// @public +export interface MetricBaselinesResponse { + value?: SingleMetricBaseline[]; +} + +// @public +export type MetricClass = string; + +// @public +export type MetricCriteria = MultiMetricCriteria & { + criterionType: "StaticThresholdCriterion"; + operator: Operator; + threshold: number; +}; + +// @public +export interface MetricDefinition { + category?: string; + dimensions?: LocalizableString[]; + displayDescription?: string; + id?: string; + isDimensionRequired?: boolean; + metricAvailabilities?: MetricAvailability[]; + metricClass?: MetricClass; + name?: LocalizableString; + namespace?: string; + primaryAggregationType?: AggregationType; + resourceId?: string; + supportedAggregationTypes?: AggregationType[]; + unit?: MetricUnit; +} + +// @public +export interface MetricDefinitionCollection { + value: MetricDefinition[]; +} + +// @public +export interface MetricDefinitions { + list(resourceUri: string, options?: MetricDefinitionsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface MetricDefinitionsListOptionalParams extends coreClient.OperationOptions { + metricnamespace?: string; +} + +// @public +export type MetricDefinitionsListResponse = MetricDefinitionCollection; + +// @public +export interface MetricDimension { + name: string; + operator: string; + values: string[]; +} + +// @public +export interface MetricNamespace { + classification?: NamespaceClassification; + id?: string; + name?: string; + properties?: MetricNamespaceName; + type?: string; +} + +// @public +export interface MetricNamespaceCollection { + value: MetricNamespace[]; +} + +// @public +export interface MetricNamespaceName { + metricNamespaceName?: string; +} + +// @public +export interface MetricNamespaces { + list(resourceUri: string, options?: MetricNamespacesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface MetricNamespacesListOptionalParams extends coreClient.OperationOptions { + startTime?: string; +} + +// @public +export type MetricNamespacesListResponse = MetricNamespaceCollection; + +// @public +export interface Metrics { + list(resourceUri: string, options?: MetricsListOptionalParams): Promise; +} + +// @public +export interface MetricSettings { + category?: string; + enabled: boolean; + retentionPolicy?: RetentionPolicy; + timeGrain?: string; +} + +// @public +export interface MetricSingleDimension { + name: string; + value: string; +} + +// @public +export interface MetricsListOptionalParams extends coreClient.OperationOptions { + aggregation?: string; + filter?: string; + interval?: string; + metricnames?: string; + metricnamespace?: string; + orderby?: string; + resultType?: ResultType; + timespan?: string; + top?: number; +} + +// @public +export type MetricsListResponse = Response_2; + +// @public +export type MetricStatisticType = "Average" | "Min" | "Max" | "Sum" | "Count"; + +// @public +export interface MetricTrigger { + dimensions?: ScaleRuleMetricDimension[]; + dividePerInstance?: boolean; + metricName: string; + metricNamespace?: string; + metricResourceLocation?: string; + metricResourceUri: string; + operator: ComparisonOperationType; + statistic: MetricStatisticType; + threshold: number; + timeAggregation: TimeAggregationType; + timeGrain: string; + timeWindow: string; +} + +// @public +export type MetricTriggerType = string; + +// @public +export type MetricUnit = string; + +// @public +export interface MetricValue { + average?: number; + count?: number; + maximum?: number; + minimum?: number; + timeStamp: Date; + total?: number; +} + +// @public (undocumented) +export class MonitorClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: MonitorClientOptionalParams); + // (undocumented) + actionGroups: ActionGroups; + // (undocumented) + activityLogAlerts: ActivityLogAlerts; + // (undocumented) + activityLogs: ActivityLogs; + // (undocumented) + alertRuleIncidents: AlertRuleIncidents; + // (undocumented) + alertRules: AlertRules; + // (undocumented) + autoscaleSettings: AutoscaleSettings; + // (undocumented) + baselines: Baselines; + // (undocumented) + dataCollectionEndpoints: DataCollectionEndpoints; + // (undocumented) + dataCollectionRuleAssociations: DataCollectionRuleAssociations; + // (undocumented) + dataCollectionRules: DataCollectionRules; + // (undocumented) + diagnosticSettings: DiagnosticSettings; + // (undocumented) + diagnosticSettingsCategory: DiagnosticSettingsCategory; + // (undocumented) + eventCategories: EventCategories; + // (undocumented) + logProfiles: LogProfiles; + // (undocumented) + metricAlerts: MetricAlerts; + // (undocumented) + metricAlertsStatus: MetricAlertsStatus; + // (undocumented) + metricDefinitions: MetricDefinitions; + // (undocumented) + metricNamespaces: MetricNamespaces; + // (undocumented) + metrics: Metrics; + // (undocumented) + operations: Operations; + // (undocumented) + privateEndpointConnections: PrivateEndpointConnections; + // (undocumented) + privateLinkResources: PrivateLinkResources; + // (undocumented) + privateLinkScopedResources: PrivateLinkScopedResources; + // (undocumented) + privateLinkScopeOperationStatus: PrivateLinkScopeOperationStatus; + // (undocumented) + privateLinkScopes: PrivateLinkScopes; + // (undocumented) + scheduledQueryRules: ScheduledQueryRules; + // (undocumented) + subscriptionId: string; + // (undocumented) + tenantActivityLogs: TenantActivityLogs; + // (undocumented) + vMInsights: VMInsights; +} + +// @public +export interface MonitorClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + endpoint?: string; +} + +// @public +export interface MultiMetricCriteria { + [property: string]: any; + criterionType: "StaticThresholdCriterion" | "DynamicThresholdCriterion"; + dimensions?: MetricDimension[]; + metricName: string; + metricNamespace?: string; + name: string; + skipMetricValidation?: boolean; + timeAggregation: AggregationTypeEnum; +} + +// @public (undocumented) +export type MultiMetricCriteriaUnion = MultiMetricCriteria | MetricCriteria | DynamicMetricCriteria; + +// @public +export type NamespaceClassification = string; + +// @public +export interface NetworkRuleSet { + publicNetworkAccess?: KnownPublicNetworkAccessOptions; +} + +// @public +export interface NotificationRequestBody { + alertType: string; + armRoleReceivers?: ArmRoleReceiver[]; + automationRunbookReceivers?: AutomationRunbookReceiver[]; + azureAppPushReceivers?: AzureAppPushReceiver[]; + azureFunctionReceivers?: AzureFunctionReceiver[]; + emailReceivers?: EmailReceiver[]; + eventHubReceivers?: EventHubReceiver[]; + itsmReceivers?: ItsmReceiver[]; + logicAppReceivers?: LogicAppReceiver[]; + smsReceivers?: SmsReceiver[]; + voiceReceivers?: VoiceReceiver[]; + webhookReceivers?: WebhookReceiver[]; +} + +// @public +export type Odatatype = string; + +// @public +export type OnboardingStatus = string; + +// @public +export interface Operation { + display?: OperationDisplay; + name?: string; +} + +// @public +export interface OperationDisplay { + operation?: string; + provider?: string; + resource?: string; +} + +// @public +export interface OperationListResult { + nextLink?: string; + value?: Operation[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): Promise; +} + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export interface OperationStatus { + endTime?: Date; + error?: ErrorResponseCommon; + id?: string; + name?: string; + startTime?: Date; + status?: string; +} + +// @public +export type Operator = string; + +// @public +export interface PerfCounterDataSource { + counterSpecifiers?: string[]; + name?: string; + samplingFrequencyInSeconds?: number; + streams?: KnownPerfCounterDataSourceStreams[]; +} + +// @public +export type PrivateEndpointConnection = ProxyResource & { + privateEndpoint?: PrivateEndpointProperty; + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionStateProperty; + readonly provisioningState?: string; +}; + +// @public +export interface PrivateEndpointConnectionListResult { + readonly nextLink?: string; + readonly value?: PrivateEndpointConnection[]; +} + +// @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; + beginDelete(resourceGroupName: string, scopeName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, scopeName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise; + get(resourceGroupName: string, scopeName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; + listByPrivateLinkScope(resourceGroupName: string, scopeName: string, options?: PrivateEndpointConnectionsListByPrivateLinkScopeOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PrivateEndpointConnectionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnection; + +// @public +export interface PrivateEndpointConnectionsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface PrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; + +// @public +export interface PrivateEndpointConnectionsListByPrivateLinkScopeNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsListByPrivateLinkScopeNextResponse = PrivateEndpointConnectionListResult; + +// @public +export interface PrivateEndpointConnectionsListByPrivateLinkScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsListByPrivateLinkScopeResponse = PrivateEndpointConnectionListResult; + +// @public +export interface PrivateEndpointProperty { + id?: string; +} + +// @public +export type PrivateLinkResource = ProxyResource & { + readonly groupId?: string; + readonly requiredMembers?: string[]; +}; + +// @public +export interface PrivateLinkResourceListResult { + readonly nextLink?: string; + readonly value?: PrivateLinkResource[]; +} + +// @public +export interface PrivateLinkResources { + get(resourceGroupName: string, scopeName: string, groupName: string, options?: PrivateLinkResourcesGetOptionalParams): Promise; + listByPrivateLinkScope(resourceGroupName: string, scopeName: string, options?: PrivateLinkResourcesListByPrivateLinkScopeOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PrivateLinkResourcesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkResourcesGetResponse = PrivateLinkResource; + +// @public +export interface PrivateLinkResourcesListByPrivateLinkScopeNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkResourcesListByPrivateLinkScopeNextResponse = PrivateLinkResourceListResult; + +// @public +export interface PrivateLinkResourcesListByPrivateLinkScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkResourcesListByPrivateLinkScopeResponse = PrivateLinkResourceListResult; + +// @public +export interface PrivateLinkScopedResources { + beginCreateOrUpdate(resourceGroupName: string, scopeName: string, name: string, parameters: ScopedResource, options?: PrivateLinkScopedResourcesCreateOrUpdateOptionalParams): Promise, PrivateLinkScopedResourcesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, scopeName: string, name: string, parameters: ScopedResource, options?: PrivateLinkScopedResourcesCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, scopeName: string, name: string, options?: PrivateLinkScopedResourcesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, scopeName: string, name: string, options?: PrivateLinkScopedResourcesDeleteOptionalParams): Promise; + get(resourceGroupName: string, scopeName: string, name: string, options?: PrivateLinkScopedResourcesGetOptionalParams): Promise; + listByPrivateLinkScope(resourceGroupName: string, scopeName: string, options?: PrivateLinkScopedResourcesListByPrivateLinkScopeOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PrivateLinkScopedResourcesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PrivateLinkScopedResourcesCreateOrUpdateResponse = ScopedResource; + +// @public +export interface PrivateLinkScopedResourcesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface PrivateLinkScopedResourcesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkScopedResourcesGetResponse = ScopedResource; + +// @public +export interface PrivateLinkScopedResourcesListByPrivateLinkScopeNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkScopedResourcesListByPrivateLinkScopeNextResponse = ScopedResourceListResult; + +// @public +export interface PrivateLinkScopedResourcesListByPrivateLinkScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkScopedResourcesListByPrivateLinkScopeResponse = ScopedResourceListResult; + +// @public +export interface PrivateLinkScopeOperationStatus { + get(asyncOperationId: string, resourceGroupName: string, options?: PrivateLinkScopeOperationStatusGetOptionalParams): Promise; +} + +// @public +export interface PrivateLinkScopeOperationStatusGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkScopeOperationStatusGetResponse = OperationStatus; + +// @public +export interface PrivateLinkScopes { + beginDelete(resourceGroupName: string, scopeName: string, options?: PrivateLinkScopesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, scopeName: string, options?: PrivateLinkScopesDeleteOptionalParams): Promise; + createOrUpdate(resourceGroupName: string, scopeName: string, azureMonitorPrivateLinkScopePayload: AzureMonitorPrivateLinkScope, options?: PrivateLinkScopesCreateOrUpdateOptionalParams): Promise; + get(resourceGroupName: string, scopeName: string, options?: PrivateLinkScopesGetOptionalParams): Promise; + list(options?: PrivateLinkScopesListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: PrivateLinkScopesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + updateTags(resourceGroupName: string, scopeName: string, privateLinkScopeTags: TagsResource, options?: PrivateLinkScopesUpdateTagsOptionalParams): Promise; +} + +// @public +export interface PrivateLinkScopesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkScopesCreateOrUpdateResponse = AzureMonitorPrivateLinkScope; + +// @public +export interface PrivateLinkScopesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface PrivateLinkScopesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkScopesGetResponse = AzureMonitorPrivateLinkScope; + +// @public +export interface PrivateLinkScopesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkScopesListByResourceGroupNextResponse = AzureMonitorPrivateLinkScopeListResult; + +// @public +export interface PrivateLinkScopesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkScopesListByResourceGroupResponse = AzureMonitorPrivateLinkScopeListResult; + +// @public +export interface PrivateLinkScopesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkScopesListNextResponse = AzureMonitorPrivateLinkScopeListResult; + +// @public +export interface PrivateLinkScopesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkScopesListResponse = AzureMonitorPrivateLinkScopeListResult; + +// @public +export interface PrivateLinkScopesResource { + readonly id?: string; + location: string; + readonly name?: string; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export interface PrivateLinkScopesUpdateTagsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkScopesUpdateTagsResponse = AzureMonitorPrivateLinkScope; + +// @public +export interface PrivateLinkServiceConnectionStateProperty { + readonly actionsRequired?: string; + description: string; + status: string; +} + +// @public +export type ProvisioningState = string; + +// @public +export interface ProxyOnlyResource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export interface ProxyResource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export type QueryType = string; + +// @public +export type ReceiverStatus = "NotSpecified" | "Enabled" | "Disabled"; + +// @public +export interface Recurrence { + frequency: RecurrenceFrequency; + schedule: RecurrentSchedule; +} + +// @public +export type RecurrenceFrequency = "None" | "Second" | "Minute" | "Hour" | "Day" | "Week" | "Month" | "Year"; + +// @public +export interface RecurrentSchedule { + days: string[]; + hours: number[]; + minutes: number[]; + timeZone: string; +} + +// @public +export interface Resource { + readonly id?: string; + location: string; + readonly name?: string; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export interface ResourceAutoGenerated { + readonly etag?: string; + readonly id?: string; + readonly kind?: string; + location: string; + readonly name?: string; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export interface ResourceForUpdate { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +interface Response_2 { + cost?: number; + interval?: string; + namespace?: string; + resourceregion?: string; + timespan: string; + value: Metric[]; +} +export { Response_2 as Response } + +// @public +export interface ResponseWithError { + error: ErrorModel; +} + +// @public +export type ResultType = "Data" | "Metadata"; + +// @public +export interface RetentionPolicy { + days: number; + enabled: boolean; +} + +// @public +export interface RuleAction { + odataType: "Microsoft.Azure.Management.Insights.Models.RuleEmailAction" | "Microsoft.Azure.Management.Insights.Models.RuleWebhookAction"; +} + +// @public (undocumented) +export type RuleActionUnion = RuleAction | RuleEmailAction | RuleWebhookAction; + +// @public +export interface RuleCondition { + dataSource?: RuleDataSourceUnion; + odataType: "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition" | "Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition" | "Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition"; +} + +// @public (undocumented) +export type RuleConditionUnion = RuleCondition | ThresholdRuleCondition | LocationThresholdRuleCondition | ManagementEventRuleCondition; + +// @public +export interface RuleDataSource { + legacyResourceId?: string; + metricNamespace?: string; + odataType: "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource" | "Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource"; + resourceLocation?: string; + resourceUri?: string; +} + +// @public (undocumented) +export type RuleDataSourceUnion = RuleDataSource | RuleMetricDataSource | RuleManagementEventDataSource; + +// @public +export type RuleEmailAction = RuleAction & { + odataType: "Microsoft.Azure.Management.Insights.Models.RuleEmailAction"; + sendToServiceOwners?: boolean; + customEmails?: string[]; +}; + +// @public +export interface RuleManagementEventClaimsDataSource { + emailAddress?: string; +} + +// @public +export type RuleManagementEventDataSource = RuleDataSource & { + odataType: "Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource"; + eventName?: string; + eventSource?: string; + level?: string; + operationName?: string; + resourceGroupName?: string; + resourceProviderName?: string; + status?: string; + subStatus?: string; + claims?: RuleManagementEventClaimsDataSource; +}; + +// @public +export type RuleMetricDataSource = RuleDataSource & { + odataType: "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource"; + metricName?: string; +}; + +// @public +export type RuleWebhookAction = RuleAction & { + odataType: "Microsoft.Azure.Management.Insights.Models.RuleWebhookAction"; + serviceUri?: string; + properties?: { + [propertyName: string]: string; + }; +}; + +// @public +export interface ScaleAction { + cooldown: string; + direction: ScaleDirection; + type: ScaleType; + value?: string; +} + +// @public +export interface ScaleCapacity { + default: string; + maximum: string; + minimum: string; +} + +// @public +export type ScaleDirection = "None" | "Increase" | "Decrease"; + +// @public +export interface ScaleRule { + metricTrigger: MetricTrigger; + scaleAction: ScaleAction; +} + +// @public +export interface ScaleRuleMetricDimension { + dimensionName: string; + operator: ScaleRuleMetricDimensionOperationType; + values: string[]; +} + +// @public +export type ScaleRuleMetricDimensionOperationType = string; + +// @public +export type ScaleType = "ChangeCount" | "PercentChangeCount" | "ExactCount" | "ServiceAllowedNextValue"; + +// @public +export interface Schedule { + frequencyInMinutes: number; + timeWindowInMinutes: number; +} + +// @public +export interface ScheduledQueryRules { + createOrUpdate(resourceGroupName: string, ruleName: string, parameters: LogSearchRuleResource, options?: ScheduledQueryRulesCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, ruleName: string, options?: ScheduledQueryRulesDeleteOptionalParams): Promise; + get(resourceGroupName: string, ruleName: string, options?: ScheduledQueryRulesGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: ScheduledQueryRulesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: ScheduledQueryRulesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, ruleName: string, parameters: LogSearchRuleResourcePatch, options?: ScheduledQueryRulesUpdateOptionalParams): Promise; +} + +// @public +export interface ScheduledQueryRulesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ScheduledQueryRulesCreateOrUpdateResponse = LogSearchRuleResource; + +// @public +export interface ScheduledQueryRulesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ScheduledQueryRulesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ScheduledQueryRulesGetResponse = LogSearchRuleResource; + +// @public +export interface ScheduledQueryRulesListByResourceGroupOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ScheduledQueryRulesListByResourceGroupResponse = LogSearchRuleResourceCollection; + +// @public +export interface ScheduledQueryRulesListBySubscriptionOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ScheduledQueryRulesListBySubscriptionResponse = LogSearchRuleResourceCollection; + +// @public +export interface ScheduledQueryRulesUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ScheduledQueryRulesUpdateResponse = LogSearchRuleResource; + +// @public +export type ScopedResource = ProxyResource & { + linkedResourceId?: string; + readonly provisioningState?: string; +}; + +// @public +export interface ScopedResourceListResult { + readonly nextLink?: string; + readonly value?: ScopedResource[]; +} + +// @public +export interface SenderAuthorization { + action?: string; + role?: string; + scope?: string; +} + +// @public +export interface SingleBaseline { + highThresholds: number[]; + lowThresholds: number[]; + sensitivity: BaselineSensitivity; +} + +// @public +export interface SingleMetricBaseline { + baselines: TimeSeriesBaseline[]; + id: string; + interval: string; + name: string; + namespace?: string; + timespan: string; + type: string; +} + +// @public +export interface SmsReceiver { + countryCode: string; + name: string; + phoneNumber: string; + readonly status?: ReceiverStatus; +} + +// @public +export interface Source { + authorizedResources?: string[]; + dataSourceId: string; + query?: string; + queryType?: QueryType; +} + +// @public +export interface SyslogDataSource { + facilityNames?: KnownSyslogDataSourceFacilityNames[]; + logLevels?: KnownSyslogDataSourceLogLevels[]; + name?: string; + streams?: KnownSyslogDataSourceStreams[]; +} + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TagsResource { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface TenantActivityLogs { + list(options?: TenantActivityLogsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface TenantActivityLogsListNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + select?: string; +} + +// @public +export type TenantActivityLogsListNextResponse = EventDataCollection; + +// @public +export interface TenantActivityLogsListOptionalParams extends coreClient.OperationOptions { + filter?: string; + select?: string; +} + +// @public +export type TenantActivityLogsListResponse = EventDataCollection; + +// @public +export interface TestNotificationDetailsResponse { + actionDetails?: ActionDetail[]; + completedTime?: string; + context?: Context; + createdTime?: string; + state: string; +} + +// @public +export interface TestNotificationResponse { + correlationId: string; + createdTime: string; + notificationId: string; +} + +// @public +export type ThresholdRuleCondition = RuleCondition & { + odataType: "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition"; + operator: ConditionOperator; + threshold: number; + windowSize?: string; + timeAggregation?: TimeAggregationOperator; +}; + +// @public +export type TimeAggregationOperator = "Average" | "Minimum" | "Maximum" | "Total" | "Last"; + +// @public +export type TimeAggregationType = "Average" | "Minimum" | "Maximum" | "Total" | "Count" | "Last"; + +// @public +export interface TimeSeriesBaseline { + aggregation: string; + data: SingleBaseline[]; + dimensions?: MetricSingleDimension[]; + metadataValues?: BaselineMetadata[]; + timestamps: Date[]; +} + +// @public +export interface TimeSeriesElement { + data?: MetricValue[]; + metadatavalues?: MetadataValue[]; +} + +// @public +export interface TimeWindow { + end: Date; + start: Date; + timeZone?: string; +} + +// @public +export interface TriggerCondition { + metricTrigger?: LogMetricTrigger; + threshold: number; + thresholdOperator: ConditionalOperator; +} + +// @public +export interface VMInsights { + getOnboardingStatus(resourceUri: string, options?: VMInsightsGetOnboardingStatusOptionalParams): Promise; +} + +// @public +export interface VMInsightsGetOnboardingStatusOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VMInsightsGetOnboardingStatusResponse = VMInsightsOnboardingStatus; + +// @public +export type VMInsightsOnboardingStatus = ProxyResource & { + resourceId?: string; + onboardingStatus?: OnboardingStatus; + dataStatus?: DataStatus; + data?: DataContainer[]; +}; + +// @public +export interface VoiceReceiver { + countryCode: string; + name: string; + phoneNumber: string; +} + +// @public +export interface WebhookNotification { + properties?: { + [propertyName: string]: string; + }; + serviceUri?: string; +} + +// @public +export interface WebhookReceiver { + identifierUri?: string; + name: string; + objectId?: string; + serviceUri: string; + tenantId?: string; + useAadAuth?: boolean; + useCommonAlertSchema?: boolean; +} + +// @public +export type WebtestLocationAvailabilityCriteria = MetricAlertCriteria & { + odataType: "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria"; + webTestId: string; + componentId: string; + failedLocationCount: number; +}; + +// @public +export interface WindowsEventLogDataSource { + name?: string; + streams?: KnownWindowsEventLogDataSourceStreams[]; + xPathQueries?: string[]; +} + +// @public +export interface WorkspaceInfo { + customerId: string; + id: string; + location: string; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/monitor/arm-monitor/rollup.config.js b/sdk/monitor/arm-monitor/rollup.config.js index 60aa3b0cb549..9be1955eb7f1 100644 --- a/sdk/monitor/arm-monitor/rollup.config.js +++ b/sdk/monitor/arm-monitor/rollup.config.js @@ -1,37 +1,188 @@ -import rollup from "rollup"; -import nodeResolve from "rollup-plugin-node-resolve"; +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; + +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + +// #region Warning Handler /** - * @type {rollup.RollupFileOptions} + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. */ -const config = { - input: "./esm/monitorManagementClient.js", - external: [ - "@azure/ms-rest-js", - "@azure/ms-rest-azure-js" - ], - output: { - file: "./dist/arm-monitor.js", - format: "umd", - name: "Azure.ArmMonitor", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + +/** + * 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/**"] }, - banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */` - }, - plugins: [ - nodeResolve({ mainFields: ['module', 'main'] }), - sourcemaps() - ] + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), + 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 default config; +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(), cjs()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/monitor/arm-monitor/src/index.ts b/sdk/monitor/arm-monitor/src/index.ts new file mode 100644 index 000000000000..826cbfe61d7d --- /dev/null +++ b/sdk/monitor/arm-monitor/src/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export * from "./models"; +export { MonitorClient } from "./monitorClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/monitor/arm-monitor/src/lroImpl.ts b/sdk/monitor/arm-monitor/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/monitor/arm-monitor/src/lroImpl.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export class LroImpl implements LongRunningOperation { + constructor( + private sendOperationFn: (args: any, spec: any) => Promise>, + private args: Record, + private spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record, + public requestPath: string = spec.path!, + public requestMethod: string = spec.httpMethod + ) {} + public async sendInitialRequest(): Promise> { + return this.sendOperationFn(this.args, this.spec); + } + public async sendPollRequest(path: string): Promise> { + const { requestBody, ...restSpec } = this.spec; + return this.sendOperationFn(this.args, { + ...restSpec, + path, + httpMethod: "GET" + }); + } +} diff --git a/sdk/monitor/arm-monitor/src/models/actionGroupsMappers.ts b/sdk/monitor/arm-monitor/src/models/actionGroupsMappers.ts deleted file mode 100644 index 11486f297d29..000000000000 --- a/sdk/monitor/arm-monitor/src/models/actionGroupsMappers.ts +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - Action, - ActionGroupList, - ActionGroupPatchBody, - ActionGroupResource, - ActivityLogAlertActionGroup, - ActivityLogAlertActionList, - ActivityLogAlertAllOfCondition, - ActivityLogAlertLeafCondition, - ActivityLogAlertResource, - AlertingAction, - AlertRuleResource, - ArmRoleReceiver, - AutomationRunbookReceiver, - AutoscaleNotification, - AutoscaleProfile, - AutoscaleSettingResource, - AzNsActionGroup, - AzureAppPushReceiver, - AzureFunctionReceiver, - BaseResource, - Criteria, - DataContainer, - DiagnosticSettingsCategoryResource, - DiagnosticSettingsResource, - Dimension, - DynamicMetricCriteria, - DynamicThresholdFailingPeriods, - EmailNotification, - EmailReceiver, - EnableRequest, - ErrorResponse, - ItsmReceiver, - LocationThresholdRuleCondition, - LogicAppReceiver, - LogMetricTrigger, - LogProfileResource, - LogSearchRuleResource, - LogSettings, - LogToMetricAction, - ManagementEventAggregationCondition, - ManagementEventRuleCondition, - MetricAlertAction, - MetricAlertCriteria, - MetricAlertMultipleResourceMultipleMetricCriteria, - MetricAlertResource, - MetricAlertSingleResourceMultipleMetricCriteria, - MetricCriteria, - MetricDimension, - MetricSettings, - MetricTrigger, - MultiMetricCriteria, - ProxyOnlyResource, - ProxyResource, - Recurrence, - RecurrentSchedule, - Resource, - RetentionPolicy, - RuleAction, - RuleCondition, - RuleDataSource, - RuleEmailAction, - RuleManagementEventClaimsDataSource, - RuleManagementEventDataSource, - RuleMetricDataSource, - RuleWebhookAction, - ScaleAction, - ScaleCapacity, - ScaleRule, - Schedule, - SmsReceiver, - Source, - ThresholdRuleCondition, - TimeWindow, - TriggerCondition, - VMInsightsOnboardingStatus, - VoiceReceiver, - WebhookNotification, - WebhookReceiver, - WorkspaceInfo -} from "../models/mappers"; diff --git a/sdk/monitor/arm-monitor/src/models/activityLogAlertsMappers.ts b/sdk/monitor/arm-monitor/src/models/activityLogAlertsMappers.ts deleted file mode 100644 index d949c6e04f10..000000000000 --- a/sdk/monitor/arm-monitor/src/models/activityLogAlertsMappers.ts +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - Action, - ActionGroupResource, - ActivityLogAlertActionGroup, - ActivityLogAlertActionList, - ActivityLogAlertAllOfCondition, - ActivityLogAlertLeafCondition, - ActivityLogAlertList, - ActivityLogAlertPatchBody, - ActivityLogAlertResource, - AlertingAction, - AlertRuleResource, - ArmRoleReceiver, - AutomationRunbookReceiver, - AutoscaleNotification, - AutoscaleProfile, - AutoscaleSettingResource, - AzNsActionGroup, - AzureAppPushReceiver, - AzureFunctionReceiver, - BaseResource, - Criteria, - DataContainer, - DiagnosticSettingsCategoryResource, - DiagnosticSettingsResource, - Dimension, - DynamicMetricCriteria, - DynamicThresholdFailingPeriods, - EmailNotification, - EmailReceiver, - ErrorResponse, - ItsmReceiver, - LocationThresholdRuleCondition, - LogicAppReceiver, - LogMetricTrigger, - LogProfileResource, - LogSearchRuleResource, - LogSettings, - LogToMetricAction, - ManagementEventAggregationCondition, - ManagementEventRuleCondition, - MetricAlertAction, - MetricAlertCriteria, - MetricAlertMultipleResourceMultipleMetricCriteria, - MetricAlertResource, - MetricAlertSingleResourceMultipleMetricCriteria, - MetricCriteria, - MetricDimension, - MetricSettings, - MetricTrigger, - MultiMetricCriteria, - ProxyOnlyResource, - ProxyResource, - Recurrence, - RecurrentSchedule, - Resource, - RetentionPolicy, - RuleAction, - RuleCondition, - RuleDataSource, - RuleEmailAction, - RuleManagementEventClaimsDataSource, - RuleManagementEventDataSource, - RuleMetricDataSource, - RuleWebhookAction, - ScaleAction, - ScaleCapacity, - ScaleRule, - Schedule, - SmsReceiver, - Source, - ThresholdRuleCondition, - TimeWindow, - TriggerCondition, - VMInsightsOnboardingStatus, - VoiceReceiver, - WebhookNotification, - WebhookReceiver, - WorkspaceInfo -} from "../models/mappers"; diff --git a/sdk/monitor/arm-monitor/src/models/activityLogsMappers.ts b/sdk/monitor/arm-monitor/src/models/activityLogsMappers.ts deleted file mode 100644 index 80edb96348be..000000000000 --- a/sdk/monitor/arm-monitor/src/models/activityLogsMappers.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - ErrorResponse, - EventData, - EventDataCollection, - HttpRequestInfo, - LocalizableString, - SenderAuthorization -} from "../models/mappers"; diff --git a/sdk/monitor/arm-monitor/src/models/alertRuleIncidentsMappers.ts b/sdk/monitor/arm-monitor/src/models/alertRuleIncidentsMappers.ts deleted file mode 100644 index 1980277abff7..000000000000 --- a/sdk/monitor/arm-monitor/src/models/alertRuleIncidentsMappers.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - CloudError, - ErrorResponse, - Incident, - IncidentListResult -} from "../models/mappers"; diff --git a/sdk/monitor/arm-monitor/src/models/alertRulesMappers.ts b/sdk/monitor/arm-monitor/src/models/alertRulesMappers.ts deleted file mode 100644 index 91bb37022f98..000000000000 --- a/sdk/monitor/arm-monitor/src/models/alertRulesMappers.ts +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - Action, - ActionGroupResource, - ActivityLogAlertActionGroup, - ActivityLogAlertActionList, - ActivityLogAlertAllOfCondition, - ActivityLogAlertLeafCondition, - ActivityLogAlertResource, - AlertingAction, - AlertRuleResource, - AlertRuleResourceCollection, - AlertRuleResourcePatch, - ArmRoleReceiver, - AutomationRunbookReceiver, - AutoscaleNotification, - AutoscaleProfile, - AutoscaleSettingResource, - AzNsActionGroup, - AzureAppPushReceiver, - AzureFunctionReceiver, - BaseResource, - CloudError, - Criteria, - DataContainer, - DiagnosticSettingsCategoryResource, - DiagnosticSettingsResource, - Dimension, - DynamicMetricCriteria, - DynamicThresholdFailingPeriods, - EmailNotification, - EmailReceiver, - ErrorResponse, - ItsmReceiver, - LocationThresholdRuleCondition, - LogicAppReceiver, - LogMetricTrigger, - LogProfileResource, - LogSearchRuleResource, - LogSettings, - LogToMetricAction, - ManagementEventAggregationCondition, - ManagementEventRuleCondition, - MetricAlertAction, - MetricAlertCriteria, - MetricAlertMultipleResourceMultipleMetricCriteria, - MetricAlertResource, - MetricAlertSingleResourceMultipleMetricCriteria, - MetricCriteria, - MetricDimension, - MetricSettings, - MetricTrigger, - MultiMetricCriteria, - ProxyOnlyResource, - ProxyResource, - Recurrence, - RecurrentSchedule, - Resource, - RetentionPolicy, - RuleAction, - RuleCondition, - RuleDataSource, - RuleEmailAction, - RuleManagementEventClaimsDataSource, - RuleManagementEventDataSource, - RuleMetricDataSource, - RuleWebhookAction, - ScaleAction, - ScaleCapacity, - ScaleRule, - Schedule, - SmsReceiver, - Source, - ThresholdRuleCondition, - TimeWindow, - TriggerCondition, - VMInsightsOnboardingStatus, - VoiceReceiver, - WebhookNotification, - WebhookReceiver, - WorkspaceInfo -} from "../models/mappers"; diff --git a/sdk/monitor/arm-monitor/src/models/autoscaleSettingsMappers.ts b/sdk/monitor/arm-monitor/src/models/autoscaleSettingsMappers.ts deleted file mode 100644 index 68da5c7050e0..000000000000 --- a/sdk/monitor/arm-monitor/src/models/autoscaleSettingsMappers.ts +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - Action, - ActionGroupResource, - ActivityLogAlertActionGroup, - ActivityLogAlertActionList, - ActivityLogAlertAllOfCondition, - ActivityLogAlertLeafCondition, - ActivityLogAlertResource, - AlertingAction, - AlertRuleResource, - ArmRoleReceiver, - AutomationRunbookReceiver, - AutoscaleNotification, - AutoscaleProfile, - AutoscaleSettingResource, - AutoscaleSettingResourceCollection, - AutoscaleSettingResourcePatch, - AzNsActionGroup, - AzureAppPushReceiver, - AzureFunctionReceiver, - BaseResource, - Criteria, - DataContainer, - DiagnosticSettingsCategoryResource, - DiagnosticSettingsResource, - Dimension, - DynamicMetricCriteria, - DynamicThresholdFailingPeriods, - EmailNotification, - EmailReceiver, - ErrorResponse, - ItsmReceiver, - LocationThresholdRuleCondition, - LogicAppReceiver, - LogMetricTrigger, - LogProfileResource, - LogSearchRuleResource, - LogSettings, - LogToMetricAction, - ManagementEventAggregationCondition, - ManagementEventRuleCondition, - MetricAlertAction, - MetricAlertCriteria, - MetricAlertMultipleResourceMultipleMetricCriteria, - MetricAlertResource, - MetricAlertSingleResourceMultipleMetricCriteria, - MetricCriteria, - MetricDimension, - MetricSettings, - MetricTrigger, - MultiMetricCriteria, - ProxyOnlyResource, - ProxyResource, - Recurrence, - RecurrentSchedule, - Resource, - RetentionPolicy, - RuleAction, - RuleCondition, - RuleDataSource, - RuleEmailAction, - RuleManagementEventClaimsDataSource, - RuleManagementEventDataSource, - RuleMetricDataSource, - RuleWebhookAction, - ScaleAction, - ScaleCapacity, - ScaleRule, - Schedule, - SmsReceiver, - Source, - ThresholdRuleCondition, - TimeWindow, - TriggerCondition, - VMInsightsOnboardingStatus, - VoiceReceiver, - WebhookNotification, - WebhookReceiver, - WorkspaceInfo -} from "../models/mappers"; diff --git a/sdk/monitor/arm-monitor/src/models/baselinesMappers.ts b/sdk/monitor/arm-monitor/src/models/baselinesMappers.ts deleted file mode 100644 index b49d6f14718e..000000000000 --- a/sdk/monitor/arm-monitor/src/models/baselinesMappers.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - BaselineMetadata, - ErrorResponse, - MetricBaselinesResponse, - MetricSingleDimension, - SingleBaseline, - SingleMetricBaseline, - TimeSeriesBaseline -} from "../models/mappers"; diff --git a/sdk/monitor/arm-monitor/src/models/diagnosticSettingsCategoryOperationsMappers.ts b/sdk/monitor/arm-monitor/src/models/diagnosticSettingsCategoryOperationsMappers.ts deleted file mode 100644 index 7402d3661f02..000000000000 --- a/sdk/monitor/arm-monitor/src/models/diagnosticSettingsCategoryOperationsMappers.ts +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - Action, - ActionGroupResource, - ActivityLogAlertActionGroup, - ActivityLogAlertActionList, - ActivityLogAlertAllOfCondition, - ActivityLogAlertLeafCondition, - ActivityLogAlertResource, - AlertingAction, - AlertRuleResource, - ArmRoleReceiver, - AutomationRunbookReceiver, - AutoscaleNotification, - AutoscaleProfile, - AutoscaleSettingResource, - AzNsActionGroup, - AzureAppPushReceiver, - AzureFunctionReceiver, - BaseResource, - Criteria, - DataContainer, - DiagnosticSettingsCategoryResource, - DiagnosticSettingsCategoryResourceCollection, - DiagnosticSettingsResource, - Dimension, - DynamicMetricCriteria, - DynamicThresholdFailingPeriods, - EmailNotification, - EmailReceiver, - ErrorResponse, - ItsmReceiver, - LocationThresholdRuleCondition, - LogicAppReceiver, - LogMetricTrigger, - LogProfileResource, - LogSearchRuleResource, - LogSettings, - LogToMetricAction, - ManagementEventAggregationCondition, - ManagementEventRuleCondition, - MetricAlertAction, - MetricAlertCriteria, - MetricAlertMultipleResourceMultipleMetricCriteria, - MetricAlertResource, - MetricAlertSingleResourceMultipleMetricCriteria, - MetricCriteria, - MetricDimension, - MetricSettings, - MetricTrigger, - MultiMetricCriteria, - ProxyOnlyResource, - ProxyResource, - Recurrence, - RecurrentSchedule, - Resource, - RetentionPolicy, - RuleAction, - RuleCondition, - RuleDataSource, - RuleEmailAction, - RuleManagementEventClaimsDataSource, - RuleManagementEventDataSource, - RuleMetricDataSource, - RuleWebhookAction, - ScaleAction, - ScaleCapacity, - ScaleRule, - Schedule, - SmsReceiver, - Source, - ThresholdRuleCondition, - TimeWindow, - TriggerCondition, - VMInsightsOnboardingStatus, - VoiceReceiver, - WebhookNotification, - WebhookReceiver, - WorkspaceInfo -} from "../models/mappers"; diff --git a/sdk/monitor/arm-monitor/src/models/diagnosticSettingsOperationsMappers.ts b/sdk/monitor/arm-monitor/src/models/diagnosticSettingsOperationsMappers.ts deleted file mode 100644 index f0ba9bbf166f..000000000000 --- a/sdk/monitor/arm-monitor/src/models/diagnosticSettingsOperationsMappers.ts +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - Action, - ActionGroupResource, - ActivityLogAlertActionGroup, - ActivityLogAlertActionList, - ActivityLogAlertAllOfCondition, - ActivityLogAlertLeafCondition, - ActivityLogAlertResource, - AlertingAction, - AlertRuleResource, - ArmRoleReceiver, - AutomationRunbookReceiver, - AutoscaleNotification, - AutoscaleProfile, - AutoscaleSettingResource, - AzNsActionGroup, - AzureAppPushReceiver, - AzureFunctionReceiver, - BaseResource, - Criteria, - DataContainer, - DiagnosticSettingsCategoryResource, - DiagnosticSettingsResource, - DiagnosticSettingsResourceCollection, - Dimension, - DynamicMetricCriteria, - DynamicThresholdFailingPeriods, - EmailNotification, - EmailReceiver, - ErrorResponse, - ItsmReceiver, - LocationThresholdRuleCondition, - LogicAppReceiver, - LogMetricTrigger, - LogProfileResource, - LogSearchRuleResource, - LogSettings, - LogToMetricAction, - ManagementEventAggregationCondition, - ManagementEventRuleCondition, - MetricAlertAction, - MetricAlertCriteria, - MetricAlertMultipleResourceMultipleMetricCriteria, - MetricAlertResource, - MetricAlertSingleResourceMultipleMetricCriteria, - MetricCriteria, - MetricDimension, - MetricSettings, - MetricTrigger, - MultiMetricCriteria, - ProxyOnlyResource, - ProxyResource, - Recurrence, - RecurrentSchedule, - Resource, - RetentionPolicy, - RuleAction, - RuleCondition, - RuleDataSource, - RuleEmailAction, - RuleManagementEventClaimsDataSource, - RuleManagementEventDataSource, - RuleMetricDataSource, - RuleWebhookAction, - ScaleAction, - ScaleCapacity, - ScaleRule, - Schedule, - SmsReceiver, - Source, - ThresholdRuleCondition, - TimeWindow, - TriggerCondition, - VMInsightsOnboardingStatus, - VoiceReceiver, - WebhookNotification, - WebhookReceiver, - WorkspaceInfo -} from "../models/mappers"; diff --git a/sdk/monitor/arm-monitor/src/models/eventCategoriesMappers.ts b/sdk/monitor/arm-monitor/src/models/eventCategoriesMappers.ts deleted file mode 100644 index 3be0e41dbda8..000000000000 --- a/sdk/monitor/arm-monitor/src/models/eventCategoriesMappers.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - ErrorResponse, - EventCategoryCollection, - LocalizableString -} from "../models/mappers"; diff --git a/sdk/monitor/arm-monitor/src/models/index.ts b/sdk/monitor/arm-monitor/src/models/index.ts index 88cfd9ddd4cf..34e82344e627 100644 --- a/sdk/monitor/arm-monitor/src/models/index.ts +++ b/sdk/monitor/arm-monitor/src/models/index.ts @@ -1,2943 +1,3582 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export { BaseResource, CloudError }; +export type RuleConditionUnion = + | RuleCondition + | ThresholdRuleCondition + | LocationThresholdRuleCondition + | ManagementEventRuleCondition; +export type RuleDataSourceUnion = + | RuleDataSource + | RuleMetricDataSource + | RuleManagementEventDataSource; +export type RuleActionUnion = RuleAction | RuleEmailAction | RuleWebhookAction; +export type MetricAlertCriteriaUnion = + | MetricAlertCriteria + | MetricAlertSingleResourceMultipleMetricCriteria + | WebtestLocationAvailabilityCriteria + | MetricAlertMultipleResourceMultipleMetricCriteria; +export type ActionUnion = Action | AlertingAction | LogToMetricAction; +export type MultiMetricCriteriaUnion = + | MultiMetricCriteria + | MetricCriteria + | DynamicMetricCriteria; + +/** Represents a collection of autoscale setting resources. */ +export interface AutoscaleSettingResourceCollection { + /** the values for the autoscale setting resources. */ + value: AutoscaleSettingResource[]; + /** URL to get the next set of results. */ + nextLink?: string; +} -/** - * An azure resource object - */ -export interface Resource extends BaseResource { - /** - * Azure resource Id - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * Azure resource name - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * Azure resource type - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; - /** - * Resource location - */ - location: string; - /** - * Resource tags - */ - tags?: { [propertyName: string]: string }; +/** Autoscale profile. */ +export interface AutoscaleProfile { + /** the name of the profile. */ + name: string; + /** the number of instances that can be used during this profile. */ + capacity: ScaleCapacity; + /** the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified. */ + rules: ScaleRule[]; + /** the specific date-time for the profile. This element is not used if the Recurrence element is used. */ + fixedDate?: TimeWindow; + /** the repeating times at which this profile begins. This element is not used if the FixedDate element is used. */ + recurrence?: Recurrence; } -/** - * The number of instances that can be used during this profile. - */ +/** The number of instances that can be used during this profile. */ export interface ScaleCapacity { - /** - * the minimum number of instances for the resource. - */ + /** the minimum number of instances for the resource. */ minimum: string; - /** - * the maximum number of instances for the resource. The actual maximum number of instances is - * limited by the cores that are available in the subscription. - */ + /** the maximum number of instances for the resource. The actual maximum number of instances is limited by the cores that are available in the subscription. */ maximum: string; - /** - * the number of instances that will be set if metrics are not available for evaluation. The - * default is only used if the current instance count is lower than the default. - */ + /** the number of instances that will be set if metrics are not available for evaluation. The default is only used if the current instance count is lower than the default. */ default: string; } -/** - * The trigger that results in a scaling action. - */ +/** A rule that provide the triggers and parameters for the scaling action. */ +export interface ScaleRule { + /** the trigger that results in a scaling action. */ + metricTrigger: MetricTrigger; + /** the parameters for the scaling action. */ + scaleAction: ScaleAction; +} + +/** The trigger that results in a scaling action. */ export interface MetricTrigger { - /** - * the name of the metric that defines what the rule monitors. - */ + /** the name of the metric that defines what the rule monitors. */ metricName: string; - /** - * the resource identifier of the resource the rule monitors. - */ + /** the namespace of the metric that defines what the rule monitors. */ + metricNamespace?: string; + /** the resource identifier of the resource the rule monitors. */ metricResourceUri: string; - /** - * the granularity of metrics the rule monitors. Must be one of the predefined values returned - * from metric definitions for the metric. Must be between 12 hours and 1 minute. - */ + /** the location of the resource the rule monitors. */ + metricResourceLocation?: string; + /** the granularity of metrics the rule monitors. Must be one of the predefined values returned from metric definitions for the metric. Must be between 12 hours and 1 minute. */ timeGrain: string; - /** - * the metric statistic type. How the metrics from multiple instances are combined. Possible - * values include: 'Average', 'Min', 'Max', 'Sum' - */ + /** the metric statistic type. How the metrics from multiple instances are combined. */ statistic: MetricStatisticType; - /** - * the range of time in which instance data is collected. This value must be greater than the - * delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours - * and 5 minutes. - */ + /** the range of time in which instance data is collected. This value must be greater than the delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours and 5 minutes. */ timeWindow: string; - /** - * time aggregation type. How the data that is collected should be combined over time. The - * default value is Average. Possible values include: 'Average', 'Minimum', 'Maximum', 'Total', - * 'Count', 'Last' - */ + /** time aggregation type. How the data that is collected should be combined over time. The default value is Average. */ timeAggregation: TimeAggregationType; - /** - * the operator that is used to compare the metric data and the threshold. Possible values - * include: 'Equals', 'NotEquals', 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', - * 'LessThanOrEqual' - */ + /** the operator that is used to compare the metric data and the threshold. */ operator: ComparisonOperationType; - /** - * the threshold of the metric that triggers the scale action. - */ + /** the threshold of the metric that triggers the scale action. */ threshold: number; + /** List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. */ + dimensions?: ScaleRuleMetricDimension[]; + /** a value indicating whether metric should divide per instance. */ + dividePerInstance?: boolean; +} + +/** Specifies an auto scale rule metric dimension. */ +export interface ScaleRuleMetricDimension { + /** Name of the dimension. */ + dimensionName: string; + /** the dimension operator. Only 'Equals' and 'NotEquals' are supported. 'Equals' being equal to any of the values. 'NotEquals' being not equal to all of the values */ + operator: ScaleRuleMetricDimensionOperationType; + /** list of dimension values. For example: ["App1","App2"]. */ + values: string[]; } -/** - * The parameters for the scaling action. - */ +/** The parameters for the scaling action. */ export interface ScaleAction { - /** - * the scale direction. Whether the scaling action increases or decreases the number of - * instances. Possible values include: 'None', 'Increase', 'Decrease' - */ + /** the scale direction. Whether the scaling action increases or decreases the number of instances. */ direction: ScaleDirection; - /** - * the type of action that should occur when the scale rule fires. Possible values include: - * 'ChangeCount', 'PercentChangeCount', 'ExactCount' - */ + /** the type of action that should occur when the scale rule fires. */ type: ScaleType; - /** - * the number of instances that are involved in the scaling action. This value must be 1 or - * greater. The default value is 1. Default value: '1'. - */ + /** the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is 1. */ value?: string; - /** - * the amount of time to wait since the last scaling action before this action occurs. It must be - * between 1 week and 1 minute in ISO 8601 format. - */ + /** the amount of time to wait since the last scaling action before this action occurs. It must be between 1 week and 1 minute in ISO 8601 format. */ cooldown: string; } -/** - * A rule that provide the triggers and parameters for the scaling action. - */ -export interface ScaleRule { - /** - * the trigger that results in a scaling action. - */ - metricTrigger: MetricTrigger; - /** - * the parameters for the scaling action. - */ - scaleAction: ScaleAction; -} - -/** - * A specific date-time for the profile. - */ +/** A specific date-time for the profile. */ export interface TimeWindow { - /** - * the timezone of the start and end times for the profile. Some examples of valid time zones - * are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific - * Standard Time (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard - * Time (Mexico), Mountain Standard Time, Central America Standard Time, Central Standard Time, - * Central Standard Time (Mexico), Canada Central Standard Time, SA Pacific Standard Time, - * Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard - * Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, - * Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, - * Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo - * Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, - * Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard - * Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central - * European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan - * Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria - * Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, Turkey - * Standard Time, Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic - * Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa - * Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia - * Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, - * Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan - * Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia - * Standard Time, Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard Time, - * SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard - * Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar - * Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia - * Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern Standard - * Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok - * Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New - * Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard - * Time, Samoa Standard Time, Line Islands Standard Time - */ + /** the timezone of the start and end times for the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time */ timeZone?: string; - /** - * the start time for the profile in ISO 8601 format. - */ + /** the start time for the profile in ISO 8601 format. */ start: Date; - /** - * the end time for the profile in ISO 8601 format. - */ + /** the end time for the profile in ISO 8601 format. */ end: Date; } -/** - * The scheduling constraints for when the profile begins. - */ +/** The repeating times at which this profile begins. This element is not used if the FixedDate element is used. */ +export interface Recurrence { + /** the recurrence frequency. How often the schedule profile should take effect. This value must be Week, meaning each week will have the same set of profiles. For example, to set a daily schedule, set **schedule** to every day of the week. The frequency property specifies that the schedule is repeated weekly. */ + frequency: RecurrenceFrequency; + /** the scheduling constraints for when the profile begins. */ + schedule: RecurrentSchedule; +} + +/** The scheduling constraints for when the profile begins. */ export interface RecurrentSchedule { - /** - * the timezone for the hours of the profile. Some examples of valid time zones are: Dateline - * Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time - * (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), - * Mountain Standard Time, Central America Standard Time, Central Standard Time, Central Standard - * Time (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, - * US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard - * Time, Central Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, - * Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA - * Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, - * UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco - * Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe Standard Time, - * Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. - * Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard Time, - * Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, - * South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, - * Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, - * Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, - * Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, - * Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard - * Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka - * Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. - * Central Asia Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard - * Time, China Standard Time, North Asia East Standard Time, Singapore Standard Time, W. - * Australia Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo Standard Time, - * Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard - * Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, - * Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, - * Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji - * Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands - * Standard Time - */ + /** the timezone for the hours of the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time */ timeZone: string; - /** - * the collection of days that the profile takes effect on. Possible values are Sunday through - * Saturday. - */ + /** the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. */ days: string[]; - /** - * A collection of hours that the profile takes effect on. Values supported are 0 to 23 on the - * 24-hour clock (AM/PM times are not supported). - */ + /** A collection of hours that the profile takes effect on. Values supported are 0 to 23 on the 24-hour clock (AM/PM times are not supported). */ hours: number[]; - /** - * A collection of minutes at which the profile takes effect at. - */ + /** A collection of minutes at which the profile takes effect at. */ minutes: number[]; } -/** - * The repeating times at which this profile begins. This element is not used if the FixedDate - * element is used. - */ -export interface Recurrence { - /** - * the recurrence frequency. How often the schedule profile should take effect. This value must - * be Week, meaning each week will have the same set of profiles. For example, to set a daily - * schedule, set **schedule** to every day of the week. The frequency property specifies that the - * schedule is repeated weekly. Possible values include: 'None', 'Second', 'Minute', 'Hour', - * 'Day', 'Week', 'Month', 'Year' - */ - frequency: RecurrenceFrequency; - /** - * the scheduling constraints for when the profile begins. - */ - schedule: RecurrentSchedule; -} - -/** - * Autoscale profile. - */ -export interface AutoscaleProfile { - /** - * the name of the profile. - */ - name: string; - /** - * the number of instances that can be used during this profile. - */ - capacity: ScaleCapacity; - /** - * the collection of rules that provide the triggers and parameters for the scaling action. A - * maximum of 10 rules can be specified. - */ - rules: ScaleRule[]; - /** - * the specific date-time for the profile. This element is not used if the Recurrence element is - * used. - */ - fixedDate?: TimeWindow; - /** - * the repeating times at which this profile begins. This element is not used if the FixedDate - * element is used. - */ - recurrence?: Recurrence; +/** Autoscale notification. */ +export interface AutoscaleNotification { + /** the operation associated with the notification and its value must be "scale" */ + operation: "Scale"; + /** the email notification. */ + email?: EmailNotification; + /** the collection of webhook notifications. */ + webhooks?: WebhookNotification[]; } -/** - * Email notification of an autoscale event. - */ +/** Email notification of an autoscale event. */ export interface EmailNotification { - /** - * a value indicating whether to send email to subscription administrator. - */ + /** a value indicating whether to send email to subscription administrator. */ sendToSubscriptionAdministrator?: boolean; - /** - * a value indicating whether to send email to subscription co-administrators. - */ + /** a value indicating whether to send email to subscription co-administrators. */ sendToSubscriptionCoAdministrators?: boolean; - /** - * the custom e-mails list. This value can be null or empty, in which case this attribute will be - * ignored. - */ + /** the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. */ customEmails?: string[]; } -/** - * Webhook notification of an autoscale event. - */ +/** Webhook notification of an autoscale event. */ export interface WebhookNotification { - /** - * the service address to receive the notification. - */ + /** the service address to receive the notification. */ serviceUri?: string; - /** - * a property bag of settings. This value can be empty. - */ + /** a property bag of settings. This value can be empty. */ properties?: { [propertyName: string]: string }; } -/** - * Autoscale notification. - */ -export interface AutoscaleNotification { - /** - * the email notification. - */ - email?: EmailNotification; - /** - * the collection of webhook notifications. - */ - webhooks?: WebhookNotification[]; -} - -/** - * The autoscale setting resource. - */ -export interface AutoscaleSettingResource extends Resource { - /** - * the collection of automatic scaling profiles that specify different scaling parameters for - * different time periods. A maximum of 20 profiles can be specified. - */ - profiles: AutoscaleProfile[]; - /** - * the collection of notifications. - */ - notifications?: AutoscaleNotification[]; +/** An azure resource object */ +export interface Resource { /** - * the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default - * value is 'true'. Default value: true. + * Azure resource Id + * NOTE: This property will not be serialized. It can only be populated by the server. */ - enabled?: boolean; + readonly id?: string; /** - * the name of the autoscale setting. + * Azure resource name + * NOTE: This property will not be serialized. It can only be populated by the server. */ - autoscaleSettingResourceName?: string; + readonly name?: string; /** - * the resource identifier of the resource that the autoscale setting should be added to. + * Azure resource type + * NOTE: This property will not be serialized. It can only be populated by the server. */ - targetResourceUri?: string; + readonly type?: string; + /** Resource location */ + location: string; + /** Resource tags */ + tags?: { [propertyName: string]: string }; } -/** - * The autoscale setting object for patch operations. - */ +/** Describes the format of Error response. */ +export interface ErrorResponse { + /** Error code */ + code?: string; + /** Error message indicating why the operation failed. */ + message?: string; +} + +/** The autoscale setting object for patch operations. */ export interface AutoscaleSettingResourcePatch { - /** - * Resource tags - */ + /** Resource tags */ tags?: { [propertyName: string]: string }; - /** - * the collection of automatic scaling profiles that specify different scaling parameters for - * different time periods. A maximum of 20 profiles can be specified. - */ - profiles: AutoscaleProfile[]; - /** - * the collection of notifications. - */ + /** the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified. */ + profiles?: AutoscaleProfile[]; + /** the collection of notifications. */ notifications?: AutoscaleNotification[]; - /** - * the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default - * value is 'true'. Default value: true. - */ + /** the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default value is 'true'. */ enabled?: boolean; - /** - * the name of the autoscale setting. - */ + /** the name of the autoscale setting. */ name?: string; - /** - * the resource identifier of the resource that the autoscale setting should be added to. - */ + /** the resource identifier of the resource that the autoscale setting should be added to. */ targetResourceUri?: string; + /** the location of the resource that the autoscale setting should be added to. */ + targetResourceLocation?: string; } -/** - * Describes the format of Error response. - */ -export interface ErrorResponse { - /** - * Error code - */ - code?: string; - /** - * Error message indicating why the operation failed. - */ - message?: string; -} - -/** - * Display metadata associated with the operation. - */ -export interface OperationDisplay { - /** - * Service provider: Microsoft.Insights - */ - provider?: string; - /** - * Resource on which the operation is performed: AlertRules, Autoscale, etc. - */ - resource?: string; - /** - * Operation type: Read, write, delete, etc. - */ - operation?: string; +/** 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 { + /** List of operations supported by the Microsoft.Insights provider. */ + value?: Operation[]; + /** URL to get the next set of operation list results if there are any. */ + nextLink?: string; } -/** - * Microsoft Insights API operation definition. - */ +/** Microsoft Insights API operation definition. */ export interface Operation { - /** - * Operation name: {provider}/{resource}/{operation} - */ + /** Operation name: {provider}/{resource}/{operation} */ name?: string; - /** - * Display metadata associated with the operation. - */ + /** Display metadata associated with the operation. */ display?: OperationDisplay; } -/** - * 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 { - /** - * List of operations supported by the Microsoft.Insights provider. - */ - value?: Operation[]; - /** - * URL to get the next set of operation list results if there are any. - */ - nextLink?: string; +/** Display metadata associated with the operation. */ +export interface OperationDisplay { + /** Service provider: Microsoft.Insights */ + provider?: string; + /** Resource on which the operation is performed: AlertRules, Autoscale, etc. */ + resource?: string; + /** Operation type: Read, write, delete, etc. */ + operation?: string; } -/** - * An alert incident indicates the activation status of an alert rule. - */ +/** An alert incident indicates the activation status of an alert rule. */ export interface Incident { /** * Incident name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** * Rule name that is associated with the incident. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly ruleName?: string; /** * A boolean to indicate whether the incident is active or resolved. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly isActive?: boolean; /** * The time at which the incident was activated in ISO8601 format. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly activatedTime?: Date; /** - * The time at which the incident was resolved in ISO8601 format. If null, it means the incident - * is still active. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The time at which the incident was resolved in ISO8601 format. If null, it means the incident is still active. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly resolvedTime?: Date; } -/** - * Contains the possible cases for RuleDataSource. - */ -export type RuleDataSourceUnion = RuleDataSource | RuleMetricDataSource | RuleManagementEventDataSource; +/** The List incidents operation response. */ +export interface IncidentListResult { + /** the incident collection. */ + value?: Incident[]; +} -/** - * The resource from which the rule collects its data. - */ -export interface RuleDataSource { - /** - * Polymorphic Discriminator - */ - odatatype: "RuleDataSource"; - /** - * the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be - * updated for an existing rule. - */ +/** The condition that results in the alert rule being activated. */ +export interface RuleCondition { + /** Polymorphic discriminator, which specifies the different types this object can be */ + odataType: + | "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition" + | "Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition" + | "Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition"; + /** the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource. */ + dataSource?: RuleDataSourceUnion; +} + +/** The resource from which the rule collects its data. */ +export interface RuleDataSource { + /** Polymorphic discriminator, which specifies the different types this object can be */ + odataType: + | "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource" + | "Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource"; + /** the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule. */ resourceUri?: string; + /** the legacy resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule. */ + legacyResourceId?: string; + /** the location of the resource. */ + resourceLocation?: string; + /** the namespace of the metric. */ + metricNamespace?: string; } -/** - * Contains the possible cases for RuleCondition. - */ -export type RuleConditionUnion = RuleCondition | ThresholdRuleCondition | LocationThresholdRuleCondition | ManagementEventRuleCondition; +/** The action that is performed when the alert rule becomes active, and when an alert condition is resolved. */ +export interface RuleAction { + /** Polymorphic discriminator, which specifies the different types this object can be */ + odataType: + | "Microsoft.Azure.Management.Insights.Models.RuleEmailAction" + | "Microsoft.Azure.Management.Insights.Models.RuleWebhookAction"; +} -/** - * The condition that results in the alert rule being activated. - */ -export interface RuleCondition { - /** - * Polymorphic Discriminator - */ - odatatype: "RuleCondition"; +/** The alert rule object for patch operations. */ +export interface AlertRuleResourcePatch { + /** Resource tags */ + tags?: { [propertyName: string]: string }; + /** the name of the alert rule. */ + name?: string; + /** the description of the alert rule that will be included in the alert email. */ + description?: string; + /** the provisioning state. */ + provisioningState?: string; + /** the flag that indicates whether the alert rule is enabled. */ + isEnabled?: boolean; + /** the condition that results in the alert rule being activated. */ + condition?: RuleConditionUnion; + /** action that is performed when the alert rule becomes active, and when an alert condition is resolved. */ + action?: RuleActionUnion; + /** the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. */ + actions?: RuleActionUnion[]; /** - * the resource from which the rule collects its data. For this type dataSource will always be of - * type RuleMetricDataSource. + * Last time the rule was updated in ISO8601 format. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - dataSource?: RuleDataSourceUnion; + readonly lastUpdatedTime?: Date; } -/** - * A rule metric data source. The discriminator value is always RuleMetricDataSource in this case. - */ -export interface RuleMetricDataSource { +/** Represents a collection of alert rule resources. */ +export interface AlertRuleResourceCollection { + /** the values for the alert rule resources. */ + value?: AlertRuleResource[]; +} + +/** Specifies the retention policy for the log. */ +export interface RetentionPolicy { + /** a value indicating whether the retention policy is enabled. */ + enabled: boolean; + /** the number of days for the retention in days. A value of 0 will retain the events indefinitely. */ + days: number; +} + +/** The log profile resource for patch operations. */ +export interface LogProfileResourcePatch { + /** Resource tags */ + tags?: { [propertyName: string]: string }; + /** the resource id of the storage account to which you would like to send the Activity Log. */ + storageAccountId?: string; + /** The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming the Activity Log. The rule ID is of the format: '{service bus resource ID}/authorizationrules/{key name}'. */ + serviceBusRuleId?: string; + /** List of regions for which Activity Log events should be stored or streamed. It is a comma separated list of valid ARM locations including the 'global' location. */ + locations?: string[]; + /** the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.' */ + categories?: string[]; + /** the retention policy for the events in the log. */ + retentionPolicy?: RetentionPolicy; +} + +/** Represents a collection of log profiles. */ +export interface LogProfileCollection { + /** the values of the log profiles. */ + value: LogProfileResource[]; +} + +/** Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular metric. */ +export interface MetricSettings { + /** the timegrain of the metric in ISO8601 format. */ + timeGrain?: string; + /** Name of a Diagnostic Metric category for a resource type this setting is applied to. To obtain the list of Diagnostic metric categories for a resource, first perform a GET diagnostic settings operation. */ + category?: string; + /** a value indicating whether this category is enabled. */ + enabled: boolean; + /** the retention policy for this category. */ + retentionPolicy?: RetentionPolicy; +} + +/** Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular log. */ +export interface LogSettings { + /** Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation. */ + category?: string; + /** a value indicating whether this log is enabled. */ + enabled: boolean; + /** the retention policy for this log. */ + retentionPolicy?: RetentionPolicy; +} + +/** A proxy only azure resource object */ +export interface ProxyOnlyResource { /** - * Polymorphic Discriminator + * Azure resource Id + * NOTE: This property will not be serialized. It can only be populated by the server. */ - odatatype: "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource"; + readonly id?: string; /** - * the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be - * updated for an existing rule. + * Azure resource name + * NOTE: This property will not be serialized. It can only be populated by the server. */ - resourceUri?: string; + readonly name?: string; /** - * the name of the metric that defines what the rule monitors. + * Azure resource type + * NOTE: This property will not be serialized. It can only be populated by the server. */ - metricName?: string; + readonly type?: string; } -/** - * The claims for a rule management event data source. - */ -export interface RuleManagementEventClaimsDataSource { +/** Represents a collection of alert rule resources. */ +export interface DiagnosticSettingsResourceCollection { + /** The collection of diagnostic settings resources;. */ + value?: DiagnosticSettingsResource[]; +} + +/** Represents a collection of diagnostic setting category resources. */ +export interface DiagnosticSettingsCategoryResourceCollection { + /** The collection of diagnostic settings category resources. */ + value?: DiagnosticSettingsCategoryResource[]; +} + +/** An email receiver. */ +export interface EmailReceiver { + /** The name of the email receiver. Names must be unique across all receivers within an action group. */ + name: string; + /** The email address of this receiver. */ + emailAddress: string; + /** Indicates whether to use common alert schema. */ + useCommonAlertSchema?: boolean; /** - * the email address. + * The receiver status of the e-mail. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - emailAddress?: string; + readonly status?: ReceiverStatus; } -/** - * A rule management event data source. The discriminator fields is always - * RuleManagementEventDataSource in this case. - */ -export interface RuleManagementEventDataSource { +/** An SMS receiver. */ +export interface SmsReceiver { + /** The name of the SMS receiver. Names must be unique across all receivers within an action group. */ + name: string; + /** The country code of the SMS receiver. */ + countryCode: string; + /** The phone number of the SMS receiver. */ + phoneNumber: string; /** - * Polymorphic Discriminator + * The status of the receiver. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - odatatype: "Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource"; + readonly status?: ReceiverStatus; +} + +/** A webhook receiver. */ +export interface WebhookReceiver { + /** The name of the webhook receiver. Names must be unique across all receivers within an action group. */ + name: string; + /** The URI where webhooks should be sent. */ + serviceUri: string; + /** Indicates whether to use common alert schema. */ + useCommonAlertSchema?: boolean; + /** Indicates whether or not use AAD authentication. */ + useAadAuth?: boolean; + /** Indicates the webhook app object Id for aad auth. */ + objectId?: string; + /** Indicates the identifier uri for aad auth. */ + identifierUri?: string; + /** Indicates the tenant id for aad auth. */ + tenantId?: string; +} + +/** An Itsm receiver. */ +export interface ItsmReceiver { + /** The name of the Itsm receiver. Names must be unique across all receivers within an action group. */ + name: string; + /** OMS LA instance identifier. */ + workspaceId: string; + /** Unique identification of ITSM connection among multiple defined in above workspace. */ + connectionId: string; + /** JSON blob for the configurations of the ITSM action. CreateMultipleWorkItems option will be part of this blob as well. */ + ticketConfiguration: string; + /** Region in which workspace resides. Supported values:'centralindia','japaneast','southeastasia','australiasoutheast','uksouth','westcentralus','canadacentral','eastus','westeurope' */ + region: string; +} + +/** The Azure mobile App push notification receiver. */ +export interface AzureAppPushReceiver { + /** The name of the Azure mobile app push receiver. Names must be unique across all receivers within an action group. */ + name: string; + /** The email address registered for the Azure mobile app. */ + emailAddress: string; +} + +/** The Azure Automation Runbook notification receiver. */ +export interface AutomationRunbookReceiver { + /** The Azure automation account Id which holds this runbook and authenticate to Azure resource. */ + automationAccountId: string; + /** The name for this runbook. */ + runbookName: string; + /** The resource id for webhook linked to this runbook. */ + webhookResourceId: string; + /** Indicates whether this instance is global runbook. */ + isGlobalRunbook: boolean; + /** Indicates name of the webhook. */ + name?: string; + /** The URI where webhooks should be sent. */ + serviceUri?: string; + /** Indicates whether to use common alert schema. */ + useCommonAlertSchema?: boolean; +} + +/** A voice receiver. */ +export interface VoiceReceiver { + /** The name of the voice receiver. Names must be unique across all receivers within an action group. */ + name: string; + /** The country code of the voice receiver. */ + countryCode: string; + /** The phone number of the voice receiver. */ + phoneNumber: string; +} + +/** A logic app receiver. */ +export interface LogicAppReceiver { + /** The name of the logic app receiver. Names must be unique across all receivers within an action group. */ + name: string; + /** The azure resource id of the logic app receiver. */ + resourceId: string; + /** The callback url where http request sent to. */ + callbackUrl: string; + /** Indicates whether to use common alert schema. */ + useCommonAlertSchema?: boolean; +} + +/** An azure function receiver. */ +export interface AzureFunctionReceiver { + /** The name of the azure function receiver. Names must be unique across all receivers within an action group. */ + name: string; + /** The azure resource id of the function app. */ + functionAppResourceId: string; + /** The function name in the function app. */ + functionName: string; + /** The http trigger url where http request sent to. */ + httpTriggerUrl: string; + /** Indicates whether to use common alert schema. */ + useCommonAlertSchema?: boolean; +} + +/** An arm role receiver. */ +export interface ArmRoleReceiver { + /** The name of the arm role receiver. Names must be unique across all receivers within an action group. */ + name: string; + /** The arm role id. */ + roleId: string; + /** Indicates whether to use common alert schema. */ + useCommonAlertSchema?: boolean; +} + +/** An Event hub receiver. */ +export interface EventHubReceiver { + /** The name of the Event hub receiver. Names must be unique across all receivers within an action group. */ + name: string; + /** The Event Hub namespace */ + eventHubNameSpace: string; + /** The name of the specific Event Hub queue */ + eventHubName: string; + /** Indicates whether to use common alert schema. */ + useCommonAlertSchema?: boolean; + /** The tenant Id for the subscription containing this event hub */ + tenantId?: string; + /** The Id for the subscription containing this event hub */ + subscriptionId: string; +} + +/** An azure resource object */ +export interface AzureResource { /** - * the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be - * updated for an existing rule. + * Azure resource Id + * NOTE: This property will not be serialized. It can only be populated by the server. */ - resourceUri?: string; + readonly id?: string; /** - * the event name. + * Azure resource name + * NOTE: This property will not be serialized. It can only be populated by the server. */ - eventName?: string; + readonly name?: string; /** - * the event source. + * Azure resource type + * NOTE: This property will not be serialized. It can only be populated by the server. */ - eventSource?: string; + readonly type?: string; /** - * the level. + * Azure resource kind + * NOTE: This property will not be serialized. It can only be populated by the server. */ - level?: string; + readonly kind?: string; /** - * The name of the operation that should be checked for. If no name is provided, any operation - * will match. + * Azure resource identity + * NOTE: This property will not be serialized. It can only be populated by the server. */ - operationName?: string; + readonly identity?: string; + /** Resource location */ + location: string; + /** Resource tags */ + tags?: { [propertyName: string]: string }; +} + +/** An action group object for the body of patch operations. */ +export interface ActionGroupPatchBody { + /** Resource tags */ + tags?: { [propertyName: string]: string }; + /** Indicates whether this action group is enabled. If an action group is not enabled, then none of its actions will be activated. */ + enabled?: boolean; +} + +/** The request body which contain contact detail metadata */ +export interface NotificationRequestBody { + /** The name of the supported alert type. */ + alertType: string; + /** The list of email receivers that are part of this action group. */ + emailReceivers?: EmailReceiver[]; + /** The list of SMS receivers that are part of this action group. */ + smsReceivers?: SmsReceiver[]; + /** The list of webhook receivers that are part of this action group. */ + webhookReceivers?: WebhookReceiver[]; + /** The list of ITSM receivers that are part of this action group. */ + itsmReceivers?: ItsmReceiver[]; + /** The list of AzureAppPush receivers that are part of this action group. */ + azureAppPushReceivers?: AzureAppPushReceiver[]; + /** The list of AutomationRunbook receivers that are part of this action group. */ + automationRunbookReceivers?: AutomationRunbookReceiver[]; + /** The list of voice receivers that are part of this action group. */ + voiceReceivers?: VoiceReceiver[]; + /** The list of logic app receivers that are part of this action group. */ + logicAppReceivers?: LogicAppReceiver[]; + /** The list of azure function receivers that are part of this action group. */ + azureFunctionReceivers?: AzureFunctionReceiver[]; + /** The list of ARM role receivers that are part of this action group. Roles are Azure RBAC roles and only built-in roles are supported. */ + armRoleReceivers?: ArmRoleReceiver[]; + /** The list of event hub receivers that are part of this action group. */ + eventHubReceivers?: EventHubReceiver[]; +} + +/** The response when test notification succeeded */ +export interface TestNotificationResponse { + /** The notification id */ + notificationId: string; + /** The correlation id */ + correlationId: string; + /** The created time */ + createdTime: string; +} + +/** The details of the test notification results. */ +export interface TestNotificationDetailsResponse { + /** The context info */ + context?: Context; + /** The overall state */ + state: string; + /** The completed time */ + completedTime?: string; + /** The created time */ + createdTime?: string; + /** The list of action detail */ + actionDetails?: ActionDetail[]; +} + +/** The context info */ +export interface Context { + /** The source of the notification request */ + notificationSource?: string; + /** The context id type */ + contextType?: string; +} + +/** The action detail */ +export interface ActionDetail { + /** The mechanism type */ + mechanismType?: string; + /** The name of the action */ + name?: string; + /** The status of the action */ + status?: string; + /** The substatus of the action */ + subState?: string; + /** The send time */ + sendTime?: string; + /** The detail of the friendly error message */ + detail?: string; +} + +/** A list of action groups. */ +export interface ActionGroupList { + /** The list of action groups. */ + value?: ActionGroupResource[]; + /** Provides the link to retrieve the next set of elements. */ + nextLink?: string; +} + +/** Describes a receiver that should be resubscribed. */ +export interface EnableRequest { + /** The name of the receiver to resubscribe. */ + receiverName: string; +} + +/** Represents collection of events. */ +export interface EventDataCollection { + /** this list that includes the Azure audit logs. */ + value: EventData[]; + /** Provides the link to retrieve the next set of events. */ + nextLink?: string; +} + +/** The Azure event log entries are of type EventData */ +export interface EventData { /** - * the resource group name. + * The sender authorization information. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - resourceGroupName?: string; + readonly authorization?: SenderAuthorization; /** - * the resource provider name. + * key value pairs to identify ARM permissions. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - resourceProviderName?: string; + readonly claims?: { [propertyName: string]: string }; /** - * The status of the operation that should be checked for. If no status is provided, any status - * will match. + * the email address of the user who has performed the operation, the UPN claim or SPN claim based on availability. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - status?: string; + readonly caller?: string; /** - * the substatus. + * the description of the event. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - subStatus?: string; + readonly description?: string; /** - * the claims. + * the Id of this event as required by ARM for RBAC. It contains the EventDataID and a timestamp information. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - claims?: RuleManagementEventClaimsDataSource; -} - -/** - * A rule condition based on a metric crossing a threshold. - */ -export interface ThresholdRuleCondition { + readonly id?: string; /** - * Polymorphic Discriminator + * the event data Id. This is a unique identifier for an event. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - odatatype: "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition"; + readonly eventDataId?: string; /** - * the resource from which the rule collects its data. For this type dataSource will always be of - * type RuleMetricDataSource. + * the correlation Id, usually a GUID in the string format. The correlation Id is shared among the events that belong to the same uber operation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - dataSource?: RuleDataSourceUnion; + readonly correlationId?: string; /** - * the operator used to compare the data and the threshold. Possible values include: - * 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual' + * the event name. This value should not be confused with OperationName. For practical purposes, OperationName might be more appealing to end users. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - operator: ConditionOperator; + readonly eventName?: LocalizableString; /** - * the threshold value that activates the alert. + * the event category. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - threshold: number; + readonly category?: LocalizableString; /** - * the period of time (in ISO 8601 duration format) that is used to monitor alert activity based - * on the threshold. If specified then it must be between 5 minutes and 1 day. + * the HTTP request info. Usually includes the 'clientRequestId', 'clientIpAddress' (IP address of the user who initiated the event) and 'method' (HTTP method e.g. PUT). + * NOTE: This property will not be serialized. It can only be populated by the server. */ - windowSize?: string; + readonly httpRequest?: HttpRequestInfo; /** - * the time aggregation operator. How the data that are collected should be combined over time. - * The default value is the PrimaryAggregationType of the Metric. Possible values include: - * 'Average', 'Minimum', 'Maximum', 'Total', 'Last' + * the event level + * NOTE: This property will not be serialized. It can only be populated by the server. */ - timeAggregation?: TimeAggregationOperator; -} - -/** - * A rule condition based on a certain number of locations failing. - */ -export interface LocationThresholdRuleCondition { + readonly level?: EventLevel; /** - * Polymorphic Discriminator + * the resource group name of the impacted resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - odatatype: "Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition"; + readonly resourceGroupName?: string; /** - * the resource from which the rule collects its data. For this type dataSource will always be of - * type RuleMetricDataSource. + * the resource provider name of the impacted resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - dataSource?: RuleDataSourceUnion; + readonly resourceProviderName?: LocalizableString; /** - * the period of time (in ISO 8601 duration format) that is used to monitor alert activity based - * on the threshold. If specified then it must be between 5 minutes and 1 day. + * the resource uri that uniquely identifies the resource that caused this event. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - windowSize?: string; + readonly resourceId?: string; /** - * the number of locations that must fail to activate the alert. + * the resource type + * NOTE: This property will not be serialized. It can only be populated by the server. */ - failedLocationCount: number; -} - -/** - * How the data that is collected should be combined over time. - */ -export interface ManagementEventAggregationCondition { + readonly resourceType?: LocalizableString; /** - * the condition operator. Possible values include: 'GreaterThan', 'GreaterThanOrEqual', - * 'LessThan', 'LessThanOrEqual' + * It is usually a GUID shared among the events corresponding to single operation. This value should not be confused with EventName. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - operator?: ConditionOperator; + readonly operationId?: string; /** - * The threshold value that activates the alert. + * the operation name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - threshold?: number; + readonly operationName?: LocalizableString; /** - * the period of time (in ISO 8601 duration format) that is used to monitor alert activity based - * on the threshold. If specified then it must be between 5 minutes and 1 day. + * the set of pairs (usually a Dictionary) that includes details about the event. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - windowSize?: string; -} - -/** - * A management event rule condition. - */ -export interface ManagementEventRuleCondition { + readonly properties?: { [propertyName: string]: string }; /** - * Polymorphic Discriminator + * a string describing the status of the operation. Some typical values are: Started, In progress, Succeeded, Failed, Resolved. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - odatatype: "Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition"; + readonly status?: LocalizableString; /** - * the resource from which the rule collects its data. For this type dataSource will always be of - * type RuleMetricDataSource. + * the event sub status. Most of the time, when included, this captures the HTTP status code of the REST call. Common values are: OK (HTTP Status Code: 200), Created (HTTP Status Code: 201), Accepted (HTTP Status Code: 202), No Content (HTTP Status Code: 204), Bad Request(HTTP Status Code: 400), Not Found (HTTP Status Code: 404), Conflict (HTTP Status Code: 409), Internal Server Error (HTTP Status Code: 500), Service Unavailable (HTTP Status Code:503), Gateway Timeout (HTTP Status Code: 504) + * NOTE: This property will not be serialized. It can only be populated by the server. */ - dataSource?: RuleDataSourceUnion; + readonly subStatus?: LocalizableString; /** - * How the data that is collected should be combined over time and when the alert is activated. - * Note that for management event alerts aggregation is optional – if it is not provided then any - * event will cause the alert to activate. + * the timestamp of when the event was generated by the Azure service processing the request corresponding the event. It in ISO 8601 format. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - aggregation?: ManagementEventAggregationCondition; -} - -/** - * Contains the possible cases for RuleAction. - */ -export type RuleActionUnion = RuleAction | RuleEmailAction | RuleWebhookAction; - -/** - * The action that is performed when the alert rule becomes active, and when an alert condition is - * resolved. - */ -export interface RuleAction { - /** - * Polymorphic Discriminator - */ - odatatype: "RuleAction"; -} - -/** - * Specifies the action to send email when the rule condition is evaluated. The discriminator is - * always RuleEmailAction in this case. - */ -export interface RuleEmailAction { - /** - * Polymorphic Discriminator - */ - odatatype: "Microsoft.Azure.Management.Insights.Models.RuleEmailAction"; - /** - * Whether the administrators (service and co-administrators) of the service should be notified - * when the alert is activated. - */ - sendToServiceOwners?: boolean; - /** - * the list of administrator's custom email addresses to notify of the activation of the alert. - */ - customEmails?: string[]; -} - -/** - * Specifies the action to post to service when the rule condition is evaluated. The discriminator - * is always RuleWebhookAction in this case. - */ -export interface RuleWebhookAction { - /** - * Polymorphic Discriminator - */ - odatatype: "Microsoft.Azure.Management.Insights.Models.RuleWebhookAction"; - /** - * the service uri to Post the notification when the alert activates or resolves. - */ - serviceUri?: string; - /** - * the dictionary of custom properties to include with the post operation. These data are - * appended to the webhook payload. - */ - properties?: { [propertyName: string]: string }; -} - -/** - * The alert rule resource. - */ -export interface AlertRuleResource extends Resource { - /** - * the name of the alert rule. - */ - alertRuleResourceName: string; - /** - * the description of the alert rule that will be included in the alert email. - */ - description?: string; - /** - * the flag that indicates whether the alert rule is enabled. - */ - isEnabled: boolean; - /** - * the condition that results in the alert rule being activated. - */ - condition: RuleConditionUnion; - /** - * the array of actions that are performed when the alert rule becomes active, and when an alert - * condition is resolved. - */ - actions?: RuleActionUnion[]; - /** - * Last time the rule was updated in ISO8601 format. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly lastUpdatedTime?: Date; -} - -/** - * The alert rule object for patch operations. - */ -export interface AlertRuleResourcePatch { - /** - * Resource tags - */ - tags?: { [propertyName: string]: string }; - /** - * the name of the alert rule. - */ - name: string; - /** - * the description of the alert rule that will be included in the alert email. - */ - description?: string; - /** - * the flag that indicates whether the alert rule is enabled. - */ - isEnabled: boolean; - /** - * the condition that results in the alert rule being activated. - */ - condition: RuleConditionUnion; - /** - * the array of actions that are performed when the alert rule becomes active, and when an alert - * condition is resolved. - */ - actions?: RuleActionUnion[]; - /** - * Last time the rule was updated in ISO8601 format. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly lastUpdatedTime?: Date; -} - -/** - * Specifies the retention policy for the log. - */ -export interface RetentionPolicy { - /** - * a value indicating whether the retention policy is enabled. - */ - enabled: boolean; - /** - * the number of days for the retention in days. A value of 0 will retain the events - * indefinitely. - */ - days: number; -} - -/** - * The log profile resource. - */ -export interface LogProfileResource extends Resource { - /** - * the resource id of the storage account to which you would like to send the Activity Log. - */ - storageAccountId?: string; - /** - * The service bus rule ID of the service bus namespace in which you would like to have Event - * Hubs created for streaming the Activity Log. The rule ID is of the format: '{service bus - * resource ID}/authorizationrules/{key name}'. - */ - serviceBusRuleId?: string; - /** - * List of regions for which Activity Log events should be stored or streamed. It is a comma - * separated list of valid ARM locations including the 'global' location. - */ - locations: string[]; - /** - * the categories of the logs. These categories are created as is convenient to the user. Some - * values are: 'Write', 'Delete', and/or 'Action.' - */ - categories: string[]; - /** - * the retention policy for the events in the log. - */ - retentionPolicy: RetentionPolicy; -} - -/** - * The log profile resource for patch operations. - */ -export interface LogProfileResourcePatch { - /** - * Resource tags - */ - tags?: { [propertyName: string]: string }; - /** - * the resource id of the storage account to which you would like to send the Activity Log. - */ - storageAccountId?: string; - /** - * The service bus rule ID of the service bus namespace in which you would like to have Event - * Hubs created for streaming the Activity Log. The rule ID is of the format: '{service bus - * resource ID}/authorizationrules/{key name}'. - */ - serviceBusRuleId?: string; - /** - * List of regions for which Activity Log events should be stored or streamed. It is a comma - * separated list of valid ARM locations including the 'global' location. - */ - locations: string[]; - /** - * the categories of the logs. These categories are created as is convenient to the user. Some - * values are: 'Write', 'Delete', and/or 'Action.' - */ - categories: string[]; - /** - * the retention policy for the events in the log. - */ - retentionPolicy: RetentionPolicy; -} - -/** - * A proxy only azure resource object - */ -export interface ProxyOnlyResource extends BaseResource { - /** - * Azure resource Id - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * Azure resource name - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * Azure resource type - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; -} - -/** - * Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular metric. - */ -export interface MetricSettings { - /** - * the timegrain of the metric in ISO8601 format. - */ - timeGrain?: string; - /** - * Name of a Diagnostic Metric category for a resource type this setting is applied to. To obtain - * the list of Diagnostic metric categories for a resource, first perform a GET diagnostic - * settings operation. - */ - category?: string; - /** - * a value indicating whether this category is enabled. - */ - enabled: boolean; - /** - * the retention policy for this category. - */ - retentionPolicy?: RetentionPolicy; -} - -/** - * Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular log. - */ -export interface LogSettings { - /** - * Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain - * the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings - * operation. - */ - category?: string; - /** - * a value indicating whether this log is enabled. - */ - enabled: boolean; - /** - * the retention policy for this log. - */ - retentionPolicy?: RetentionPolicy; -} - -/** - * The diagnostic setting resource. - */ -export interface DiagnosticSettingsResource extends ProxyOnlyResource { - /** - * The resource ID of the storage account to which you would like to send Diagnostic Logs. - */ - storageAccountId?: string; - /** - * The service bus rule Id of the diagnostic setting. This is here to maintain backwards - * compatibility. - */ - serviceBusRuleId?: string; - /** - * The resource Id for the event hub authorization rule. - */ - eventHubAuthorizationRuleId?: string; - /** - * The name of the event hub. If none is specified, the default event hub will be selected. - */ - eventHubName?: string; - /** - * The list of metric settings. - */ - metrics?: MetricSettings[]; - /** - * The list of logs settings. - */ - logs?: LogSettings[]; - /** - * The full ARM resource ID of the Log Analytics workspace to which you would like to send - * Diagnostic Logs. Example: - * /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 - */ - workspaceId?: string; - /** - * A string indicating whether the export to Log Analytics should use the default destination - * type, i.e. AzureDiagnostics, or use a destination type constructed as follows: _. Possible values are: Dedicated and null (null is - * default.) - */ - logAnalyticsDestinationType?: string; -} - -/** - * Represents a collection of alert rule resources. - */ -export interface DiagnosticSettingsResourceCollection { - /** - * The collection of diagnostic settings resources;. - */ - value?: DiagnosticSettingsResource[]; -} - -/** - * The diagnostic settings category resource. - */ -export interface DiagnosticSettingsCategoryResource extends ProxyOnlyResource { - /** - * The type of the diagnostic settings category. Possible values include: 'Metrics', 'Logs' - */ - categoryType?: CategoryType; -} - -/** - * Represents a collection of diagnostic setting category resources. - */ -export interface DiagnosticSettingsCategoryResourceCollection { - /** - * The collection of diagnostic settings category resources. - */ - value?: DiagnosticSettingsCategoryResource[]; -} - -/** - * An email receiver. - */ -export interface EmailReceiver { - /** - * The name of the email receiver. Names must be unique across all receivers within an action - * group. - */ - name: string; - /** - * The email address of this receiver. - */ - emailAddress: string; - /** - * Indicates whether to use common alert schema. - */ - useCommonAlertSchema: boolean; - /** - * The receiver status of the e-mail. Possible values include: 'NotSpecified', 'Enabled', - * 'Disabled' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly status?: ReceiverStatus; -} - -/** - * An SMS receiver. - */ -export interface SmsReceiver { - /** - * The name of the SMS receiver. Names must be unique across all receivers within an action - * group. - */ - name: string; - /** - * The country code of the SMS receiver. - */ - countryCode: string; - /** - * The phone number of the SMS receiver. - */ - phoneNumber: string; - /** - * The status of the receiver. Possible values include: 'NotSpecified', 'Enabled', 'Disabled' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly status?: ReceiverStatus; -} - -/** - * A webhook receiver. - */ -export interface WebhookReceiver { - /** - * The name of the webhook receiver. Names must be unique across all receivers within an action - * group. - */ - name: string; - /** - * The URI where webhooks should be sent. - */ - serviceUri: string; - /** - * Indicates whether to use common alert schema. - */ - useCommonAlertSchema: boolean; - /** - * Indicates whether or not use AAD authentication. Default value: false. - */ - useAadAuth?: boolean; - /** - * Indicates the webhook app object Id for aad auth. - */ - objectId?: string; - /** - * Indicates the identifier uri for aad auth. - */ - identifierUri?: string; - /** - * Indicates the tenant id for aad auth. - */ - tenantId?: string; -} - -/** - * An Itsm receiver. - */ -export interface ItsmReceiver { - /** - * The name of the Itsm receiver. Names must be unique across all receivers within an action - * group. - */ - name: string; - /** - * OMS LA instance identifier. - */ - workspaceId: string; - /** - * Unique identification of ITSM connection among multiple defined in above workspace. - */ - connectionId: string; - /** - * JSON blob for the configurations of the ITSM action. CreateMultipleWorkItems option will be - * part of this blob as well. - */ - ticketConfiguration: string; - /** - * Region in which workspace resides. Supported - * values:'centralindia','japaneast','southeastasia','australiasoutheast','uksouth','westcentralus','canadacentral','eastus','westeurope' - */ - region: string; -} - -/** - * The Azure mobile App push notification receiver. - */ -export interface AzureAppPushReceiver { - /** - * The name of the Azure mobile app push receiver. Names must be unique across all receivers - * within an action group. - */ - name: string; - /** - * The email address registered for the Azure mobile app. - */ - emailAddress: string; -} - -/** - * The Azure Automation Runbook notification receiver. - */ -export interface AutomationRunbookReceiver { - /** - * The Azure automation account Id which holds this runbook and authenticate to Azure resource. - */ - automationAccountId: string; - /** - * The name for this runbook. - */ - runbookName: string; - /** - * The resource id for webhook linked to this runbook. - */ - webhookResourceId: string; - /** - * Indicates whether this instance is global runbook. - */ - isGlobalRunbook: boolean; - /** - * Indicates name of the webhook. - */ - name?: string; - /** - * The URI where webhooks should be sent. - */ - serviceUri?: string; - /** - * Indicates whether to use common alert schema. - */ - useCommonAlertSchema: boolean; -} - -/** - * A voice receiver. - */ -export interface VoiceReceiver { - /** - * The name of the voice receiver. Names must be unique across all receivers within an action - * group. - */ - name: string; - /** - * The country code of the voice receiver. - */ - countryCode: string; - /** - * The phone number of the voice receiver. - */ - phoneNumber: string; -} - -/** - * A logic app receiver. - */ -export interface LogicAppReceiver { - /** - * The name of the logic app receiver. Names must be unique across all receivers within an action - * group. - */ - name: string; - /** - * The azure resource id of the logic app receiver. - */ - resourceId: string; - /** - * The callback url where http request sent to. - */ - callbackUrl: string; - /** - * Indicates whether to use common alert schema. - */ - useCommonAlertSchema: boolean; -} - -/** - * An azure function receiver. - */ -export interface AzureFunctionReceiver { - /** - * The name of the azure function receiver. Names must be unique across all receivers within an - * action group. - */ - name: string; - /** - * The azure resource id of the function app. - */ - functionAppResourceId: string; - /** - * The function name in the function app. - */ - functionName: string; - /** - * The http trigger url where http request sent to. - */ - httpTriggerUrl: string; - /** - * Indicates whether to use common alert schema. - */ - useCommonAlertSchema: boolean; -} - -/** - * An arm role receiver. - */ -export interface ArmRoleReceiver { - /** - * The name of the arm role receiver. Names must be unique across all receivers within an action - * group. - */ - name: string; - /** - * The arm role id. - */ - roleId: string; - /** - * Indicates whether to use common alert schema. - */ - useCommonAlertSchema: boolean; -} - -/** - * An action group resource. - */ -export interface ActionGroupResource extends Resource { - /** - * The short name of the action group. This will be used in SMS messages. - */ - groupShortName: string; - /** - * Indicates whether this action group is enabled. If an action group is not enabled, then none - * of its receivers will receive communications. Default value: true. - */ - enabled: boolean; - /** - * The list of email receivers that are part of this action group. - */ - emailReceivers?: EmailReceiver[]; - /** - * The list of SMS receivers that are part of this action group. - */ - smsReceivers?: SmsReceiver[]; - /** - * The list of webhook receivers that are part of this action group. - */ - webhookReceivers?: WebhookReceiver[]; - /** - * The list of ITSM receivers that are part of this action group. - */ - itsmReceivers?: ItsmReceiver[]; - /** - * The list of AzureAppPush receivers that are part of this action group. - */ - azureAppPushReceivers?: AzureAppPushReceiver[]; - /** - * The list of AutomationRunbook receivers that are part of this action group. - */ - automationRunbookReceivers?: AutomationRunbookReceiver[]; - /** - * The list of voice receivers that are part of this action group. - */ - voiceReceivers?: VoiceReceiver[]; - /** - * The list of logic app receivers that are part of this action group. - */ - logicAppReceivers?: LogicAppReceiver[]; - /** - * The list of azure function receivers that are part of this action group. - */ - azureFunctionReceivers?: AzureFunctionReceiver[]; - /** - * The list of ARM role receivers that are part of this action group. Roles are Azure RBAC roles - * and only built-in roles are supported. - */ - armRoleReceivers?: ArmRoleReceiver[]; -} - -/** - * Describes a receiver that should be resubscribed. - */ -export interface EnableRequest { - /** - * The name of the receiver to resubscribe. - */ - receiverName: string; -} - -/** - * An action group object for the body of patch operations. - */ -export interface ActionGroupPatchBody { - /** - * Resource tags - */ - tags?: { [propertyName: string]: string }; - /** - * Indicates whether this action group is enabled. If an action group is not enabled, then none - * of its actions will be activated. Default value: true. - */ - enabled?: boolean; -} - -/** - * An Activity Log alert condition that is met by comparing an activity log field and value. - */ -export interface ActivityLogAlertLeafCondition { - /** - * The name of the field that this condition will examine. The possible values for this field are - * (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', - * 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything - * beginning with 'properties.'. - */ - field: string; - /** - * The field value will be compared to this value (case-insensitive) to determine if the - * condition is met. - */ - equals: string; -} - -/** - * An Activity Log alert condition that is met when all its member conditions are met. - */ -export interface ActivityLogAlertAllOfCondition { - /** - * The list of activity log alert conditions. - */ - allOf: ActivityLogAlertLeafCondition[]; -} - -/** - * A pointer to an Azure Action Group. - */ -export interface ActivityLogAlertActionGroup { - /** - * The resourceId of the action group. This cannot be null or empty. - */ - actionGroupId: string; - /** - * the dictionary of custom properties to include with the post operation. These data are - * appended to the webhook payload. - */ - webhookProperties?: { [propertyName: string]: string }; -} - -/** - * A list of activity log alert actions. - */ -export interface ActivityLogAlertActionList { - /** - * The list of activity log alerts. - */ - actionGroups?: ActivityLogAlertActionGroup[]; -} - -/** - * An activity log alert resource. - */ -export interface ActivityLogAlertResource extends Resource { - /** - * A list of resourceIds that will be used as prefixes. The alert will only apply to activityLogs - * with resourceIds that fall under one of these prefixes. This list must include at least one - * item. - */ - scopes: string[]; - /** - * Indicates whether this activity log alert is enabled. If an activity log alert is not enabled, - * then none of its actions will be activated. Default value: true. - */ - enabled?: boolean; - /** - * The condition that will cause this alert to activate. - */ - condition: ActivityLogAlertAllOfCondition; - /** - * The actions that will activate when the condition is met. - */ - actions: ActivityLogAlertActionList; - /** - * A description of this activity log alert. - */ - description?: string; -} - -/** - * An activity log alert object for the body of patch operations. - */ -export interface ActivityLogAlertPatchBody { - /** - * Resource tags - */ - tags?: { [propertyName: string]: string }; - /** - * Indicates whether this activity log alert is enabled. If an activity log alert is not enabled, - * then none of its actions will be activated. Default value: true. - */ - enabled?: boolean; -} - -/** - * The localizable string class. - */ -export interface LocalizableString { - /** - * the invariant value. - */ - value: string; - /** - * the locale specific value. - */ - localizedValue?: string; -} - -/** - * the authorization used by the user who has performed the operation that led to this event. This - * captures the RBAC properties of the event. These usually include the 'action', 'role' and the - * 'scope' - */ -export interface SenderAuthorization { - /** - * the permissible actions. For instance: microsoft.support/supporttickets/write - */ - action?: string; - /** - * the role of the user. For instance: Subscription Admin - */ - role?: string; - /** - * the scope. - */ - scope?: string; -} - -/** - * The Http request info. - */ -export interface HttpRequestInfo { - /** - * the client request id. - */ - clientRequestId?: string; - /** - * the client Ip Address - */ - clientIpAddress?: string; - /** - * the Http request method. - */ - method?: string; - /** - * the Uri. - */ - uri?: string; -} - -/** - * The Azure event log entries are of type EventData - */ -export interface EventData { - /** - * The sender authorization information. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly authorization?: SenderAuthorization; - /** - * key value pairs to identify ARM permissions. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly claims?: { [propertyName: string]: string }; - /** - * the email address of the user who has performed the operation, the UPN claim or SPN claim - * based on availability. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly caller?: string; - /** - * the description of the event. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly description?: string; - /** - * the Id of this event as required by ARM for RBAC. It contains the EventDataID and a timestamp - * information. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * the event data Id. This is a unique identifier for an event. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly eventDataId?: string; - /** - * the correlation Id, usually a GUID in the string format. The correlation Id is shared among - * the events that belong to the same uber operation. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly correlationId?: string; - /** - * the event name. This value should not be confused with OperationName. For practical purposes, - * OperationName might be more appealing to end users. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly eventName?: LocalizableString; - /** - * the event category. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly category?: LocalizableString; - /** - * the HTTP request info. Usually includes the 'clientRequestId', 'clientIpAddress' (IP address - * of the user who initiated the event) and 'method' (HTTP method e.g. PUT). - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly httpRequest?: HttpRequestInfo; - /** - * the event level. Possible values include: 'Critical', 'Error', 'Warning', 'Informational', - * 'Verbose' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly level?: EventLevel; - /** - * the resource group name of the impacted resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly resourceGroupName?: string; - /** - * the resource provider name of the impacted resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly resourceProviderName?: LocalizableString; - /** - * the resource uri that uniquely identifies the resource that caused this event. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly resourceId?: string; - /** - * the resource type - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly resourceType?: LocalizableString; - /** - * It is usually a GUID shared among the events corresponding to single operation. This value - * should not be confused with EventName. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly operationId?: string; - /** - * the operation name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly operationName?: LocalizableString; - /** - * the set of pairs (usually a Dictionary) that includes details - * about the event. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly properties?: { [propertyName: string]: string }; - /** - * a string describing the status of the operation. Some typical values are: Started, In - * progress, Succeeded, Failed, Resolved. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly status?: LocalizableString; - /** - * the event sub status. Most of the time, when included, this captures the HTTP status code of - * the REST call. Common values are: OK (HTTP Status Code: 200), Created (HTTP Status Code: 201), - * Accepted (HTTP Status Code: 202), No Content (HTTP Status Code: 204), Bad Request(HTTP Status - * Code: 400), Not Found (HTTP Status Code: 404), Conflict (HTTP Status Code: 409), Internal - * Server Error (HTTP Status Code: 500), Service Unavailable (HTTP Status Code:503), Gateway - * Timeout (HTTP Status Code: 504) - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly subStatus?: LocalizableString; - /** - * the timestamp of when the event was generated by the Azure service processing the request - * corresponding the event. It in ISO 8601 format. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly eventTimestamp?: Date; - /** - * the timestamp of when the event became available for querying via this API. It is in ISO 8601 - * format. This value should not be confused eventTimestamp. As there might be a delay between - * the occurrence time of the event, and the time that the event is submitted to the Azure - * logging infrastructure. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly submissionTimestamp?: Date; - /** - * the Azure subscription Id usually a GUID. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly subscriptionId?: string; - /** - * the Azure tenant Id - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly tenantId?: string; -} - -/** - * Metric availability specifies the time grain (aggregation interval or frequency) and the - * retention period for that time grain. - */ -export interface MetricAvailability { - /** - * the time grain specifies the aggregation interval for the metric. Expressed as a duration - * 'PT1M', 'P1D', etc. - */ - timeGrain?: string; - /** - * the retention period for the metric at the specified timegrain. Expressed as a duration - * 'PT1M', 'P1D', etc. - */ - retention?: string; -} - -/** - * 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; - /** - * the unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', - * 'CountPerSecond', 'BytesPerSecond', 'Percent', 'MilliSeconds', 'ByteSeconds', 'Unspecified', - * 'Cores', 'MilliCores', 'NanoCores', 'BitsPerSecond' - */ - unit?: Unit; - /** - * the primary aggregation type value defining how to use the values for display. Possible values - * include: 'None', 'Average', 'Count', 'Minimum', 'Maximum', 'Total' - */ - 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[]; -} - -/** - * Represents a metric value. - */ -export interface MetricValue { - /** - * the timestamp for the metric value in ISO 8601 format. - */ - timeStamp: Date; - /** - * the average value in the time range. - */ - average?: number; - /** - * the least value in the time range. - */ - minimum?: number; - /** - * the greatest value in the time range. - */ - maximum?: number; - /** - * the sum of all of the values in the time range. - */ - total?: number; - /** - * the number of samples in the time range. Can be used to determine the number of values that - * contributed to the average value. - */ - count?: number; -} - -/** - * Represents a metric metadata value. - */ -export interface MetadataValue { - /** - * the name of the metadata. - */ - name?: LocalizableString; - /** - * the value of the metadata. - */ - value?: string; -} - -/** - * A time series result type. The discriminator value is always TimeSeries in this case. - */ -export interface TimeSeriesElement { - /** - * the metadata values returned if $filter was specified in the call. - */ - metadatavalues?: MetadataValue[]; - /** - * An array of data points representing the metric values. This is only returned if a result - * type of data is specified. - */ - data?: MetricValue[]; -} - -/** - * The result data of a query. - */ -export interface Metric { - /** - * the metric Id. - */ - id: string; - /** - * the resource type of the metric resource. - */ - type: string; + readonly eventTimestamp?: Date; /** - * the name and the display name of the metric, i.e. it is localizable string. + * the timestamp of when the event became available for querying via this API. It is in ISO 8601 format. This value should not be confused eventTimestamp. As there might be a delay between the occurrence time of the event, and the time that the event is submitted to the Azure logging infrastructure. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - name: LocalizableString; + readonly submissionTimestamp?: Date; /** - * the unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', - * 'CountPerSecond', 'BytesPerSecond', 'Percent', 'MilliSeconds', 'ByteSeconds', 'Unspecified', - * 'Cores', 'MilliCores', 'NanoCores', 'BitsPerSecond' + * the Azure subscription Id usually a GUID. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - unit: Unit; + readonly subscriptionId?: string; /** - * the time series returned when a data query is performed. + * the Azure tenant Id + * NOTE: This property will not be serialized. It can only be populated by the server. */ - timeseries: TimeSeriesElement[]; + readonly tenantId?: string; } -/** - * The response to a metrics query. - */ +/** the authorization used by the user who has performed the operation that led to this event. This captures the RBAC properties of the event. These usually include the 'action', 'role' and the 'scope' */ +export interface SenderAuthorization { + /** the permissible actions. For instance: microsoft.support/supporttickets/write */ + action?: string; + /** the role of the user. For instance: Subscription Admin */ + role?: string; + /** the scope. */ + scope?: string; +} + +/** The localizable string class. */ +export interface LocalizableString { + /** the invariant value. */ + value: string; + /** the locale specific value. */ + localizedValue?: string; +} + +/** The Http request info. */ +export interface HttpRequestInfo { + /** the client request id. */ + clientRequestId?: string; + /** the client Ip Address */ + clientIpAddress?: string; + /** the Http request method. */ + method?: string; + /** the Uri. */ + uri?: string; +} + +/** A collection of event categories. Currently possible values are: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. */ +export interface EventCategoryCollection { + /** the list that includes the Azure event categories. */ + value: LocalizableString[]; +} + +/** 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[]; +} + +/** Metric availability specifies the time grain (aggregation interval or frequency) and the retention period for that time grain. */ +export interface MetricAvailability { + /** the time grain specifies the aggregation interval for the metric. Expressed as a duration 'PT1M', 'P1D', etc. */ + timeGrain?: string; + /** the retention period for the metric at the specified timegrain. Expressed as a duration 'PT1M', 'P1D', etc. */ + retention?: string; +} + +/** The response to a metrics query. */ export interface Response { - /** - * The integer value representing the cost of the query, for data case. - */ + /** 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. - */ + /** 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. - */ + /** 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 - */ + /** The namespace of the metrics being queried */ namespace?: string; - /** - * The region of the resource been queried for metrics. - */ + /** The region of the resource being queried for metrics. */ resourceregion?: string; - /** - * the value of the collection. - */ + /** the value of the collection. */ value: Metric[]; } -/** - * Represents a baseline metadata value. - */ -export interface BaselineMetadataValue { - /** - * the name of the metadata. - */ +/** The result data of a query. */ +export interface Metric { + /** the metric Id. */ + id: string; + /** the resource type of the metric resource. */ + type: string; + /** the name and the display name of the metric, i.e. it is localizable string. */ + name: LocalizableString; + /** Detailed description of this metric. */ + displayDescription?: string; + /** 'Success' or the error details on query failures for this metric. */ + errorCode?: string; + /** Error message encountered querying this specific metric. */ + errorMessage?: string; + /** The unit of the metric. */ + unit: MetricUnit; + /** the time series returned when a data query is performed. */ + timeseries: TimeSeriesElement[]; +} + +/** A time series result type. The discriminator value is always TimeSeries in this case. */ +export interface TimeSeriesElement { + /** the metadata values returned if $filter was specified in the call. */ + metadatavalues?: MetadataValue[]; + /** An array of data points representing the metric values. This is only returned if a result type of data is specified. */ + data?: MetricValue[]; +} + +/** Represents a metric metadata value. */ +export interface MetadataValue { + /** the name of the metadata. */ name?: LocalizableString; - /** - * the value of the metadata. - */ + /** the value of the metadata. */ value?: string; } -/** - * The baseline values for a single sensitivity value. - */ -export interface Baseline { - /** - * the sensitivity of the baseline. Possible values include: 'Low', 'Medium', 'High' - */ - sensitivity: Sensitivity; - /** - * The low thresholds of the baseline. - */ - lowThresholds: number[]; - /** - * The high thresholds of the baseline. - */ - highThresholds: number[]; +/** Represents a metric value. */ +export interface MetricValue { + /** the timestamp for the metric value in ISO 8601 format. */ + timeStamp: Date; + /** the average value in the time range. */ + average?: number; + /** the least value in the time range. */ + minimum?: number; + /** the greatest value in the time range. */ + maximum?: number; + /** the sum of all of the values in the time range. */ + total?: number; + /** the number of samples in the time range. Can be used to determine the number of values that contributed to the average value. */ + count?: number; } -/** - * The response to a baseline query. - */ -export interface BaselineResponse { - /** - * the metric baseline Id. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * the resource type of the baseline resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; - /** - * the name and the display name of the metric, i.e. it is localizable string. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: LocalizableString; - /** - * 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 aggregation type of the metric. - */ - aggregation?: string; - /** - * the array of timestamps of the baselines. - */ - timestamps?: Date[] | string[]; - /** - * the baseline values for each sensitivity. - */ - baseline?: Baseline[]; - /** - * the baseline metadata values. - */ - metadata?: BaselineMetadataValue[]; +/** A list of metric baselines. */ +export interface MetricBaselinesResponse { + /** The list of metric baselines. */ + value?: SingleMetricBaseline[]; } -/** - * The time series info needed for calculating the baseline. - */ -export interface TimeSeriesInformation { - /** - * the list of sensitivities for calculating the baseline. - */ - sensitivities: string[]; - /** - * The metric values to calculate the baseline. - */ - values: number[]; - /** - * the array of timestamps of the baselines. - */ - timestamps?: Date[] | string[]; +/** The baseline results of a single metric. */ +export interface SingleMetricBaseline { + /** The metric baseline Id. */ + id: string; + /** The resource type of the metric baseline resource. */ + type: string; + /** The name of the metric for which the baselines were retrieved. */ + name: string; + /** The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by '/'. This may be adjusted in the future and returned back from what was originally requested. */ + timespan: string; + /** The interval (window size) for which the metric data was returned in. This may be adjusted in the future and returned back from what was originally requested. This is not present if a metadata request was made. */ + interval: string; + /** The namespace of the metrics been queried. */ + namespace?: string; + /** The baseline for each time series that was queried. */ + baselines: TimeSeriesBaseline[]; } -/** - * The response to a calculate baseline call. - */ -export interface CalculateBaselineResponse { - /** - * the resource type of the baseline resource. - */ - type: string; - /** - * the array of timestamps of the baselines. - */ - timestamps?: Date[] | string[]; - /** - * the baseline values for each sensitivity. - */ - baseline: Baseline[]; +/** The baseline values for a single time series. */ +export interface TimeSeriesBaseline { + /** The aggregation type of the metric. */ + aggregation: string; + /** The dimensions of this time series. */ + dimensions?: MetricSingleDimension[]; + /** The list of timestamps of the baselines. */ + timestamps: Date[]; + /** The baseline values for each sensitivity. */ + data: SingleBaseline[]; + /** The baseline metadata values. */ + metadataValues?: BaselineMetadata[]; } -/** - * The metric dimension name and value. - */ +/** The metric dimension name and value. */ export interface MetricSingleDimension { - /** - * Name of the dimension. - */ + /** Name of the dimension. */ name: string; - /** - * Value of the dimension. - */ + /** Value of the dimension. */ value: string; } -/** - * The baseline values for a single sensitivity value. - */ +/** The baseline values for a single sensitivity value. */ export interface SingleBaseline { - /** - * the sensitivity of the baseline. Possible values include: 'Low', 'Medium', 'High' - */ + /** the sensitivity of the baseline. */ sensitivity: BaselineSensitivity; - /** - * The low thresholds of the baseline. - */ + /** The low thresholds of the baseline. */ lowThresholds: number[]; - /** - * The high thresholds of the baseline. - */ + /** The high thresholds of the baseline. */ highThresholds: number[]; } -/** - * Represents a baseline metadata value. - */ +/** Represents a baseline metadata value. */ export interface BaselineMetadata { - /** - * Name of the baseline metadata. - */ + /** Name of the baseline metadata. */ name: string; - /** - * Value of the baseline metadata. - */ + /** Value of the baseline metadata. */ value: string; } -/** - * The baseline values for a single time series. - */ -export interface TimeSeriesBaseline { - /** - * The aggregation type of the metric. - */ - aggregation: string; - /** - * The dimensions of this time series. - */ - dimensions?: MetricSingleDimension[]; - /** - * The list of timestamps of the baselines. - */ - timestamps: Date[] | string[]; - /** - * The baseline values for each sensitivity. - */ - data: SingleBaseline[]; - /** - * The baseline metadata values. - */ - metadata?: BaselineMetadata[]; +/** Represents a collection of alert rule resources. */ +export interface MetricAlertResourceCollection { + /** the values for the alert rule resources. */ + value?: MetricAlertResource[]; } -/** - * The baseline results of a single metric. - */ -export interface SingleMetricBaseline { - /** - * The metric baseline Id. - */ - id: string; - /** - * The resource type of the metric baseline resource. - */ - type: string; - /** - * The name of the metric for which the baselines were retrieved. - */ - name: string; - /** - * The timespan for which the data was retrieved. Its value consists of two datetimes - * concatenated, separated by '/'. This may be adjusted in the future and returned back from - * what was originally requested. - */ - timespan: string; - /** - * The interval (window size) for which the metric data was returned in. This may be adjusted in - * the future and returned back from what was originally requested. This is not present if a - * metadata request was made. - */ - interval: string; - /** - * The namespace of the metrics been queried. - */ - namespace?: string; - /** - * The baseline for each time series that was queried. - */ - baselines: TimeSeriesBaseline[]; +/** The rule criteria that defines the conditions of the alert rule. */ +export interface MetricAlertCriteria { + /** Polymorphic discriminator, which specifies the different types this object can be */ + odataType: + | "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria" + | "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria" + | "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria"; + /** Describes unknown properties. The value of an unknown property can be of "any" type. */ + [property: string]: any; } -/** - * An alert action. - */ +/** An alert action. */ export interface MetricAlertAction { + /** the id of the action group to use. */ + actionGroupId?: string; + /** This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook. */ + webHookProperties?: { [propertyName: string]: string }; +} + +/** The metric alert resource for patch operations. */ +export interface MetricAlertResourcePatch { + /** Resource tags */ + tags?: { [propertyName: string]: string }; + /** the description of the metric alert that will be included in the alert email. */ + description?: string; + /** Alert severity {0, 1, 2, 3, 4} */ + severity?: number; + /** the flag that indicates whether the metric alert is enabled. */ + enabled?: boolean; + /** the list of resource id's that this metric alert is scoped to. */ + scopes?: string[]; + /** how often the metric alert is evaluated represented in ISO 8601 duration format. */ + evaluationFrequency?: string; + /** the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. */ + windowSize?: string; + /** the resource type of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. */ + targetResourceType?: string; + /** the region of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. */ + targetResourceRegion?: string; + /** defines the specific alert criteria information. */ + criteria?: MetricAlertCriteriaUnion; + /** the flag that indicates whether the alert should be auto resolved or not. The default is true. */ + autoMitigate?: boolean; + /** the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. */ + actions?: MetricAlertAction[]; /** - * the id of the action group to use. + * Last time the rule was updated in ISO8601 format. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - actionGroupId?: string; + readonly lastUpdatedTime?: Date; /** - * The properties of a webhook object. + * the value indicating whether this alert rule is migrated. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - webhookProperties?: { [propertyName: string]: string }; + readonly isMigrated?: boolean; +} + +/** Represents a collection of alert rule resources. */ +export interface MetricAlertStatusCollection { + /** the values for the alert rule resources. */ + value?: MetricAlertStatus[]; +} + +/** An alert status. */ +export interface MetricAlertStatus { + /** The status name. */ + name?: string; + /** The alert rule arm id. */ + id?: string; + /** The extended resource type name. */ + type?: string; + /** The alert status properties of the metric alert status. */ + properties?: MetricAlertStatusProperties; +} + +/** An alert status properties. */ +export interface MetricAlertStatusProperties { + /** An object describing the type of the dimensions. */ + dimensions?: { [propertyName: string]: string }; + /** status value */ + status?: string; + /** UTC time when the status was checked. */ + timestamp?: Date; +} + +/** Specifies the log search query. */ +export interface Source { + /** Log search query. Required for action type - AlertingAction */ + query?: string; + /** List of Resource referred into query */ + authorizedResources?: string[]; + /** The resource uri over which log search query is to be run. */ + dataSourceId: string; + /** Set value to 'ResultCount' . */ + queryType?: QueryType; } -/** - * Contains the possible cases for MetricAlertCriteria. - */ -export type MetricAlertCriteriaUnion = MetricAlertCriteria | MetricAlertSingleResourceMultipleMetricCriteria | MetricAlertMultipleResourceMultipleMetricCriteria; +/** Defines how often to run the search and the time interval. */ +export interface Schedule { + /** frequency (in minutes) at which rule condition should be evaluated. */ + frequencyInMinutes: number; + /** Time window for which data needs to be fetched for query (should be greater than or equal to frequencyInMinutes). */ + timeWindowInMinutes: number; +} -/** - * The rule criteria that defines the conditions of the alert rule. - */ -export interface MetricAlertCriteria { - /** - * Polymorphic Discriminator - */ - odatatype: "MetricAlertCriteria"; - /** - * Describes unknown properties. The value of an unknown property can be of "any" type. - */ - [property: string]: any; +/** Action descriptor. */ +export interface Action { + /** Polymorphic discriminator, which specifies the different types this object can be */ + odataType: + | "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction" + | "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction"; } -/** - * The metric alert resource. - */ -export interface MetricAlertResource extends Resource { +/** An azure resource object */ +export interface ResourceAutoGenerated { /** - * the description of the metric alert that will be included in the alert email. + * Azure resource Id + * NOTE: This property will not be serialized. It can only be populated by the server. */ - description: string; + readonly id?: string; /** - * Alert severity {0, 1, 2, 3, 4} + * Azure resource name + * NOTE: This property will not be serialized. It can only be populated by the server. */ - severity: number; + readonly name?: string; /** - * the flag that indicates whether the metric alert is enabled. + * Azure resource type + * NOTE: This property will not be serialized. It can only be populated by the server. */ - enabled: boolean; + readonly type?: string; + /** Resource location */ + location: string; + /** Resource tags */ + tags?: { [propertyName: string]: string }; /** - * the list of resource id's that this metric alert is scoped to. + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - scopes?: string[]; + readonly kind?: string; /** - * how often the metric alert is evaluated represented in ISO 8601 duration format. + * The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - evaluationFrequency: string; + readonly etag?: string; +} + +/** Describes the format of Error response. */ +export interface ErrorContract { + /** The error details. */ + error?: ErrorResponse; +} + +/** The log search rule resource for patch operations. */ +export interface LogSearchRuleResourcePatch { + /** Resource tags */ + tags?: { [propertyName: string]: string }; + /** The flag which indicates whether the Log Search rule is enabled. Value should be true or false */ + enabled?: Enabled; +} + +/** Represents a collection of Log Search rule resources. */ +export interface LogSearchRuleResourceCollection { + /** The values for the Log Search Rule resources. */ + value?: LogSearchRuleResource[]; +} + +/** Represents collection of metric namespaces. */ +export interface MetricNamespaceCollection { + /** The values for the metric namespaces. */ + value: MetricNamespace[]; +} + +/** Metric namespace class specifies the metadata for a metric namespace. */ +export interface MetricNamespace { + /** The ID of the metric namespace. */ + id?: string; + /** The type of the namespace. */ + type?: string; + /** The escaped name of the namespace. */ + name?: string; + /** Kind of namespace */ + classification?: NamespaceClassification; + /** Properties which include the fully qualified namespace name. */ + properties?: MetricNamespaceName; +} + +/** The fully qualified metric namespace name. */ +export interface MetricNamespaceName { + /** The metric namespace name. */ + metricNamespaceName?: string; +} + +/** Information about a container with data for a given resource. */ +export interface DataContainer { + /** Log Analytics workspace information. */ + workspace: WorkspaceInfo; +} + +/** Information about a Log Analytics Workspace. */ +export interface WorkspaceInfo { + /** Azure Resource Manager identifier of the Log Analytics Workspace. */ + id: string; + /** Location of the Log Analytics workspace. */ + location: string; + /** Log Analytics workspace identifier. */ + customerId: string; +} + +/** An azure resource object */ +export interface ProxyResource { /** - * the period of time (in ISO 8601 duration format) that is used to monitor alert activity based - * on the threshold. + * Azure resource Id + * NOTE: This property will not be serialized. It can only be populated by the server. */ - windowSize: string; + readonly id?: string; /** - * the resource type of the target resource(s) on which the alert is created/updated. Mandatory - * for MultipleResourceMultipleMetricCriteria. + * Azure resource name + * NOTE: This property will not be serialized. It can only be populated by the server. */ - targetResourceType?: string; + readonly name?: string; /** - * the region of the target resource(s) on which the alert is created/updated. Mandatory for - * MultipleResourceMultipleMetricCriteria. + * Azure resource type + * NOTE: This property will not be serialized. It can only be populated by the server. */ - targetResourceRegion?: string; + readonly type?: string; +} + +/** An error response from the API. */ +export interface ResponseWithError { + /** Error information. */ + error: ErrorModel; +} + +/** Error details. */ +export interface ErrorModel { + /** Error code identifying the specific error. */ + code: string; + /** Error message in the caller's locale. */ + message?: string; +} + +/** Describes the list of Azure Monitor PrivateLinkScope resources. */ +export interface AzureMonitorPrivateLinkScopeListResult { + /** List of Azure Monitor PrivateLinkScope definitions. */ + value: AzureMonitorPrivateLinkScope[]; + /** The URI to get the next set of Azure Monitor PrivateLinkScope definitions if too many PrivateLinkScopes where returned in the result set. */ + nextLink?: string; +} + +/** Private endpoint which the connection belongs to. */ +export interface PrivateEndpointProperty { + /** Resource id of the private endpoint. */ + id?: string; +} + +/** State of the private endpoint connection. */ +export interface PrivateLinkServiceConnectionStateProperty { + /** The private link service connection status. */ + status: string; + /** The private link service connection description. */ + description: string; /** - * defines the specific alert criteria information. + * The actions required for private link service connection. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - criteria: MetricAlertCriteriaUnion; + readonly actionsRequired?: string; +} + +/** An azure resource object */ +export interface PrivateLinkScopesResource { /** - * the flag that indicates whether the alert should be auto resolved or not. + * Azure resource Id + * NOTE: This property will not be serialized. It can only be populated by the server. */ - autoMitigate?: boolean; + readonly id?: string; /** - * the array of actions that are performed when the alert rule becomes active, and when an alert - * condition is resolved. + * Azure resource name + * NOTE: This property will not be serialized. It can only be populated by the server. */ - actions?: MetricAlertAction[]; + readonly name?: string; /** - * Last time the rule was updated in ISO8601 format. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Azure resource type + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly lastUpdatedTime?: Date; + readonly type?: string; + /** Resource location */ + location: string; + /** Resource tags */ + tags?: { [propertyName: string]: string }; } -/** - * The metric alert resource for patch operations. - */ -export interface MetricAlertResourcePatch { +/** A container holding only the Tags for a resource, allowing the user to update the tags on a PrivateLinkScope instance. */ +export interface TagsResource { + /** Resource tags */ + tags?: { [propertyName: string]: string }; +} + +/** The status of operation. */ +export interface OperationStatus { + /** The operation Id. */ + id?: string; + /** The operation name. */ + name?: string; + /** Start time of the job in standard ISO8601 format. */ + startTime?: Date; + /** End time of the job in standard ISO8601 format. */ + endTime?: Date; + /** The status of the operation. */ + status?: string; + /** The error detail of the operation if any. */ + error?: ErrorResponseCommon; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { /** - * Resource tags + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: { [propertyName: string]: string }; + readonly type?: string; /** - * the description of the metric alert that will be included in the alert email. + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - description: string; + readonly info?: Record; +} + +/** A list of private link resources */ +export interface PrivateLinkResourceListResult { /** - * Alert severity {0, 1, 2, 3, 4} + * Array of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - severity: number; + readonly value?: PrivateLinkResource[]; /** - * the flag that indicates whether the metric alert is enabled. + * Link to retrieve next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - enabled: boolean; + readonly nextLink?: string; +} + +/** A list of private endpoint connections. */ +export interface PrivateEndpointConnectionListResult { /** - * the list of resource id's that this metric alert is scoped to. + * Array of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - scopes?: string[]; + readonly value?: PrivateEndpointConnection[]; /** - * how often the metric alert is evaluated represented in ISO 8601 duration format. + * Link to retrieve next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - evaluationFrequency: string; + readonly nextLink?: string; +} + +/** A list of scoped resources in a private link scope. */ +export interface ScopedResourceListResult { /** - * the period of time (in ISO 8601 duration format) that is used to monitor alert activity based - * on the threshold. + * Array of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - windowSize: string; + readonly value?: ScopedResource[]; /** - * the resource type of the target resource(s) on which the alert is created/updated. Mandatory - * for MultipleResourceMultipleMetricCriteria. + * Link to retrieve next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - targetResourceType?: string; + readonly nextLink?: string; +} + +/** An Activity Log alert condition that is met when all its member conditions are met. */ +export interface ActivityLogAlertAllOfCondition { + /** The list of activity log alert conditions. */ + allOf: ActivityLogAlertLeafCondition[]; +} + +/** An Activity Log alert condition that is met by comparing an activity log field and value. */ +export interface ActivityLogAlertLeafCondition { + /** The name of the field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties.'. */ + field: string; + /** The field value will be compared to this value (case-insensitive) to determine if the condition is met. */ + equals: string; +} + +/** A list of activity log alert actions. */ +export interface ActivityLogAlertActionList { + /** The list of activity log alerts. */ + actionGroups?: ActivityLogAlertActionGroup[]; +} + +/** A pointer to an Azure Action Group. */ +export interface ActivityLogAlertActionGroup { + /** The resourceId of the action group. This cannot be null or empty. */ + actionGroupId: string; + /** the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. */ + webhookProperties?: { [propertyName: string]: string }; +} + +/** An activity log alert object for the body of patch operations. */ +export interface ActivityLogAlertPatchBody { + /** Resource tags */ + tags?: { [propertyName: string]: string }; + /** Indicates whether this activity log alert is enabled. If an activity log alert is not enabled, then none of its actions will be activated. */ + enabled?: boolean; +} + +/** A list of activity log alerts. */ +export interface ActivityLogAlertList { + /** The list of activity log alerts. */ + value?: ActivityLogAlertResource[]; + /** Provides the link to retrieve the next set of elements. */ + nextLink?: string; +} + +/** A pageable list of resources. */ +export interface DataCollectionEndpointResourceListResult { + /** A list of resources. */ + value: DataCollectionEndpointResource[]; + /** The URL to use for getting the next set of results. */ + nextLink?: string; +} + +/** Definition of ARM tracked top level resource. */ +export interface DataCollectionEndpointResource { + /** The geo-location where the resource lives. */ + location: string; + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The kind of the resource. */ + kind?: KnownDataCollectionEndpointResourceKind; /** - * the region of the target resource(s) on which the alert is created/updated. Mandatory for - * MultipleResourceMultipleMetricCriteria. + * Fully qualified ID of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - targetResourceRegion?: string; + readonly id?: string; /** - * defines the specific alert criteria information. + * The name of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - criteria: MetricAlertCriteriaUnion; + readonly name?: string; /** - * the flag that indicates whether the alert should be auto resolved or not. + * The type of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - autoMitigate?: boolean; + readonly type?: string; /** - * the array of actions that are performed when the alert rule becomes active, and when an alert - * condition is resolved. + * Resource entity tag (ETag). + * NOTE: This property will not be serialized. It can only be populated by the server. */ - actions?: MetricAlertAction[]; + readonly etag?: string; /** - * Last time the rule was updated in ISO8601 format. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly lastUpdatedTime?: Date; + readonly systemData?: DataCollectionEndpointResourceSystemData; + /** Description of the data collection endpoint. */ + description?: string; + /** The immutable ID of this data collection endpoint resource. This property is READ-ONLY. */ + immutableId?: string; + /** The endpoint used by agents to access their configuration. */ + configurationAccess?: DataCollectionEndpointConfigurationAccess; + /** The endpoint used by clients to ingest logs. */ + logsIngestion?: DataCollectionEndpointLogsIngestion; + /** Network access control rules for the endpoints. */ + networkAcls?: DataCollectionEndpointNetworkAcls; + /** + * The resource provisioning state. This property is READ-ONLY. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: KnownDataCollectionEndpointProvisioningState; } -/** - * An alert status properties. - */ -export interface MetricAlertStatusProperties { +/** Definition of data collection endpoint. */ +export interface DataCollectionEndpoint { + /** Description of the data collection endpoint. */ + description?: string; + /** The immutable ID of this data collection endpoint resource. This property is READ-ONLY. */ + immutableId?: string; + /** The endpoint used by agents to access their configuration. */ + configurationAccess?: DataCollectionEndpointConfigurationAccess; + /** The endpoint used by clients to ingest logs. */ + logsIngestion?: DataCollectionEndpointLogsIngestion; + /** Network access control rules for the endpoints. */ + networkAcls?: DataCollectionEndpointNetworkAcls; /** - * An object describing the type of the dimensions. + * The resource provisioning state. This property is READ-ONLY. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - dimensions?: { [propertyName: string]: string }; + readonly provisioningState?: KnownDataCollectionEndpointProvisioningState; +} + +/** Definition of the endpoint used for accessing configuration. */ +export interface ConfigurationAccessEndpointSpec { /** - * status value + * The endpoint. This property is READ-ONLY. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - status?: string; + readonly endpoint?: string; +} + +/** Definition of the endpoint used for ingesting logs. */ +export interface LogsIngestionEndpointSpec { /** - * UTC time when the status was checked. + * The endpoint. This property is READ-ONLY. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - timestamp?: Date; + readonly endpoint?: string; } -/** - * An alert status. - */ -export interface MetricAlertStatus { +/** 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; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponseCommonV2 { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { /** - * The status name. + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - name?: string; + readonly code?: string; /** - * The alert rule arm id. + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - id?: string; + readonly message?: string; /** - * The extended resource type name. + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - type?: string; + readonly target?: string; /** - * The alert status properties of the metric alert status. + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - properties?: MetricAlertStatusProperties; -} - -/** - * Represents a collection of alert rule resources. - */ -export interface MetricAlertStatusCollection { + readonly details?: ErrorDetail[]; /** - * the values for the alert rule resources. + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - value?: MetricAlertStatus[]; + readonly additionalInfo?: ErrorAdditionalInfo[]; } -/** - * Contains the possible cases for MultiMetricCriteria. - */ -export type MultiMetricCriteriaUnion = MultiMetricCriteria | MetricCriteria | DynamicMetricCriteria; +/** Definition of ARM tracked top level resource properties for update operation. */ +export interface ResourceForUpdate { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; +} -/** - * The types of conditions for a multi resource alert. - */ -export interface MultiMetricCriteria { +/** A pageable list of resources. */ +export interface DataCollectionRuleAssociationProxyOnlyResourceListResult { + /** A list of resources. */ + value: DataCollectionRuleAssociationProxyOnlyResource[]; + /** The URL to use for getting the next set of results. */ + nextLink?: string; +} + +/** Definition of generic ARM proxy resource. */ +export interface DataCollectionRuleAssociationProxyOnlyResource { /** - * Polymorphic Discriminator + * Fully qualified ID of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - criterionType: "MultiMetricCriteria"; + readonly id?: string; /** - * Name of the criteria. + * The name of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - name: string; + readonly name?: string; /** - * Name of the metric. + * The type of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - metricName: string; + readonly type?: string; /** - * Namespace of the metric. + * Resource entity tag (ETag). + * NOTE: This property will not be serialized. It can only be populated by the server. */ - metricNamespace?: string; + readonly etag?: string; /** - * the criteria time aggregation types. + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - timeAggregation: any; + readonly systemData?: DataCollectionRuleAssociationProxyOnlyResourceSystemData; + /** Description of the association. */ + description?: string; + /** The resource ID of the data collection rule that is to be associated. */ + dataCollectionRuleId?: string; + /** The resource ID of the data collection endpoint that is to be associated. */ + dataCollectionEndpointId?: string; /** - * List of dimension conditions. + * The resource provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - dimensions?: MetricDimension[]; + readonly provisioningState?: KnownDataCollectionRuleAssociationProvisioningState; +} + +/** Definition of association of a data collection rule with a monitored Azure resource. */ +export interface DataCollectionRuleAssociation { + /** Description of the association. */ + description?: string; + /** The resource ID of the data collection rule that is to be associated. */ + dataCollectionRuleId?: string; + /** The resource ID of the data collection endpoint that is to be associated. */ + dataCollectionEndpointId?: string; /** - * Describes unknown properties. The value of an unknown property can be of "any" type. + * The resource provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - [property: string]: any; + readonly provisioningState?: KnownDataCollectionRuleAssociationProvisioningState; } -/** - * Criterion to filter metrics. - */ -export interface MetricCriteria { +/** A pageable list of resources. */ +export interface DataCollectionRuleResourceListResult { + /** A list of resources. */ + value: DataCollectionRuleResource[]; + /** The URL to use for getting the next set of results. */ + nextLink?: string; +} + +/** Definition of ARM tracked top level resource. */ +export interface DataCollectionRuleResource { + /** The geo-location where the resource lives. */ + location: string; + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The kind of the resource. */ + kind?: KnownDataCollectionRuleResourceKind; /** - * Polymorphic Discriminator + * Fully qualified ID of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - criterionType: "StaticThresholdCriterion"; + readonly id?: string; /** - * Name of the criteria. + * The name of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - name: string; + readonly name?: string; /** - * Name of the metric. + * The type of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - metricName: string; + readonly type?: string; /** - * Namespace of the metric. + * Resource entity tag (ETag). + * NOTE: This property will not be serialized. It can only be populated by the server. */ - metricNamespace?: string; + readonly etag?: string; /** - * the criteria time aggregation types. + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - timeAggregation: any; + readonly systemData?: DataCollectionRuleResourceSystemData; + /** Description of the data collection rule. */ + description?: string; /** - * List of dimension conditions. + * The immutable ID of this data collection rule. This property is READ-ONLY. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - dimensions?: MetricDimension[]; + readonly immutableId?: string; /** - * the criteria operator. + * The specification of data sources. + * This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint. */ - operator: any; + dataSources?: DataCollectionRuleDataSources; + /** The specification of destinations. */ + destinations?: DataCollectionRuleDestinations; + /** The specification of data flows. */ + dataFlows?: DataFlow[]; /** - * the criteria threshold value that activates the alert. + * The resource provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - threshold: number; + readonly provisioningState?: KnownDataCollectionRuleProvisioningState; } -/** - * Specifies the metric alert criteria for a single resource that has multiple metric criteria. - */ -export interface MetricAlertSingleResourceMultipleMetricCriteria { +/** Definition of what monitoring data to collect and where that data should be sent. */ +export interface DataCollectionRule { + /** Description of the data collection rule. */ + description?: string; /** - * Polymorphic Discriminator + * The immutable ID of this data collection rule. This property is READ-ONLY. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - odatatype: "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria"; + readonly immutableId?: string; /** - * The list of metric criteria for this 'all of' operation. + * The specification of data sources. + * This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint. */ - allOf?: MetricCriteria[]; + dataSources?: DataCollectionRuleDataSources; + /** The specification of destinations. */ + destinations?: DataCollectionRuleDestinations; + /** The specification of data flows. */ + dataFlows?: DataFlow[]; + /** + * The resource provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: KnownDataCollectionRuleProvisioningState; +} + +/** Specification of data sources that will be collected. */ +export interface DataSourcesSpec { + /** The list of performance counter data source configurations. */ + performanceCounters?: PerfCounterDataSource[]; + /** The list of Windows Event Log data source configurations. */ + windowsEventLogs?: WindowsEventLogDataSource[]; + /** The list of Syslog data source configurations. */ + syslog?: SyslogDataSource[]; + /** The list of Azure VM extension data source configurations. */ + extensions?: ExtensionDataSource[]; } /** - * Specifies a metric dimension. + * Definition of which performance counters will be collected and how they will be collected by this data collection rule. + * Collected from both Windows and Linux machines where the counter is present. */ -export interface MetricDimension { +export interface PerfCounterDataSource { /** - * Name of the dimension. + * List of streams that this data source will be sent to. + * A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will be sent to. */ - name: string; + streams?: KnownPerfCounterDataSourceStreams[]; + /** The number of seconds between consecutive counter measurements (samples). */ + samplingFrequencyInSeconds?: number; /** - * the dimension operator. Only 'Include' and 'Exclude' are supported + * A list of specifier names of the performance counters you want to collect. + * Use a wildcard (*) to collect a counter for all instances. + * To get a list of performance counters on Windows, run the command 'typeperf'. */ - operator: string; + counterSpecifiers?: string[]; /** - * list of dimension values. + * A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. */ - values: string[]; + name?: string; } /** - * Specifies the metric alert criteria for multiple resource that has multiple metric criteria. + * Definition of which Windows Event Log events will be collected and how they will be collected. + * Only collected from Windows machines. */ -export interface MetricAlertMultipleResourceMultipleMetricCriteria { +export interface WindowsEventLogDataSource { /** - * Polymorphic Discriminator + * List of streams that this data source will be sent to. + * A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will be sent to. */ - odatatype: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria"; + streams?: KnownWindowsEventLogDataSourceStreams[]; + /** A list of Windows Event Log queries in XPATH format. */ + xPathQueries?: string[]; /** - * the list of multiple metric criteria for this 'all of' operation. + * A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. */ - allOf?: MultiMetricCriteriaUnion[]; + name?: string; } /** - * The minimum number of violations required within the selected lookback time window required to - * raise an alert. + * Definition of which syslog data will be collected and how it will be collected. + * Only collected from Linux machines. */ -export interface DynamicThresholdFailingPeriods { +export interface SyslogDataSource { /** - * The number of aggregated lookback points. The lookback time window is calculated based on the - * aggregation granularity (windowSize) and the selected number of aggregated points. + * List of streams that this data source will be sent to. + * A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will be sent to. */ - numberOfEvaluationPeriods: number; + streams?: KnownSyslogDataSourceStreams[]; + /** The list of facility names. */ + facilityNames?: KnownSyslogDataSourceFacilityNames[]; + /** The log levels to collect. */ + logLevels?: KnownSyslogDataSourceLogLevels[]; /** - * The number of violations to trigger an alert. Should be smaller or equal to - * numberOfEvaluationPeriods. + * A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. */ - minFailingPeriodsToAlert: number; + name?: string; } /** - * Criterion for dynamic threshold. + * Definition of which data will be collected from a separate VM extension that integrates with the Azure Monitor Agent. + * Collected from either Windows and Linux machines, depending on which extension is defined. */ -export interface DynamicMetricCriteria { +export interface ExtensionDataSource { /** - * Polymorphic Discriminator + * List of streams that this data source will be sent to. + * A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will be sent to. */ - criterionType: "DynamicThresholdCriterion"; - /** - * Name of the criteria. - */ - name: string; + streams?: KnownExtensionDataSourceStreams[]; + /** The name of the VM extension. */ + extensionName: string; + /** The extension settings. The format is specific for particular extension. */ + extensionSettings?: Record; + /** The list of data sources this extension needs data from. */ + inputDataSources?: string[]; /** - * Name of the metric. + * A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. */ - metricName: string; + 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; +} + +/** Log Analytics destination. */ +export interface LogAnalyticsDestination { + /** The resource ID of the Log Analytics workspace. */ + workspaceResourceId?: string; /** - * Namespace of the metric. + * The Customer ID of the Log Analytics workspace. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - metricNamespace?: string; + readonly workspaceId?: string; /** - * the criteria time aggregation types. + * A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. */ - timeAggregation: any; + name?: string; +} + +/** Azure Monitor Metrics destination. */ +export interface AzureMonitorMetricsDestination { /** - * List of dimension conditions. + * A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. */ + name?: string; +} + +/** Definition of which streams are sent to which destinations. */ +export interface DataFlow { + /** List of streams for this data flow. */ + streams?: KnownDataFlowStreams[]; + /** List of destinations for this data flow. */ + destinations?: string[]; +} + +/** The claims for a rule management event data source. */ +export interface RuleManagementEventClaimsDataSource { + /** the email address. */ + emailAddress?: string; +} + +/** How the data that is collected should be combined over time. */ +export interface ManagementEventAggregationCondition { + /** the condition operator. */ + operator?: ConditionOperator; + /** The threshold value that activates the alert. */ + threshold?: number; + /** the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. If specified then it must be between 5 minutes and 1 day. */ + windowSize?: string; +} + +/** The types of conditions for a multi resource alert. */ +export interface MultiMetricCriteria { + /** Polymorphic discriminator, which specifies the different types this object can be */ + criterionType: "StaticThresholdCriterion" | "DynamicThresholdCriterion"; + /** Describes unknown properties. The value of an unknown property can be of "any" type. */ + [property: string]: any; + /** Name of the criteria. */ + name: string; + /** Name of the metric. */ + metricName: string; + /** Namespace of the metric. */ + metricNamespace?: string; + /** the criteria time aggregation types. */ + timeAggregation: AggregationTypeEnum; + /** List of dimension conditions. */ dimensions?: MetricDimension[]; - /** - * The operator used to compare the metric value against the threshold. - */ - operator: any; - /** - * The extent of deviation required to trigger an alert. This will affect how tight the threshold - * is to the metric series pattern. - */ - alertSensitivity: any; - /** - * The minimum number of violations required within the selected lookback time window required to - * raise an alert. - */ - failingPeriods: DynamicThresholdFailingPeriods; - /** - * Use this option to set the date from which to start learning the metric historical data and - * calculate the dynamic thresholds (in ISO8601 format) - */ - ignoreDataBefore?: Date; + /** Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped. */ + skipMetricValidation?: boolean; } -/** - * Specifies the log search query. - */ -export interface Source { - /** - * Log search query. Required for action type - AlertingAction - */ - query?: string; +/** Specifies a metric dimension. */ +export interface MetricDimension { + /** Name of the dimension. */ + name: string; + /** the dimension operator. Only 'Include' and 'Exclude' are supported */ + operator: string; + /** list of dimension values. */ + values: string[]; +} + +/** The minimum number of violations required within the selected lookback time window required to raise an alert. */ +export interface DynamicThresholdFailingPeriods { + /** The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points. */ + numberOfEvaluationPeriods: number; + /** The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. */ + minFailingPeriodsToAlert: number; +} + +/** The condition that results in the Log Search rule. */ +export interface TriggerCondition { + /** Evaluation operation for rule - 'GreaterThan' or 'LessThan. */ + thresholdOperator: ConditionalOperator; + /** Result or count threshold based on which rule should be triggered. */ + threshold: number; + /** Trigger condition for metric query rule */ + metricTrigger?: LogMetricTrigger; +} + +/** A log metrics trigger descriptor. */ +export interface LogMetricTrigger { + /** Evaluation operation for Metric -'GreaterThan' or 'LessThan' or 'Equal'. */ + thresholdOperator?: ConditionalOperator; + /** The threshold of the metric trigger. */ + threshold?: number; + /** Metric Trigger Type - 'Consecutive' or 'Total' */ + metricTriggerType?: MetricTriggerType; + /** Evaluation of metric on a particular column */ + metricColumn?: string; +} + +/** Azure action group */ +export interface AzNsActionGroup { + /** Azure Action Group reference. */ + actionGroup?: string[]; + /** Custom subject override for all email ids in Azure action group */ + emailSubject?: string; + /** Custom payload to be sent for all webhook URI in Azure action group */ + customWebhookPayload?: string; +} + +/** Specifies the criteria for converting log to metric. */ +export interface Dimension { + /** Name of the dimension */ + name: string; + /** Operator for dimension values */ + operator: Operator; + /** List of dimension values */ + values: string[]; +} + +/** Specifies the criteria for converting log to metric. */ +export interface Criteria { + /** Name of the metric */ + metricName: string; + /** List of Dimensions for creating metric */ + dimensions?: Dimension[]; +} + +/** The autoscale setting resource. */ +export type AutoscaleSettingResource = Resource & { + /** the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified. */ + profiles: AutoscaleProfile[]; + /** the collection of notifications. */ + notifications?: AutoscaleNotification[]; + /** the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default value is 'true'. */ + enabled?: boolean; + /** the name of the autoscale setting. */ + namePropertiesName?: string; + /** the resource identifier of the resource that the autoscale setting should be added to. */ + targetResourceUri?: string; + /** the location of the resource that the autoscale setting should be added to. */ + targetResourceLocation?: string; +}; + +/** The alert rule resource. */ +export type AlertRuleResource = Resource & { + /** the name of the alert rule. */ + namePropertiesName: string; + /** the description of the alert rule that will be included in the alert email. */ + description?: string; + /** the provisioning state. */ + provisioningState?: string; + /** the flag that indicates whether the alert rule is enabled. */ + isEnabled: boolean; + /** the condition that results in the alert rule being activated. */ + condition: RuleConditionUnion; + /** action that is performed when the alert rule becomes active, and when an alert condition is resolved. */ + action?: RuleActionUnion; + /** the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. */ + actions?: RuleActionUnion[]; /** - * List of Resource referred into query + * Last time the rule was updated in ISO8601 format. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - authorizedResources?: string[]; + readonly lastUpdatedTime?: Date; +}; + +/** The log profile resource. */ +export type LogProfileResource = Resource & { + /** the resource id of the storage account to which you would like to send the Activity Log. */ + storageAccountId?: string; + /** The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming the Activity Log. The rule ID is of the format: '{service bus resource ID}/authorizationrules/{key name}'. */ + serviceBusRuleId?: string; + /** List of regions for which Activity Log events should be stored or streamed. It is a comma separated list of valid ARM locations including the 'global' location. */ + locations: string[]; + /** the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.' */ + categories: string[]; + /** the retention policy for the events in the log. */ + retentionPolicy: RetentionPolicy; +}; + +/** The metric alert resource. */ +export type MetricAlertResource = Resource & { + /** the description of the metric alert that will be included in the alert email. */ + description?: string; + /** Alert severity {0, 1, 2, 3, 4} */ + severity: number; + /** the flag that indicates whether the metric alert is enabled. */ + enabled: boolean; + /** the list of resource id's that this metric alert is scoped to. */ + scopes: string[]; + /** how often the metric alert is evaluated represented in ISO 8601 duration format. */ + evaluationFrequency: string; + /** the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. */ + windowSize: string; + /** the resource type of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. */ + targetResourceType?: string; + /** the region of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. */ + targetResourceRegion?: string; + /** defines the specific alert criteria information. */ + criteria: MetricAlertCriteriaUnion; + /** the flag that indicates whether the alert should be auto resolved or not. The default is true. */ + autoMitigate?: boolean; + /** the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. */ + actions?: MetricAlertAction[]; /** - * The resource uri over which log search query is to be run. + * Last time the rule was updated in ISO8601 format. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - dataSourceId: string; + readonly lastUpdatedTime?: Date; /** - * Set value to 'ResultCount'. Possible values include: 'ResultCount' + * the value indicating whether this alert rule is migrated. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - queryType?: QueryType; -} + readonly isMigrated?: boolean; +}; -/** - * Defines how often to run the search and the time interval. - */ -export interface Schedule { +/** An activity log alert resource. */ +export type ActivityLogAlertResource = Resource & { + /** A list of resourceIds that will be used as prefixes. The alert will only apply to activityLogs with resourceIds that fall under one of these prefixes. This list must include at least one item. */ + scopes?: string[]; + /** Indicates whether this activity log alert is enabled. If an activity log alert is not enabled, then none of its actions will be activated. */ + enabled?: boolean; + /** The condition that will cause this alert to activate. */ + condition?: ActivityLogAlertAllOfCondition; + /** The actions that will activate when the condition is met. */ + actions?: ActivityLogAlertActionList; + /** A description of this activity log alert. */ + description?: string; +}; + +/** The resource management error response. */ +export type ErrorResponseCommon = ErrorResponse & { /** - * frequency (in minutes) at which rule condition should be evaluated. + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - frequencyInMinutes: number; + readonly details?: ErrorResponseCommon[]; /** - * Time window for which data needs to be fetched for query (should be greater than or equal to - * frequencyInMinutes). + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - timeWindowInMinutes: number; -} + readonly additionalInfo?: ErrorAdditionalInfo[]; +}; -/** - * Contains the possible cases for Action. - */ -export type ActionUnion = Action | AlertingAction | LogToMetricAction; +/** A rule condition based on a metric crossing a threshold. */ +export type ThresholdRuleCondition = RuleCondition & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + odataType: "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition"; + /** the operator used to compare the data and the threshold. */ + operator: ConditionOperator; + /** the threshold value that activates the alert. */ + threshold: number; + /** the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. If specified then it must be between 5 minutes and 1 day. */ + windowSize?: string; + /** the time aggregation operator. How the data that are collected should be combined over time. The default value is the PrimaryAggregationType of the Metric. */ + timeAggregation?: TimeAggregationOperator; +}; -/** - * Action descriptor. - */ -export interface Action { - /** - * Polymorphic Discriminator - */ - odatatype: "Action"; -} +/** A rule condition based on a certain number of locations failing. */ +export type LocationThresholdRuleCondition = RuleCondition & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + odataType: "Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition"; + /** the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. If specified then it must be between 5 minutes and 1 day. */ + windowSize?: string; + /** the number of locations that must fail to activate the alert. */ + failedLocationCount: number; +}; -/** - * The Log Search Rule resource. - */ -export interface LogSearchRuleResource extends Resource { +/** A management event rule condition. */ +export type ManagementEventRuleCondition = RuleCondition & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + odataType: "Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition"; + /** How the data that is collected should be combined over time and when the alert is activated. Note that for management event alerts aggregation is optional – if it is not provided then any event will cause the alert to activate. */ + aggregation?: ManagementEventAggregationCondition; +}; + +/** A rule metric data source. The discriminator value is always RuleMetricDataSource in this case. */ +export type RuleMetricDataSource = RuleDataSource & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + odataType: "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource"; + /** the name of the metric that defines what the rule monitors. */ + metricName?: string; +}; + +/** A rule management event data source. The discriminator fields is always RuleManagementEventDataSource in this case. */ +export type RuleManagementEventDataSource = RuleDataSource & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + odataType: "Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource"; + /** the event name. */ + eventName?: string; + /** the event source. */ + eventSource?: string; + /** the level. */ + level?: string; + /** The name of the operation that should be checked for. If no name is provided, any operation will match. */ + operationName?: string; + /** the resource group name. */ + resourceGroupName?: string; + /** the resource provider name. */ + resourceProviderName?: string; + /** The status of the operation that should be checked for. If no status is provided, any status will match. */ + status?: string; + /** the substatus. */ + subStatus?: string; + /** the claims. */ + claims?: RuleManagementEventClaimsDataSource; +}; + +/** Specifies the action to send email when the rule condition is evaluated. The discriminator is always RuleEmailAction in this case. */ +export type RuleEmailAction = RuleAction & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + odataType: "Microsoft.Azure.Management.Insights.Models.RuleEmailAction"; + /** Whether the administrators (service and co-administrators) of the service should be notified when the alert is activated. */ + sendToServiceOwners?: boolean; + /** the list of administrator's custom email addresses to notify of the activation of the alert. */ + customEmails?: string[]; +}; + +/** Specifies the action to post to service when the rule condition is evaluated. The discriminator is always RuleWebhookAction in this case. */ +export type RuleWebhookAction = RuleAction & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + odataType: "Microsoft.Azure.Management.Insights.Models.RuleWebhookAction"; + /** the service uri to Post the notification when the alert activates or resolves. */ + serviceUri?: string; + /** the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. */ + properties?: { [propertyName: string]: string }; +}; + +/** The diagnostic setting resource. */ +export type DiagnosticSettingsResource = ProxyOnlyResource & { + /** The resource ID of the storage account to which you would like to send Diagnostic Logs. */ + storageAccountId?: string; + /** The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility. */ + serviceBusRuleId?: string; + /** The resource Id for the event hub authorization rule. */ + eventHubAuthorizationRuleId?: string; + /** The name of the event hub. If none is specified, the default event hub will be selected. */ + eventHubName?: string; + /** The list of metric settings. */ + metrics?: MetricSettings[]; + /** The list of logs settings. */ + logs?: LogSettings[]; + /** The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 */ + workspaceId?: string; + /** A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, or use a destination type constructed as follows: _. Possible values are: Dedicated and null (null is default.) */ + logAnalyticsDestinationType?: string; +}; + +/** The diagnostic settings category resource. */ +export type DiagnosticSettingsCategoryResource = ProxyOnlyResource & { + /** The type of the diagnostic settings category. */ + categoryType?: CategoryType; +}; + +/** An action group resource. */ +export type ActionGroupResource = AzureResource & { + /** The short name of the action group. This will be used in SMS messages. */ + groupShortName?: string; + /** Indicates whether this action group is enabled. If an action group is not enabled, then none of its receivers will receive communications. */ + enabled?: boolean; + /** The list of email receivers that are part of this action group. */ + emailReceivers?: EmailReceiver[]; + /** The list of SMS receivers that are part of this action group. */ + smsReceivers?: SmsReceiver[]; + /** The list of webhook receivers that are part of this action group. */ + webhookReceivers?: WebhookReceiver[]; + /** The list of ITSM receivers that are part of this action group. */ + itsmReceivers?: ItsmReceiver[]; + /** The list of AzureAppPush receivers that are part of this action group. */ + azureAppPushReceivers?: AzureAppPushReceiver[]; + /** The list of AutomationRunbook receivers that are part of this action group. */ + automationRunbookReceivers?: AutomationRunbookReceiver[]; + /** The list of voice receivers that are part of this action group. */ + voiceReceivers?: VoiceReceiver[]; + /** The list of logic app receivers that are part of this action group. */ + logicAppReceivers?: LogicAppReceiver[]; + /** The list of azure function receivers that are part of this action group. */ + azureFunctionReceivers?: AzureFunctionReceiver[]; + /** The list of ARM role receivers that are part of this action group. Roles are Azure RBAC roles and only built-in roles are supported. */ + armRoleReceivers?: ArmRoleReceiver[]; + /** The list of event hub receivers that are part of this action group. */ + eventHubReceivers?: EventHubReceiver[]; +}; + +/** Specifies the metric alert criteria for a single resource that has multiple metric criteria. */ +export type MetricAlertSingleResourceMultipleMetricCriteria = MetricAlertCriteria & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + odataType: "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria"; + /** The list of metric criteria for this 'all of' operation. */ + allOf?: MetricCriteria[]; +}; + +/** Specifies the metric alert rule criteria for a web test resource. */ +export type WebtestLocationAvailabilityCriteria = MetricAlertCriteria & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + odataType: "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria"; + /** The Application Insights web test Id. */ + webTestId: string; + /** The Application Insights resource Id. */ + componentId: string; + /** The number of failed locations. */ + failedLocationCount: number; +}; + +/** Specifies the metric alert criteria for multiple resource that has multiple metric criteria. */ +export type MetricAlertMultipleResourceMultipleMetricCriteria = MetricAlertCriteria & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria"; + /** the list of multiple metric criteria for this 'all of' operation. */ + allOf?: MultiMetricCriteriaUnion[]; +}; + +/** Specify action need to be taken when rule type is Alert */ +export type AlertingAction = Action & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + odataType: "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction"; + /** Severity of the alert */ + severity: AlertSeverity; + /** Azure action group reference. */ + aznsAction?: AzNsActionGroup; + /** time (in minutes) for which Alerts should be throttled or suppressed. */ + throttlingInMin?: number; + /** The trigger condition that results in the alert rule being. */ + trigger: TriggerCondition; +}; + +/** Specify action need to be taken when rule type is converting log to metric */ +export type LogToMetricAction = Action & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + odataType: "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction"; + /** Criteria of Metric */ + criteria: Criteria[]; +}; + +/** The Log Search Rule resource. */ +export type LogSearchRuleResource = ResourceAutoGenerated & { /** - * The description of the Log Search rule. + * The api-version used when creating this alert rule + * NOTE: This property will not be serialized. It can only be populated by the server. */ - description?: string; + readonly createdWithApiVersion?: string; /** - * The flag which indicates whether the Log Search rule is enabled. Value should be true or - * false. Possible values include: 'true', 'false' + * True if alert rule is legacy Log Analytic rule + * NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly isLegacyLogAnalyticsRule?: boolean; + /** The description of the Log Search rule. */ + description?: string; + /** The display name of the alert rule */ + displayName?: string; + /** The flag that indicates whether the alert should be automatically resolved or not. The default is false. */ + autoMitigate?: boolean; + /** The flag which indicates whether the Log Search rule is enabled. Value should be true or false */ enabled?: Enabled; /** * Last time the rule was updated in IS08601 format. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly lastUpdatedTime?: Date; /** - * Provisioning state of the scheduled query rule. Possible values include: 'Succeeded', - * 'Deploying', 'Canceled', 'Failed' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Provisioning state of the scheduled query rule + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** Data Source against which rule will Query Data */ + source: Source; + /** Schedule (Frequency, Time Window) for rule. Required for action type - AlertingAction */ + schedule?: Schedule; + /** Action needs to be taken on rule execution. */ + action: ActionUnion; +}; + +/** VM Insights onboarding status for a resource. */ +export type VMInsightsOnboardingStatus = ProxyResource & { + /** Azure Resource Manager identifier of the resource whose onboarding status is being represented. */ + resourceId?: string; + /** The onboarding status for the resource. Note that, a higher level scope, e.g., resource group or subscription, is considered onboarded if at least one resource under it is onboarded. */ + onboardingStatus?: OnboardingStatus; + /** The status of VM Insights data from the resource. When reported as `present` the data array will contain information about the data containers to which data for the specified resource is being routed. */ + dataStatus?: DataStatus; + /** Containers that currently store VM Insights data for the specified resource. */ + data?: DataContainer[]; +}; + +/** A private endpoint connection */ +export type PrivateEndpointConnection = ProxyResource & { + /** Private endpoint which the connection belongs to. */ + privateEndpoint?: PrivateEndpointProperty; + /** Connection state of the private endpoint connection. */ + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionStateProperty; + /** + * State of the private endpoint connection. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: ProvisioningState; + readonly provisioningState?: string; +}; + +/** A private link resource */ +export type PrivateLinkResource = ProxyResource & { /** - * Data Source against which rule will Query Data + * The private link resource group id. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - source: Source; + readonly groupId?: string; /** - * Schedule (Frequency, Time Window) for rule. Required for action type - AlertingAction + * The private link resource required member names. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - schedule?: Schedule; + readonly requiredMembers?: string[]; +}; + +/** A private link scoped resource */ +export type ScopedResource = ProxyResource & { + /** The resource id of the scoped Azure monitor resource. */ + linkedResourceId?: string; /** - * Action needs to be taken on rule execution. + * State of the private endpoint connection. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - action: ActionUnion; -} + readonly provisioningState?: string; +}; -/** - * The log search rule resource for patch operations. - */ -export interface LogSearchRuleResourcePatch { +/** An Azure Monitor PrivateLinkScope definition. */ +export type AzureMonitorPrivateLinkScope = PrivateLinkScopesResource & { /** - * Resource tags + * Current state of this PrivateLinkScope: whether or not is has been provisioned within the resource group it is defined. Users cannot change this value but are able to read from it. Values will include Provisioning ,Succeeded, Canceled and Failed. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: { [propertyName: string]: string }; + readonly provisioningState?: string; /** - * The flag which indicates whether the Log Search rule is enabled. Value should be true or - * false. Possible values include: 'true', 'false' + * List of private endpoint connections. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - enabled?: Enabled; -} + readonly privateEndpointConnections?: PrivateEndpointConnection[]; +}; + +/** Resource properties. */ +export type DataCollectionEndpointResourceProperties = DataCollectionEndpoint & {}; + +/** The endpoint used by agents to access their configuration. */ +export type DataCollectionEndpointConfigurationAccess = ConfigurationAccessEndpointSpec & {}; + +/** The endpoint used by clients to ingest logs. */ +export type DataCollectionEndpointLogsIngestion = LogsIngestionEndpointSpec & {}; + +/** Network access control rules for the endpoints. */ +export type DataCollectionEndpointNetworkAcls = NetworkRuleSet & {}; + +/** Metadata pertaining to creation and last modification of the resource. */ +export type DataCollectionEndpointResourceSystemData = SystemData & {}; + +/** Metadata pertaining to creation and last modification of the resource. */ +export type DataCollectionRuleAssociationProxyOnlyResourceSystemData = SystemData & {}; + +/** Metadata pertaining to creation and last modification of the resource. */ +export type DataCollectionRuleResourceSystemData = SystemData & {}; + +/** Resource properties. */ +export type DataCollectionRuleAssociationProxyOnlyResourceProperties = DataCollectionRuleAssociation & {}; + +/** Resource properties. */ +export type DataCollectionRuleResourceProperties = DataCollectionRule & {}; /** - * A log metrics trigger descriptor. + * The specification of data sources. + * This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint. */ -export interface LogMetricTrigger { - /** - * Evaluation operation for Metric -'GreaterThan' or 'LessThan' or 'Equal'. Possible values - * include: 'GreaterThan', 'LessThan', 'Equal' - */ - thresholdOperator?: ConditionalOperator; - /** - * The threshold of the metric trigger. - */ - threshold?: number; - /** - * Metric Trigger Type - 'Consecutive' or 'Total'. Possible values include: 'Consecutive', - * 'Total' - */ - metricTriggerType?: MetricTriggerType; - /** - * Evaluation of metric on a particular column - */ - metricColumn?: string; +export type DataCollectionRuleDataSources = DataSourcesSpec & {}; + +/** The specification of destinations. */ +export type DataCollectionRuleDestinations = DestinationsSpec & {}; + +/** Azure Monitor Metrics destination. */ +export type DestinationsSpecAzureMonitorMetrics = AzureMonitorMetricsDestination & {}; + +/** Criterion to filter metrics. */ +export type MetricCriteria = MultiMetricCriteria & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + criterionType: "StaticThresholdCriterion"; + /** the criteria operator. */ + operator: Operator; + /** the criteria threshold value that activates the alert. */ + threshold: number; +}; + +/** Criterion for dynamic threshold. */ +export type DynamicMetricCriteria = MultiMetricCriteria & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + criterionType: "DynamicThresholdCriterion"; + /** The operator used to compare the metric value against the threshold. */ + operator: DynamicThresholdOperator; + /** The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern. */ + alertSensitivity: DynamicThresholdSensitivity; + /** The minimum number of violations required within the selected lookback time window required to raise an alert. */ + failingPeriods: DynamicThresholdFailingPeriods; + /** Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format) */ + ignoreDataBefore?: Date; +}; + +/** Known values of {@link ScaleRuleMetricDimensionOperationType} that the service accepts. */ +export enum KnownScaleRuleMetricDimensionOperationType { + Equals = "Equals", + NotEquals = "NotEquals" +} + +/** + * Defines values for ScaleRuleMetricDimensionOperationType. \ + * {@link KnownScaleRuleMetricDimensionOperationType} can be used interchangeably with ScaleRuleMetricDimensionOperationType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Equals** \ + * **NotEquals** + */ +export type ScaleRuleMetricDimensionOperationType = string; + +/** Known values of {@link MetricClass} that the service accepts. */ +export enum KnownMetricClass { + Availability = "Availability", + Transactions = "Transactions", + Errors = "Errors", + Latency = "Latency", + Saturation = "Saturation" +} + +/** + * Defines values for MetricClass. \ + * {@link KnownMetricClass} can be used interchangeably with MetricClass, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Availability** \ + * **Transactions** \ + * **Errors** \ + * **Latency** \ + * **Saturation** + */ +export type MetricClass = string; + +/** Known values of {@link MetricUnit} that the service accepts. */ +export enum KnownMetricUnit { + Count = "Count", + Bytes = "Bytes", + Seconds = "Seconds", + CountPerSecond = "CountPerSecond", + BytesPerSecond = "BytesPerSecond", + Percent = "Percent", + MilliSeconds = "MilliSeconds", + ByteSeconds = "ByteSeconds", + Unspecified = "Unspecified", + Cores = "Cores", + MilliCores = "MilliCores", + NanoCores = "NanoCores", + BitsPerSecond = "BitsPerSecond" } /** - * The condition that results in the Log Search rule. + * Defines values for MetricUnit. \ + * {@link KnownMetricUnit} can be used interchangeably with MetricUnit, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Count** \ + * **Bytes** \ + * **Seconds** \ + * **CountPerSecond** \ + * **BytesPerSecond** \ + * **Percent** \ + * **MilliSeconds** \ + * **ByteSeconds** \ + * **Unspecified** \ + * **Cores** \ + * **MilliCores** \ + * **NanoCores** \ + * **BitsPerSecond** */ -export interface TriggerCondition { - /** - * Evaluation operation for rule - 'GreaterThan' or 'LessThan. Possible values include: - * 'GreaterThan', 'LessThan', 'Equal' - */ - thresholdOperator: ConditionalOperator; - /** - * Result or count threshold based on which rule should be triggered. - */ - threshold: number; - /** - * Trigger condition for metric query rule - */ - metricTrigger?: LogMetricTrigger; +export type MetricUnit = string; + +/** Known values of {@link BaselineSensitivity} that the service accepts. */ +export enum KnownBaselineSensitivity { + Low = "Low", + Medium = "Medium", + High = "High" } /** - * Azure action group + * Defines values for BaselineSensitivity. \ + * {@link KnownBaselineSensitivity} can be used interchangeably with BaselineSensitivity, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Low** \ + * **Medium** \ + * **High** */ -export interface AzNsActionGroup { - /** - * Azure Action Group reference. - */ - actionGroup?: string[]; - /** - * Custom subject override for all email ids in Azure action group - */ - emailSubject?: string; - /** - * Custom payload to be sent for all webhook URI in Azure action group - */ - customWebhookPayload?: string; +export type BaselineSensitivity = string; + +/** Known values of {@link Odatatype} that the service accepts. */ +export enum KnownOdatatype { + MicrosoftAzureMonitorSingleResourceMultipleMetricCriteria = "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", + MicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria", + MicrosoftAzureMonitorWebtestLocationAvailabilityCriteria = "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria" } /** - * Specify action need to be taken when rule type is Alert + * Defines values for Odatatype. \ + * {@link KnownOdatatype} can be used interchangeably with Odatatype, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria** \ + * **Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria** \ + * **Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria** */ -export interface AlertingAction { - /** - * Polymorphic Discriminator - */ - odatatype: "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction"; - /** - * Severity of the alert. Possible values include: '0', '1', '2', '3', '4' - */ - severity: AlertSeverity; - /** - * Azure action group reference. - */ - aznsAction?: AzNsActionGroup; - /** - * time (in minutes) for which Alerts should be throttled or suppressed. - */ - throttlingInMin?: number; - /** - * The trigger condition that results in the alert rule being. - */ - trigger: TriggerCondition; +export type Odatatype = string; + +/** Known values of {@link Enabled} that the service accepts. */ +export enum KnownEnabled { + True = "true", + False = "false" } /** - * Specifies the criteria for converting log to metric. + * Defines values for Enabled. \ + * {@link KnownEnabled} can be used interchangeably with Enabled, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **true** \ + * **false** */ -export interface Dimension { - /** - * Name of the dimension - */ - name: string; - /** - * List of dimension values - */ - values: string[]; +export type Enabled = string; + +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + Succeeded = "Succeeded", + Deploying = "Deploying", + Canceled = "Canceled", + Failed = "Failed" } /** - * Specifies the criteria for converting log to metric. + * 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 + * **Succeeded** \ + * **Deploying** \ + * **Canceled** \ + * **Failed** */ -export interface Criteria { - /** - * Name of the metric - */ - metricName: string; - /** - * List of Dimensions for creating metric - */ - dimensions?: Dimension[]; +export type ProvisioningState = string; + +/** Known values of {@link QueryType} that the service accepts. */ +export enum KnownQueryType { + ResultCount = "ResultCount" } /** - * Specify action need to be taken when rule type is converting log to metric + * Defines values for QueryType. \ + * {@link KnownQueryType} can be used interchangeably with QueryType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ResultCount** */ -export interface LogToMetricAction { - /** - * Polymorphic Discriminator - */ - odatatype: "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction"; - /** - * Criteria of Metric - */ - criteria: Criteria[]; +export type QueryType = string; + +/** Known values of {@link NamespaceClassification} that the service accepts. */ +export enum KnownNamespaceClassification { + Platform = "Platform", + Custom = "Custom", + Qos = "Qos" } /** - * The fully qualified metric namespace name. + * Defines values for NamespaceClassification. \ + * {@link KnownNamespaceClassification} can be used interchangeably with NamespaceClassification, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Platform** \ + * **Custom** \ + * **Qos** */ -export interface MetricNamespaceName { - /** - * The metric namespace name. - */ - metricNamespaceName?: string; +export type NamespaceClassification = string; + +/** Known values of {@link OnboardingStatus} that the service accepts. */ +export enum KnownOnboardingStatus { + Onboarded = "onboarded", + NotOnboarded = "notOnboarded", + Unknown = "unknown" } /** - * Metric namespace class specifies the metadata for a metric namespace. + * Defines values for OnboardingStatus. \ + * {@link KnownOnboardingStatus} can be used interchangeably with OnboardingStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **onboarded** \ + * **notOnboarded** \ + * **unknown** */ -export interface MetricNamespace { - /** - * The ID of the metricNamespace. - */ - id?: string; - /** - * The type of the namespace. - */ - type?: string; - /** - * The name of the namespace. - */ - name?: string; - /** - * Properties which include the fully qualified namespace name. - */ - properties?: MetricNamespaceName; +export type OnboardingStatus = string; + +/** Known values of {@link DataStatus} that the service accepts. */ +export enum KnownDataStatus { + Present = "present", + NotPresent = "notPresent" } /** - * An azure resource object + * Defines values for DataStatus. \ + * {@link KnownDataStatus} can be used interchangeably with DataStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **present** \ + * **notPresent** */ -export interface ProxyResource extends BaseResource { - /** - * Azure resource Id - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * Azure resource name - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * Azure resource type - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; +export type DataStatus = string; + +/** Known values of {@link KnownPublicNetworkAccessOptions} that the service accepts. */ +export enum KnownKnownPublicNetworkAccessOptions { + Enabled = "Enabled", + Disabled = "Disabled" } /** - * Error details. + * Defines values for KnownPublicNetworkAccessOptions. \ + * {@link KnownKnownPublicNetworkAccessOptions} can be used interchangeably with KnownPublicNetworkAccessOptions, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** */ -export interface ErrorModel { - /** - * Error code identifying the specific error. - */ - code: string; - /** - * Error message in the caller's locale. - */ - message?: string; +export type KnownPublicNetworkAccessOptions = string; + +/** Known values of {@link KnownDataCollectionEndpointProvisioningState} that the service accepts. */ +export enum KnownKnownDataCollectionEndpointProvisioningState { + Creating = "Creating", + Updating = "Updating", + Deleting = "Deleting", + Succeeded = "Succeeded", + Failed = "Failed" } /** - * An error response from the API. + * Defines values for KnownDataCollectionEndpointProvisioningState. \ + * {@link KnownKnownDataCollectionEndpointProvisioningState} can be used interchangeably with KnownDataCollectionEndpointProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Creating** \ + * **Updating** \ + * **Deleting** \ + * **Succeeded** \ + * **Failed** */ -export interface ResponseWithError { - /** - * Error information. - */ - error: ErrorModel; +export type KnownDataCollectionEndpointProvisioningState = string; + +/** Known values of {@link KnownDataCollectionEndpointResourceKind} that the service accepts. */ +export enum KnownKnownDataCollectionEndpointResourceKind { + Linux = "Linux", + Windows = "Windows" } /** - * Information about a Log Analytics Workspace. + * Defines values for KnownDataCollectionEndpointResourceKind. \ + * {@link KnownKnownDataCollectionEndpointResourceKind} can be used interchangeably with KnownDataCollectionEndpointResourceKind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Linux** \ + * **Windows** */ -export interface WorkspaceInfo { - /** - * Azure Resource Manager identifier of the Log Analytics Workspace. - */ - id: string; - /** - * Location of the Log Analytics workspace. - */ - location: string; - /** - * Log Analytics workspace identifier. - */ - customerId: string; +export type KnownDataCollectionEndpointResourceKind = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + User = "User", + Application = "Application", + ManagedIdentity = "ManagedIdentity", + Key = "Key" } /** - * Information about a container with data for a given resource. + * 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 interface DataContainer { - /** - * Log Analytics workspace information. - */ - workspace: WorkspaceInfo; +export type CreatedByType = string; + +/** Known values of {@link KnownDataCollectionRuleAssociationProvisioningState} that the service accepts. */ +export enum KnownKnownDataCollectionRuleAssociationProvisioningState { + Creating = "Creating", + Updating = "Updating", + Deleting = "Deleting", + Succeeded = "Succeeded", + Failed = "Failed" +} + +/** + * Defines values for KnownDataCollectionRuleAssociationProvisioningState. \ + * {@link KnownKnownDataCollectionRuleAssociationProvisioningState} can be used interchangeably with KnownDataCollectionRuleAssociationProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Creating** \ + * **Updating** \ + * **Deleting** \ + * **Succeeded** \ + * **Failed** + */ +export type KnownDataCollectionRuleAssociationProvisioningState = string; + +/** Known values of {@link KnownPerfCounterDataSourceStreams} that the service accepts. */ +export enum KnownKnownPerfCounterDataSourceStreams { + MicrosoftPerf = "Microsoft-Perf", + MicrosoftInsightsMetrics = "Microsoft-InsightsMetrics" +} + +/** + * Defines values for KnownPerfCounterDataSourceStreams. \ + * {@link KnownKnownPerfCounterDataSourceStreams} can be used interchangeably with KnownPerfCounterDataSourceStreams, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Microsoft-Perf** \ + * **Microsoft-InsightsMetrics** + */ +export type KnownPerfCounterDataSourceStreams = string; + +/** Known values of {@link KnownWindowsEventLogDataSourceStreams} that the service accepts. */ +export enum KnownKnownWindowsEventLogDataSourceStreams { + MicrosoftWindowsEvent = "Microsoft-WindowsEvent", + MicrosoftEvent = "Microsoft-Event" +} + +/** + * Defines values for KnownWindowsEventLogDataSourceStreams. \ + * {@link KnownKnownWindowsEventLogDataSourceStreams} can be used interchangeably with KnownWindowsEventLogDataSourceStreams, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Microsoft-WindowsEvent** \ + * **Microsoft-Event** + */ +export type KnownWindowsEventLogDataSourceStreams = string; + +/** Known values of {@link KnownSyslogDataSourceStreams} that the service accepts. */ +export enum KnownKnownSyslogDataSourceStreams { + MicrosoftSyslog = "Microsoft-Syslog" +} + +/** + * Defines values for KnownSyslogDataSourceStreams. \ + * {@link KnownKnownSyslogDataSourceStreams} can be used interchangeably with KnownSyslogDataSourceStreams, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Microsoft-Syslog** + */ +export type KnownSyslogDataSourceStreams = string; + +/** Known values of {@link KnownSyslogDataSourceFacilityNames} that the service accepts. */ +export enum KnownKnownSyslogDataSourceFacilityNames { + Auth = "auth", + Authpriv = "authpriv", + Cron = "cron", + Daemon = "daemon", + Kern = "kern", + Lpr = "lpr", + Mail = "mail", + Mark = "mark", + News = "news", + Syslog = "syslog", + User = "user", + Uucp = "uucp", + Local0 = "local0", + Local1 = "local1", + Local2 = "local2", + Local3 = "local3", + Local4 = "local4", + Local5 = "local5", + Local6 = "local6", + Local7 = "local7", + Asterisk = "*" +} + +/** + * Defines values for KnownSyslogDataSourceFacilityNames. \ + * {@link KnownKnownSyslogDataSourceFacilityNames} can be used interchangeably with KnownSyslogDataSourceFacilityNames, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **auth** \ + * **authpriv** \ + * **cron** \ + * **daemon** \ + * **kern** \ + * **lpr** \ + * **mail** \ + * **mark** \ + * **news** \ + * **syslog** \ + * **user** \ + * **uucp** \ + * **local0** \ + * **local1** \ + * **local2** \ + * **local3** \ + * **local4** \ + * **local5** \ + * **local6** \ + * **local7** \ + * ***** + */ +export type KnownSyslogDataSourceFacilityNames = string; + +/** Known values of {@link KnownSyslogDataSourceLogLevels} that the service accepts. */ +export enum KnownKnownSyslogDataSourceLogLevels { + Debug = "Debug", + Info = "Info", + Notice = "Notice", + Warning = "Warning", + Error = "Error", + Critical = "Critical", + Alert = "Alert", + Emergency = "Emergency", + Asterisk = "*" +} + +/** + * Defines values for KnownSyslogDataSourceLogLevels. \ + * {@link KnownKnownSyslogDataSourceLogLevels} can be used interchangeably with KnownSyslogDataSourceLogLevels, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Debug** \ + * **Info** \ + * **Notice** \ + * **Warning** \ + * **Error** \ + * **Critical** \ + * **Alert** \ + * **Emergency** \ + * ***** + */ +export type KnownSyslogDataSourceLogLevels = string; + +/** Known values of {@link KnownExtensionDataSourceStreams} that the service accepts. */ +export enum KnownKnownExtensionDataSourceStreams { + MicrosoftEvent = "Microsoft-Event", + MicrosoftInsightsMetrics = "Microsoft-InsightsMetrics", + MicrosoftPerf = "Microsoft-Perf", + MicrosoftSyslog = "Microsoft-Syslog", + MicrosoftWindowsEvent = "Microsoft-WindowsEvent" +} + +/** + * Defines values for KnownExtensionDataSourceStreams. \ + * {@link KnownKnownExtensionDataSourceStreams} can be used interchangeably with KnownExtensionDataSourceStreams, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Microsoft-Event** \ + * **Microsoft-InsightsMetrics** \ + * **Microsoft-Perf** \ + * **Microsoft-Syslog** \ + * **Microsoft-WindowsEvent** + */ +export type KnownExtensionDataSourceStreams = string; + +/** Known values of {@link KnownDataFlowStreams} that the service accepts. */ +export enum KnownKnownDataFlowStreams { + MicrosoftEvent = "Microsoft-Event", + MicrosoftInsightsMetrics = "Microsoft-InsightsMetrics", + MicrosoftPerf = "Microsoft-Perf", + MicrosoftSyslog = "Microsoft-Syslog", + MicrosoftWindowsEvent = "Microsoft-WindowsEvent" +} + +/** + * Defines values for KnownDataFlowStreams. \ + * {@link KnownKnownDataFlowStreams} can be used interchangeably with KnownDataFlowStreams, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Microsoft-Event** \ + * **Microsoft-InsightsMetrics** \ + * **Microsoft-Perf** \ + * **Microsoft-Syslog** \ + * **Microsoft-WindowsEvent** + */ +export type KnownDataFlowStreams = string; + +/** Known values of {@link KnownDataCollectionRuleProvisioningState} that the service accepts. */ +export enum KnownKnownDataCollectionRuleProvisioningState { + Creating = "Creating", + Updating = "Updating", + Deleting = "Deleting", + Succeeded = "Succeeded", + Failed = "Failed" +} + +/** + * Defines values for KnownDataCollectionRuleProvisioningState. \ + * {@link KnownKnownDataCollectionRuleProvisioningState} can be used interchangeably with KnownDataCollectionRuleProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Creating** \ + * **Updating** \ + * **Deleting** \ + * **Succeeded** \ + * **Failed** + */ +export type KnownDataCollectionRuleProvisioningState = string; + +/** Known values of {@link KnownDataCollectionRuleResourceKind} that the service accepts. */ +export enum KnownKnownDataCollectionRuleResourceKind { + Linux = "Linux", + Windows = "Windows" +} + +/** + * Defines values for KnownDataCollectionRuleResourceKind. \ + * {@link KnownKnownDataCollectionRuleResourceKind} can be used interchangeably with KnownDataCollectionRuleResourceKind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Linux** \ + * **Windows** + */ +export type KnownDataCollectionRuleResourceKind = string; + +/** Known values of {@link Operator} that the service accepts. */ +export enum KnownOperator { + Equals = "Equals", + GreaterThan = "GreaterThan", + GreaterThanOrEqual = "GreaterThanOrEqual", + LessThan = "LessThan", + LessThanOrEqual = "LessThanOrEqual", + Include = "Include" } /** - * VM Insights onboarding status for a resource. + * Defines values for Operator. \ + * {@link KnownOperator} can be used interchangeably with Operator, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Equals** \ + * **GreaterThan** \ + * **GreaterThanOrEqual** \ + * **LessThan** \ + * **LessThanOrEqual** \ + * **Include** */ -export interface VMInsightsOnboardingStatus extends ProxyResource { - /** - * Azure Resource Manager identifier of the resource whose onboarding status is being - * represented. - */ - resourceId: string; - /** - * The onboarding status for the resource. Note that, a higher level scope, e.g., resource group - * or subscription, is considered onboarded if at least one resource under it is onboarded. - * Possible values include: 'onboarded', 'notOnboarded', 'unknown' - */ - onboardingStatus: OnboardingStatus; - /** - * The status of VM Insights data from the resource. When reported as `present` the data array - * will contain information about the data containers to which data for the specified resource is - * being routed. Possible values include: 'present', 'notPresent' - */ - dataStatus: DataStatus; - /** - * Containers that currently store VM Insights data for the specified resource. - */ - data?: DataContainer[]; +export type Operator = string; + +/** Known values of {@link CriterionType} that the service accepts. */ +export enum KnownCriterionType { + StaticThresholdCriterion = "StaticThresholdCriterion", + DynamicThresholdCriterion = "DynamicThresholdCriterion" } /** - * Optional Parameters. + * Defines values for CriterionType. \ + * {@link KnownCriterionType} can be used interchangeably with CriterionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **StaticThresholdCriterion** \ + * **DynamicThresholdCriterion** */ -export interface ActivityLogsListOptionalParams extends msRest.RequestOptionsBase { - /** - * Used to fetch events with only the given properties.
The **$select** argument is a comma - * separated list of property names to be returned. Possible values are: *authorization*, - * *claims*, *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, - * *httpRequest*, *level*, *operationId*, *operationName*, *properties*, *resourceGroupName*, - * *resourceProviderName*, *resourceId*, *status*, *submissionTimestamp*, *subStatus*, - * *subscriptionId* - */ - select?: string; +export type CriterionType = string; + +/** Known values of {@link AggregationTypeEnum} that the service accepts. */ +export enum KnownAggregationTypeEnum { + Average = "Average", + Count = "Count", + Minimum = "Minimum", + Maximum = "Maximum", + Total = "Total" } /** - * Optional Parameters. + * Defines values for AggregationTypeEnum. \ + * {@link KnownAggregationTypeEnum} can be used interchangeably with AggregationTypeEnum, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Average** \ + * **Count** \ + * **Minimum** \ + * **Maximum** \ + * **Total** */ -export interface TenantActivityLogsListOptionalParams extends msRest.RequestOptionsBase { - /** - * Reduces the set of data collected.
The **$filter** is very restricted and allows only the - * following patterns.
- List events for a resource group: $filter=eventTimestamp ge '' and eventTimestamp le '' and eventChannels eq 'Admin, Operation' and - * resourceGroupName eq ''.
- List events for resource: - * $filter=eventTimestamp ge '' and eventTimestamp le '' and eventChannels - * eq 'Admin, Operation' and resourceUri eq ''.
- List events for a subscription: - * $filter=eventTimestamp ge '' and eventTimestamp le '' and eventChannels - * eq 'Admin, Operation'.
- List events for a resource provider: $filter=eventTimestamp ge - * '' and eventTimestamp le '' and eventChannels eq 'Admin, Operation' and - * resourceProvider eq ''.
- List events for a correlation Id: - * api-version=2014-04-01&$filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and - * eventTimestamp le '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and - * correlationId eq ''.
**NOTE**: No other syntax is allowed. - */ +export type AggregationTypeEnum = string; + +/** Known values of {@link DynamicThresholdOperator} that the service accepts. */ +export enum KnownDynamicThresholdOperator { + GreaterThan = "GreaterThan", + LessThan = "LessThan", + GreaterOrLessThan = "GreaterOrLessThan" +} + +/** + * Defines values for DynamicThresholdOperator. \ + * {@link KnownDynamicThresholdOperator} can be used interchangeably with DynamicThresholdOperator, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **GreaterThan** \ + * **LessThan** \ + * **GreaterOrLessThan** + */ +export type DynamicThresholdOperator = string; + +/** Known values of {@link DynamicThresholdSensitivity} that the service accepts. */ +export enum KnownDynamicThresholdSensitivity { + Low = "Low", + Medium = "Medium", + High = "High" +} + +/** + * Defines values for DynamicThresholdSensitivity. \ + * {@link KnownDynamicThresholdSensitivity} can be used interchangeably with DynamicThresholdSensitivity, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Low** \ + * **Medium** \ + * **High** + */ +export type DynamicThresholdSensitivity = string; + +/** Known values of {@link ConditionalOperator} that the service accepts. */ +export enum KnownConditionalOperator { + GreaterThanOrEqual = "GreaterThanOrEqual", + LessThanOrEqual = "LessThanOrEqual", + GreaterThan = "GreaterThan", + LessThan = "LessThan", + Equal = "Equal" +} + +/** + * Defines values for ConditionalOperator. \ + * {@link KnownConditionalOperator} can be used interchangeably with ConditionalOperator, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **GreaterThanOrEqual** \ + * **LessThanOrEqual** \ + * **GreaterThan** \ + * **LessThan** \ + * **Equal** + */ +export type ConditionalOperator = string; + +/** Known values of {@link MetricTriggerType} that the service accepts. */ +export enum KnownMetricTriggerType { + Consecutive = "Consecutive", + Total = "Total" +} + +/** + * Defines values for MetricTriggerType. \ + * {@link KnownMetricTriggerType} can be used interchangeably with MetricTriggerType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Consecutive** \ + * **Total** + */ +export type MetricTriggerType = string; + +/** Known values of {@link AlertSeverity} that the service accepts. */ +export enum KnownAlertSeverity { + Zero = "0", + One = "1", + Two = "2", + Three = "3", + Four = "4" +} + +/** + * Defines values for AlertSeverity. \ + * {@link KnownAlertSeverity} can be used interchangeably with AlertSeverity, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **0** \ + * **1** \ + * **2** \ + * **3** \ + * **4** + */ +export type AlertSeverity = string; +/** Defines values for MetricStatisticType. */ +export type MetricStatisticType = "Average" | "Min" | "Max" | "Sum" | "Count"; +/** Defines values for TimeAggregationType. */ +export type TimeAggregationType = + | "Average" + | "Minimum" + | "Maximum" + | "Total" + | "Count" + | "Last"; +/** Defines values for ComparisonOperationType. */ +export type ComparisonOperationType = + | "Equals" + | "NotEquals" + | "GreaterThan" + | "GreaterThanOrEqual" + | "LessThan" + | "LessThanOrEqual"; +/** Defines values for ScaleDirection. */ +export type ScaleDirection = "None" | "Increase" | "Decrease"; +/** Defines values for ScaleType. */ +export type ScaleType = + | "ChangeCount" + | "PercentChangeCount" + | "ExactCount" + | "ServiceAllowedNextValue"; +/** Defines values for RecurrenceFrequency. */ +export type RecurrenceFrequency = + | "None" + | "Second" + | "Minute" + | "Hour" + | "Day" + | "Week" + | "Month" + | "Year"; +/** Defines values for CategoryType. */ +export type CategoryType = "Metrics" | "Logs"; +/** Defines values for ReceiverStatus. */ +export type ReceiverStatus = "NotSpecified" | "Enabled" | "Disabled"; +/** Defines values for EventLevel. */ +export type EventLevel = + | "Critical" + | "Error" + | "Warning" + | "Informational" + | "Verbose"; +/** Defines values for AggregationType. */ +export type AggregationType = + | "None" + | "Average" + | "Count" + | "Minimum" + | "Maximum" + | "Total"; +/** Defines values for ResultType. */ +export type ResultType = "Data" | "Metadata"; +/** Defines values for ConditionOperator. */ +export type ConditionOperator = + | "GreaterThan" + | "GreaterThanOrEqual" + | "LessThan" + | "LessThanOrEqual"; +/** Defines values for TimeAggregationOperator. */ +export type TimeAggregationOperator = + | "Average" + | "Minimum" + | "Maximum" + | "Total" + | "Last"; + +/** Optional parameters. */ +export interface AutoscaleSettingsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type AutoscaleSettingsListByResourceGroupResponse = AutoscaleSettingResourceCollection; + +/** Optional parameters. */ +export interface AutoscaleSettingsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type AutoscaleSettingsCreateOrUpdateResponse = AutoscaleSettingResource; + +/** Optional parameters. */ +export interface AutoscaleSettingsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface AutoscaleSettingsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type AutoscaleSettingsGetResponse = AutoscaleSettingResource; + +/** Optional parameters. */ +export interface AutoscaleSettingsUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type AutoscaleSettingsUpdateResponse = AutoscaleSettingResource; + +/** Optional parameters. */ +export interface AutoscaleSettingsListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type AutoscaleSettingsListBySubscriptionResponse = AutoscaleSettingResourceCollection; + +/** Optional parameters. */ +export interface AutoscaleSettingsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type AutoscaleSettingsListByResourceGroupNextResponse = AutoscaleSettingResourceCollection; + +/** Optional parameters. */ +export interface AutoscaleSettingsListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type AutoscaleSettingsListBySubscriptionNextResponse = AutoscaleSettingResourceCollection; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface AlertRuleIncidentsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type AlertRuleIncidentsGetResponse = Incident; + +/** Optional parameters. */ +export interface AlertRuleIncidentsListByAlertRuleOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByAlertRule operation. */ +export type AlertRuleIncidentsListByAlertRuleResponse = IncidentListResult; + +/** Optional parameters. */ +export interface AlertRulesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type AlertRulesCreateOrUpdateResponse = AlertRuleResource; + +/** Optional parameters. */ +export interface AlertRulesDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface AlertRulesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type AlertRulesGetResponse = AlertRuleResource; + +/** Optional parameters. */ +export interface AlertRulesUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type AlertRulesUpdateResponse = AlertRuleResource; + +/** Optional parameters. */ +export interface AlertRulesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type AlertRulesListByResourceGroupResponse = AlertRuleResourceCollection; + +/** Optional parameters. */ +export interface AlertRulesListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type AlertRulesListBySubscriptionResponse = AlertRuleResourceCollection; + +/** Optional parameters. */ +export interface LogProfilesDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface LogProfilesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type LogProfilesGetResponse = LogProfileResource; + +/** Optional parameters. */ +export interface LogProfilesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type LogProfilesCreateOrUpdateResponse = LogProfileResource; + +/** Optional parameters. */ +export interface LogProfilesUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type LogProfilesUpdateResponse = LogProfileResource; + +/** Optional parameters. */ +export interface LogProfilesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type LogProfilesListResponse = LogProfileCollection; + +/** Optional parameters. */ +export interface DiagnosticSettingsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type DiagnosticSettingsGetResponse = DiagnosticSettingsResource; + +/** Optional parameters. */ +export interface DiagnosticSettingsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type DiagnosticSettingsCreateOrUpdateResponse = DiagnosticSettingsResource; + +/** Optional parameters. */ +export interface DiagnosticSettingsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface DiagnosticSettingsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type DiagnosticSettingsListResponse = DiagnosticSettingsResourceCollection; + +/** Optional parameters. */ +export interface DiagnosticSettingsCategoryGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type DiagnosticSettingsCategoryGetResponse = DiagnosticSettingsCategoryResource; + +/** Optional parameters. */ +export interface DiagnosticSettingsCategoryListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type DiagnosticSettingsCategoryListResponse = DiagnosticSettingsCategoryResourceCollection; + +/** Optional parameters. */ +export interface ActionGroupsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type ActionGroupsCreateOrUpdateResponse = ActionGroupResource; + +/** Optional parameters. */ +export interface ActionGroupsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ActionGroupsGetResponse = ActionGroupResource; + +/** Optional parameters. */ +export interface ActionGroupsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface ActionGroupsUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type ActionGroupsUpdateResponse = ActionGroupResource; + +/** Optional parameters. */ +export interface ActionGroupsPostTestNotificationsOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the postTestNotifications operation. */ +export type ActionGroupsPostTestNotificationsResponse = TestNotificationResponse; + +/** Optional parameters. */ +export interface ActionGroupsGetTestNotificationsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getTestNotifications operation. */ +export type ActionGroupsGetTestNotificationsResponse = TestNotificationDetailsResponse; + +/** Optional parameters. */ +export interface ActionGroupsListBySubscriptionIdOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionId operation. */ +export type ActionGroupsListBySubscriptionIdResponse = ActionGroupList; + +/** Optional parameters. */ +export interface ActionGroupsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type ActionGroupsListByResourceGroupResponse = ActionGroupList; + +/** Optional parameters. */ +export interface ActionGroupsEnableReceiverOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface ActivityLogsListOptionalParams + extends coreClient.OperationOptions { + /** Used to fetch events with only the given properties.
The **$select** argument is a comma separated list of property names to be returned. Possible values are: *authorization*, *claims*, *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, *status*, *submissionTimestamp*, *subStatus*, *subscriptionId* */ + select?: string; +} + +/** Contains response data for the list operation. */ +export type ActivityLogsListResponse = EventDataCollection; + +/** Optional parameters. */ +export interface ActivityLogsListNextOptionalParams + extends coreClient.OperationOptions { + /** Used to fetch events with only the given properties.
The **$select** argument is a comma separated list of property names to be returned. Possible values are: *authorization*, *claims*, *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, *status*, *submissionTimestamp*, *subStatus*, *subscriptionId* */ + select?: string; +} + +/** Contains response data for the listNext operation. */ +export type ActivityLogsListNextResponse = EventDataCollection; + +/** Optional parameters. */ +export interface EventCategoriesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type EventCategoriesListResponse = EventCategoryCollection; + +/** Optional parameters. */ +export interface TenantActivityLogsListOptionalParams + extends coreClient.OperationOptions { + /** Used to fetch events with only the given properties.
The **$select** argument is a comma separated list of property names to be returned. Possible values are: *authorization*, *claims*, *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, *status*, *submissionTimestamp*, *subStatus*, *subscriptionId* */ + select?: string; + /** Reduces the set of data collected.
The **$filter** is very restricted and allows only the following patterns.
- List events for a resource group: $filter=eventTimestamp ge '' and eventTimestamp le '' and eventChannels eq 'Admin, Operation' and resourceGroupName eq ''.
- List events for resource: $filter=eventTimestamp ge '' and eventTimestamp le '' and eventChannels eq 'Admin, Operation' and resourceUri eq ''.
- List events for a subscription: $filter=eventTimestamp ge '' and eventTimestamp le '' and eventChannels eq 'Admin, Operation'.
- List events for a resource provider: $filter=eventTimestamp ge '' and eventTimestamp le '' and eventChannels eq 'Admin, Operation' and resourceProvider eq ''.
- List events for a correlation Id: api-version=2014-04-01&$filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and correlationId eq ''.
**NOTE**: No other syntax is allowed. */ filter?: string; - /** - * Used to fetch events with only the given properties.
The **$select** argument is a comma - * separated list of property names to be returned. Possible values are: *authorization*, - * *claims*, *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, - * *httpRequest*, *level*, *operationId*, *operationName*, *properties*, *resourceGroupName*, - * *resourceProviderName*, *resourceId*, *status*, *submissionTimestamp*, *subStatus*, - * *subscriptionId* - */ +} + +/** Contains response data for the list operation. */ +export type TenantActivityLogsListResponse = EventDataCollection; + +/** Optional parameters. */ +export interface TenantActivityLogsListNextOptionalParams + extends coreClient.OperationOptions { + /** Used to fetch events with only the given properties.
The **$select** argument is a comma separated list of property names to be returned. Possible values are: *authorization*, *claims*, *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, *status*, *submissionTimestamp*, *subStatus*, *subscriptionId* */ select?: string; + /** Reduces the set of data collected.
The **$filter** is very restricted and allows only the following patterns.
- List events for a resource group: $filter=eventTimestamp ge '' and eventTimestamp le '' and eventChannels eq 'Admin, Operation' and resourceGroupName eq ''.
- List events for resource: $filter=eventTimestamp ge '' and eventTimestamp le '' and eventChannels eq 'Admin, Operation' and resourceUri eq ''.
- List events for a subscription: $filter=eventTimestamp ge '' and eventTimestamp le '' and eventChannels eq 'Admin, Operation'.
- List events for a resource provider: $filter=eventTimestamp ge '' and eventTimestamp le '' and eventChannels eq 'Admin, Operation' and resourceProvider eq ''.
- List events for a correlation Id: api-version=2014-04-01&$filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and correlationId eq ''.
**NOTE**: No other syntax is allowed. */ + filter?: string; } -/** - * Optional Parameters. - */ -export interface MetricDefinitionsListOptionalParams extends msRest.RequestOptionsBase { - /** - * Metric namespace to query metric definitions for. - */ +/** Contains response data for the listNext operation. */ +export type TenantActivityLogsListNextResponse = EventDataCollection; + +/** Optional parameters. */ +export interface MetricDefinitionsListOptionalParams + extends coreClient.OperationOptions { + /** Metric namespace to query metric definitions for. */ metricnamespace?: string; } -/** - * Optional Parameters. - */ -export interface MetricsListOptionalParams extends msRest.RequestOptionsBase { - /** - * The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - */ +/** Contains response data for the list operation. */ +export type MetricDefinitionsListResponse = MetricDefinitionCollection; + +/** 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' "** */ + filter?: string; + /** Metric namespace to query metric definitions for. */ + metricnamespace?: string; + /** The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'. */ timespan?: string; - /** - * The interval (i.e. timegrain) of the query. - */ + /** The interval (i.e. timegrain) of the query. */ interval?: string; - /** - * The names of the metrics (comma separated) to retrieve. - */ + /** The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'** */ metricnames?: string; - /** - * The list of aggregation types (comma separated) to retrieve. - */ + /** The list of aggregation types (comma separated) to retrieve. */ aggregation?: string; /** * The maximum number of records to retrieve. @@ -2951,1614 +3590,533 @@ export interface MetricsListOptionalParams extends msRest.RequestOptionsBase { * Examples: sum asc. */ orderby?: string; - /** - * The **$filter** is used to reduce the set of metric data returned.
Example:
Metric - * contains metadata A, B and C.
- Return all time series of C where A = a1 and B = b1 or - * b2
**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**
- Invalid - * variant:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**
This is invalid - * because the logical or operator cannot separate two different metadata names.
- Return all - * time series where A = a1, B = b1 and C = c1:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq - * ‘c1’**
- Return all time series where A = a1
**$filter=A eq ‘a1’ and B eq ‘*’ and C eq - * ‘*’**. - */ - filter?: string; - /** - * Reduces the set of data collected. The syntax allowed depends on the operation. See the - * operation's description for details. Possible values include: 'Data', 'Metadata' - */ + /** Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details. */ resultType?: ResultType; - /** - * Metric namespace to query metric definitions for. - */ - metricnamespace?: string; } -/** - * Optional Parameters. - */ -export interface MetricBaselineGetOptionalParams extends msRest.RequestOptionsBase { - /** - * 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 aggregation type of the metric to retrieve the baseline for. - */ - aggregation?: string; - /** - * The list of sensitivities (comma separated) to retrieve. - */ - sensitivities?: string; - /** - * Allows retrieving only metadata of the baseline. On data request all information is retrieved. - * Possible values include: 'Data', 'Metadata' - */ - resultType?: ResultType; -} +/** Contains response data for the list operation. */ +export type MetricsListResponse = Response; -/** - * Optional Parameters. - */ -export interface BaselinesListOptionalParams extends msRest.RequestOptionsBase { - /** - * The names of the metrics (comma separated) to retrieve. - */ - metricnames?: string; - /** - * Metric namespace to query metric definitions for. - */ +/** Optional parameters. */ +export interface BaselinesListOptionalParams + 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' "** */ + filter?: string; + /** Metric namespace to query metric definitions for. */ metricnamespace?: string; - /** - * The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - */ + /** 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. - */ + /** The interval (i.e. timegrain) of the query. */ interval?: string; - /** - * The list of aggregation types (comma separated) to retrieve. - */ + /** The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'** */ + metricnames?: string; + /** The list of aggregation types (comma separated) to retrieve. */ aggregation?: string; - /** - * The list of sensitivities (comma separated) to retrieve. - */ - sensitivities?: 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; - /** - * Allows retrieving only metadata of the baseline. On data request all information is retrieved. - * Possible values include: 'Data', 'Metadata' - */ + /** Allows retrieving only metadata of the baseline. On data request all information is retrieved. */ resultType?: ResultType; + /** The list of sensitivities (comma separated) to retrieve. */ + sensitivities?: string; } -/** - * Optional Parameters. - */ -export interface ScheduledQueryRulesListBySubscriptionOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation. For more information please see - * https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx - */ +/** Contains response data for the list operation. */ +export type BaselinesListResponse = MetricBaselinesResponse; + +/** Optional parameters. */ +export interface MetricAlertsListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type MetricAlertsListBySubscriptionResponse = MetricAlertResourceCollection; + +/** Optional parameters. */ +export interface MetricAlertsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type MetricAlertsListByResourceGroupResponse = MetricAlertResourceCollection; + +/** Optional parameters. */ +export interface MetricAlertsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type MetricAlertsGetResponse = MetricAlertResource; + +/** Optional parameters. */ +export interface MetricAlertsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type MetricAlertsCreateOrUpdateResponse = MetricAlertResource; + +/** Optional parameters. */ +export interface MetricAlertsUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type MetricAlertsUpdateResponse = MetricAlertResource; + +/** Optional parameters. */ +export interface MetricAlertsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface MetricAlertsStatusListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type MetricAlertsStatusListResponse = MetricAlertStatusCollection; + +/** Optional parameters. */ +export interface MetricAlertsStatusListByNameOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByName operation. */ +export type MetricAlertsStatusListByNameResponse = MetricAlertStatusCollection; + +/** Optional parameters. */ +export interface ScheduledQueryRulesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type ScheduledQueryRulesCreateOrUpdateResponse = LogSearchRuleResource; + +/** Optional parameters. */ +export interface ScheduledQueryRulesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ScheduledQueryRulesGetResponse = LogSearchRuleResource; + +/** Optional parameters. */ +export interface ScheduledQueryRulesUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type ScheduledQueryRulesUpdateResponse = LogSearchRuleResource; + +/** Optional parameters. */ +export interface ScheduledQueryRulesDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface ScheduledQueryRulesListBySubscriptionOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. For more information please see https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx */ filter?: string; } -/** - * Optional Parameters. - */ -export interface ScheduledQueryRulesListByResourceGroupOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation. For more information please see - * https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx - */ +/** Contains response data for the listBySubscription operation. */ +export type ScheduledQueryRulesListBySubscriptionResponse = LogSearchRuleResourceCollection; + +/** Optional parameters. */ +export interface ScheduledQueryRulesListByResourceGroupOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. For more information please see https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx */ filter?: string; } -/** - * Optional Parameters. - */ -export interface MetricNamespacesListOptionalParams extends msRest.RequestOptionsBase { - /** - * The ISO 8601 conform Date start time from which to query for metric namespaces. - */ +/** Contains response data for the listByResourceGroup operation. */ +export type ScheduledQueryRulesListByResourceGroupResponse = LogSearchRuleResourceCollection; + +/** Optional parameters. */ +export interface MetricNamespacesListOptionalParams + extends coreClient.OperationOptions { + /** The ISO 8601 conform Date start time from which to query for metric namespaces. */ startTime?: string; } -/** - * An interface representing MonitorManagementClientOptions. - */ -export interface MonitorManagementClientOptions extends AzureServiceClientOptions { - baseUri?: string; -} +/** Contains response data for the list operation. */ +export type MetricNamespacesListResponse = MetricNamespaceCollection; -/** - * @interface - * Represents a collection of autoscale setting resources. - * @extends Array - */ -export interface AutoscaleSettingResourceCollection extends Array { - /** - * URL to get the next set of results. - */ - nextLink?: string; -} +/** Optional parameters. */ +export interface VMInsightsGetOnboardingStatusOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * The List incidents operation response. - * @extends Array - */ -export interface IncidentListResult extends Array { -} +/** Contains response data for the getOnboardingStatus operation. */ +export type VMInsightsGetOnboardingStatusResponse = VMInsightsOnboardingStatus; -/** - * @interface - * Represents a collection of alert rule resources. - * @extends Array - */ -export interface AlertRuleResourceCollection extends Array { -} +/** Optional parameters. */ +export interface PrivateLinkScopesListOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * Represents a collection of log profiles. - * @extends Array - */ -export interface LogProfileCollection extends Array { -} +/** Contains response data for the list operation. */ +export type PrivateLinkScopesListResponse = AzureMonitorPrivateLinkScopeListResult; -/** - * @interface - * A list of action groups. - * @extends Array - */ -export interface ActionGroupList extends Array { - /** - * Provides the link to retrieve the next set of elements. - */ - nextLink?: string; -} +/** Optional parameters. */ +export interface PrivateLinkScopesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * A list of activity log alerts. - * @extends Array - */ -export interface ActivityLogAlertList extends Array { - /** - * Provides the link to retrieve the next set of elements. - */ - nextLink?: string; -} +/** Contains response data for the listByResourceGroup operation. */ +export type PrivateLinkScopesListByResourceGroupResponse = AzureMonitorPrivateLinkScopeListResult; -/** - * @interface - * Represents collection of events. - * @extends Array - */ -export interface EventDataCollection extends Array { - /** - * Provides the link to retrieve the next set of events. - */ - nextLink?: string; +/** Optional parameters. */ +export interface PrivateLinkScopesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; } -/** - * @interface - * A collection of event categories. Currently possible values are: Administrative, Security, - * ServiceHealth, Alert, Recommendation, Policy. - * @extends Array - */ -export interface EventCategoryCollection extends Array { -} +/** Optional parameters. */ +export interface PrivateLinkScopesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * Represents collection of metric definitions. - * @extends Array - */ -export interface MetricDefinitionCollection extends Array { -} +/** Contains response data for the get operation. */ +export type PrivateLinkScopesGetResponse = AzureMonitorPrivateLinkScope; -/** - * @interface - * A list of metric baselines. - * @extends Array - */ -export interface MetricBaselinesResponse extends Array { -} +/** Optional parameters. */ +export interface PrivateLinkScopesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * Represents a collection of alert rule resources. - * @extends Array - */ -export interface MetricAlertResourceCollection extends Array { -} +/** Contains response data for the createOrUpdate operation. */ +export type PrivateLinkScopesCreateOrUpdateResponse = AzureMonitorPrivateLinkScope; -/** - * @interface - * Represents a collection of Log Search rule resources. - * @extends Array - */ -export interface LogSearchRuleResourceCollection extends Array { -} +/** Optional parameters. */ +export interface PrivateLinkScopesUpdateTagsOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * Represents collection of metric namespaces. - * @extends Array - */ -export interface MetricNamespaceCollection extends Array { -} +/** Contains response data for the updateTags operation. */ +export type PrivateLinkScopesUpdateTagsResponse = AzureMonitorPrivateLinkScope; -/** - * Defines values for MetricStatisticType. - * Possible values include: 'Average', 'Min', 'Max', 'Sum' - * @readonly - * @enum {string} - */ -export type MetricStatisticType = 'Average' | 'Min' | 'Max' | 'Sum'; +/** Optional parameters. */ +export interface PrivateLinkScopesListNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for TimeAggregationType. - * Possible values include: 'Average', 'Minimum', 'Maximum', 'Total', 'Count', 'Last' - * @readonly - * @enum {string} - */ -export type TimeAggregationType = 'Average' | 'Minimum' | 'Maximum' | 'Total' | 'Count' | 'Last'; +/** Contains response data for the listNext operation. */ +export type PrivateLinkScopesListNextResponse = AzureMonitorPrivateLinkScopeListResult; -/** - * Defines values for ComparisonOperationType. - * Possible values include: 'Equals', 'NotEquals', 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', - * 'LessThanOrEqual' - * @readonly - * @enum {string} - */ -export type ComparisonOperationType = 'Equals' | 'NotEquals' | 'GreaterThan' | 'GreaterThanOrEqual' | 'LessThan' | 'LessThanOrEqual'; +/** Optional parameters. */ +export interface PrivateLinkScopesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for ScaleDirection. - * Possible values include: 'None', 'Increase', 'Decrease' - * @readonly - * @enum {string} - */ -export type ScaleDirection = 'None' | 'Increase' | 'Decrease'; +/** Contains response data for the listByResourceGroupNext operation. */ +export type PrivateLinkScopesListByResourceGroupNextResponse = AzureMonitorPrivateLinkScopeListResult; -/** - * Defines values for ScaleType. - * Possible values include: 'ChangeCount', 'PercentChangeCount', 'ExactCount' - * @readonly - * @enum {string} - */ -export type ScaleType = 'ChangeCount' | 'PercentChangeCount' | 'ExactCount'; +/** Optional parameters. */ +export interface PrivateLinkScopeOperationStatusGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for RecurrenceFrequency. - * Possible values include: 'None', 'Second', 'Minute', 'Hour', 'Day', 'Week', 'Month', 'Year' - * @readonly - * @enum {string} - */ -export type RecurrenceFrequency = 'None' | 'Second' | 'Minute' | 'Hour' | 'Day' | 'Week' | 'Month' | 'Year'; +/** Contains response data for the get operation. */ +export type PrivateLinkScopeOperationStatusGetResponse = OperationStatus; -/** - * Defines values for ConditionOperator. - * Possible values include: 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual' - * @readonly - * @enum {string} - */ -export type ConditionOperator = 'GreaterThan' | 'GreaterThanOrEqual' | 'LessThan' | 'LessThanOrEqual'; +/** Optional parameters. */ +export interface PrivateLinkResourcesListByPrivateLinkScopeOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for TimeAggregationOperator. - * Possible values include: 'Average', 'Minimum', 'Maximum', 'Total', 'Last' - * @readonly - * @enum {string} - */ -export type TimeAggregationOperator = 'Average' | 'Minimum' | 'Maximum' | 'Total' | 'Last'; +/** Contains response data for the listByPrivateLinkScope operation. */ +export type PrivateLinkResourcesListByPrivateLinkScopeResponse = PrivateLinkResourceListResult; -/** - * Defines values for CategoryType. - * Possible values include: 'Metrics', 'Logs' - * @readonly - * @enum {string} - */ -export type CategoryType = 'Metrics' | 'Logs'; +/** Optional parameters. */ +export interface PrivateLinkResourcesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for ReceiverStatus. - * Possible values include: 'NotSpecified', 'Enabled', 'Disabled' - * @readonly - * @enum {string} - */ -export type ReceiverStatus = 'NotSpecified' | 'Enabled' | 'Disabled'; +/** Contains response data for the get operation. */ +export type PrivateLinkResourcesGetResponse = PrivateLinkResource; -/** - * Defines values for EventLevel. - * Possible values include: 'Critical', 'Error', 'Warning', 'Informational', 'Verbose' - * @readonly - * @enum {string} - */ -export type EventLevel = 'Critical' | 'Error' | 'Warning' | 'Informational' | 'Verbose'; +/** Optional parameters. */ +export interface PrivateLinkResourcesListByPrivateLinkScopeNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for Unit. - * Possible values include: 'Count', 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', - * 'Percent', 'MilliSeconds', 'ByteSeconds', 'Unspecified', 'Cores', 'MilliCores', 'NanoCores', - * 'BitsPerSecond' - * @readonly - * @enum {string} - */ -export type Unit = 'Count' | 'Bytes' | 'Seconds' | 'CountPerSecond' | 'BytesPerSecond' | 'Percent' | 'MilliSeconds' | 'ByteSeconds' | 'Unspecified' | 'Cores' | 'MilliCores' | 'NanoCores' | 'BitsPerSecond'; +/** Contains response data for the listByPrivateLinkScopeNext operation. */ +export type PrivateLinkResourcesListByPrivateLinkScopeNextResponse = PrivateLinkResourceListResult; -/** - * Defines values for AggregationType. - * Possible values include: 'None', 'Average', 'Count', 'Minimum', 'Maximum', 'Total' - * @readonly - * @enum {string} - */ -export type AggregationType = 'None' | 'Average' | 'Count' | 'Minimum' | 'Maximum' | 'Total'; +/** Optional parameters. */ +export interface PrivateEndpointConnectionsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for Sensitivity. - * Possible values include: 'Low', 'Medium', 'High' - * @readonly - * @enum {string} - */ -export type Sensitivity = 'Low' | 'Medium' | 'High'; +/** Contains response data for the get operation. */ +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; -/** - * Defines values for BaselineSensitivity. - * Possible values include: 'Low', 'Medium', 'High' - * @readonly - * @enum {string} - */ -export type BaselineSensitivity = 'Low' | 'Medium' | 'High'; +/** Optional parameters. */ +export interface PrivateEndpointConnectionsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Defines values for Enabled. - * Possible values include: 'true', 'false' - * @readonly - * @enum {string} - */ -export type Enabled = 'true' | 'false'; +/** Contains response data for the createOrUpdate operation. */ +export type PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnection; -/** - * Defines values for ProvisioningState. - * Possible values include: 'Succeeded', 'Deploying', 'Canceled', 'Failed' - * @readonly - * @enum {string} - */ -export type ProvisioningState = 'Succeeded' | 'Deploying' | 'Canceled' | 'Failed'; +/** Optional parameters. */ +export interface PrivateEndpointConnectionsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Defines values for QueryType. - * Possible values include: 'ResultCount' - * @readonly - * @enum {string} - */ -export type QueryType = 'ResultCount'; +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListByPrivateLinkScopeOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for ConditionalOperator. - * Possible values include: 'GreaterThan', 'LessThan', 'Equal' - * @readonly - * @enum {string} - */ -export type ConditionalOperator = 'GreaterThan' | 'LessThan' | 'Equal'; +/** Contains response data for the listByPrivateLinkScope operation. */ +export type PrivateEndpointConnectionsListByPrivateLinkScopeResponse = PrivateEndpointConnectionListResult; -/** - * Defines values for MetricTriggerType. - * Possible values include: 'Consecutive', 'Total' - * @readonly - * @enum {string} - */ -export type MetricTriggerType = 'Consecutive' | 'Total'; +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListByPrivateLinkScopeNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for AlertSeverity. - * Possible values include: '0', '1', '2', '3', '4' - * @readonly - * @enum {string} - */ -export type AlertSeverity = '0' | '1' | '2' | '3' | '4'; +/** Contains response data for the listByPrivateLinkScopeNext operation. */ +export type PrivateEndpointConnectionsListByPrivateLinkScopeNextResponse = PrivateEndpointConnectionListResult; -/** - * Defines values for OnboardingStatus. - * Possible values include: 'onboarded', 'notOnboarded', 'unknown' - * @readonly - * @enum {string} - */ -export type OnboardingStatus = 'onboarded' | 'notOnboarded' | 'unknown'; +/** Optional parameters. */ +export interface PrivateLinkScopedResourcesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for DataStatus. - * Possible values include: 'present', 'notPresent' - * @readonly - * @enum {string} - */ -export type DataStatus = 'present' | 'notPresent'; +/** Contains response data for the get operation. */ +export type PrivateLinkScopedResourcesGetResponse = ScopedResource; -/** - * Defines values for ResultType. - * Possible values include: 'Data', 'Metadata' - * @readonly - * @enum {string} - */ -export type ResultType = 'Data' | 'Metadata'; +/** Optional parameters. */ +export interface PrivateLinkScopedResourcesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listByResourceGroup operation. - */ -export type AutoscaleSettingsListByResourceGroupResponse = AutoscaleSettingResourceCollection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AutoscaleSettingResourceCollection; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type PrivateLinkScopedResourcesCreateOrUpdateResponse = ScopedResource; -/** - * Contains response data for the createOrUpdate operation. - */ -export type AutoscaleSettingsCreateOrUpdateResponse = AutoscaleSettingResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AutoscaleSettingResource; - }; -}; +/** Optional parameters. */ +export interface PrivateLinkScopedResourcesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the get operation. - */ -export type AutoscaleSettingsGetResponse = AutoscaleSettingResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AutoscaleSettingResource; - }; -}; +/** Optional parameters. */ +export interface PrivateLinkScopedResourcesListByPrivateLinkScopeOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the update operation. - */ -export type AutoscaleSettingsUpdateResponse = AutoscaleSettingResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AutoscaleSettingResource; - }; -}; +/** Contains response data for the listByPrivateLinkScope operation. */ +export type PrivateLinkScopedResourcesListByPrivateLinkScopeResponse = ScopedResourceListResult; -/** - * Contains response data for the listBySubscription operation. - */ -export type AutoscaleSettingsListBySubscriptionResponse = AutoscaleSettingResourceCollection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AutoscaleSettingResourceCollection; - }; -}; +/** Optional parameters. */ +export interface PrivateLinkScopedResourcesListByPrivateLinkScopeNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByResourceGroupNext operation. - */ -export type AutoscaleSettingsListByResourceGroupNextResponse = AutoscaleSettingResourceCollection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AutoscaleSettingResourceCollection; - }; -}; +/** Contains response data for the listByPrivateLinkScopeNext operation. */ +export type PrivateLinkScopedResourcesListByPrivateLinkScopeNextResponse = ScopedResourceListResult; -/** - * Contains response data for the listBySubscriptionNext operation. - */ -export type AutoscaleSettingsListBySubscriptionNextResponse = AutoscaleSettingResourceCollection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AutoscaleSettingResourceCollection; - }; -}; +/** Optional parameters. */ +export interface ActivityLogAlertsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type OperationsListResponse = OperationListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationListResult; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type ActivityLogAlertsCreateOrUpdateResponse = ActivityLogAlertResource; + +/** Optional parameters. */ +export interface ActivityLogAlertsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ActivityLogAlertsGetResponse = ActivityLogAlertResource; + +/** Optional parameters. */ +export interface ActivityLogAlertsDeleteOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type AlertRuleIncidentsGetResponse = Incident & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Incident; - }; -}; +/** Optional parameters. */ +export interface ActivityLogAlertsUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByAlertRule operation. - */ -export type AlertRuleIncidentsListByAlertRuleResponse = IncidentListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: IncidentListResult; - }; -}; +/** Contains response data for the update operation. */ +export type ActivityLogAlertsUpdateResponse = ActivityLogAlertResource; -/** - * Contains response data for the createOrUpdate operation. - */ -export type AlertRulesCreateOrUpdateResponse = AlertRuleResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AlertRuleResource; - }; -}; +/** Optional parameters. */ +export interface ActivityLogAlertsListBySubscriptionIdOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type AlertRulesGetResponse = AlertRuleResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AlertRuleResource; - }; -}; +/** Contains response data for the listBySubscriptionId operation. */ +export type ActivityLogAlertsListBySubscriptionIdResponse = ActivityLogAlertList; -/** - * Contains response data for the update operation. - */ -export type AlertRulesUpdateResponse = AlertRuleResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AlertRuleResource; - }; -}; +/** Optional parameters. */ +export interface ActivityLogAlertsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByResourceGroup operation. - */ -export type AlertRulesListByResourceGroupResponse = AlertRuleResourceCollection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AlertRuleResourceCollection; - }; -}; +/** Contains response data for the listByResourceGroup operation. */ +export type ActivityLogAlertsListByResourceGroupResponse = ActivityLogAlertList; -/** - * Contains response data for the listBySubscription operation. - */ -export type AlertRulesListBySubscriptionResponse = AlertRuleResourceCollection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AlertRuleResourceCollection; - }; -}; +/** Optional parameters. */ +export interface DataCollectionEndpointsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type LogProfilesGetResponse = LogProfileResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: LogProfileResource; - }; -}; +/** Contains response data for the listByResourceGroup operation. */ +export type DataCollectionEndpointsListByResourceGroupResponse = DataCollectionEndpointResourceListResult; -/** - * Contains response data for the createOrUpdate operation. - */ -export type LogProfilesCreateOrUpdateResponse = LogProfileResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: LogProfileResource; - }; -}; +/** Optional parameters. */ +export interface DataCollectionEndpointsListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the update operation. - */ -export type LogProfilesUpdateResponse = LogProfileResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: LogProfileResource; - }; -}; +/** Contains response data for the listBySubscription operation. */ +export type DataCollectionEndpointsListBySubscriptionResponse = DataCollectionEndpointResourceListResult; -/** - * Contains response data for the list operation. - */ -export type LogProfilesListResponse = LogProfileCollection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: LogProfileCollection; - }; -}; +/** Optional parameters. */ +export interface DataCollectionEndpointsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type DiagnosticSettingsGetResponse = DiagnosticSettingsResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DiagnosticSettingsResource; - }; -}; +/** Contains response data for the get operation. */ +export type DataCollectionEndpointsGetResponse = DataCollectionEndpointResource; -/** - * Contains response data for the createOrUpdate operation. - */ -export type DiagnosticSettingsCreateOrUpdateResponse = DiagnosticSettingsResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DiagnosticSettingsResource; - }; -}; +/** Optional parameters. */ +export interface DataCollectionEndpointsCreateOptionalParams + extends coreClient.OperationOptions { + /** The payload */ + body?: DataCollectionEndpointResource; +} -/** - * Contains response data for the list operation. - */ -export type DiagnosticSettingsListResponse = DiagnosticSettingsResourceCollection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DiagnosticSettingsResourceCollection; - }; -}; +/** Contains response data for the create operation. */ +export type DataCollectionEndpointsCreateResponse = DataCollectionEndpointResource; -/** - * Contains response data for the get operation. - */ -export type DiagnosticSettingsCategoryGetResponse = DiagnosticSettingsCategoryResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DiagnosticSettingsCategoryResource; - }; -}; +/** Optional parameters. */ +export interface DataCollectionEndpointsUpdateOptionalParams + extends coreClient.OperationOptions { + /** The payload */ + body?: ResourceForUpdate; +} -/** - * Contains response data for the list operation. - */ -export type DiagnosticSettingsCategoryListResponse = DiagnosticSettingsCategoryResourceCollection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DiagnosticSettingsCategoryResourceCollection; - }; -}; +/** Contains response data for the update operation. */ +export type DataCollectionEndpointsUpdateResponse = DataCollectionEndpointResource; -/** - * Contains response data for the createOrUpdate operation. - */ -export type ActionGroupsCreateOrUpdateResponse = ActionGroupResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ActionGroupResource; - }; -}; +/** Optional parameters. */ +export interface DataCollectionEndpointsDeleteOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type ActionGroupsGetResponse = ActionGroupResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ActionGroupResource; - }; -}; +/** Optional parameters. */ +export interface DataCollectionEndpointsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the update operation. - */ -export type ActionGroupsUpdateResponse = ActionGroupResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ActionGroupResource; - }; -}; +/** Contains response data for the listByResourceGroupNext operation. */ +export type DataCollectionEndpointsListByResourceGroupNextResponse = DataCollectionEndpointResourceListResult; -/** - * Contains response data for the listBySubscriptionId operation. - */ -export type ActionGroupsListBySubscriptionIdResponse = ActionGroupList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ActionGroupList; - }; -}; +/** Optional parameters. */ +export interface DataCollectionEndpointsListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByResourceGroup operation. - */ -export type ActionGroupsListByResourceGroupResponse = ActionGroupList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ActionGroupList; - }; -}; +/** Contains response data for the listBySubscriptionNext operation. */ +export type DataCollectionEndpointsListBySubscriptionNextResponse = DataCollectionEndpointResourceListResult; -/** - * Contains response data for the createOrUpdate operation. - */ -export type ActivityLogAlertsCreateOrUpdateResponse = ActivityLogAlertResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ActivityLogAlertResource; - }; -}; +/** Optional parameters. */ +export interface DataCollectionRuleAssociationsListByResourceOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type ActivityLogAlertsGetResponse = ActivityLogAlertResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ActivityLogAlertResource; - }; -}; +/** Contains response data for the listByResource operation. */ +export type DataCollectionRuleAssociationsListByResourceResponse = DataCollectionRuleAssociationProxyOnlyResourceListResult; -/** - * Contains response data for the update operation. - */ -export type ActivityLogAlertsUpdateResponse = ActivityLogAlertResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ActivityLogAlertResource; - }; -}; +/** Optional parameters. */ +export interface DataCollectionRuleAssociationsListByRuleOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listBySubscriptionId operation. - */ -export type ActivityLogAlertsListBySubscriptionIdResponse = ActivityLogAlertList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ActivityLogAlertList; - }; -}; +/** Contains response data for the listByRule operation. */ +export type DataCollectionRuleAssociationsListByRuleResponse = DataCollectionRuleAssociationProxyOnlyResourceListResult; -/** - * Contains response data for the listByResourceGroup operation. - */ -export type ActivityLogAlertsListByResourceGroupResponse = ActivityLogAlertList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ActivityLogAlertList; - }; -}; +/** Optional parameters. */ +export interface DataCollectionRuleAssociationsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type ActivityLogsListResponse = EventDataCollection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: EventDataCollection; - }; -}; +/** Contains response data for the get operation. */ +export type DataCollectionRuleAssociationsGetResponse = DataCollectionRuleAssociationProxyOnlyResource; -/** - * Contains response data for the listNext operation. - */ -export type ActivityLogsListNextResponse = EventDataCollection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: EventDataCollection; - }; -}; +/** Optional parameters. */ +export interface DataCollectionRuleAssociationsCreateOptionalParams + extends coreClient.OperationOptions { + /** The payload */ + body?: DataCollectionRuleAssociationProxyOnlyResource; +} -/** - * Contains response data for the list operation. - */ -export type EventCategoriesListResponse = EventCategoryCollection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: EventCategoryCollection; - }; -}; +/** Contains response data for the create operation. */ +export type DataCollectionRuleAssociationsCreateResponse = DataCollectionRuleAssociationProxyOnlyResource; -/** - * Contains response data for the list operation. - */ -export type TenantActivityLogsListResponse = EventDataCollection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: EventDataCollection; - }; -}; +/** Optional parameters. */ +export interface DataCollectionRuleAssociationsDeleteOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listNext operation. - */ -export type TenantActivityLogsListNextResponse = EventDataCollection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: EventDataCollection; - }; -}; +/** Optional parameters. */ +export interface DataCollectionRuleAssociationsListByResourceNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type MetricDefinitionsListResponse = MetricDefinitionCollection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricDefinitionCollection; - }; -}; +/** Contains response data for the listByResourceNext operation. */ +export type DataCollectionRuleAssociationsListByResourceNextResponse = DataCollectionRuleAssociationProxyOnlyResourceListResult; -/** - * Contains response data for the list operation. - */ -export type MetricsListResponse = Response & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Response; - }; -}; +/** Optional parameters. */ +export interface DataCollectionRuleAssociationsListByRuleNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type MetricBaselineGetResponse = BaselineResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: BaselineResponse; - }; -}; +/** Contains response data for the listByRuleNext operation. */ +export type DataCollectionRuleAssociationsListByRuleNextResponse = DataCollectionRuleAssociationProxyOnlyResourceListResult; -/** - * Contains response data for the calculateBaseline operation. - */ -export type MetricBaselineCalculateBaselineResponse = CalculateBaselineResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CalculateBaselineResponse; - }; -}; +/** Optional parameters. */ +export interface DataCollectionRulesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type BaselinesListResponse = MetricBaselinesResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricBaselinesResponse; - }; -}; +/** Contains response data for the listByResourceGroup operation. */ +export type DataCollectionRulesListByResourceGroupResponse = DataCollectionRuleResourceListResult; -/** - * Contains response data for the listBySubscription operation. - */ -export type MetricAlertsListBySubscriptionResponse = MetricAlertResourceCollection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricAlertResourceCollection; - }; -}; +/** Optional parameters. */ +export interface DataCollectionRulesListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByResourceGroup operation. - */ -export type MetricAlertsListByResourceGroupResponse = MetricAlertResourceCollection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricAlertResourceCollection; - }; -}; +/** Contains response data for the listBySubscription operation. */ +export type DataCollectionRulesListBySubscriptionResponse = DataCollectionRuleResourceListResult; -/** - * Contains response data for the get operation. - */ -export type MetricAlertsGetResponse = MetricAlertResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricAlertResource; - }; -}; +/** Optional parameters. */ +export interface DataCollectionRulesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type MetricAlertsCreateOrUpdateResponse = MetricAlertResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricAlertResource; - }; -}; +/** Contains response data for the get operation. */ +export type DataCollectionRulesGetResponse = DataCollectionRuleResource; -/** - * Contains response data for the update operation. - */ -export type MetricAlertsUpdateResponse = MetricAlertResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricAlertResource; - }; -}; +/** Optional parameters. */ +export interface DataCollectionRulesCreateOptionalParams + extends coreClient.OperationOptions { + /** The payload */ + body?: DataCollectionRuleResource; +} -/** - * Contains response data for the list operation. - */ -export type MetricAlertsStatusListResponse = MetricAlertStatusCollection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricAlertStatusCollection; - }; -}; +/** Contains response data for the create operation. */ +export type DataCollectionRulesCreateResponse = DataCollectionRuleResource; -/** - * Contains response data for the listByName operation. - */ -export type MetricAlertsStatusListByNameResponse = MetricAlertStatusCollection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricAlertStatusCollection; - }; -}; +/** Optional parameters. */ +export interface DataCollectionRulesUpdateOptionalParams + extends coreClient.OperationOptions { + /** The payload */ + body?: ResourceForUpdate; +} -/** - * Contains response data for the createOrUpdate operation. - */ -export type ScheduledQueryRulesCreateOrUpdateResponse = LogSearchRuleResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: LogSearchRuleResource; - }; -}; +/** Contains response data for the update operation. */ +export type DataCollectionRulesUpdateResponse = DataCollectionRuleResource; -/** - * Contains response data for the get operation. - */ -export type ScheduledQueryRulesGetResponse = LogSearchRuleResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: LogSearchRuleResource; - }; -}; +/** Optional parameters. */ +export interface DataCollectionRulesDeleteOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the update operation. - */ -export type ScheduledQueryRulesUpdateResponse = LogSearchRuleResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: LogSearchRuleResource; - }; -}; +/** Optional parameters. */ +export interface DataCollectionRulesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listBySubscription operation. - */ -export type ScheduledQueryRulesListBySubscriptionResponse = LogSearchRuleResourceCollection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: LogSearchRuleResourceCollection; - }; -}; +/** Contains response data for the listByResourceGroupNext operation. */ +export type DataCollectionRulesListByResourceGroupNextResponse = DataCollectionRuleResourceListResult; -/** - * Contains response data for the listByResourceGroup operation. - */ -export type ScheduledQueryRulesListByResourceGroupResponse = LogSearchRuleResourceCollection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: LogSearchRuleResourceCollection; - }; -}; +/** Optional parameters. */ +export interface DataCollectionRulesListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type MetricNamespacesListResponse = MetricNamespaceCollection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MetricNamespaceCollection; - }; -}; +/** Contains response data for the listBySubscriptionNext operation. */ +export type DataCollectionRulesListBySubscriptionNextResponse = DataCollectionRuleResourceListResult; -/** - * Contains response data for the getOnboardingStatus operation. - */ -export type VMInsightsGetOnboardingStatusResponse = VMInsightsOnboardingStatus & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: VMInsightsOnboardingStatus; - }; -}; +/** Optional parameters. */ +export interface MonitorClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/monitor/arm-monitor/src/models/logProfilesMappers.ts b/sdk/monitor/arm-monitor/src/models/logProfilesMappers.ts deleted file mode 100644 index a1ad33c209e5..000000000000 --- a/sdk/monitor/arm-monitor/src/models/logProfilesMappers.ts +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - Action, - ActionGroupResource, - ActivityLogAlertActionGroup, - ActivityLogAlertActionList, - ActivityLogAlertAllOfCondition, - ActivityLogAlertLeafCondition, - ActivityLogAlertResource, - AlertingAction, - AlertRuleResource, - ArmRoleReceiver, - AutomationRunbookReceiver, - AutoscaleNotification, - AutoscaleProfile, - AutoscaleSettingResource, - AzNsActionGroup, - AzureAppPushReceiver, - AzureFunctionReceiver, - BaseResource, - CloudError, - Criteria, - DataContainer, - DiagnosticSettingsCategoryResource, - DiagnosticSettingsResource, - Dimension, - DynamicMetricCriteria, - DynamicThresholdFailingPeriods, - EmailNotification, - EmailReceiver, - ErrorResponse, - ItsmReceiver, - LocationThresholdRuleCondition, - LogicAppReceiver, - LogMetricTrigger, - LogProfileCollection, - LogProfileResource, - LogProfileResourcePatch, - LogSearchRuleResource, - LogSettings, - LogToMetricAction, - ManagementEventAggregationCondition, - ManagementEventRuleCondition, - MetricAlertAction, - MetricAlertCriteria, - MetricAlertMultipleResourceMultipleMetricCriteria, - MetricAlertResource, - MetricAlertSingleResourceMultipleMetricCriteria, - MetricCriteria, - MetricDimension, - MetricSettings, - MetricTrigger, - MultiMetricCriteria, - ProxyOnlyResource, - ProxyResource, - Recurrence, - RecurrentSchedule, - Resource, - RetentionPolicy, - RuleAction, - RuleCondition, - RuleDataSource, - RuleEmailAction, - RuleManagementEventClaimsDataSource, - RuleManagementEventDataSource, - RuleMetricDataSource, - RuleWebhookAction, - ScaleAction, - ScaleCapacity, - ScaleRule, - Schedule, - SmsReceiver, - Source, - ThresholdRuleCondition, - TimeWindow, - TriggerCondition, - VMInsightsOnboardingStatus, - VoiceReceiver, - WebhookNotification, - WebhookReceiver, - WorkspaceInfo -} from "../models/mappers"; diff --git a/sdk/monitor/arm-monitor/src/models/mappers.ts b/sdk/monitor/arm-monitor/src/models/mappers.ts index 3528feefba03..1e57aafe18fc 100644 --- a/sdk/monitor/arm-monitor/src/models/mappers.ts +++ b/sdk/monitor/arm-monitor/src/models/mappers.ts @@ -1,89 +1,113 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export const CloudError = CloudErrorMapper; -export const BaseResource = BaseResourceMapper; - -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const AutoscaleSettingResourceCollection: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "AutoscaleSettingResourceCollection", modelProperties: { - id: { - readOnly: true, - serializedName: "id", + value: { + serializedName: "value", + required: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AutoscaleSettingResource" + } + } } }, - name: { - readOnly: true, - serializedName: "name", + nextLink: { + serializedName: "nextLink", type: { name: "String" } - }, - type: { - readOnly: true, - serializedName: "type", + } + } + } +}; + +export const AutoscaleProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AutoscaleProfile", + modelProperties: { + name: { + serializedName: "name", + required: true, type: { name: "String" } }, - location: { - required: true, - serializedName: "location", + capacity: { + serializedName: "capacity", type: { - name: "String" + name: "Composite", + className: "ScaleCapacity" } }, - tags: { - serializedName: "tags", + rules: { + serializedName: "rules", + required: true, type: { - name: "Dictionary", - value: { + name: "Sequence", + element: { type: { - name: "String" + name: "Composite", + className: "ScaleRule" } } } + }, + fixedDate: { + serializedName: "fixedDate", + type: { + name: "Composite", + className: "TimeWindow" + } + }, + recurrence: { + serializedName: "recurrence", + type: { + name: "Composite", + className: "Recurrence" + } } } } }; -export const ScaleCapacity: msRest.CompositeMapper = { - serializedName: "ScaleCapacity", +export const ScaleCapacity: coreClient.CompositeMapper = { type: { name: "Composite", className: "ScaleCapacity", modelProperties: { minimum: { - required: true, serializedName: "minimum", + required: true, type: { name: "String" } }, maximum: { - required: true, serializedName: "maximum", + required: true, type: { name: "String" } }, default: { - required: true, serializedName: "default", + required: true, type: { name: "String" } @@ -92,56 +116,85 @@ export const ScaleCapacity: msRest.CompositeMapper = { } }; -export const MetricTrigger: msRest.CompositeMapper = { - serializedName: "MetricTrigger", +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: { - required: true, serializedName: "metricName", + required: true, + type: { + name: "String" + } + }, + metricNamespace: { + serializedName: "metricNamespace", type: { name: "String" } }, metricResourceUri: { - required: true, serializedName: "metricResourceUri", + required: true, + type: { + name: "String" + } + }, + metricResourceLocation: { + serializedName: "metricResourceLocation", type: { name: "String" } }, timeGrain: { - required: true, serializedName: "timeGrain", + required: true, type: { name: "TimeSpan" } }, statistic: { - required: true, serializedName: "statistic", + required: true, type: { name: "Enum", - allowedValues: [ - "Average", - "Min", - "Max", - "Sum" - ] + allowedValues: ["Average", "Min", "Max", "Sum", "Count"] } }, timeWindow: { - required: true, serializedName: "timeWindow", + required: true, type: { name: "TimeSpan" } }, timeAggregation: { - required: true, serializedName: "timeAggregation", + required: true, type: { name: "Enum", allowedValues: [ @@ -155,8 +208,8 @@ export const MetricTrigger: msRest.CompositeMapper = { } }, operator: { - required: true, serializedName: "operator", + required: true, type: { name: "Enum", allowedValues: [ @@ -170,56 +223,105 @@ export const MetricTrigger: msRest.CompositeMapper = { } }, threshold: { - required: true, 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: msRest.CompositeMapper = { - serializedName: "ScaleAction", +export const ScaleAction: coreClient.CompositeMapper = { type: { name: "Composite", className: "ScaleAction", modelProperties: { direction: { - required: true, serializedName: "direction", + required: true, type: { name: "Enum", - allowedValues: [ - "None", - "Increase", - "Decrease" - ] + allowedValues: ["None", "Increase", "Decrease"] } }, type: { - required: true, serializedName: "type", + required: true, type: { name: "Enum", allowedValues: [ "ChangeCount", "PercentChangeCount", - "ExactCount" + "ExactCount", + "ServiceAllowedNextValue" ] } }, value: { + defaultValue: "1", serializedName: "value", - defaultValue: '1', type: { name: "String" } }, cooldown: { - required: true, serializedName: "cooldown", + required: true, type: { name: "TimeSpan" } @@ -228,78 +330,83 @@ export const ScaleAction: msRest.CompositeMapper = { } }; -export const ScaleRule: msRest.CompositeMapper = { - serializedName: "ScaleRule", +export const TimeWindow: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ScaleRule", + className: "TimeWindow", modelProperties: { - metricTrigger: { + timeZone: { + serializedName: "timeZone", + type: { + name: "String" + } + }, + start: { + serializedName: "start", required: true, - serializedName: "metricTrigger", type: { - name: "Composite", - className: "MetricTrigger" + name: "DateTime" } }, - scaleAction: { + end: { + serializedName: "end", required: true, - serializedName: "scaleAction", type: { - name: "Composite", - className: "ScaleAction" + name: "DateTime" } } } } }; -export const TimeWindow: msRest.CompositeMapper = { - serializedName: "TimeWindow", +export const Recurrence: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TimeWindow", + className: "Recurrence", modelProperties: { - timeZone: { - serializedName: "timeZone", - type: { - name: "String" - } - }, - start: { + frequency: { + serializedName: "frequency", required: true, - serializedName: "start", type: { - name: "DateTime" + name: "Enum", + allowedValues: [ + "None", + "Second", + "Minute", + "Hour", + "Day", + "Week", + "Month", + "Year" + ] } }, - end: { - required: true, - serializedName: "end", + schedule: { + serializedName: "schedule", type: { - name: "DateTime" + name: "Composite", + className: "RecurrentSchedule" } } } } }; -export const RecurrentSchedule: msRest.CompositeMapper = { - serializedName: "RecurrentSchedule", +export const RecurrentSchedule: coreClient.CompositeMapper = { type: { name: "Composite", className: "RecurrentSchedule", modelProperties: { timeZone: { - required: true, serializedName: "timeZone", + required: true, type: { name: "String" } }, days: { - required: true, serializedName: "days", + required: true, type: { name: "Sequence", element: { @@ -310,8 +417,8 @@ export const RecurrentSchedule: msRest.CompositeMapper = { } }, hours: { - required: true, serializedName: "hours", + required: true, type: { name: "Sequence", element: { @@ -322,8 +429,8 @@ export const RecurrentSchedule: msRest.CompositeMapper = { } }, minutes: { - required: true, serializedName: "minutes", + required: true, type: { name: "Sequence", element: { @@ -337,106 +444,56 @@ export const RecurrentSchedule: msRest.CompositeMapper = { } }; -export const Recurrence: msRest.CompositeMapper = { - serializedName: "Recurrence", +export const AutoscaleNotification: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Recurrence", + className: "AutoscaleNotification", modelProperties: { - frequency: { - required: true, - serializedName: "frequency", - type: { - name: "Enum", - allowedValues: [ - "None", - "Second", - "Minute", - "Hour", - "Day", - "Week", - "Month", - "Year" - ] - } - }, - schedule: { - required: true, - serializedName: "schedule", - type: { - name: "Composite", - className: "RecurrentSchedule" - } - } - } - } -}; - -export const AutoscaleProfile: msRest.CompositeMapper = { - serializedName: "AutoscaleProfile", - type: { - name: "Composite", - className: "AutoscaleProfile", - modelProperties: { - name: { - required: true, - serializedName: "name", + operation: { + defaultValue: "Scale", + isConstant: true, + serializedName: "operation", type: { name: "String" } }, - capacity: { - required: true, - serializedName: "capacity", + email: { + serializedName: "email", type: { name: "Composite", - className: "ScaleCapacity" + className: "EmailNotification" } }, - rules: { - required: true, - serializedName: "rules", + webhooks: { + serializedName: "webhooks", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ScaleRule" + className: "WebhookNotification" } } } - }, - fixedDate: { - serializedName: "fixedDate", - type: { - name: "Composite", - className: "TimeWindow" - } - }, - recurrence: { - serializedName: "recurrence", - type: { - name: "Composite", - className: "Recurrence" - } } } } }; -export const EmailNotification: msRest.CompositeMapper = { - serializedName: "EmailNotification", +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" @@ -457,8 +514,7 @@ export const EmailNotification: msRest.CompositeMapper = { } }; -export const WebhookNotification: msRest.CompositeMapper = { - serializedName: "WebhookNotification", +export const WebhookNotification: coreClient.CompositeMapper = { type: { name: "Composite", className: "WebhookNotification", @@ -473,105 +529,70 @@ export const WebhookNotification: msRest.CompositeMapper = { serializedName: "properties", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } } } } } }; -export const AutoscaleNotification: msRest.CompositeMapper = { - serializedName: "AutoscaleNotification", +export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AutoscaleNotification", + className: "Resource", modelProperties: { - operation: { - required: true, - isConstant: true, - serializedName: "operation", - defaultValue: 'Scale', + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - email: { - serializedName: "email", + name: { + serializedName: "name", + readOnly: true, type: { - name: "Composite", - className: "EmailNotification" + name: "String" } }, - webhooks: { - serializedName: "webhooks", + type: { + serializedName: "type", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "WebhookNotification" - } - } + name: "String" + } + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const AutoscaleSettingResource: msRest.CompositeMapper = { - serializedName: "AutoscaleSettingResource", +export const ErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AutoscaleSettingResource", + className: "ErrorResponse", modelProperties: { - ...Resource.type.modelProperties, - profiles: { - required: true, - serializedName: "properties.profiles", - constraints: { - MaxItems: 20 - }, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AutoscaleProfile" - } - } - } - }, - notifications: { - serializedName: "properties.notifications", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AutoscaleNotification" - } - } - } - }, - enabled: { - serializedName: "properties.enabled", - defaultValue: true, - type: { - name: "Boolean" - } - }, - autoscaleSettingResourceName: { - serializedName: "properties.name", + code: { + serializedName: "code", type: { name: "String" } }, - targetResourceUri: { - serializedName: "properties.targetResourceUri", + message: { + serializedName: "message", type: { name: "String" } @@ -580,8 +601,7 @@ export const AutoscaleSettingResource: msRest.CompositeMapper = { } }; -export const AutoscaleSettingResourcePatch: msRest.CompositeMapper = { - serializedName: "AutoscaleSettingResourcePatch", +export const AutoscaleSettingResourcePatch: coreClient.CompositeMapper = { type: { name: "Composite", className: "AutoscaleSettingResourcePatch", @@ -590,19 +610,14 @@ export const AutoscaleSettingResourcePatch: msRest.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } } }, profiles: { - required: true, - serializedName: "properties.profiles", constraints: { MaxItems: 20 }, + serializedName: "properties.profiles", type: { name: "Sequence", element: { @@ -626,8 +641,8 @@ export const AutoscaleSettingResourcePatch: msRest.CompositeMapper = { } }, enabled: { - serializedName: "properties.enabled", defaultValue: true, + serializedName: "properties.enabled", type: { name: "Boolean" } @@ -643,25 +658,9 @@ export const AutoscaleSettingResourcePatch: msRest.CompositeMapper = { type: { name: "String" } - } - } - } -}; - -export const ErrorResponse: msRest.CompositeMapper = { - serializedName: "ErrorResponse", - type: { - name: "Composite", - className: "ErrorResponse", - modelProperties: { - code: { - serializedName: "code", - type: { - name: "String" - } }, - message: { - serializedName: "message", + targetResourceLocation: { + serializedName: "properties.targetResourceLocation", type: { name: "String" } @@ -670,26 +669,25 @@ export const ErrorResponse: msRest.CompositeMapper = { } }; -export const OperationDisplay: msRest.CompositeMapper = { - serializedName: "Operation_display", +export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationDisplay", + className: "OperationListResult", modelProperties: { - provider: { - serializedName: "provider", - type: { - name: "String" - } - }, - resource: { - serializedName: "resource", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } } }, - operation: { - serializedName: "operation", + nextLink: { + serializedName: "nextLink", type: { name: "String" } @@ -698,8 +696,7 @@ export const OperationDisplay: msRest.CompositeMapper = { } }; -export const Operation: msRest.CompositeMapper = { - serializedName: "Operation", +export const Operation: coreClient.CompositeMapper = { type: { name: "Composite", className: "Operation", @@ -721,26 +718,25 @@ export const Operation: msRest.CompositeMapper = { } }; -export const OperationListResult: msRest.CompositeMapper = { - serializedName: "OperationListResult", +export const OperationDisplay: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationListResult", + className: "OperationDisplay", modelProperties: { - value: { - serializedName: "value", + provider: { + serializedName: "provider", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation" - } - } + name: "String" } }, - nextLink: { - serializedName: "nextLink", + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", type: { name: "String" } @@ -749,43 +745,42 @@ export const OperationListResult: msRest.CompositeMapper = { } }; -export const Incident: msRest.CompositeMapper = { - serializedName: "Incident", +export const Incident: coreClient.CompositeMapper = { type: { name: "Composite", className: "Incident", modelProperties: { name: { - readOnly: true, serializedName: "name", + readOnly: true, type: { name: "String" } }, ruleName: { - readOnly: true, serializedName: "ruleName", + readOnly: true, type: { name: "String" } }, isActive: { - readOnly: true, serializedName: "isActive", + readOnly: true, type: { name: "Boolean" } }, activatedTime: { - readOnly: true, serializedName: "activatedTime", + readOnly: true, type: { name: "DateTime" } }, resolvedTime: { - readOnly: true, serializedName: "resolvedTime", + readOnly: true, type: { name: "DateTime" } @@ -794,74 +789,92 @@ export const Incident: msRest.CompositeMapper = { } }; -export const RuleDataSource: msRest.CompositeMapper = { - serializedName: "RuleDataSource", +export const IncidentListResult: coreClient.CompositeMapper = { type: { name: "Composite", - polymorphicDiscriminator: { - serializedName: "odata.type", - clientName: "odatatype" - }, - uberParent: "RuleDataSource", - className: "RuleDataSource", + className: "IncidentListResult", modelProperties: { - resourceUri: { - serializedName: "resourceUri", - type: { - name: "String" - } - }, - odatatype: { - required: true, - serializedName: "odata\\.type", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Incident" + } + } } } } } }; -export const RuleCondition: msRest.CompositeMapper = { - serializedName: "RuleCondition", +export const RuleCondition: coreClient.CompositeMapper = { type: { name: "Composite", + className: "RuleCondition", + uberParent: "RuleCondition", polymorphicDiscriminator: { - serializedName: "odata.type", - clientName: "odatatype" + serializedName: "odata\\.type", + clientName: "odataType" }, - uberParent: "RuleCondition", - className: "RuleCondition", modelProperties: { + odataType: { + serializedName: "odata\\.type", + required: true, + type: { + name: "String" + } + }, dataSource: { serializedName: "dataSource", type: { name: "Composite", className: "RuleDataSource" } - }, - odatatype: { - required: true, - serializedName: "odata\\.type", - type: { - name: "String" - } } } } }; -export const RuleMetricDataSource: msRest.CompositeMapper = { - serializedName: "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource", +export const RuleDataSource: coreClient.CompositeMapper = { type: { name: "Composite", - polymorphicDiscriminator: RuleDataSource.type.polymorphicDiscriminator, + className: "RuleDataSource", uberParent: "RuleDataSource", - className: "RuleMetricDataSource", + polymorphicDiscriminator: { + serializedName: "odata\\.type", + clientName: "odataType" + }, modelProperties: { - ...RuleDataSource.type.modelProperties, - metricName: { - serializedName: "metricName", + odataType: { + serializedName: "odata\\.type", + required: true, + type: { + name: "String" + } + }, + resourceUri: { + serializedName: "resourceUri", + type: { + name: "String" + } + }, + legacyResourceId: { + serializedName: "legacyResourceId", + type: { + name: "String" + } + }, + resourceLocation: { + serializedName: "resourceLocation", + type: { + name: "String" + } + }, + metricNamespace: { + serializedName: "metricNamespace", type: { name: "String" } @@ -870,14 +883,19 @@ export const RuleMetricDataSource: msRest.CompositeMapper = { } }; -export const RuleManagementEventClaimsDataSource: msRest.CompositeMapper = { - serializedName: "RuleManagementEventClaimsDataSource", +export const RuleAction: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RuleManagementEventClaimsDataSource", + className: "RuleAction", + uberParent: "RuleAction", + polymorphicDiscriminator: { + serializedName: "odata\\.type", + clientName: "odataType" + }, modelProperties: { - emailAddress: { - serializedName: "emailAddress", + odataType: { + serializedName: "odata\\.type", + required: true, type: { name: "String" } @@ -886,147 +904,118 @@ export const RuleManagementEventClaimsDataSource: msRest.CompositeMapper = { } }; -export const RuleManagementEventDataSource: msRest.CompositeMapper = { - serializedName: "Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource", +export const AlertRuleResourcePatch: coreClient.CompositeMapper = { type: { name: "Composite", - polymorphicDiscriminator: RuleDataSource.type.polymorphicDiscriminator, - uberParent: "RuleDataSource", - className: "RuleManagementEventDataSource", + className: "AlertRuleResourcePatch", modelProperties: { - ...RuleDataSource.type.modelProperties, - eventName: { - serializedName: "eventName", + tags: { + serializedName: "tags", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } }, - eventSource: { - serializedName: "eventSource", + name: { + serializedName: "properties.name", type: { name: "String" } }, - level: { - serializedName: "level", + description: { + serializedName: "properties.description", type: { name: "String" } }, - operationName: { - serializedName: "operationName", + provisioningState: { + serializedName: "properties.provisioningState", type: { name: "String" } }, - resourceGroupName: { - serializedName: "resourceGroupName", + isEnabled: { + serializedName: "properties.isEnabled", type: { - name: "String" + name: "Boolean" } }, - resourceProviderName: { - serializedName: "resourceProviderName", + condition: { + serializedName: "properties.condition", type: { - name: "String" + name: "Composite", + className: "RuleCondition" } }, - status: { - serializedName: "status", + action: { + serializedName: "properties.action", type: { - name: "String" + name: "Composite", + className: "RuleAction" } }, - subStatus: { - serializedName: "subStatus", + actions: { + serializedName: "properties.actions", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RuleAction" + } + } } }, - claims: { - serializedName: "claims", + lastUpdatedTime: { + serializedName: "properties.lastUpdatedTime", + readOnly: true, type: { - name: "Composite", - className: "RuleManagementEventClaimsDataSource" + name: "DateTime" } } } } }; -export const ThresholdRuleCondition: msRest.CompositeMapper = { - serializedName: "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition", +export const AlertRuleResourceCollection: coreClient.CompositeMapper = { type: { name: "Composite", - polymorphicDiscriminator: RuleCondition.type.polymorphicDiscriminator, - uberParent: "RuleCondition", - className: "ThresholdRuleCondition", + className: "AlertRuleResourceCollection", modelProperties: { - ...RuleCondition.type.modelProperties, - operator: { - required: true, - serializedName: "operator", - type: { - name: "Enum", - allowedValues: [ - "GreaterThan", - "GreaterThanOrEqual", - "LessThan", - "LessThanOrEqual" - ] - } - }, - threshold: { - required: true, - serializedName: "threshold", - type: { - name: "Number" - } - }, - windowSize: { - serializedName: "windowSize", - type: { - name: "TimeSpan" - } - }, - timeAggregation: { - serializedName: "timeAggregation", + value: { + serializedName: "value", type: { - name: "Enum", - allowedValues: [ - "Average", - "Minimum", - "Maximum", - "Total", - "Last" - ] + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AlertRuleResource" + } + } } } } } }; -export const LocationThresholdRuleCondition: msRest.CompositeMapper = { - serializedName: "Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition", +export const RetentionPolicy: coreClient.CompositeMapper = { type: { name: "Composite", - polymorphicDiscriminator: RuleCondition.type.polymorphicDiscriminator, - uberParent: "RuleCondition", - className: "LocationThresholdRuleCondition", + className: "RetentionPolicy", modelProperties: { - ...RuleCondition.type.modelProperties, - windowSize: { - serializedName: "windowSize", + enabled: { + serializedName: "enabled", + required: true, type: { - name: "TimeSpan" + name: "Boolean" } }, - failedLocationCount: { - required: true, - serializedName: "failedLocationCount", + days: { constraints: { InclusiveMinimum: 0 }, + serializedName: "days", + required: true, type: { name: "Number" } @@ -1035,438 +1024,411 @@ export const LocationThresholdRuleCondition: msRest.CompositeMapper = { } }; -export const ManagementEventAggregationCondition: msRest.CompositeMapper = { - serializedName: "ManagementEventAggregationCondition", +export const LogProfileResourcePatch: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ManagementEventAggregationCondition", + className: "LogProfileResourcePatch", modelProperties: { - operator: { - serializedName: "operator", + tags: { + serializedName: "tags", type: { - name: "Enum", - allowedValues: [ - "GreaterThan", - "GreaterThanOrEqual", - "LessThan", - "LessThanOrEqual" - ] + name: "Dictionary", + value: { type: { name: "String" } } } }, - threshold: { - serializedName: "threshold", + storageAccountId: { + serializedName: "properties.storageAccountId", type: { - name: "Number" + name: "String" } }, - windowSize: { - serializedName: "windowSize", + serviceBusRuleId: { + serializedName: "properties.serviceBusRuleId", type: { - name: "TimeSpan" + name: "String" } - } - } - } -}; - -export const ManagementEventRuleCondition: msRest.CompositeMapper = { - serializedName: "Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition", - type: { - name: "Composite", - polymorphicDiscriminator: RuleCondition.type.polymorphicDiscriminator, - uberParent: "RuleCondition", - className: "ManagementEventRuleCondition", - modelProperties: { - ...RuleCondition.type.modelProperties, - aggregation: { - serializedName: "aggregation", + }, + 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: "ManagementEventAggregationCondition" + className: "RetentionPolicy" } } } } }; -export const RuleAction: msRest.CompositeMapper = { - serializedName: "RuleAction", +export const LogProfileCollection: coreClient.CompositeMapper = { type: { name: "Composite", - polymorphicDiscriminator: { - serializedName: "odata.type", - clientName: "odatatype" - }, - uberParent: "RuleAction", - className: "RuleAction", + className: "LogProfileCollection", modelProperties: { - odatatype: { + value: { + serializedName: "value", required: true, - serializedName: "odata\\.type", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LogProfileResource" + } + } } } } } }; -export const RuleEmailAction: msRest.CompositeMapper = { - serializedName: "Microsoft.Azure.Management.Insights.Models.RuleEmailAction", +export const MetricSettings: coreClient.CompositeMapper = { type: { name: "Composite", - polymorphicDiscriminator: RuleAction.type.polymorphicDiscriminator, - uberParent: "RuleAction", - className: "RuleEmailAction", + className: "MetricSettings", modelProperties: { - ...RuleAction.type.modelProperties, - sendToServiceOwners: { - serializedName: "sendToServiceOwners", + timeGrain: { + serializedName: "timeGrain", + type: { + name: "TimeSpan" + } + }, + category: { + serializedName: "category", + type: { + name: "String" + } + }, + enabled: { + serializedName: "enabled", + required: true, type: { name: "Boolean" } }, - customEmails: { - serializedName: "customEmails", + retentionPolicy: { + serializedName: "retentionPolicy", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "Composite", + className: "RetentionPolicy" } } } } }; -export const RuleWebhookAction: msRest.CompositeMapper = { - serializedName: "Microsoft.Azure.Management.Insights.Models.RuleWebhookAction", +export const LogSettings: coreClient.CompositeMapper = { type: { name: "Composite", - polymorphicDiscriminator: RuleAction.type.polymorphicDiscriminator, - uberParent: "RuleAction", - className: "RuleWebhookAction", + className: "LogSettings", modelProperties: { - ...RuleAction.type.modelProperties, - serviceUri: { - serializedName: "serviceUri", + category: { + serializedName: "category", type: { name: "String" } }, - properties: { - serializedName: "properties", + enabled: { + serializedName: "enabled", + required: true, type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "Boolean" + } + }, + retentionPolicy: { + serializedName: "retentionPolicy", + type: { + name: "Composite", + className: "RetentionPolicy" } } } } }; -export const AlertRuleResource: msRest.CompositeMapper = { - serializedName: "AlertRuleResource", +export const ProxyOnlyResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AlertRuleResource", + className: "ProxyOnlyResource", modelProperties: { - ...Resource.type.modelProperties, - alertRuleResourceName: { - required: true, - serializedName: "properties.name", + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - description: { - serializedName: "properties.description", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - isEnabled: { - required: true, - serializedName: "properties.isEnabled", - type: { - name: "Boolean" - } - }, - condition: { - required: true, - serializedName: "properties.condition", + type: { + serializedName: "type", + readOnly: true, type: { - name: "Composite", - className: "RuleCondition" + name: "String" } - }, - actions: { - serializedName: "properties.actions", + } + } + } +}; + +export const DiagnosticSettingsResourceCollection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DiagnosticSettingsResourceCollection", + modelProperties: { + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "RuleAction" + className: "DiagnosticSettingsResource" } } } - }, - lastUpdatedTime: { - readOnly: true, - serializedName: "properties.lastUpdatedTime", - type: { - name: "DateTime" - } } } } }; -export const AlertRuleResourcePatch: msRest.CompositeMapper = { - serializedName: "AlertRuleResourcePatch", +export const DiagnosticSettingsCategoryResourceCollection: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AlertRuleResourcePatch", + className: "DiagnosticSettingsCategoryResourceCollection", modelProperties: { - tags: { - serializedName: "tags", + value: { + serializedName: "value", type: { - name: "Dictionary", - value: { + name: "Sequence", + element: { type: { - name: "String" + name: "Composite", + className: "DiagnosticSettingsCategoryResource" } } } - }, + } + } + } +}; + +export const EmailReceiver: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EmailReceiver", + modelProperties: { name: { + serializedName: "name", required: true, - serializedName: "properties.name", type: { name: "String" } }, - description: { - serializedName: "properties.description", + emailAddress: { + serializedName: "emailAddress", + required: true, type: { name: "String" } }, - isEnabled: { - required: true, - serializedName: "properties.isEnabled", + useCommonAlertSchema: { + defaultValue: false, + serializedName: "useCommonAlertSchema", type: { name: "Boolean" } }, - condition: { - required: true, - serializedName: "properties.condition", - type: { - name: "Composite", - className: "RuleCondition" - } - }, - actions: { - serializedName: "properties.actions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RuleAction" - } - } - } - }, - lastUpdatedTime: { + status: { + serializedName: "status", readOnly: true, - serializedName: "properties.lastUpdatedTime", type: { - name: "DateTime" + name: "Enum", + allowedValues: ["NotSpecified", "Enabled", "Disabled"] } } } } }; -export const RetentionPolicy: msRest.CompositeMapper = { - serializedName: "RetentionPolicy", +export const SmsReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RetentionPolicy", + className: "SmsReceiver", modelProperties: { - enabled: { + name: { + serializedName: "name", required: true, - serializedName: "enabled", type: { - name: "Boolean" + name: "String" } }, - days: { + countryCode: { + serializedName: "countryCode", required: true, - serializedName: "days", - constraints: { - InclusiveMinimum: 0 - }, type: { - name: "Number" + name: "String" + } + }, + phoneNumber: { + serializedName: "phoneNumber", + required: true, + type: { + name: "String" + } + }, + status: { + serializedName: "status", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["NotSpecified", "Enabled", "Disabled"] } } } } }; -export const LogProfileResource: msRest.CompositeMapper = { - serializedName: "LogProfileResource", +export const WebhookReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LogProfileResource", + className: "WebhookReceiver", modelProperties: { - ...Resource.type.modelProperties, - storageAccountId: { - serializedName: "properties.storageAccountId", + name: { + serializedName: "name", + required: true, type: { name: "String" } }, - serviceBusRuleId: { - serializedName: "properties.serviceBusRuleId", + serviceUri: { + serializedName: "serviceUri", + required: true, type: { name: "String" } }, - locations: { - required: true, - serializedName: "properties.locations", + useCommonAlertSchema: { + defaultValue: false, + serializedName: "useCommonAlertSchema", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "Boolean" } }, - categories: { - required: true, - serializedName: "properties.categories", + useAadAuth: { + defaultValue: false, + serializedName: "useAadAuth", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "Boolean" } }, - retentionPolicy: { - required: true, - serializedName: "properties.retentionPolicy", + objectId: { + serializedName: "objectId", type: { - name: "Composite", - className: "RetentionPolicy" + name: "String" + } + }, + identifierUri: { + serializedName: "identifierUri", + type: { + name: "String" + } + }, + tenantId: { + serializedName: "tenantId", + type: { + name: "String" } } } } }; -export const LogProfileResourcePatch: msRest.CompositeMapper = { - serializedName: "LogProfileResourcePatch", +export const ItsmReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LogProfileResourcePatch", + className: "ItsmReceiver", 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", + workspaceId: { + serializedName: "workspaceId", + required: true, type: { name: "String" } }, - locations: { + connectionId: { + serializedName: "connectionId", required: true, - serializedName: "properties.locations", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - categories: { + ticketConfiguration: { + serializedName: "ticketConfiguration", required: true, - serializedName: "properties.categories", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - retentionPolicy: { + region: { + serializedName: "region", required: true, - serializedName: "properties.retentionPolicy", type: { - name: "Composite", - className: "RetentionPolicy" + name: "String" } } } } }; -export const ProxyOnlyResource: msRest.CompositeMapper = { - serializedName: "ProxyOnlyResource", +export const AzureAppPushReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ProxyOnlyResource", + className: "AzureAppPushReceiver", modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, name: { - readOnly: true, serializedName: "name", + required: true, type: { name: "String" } }, - type: { - readOnly: true, - serializedName: "type", + emailAddress: { + serializedName: "emailAddress", + required: true, type: { name: "String" } @@ -1475,343 +1437,245 @@ export const ProxyOnlyResource: msRest.CompositeMapper = { } }; -export const MetricSettings: msRest.CompositeMapper = { - serializedName: "MetricSettings", +export const AutomationRunbookReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricSettings", + className: "AutomationRunbookReceiver", modelProperties: { - timeGrain: { - serializedName: "timeGrain", + automationAccountId: { + serializedName: "automationAccountId", + required: true, type: { - name: "TimeSpan" + name: "String" } }, - category: { - serializedName: "category", + runbookName: { + serializedName: "runbookName", + required: true, type: { name: "String" } }, - enabled: { + webhookResourceId: { + serializedName: "webhookResourceId", + required: true, + type: { + name: "String" + } + }, + isGlobalRunbook: { + serializedName: "isGlobalRunbook", required: true, - serializedName: "enabled", type: { name: "Boolean" } }, - retentionPolicy: { - serializedName: "retentionPolicy", + name: { + serializedName: "name", type: { - name: "Composite", - className: "RetentionPolicy" + name: "String" + } + }, + serviceUri: { + serializedName: "serviceUri", + type: { + name: "String" + } + }, + useCommonAlertSchema: { + defaultValue: false, + serializedName: "useCommonAlertSchema", + type: { + name: "Boolean" } } } } }; -export const LogSettings: msRest.CompositeMapper = { - serializedName: "LogSettings", +export const VoiceReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LogSettings", + className: "VoiceReceiver", modelProperties: { - category: { - serializedName: "category", + name: { + serializedName: "name", + required: true, type: { name: "String" } }, - enabled: { + countryCode: { + serializedName: "countryCode", required: true, - serializedName: "enabled", type: { - name: "Boolean" + name: "String" } }, - retentionPolicy: { - serializedName: "retentionPolicy", + phoneNumber: { + serializedName: "phoneNumber", + required: true, type: { - name: "Composite", - className: "RetentionPolicy" + name: "String" } } } } }; -export const DiagnosticSettingsResource: msRest.CompositeMapper = { - serializedName: "DiagnosticSettingsResource", +export const LogicAppReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DiagnosticSettingsResource", + className: "LogicAppReceiver", modelProperties: { - ...ProxyOnlyResource.type.modelProperties, - storageAccountId: { - serializedName: "properties.storageAccountId", + name: { + serializedName: "name", + required: true, type: { name: "String" } }, - serviceBusRuleId: { - serializedName: "properties.serviceBusRuleId", + resourceId: { + serializedName: "resourceId", + required: true, type: { name: "String" } }, - eventHubAuthorizationRuleId: { - serializedName: "properties.eventHubAuthorizationRuleId", + callbackUrl: { + serializedName: "callbackUrl", + required: true, type: { name: "String" } }, - eventHubName: { - serializedName: "properties.eventHubName", + 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" } }, - metrics: { - serializedName: "properties.metrics", + functionAppResourceId: { + serializedName: "functionAppResourceId", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricSettings" - } - } + name: "String" } }, - logs: { - serializedName: "properties.logs", + functionName: { + serializedName: "functionName", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "LogSettings" - } - } + name: "String" } }, - workspaceId: { - serializedName: "properties.workspaceId", + httpTriggerUrl: { + serializedName: "httpTriggerUrl", + required: true, type: { name: "String" } }, - logAnalyticsDestinationType: { - serializedName: "properties.logAnalyticsDestinationType", + useCommonAlertSchema: { + defaultValue: false, + serializedName: "useCommonAlertSchema", type: { - name: "String" + name: "Boolean" } } } } }; -export const DiagnosticSettingsResourceCollection: msRest.CompositeMapper = { - serializedName: "DiagnosticSettingsResourceCollection", +export const ArmRoleReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DiagnosticSettingsResourceCollection", + className: "ArmRoleReceiver", modelProperties: { - value: { - serializedName: "value", + name: { + serializedName: "name", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DiagnosticSettingsResource" - } - } - } - } - } - } -}; - -export const DiagnosticSettingsCategoryResource: msRest.CompositeMapper = { - serializedName: "DiagnosticSettingsCategoryResource", - type: { - name: "Composite", - className: "DiagnosticSettingsCategoryResource", - modelProperties: { - ...ProxyOnlyResource.type.modelProperties, - categoryType: { - nullable: false, - serializedName: "properties.categoryType", - type: { - name: "Enum", - allowedValues: [ - "Metrics", - "Logs" - ] - } - } - } - } -}; - -export const DiagnosticSettingsCategoryResourceCollection: msRest.CompositeMapper = { - serializedName: "DiagnosticSettingsCategoryResourceCollection", - type: { - name: "Composite", - className: "DiagnosticSettingsCategoryResourceCollection", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DiagnosticSettingsCategoryResource" - } - } - } - } - } - } -}; - -export const EmailReceiver: msRest.CompositeMapper = { - serializedName: "EmailReceiver", - type: { - name: "Composite", - className: "EmailReceiver", - modelProperties: { - name: { - required: true, - serializedName: "name", - type: { - name: "String" + name: "String" } }, - emailAddress: { + roleId: { + serializedName: "roleId", required: true, - serializedName: "emailAddress", type: { name: "String" } }, useCommonAlertSchema: { - required: true, + defaultValue: false, serializedName: "useCommonAlertSchema", type: { name: "Boolean" } - }, - status: { - readOnly: true, - serializedName: "status", - type: { - name: "Enum", - allowedValues: [ - "NotSpecified", - "Enabled", - "Disabled" - ] - } } } } }; -export const SmsReceiver: msRest.CompositeMapper = { - serializedName: "SmsReceiver", +export const EventHubReceiver: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SmsReceiver", + className: "EventHubReceiver", modelProperties: { name: { - required: true, serializedName: "name", - type: { - name: "String" - } - }, - countryCode: { required: true, - serializedName: "countryCode", - type: { - name: "String" - } - }, - phoneNumber: { - required: true, - serializedName: "phoneNumber", type: { name: "String" } }, - status: { - readOnly: true, - serializedName: "status", - type: { - name: "Enum", - allowedValues: [ - "NotSpecified", - "Enabled", - "Disabled" - ] - } - } - } - } -}; - -export const WebhookReceiver: msRest.CompositeMapper = { - serializedName: "WebhookReceiver", - type: { - name: "Composite", - className: "WebhookReceiver", - modelProperties: { - name: { + eventHubNameSpace: { + serializedName: "eventHubNameSpace", required: true, - serializedName: "name", type: { name: "String" } }, - serviceUri: { + eventHubName: { + serializedName: "eventHubName", required: true, - serializedName: "serviceUri", type: { name: "String" } }, useCommonAlertSchema: { - required: true, - serializedName: "useCommonAlertSchema", - type: { - name: "Boolean" - } - }, - useAadAuth: { - serializedName: "useAadAuth", defaultValue: false, + serializedName: "useCommonAlertSchema", type: { name: "Boolean" } }, - objectId: { - serializedName: "objectId", - type: { - name: "String" - } - }, - identifierUri: { - serializedName: "identifierUri", + tenantId: { + serializedName: "tenantId", type: { name: "String" } }, - tenantId: { - serializedName: "tenantId", + subscriptionId: { + serializedName: "subscriptionId", + required: true, type: { name: "String" } @@ -1820,435 +1684,416 @@ export const WebhookReceiver: msRest.CompositeMapper = { } }; -export const ItsmReceiver: msRest.CompositeMapper = { - serializedName: "ItsmReceiver", +export const AzureResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ItsmReceiver", + className: "AzureResource", modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, name: { - required: true, serializedName: "name", + readOnly: true, type: { name: "String" } }, - workspaceId: { - required: true, - serializedName: "workspaceId", + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } }, - connectionId: { - required: true, - serializedName: "connectionId", + kind: { + serializedName: "kind", + readOnly: true, type: { name: "String" } }, - ticketConfiguration: { - required: true, - serializedName: "ticketConfiguration", + identity: { + serializedName: "identity", + readOnly: true, type: { name: "String" } }, - region: { + location: { + serializedName: "location", required: true, - serializedName: "region", type: { name: "String" } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } } } } }; -export const AzureAppPushReceiver: msRest.CompositeMapper = { - serializedName: "AzureAppPushReceiver", +export const ActionGroupPatchBody: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureAppPushReceiver", + className: "ActionGroupPatchBody", modelProperties: { - name: { - required: true, - serializedName: "name", + tags: { + serializedName: "tags", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } }, - emailAddress: { - required: true, - serializedName: "emailAddress", + enabled: { + defaultValue: true, + serializedName: "properties.enabled", type: { - name: "String" + name: "Boolean" } } } } }; -export const AutomationRunbookReceiver: msRest.CompositeMapper = { - serializedName: "AutomationRunbookReceiver", +export const NotificationRequestBody: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AutomationRunbookReceiver", + className: "NotificationRequestBody", modelProperties: { - automationAccountId: { + alertType: { + constraints: { + MaxLength: 30 + }, + serializedName: "alertType", required: true, - serializedName: "automationAccountId", type: { name: "String" } }, - runbookName: { - required: true, - serializedName: "runbookName", + emailReceivers: { + serializedName: "emailReceivers", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EmailReceiver" + } + } } }, - webhookResourceId: { - required: true, - serializedName: "webhookResourceId", + smsReceivers: { + serializedName: "smsReceivers", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SmsReceiver" + } + } } }, - isGlobalRunbook: { - required: true, - serializedName: "isGlobalRunbook", + webhookReceivers: { + serializedName: "webhookReceivers", type: { - name: "Boolean" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "WebhookReceiver" + } + } } }, - name: { - serializedName: "name", + itsmReceivers: { + serializedName: "itsmReceivers", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ItsmReceiver" + } + } } }, - serviceUri: { - serializedName: "serviceUri", + azureAppPushReceivers: { + serializedName: "azureAppPushReceivers", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AzureAppPushReceiver" + } + } } }, - useCommonAlertSchema: { - required: true, - serializedName: "useCommonAlertSchema", + automationRunbookReceivers: { + serializedName: "automationRunbookReceivers", type: { - name: "Boolean" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AutomationRunbookReceiver" + } + } } - } - } - } -}; - -export const VoiceReceiver: msRest.CompositeMapper = { - serializedName: "VoiceReceiver", - type: { - name: "Composite", - className: "VoiceReceiver", - modelProperties: { - name: { - required: true, - serializedName: "name", + }, + voiceReceivers: { + serializedName: "voiceReceivers", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VoiceReceiver" + } + } } }, - countryCode: { - required: true, - serializedName: "countryCode", + logicAppReceivers: { + serializedName: "logicAppReceivers", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LogicAppReceiver" + } + } } }, - phoneNumber: { - required: true, - serializedName: "phoneNumber", + azureFunctionReceivers: { + serializedName: "azureFunctionReceivers", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AzureFunctionReceiver" + } + } + } + }, + armRoleReceivers: { + serializedName: "armRoleReceivers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ArmRoleReceiver" + } + } + } + }, + eventHubReceivers: { + serializedName: "eventHubReceivers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EventHubReceiver" + } + } } } } } }; -export const LogicAppReceiver: msRest.CompositeMapper = { - serializedName: "LogicAppReceiver", +export const TestNotificationResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LogicAppReceiver", + className: "TestNotificationResponse", modelProperties: { - name: { + notificationId: { + serializedName: "notificationId", required: true, - serializedName: "name", type: { name: "String" } }, - resourceId: { + correlationId: { + serializedName: "correlationId", required: true, - serializedName: "resourceId", type: { name: "String" } }, - callbackUrl: { + createdTime: { + serializedName: "createdTime", required: true, - serializedName: "callbackUrl", type: { name: "String" } - }, - useCommonAlertSchema: { - required: true, - serializedName: "useCommonAlertSchema", - type: { - name: "Boolean" - } } } } }; -export const AzureFunctionReceiver: msRest.CompositeMapper = { - serializedName: "AzureFunctionReceiver", +export const TestNotificationDetailsResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureFunctionReceiver", + className: "TestNotificationDetailsResponse", modelProperties: { - name: { - required: true, - serializedName: "name", + context: { + serializedName: "Context", type: { - name: "String" + name: "Composite", + className: "Context" } }, - functionAppResourceId: { + state: { + serializedName: "State", required: true, - serializedName: "functionAppResourceId", type: { name: "String" } }, - functionName: { - required: true, - serializedName: "functionName", + completedTime: { + serializedName: "CompletedTime", type: { name: "String" } }, - httpTriggerUrl: { - required: true, - serializedName: "httpTriggerUrl", + createdTime: { + serializedName: "CreatedTime", type: { name: "String" } }, - useCommonAlertSchema: { - required: true, - serializedName: "useCommonAlertSchema", + actionDetails: { + serializedName: "ActionDetails", type: { - name: "Boolean" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ActionDetail" + } + } } } } } }; -export const ArmRoleReceiver: msRest.CompositeMapper = { - serializedName: "ArmRoleReceiver", +export const Context: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ArmRoleReceiver", + className: "Context", modelProperties: { - name: { - required: true, - serializedName: "name", + notificationSource: { + serializedName: "NotificationSource", type: { name: "String" } }, - roleId: { - required: true, - serializedName: "roleId", + contextType: { + serializedName: "ContextType", type: { name: "String" } - }, - useCommonAlertSchema: { - required: true, - serializedName: "useCommonAlertSchema", - type: { - name: "Boolean" - } } } } }; -export const ActionGroupResource: msRest.CompositeMapper = { - serializedName: "ActionGroupResource", +export const ActionDetail: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ActionGroupResource", + className: "ActionDetail", modelProperties: { - ...Resource.type.modelProperties, - groupShortName: { - required: true, - serializedName: "properties.groupShortName", - constraints: { - MaxLength: 12 - }, + mechanismType: { + serializedName: "MechanismType", type: { name: "String" } }, - enabled: { - required: true, - serializedName: "properties.enabled", - defaultValue: true, - type: { - name: "Boolean" - } - }, - emailReceivers: { - serializedName: "properties.emailReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "EmailReceiver" - } - } - } - }, - smsReceivers: { - serializedName: "properties.smsReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SmsReceiver" - } - } - } - }, - webhookReceivers: { - serializedName: "properties.webhookReceivers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "WebhookReceiver" - } - } - } - }, - itsmReceivers: { - serializedName: "properties.itsmReceivers", + name: { + serializedName: "Name", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ItsmReceiver" - } - } + name: "String" } }, - azureAppPushReceivers: { - serializedName: "properties.azureAppPushReceivers", + status: { + serializedName: "Status", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AzureAppPushReceiver" - } - } + name: "String" } }, - automationRunbookReceivers: { - serializedName: "properties.automationRunbookReceivers", + subState: { + serializedName: "SubState", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AutomationRunbookReceiver" - } - } + name: "String" } }, - voiceReceivers: { - serializedName: "properties.voiceReceivers", + sendTime: { + serializedName: "SendTime", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VoiceReceiver" - } - } + name: "String" } }, - logicAppReceivers: { - serializedName: "properties.logicAppReceivers", + detail: { + serializedName: "Detail", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "LogicAppReceiver" - } - } + name: "String" } - }, - azureFunctionReceivers: { - serializedName: "properties.azureFunctionReceivers", + } + } + } +}; + +export const ActionGroupList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ActionGroupList", + modelProperties: { + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "AzureFunctionReceiver" + className: "ActionGroupResource" } } } }, - armRoleReceivers: { - serializedName: "properties.armRoleReceivers", + nextLink: { + serializedName: "nextLink", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ArmRoleReceiver" - } - } + name: "String" } } } } }; -export const EnableRequest: msRest.CompositeMapper = { - serializedName: "EnableRequest", +export const EnableRequest: coreClient.CompositeMapper = { type: { name: "Composite", className: "EnableRequest", modelProperties: { receiverName: { - required: true, serializedName: "receiverName", + required: true, type: { name: "String" } @@ -2257,50 +2102,2232 @@ export const EnableRequest: msRest.CompositeMapper = { } }; -export const ActionGroupPatchBody: msRest.CompositeMapper = { - serializedName: "ActionGroupPatchBody", +export const EventDataCollection: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ActionGroupPatchBody", + className: "EventDataCollection", modelProperties: { - tags: { - serializedName: "tags", + value: { + serializedName: "value", + required: true, type: { - name: "Dictionary", - value: { + name: "Sequence", + element: { type: { - name: "String" + name: "Composite", + className: "EventData" } } } }, - enabled: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const EventData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EventData", + modelProperties: { + authorization: { + serializedName: "authorization", + type: { + name: "Composite", + className: "SenderAuthorization" + } + }, + claims: { + serializedName: "claims", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + caller: { + serializedName: "caller", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String" + } + }, + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + eventDataId: { + serializedName: "eventDataId", + readOnly: true, + type: { + name: "String" + } + }, + correlationId: { + serializedName: "correlationId", + readOnly: true, + type: { + name: "String" + } + }, + eventName: { + serializedName: "eventName", + type: { + name: "Composite", + className: "LocalizableString" + } + }, + category: { + serializedName: "category", + type: { + name: "Composite", + className: "LocalizableString" + } + }, + httpRequest: { + serializedName: "httpRequest", + type: { + name: "Composite", + className: "HttpRequestInfo" + } + }, + level: { + serializedName: "level", + readOnly: true, + type: { + name: "Enum", + allowedValues: [ + "Critical", + "Error", + "Warning", + "Informational", + "Verbose" + ] + } + }, + resourceGroupName: { + serializedName: "resourceGroupName", + readOnly: true, + type: { + name: "String" + } + }, + resourceProviderName: { + serializedName: "resourceProviderName", + type: { + name: "Composite", + className: "LocalizableString" + } + }, + resourceId: { + serializedName: "resourceId", + readOnly: true, + type: { + name: "String" + } + }, + resourceType: { + serializedName: "resourceType", + type: { + name: "Composite", + className: "LocalizableString" + } + }, + operationId: { + serializedName: "operationId", + readOnly: true, + type: { + name: "String" + } + }, + operationName: { + serializedName: "operationName", + type: { + name: "Composite", + className: "LocalizableString" + } + }, + properties: { + serializedName: "properties", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + status: { + serializedName: "status", + type: { + name: "Composite", + className: "LocalizableString" + } + }, + subStatus: { + serializedName: "subStatus", + type: { + name: "Composite", + className: "LocalizableString" + } + }, + eventTimestamp: { + serializedName: "eventTimestamp", + readOnly: true, + type: { + name: "DateTime" + } + }, + submissionTimestamp: { + serializedName: "submissionTimestamp", + readOnly: true, + type: { + name: "DateTime" + } + }, + subscriptionId: { + serializedName: "subscriptionId", + readOnly: true, + type: { + name: "String" + } + }, + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const SenderAuthorization: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SenderAuthorization", + modelProperties: { + action: { + serializedName: "action", + type: { + name: "String" + } + }, + role: { + serializedName: "role", + type: { + name: "String" + } + }, + scope: { + serializedName: "scope", + type: { + name: "String" + } + } + } + } +}; + +export const LocalizableString: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LocalizableString", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "String" + } + }, + localizedValue: { + serializedName: "localizedValue", + type: { + name: "String" + } + } + } + } +}; + +export const HttpRequestInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HttpRequestInfo", + modelProperties: { + clientRequestId: { + serializedName: "clientRequestId", + type: { + name: "String" + } + }, + clientIpAddress: { + serializedName: "clientIpAddress", + type: { + name: "String" + } + }, + method: { + serializedName: "method", + type: { + name: "String" + } + }, + uri: { + serializedName: "uri", + type: { + name: "String" + } + } + } + } +}; + +export const EventCategoryCollection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EventCategoryCollection", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LocalizableString" + } + } + } + } + } + } +}; + +export const MetricDefinitionCollection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricDefinitionCollection", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricDefinition" + } + } + } + } + } + } +}; + +export const MetricDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricDefinition", + 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: "Enum", + allowedValues: [ + "None", + "Average", + "Count", + "Minimum", + "Maximum", + "Total" + ] + } + }, + supportedAggregationTypes: { + serializedName: "supportedAggregationTypes", + type: { + name: "Sequence", + element: { + type: { + name: "Enum", + allowedValues: [ + "None", + "Average", + "Count", + "Minimum", + "Maximum", + "Total" + ] + } + } + } + }, + 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 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: "String" + } + }, + timeseries: { + serializedName: "timeseries", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TimeSeriesElement" + } + } + } + } + } + } +}; + +export const TimeSeriesElement: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TimeSeriesElement", + modelProperties: { + metadatavalues: { + serializedName: "metadatavalues", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetadataValue" + } + } + } + }, + data: { + serializedName: "data", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricValue" + } + } + } + } + } + } +}; + +export const MetadataValue: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetadataValue", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "Composite", + className: "LocalizableString" + } + }, + value: { + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; + +export const MetricValue: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricValue", + modelProperties: { + timeStamp: { + serializedName: "timeStamp", + required: true, + type: { + name: "DateTime" + } + }, + average: { + serializedName: "average", + type: { + name: "Number" + } + }, + minimum: { + serializedName: "minimum", + type: { + name: "Number" + } + }, + maximum: { + serializedName: "maximum", + type: { + name: "Number" + } + }, + total: { + serializedName: "total", + type: { + name: "Number" + } + }, + count: { + serializedName: "count", + type: { + name: "Number" + } + } + } + } +}; + +export const MetricBaselinesResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricBaselinesResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SingleMetricBaseline" + } + } + } + } + } + } +}; + +export const SingleMetricBaseline: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SingleMetricBaseline", + modelProperties: { + id: { + serializedName: "id", + required: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + required: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + timespan: { + serializedName: "properties.timespan", + required: true, + type: { + name: "String" + } + }, + interval: { + serializedName: "properties.interval", + required: true, + type: { + name: "TimeSpan" + } + }, + namespace: { + serializedName: "properties.namespace", + type: { + name: "String" + } + }, + baselines: { + serializedName: "properties.baselines", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TimeSeriesBaseline" + } + } + } + } + } + } +}; + +export const TimeSeriesBaseline: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TimeSeriesBaseline", + modelProperties: { + aggregation: { + serializedName: "aggregation", + required: true, + type: { + name: "String" + } + }, + dimensions: { + serializedName: "dimensions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricSingleDimension" + } + } + } + }, + timestamps: { + serializedName: "timestamps", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "DateTime" + } + } + } + }, + data: { + serializedName: "data", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SingleBaseline" + } + } + } + }, + metadataValues: { + serializedName: "metadataValues", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BaselineMetadata" + } + } + } + } + } + } +}; + +export const MetricSingleDimension: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricSingleDimension", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const SingleBaseline: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SingleBaseline", + modelProperties: { + sensitivity: { + serializedName: "sensitivity", + required: true, + type: { + name: "String" + } + }, + lowThresholds: { + serializedName: "lowThresholds", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Number" + } + } + } + }, + highThresholds: { + serializedName: "highThresholds", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Number" + } + } + } + } + } + } +}; + +export const BaselineMetadata: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BaselineMetadata", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const MetricAlertResourceCollection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricAlertResourceCollection", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricAlertResource" + } + } + } + } + } + } +}; + +export const MetricAlertCriteria: coreClient.CompositeMapper = { + serializedName: "MetricAlertCriteria", + type: { + name: "Composite", + className: "MetricAlertCriteria", + uberParent: "MetricAlertCriteria", + additionalProperties: { type: { name: "Object" } }, + polymorphicDiscriminator: { + serializedName: "odata\\.type", + clientName: "odataType" + }, + modelProperties: { + odataType: { + serializedName: "odata\\.type", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const MetricAlertAction: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricAlertAction", + modelProperties: { + actionGroupId: { + serializedName: "actionGroupId", + type: { + name: "String" + } + }, + webHookProperties: { + serializedName: "webHookProperties", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const MetricAlertResourcePatch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricAlertResourcePatch", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + severity: { + serializedName: "properties.severity", + type: { + name: "Number" + } + }, + enabled: { + serializedName: "properties.enabled", + type: { + name: "Boolean" + } + }, + scopes: { + serializedName: "properties.scopes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + evaluationFrequency: { + serializedName: "properties.evaluationFrequency", + type: { + name: "TimeSpan" + } + }, + windowSize: { + serializedName: "properties.windowSize", + type: { + name: "TimeSpan" + } + }, + targetResourceType: { + serializedName: "properties.targetResourceType", + type: { + name: "String" + } + }, + targetResourceRegion: { + serializedName: "properties.targetResourceRegion", + type: { + name: "String" + } + }, + criteria: { + serializedName: "properties.criteria", + type: { + name: "Composite", + className: "MetricAlertCriteria" + } + }, + autoMitigate: { + serializedName: "properties.autoMitigate", + type: { + name: "Boolean" + } + }, + actions: { + serializedName: "properties.actions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricAlertAction" + } + } + } + }, + lastUpdatedTime: { + serializedName: "properties.lastUpdatedTime", + readOnly: true, + type: { + name: "DateTime" + } + }, + isMigrated: { + serializedName: "properties.isMigrated", + readOnly: true, + type: { + name: "Boolean" + } + } + } + } +}; + +export const MetricAlertStatusCollection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricAlertStatusCollection", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricAlertStatus" + } + } + } + } + } + } +}; + +export const MetricAlertStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricAlertStatus", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + id: { + serializedName: "id", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "MetricAlertStatusProperties" + } + } + } + } +}; + +export const MetricAlertStatusProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricAlertStatusProperties", + modelProperties: { + dimensions: { + serializedName: "dimensions", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + }, + timestamp: { + serializedName: "timestamp", + type: { + name: "DateTime" + } + } + } + } +}; + +export const Source: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Source", + modelProperties: { + query: { + serializedName: "query", + type: { + name: "String" + } + }, + authorizedResources: { + serializedName: "authorizedResources", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + dataSourceId: { + serializedName: "dataSourceId", + required: true, + type: { + name: "String" + } + }, + queryType: { + serializedName: "queryType", + type: { + name: "String" + } + } + } + } +}; + +export const Schedule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Schedule", + modelProperties: { + frequencyInMinutes: { + serializedName: "frequencyInMinutes", + required: true, + type: { + name: "Number" + } + }, + timeWindowInMinutes: { + serializedName: "timeWindowInMinutes", + required: true, + type: { + name: "Number" + } + } + } + } +}; + +export const Action: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Action", + uberParent: "Action", + polymorphicDiscriminator: { + serializedName: "odata\\.type", + clientName: "odataType" + }, + modelProperties: { + odataType: { + serializedName: "odata\\.type", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ResourceAutoGenerated: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceAutoGenerated", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + kind: { + serializedName: "kind", + readOnly: true, + type: { + name: "String" + } + }, + etag: { + serializedName: "etag", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ErrorContract: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorContract", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorResponse" + } + } + } + } +}; + +export const LogSearchRuleResourcePatch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LogSearchRuleResourcePatch", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + enabled: { serializedName: "properties.enabled", - defaultValue: true, type: { - name: "Boolean" + name: "String" + } + } + } + } +}; + +export const LogSearchRuleResourceCollection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LogSearchRuleResourceCollection", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LogSearchRuleResource" + } + } + } + } + } + } +}; + +export const MetricNamespaceCollection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricNamespaceCollection", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricNamespace" + } + } + } + } + } + } +}; + +export const MetricNamespace: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricNamespace", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + classification: { + serializedName: "classification", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "MetricNamespaceName" + } + } + } + } +}; + +export const MetricNamespaceName: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricNamespaceName", + modelProperties: { + metricNamespaceName: { + serializedName: "metricNamespaceName", + type: { + name: "String" + } + } + } + } +}; + +export const DataContainer: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataContainer", + modelProperties: { + workspace: { + serializedName: "workspace", + type: { + name: "Composite", + className: "WorkspaceInfo" + } + } + } + } +}; + +export const WorkspaceInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkspaceInfo", + modelProperties: { + id: { + serializedName: "id", + required: true, + type: { + name: "String" + } + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + }, + customerId: { + serializedName: "properties.customerId", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ResponseWithError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResponseWithError", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorModel" + } + } + } + } +}; + +export const ErrorModel: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorModel", + modelProperties: { + code: { + serializedName: "code", + required: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const AzureMonitorPrivateLinkScopeListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureMonitorPrivateLinkScopeListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AzureMonitorPrivateLinkScope" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateEndpointProperty: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointProperty", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateLinkServiceConnectionStateProperty: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionStateProperty", + modelProperties: { + status: { + serializedName: "status", + required: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + required: true, + type: { + name: "String" + } + }, + actionsRequired: { + serializedName: "actionsRequired", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PrivateLinkScopesResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkScopesResource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const TagsResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TagsResource", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const OperationStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationStatus", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + startTime: { + serializedName: "startTime", + nullable: true, + type: { + name: "DateTime" + } + }, + endTime: { + serializedName: "endTime", + nullable: true, + type: { + name: "DateTime" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorResponseCommon" + } + } + } + } +}; + +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const PrivateLinkResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResourceListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateLinkResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnectionListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ScopedResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ScopedResourceListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ScopedResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ActivityLogAlertAllOfCondition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ActivityLogAlertAllOfCondition", + modelProperties: { + allOf: { + serializedName: "allOf", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ActivityLogAlertLeafCondition" + } + } } } } } }; -export const ActivityLogAlertLeafCondition: msRest.CompositeMapper = { - serializedName: "ActivityLogAlertLeafCondition", +export const ActivityLogAlertLeafCondition: coreClient.CompositeMapper = { type: { name: "Composite", className: "ActivityLogAlertLeafCondition", modelProperties: { field: { - required: true, serializedName: "field", + required: true, type: { name: "String" } }, equals: { - required: true, serializedName: "equals", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ActivityLogAlertActionList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ActivityLogAlertActionList", + modelProperties: { + actionGroups: { + serializedName: "actionGroups", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ActivityLogAlertActionGroup" + } + } + } + } + } + } +}; + +export const ActivityLogAlertActionGroup: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ActivityLogAlertActionGroup", + modelProperties: { + actionGroupId: { + serializedName: "actionGroupId", + required: true, + type: { + name: "String" + } + }, + webhookProperties: { + serializedName: "webhookProperties", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const ActivityLogAlertPatchBody: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ActivityLogAlertPatchBody", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + enabled: { + defaultValue: true, + serializedName: "properties.enabled", + type: { + name: "Boolean" + } + } + } + } +}; + +export const ActivityLogAlertList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ActivityLogAlertList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ActivityLogAlertResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const DataCollectionEndpointResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataCollectionEndpointResourceListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DataCollectionEndpointResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const DataCollectionEndpointResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataCollectionEndpointResource", + modelProperties: { + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + kind: { + serializedName: "kind", + type: { + name: "String" + } + }, + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + etag: { + serializedName: "etag", + readOnly: true, + type: { + name: "String" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "DataCollectionEndpointResourceSystemData" + } + }, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + immutableId: { + serializedName: "properties.immutableId", + type: { + name: "String" + } + }, + configurationAccess: { + serializedName: "properties.configurationAccess", + type: { + name: "Composite", + className: "DataCollectionEndpointConfigurationAccess" + } + }, + logsIngestion: { + serializedName: "properties.logsIngestion", + type: { + name: "Composite", + className: "DataCollectionEndpointLogsIngestion" + } + }, + networkAcls: { + serializedName: "properties.networkAcls", + type: { + name: "Composite", + className: "DataCollectionEndpointNetworkAcls" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const DataCollectionEndpoint: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataCollectionEndpoint", + modelProperties: { + description: { + serializedName: "description", + type: { + name: "String" + } + }, + immutableId: { + serializedName: "immutableId", + type: { + name: "String" + } + }, + configurationAccess: { + serializedName: "configurationAccess", + type: { + name: "Composite", + className: "DataCollectionEndpointConfigurationAccess" + } + }, + logsIngestion: { + serializedName: "logsIngestion", + type: { + name: "Composite", + className: "DataCollectionEndpointLogsIngestion" + } + }, + networkAcls: { + serializedName: "networkAcls", + type: { + name: "Composite", + className: "DataCollectionEndpointNetworkAcls" + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +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" } @@ -2309,174 +4336,174 @@ export const ActivityLogAlertLeafCondition: msRest.CompositeMapper = { } }; -export const ActivityLogAlertAllOfCondition: msRest.CompositeMapper = { - serializedName: "ActivityLogAlertAllOfCondition", +export const NetworkRuleSet: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ActivityLogAlertAllOfCondition", + className: "NetworkRuleSet", modelProperties: { - allOf: { - required: true, - serializedName: "allOf", + publicNetworkAccess: { + serializedName: "publicNetworkAccess", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ActivityLogAlertLeafCondition" - } - } + name: "String" } } } } }; -export const ActivityLogAlertActionGroup: msRest.CompositeMapper = { - serializedName: "ActivityLogAlertActionGroup", +export const SystemData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ActivityLogAlertActionGroup", + className: "SystemData", modelProperties: { - actionGroupId: { - required: true, - serializedName: "actionGroupId", + createdBy: { + serializedName: "createdBy", type: { name: "String" } }, - webhookProperties: { - serializedName: "webhookProperties", + createdByType: { + serializedName: "createdByType", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" } } } } }; -export const ActivityLogAlertActionList: msRest.CompositeMapper = { - serializedName: "ActivityLogAlertActionList", +export const ErrorResponseCommonV2: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ActivityLogAlertActionList", + className: "ErrorResponseCommonV2", modelProperties: { - actionGroups: { - serializedName: "actionGroups", + error: { + serializedName: "error", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ActivityLogAlertActionGroup" - } - } + name: "Composite", + className: "ErrorDetail" } } } } }; -export const ActivityLogAlertResource: msRest.CompositeMapper = { - serializedName: "ActivityLogAlertResource", +export const ErrorDetail: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ActivityLogAlertResource", + className: "ErrorDetail", modelProperties: { - ...Resource.type.modelProperties, - scopes: { - required: true, - serializedName: "properties.scopes", + code: { + serializedName: "code", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - enabled: { - serializedName: "properties.enabled", - defaultValue: true, + message: { + serializedName: "message", + readOnly: true, type: { - name: "Boolean" + name: "String" } }, - condition: { - required: true, - serializedName: "properties.condition", + target: { + serializedName: "target", + readOnly: true, type: { - name: "Composite", - className: "ActivityLogAlertAllOfCondition" + name: "String" } }, - actions: { - required: true, - serializedName: "properties.actions", + details: { + serializedName: "details", + readOnly: true, type: { - name: "Composite", - className: "ActivityLogAlertActionList" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } } }, - description: { - serializedName: "properties.description", + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } } } } } }; -export const ActivityLogAlertPatchBody: msRest.CompositeMapper = { - serializedName: "ActivityLogAlertPatchBody", +export const ResourceForUpdate: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ActivityLogAlertPatchBody", + className: "ResourceForUpdate", modelProperties: { tags: { serializedName: "tags", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } - } - }, - enabled: { - serializedName: "properties.enabled", - defaultValue: true, - type: { - name: "Boolean" + value: { type: { name: "String" } } } } } } }; -export const LocalizableString: msRest.CompositeMapper = { - serializedName: "LocalizableString", +export const DataCollectionRuleAssociationProxyOnlyResourceListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LocalizableString", + className: "DataCollectionRuleAssociationProxyOnlyResourceListResult", modelProperties: { value: { - required: true, serializedName: "value", + required: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DataCollectionRuleAssociationProxyOnlyResource" + } + } } }, - localizedValue: { - serializedName: "localizedValue", + nextLink: { + serializedName: "nextLink", type: { name: "String" } @@ -2485,60 +4512,67 @@ export const LocalizableString: msRest.CompositeMapper = { } }; -export const SenderAuthorization: msRest.CompositeMapper = { - serializedName: "SenderAuthorization", +export const DataCollectionRuleAssociationProxyOnlyResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SenderAuthorization", + className: "DataCollectionRuleAssociationProxyOnlyResource", modelProperties: { - action: { - serializedName: "action", + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - role: { - serializedName: "role", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - scope: { - serializedName: "scope", + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } - } - } - } -}; - -export const HttpRequestInfo: msRest.CompositeMapper = { - serializedName: "HttpRequestInfo", - type: { - name: "Composite", - className: "HttpRequestInfo", - modelProperties: { - clientRequestId: { - serializedName: "clientRequestId", + }, + etag: { + serializedName: "etag", + readOnly: true, type: { name: "String" } }, - clientIpAddress: { - serializedName: "clientIpAddress", + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "DataCollectionRuleAssociationProxyOnlyResourceSystemData" + } + }, + description: { + serializedName: "properties.description", type: { name: "String" } }, - method: { - serializedName: "method", + dataCollectionRuleId: { + serializedName: "properties.dataCollectionRuleId", type: { name: "String" } }, - uri: { - serializedName: "uri", + dataCollectionEndpointId: { + serializedName: "properties.dataCollectionEndpointId", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, type: { name: "String" } @@ -2547,202 +4581,170 @@ export const HttpRequestInfo: msRest.CompositeMapper = { } }; -export const EventData: msRest.CompositeMapper = { - serializedName: "EventData", +export const DataCollectionRuleAssociation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EventData", + className: "DataCollectionRuleAssociation", modelProperties: { - authorization: { - readOnly: true, - serializedName: "authorization", - type: { - name: "Composite", - className: "SenderAuthorization" - } - }, - claims: { - readOnly: true, - serializedName: "claims", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - } - }, - caller: { - readOnly: true, - serializedName: "caller", - type: { - name: "String" - } - }, description: { - readOnly: true, serializedName: "description", type: { name: "String" } }, - id: { - readOnly: true, - serializedName: "id", + dataCollectionRuleId: { + serializedName: "dataCollectionRuleId", type: { name: "String" } }, - eventDataId: { - readOnly: true, - serializedName: "eventDataId", + dataCollectionEndpointId: { + serializedName: "dataCollectionEndpointId", type: { name: "String" } }, - correlationId: { + provisioningState: { + serializedName: "provisioningState", readOnly: true, - serializedName: "correlationId", type: { name: "String" } - }, - eventName: { - readOnly: true, - serializedName: "eventName", + } + } + } +}; + +export const DataCollectionRuleResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataCollectionRuleResourceListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, type: { - name: "Composite", - className: "LocalizableString" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DataCollectionRuleResource" + } + } } }, - category: { - readOnly: true, - serializedName: "category", + nextLink: { + serializedName: "nextLink", type: { - name: "Composite", - className: "LocalizableString" - } - }, - httpRequest: { - readOnly: true, - serializedName: "httpRequest", + name: "String" + } + } + } + } +}; + +export const DataCollectionRuleResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataCollectionRuleResource", + modelProperties: { + location: { + serializedName: "location", + required: true, type: { - name: "Composite", - className: "HttpRequestInfo" + name: "String" } }, - level: { - readOnly: true, - serializedName: "level", + tags: { + serializedName: "tags", type: { - name: "Enum", - allowedValues: [ - "Critical", - "Error", - "Warning", - "Informational", - "Verbose" - ] + name: "Dictionary", + value: { type: { name: "String" } } } }, - resourceGroupName: { - readOnly: true, - serializedName: "resourceGroupName", + kind: { + serializedName: "kind", type: { name: "String" } }, - resourceProviderName: { + id: { + serializedName: "id", readOnly: true, - serializedName: "resourceProviderName", type: { - name: "Composite", - className: "LocalizableString" + name: "String" } }, - resourceId: { + name: { + serializedName: "name", readOnly: true, - serializedName: "resourceId", type: { name: "String" } }, - resourceType: { + type: { + serializedName: "type", readOnly: true, - serializedName: "resourceType", type: { - name: "Composite", - className: "LocalizableString" + name: "String" } }, - operationId: { + etag: { + serializedName: "etag", readOnly: true, - serializedName: "operationId", type: { name: "String" } }, - operationName: { - readOnly: true, - serializedName: "operationName", + systemData: { + serializedName: "systemData", type: { name: "Composite", - className: "LocalizableString" + className: "DataCollectionRuleResourceSystemData" } }, - properties: { - readOnly: true, - serializedName: "properties", + description: { + serializedName: "properties.description", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "String" } }, - status: { + immutableId: { + serializedName: "properties.immutableId", readOnly: true, - serializedName: "status", type: { - name: "Composite", - className: "LocalizableString" + name: "String" } }, - subStatus: { - readOnly: true, - serializedName: "subStatus", + dataSources: { + serializedName: "properties.dataSources", type: { name: "Composite", - className: "LocalizableString" - } - }, - eventTimestamp: { - readOnly: true, - serializedName: "eventTimestamp", - type: { - name: "DateTime" + className: "DataCollectionRuleDataSources" } }, - submissionTimestamp: { - readOnly: true, - serializedName: "submissionTimestamp", + destinations: { + serializedName: "properties.destinations", type: { - name: "DateTime" + name: "Composite", + className: "DataCollectionRuleDestinations" } }, - subscriptionId: { - readOnly: true, - serializedName: "subscriptionId", + dataFlows: { + serializedName: "properties.dataFlows", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DataFlow" + } + } } }, - tenantId: { + provisioningState: { + serializedName: "properties.provisioningState", readOnly: true, - serializedName: "tenantId", type: { name: "String" } @@ -2751,139 +4753,110 @@ export const EventData: msRest.CompositeMapper = { } }; -export const MetricAvailability: msRest.CompositeMapper = { - serializedName: "MetricAvailability", - type: { - name: "Composite", - className: "MetricAvailability", - modelProperties: { - timeGrain: { - serializedName: "timeGrain", - type: { - name: "TimeSpan" - } - }, - retention: { - serializedName: "retention", - type: { - name: "TimeSpan" - } - } - } - } -}; - -export const MetricDefinition: msRest.CompositeMapper = { - serializedName: "MetricDefinition", +export const DataCollectionRule: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricDefinition", + className: "DataCollectionRule", modelProperties: { - isDimensionRequired: { - serializedName: "isDimensionRequired", + description: { + serializedName: "description", type: { - name: "Boolean" + name: "String" } }, - resourceId: { - serializedName: "resourceId", + immutableId: { + serializedName: "immutableId", + readOnly: true, type: { name: "String" } }, - namespace: { - serializedName: "namespace", + dataSources: { + serializedName: "dataSources", type: { - name: "String" + name: "Composite", + className: "DataCollectionRuleDataSources" } }, - name: { - serializedName: "name", + destinations: { + serializedName: "destinations", type: { name: "Composite", - className: "LocalizableString" + className: "DataCollectionRuleDestinations" } }, - unit: { - serializedName: "unit", + dataFlows: { + serializedName: "dataFlows", type: { - name: "Enum", - allowedValues: [ - "Count", - "Bytes", - "Seconds", - "CountPerSecond", - "BytesPerSecond", - "Percent", - "MilliSeconds", - "ByteSeconds", - "Unspecified", - "Cores", - "MilliCores", - "NanoCores", - "BitsPerSecond" - ] + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DataFlow" + } + } } }, - primaryAggregationType: { - serializedName: "primaryAggregationType", + provisioningState: { + serializedName: "provisioningState", + readOnly: true, type: { - name: "Enum", - allowedValues: [ - "None", - "Average", - "Count", - "Minimum", - "Maximum", - "Total" - ] + name: "String" } - }, - supportedAggregationTypes: { - serializedName: "supportedAggregationTypes", + } + } + } +}; + +export const DataSourcesSpec: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataSourcesSpec", + modelProperties: { + performanceCounters: { + serializedName: "performanceCounters", type: { name: "Sequence", element: { type: { - name: "Enum", - allowedValues: [ - "None", - "Average", - "Count", - "Minimum", - "Maximum", - "Total" - ] + name: "Composite", + className: "PerfCounterDataSource" } } } }, - metricAvailabilities: { - serializedName: "metricAvailabilities", + windowsEventLogs: { + serializedName: "windowsEventLogs", type: { name: "Sequence", element: { type: { name: "Composite", - className: "MetricAvailability" + className: "WindowsEventLogDataSource" } } } }, - id: { - serializedName: "id", + syslog: { + serializedName: "syslog", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SyslogDataSource" + } + } } }, - dimensions: { - serializedName: "dimensions", + extensions: { + serializedName: "extensions", type: { name: "Sequence", element: { type: { name: "Composite", - className: "LocalizableString" + className: "ExtensionDataSource" } } } @@ -2892,68 +4865,78 @@ export const MetricDefinition: msRest.CompositeMapper = { } }; -export const MetricValue: msRest.CompositeMapper = { - serializedName: "MetricValue", +export const PerfCounterDataSource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricValue", + className: "PerfCounterDataSource", modelProperties: { - timeStamp: { - required: true, - serializedName: "timeStamp", - type: { - name: "DateTime" - } - }, - average: { - serializedName: "average", - type: { - name: "Number" - } - }, - minimum: { - serializedName: "minimum", + streams: { + serializedName: "streams", type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - maximum: { - serializedName: "maximum", + samplingFrequencyInSeconds: { + serializedName: "samplingFrequencyInSeconds", type: { name: "Number" } }, - total: { - serializedName: "total", + counterSpecifiers: { + serializedName: "counterSpecifiers", type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - count: { - serializedName: "count", + name: { + serializedName: "name", type: { - name: "Number" + name: "String" } } } } }; -export const MetadataValue: msRest.CompositeMapper = { - serializedName: "MetadataValue", +export const WindowsEventLogDataSource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetadataValue", + className: "WindowsEventLogDataSource", modelProperties: { - name: { - serializedName: "name", + streams: { + serializedName: "streams", type: { - name: "Composite", - className: "LocalizableString" + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + xPathQueries: { + serializedName: "xPathQueries", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - value: { - serializedName: "value", + name: { + serializedName: "name", type: { name: "String" } @@ -2962,179 +4945,168 @@ export const MetadataValue: msRest.CompositeMapper = { } }; -export const TimeSeriesElement: msRest.CompositeMapper = { - serializedName: "TimeSeriesElement", +export const SyslogDataSource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TimeSeriesElement", + className: "SyslogDataSource", modelProperties: { - metadatavalues: { - serializedName: "metadatavalues", + streams: { + serializedName: "streams", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "MetadataValue" + name: "String" } } } }, - data: { - serializedName: "data", + facilityNames: { + serializedName: "facilityNames", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "MetricValue" + name: "String" + } + } + } + }, + logLevels: { + serializedName: "logLevels", + type: { + name: "Sequence", + element: { + type: { + name: "String" } } } + }, + name: { + serializedName: "name", + type: { + name: "String" + } } } } }; -export const Metric: msRest.CompositeMapper = { - serializedName: "Metric", +export const ExtensionDataSource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Metric", + className: "ExtensionDataSource", modelProperties: { - id: { - required: true, - serializedName: "id", + streams: { + serializedName: "streams", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - type: { + extensionName: { + serializedName: "extensionName", required: true, - serializedName: "type", type: { name: "String" } }, - name: { - required: true, - serializedName: "name", - type: { - name: "Composite", - className: "LocalizableString" - } - }, - unit: { - required: true, - serializedName: "unit", + extensionSettings: { + serializedName: "extensionSettings", type: { - name: "Enum", - allowedValues: [ - "Count", - "Bytes", - "Seconds", - "CountPerSecond", - "BytesPerSecond", - "Percent", - "MilliSeconds", - "ByteSeconds", - "Unspecified", - "Cores", - "MilliCores", - "NanoCores", - "BitsPerSecond" - ] + name: "Dictionary", + value: { type: { name: "any" } } } }, - timeseries: { - required: true, - serializedName: "timeseries", + inputDataSources: { + serializedName: "inputDataSources", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "TimeSeriesElement" + name: "String" } } } + }, + name: { + serializedName: "name", + type: { + name: "String" + } } } } }; -export const Response: msRest.CompositeMapper = { - serializedName: "Response", +export const DestinationsSpec: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Response", + className: "DestinationsSpec", modelProperties: { - cost: { - serializedName: "cost", - constraints: { - InclusiveMinimum: 0 - }, - type: { - name: "Number" - } - }, - timespan: { - required: true, - serializedName: "timespan", + logAnalytics: { + serializedName: "logAnalytics", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LogAnalyticsDestination" + } + } } }, - interval: { - serializedName: "interval", + azureMonitorMetrics: { + serializedName: "azureMonitorMetrics", type: { - name: "TimeSpan" + name: "Composite", + className: "DestinationsSpecAzureMonitorMetrics" } - }, - namespace: { - serializedName: "namespace", + } + } + } +}; + +export const LogAnalyticsDestination: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LogAnalyticsDestination", + modelProperties: { + workspaceResourceId: { + serializedName: "workspaceResourceId", type: { name: "String" } }, - resourceregion: { - serializedName: "resourceregion", + workspaceId: { + serializedName: "workspaceId", + readOnly: true, type: { name: "String" } }, - value: { - required: true, - serializedName: "value", + name: { + serializedName: "name", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Metric" - } - } + name: "String" } } } } }; -export const BaselineMetadataValue: msRest.CompositeMapper = { - serializedName: "BaselineMetadataValue", +export const AzureMonitorMetricsDestination: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BaselineMetadataValue", + className: "AzureMonitorMetricsDestination", modelProperties: { name: { serializedName: "name", - type: { - name: "Composite", - className: "LocalizableString" - } - }, - value: { - serializedName: "value", type: { name: "String" } @@ -3143,44 +5115,29 @@ export const BaselineMetadataValue: msRest.CompositeMapper = { } }; -export const Baseline: msRest.CompositeMapper = { - serializedName: "Baseline", +export const DataFlow: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Baseline", + className: "DataFlow", modelProperties: { - sensitivity: { - required: true, - serializedName: "sensitivity", - type: { - name: "Enum", - allowedValues: [ - "Low", - "Medium", - "High" - ] - } - }, - lowThresholds: { - required: true, - serializedName: "lowThresholds", + streams: { + serializedName: "streams", type: { name: "Sequence", element: { type: { - name: "Number" + name: "String" } } } }, - highThresholds: { - required: true, - serializedName: "highThresholds", + destinations: { + serializedName: "destinations", type: { name: "Sequence", element: { type: { - name: "Number" + name: "String" } } } @@ -3189,169 +5146,149 @@ export const Baseline: msRest.CompositeMapper = { } }; -export const BaselineResponse: msRest.CompositeMapper = { - serializedName: "BaselineResponse", +export const RuleManagementEventClaimsDataSource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BaselineResponse", + className: "RuleManagementEventClaimsDataSource", modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - type: { - readOnly: true, - serializedName: "type", + emailAddress: { + serializedName: "emailAddress", type: { name: "String" } - }, - name: { - readOnly: true, - serializedName: "name", + } + } + } +}; + +export const ManagementEventAggregationCondition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagementEventAggregationCondition", + modelProperties: { + operator: { + serializedName: "operator", type: { - name: "Composite", - className: "LocalizableString" + name: "Enum", + allowedValues: [ + "GreaterThan", + "GreaterThanOrEqual", + "LessThan", + "LessThanOrEqual" + ] } }, - timespan: { - serializedName: "properties.timespan", + threshold: { + serializedName: "threshold", type: { - name: "String" + name: "Number" } }, - interval: { - serializedName: "properties.interval", + windowSize: { + serializedName: "windowSize", type: { name: "TimeSpan" } - }, - aggregation: { - serializedName: "properties.aggregation", - type: { - name: "String" - } - }, - timestamps: { - serializedName: "properties.timestamps", - type: { - name: "Sequence", - element: { - type: { - name: "DateTime" - } - } - } - }, - baseline: { - serializedName: "properties.baseline", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Baseline" - } - } - } - }, - metadata: { - serializedName: "properties.metadata", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BaselineMetadataValue" - } - } - } } } } }; -export const TimeSeriesInformation: msRest.CompositeMapper = { - serializedName: "TimeSeriesInformation", +export const MultiMetricCriteria: coreClient.CompositeMapper = { + serializedName: "MultiMetricCriteria", type: { name: "Composite", - className: "TimeSeriesInformation", + className: "MultiMetricCriteria", + uberParent: "MultiMetricCriteria", + additionalProperties: { type: { name: "Object" } }, + polymorphicDiscriminator: { + serializedName: "criterionType", + clientName: "criterionType" + }, modelProperties: { - sensitivities: { + criterionType: { + serializedName: "criterionType", + required: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + metricName: { + serializedName: "metricName", required: true, - serializedName: "sensitivities", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - values: { + metricNamespace: { + serializedName: "metricNamespace", + type: { + name: "String" + } + }, + timeAggregation: { + serializedName: "timeAggregation", required: true, - serializedName: "values", type: { - name: "Sequence", - element: { - type: { - name: "Number" - } - } + name: "String" } }, - timestamps: { - serializedName: "timestamps", + dimensions: { + serializedName: "dimensions", type: { name: "Sequence", element: { type: { - name: "DateTime" + name: "Composite", + className: "MetricDimension" } } } + }, + skipMetricValidation: { + serializedName: "skipMetricValidation", + type: { + name: "Boolean" + } } } } }; -export const CalculateBaselineResponse: msRest.CompositeMapper = { - serializedName: "CalculateBaselineResponse", +export const MetricDimension: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CalculateBaselineResponse", + className: "MetricDimension", modelProperties: { - type: { + name: { + serializedName: "name", required: true, - serializedName: "type", type: { name: "String" } }, - timestamps: { - serializedName: "timestamps", + operator: { + serializedName: "operator", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "DateTime" - } - } + name: "String" } }, - baseline: { + values: { + serializedName: "values", required: true, - serializedName: "baseline", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "Baseline" + name: "String" } } } @@ -3360,87 +5297,87 @@ export const CalculateBaselineResponse: msRest.CompositeMapper = { } }; -export const MetricSingleDimension: msRest.CompositeMapper = { - serializedName: "MetricSingleDimension", +export const DynamicThresholdFailingPeriods: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricSingleDimension", + className: "DynamicThresholdFailingPeriods", modelProperties: { - name: { + numberOfEvaluationPeriods: { + serializedName: "numberOfEvaluationPeriods", required: true, - serializedName: "name", type: { - name: "String" + name: "Number" } }, - value: { + minFailingPeriodsToAlert: { + serializedName: "minFailingPeriodsToAlert", required: true, - serializedName: "value", type: { - name: "String" + name: "Number" } } } } }; -export const SingleBaseline: msRest.CompositeMapper = { - serializedName: "SingleBaseline", +export const TriggerCondition: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SingleBaseline", + className: "TriggerCondition", modelProperties: { - sensitivity: { + thresholdOperator: { + defaultValue: "GreaterThanOrEqual", + serializedName: "thresholdOperator", required: true, - serializedName: "sensitivity", type: { name: "String" } }, - lowThresholds: { + threshold: { + serializedName: "threshold", required: true, - serializedName: "lowThresholds", type: { - name: "Sequence", - element: { - type: { - name: "Number" - } - } + name: "Number" } }, - highThresholds: { - required: true, - serializedName: "highThresholds", + metricTrigger: { + serializedName: "metricTrigger", type: { - name: "Sequence", - element: { - type: { - name: "Number" - } - } + name: "Composite", + className: "LogMetricTrigger" } } } } }; -export const BaselineMetadata: msRest.CompositeMapper = { - serializedName: "BaselineMetadata", +export const LogMetricTrigger: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BaselineMetadata", + className: "LogMetricTrigger", modelProperties: { - name: { - required: true, - serializedName: "name", + thresholdOperator: { + defaultValue: "GreaterThanOrEqual", + serializedName: "thresholdOperator", type: { name: "String" } }, - value: { - required: true, - serializedName: "value", + threshold: { + serializedName: "threshold", + type: { + name: "Number" + } + }, + metricTriggerType: { + defaultValue: "Consecutive", + serializedName: "metricTriggerType", + type: { + name: "String" + } + }, + metricColumn: { + serializedName: "metricColumn", type: { name: "String" } @@ -3449,128 +5386,65 @@ export const BaselineMetadata: msRest.CompositeMapper = { } }; -export const TimeSeriesBaseline: msRest.CompositeMapper = { - serializedName: "TimeSeriesBaseline", +export const AzNsActionGroup: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TimeSeriesBaseline", + className: "AzNsActionGroup", modelProperties: { - aggregation: { - required: true, - serializedName: "aggregation", - type: { - name: "String" - } - }, - dimensions: { - serializedName: "dimensions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricSingleDimension" - } - } - } - }, - timestamps: { - required: true, - serializedName: "timestamps", + actionGroup: { + serializedName: "actionGroup", type: { name: "Sequence", element: { type: { - name: "DateTime" + name: "String" } } } }, - data: { - required: true, - serializedName: "data", + emailSubject: { + serializedName: "emailSubject", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SingleBaseline" - } - } + name: "String" } }, - metadata: { - serializedName: "metadata", + customWebhookPayload: { + serializedName: "customWebhookPayload", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BaselineMetadata" - } - } + name: "String" } } } } }; -export const SingleMetricBaseline: msRest.CompositeMapper = { - serializedName: "SingleMetricBaseline", +export const Dimension: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SingleMetricBaseline", + className: "Dimension", modelProperties: { - id: { - required: true, - serializedName: "id", - type: { - name: "String" - } - }, - type: { - required: true, - serializedName: "type", - type: { - name: "String" - } - }, name: { - required: true, serializedName: "name", - type: { - name: "String" - } - }, - timespan: { required: true, - serializedName: "properties.timespan", type: { name: "String" } }, - interval: { + operator: { + serializedName: "operator", required: true, - serializedName: "properties.interval", - type: { - name: "TimeSpan" - } - }, - namespace: { - serializedName: "properties.namespace", type: { name: "String" } }, - baselines: { + values: { + serializedName: "values", required: true, - serializedName: "properties.baselines", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "TimeSeriesBaseline" + name: "String" } } } @@ -3579,142 +5453,141 @@ export const SingleMetricBaseline: msRest.CompositeMapper = { } }; -export const MetricAlertAction: msRest.CompositeMapper = { - serializedName: "MetricAlertAction", +export const Criteria: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricAlertAction", + className: "Criteria", modelProperties: { - actionGroupId: { - serializedName: "actionGroupId", + metricName: { + serializedName: "metricName", + required: true, type: { name: "String" } }, - webhookProperties: { - serializedName: "webhookProperties", + dimensions: { + serializedName: "dimensions", type: { - name: "Dictionary", - value: { + name: "Sequence", + element: { type: { - name: "String" + name: "Composite", + className: "Dimension" } } - } - } - } - } -}; - -export const MetricAlertCriteria: msRest.CompositeMapper = { - serializedName: "MetricAlertCriteria", - type: { - name: "Composite", - polymorphicDiscriminator: { - serializedName: "odata.type", - clientName: "odatatype" - }, - uberParent: "MetricAlertCriteria", - className: "MetricAlertCriteria", - modelProperties: { - odatatype: { - required: true, - serializedName: "odata\\.type", - type: { - name: "String" - } - } - }, - additionalProperties: { - type: { - name: "Object" + } } } } }; -export const MetricAlertResource: msRest.CompositeMapper = { - serializedName: "MetricAlertResource", +export const AutoscaleSettingResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricAlertResource", + className: "AutoscaleSettingResource", modelProperties: { ...Resource.type.modelProperties, - description: { + profiles: { + constraints: { + MaxItems: 20 + }, + serializedName: "properties.profiles", required: true, - serializedName: "properties.description", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AutoscaleProfile" + } + } } }, - severity: { - required: true, - serializedName: "properties.severity", + notifications: { + serializedName: "properties.notifications", type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AutoscaleNotification" + } + } } }, enabled: { - required: true, + defaultValue: true, serializedName: "properties.enabled", type: { name: "Boolean" } }, - scopes: { - serializedName: "properties.scopes", + namePropertiesName: { + serializedName: "properties.name", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - evaluationFrequency: { - required: true, - serializedName: "properties.evaluationFrequency", + targetResourceUri: { + serializedName: "properties.targetResourceUri", type: { - name: "TimeSpan" + name: "String" } }, - windowSize: { + targetResourceLocation: { + serializedName: "properties.targetResourceLocation", + type: { + name: "String" + } + } + } + } +}; + +export const AlertRuleResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AlertRuleResource", + modelProperties: { + ...Resource.type.modelProperties, + namePropertiesName: { + serializedName: "properties.name", required: true, - serializedName: "properties.windowSize", type: { - name: "TimeSpan" + name: "String" } }, - targetResourceType: { - serializedName: "properties.targetResourceType", + description: { + serializedName: "properties.description", type: { name: "String" } }, - targetResourceRegion: { - serializedName: "properties.targetResourceRegion", + provisioningState: { + serializedName: "properties.provisioningState", type: { name: "String" } }, - criteria: { + isEnabled: { + serializedName: "properties.isEnabled", required: true, - serializedName: "properties.criteria", + type: { + name: "Boolean" + } + }, + condition: { + serializedName: "properties.condition", type: { name: "Composite", - className: "MetricAlertCriteria", - additionalProperties: { - type: { - name: "Object" - } - } + className: "RuleCondition" } }, - autoMitigate: { - serializedName: "properties.autoMitigate", + action: { + serializedName: "properties.action", type: { - name: "Boolean" + name: "Composite", + className: "RuleAction" } }, actions: { @@ -3724,14 +5597,14 @@ export const MetricAlertResource: msRest.CompositeMapper = { element: { type: { name: "Composite", - className: "MetricAlertAction" + className: "RuleAction" } } } }, lastUpdatedTime: { - readOnly: true, serializedName: "properties.lastUpdatedTime", + readOnly: true, type: { name: "DateTime" } @@ -3740,46 +5613,88 @@ export const MetricAlertResource: msRest.CompositeMapper = { } }; -export const MetricAlertResourcePatch: msRest.CompositeMapper = { - serializedName: "MetricAlertResourcePatch", +export const LogProfileResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricAlertResourcePatch", + className: "LogProfileResource", modelProperties: { - tags: { - serializedName: "tags", + ...Resource.type.modelProperties, + storageAccountId: { + serializedName: "properties.storageAccountId", type: { - name: "Dictionary", - value: { + name: "String" + } + }, + serviceBusRuleId: { + serializedName: "properties.serviceBusRuleId", + type: { + name: "String" + } + }, + locations: { + serializedName: "properties.locations", + required: true, + type: { + name: "Sequence", + element: { type: { name: "String" } } } }, - description: { + categories: { + serializedName: "properties.categories", required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + retentionPolicy: { + serializedName: "properties.retentionPolicy", + type: { + name: "Composite", + className: "RetentionPolicy" + } + } + } + } +}; + +export const MetricAlertResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricAlertResource", + modelProperties: { + ...Resource.type.modelProperties, + description: { serializedName: "properties.description", type: { name: "String" } }, severity: { - required: true, serializedName: "properties.severity", + required: true, type: { name: "Number" } }, enabled: { - required: true, serializedName: "properties.enabled", + required: true, type: { name: "Boolean" } }, scopes: { serializedName: "properties.scopes", + required: true, type: { name: "Sequence", element: { @@ -3790,15 +5705,15 @@ export const MetricAlertResourcePatch: msRest.CompositeMapper = { } }, evaluationFrequency: { - required: true, serializedName: "properties.evaluationFrequency", + required: true, type: { name: "TimeSpan" } }, windowSize: { - required: true, serializedName: "properties.windowSize", + required: true, type: { name: "TimeSpan" } @@ -3816,16 +5731,10 @@ export const MetricAlertResourcePatch: msRest.CompositeMapper = { } }, criteria: { - required: true, serializedName: "properties.criteria", type: { name: "Composite", - className: "MetricAlertCriteria", - additionalProperties: { - type: { - name: "Object" - } - } + className: "MetricAlertCriteria" } }, autoMitigate: { @@ -3847,98 +5756,99 @@ export const MetricAlertResourcePatch: msRest.CompositeMapper = { } }, lastUpdatedTime: { - readOnly: true, serializedName: "properties.lastUpdatedTime", + readOnly: true, type: { name: "DateTime" } + }, + isMigrated: { + serializedName: "properties.isMigrated", + readOnly: true, + type: { + name: "Boolean" + } } } } }; -export const MetricAlertStatusProperties: msRest.CompositeMapper = { - serializedName: "MetricAlertStatusProperties", +export const ActivityLogAlertResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricAlertStatusProperties", + className: "ActivityLogAlertResource", modelProperties: { - dimensions: { - serializedName: "dimensions", + ...Resource.type.modelProperties, + scopes: { + serializedName: "properties.scopes", type: { - name: "Dictionary", - value: { + name: "Sequence", + element: { type: { name: "String" } } } }, - status: { - serializedName: "status", + enabled: { + defaultValue: true, + serializedName: "properties.enabled", type: { - name: "String" + name: "Boolean" } }, - timestamp: { - serializedName: "timestamp", - type: { - name: "DateTime" - } - } - } - } -}; - -export const MetricAlertStatus: msRest.CompositeMapper = { - serializedName: "MetricAlertStatus", - type: { - name: "Composite", - className: "MetricAlertStatus", - modelProperties: { - name: { - serializedName: "name", + condition: { + serializedName: "properties.condition", type: { - name: "String" + name: "Composite", + className: "ActivityLogAlertAllOfCondition" } }, - id: { - serializedName: "id", + actions: { + serializedName: "properties.actions", type: { - name: "String" + name: "Composite", + className: "ActivityLogAlertActionList" } }, - type: { - serializedName: "type", + description: { + serializedName: "properties.description", type: { name: "String" } - }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "MetricAlertStatusProperties" - } } } } }; -export const MetricAlertStatusCollection: msRest.CompositeMapper = { - serializedName: "MetricAlertStatusCollection", +export const ErrorResponseCommon: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricAlertStatusCollection", + className: "ErrorResponseCommon", modelProperties: { - value: { - serializedName: "value", + ...ErrorResponse.type.modelProperties, + details: { + serializedName: "details", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "MetricAlertStatus" + className: "ErrorResponseCommon" + } + } + } + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" } } } @@ -3947,543 +5857,597 @@ export const MetricAlertStatusCollection: msRest.CompositeMapper = { } }; -export const MultiMetricCriteria: msRest.CompositeMapper = { - serializedName: "MultiMetricCriteria", +export const ThresholdRuleCondition: coreClient.CompositeMapper = { + serializedName: + "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition", type: { name: "Composite", - polymorphicDiscriminator: { - serializedName: "criterionType", - clientName: "criterionType" - }, - uberParent: "MultiMetricCriteria", - className: "MultiMetricCriteria", + className: "ThresholdRuleCondition", + uberParent: "RuleCondition", + polymorphicDiscriminator: RuleCondition.type.polymorphicDiscriminator, modelProperties: { - name: { + ...RuleCondition.type.modelProperties, + operator: { + serializedName: "operator", required: true, - serializedName: "name", type: { - name: "String" + name: "Enum", + allowedValues: [ + "GreaterThan", + "GreaterThanOrEqual", + "LessThan", + "LessThanOrEqual" + ] } }, - metricName: { + threshold: { + serializedName: "threshold", required: true, - serializedName: "metricName", type: { - name: "String" + name: "Number" } }, - metricNamespace: { - serializedName: "metricNamespace", + windowSize: { + serializedName: "windowSize", type: { - name: "String" + name: "TimeSpan" } }, timeAggregation: { - required: true, serializedName: "timeAggregation", type: { - name: "Object" + name: "Enum", + allowedValues: ["Average", "Minimum", "Maximum", "Total", "Last"] } - }, - dimensions: { - serializedName: "dimensions", + } + } + } +}; + +export const LocationThresholdRuleCondition: coreClient.CompositeMapper = { + serializedName: + "Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition", + type: { + name: "Composite", + className: "LocationThresholdRuleCondition", + uberParent: "RuleCondition", + polymorphicDiscriminator: RuleCondition.type.polymorphicDiscriminator, + modelProperties: { + ...RuleCondition.type.modelProperties, + windowSize: { + serializedName: "windowSize", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricDimension" - } - } + name: "TimeSpan" } }, - criterionType: { + failedLocationCount: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "failedLocationCount", required: true, - serializedName: "criterionType", type: { - name: "String" + name: "Number" } } - }, - additionalProperties: { - type: { - name: "Object" - } } } }; -export const MetricCriteria: msRest.CompositeMapper = { - serializedName: "StaticThresholdCriterion", +export const ManagementEventRuleCondition: coreClient.CompositeMapper = { + serializedName: + "Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition", type: { name: "Composite", - polymorphicDiscriminator: MultiMetricCriteria.type.polymorphicDiscriminator, - uberParent: "MultiMetricCriteria", - className: "MetricCriteria", + className: "ManagementEventRuleCondition", + uberParent: "RuleCondition", + polymorphicDiscriminator: RuleCondition.type.polymorphicDiscriminator, modelProperties: { - ...MultiMetricCriteria.type.modelProperties, - operator: { - required: true, - serializedName: "operator", - type: { - name: "Object" - } - }, - threshold: { - required: true, - serializedName: "threshold", + ...RuleCondition.type.modelProperties, + aggregation: { + serializedName: "aggregation", type: { - name: "Number" + name: "Composite", + className: "ManagementEventAggregationCondition" } } - }, - additionalProperties: MultiMetricCriteria.type.additionalProperties + } } }; -export const MetricAlertSingleResourceMultipleMetricCriteria: msRest.CompositeMapper = { - serializedName: "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", +export const RuleMetricDataSource: coreClient.CompositeMapper = { + serializedName: + "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource", type: { name: "Composite", - polymorphicDiscriminator: MetricAlertCriteria.type.polymorphicDiscriminator, - uberParent: "MetricAlertCriteria", - className: "MetricAlertSingleResourceMultipleMetricCriteria", + className: "RuleMetricDataSource", + uberParent: "RuleDataSource", + polymorphicDiscriminator: RuleDataSource.type.polymorphicDiscriminator, modelProperties: { - ...MetricAlertCriteria.type.modelProperties, - allOf: { - serializedName: "allOf", + ...RuleDataSource.type.modelProperties, + metricName: { + serializedName: "metricName", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricCriteria", - additionalProperties: MultiMetricCriteria.type.additionalProperties - } - } + name: "String" } } - }, - additionalProperties: MetricAlertCriteria.type.additionalProperties + } } }; -export const MetricDimension: msRest.CompositeMapper = { - serializedName: "MetricDimension", +export const RuleManagementEventDataSource: coreClient.CompositeMapper = { + serializedName: + "Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource", type: { name: "Composite", - className: "MetricDimension", + className: "RuleManagementEventDataSource", + uberParent: "RuleDataSource", + polymorphicDiscriminator: RuleDataSource.type.polymorphicDiscriminator, modelProperties: { - name: { - required: true, - serializedName: "name", + ...RuleDataSource.type.modelProperties, + eventName: { + serializedName: "eventName", type: { name: "String" } }, - operator: { - required: true, - serializedName: "operator", + eventSource: { + serializedName: "eventSource", type: { name: "String" } }, - values: { - required: true, - serializedName: "values", + level: { + serializedName: "level", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" + } + }, + operationName: { + serializedName: "operationName", + type: { + name: "String" + } + }, + resourceGroupName: { + serializedName: "resourceGroupName", + type: { + name: "String" + } + }, + resourceProviderName: { + serializedName: "resourceProviderName", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + }, + subStatus: { + serializedName: "subStatus", + type: { + name: "String" + } + }, + claims: { + serializedName: "claims", + type: { + name: "Composite", + className: "RuleManagementEventClaimsDataSource" } } } } }; -export const MetricAlertMultipleResourceMultipleMetricCriteria: msRest.CompositeMapper = { - serializedName: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria", +export const RuleEmailAction: coreClient.CompositeMapper = { + serializedName: "Microsoft.Azure.Management.Insights.Models.RuleEmailAction", type: { name: "Composite", - polymorphicDiscriminator: MetricAlertCriteria.type.polymorphicDiscriminator, - uberParent: "MetricAlertCriteria", - className: "MetricAlertMultipleResourceMultipleMetricCriteria", + className: "RuleEmailAction", + uberParent: "RuleAction", + polymorphicDiscriminator: RuleAction.type.polymorphicDiscriminator, modelProperties: { - ...MetricAlertCriteria.type.modelProperties, - allOf: { - serializedName: "allOf", + ...RuleAction.type.modelProperties, + sendToServiceOwners: { + serializedName: "sendToServiceOwners", + type: { + name: "Boolean" + } + }, + customEmails: { + serializedName: "customEmails", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "MultiMetricCriteria", - additionalProperties: { - type: { - name: "Object" - } - } + name: "String" } } } } - }, - additionalProperties: MetricAlertCriteria.type.additionalProperties + } } }; -export const DynamicThresholdFailingPeriods: msRest.CompositeMapper = { - serializedName: "DynamicThresholdFailingPeriods", +export const RuleWebhookAction: coreClient.CompositeMapper = { + serializedName: + "Microsoft.Azure.Management.Insights.Models.RuleWebhookAction", type: { name: "Composite", - className: "DynamicThresholdFailingPeriods", + className: "RuleWebhookAction", + uberParent: "RuleAction", + polymorphicDiscriminator: RuleAction.type.polymorphicDiscriminator, modelProperties: { - numberOfEvaluationPeriods: { - required: true, - serializedName: "numberOfEvaluationPeriods", + ...RuleAction.type.modelProperties, + serviceUri: { + serializedName: "serviceUri", type: { - name: "Number" + name: "String" } }, - minFailingPeriodsToAlert: { - required: true, - serializedName: "minFailingPeriodsToAlert", + properties: { + serializedName: "properties", type: { - name: "Number" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const DynamicMetricCriteria: msRest.CompositeMapper = { - serializedName: "DynamicThresholdCriterion", +export const DiagnosticSettingsResource: coreClient.CompositeMapper = { type: { name: "Composite", - polymorphicDiscriminator: MultiMetricCriteria.type.polymorphicDiscriminator, - uberParent: "MultiMetricCriteria", - className: "DynamicMetricCriteria", + className: "DiagnosticSettingsResource", modelProperties: { - ...MultiMetricCriteria.type.modelProperties, - operator: { - required: true, - serializedName: "operator", - type: { - name: "Object" - } - }, - alertSensitivity: { - required: true, - serializedName: "alertSensitivity", + ...ProxyOnlyResource.type.modelProperties, + storageAccountId: { + serializedName: "properties.storageAccountId", type: { - name: "Object" + name: "String" } }, - failingPeriods: { - required: true, - serializedName: "failingPeriods", + serviceBusRuleId: { + serializedName: "properties.serviceBusRuleId", type: { - name: "Composite", - className: "DynamicThresholdFailingPeriods" + name: "String" } }, - ignoreDataBefore: { - serializedName: "ignoreDataBefore", - type: { - name: "DateTime" - } - } - }, - additionalProperties: MultiMetricCriteria.type.additionalProperties - } -}; - -export const Source: msRest.CompositeMapper = { - serializedName: "Source", - type: { - name: "Composite", - className: "Source", - modelProperties: { - query: { - serializedName: "query", + eventHubAuthorizationRuleId: { + serializedName: "properties.eventHubAuthorizationRuleId", type: { name: "String" } }, - authorizedResources: { - serializedName: "authorizedResources", + eventHubName: { + serializedName: "properties.eventHubName", + type: { + name: "String" + } + }, + metrics: { + serializedName: "properties.metrics", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "MetricSettings" } } } }, - dataSourceId: { - required: true, - serializedName: "dataSourceId", + logs: { + serializedName: "properties.logs", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LogSettings" + } + } } }, - queryType: { - serializedName: "queryType", + workspaceId: { + serializedName: "properties.workspaceId", type: { name: "String" } - } - } - } -}; - -export const Schedule: msRest.CompositeMapper = { - serializedName: "Schedule", - type: { - name: "Composite", - className: "Schedule", - modelProperties: { - frequencyInMinutes: { - required: true, - serializedName: "frequencyInMinutes", - type: { - name: "Number" - } }, - timeWindowInMinutes: { - required: true, - serializedName: "timeWindowInMinutes", + logAnalyticsDestinationType: { + serializedName: "properties.logAnalyticsDestinationType", type: { - name: "Number" + name: "String" } } } } }; -export const Action: msRest.CompositeMapper = { - serializedName: "Action", +export const DiagnosticSettingsCategoryResource: coreClient.CompositeMapper = { type: { name: "Composite", - polymorphicDiscriminator: { - serializedName: "odata.type", - clientName: "odatatype" - }, - uberParent: "Action", - className: "Action", + className: "DiagnosticSettingsCategoryResource", modelProperties: { - odatatype: { - required: true, - serializedName: "odata\\.type", + ...ProxyOnlyResource.type.modelProperties, + categoryType: { + serializedName: "properties.categoryType", type: { - name: "String" + name: "Enum", + allowedValues: ["Metrics", "Logs"] } } } } }; -export const LogSearchRuleResource: msRest.CompositeMapper = { - serializedName: "LogSearchRuleResource", +export const ActionGroupResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LogSearchRuleResource", + className: "ActionGroupResource", modelProperties: { - ...Resource.type.modelProperties, - description: { - serializedName: "properties.description", + ...AzureResource.type.modelProperties, + groupShortName: { + constraints: { + MaxLength: 12 + }, + serializedName: "properties.groupShortName", type: { name: "String" } }, enabled: { + defaultValue: true, serializedName: "properties.enabled", type: { - name: "String" + name: "Boolean" } }, - lastUpdatedTime: { - readOnly: true, - serializedName: "properties.lastUpdatedTime", + emailReceivers: { + serializedName: "properties.emailReceivers", type: { - name: "DateTime" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EmailReceiver" + } + } } }, - provisioningState: { - readOnly: true, - serializedName: "properties.provisioningState", + smsReceivers: { + serializedName: "properties.smsReceivers", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SmsReceiver" + } + } } }, - source: { - required: true, - serializedName: "properties.source", + webhookReceivers: { + serializedName: "properties.webhookReceivers", type: { - name: "Composite", - className: "Source" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "WebhookReceiver" + } + } } }, - schedule: { - serializedName: "properties.schedule", + itsmReceivers: { + serializedName: "properties.itsmReceivers", type: { - name: "Composite", - className: "Schedule" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ItsmReceiver" + } + } } }, - action: { - required: true, - serializedName: "properties.action", + azureAppPushReceivers: { + serializedName: "properties.azureAppPushReceivers", type: { - name: "Composite", - className: "Action" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AzureAppPushReceiver" + } + } } - } - } - } -}; - -export const LogSearchRuleResourcePatch: msRest.CompositeMapper = { - serializedName: "LogSearchRuleResourcePatch", - type: { - name: "Composite", - className: "LogSearchRuleResourcePatch", - modelProperties: { - tags: { - serializedName: "tags", + }, + automationRunbookReceivers: { + serializedName: "properties.automationRunbookReceivers", type: { - name: "Dictionary", - value: { + name: "Sequence", + element: { type: { - name: "String" + name: "Composite", + className: "AutomationRunbookReceiver" } } } }, - enabled: { - serializedName: "properties.enabled", + voiceReceivers: { + serializedName: "properties.voiceReceivers", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VoiceReceiver" + } + } } - } - } - } -}; - -export const LogMetricTrigger: msRest.CompositeMapper = { - serializedName: "LogMetricTrigger", - type: { - name: "Composite", - className: "LogMetricTrigger", - modelProperties: { - thresholdOperator: { - serializedName: "thresholdOperator", + }, + logicAppReceivers: { + serializedName: "properties.logicAppReceivers", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LogicAppReceiver" + } + } } }, - threshold: { - serializedName: "threshold", + azureFunctionReceivers: { + serializedName: "properties.azureFunctionReceivers", type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AzureFunctionReceiver" + } + } } }, - metricTriggerType: { - serializedName: "metricTriggerType", + armRoleReceivers: { + serializedName: "properties.armRoleReceivers", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ArmRoleReceiver" + } + } } }, - metricColumn: { - serializedName: "metricColumn", + eventHubReceivers: { + serializedName: "properties.eventHubReceivers", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EventHubReceiver" + } + } } } } } }; -export const TriggerCondition: msRest.CompositeMapper = { - serializedName: "TriggerCondition", +export const MetricAlertSingleResourceMultipleMetricCriteria: coreClient.CompositeMapper = { + serializedName: + "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", type: { name: "Composite", - className: "TriggerCondition", + className: "MetricAlertSingleResourceMultipleMetricCriteria", + uberParent: "MetricAlertCriteria", + additionalProperties: { type: { name: "Object" } }, + polymorphicDiscriminator: MetricAlertCriteria.type.polymorphicDiscriminator, + modelProperties: { + ...MetricAlertCriteria.type.modelProperties, + allOf: { + serializedName: "allOf", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricCriteria" + } + } + } + } + } + } +}; + +export const WebtestLocationAvailabilityCriteria: coreClient.CompositeMapper = { + serializedName: "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria", + type: { + name: "Composite", + className: "WebtestLocationAvailabilityCriteria", + uberParent: "MetricAlertCriteria", + additionalProperties: { type: { name: "Object" } }, + polymorphicDiscriminator: MetricAlertCriteria.type.polymorphicDiscriminator, modelProperties: { - thresholdOperator: { + ...MetricAlertCriteria.type.modelProperties, + webTestId: { + serializedName: "webTestId", required: true, - serializedName: "thresholdOperator", type: { name: "String" } }, - threshold: { + componentId: { + serializedName: "componentId", required: true, - serializedName: "threshold", type: { - name: "Number" + name: "String" } }, - metricTrigger: { - serializedName: "metricTrigger", + failedLocationCount: { + serializedName: "failedLocationCount", + required: true, type: { - name: "Composite", - className: "LogMetricTrigger" + name: "Number" } } } } }; -export const AzNsActionGroup: msRest.CompositeMapper = { - serializedName: "AzNsActionGroup", +export const MetricAlertMultipleResourceMultipleMetricCriteria: coreClient.CompositeMapper = { + serializedName: + "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria", type: { name: "Composite", - className: "AzNsActionGroup", + className: "MetricAlertMultipleResourceMultipleMetricCriteria", + uberParent: "MetricAlertCriteria", + additionalProperties: { type: { name: "Object" } }, + polymorphicDiscriminator: MetricAlertCriteria.type.polymorphicDiscriminator, modelProperties: { - actionGroup: { - serializedName: "actionGroup", + ...MetricAlertCriteria.type.modelProperties, + allOf: { + serializedName: "allOf", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "MultiMetricCriteria" } } } - }, - emailSubject: { - serializedName: "emailSubject", - type: { - name: "String" - } - }, - customWebhookPayload: { - serializedName: "customWebhookPayload", - type: { - name: "String" - } } } } }; -export const AlertingAction: msRest.CompositeMapper = { - serializedName: "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", +export const AlertingAction: coreClient.CompositeMapper = { + serializedName: + "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", type: { name: "Composite", - polymorphicDiscriminator: Action.type.polymorphicDiscriminator, - uberParent: "Action", className: "AlertingAction", + uberParent: "Action", + polymorphicDiscriminator: Action.type.polymorphicDiscriminator, modelProperties: { ...Action.type.modelProperties, severity: { - required: true, serializedName: "severity", + required: true, type: { name: "String" } @@ -4502,7 +6466,6 @@ export const AlertingAction: msRest.CompositeMapper = { } }, trigger: { - required: true, serializedName: "trigger", type: { name: "Composite", @@ -4513,85 +6476,19 @@ export const AlertingAction: msRest.CompositeMapper = { } }; -export const Dimension: msRest.CompositeMapper = { - serializedName: "Dimension", - type: { - name: "Composite", - className: "Dimension", - modelProperties: { - name: { - required: true, - serializedName: "name", - type: { - name: "String" - } - }, - operator: { - required: true, - isConstant: true, - serializedName: "operator", - defaultValue: 'Include', - type: { - name: "String" - } - }, - values: { - required: true, - serializedName: "values", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } - } - } -}; - -export const Criteria: msRest.CompositeMapper = { - serializedName: "Criteria", - type: { - name: "Composite", - className: "Criteria", - modelProperties: { - metricName: { - required: true, - serializedName: "metricName", - type: { - name: "String" - } - }, - dimensions: { - serializedName: "dimensions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Dimension" - } - } - } - } - } - } -}; - -export const LogToMetricAction: msRest.CompositeMapper = { - serializedName: "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction", +export const LogToMetricAction: coreClient.CompositeMapper = { + serializedName: + "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction", type: { name: "Composite", - polymorphicDiscriminator: Action.type.polymorphicDiscriminator, - uberParent: "Action", className: "LogToMetricAction", + uberParent: "Action", + polymorphicDiscriminator: Action.type.polymorphicDiscriminator, modelProperties: { ...Action.type.modelProperties, criteria: { - required: true, serializedName: "criteria", + required: true, type: { name: "Sequence", element: { @@ -4606,201 +6503,109 @@ export const LogToMetricAction: msRest.CompositeMapper = { } }; -export const MetricNamespaceName: msRest.CompositeMapper = { - serializedName: "MetricNamespaceName", +export const LogSearchRuleResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricNamespaceName", + className: "LogSearchRuleResource", modelProperties: { - metricNamespaceName: { - serializedName: "metricNamespaceName", + ...ResourceAutoGenerated.type.modelProperties, + createdWithApiVersion: { + serializedName: "properties.createdWithApiVersion", + readOnly: true, type: { name: "String" } - } - } - } -}; - -export const MetricNamespace: msRest.CompositeMapper = { - serializedName: "MetricNamespace", - type: { - name: "Composite", - className: "MetricNamespace", - modelProperties: { - id: { - serializedName: "id", + }, + isLegacyLogAnalyticsRule: { + serializedName: "properties.isLegacyLogAnalyticsRule", + readOnly: true, type: { - name: "String" + name: "Boolean" } }, - type: { - serializedName: "type", + description: { + serializedName: "properties.description", type: { name: "String" } }, - name: { - serializedName: "name", + displayName: { + serializedName: "properties.displayName", type: { name: "String" } }, - properties: { - serializedName: "properties", + autoMitigate: { + defaultValue: false, + serializedName: "properties.autoMitigate", type: { - name: "Composite", - className: "MetricNamespaceName" + name: "Boolean" } - } - } - } -}; - -export const ProxyResource: msRest.CompositeMapper = { - serializedName: "ProxyResource", - type: { - name: "Composite", - className: "ProxyResource", - modelProperties: { - id: { - readOnly: true, - serializedName: "id", + }, + enabled: { + serializedName: "properties.enabled", type: { name: "String" } }, - name: { + lastUpdatedTime: { + serializedName: "properties.lastUpdatedTime", readOnly: true, - serializedName: "name", type: { - name: "String" + name: "DateTime" } }, - type: { + provisioningState: { + serializedName: "properties.provisioningState", readOnly: true, - serializedName: "type", - type: { - name: "String" - } - } - } - } -}; - -export const ErrorModel: msRest.CompositeMapper = { - serializedName: "Error", - type: { - name: "Composite", - className: "ErrorModel", - modelProperties: { - code: { - required: true, - serializedName: "code", type: { name: "String" } }, - message: { - serializedName: "message", - type: { - name: "String" - } - } - } - } -}; - -export const ResponseWithError: msRest.CompositeMapper = { - serializedName: "ResponseWithError", - type: { - name: "Composite", - className: "ResponseWithError", - modelProperties: { - error: { - required: true, - serializedName: "error", + source: { + serializedName: "properties.source", type: { name: "Composite", - className: "ErrorModel" - } - } - } - } -}; - -export const WorkspaceInfo: msRest.CompositeMapper = { - serializedName: "WorkspaceInfo", - type: { - name: "Composite", - className: "WorkspaceInfo", - modelProperties: { - id: { - required: true, - serializedName: "id", - type: { - name: "String" + className: "Source" } }, - location: { - required: true, - serializedName: "location", + schedule: { + serializedName: "properties.schedule", type: { - name: "String" + name: "Composite", + className: "Schedule" } }, - customerId: { - required: true, - serializedName: "properties.customerId", - type: { - name: "String" - } - } - } - } -}; - -export const DataContainer: msRest.CompositeMapper = { - serializedName: "DataContainer", - type: { - name: "Composite", - className: "DataContainer", - modelProperties: { - workspace: { - required: true, - serializedName: "workspace", + action: { + serializedName: "properties.action", type: { name: "Composite", - className: "WorkspaceInfo" + className: "Action" } } } } }; -export const VMInsightsOnboardingStatus: msRest.CompositeMapper = { - serializedName: "VMInsightsOnboardingStatus", +export const VMInsightsOnboardingStatus: coreClient.CompositeMapper = { type: { name: "Composite", className: "VMInsightsOnboardingStatus", modelProperties: { ...ProxyResource.type.modelProperties, resourceId: { - required: true, serializedName: "properties.resourceId", type: { name: "String" } }, onboardingStatus: { - required: true, serializedName: "properties.onboardingStatus", type: { name: "String" } }, dataStatus: { - required: true, serializedName: "properties.dataStatus", type: { name: "String" @@ -4822,27 +6627,29 @@ export const VMInsightsOnboardingStatus: msRest.CompositeMapper = { } }; -export const AutoscaleSettingResourceCollection: msRest.CompositeMapper = { - serializedName: "AutoscaleSettingResourceCollection", +export const PrivateEndpointConnection: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AutoscaleSettingResourceCollection", + className: "PrivateEndpointConnection", modelProperties: { - value: { - required: true, - serializedName: "", + ...ProxyResource.type.modelProperties, + privateEndpoint: { + serializedName: "properties.privateEndpoint", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AutoscaleSettingResource" - } - } + name: "Composite", + className: "PrivateEndpointProperty" } }, - nextLink: { - serializedName: "nextLink", + privateLinkServiceConnectionState: { + serializedName: "properties.privateLinkServiceConnectionState", + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionStateProperty" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, type: { name: "String" } @@ -4851,20 +6658,27 @@ export const AutoscaleSettingResourceCollection: msRest.CompositeMapper = { } }; -export const IncidentListResult: msRest.CompositeMapper = { - serializedName: "IncidentListResult", +export const PrivateLinkResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IncidentListResult", + className: "PrivateLinkResource", modelProperties: { - value: { - serializedName: "", + ...ProxyResource.type.modelProperties, + groupId: { + serializedName: "properties.groupId", + readOnly: true, + type: { + name: "String" + } + }, + requiredMembers: { + serializedName: "properties.requiredMembers", + readOnly: true, type: { name: "Sequence", element: { type: { - name: "Composite", - className: "Incident" + name: "String" } } } @@ -4873,43 +6687,51 @@ export const IncidentListResult: msRest.CompositeMapper = { } }; -export const AlertRuleResourceCollection: msRest.CompositeMapper = { - serializedName: "AlertRuleResourceCollection", +export const ScopedResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AlertRuleResourceCollection", + className: "ScopedResource", modelProperties: { - value: { - serializedName: "", + ...ProxyResource.type.modelProperties, + linkedResourceId: { + serializedName: "properties.linkedResourceId", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AlertRuleResource" - } - } + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" } } } } }; -export const LogProfileCollection: msRest.CompositeMapper = { - serializedName: "LogProfileCollection", +export const AzureMonitorPrivateLinkScope: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LogProfileCollection", + className: "AzureMonitorPrivateLinkScope", modelProperties: { - value: { - required: true, - serializedName: "", + ...PrivateLinkScopesResource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + privateEndpointConnections: { + serializedName: "properties.privateEndpointConnections", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "LogProfileResource" + className: "PrivateEndpointConnection" } } } @@ -4918,233 +6740,214 @@ export const LogProfileCollection: msRest.CompositeMapper = { } }; -export const ActionGroupList: msRest.CompositeMapper = { - serializedName: "ActionGroupList", +export const DataCollectionEndpointResourceProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ActionGroupList", + className: "DataCollectionEndpointResourceProperties", modelProperties: { - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ActionGroupResource" - } - } - } - } + ...DataCollectionEndpoint.type.modelProperties } } }; -export const ActivityLogAlertList: msRest.CompositeMapper = { - serializedName: "ActivityLogAlertList", +export const DataCollectionEndpointConfigurationAccess: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ActivityLogAlertList", + className: "DataCollectionEndpointConfigurationAccess", modelProperties: { - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ActivityLogAlertResource" - } - } - } - } + ...ConfigurationAccessEndpointSpec.type.modelProperties } } }; -export const EventDataCollection: msRest.CompositeMapper = { - serializedName: "EventDataCollection", +export const DataCollectionEndpointLogsIngestion: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EventDataCollection", + className: "DataCollectionEndpointLogsIngestion", modelProperties: { - value: { - required: true, - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "EventData" - } - } - } - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - } + ...LogsIngestionEndpointSpec.type.modelProperties } } }; -export const EventCategoryCollection: msRest.CompositeMapper = { - serializedName: "EventCategoryCollection", +export const DataCollectionEndpointNetworkAcls: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EventCategoryCollection", + className: "DataCollectionEndpointNetworkAcls", modelProperties: { - value: { - required: true, - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "LocalizableString" - } - } - } - } + ...NetworkRuleSet.type.modelProperties } } }; -export const MetricDefinitionCollection: msRest.CompositeMapper = { - serializedName: "MetricDefinitionCollection", +export const DataCollectionEndpointResourceSystemData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricDefinitionCollection", + className: "DataCollectionEndpointResourceSystemData", modelProperties: { - value: { - required: true, - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricDefinition" - } - } - } - } + ...SystemData.type.modelProperties } } }; -export const MetricBaselinesResponse: msRest.CompositeMapper = { - serializedName: "MetricBaselinesResponse", +export const DataCollectionRuleAssociationProxyOnlyResourceSystemData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricBaselinesResponse", + className: "DataCollectionRuleAssociationProxyOnlyResourceSystemData", modelProperties: { - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SingleMetricBaseline" - } - } - } - } + ...SystemData.type.modelProperties } } }; -export const MetricAlertResourceCollection: msRest.CompositeMapper = { - serializedName: "MetricAlertResourceCollection", +export const DataCollectionRuleResourceSystemData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricAlertResourceCollection", + className: "DataCollectionRuleResourceSystemData", modelProperties: { - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricAlertResource" - } - } - } - } + ...SystemData.type.modelProperties } } }; -export const LogSearchRuleResourceCollection: msRest.CompositeMapper = { - serializedName: "LogSearchRuleResourceCollection", +export const DataCollectionRuleAssociationProxyOnlyResourceProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LogSearchRuleResourceCollection", + className: "DataCollectionRuleAssociationProxyOnlyResourceProperties", modelProperties: { - value: { - serializedName: "", + ...DataCollectionRuleAssociation.type.modelProperties + } + } +}; + +export const DataCollectionRuleResourceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataCollectionRuleResourceProperties", + modelProperties: { + ...DataCollectionRule.type.modelProperties + } + } +}; + +export const DataCollectionRuleDataSources: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataCollectionRuleDataSources", + modelProperties: { + ...DataSourcesSpec.type.modelProperties + } + } +}; + +export const DataCollectionRuleDestinations: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataCollectionRuleDestinations", + modelProperties: { + ...DestinationsSpec.type.modelProperties + } + } +}; + +export const DestinationsSpecAzureMonitorMetrics: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DestinationsSpecAzureMonitorMetrics", + modelProperties: { + ...AzureMonitorMetricsDestination.type.modelProperties + } + } +}; + +export const MetricCriteria: coreClient.CompositeMapper = { + serializedName: "StaticThresholdCriterion", + type: { + name: "Composite", + className: "MetricCriteria", + uberParent: "MultiMetricCriteria", + additionalProperties: { type: { name: "Object" } }, + polymorphicDiscriminator: MultiMetricCriteria.type.polymorphicDiscriminator, + modelProperties: { + ...MultiMetricCriteria.type.modelProperties, + operator: { + serializedName: "operator", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "LogSearchRuleResource" - } - } + name: "String" + } + }, + threshold: { + serializedName: "threshold", + required: true, + type: { + name: "Number" } } } } }; -export const MetricNamespaceCollection: msRest.CompositeMapper = { - serializedName: "MetricNamespaceCollection", +export const DynamicMetricCriteria: coreClient.CompositeMapper = { + serializedName: "DynamicThresholdCriterion", type: { name: "Composite", - className: "MetricNamespaceCollection", + className: "DynamicMetricCriteria", + uberParent: "MultiMetricCriteria", + additionalProperties: { type: { name: "Object" } }, + polymorphicDiscriminator: MultiMetricCriteria.type.polymorphicDiscriminator, modelProperties: { - value: { + ...MultiMetricCriteria.type.modelProperties, + operator: { + serializedName: "operator", required: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricNamespace" - } - } + name: "String" + } + }, + alertSensitivity: { + serializedName: "alertSensitivity", + required: true, + type: { + name: "String" + } + }, + failingPeriods: { + serializedName: "failingPeriods", + type: { + name: "Composite", + className: "DynamicThresholdFailingPeriods" + } + }, + ignoreDataBefore: { + serializedName: "ignoreDataBefore", + type: { + name: "DateTime" } } } } }; -export const discriminators = { - 'RuleDataSource' : RuleDataSource, - 'RuleCondition' : RuleCondition, - 'RuleDataSource.Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource' : RuleMetricDataSource, - 'RuleDataSource.Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource' : RuleManagementEventDataSource, - 'RuleCondition.Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition' : ThresholdRuleCondition, - 'RuleCondition.Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition' : LocationThresholdRuleCondition, - 'RuleCondition.Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition' : ManagementEventRuleCondition, - 'RuleAction' : RuleAction, - 'RuleAction.Microsoft.Azure.Management.Insights.Models.RuleEmailAction' : RuleEmailAction, - 'RuleAction.Microsoft.Azure.Management.Insights.Models.RuleWebhookAction' : RuleWebhookAction, - 'MetricAlertCriteria' : MetricAlertCriteria, - 'MultiMetricCriteria.StaticThresholdCriterion' : MetricCriteria, - 'MetricAlertCriteria.Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' : MetricAlertSingleResourceMultipleMetricCriteria, - 'MultiMetricCriteria' : MultiMetricCriteria, - 'MetricAlertCriteria.Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' : MetricAlertMultipleResourceMultipleMetricCriteria, - 'MultiMetricCriteria.DynamicThresholdCriterion' : DynamicMetricCriteria, - 'Action' : Action, - 'Action.Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction' : AlertingAction, - 'Action.Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction' : LogToMetricAction - +export let discriminators = { + RuleCondition: RuleCondition, + RuleDataSource: RuleDataSource, + RuleAction: RuleAction, + MetricAlertCriteria: MetricAlertCriteria, + Action: Action, + MultiMetricCriteria: MultiMetricCriteria, + "RuleCondition.Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition": ThresholdRuleCondition, + "RuleCondition.Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition": LocationThresholdRuleCondition, + "RuleCondition.Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition": ManagementEventRuleCondition, + "RuleDataSource.Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource": RuleMetricDataSource, + "RuleDataSource.Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource": RuleManagementEventDataSource, + "RuleAction.Microsoft.Azure.Management.Insights.Models.RuleEmailAction": RuleEmailAction, + "RuleAction.Microsoft.Azure.Management.Insights.Models.RuleWebhookAction": RuleWebhookAction, + "MetricAlertCriteria.Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria": MetricAlertSingleResourceMultipleMetricCriteria, + "MetricAlertCriteria.Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria": WebtestLocationAvailabilityCriteria, + "MetricAlertCriteria.Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria": MetricAlertMultipleResourceMultipleMetricCriteria, + "Action.Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction": AlertingAction, + "Action.Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction": LogToMetricAction, + "MultiMetricCriteria.StaticThresholdCriterion": MetricCriteria, + "MultiMetricCriteria.DynamicThresholdCriterion": DynamicMetricCriteria }; diff --git a/sdk/monitor/arm-monitor/src/models/metricAlertsMappers.ts b/sdk/monitor/arm-monitor/src/models/metricAlertsMappers.ts deleted file mode 100644 index a6d76f72efbc..000000000000 --- a/sdk/monitor/arm-monitor/src/models/metricAlertsMappers.ts +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - Action, - ActionGroupResource, - ActivityLogAlertActionGroup, - ActivityLogAlertActionList, - ActivityLogAlertAllOfCondition, - ActivityLogAlertLeafCondition, - ActivityLogAlertResource, - AlertingAction, - AlertRuleResource, - ArmRoleReceiver, - AutomationRunbookReceiver, - AutoscaleNotification, - AutoscaleProfile, - AutoscaleSettingResource, - AzNsActionGroup, - AzureAppPushReceiver, - AzureFunctionReceiver, - BaseResource, - CloudError, - Criteria, - DataContainer, - DiagnosticSettingsCategoryResource, - DiagnosticSettingsResource, - Dimension, - DynamicMetricCriteria, - DynamicThresholdFailingPeriods, - EmailNotification, - EmailReceiver, - ErrorResponse, - ItsmReceiver, - LocationThresholdRuleCondition, - LogicAppReceiver, - LogMetricTrigger, - LogProfileResource, - LogSearchRuleResource, - LogSettings, - LogToMetricAction, - ManagementEventAggregationCondition, - ManagementEventRuleCondition, - MetricAlertAction, - MetricAlertCriteria, - MetricAlertMultipleResourceMultipleMetricCriteria, - MetricAlertResource, - MetricAlertResourceCollection, - MetricAlertResourcePatch, - MetricAlertSingleResourceMultipleMetricCriteria, - MetricCriteria, - MetricDimension, - MetricSettings, - MetricTrigger, - MultiMetricCriteria, - ProxyOnlyResource, - ProxyResource, - Recurrence, - RecurrentSchedule, - Resource, - RetentionPolicy, - RuleAction, - RuleCondition, - RuleDataSource, - RuleEmailAction, - RuleManagementEventClaimsDataSource, - RuleManagementEventDataSource, - RuleMetricDataSource, - RuleWebhookAction, - ScaleAction, - ScaleCapacity, - ScaleRule, - Schedule, - SmsReceiver, - Source, - ThresholdRuleCondition, - TimeWindow, - TriggerCondition, - VMInsightsOnboardingStatus, - VoiceReceiver, - WebhookNotification, - WebhookReceiver, - WorkspaceInfo -} from "../models/mappers"; diff --git a/sdk/monitor/arm-monitor/src/models/metricAlertsStatusMappers.ts b/sdk/monitor/arm-monitor/src/models/metricAlertsStatusMappers.ts deleted file mode 100644 index a044e8994582..000000000000 --- a/sdk/monitor/arm-monitor/src/models/metricAlertsStatusMappers.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - ErrorResponse, - MetricAlertStatus, - MetricAlertStatusCollection, - MetricAlertStatusProperties -} from "../models/mappers"; diff --git a/sdk/monitor/arm-monitor/src/models/metricBaselineMappers.ts b/sdk/monitor/arm-monitor/src/models/metricBaselineMappers.ts deleted file mode 100644 index 7fbb371a4578..000000000000 --- a/sdk/monitor/arm-monitor/src/models/metricBaselineMappers.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - Baseline, - BaselineMetadataValue, - BaselineResponse, - CalculateBaselineResponse, - ErrorResponse, - LocalizableString, - TimeSeriesInformation -} from "../models/mappers"; diff --git a/sdk/monitor/arm-monitor/src/models/metricDefinitionsMappers.ts b/sdk/monitor/arm-monitor/src/models/metricDefinitionsMappers.ts deleted file mode 100644 index 31046db255a5..000000000000 --- a/sdk/monitor/arm-monitor/src/models/metricDefinitionsMappers.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - ErrorResponse, - LocalizableString, - MetricAvailability, - MetricDefinition, - MetricDefinitionCollection -} from "../models/mappers"; diff --git a/sdk/monitor/arm-monitor/src/models/metricNamespacesMappers.ts b/sdk/monitor/arm-monitor/src/models/metricNamespacesMappers.ts deleted file mode 100644 index 2e78b28244cd..000000000000 --- a/sdk/monitor/arm-monitor/src/models/metricNamespacesMappers.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - ErrorResponse, - MetricNamespace, - MetricNamespaceCollection, - MetricNamespaceName -} from "../models/mappers"; diff --git a/sdk/monitor/arm-monitor/src/models/metricsMappers.ts b/sdk/monitor/arm-monitor/src/models/metricsMappers.ts deleted file mode 100644 index 0796246e9fe7..000000000000 --- a/sdk/monitor/arm-monitor/src/models/metricsMappers.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - ErrorResponse, - LocalizableString, - MetadataValue, - Metric, - MetricValue, - Response, - TimeSeriesElement -} from "../models/mappers"; diff --git a/sdk/monitor/arm-monitor/src/models/operationsMappers.ts b/sdk/monitor/arm-monitor/src/models/operationsMappers.ts deleted file mode 100644 index 65fc7dd1800a..000000000000 --- a/sdk/monitor/arm-monitor/src/models/operationsMappers.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - CloudError, - Operation, - OperationDisplay, - OperationListResult -} from "../models/mappers"; diff --git a/sdk/monitor/arm-monitor/src/models/parameters.ts b/sdk/monitor/arm-monitor/src/models/parameters.ts index eac83a80fc9e..02e16f2df062 100644 --- a/sdk/monitor/arm-monitor/src/models/parameters.ts +++ b/sdk/monitor/arm-monitor/src/models/parameters.ts @@ -1,226 +1,336 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + AutoscaleSettingResource as AutoscaleSettingResourceMapper, + AutoscaleSettingResourcePatch as AutoscaleSettingResourcePatchMapper, + AlertRuleResource as AlertRuleResourceMapper, + AlertRuleResourcePatch as AlertRuleResourcePatchMapper, + LogProfileResource as LogProfileResourceMapper, + LogProfileResourcePatch as LogProfileResourcePatchMapper, + DiagnosticSettingsResource as DiagnosticSettingsResourceMapper, + ActionGroupResource as ActionGroupResourceMapper, + ActionGroupPatchBody as ActionGroupPatchBodyMapper, + NotificationRequestBody as NotificationRequestBodyMapper, + EnableRequest as EnableRequestMapper, + MetricAlertResource as MetricAlertResourceMapper, + MetricAlertResourcePatch as MetricAlertResourcePatchMapper, + LogSearchRuleResource as LogSearchRuleResourceMapper, + LogSearchRuleResourcePatch as LogSearchRuleResourcePatchMapper, + AzureMonitorPrivateLinkScope as AzureMonitorPrivateLinkScopeMapper, + TagsResource as TagsResourceMapper, + PrivateEndpointConnection as PrivateEndpointConnectionMapper, + ScopedResource as ScopedResourceMapper, + ActivityLogAlertResource as ActivityLogAlertResourceMapper, + ActivityLogAlertPatchBody as ActivityLogAlertPatchBodyMapper, + DataCollectionEndpointResource as DataCollectionEndpointResourceMapper, + ResourceForUpdate as ResourceForUpdateMapper, + DataCollectionRuleAssociationProxyOnlyResource as DataCollectionRuleAssociationProxyOnlyResourceMapper, + DataCollectionRuleResource as DataCollectionRuleResourceMapper +} from "../models/mappers"; -export const acceptLanguage: msRest.OperationParameter = { - parameterPath: "acceptLanguage", +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { - serializedName: "accept-language", - defaultValue: 'en-US', + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", type: { name: "String" } } }; -export const actionGroupName: msRest.OperationURLParameter = { - parameterPath: "actionGroupName", + +export const $host: OperationURLParameter = { + parameterPath: "$host", mapper: { + serializedName: "$host", required: true, - serializedName: "actionGroupName", type: { name: "String" } - } + }, + skipEncoding: true }; -export const activityLogAlertName: msRest.OperationURLParameter = { - parameterPath: "activityLogAlertName", + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", mapper: { + constraints: { + MaxLength: 90, + MinLength: 1 + }, + serializedName: "resourceGroupName", required: true, - serializedName: "activityLogAlertName", type: { name: "String" } } }; -export const aggregation: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "aggregation" - ], + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - serializedName: "aggregation", + defaultValue: "2015-04-01", + isConstant: true, + serializedName: "api-version", type: { name: "String" } } }; -export const apiVersion0: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "subscriptionId", required: true, - isConstant: true, - serializedName: "api-version", - defaultValue: '2015-04-01', type: { name: "String" } } }; -export const apiVersion1: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { - required: true, + defaultValue: "application/json", isConstant: true, - serializedName: "api-version", - defaultValue: '2016-03-01', + serializedName: "Content-Type", type: { name: "String" } } }; -export const apiVersion10: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: AutoscaleSettingResourceMapper +}; + +export const autoscaleSettingName: OperationURLParameter = { + parameterPath: "autoscaleSettingName", mapper: { + serializedName: "autoscaleSettingName", required: true, - isConstant: true, - serializedName: "api-version", - defaultValue: '2017-12-01-preview', type: { name: "String" } } }; -export const apiVersion11: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const autoscaleSettingResource: OperationParameter = { + parameterPath: "autoscaleSettingResource", + mapper: AutoscaleSettingResourcePatchMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", mapper: { + serializedName: "nextLink", required: true, - isConstant: true, - serializedName: "api-version", - defaultValue: '2018-11-27-preview', type: { name: "String" } - } + }, + skipEncoding: true }; -export const apiVersion2: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const ruleName: OperationURLParameter = { + parameterPath: "ruleName", mapper: { + serializedName: "ruleName", required: true, - isConstant: true, - serializedName: "api-version", - defaultValue: '2017-05-01-preview', type: { name: "String" } } }; -export const apiVersion3: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const incidentName: OperationURLParameter = { + parameterPath: "incidentName", mapper: { + serializedName: "incidentName", required: true, - isConstant: true, - serializedName: "api-version", - defaultValue: '2019-06-01', type: { name: "String" } } }; -export const apiVersion4: msRest.OperationQueryParameter = { + +export const apiVersion1: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - required: true, + defaultValue: "2016-03-01", isConstant: true, serializedName: "api-version", - defaultValue: '2017-04-01', type: { name: "String" } } }; -export const apiVersion5: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const parameters1: OperationParameter = { + parameterPath: "parameters", + mapper: AlertRuleResourceMapper +}; + +export const alertRulesResource: OperationParameter = { + parameterPath: "alertRulesResource", + mapper: AlertRuleResourcePatchMapper +}; + +export const logProfileName: OperationURLParameter = { + parameterPath: "logProfileName", mapper: { + serializedName: "logProfileName", required: true, - isConstant: true, - serializedName: "api-version", - defaultValue: '2018-01-01', type: { name: "String" } } }; -export const apiVersion6: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const parameters2: OperationParameter = { + parameterPath: "parameters", + mapper: LogProfileResourceMapper +}; + +export const logProfilesResource: OperationParameter = { + parameterPath: "logProfilesResource", + mapper: LogProfileResourcePatchMapper +}; + +export const resourceUri: OperationURLParameter = { + parameterPath: "resourceUri", mapper: { + serializedName: "resourceUri", required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const apiVersion2: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2017-05-01-preview", isConstant: true, serializedName: "api-version", - defaultValue: '2017-11-01-preview', type: { name: "String" } } }; -export const apiVersion7: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const name: OperationURLParameter = { + parameterPath: "name", mapper: { + serializedName: "name", required: true, - isConstant: true, - serializedName: "api-version", - defaultValue: '2019-03-01', type: { name: "String" } } }; -export const apiVersion8: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const parameters3: OperationParameter = { + parameterPath: "parameters", + mapper: DiagnosticSettingsResourceMapper +}; + +export const actionGroup: OperationParameter = { + parameterPath: "actionGroup", + mapper: ActionGroupResourceMapper +}; + +export const actionGroupName: OperationURLParameter = { + parameterPath: "actionGroupName", mapper: { + serializedName: "actionGroupName", required: true, - isConstant: true, - serializedName: "api-version", - defaultValue: '2018-03-01', type: { name: "String" } } }; -export const apiVersion9: msRest.OperationQueryParameter = { + +export const apiVersion3: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - required: true, + defaultValue: "2021-09-01", isConstant: true, serializedName: "api-version", - defaultValue: '2018-04-16', type: { name: "String" } } }; -export const autoscaleSettingName: msRest.OperationURLParameter = { - parameterPath: "autoscaleSettingName", + +export const actionGroupPatch: OperationParameter = { + parameterPath: "actionGroupPatch", + mapper: ActionGroupPatchBodyMapper +}; + +export const notificationRequest: OperationParameter = { + parameterPath: "notificationRequest", + mapper: NotificationRequestBodyMapper +}; + +export const notificationId: OperationURLParameter = { + parameterPath: "notificationId", mapper: { + serializedName: "notificationId", required: true, - serializedName: "autoscaleSettingName", type: { name: "String" } } }; -export const filter0: msRest.OperationQueryParameter = { + +export const enableRequest: OperationParameter = { + parameterPath: "enableRequest", + mapper: EnableRequestMapper +}; + +export const filter: OperationQueryParameter = { parameterPath: "filter", mapper: { - required: true, serializedName: "$filter", + required: true, type: { name: "String" } } }; -export const filter1: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "filter" - ], + +export const select: OperationQueryParameter = { + parameterPath: ["options", "select"], + mapper: { + serializedName: "$select", + type: { + name: "String" + } + } +}; + +export const filter1: OperationQueryParameter = { + parameterPath: ["options", "filter"], mapper: { serializedName: "$filter", type: { @@ -228,21 +338,41 @@ export const filter1: msRest.OperationQueryParameter = { } } }; -export const incidentName: msRest.OperationURLParameter = { - parameterPath: "incidentName", + +export const apiVersion4: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - required: true, - serializedName: "incidentName", + defaultValue: "2018-01-01", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const metricnamespace: OperationQueryParameter = { + parameterPath: ["options", "metricnamespace"], + mapper: { + serializedName: "metricnamespace", + type: { + name: "String" + } + } +}; + +export const timespan: OperationQueryParameter = { + parameterPath: ["options", "timespan"], + mapper: { + serializedName: "timespan", type: { name: "String" } } }; -export const interval: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "interval" - ], + +export const interval: OperationQueryParameter = { + parameterPath: ["options", "interval"], mapper: { serializedName: "interval", type: { @@ -250,207 +380,354 @@ export const interval: msRest.OperationQueryParameter = { } } }; -export const logProfileName: msRest.OperationURLParameter = { - parameterPath: "logProfileName", + +export const metricnames: OperationQueryParameter = { + parameterPath: ["options", "metricnames"], mapper: { - required: true, - serializedName: "logProfileName", + serializedName: "metricnames", type: { name: "String" } } }; -export const metricName: msRest.OperationURLParameter = { - parameterPath: "metricName", + +export const aggregation: OperationQueryParameter = { + parameterPath: ["options", "aggregation"], mapper: { - required: true, - serializedName: "metricName", + serializedName: "aggregation", type: { name: "String" } } }; -export const metricnames: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "metricnames" - ], + +export const top: OperationQueryParameter = { + parameterPath: ["options", "top"], mapper: { - serializedName: "metricnames", + serializedName: "top", + type: { + name: "Number" + } + } +}; + +export const orderby: OperationQueryParameter = { + parameterPath: ["options", "orderby"], + mapper: { + serializedName: "orderby", type: { name: "String" } } }; -export const metricnamespace: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "metricnamespace" - ], + +export const resultType: OperationQueryParameter = { + parameterPath: ["options", "resultType"], mapper: { - serializedName: "metricnamespace", + serializedName: "resultType", + type: { + name: "Enum", + allowedValues: ["Data", "Metadata"] + } + } +}; + +export const sensitivities: OperationQueryParameter = { + parameterPath: ["options", "sensitivities"], + mapper: { + serializedName: "sensitivities", type: { name: "String" } } }; -export const name: msRest.OperationURLParameter = { - parameterPath: "name", + +export const apiVersion5: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - required: true, - serializedName: "name", + defaultValue: "2019-03-01", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const apiVersion6: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2018-03-01", + isConstant: true, + serializedName: "api-version", type: { name: "String" } } }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", + +export const parameters4: OperationParameter = { + parameterPath: "parameters", + mapper: MetricAlertResourceMapper +}; + +export const parameters5: OperationParameter = { + parameterPath: "parameters", + mapper: MetricAlertResourcePatchMapper +}; + +export const statusName: OperationURLParameter = { + parameterPath: "statusName", mapper: { + serializedName: "statusName", required: true, - serializedName: "nextLink", type: { name: "String" } - }, - skipEncoding: true + } +}; + +export const parameters6: OperationParameter = { + parameterPath: "parameters", + mapper: LogSearchRuleResourceMapper }; -export const orderby: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "orderby" - ], + +export const apiVersion7: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - serializedName: "orderby", + defaultValue: "2018-04-16", + isConstant: true, + serializedName: "api-version", type: { name: "String" } } }; -export const resourceGroupName: msRest.OperationURLParameter = { - parameterPath: "resourceGroupName", + +export const parameters7: OperationParameter = { + parameterPath: "parameters", + mapper: LogSearchRuleResourcePatchMapper +}; + +export const apiVersion8: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2017-12-01-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const startTime: OperationQueryParameter = { + parameterPath: ["options", "startTime"], + mapper: { + serializedName: "startTime", + type: { + name: "String" + } + } +}; + +export const apiVersion9: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2018-11-27-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const apiVersion10: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { + defaultValue: "2019-10-17-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const scopeName: OperationURLParameter = { + parameterPath: "scopeName", + mapper: { + serializedName: "scopeName", required: true, - serializedName: "resourceGroupName", type: { name: "String" } } }; -export const resourceUri: msRest.OperationURLParameter = { - parameterPath: "resourceUri", + +export const azureMonitorPrivateLinkScopePayload: OperationParameter = { + parameterPath: "azureMonitorPrivateLinkScopePayload", + mapper: AzureMonitorPrivateLinkScopeMapper +}; + +export const privateLinkScopeTags: OperationParameter = { + parameterPath: "privateLinkScopeTags", + mapper: TagsResourceMapper +}; + +export const asyncOperationId: OperationURLParameter = { + parameterPath: "asyncOperationId", mapper: { + serializedName: "asyncOperationId", required: true, - serializedName: "resourceUri", type: { name: "String" } - }, - skipEncoding: true + } }; -export const resultType: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "resultType" - ], + +export const groupName: OperationURLParameter = { + parameterPath: "groupName", mapper: { - serializedName: "resultType", + serializedName: "groupName", + required: true, type: { - name: "Enum", - allowedValues: [ - "Data", - "Metadata" - ] + name: "String" } } }; -export const ruleName: msRest.OperationURLParameter = { - parameterPath: "ruleName", + +export const privateEndpointConnectionName: OperationURLParameter = { + parameterPath: "privateEndpointConnectionName", mapper: { + serializedName: "privateEndpointConnectionName", required: true, - serializedName: "ruleName", type: { name: "String" } } }; -export const select: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "select" - ], + +export const parameters8: OperationParameter = { + parameterPath: "parameters", + mapper: PrivateEndpointConnectionMapper +}; + +export const parameters9: OperationParameter = { + parameterPath: "parameters", + mapper: ScopedResourceMapper +}; + +export const activityLogAlert: OperationParameter = { + parameterPath: "activityLogAlert", + mapper: ActivityLogAlertResourceMapper +}; + +export const activityLogAlertName: OperationURLParameter = { + parameterPath: "activityLogAlertName", mapper: { - serializedName: "$select", + serializedName: "activityLogAlertName", + required: true, type: { name: "String" } } }; -export const sensitivities: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "sensitivities" - ], + +export const apiVersion11: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - serializedName: "sensitivities", + defaultValue: "2017-04-01", + isConstant: true, + serializedName: "api-version", type: { name: "String" } } }; -export const startTime: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "startTime" - ], + +export const activityLogAlertPatch: OperationParameter = { + parameterPath: "activityLogAlertPatch", + mapper: ActivityLogAlertPatchBodyMapper +}; + +export const apiVersion12: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - serializedName: "startTime", + defaultValue: "2021-04-01", + isConstant: true, + serializedName: "api-version", type: { name: "String" } } }; -export const statusName: msRest.OperationURLParameter = { - parameterPath: "statusName", + +export const dataCollectionEndpointName: OperationURLParameter = { + parameterPath: "dataCollectionEndpointName", mapper: { + serializedName: "dataCollectionEndpointName", required: true, - serializedName: "statusName", type: { name: "String" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const body: OperationParameter = { + parameterPath: ["options", "body"], + mapper: DataCollectionEndpointResourceMapper +}; + +export const body1: OperationParameter = { + parameterPath: ["options", "body"], + mapper: ResourceForUpdateMapper +}; + +export const resourceUri1: OperationURLParameter = { + parameterPath: "resourceUri", mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "resourceUri", required: true, - serializedName: "subscriptionId", type: { name: "String" } - } + }, + skipEncoding: true }; -export const timespan: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "timespan" - ], + +export const dataCollectionRuleName: OperationURLParameter = { + parameterPath: "dataCollectionRuleName", mapper: { - serializedName: "timespan", + serializedName: "dataCollectionRuleName", + required: true, type: { name: "String" } } }; -export const top: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "top" - ], + +export const associationName: OperationURLParameter = { + parameterPath: "associationName", mapper: { - serializedName: "top", + serializedName: "associationName", + required: true, type: { - name: "Number" + name: "String" } } }; + +export const body2: OperationParameter = { + parameterPath: ["options", "body"], + mapper: DataCollectionRuleAssociationProxyOnlyResourceMapper +}; + +export const body3: OperationParameter = { + parameterPath: ["options", "body"], + mapper: DataCollectionRuleResourceMapper +}; diff --git a/sdk/monitor/arm-monitor/src/models/scheduledQueryRulesMappers.ts b/sdk/monitor/arm-monitor/src/models/scheduledQueryRulesMappers.ts deleted file mode 100644 index 0fffe5f5617c..000000000000 --- a/sdk/monitor/arm-monitor/src/models/scheduledQueryRulesMappers.ts +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - Action, - ActionGroupResource, - ActivityLogAlertActionGroup, - ActivityLogAlertActionList, - ActivityLogAlertAllOfCondition, - ActivityLogAlertLeafCondition, - ActivityLogAlertResource, - AlertingAction, - AlertRuleResource, - ArmRoleReceiver, - AutomationRunbookReceiver, - AutoscaleNotification, - AutoscaleProfile, - AutoscaleSettingResource, - AzNsActionGroup, - AzureAppPushReceiver, - AzureFunctionReceiver, - BaseResource, - Criteria, - DataContainer, - DiagnosticSettingsCategoryResource, - DiagnosticSettingsResource, - Dimension, - DynamicMetricCriteria, - DynamicThresholdFailingPeriods, - EmailNotification, - EmailReceiver, - ErrorResponse, - ItsmReceiver, - LocationThresholdRuleCondition, - LogicAppReceiver, - LogMetricTrigger, - LogProfileResource, - LogSearchRuleResource, - LogSearchRuleResourceCollection, - LogSearchRuleResourcePatch, - LogSettings, - LogToMetricAction, - ManagementEventAggregationCondition, - ManagementEventRuleCondition, - MetricAlertAction, - MetricAlertCriteria, - MetricAlertMultipleResourceMultipleMetricCriteria, - MetricAlertResource, - MetricAlertSingleResourceMultipleMetricCriteria, - MetricCriteria, - MetricDimension, - MetricSettings, - MetricTrigger, - MultiMetricCriteria, - ProxyOnlyResource, - ProxyResource, - Recurrence, - RecurrentSchedule, - Resource, - RetentionPolicy, - RuleAction, - RuleCondition, - RuleDataSource, - RuleEmailAction, - RuleManagementEventClaimsDataSource, - RuleManagementEventDataSource, - RuleMetricDataSource, - RuleWebhookAction, - ScaleAction, - ScaleCapacity, - ScaleRule, - Schedule, - SmsReceiver, - Source, - ThresholdRuleCondition, - TimeWindow, - TriggerCondition, - VMInsightsOnboardingStatus, - VoiceReceiver, - WebhookNotification, - WebhookReceiver, - WorkspaceInfo -} from "../models/mappers"; diff --git a/sdk/monitor/arm-monitor/src/models/tenantActivityLogsMappers.ts b/sdk/monitor/arm-monitor/src/models/tenantActivityLogsMappers.ts deleted file mode 100644 index 80edb96348be..000000000000 --- a/sdk/monitor/arm-monitor/src/models/tenantActivityLogsMappers.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - ErrorResponse, - EventData, - EventDataCollection, - HttpRequestInfo, - LocalizableString, - SenderAuthorization -} from "../models/mappers"; diff --git a/sdk/monitor/arm-monitor/src/models/vMInsightsMappers.ts b/sdk/monitor/arm-monitor/src/models/vMInsightsMappers.ts deleted file mode 100644 index 3e0639f45f11..000000000000 --- a/sdk/monitor/arm-monitor/src/models/vMInsightsMappers.ts +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - Action, - ActionGroupResource, - ActivityLogAlertActionGroup, - ActivityLogAlertActionList, - ActivityLogAlertAllOfCondition, - ActivityLogAlertLeafCondition, - ActivityLogAlertResource, - AlertingAction, - AlertRuleResource, - ArmRoleReceiver, - AutomationRunbookReceiver, - AutoscaleNotification, - AutoscaleProfile, - AutoscaleSettingResource, - AzNsActionGroup, - AzureAppPushReceiver, - AzureFunctionReceiver, - BaseResource, - Criteria, - DataContainer, - DiagnosticSettingsCategoryResource, - DiagnosticSettingsResource, - Dimension, - DynamicMetricCriteria, - DynamicThresholdFailingPeriods, - EmailNotification, - EmailReceiver, - ErrorModel, - ItsmReceiver, - LocationThresholdRuleCondition, - LogicAppReceiver, - LogMetricTrigger, - LogProfileResource, - LogSearchRuleResource, - LogSettings, - LogToMetricAction, - ManagementEventAggregationCondition, - ManagementEventRuleCondition, - MetricAlertAction, - MetricAlertCriteria, - MetricAlertMultipleResourceMultipleMetricCriteria, - MetricAlertResource, - MetricAlertSingleResourceMultipleMetricCriteria, - MetricCriteria, - MetricDimension, - MetricSettings, - MetricTrigger, - MultiMetricCriteria, - ProxyOnlyResource, - ProxyResource, - Recurrence, - RecurrentSchedule, - Resource, - ResponseWithError, - RetentionPolicy, - RuleAction, - RuleCondition, - RuleDataSource, - RuleEmailAction, - RuleManagementEventClaimsDataSource, - RuleManagementEventDataSource, - RuleMetricDataSource, - RuleWebhookAction, - ScaleAction, - ScaleCapacity, - ScaleRule, - Schedule, - SmsReceiver, - Source, - ThresholdRuleCondition, - TimeWindow, - TriggerCondition, - VMInsightsOnboardingStatus, - VoiceReceiver, - WebhookNotification, - WebhookReceiver, - WorkspaceInfo -} from "../models/mappers"; diff --git a/sdk/monitor/arm-monitor/src/monitorClient.ts b/sdk/monitor/arm-monitor/src/monitorClient.ts new file mode 100644 index 000000000000..c92658474bdb --- /dev/null +++ b/sdk/monitor/arm-monitor/src/monitorClient.ts @@ -0,0 +1,189 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + AutoscaleSettingsImpl, + OperationsImpl, + AlertRuleIncidentsImpl, + AlertRulesImpl, + LogProfilesImpl, + DiagnosticSettingsImpl, + DiagnosticSettingsCategoryImpl, + ActionGroupsImpl, + ActivityLogsImpl, + EventCategoriesImpl, + TenantActivityLogsImpl, + MetricDefinitionsImpl, + MetricsImpl, + BaselinesImpl, + MetricAlertsImpl, + MetricAlertsStatusImpl, + ScheduledQueryRulesImpl, + MetricNamespacesImpl, + VMInsightsImpl, + PrivateLinkScopesImpl, + PrivateLinkScopeOperationStatusImpl, + PrivateLinkResourcesImpl, + PrivateEndpointConnectionsImpl, + PrivateLinkScopedResourcesImpl, + ActivityLogAlertsImpl, + DataCollectionEndpointsImpl, + DataCollectionRuleAssociationsImpl, + DataCollectionRulesImpl +} from "./operations"; +import { + AutoscaleSettings, + Operations, + AlertRuleIncidents, + AlertRules, + LogProfiles, + DiagnosticSettings, + DiagnosticSettingsCategory, + ActionGroups, + ActivityLogs, + EventCategories, + TenantActivityLogs, + MetricDefinitions, + Metrics, + Baselines, + MetricAlerts, + MetricAlertsStatus, + ScheduledQueryRules, + MetricNamespaces, + VMInsights, + PrivateLinkScopes, + PrivateLinkScopeOperationStatus, + PrivateLinkResources, + PrivateEndpointConnections, + PrivateLinkScopedResources, + ActivityLogAlerts, + DataCollectionEndpoints, + DataCollectionRuleAssociations, + DataCollectionRules +} from "./operationsInterfaces"; +import { MonitorClientOptionalParams } from "./models"; + +export class MonitorClient extends coreClient.ServiceClient { + $host: string; + subscriptionId: string; + + /** + * Initializes a new instance of the MonitorClient class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The ID of the target subscription. + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: MonitorClientOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: MonitorClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-monitor/7.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.autoscaleSettings = new AutoscaleSettingsImpl(this); + this.operations = new OperationsImpl(this); + this.alertRuleIncidents = new AlertRuleIncidentsImpl(this); + this.alertRules = new AlertRulesImpl(this); + this.logProfiles = new LogProfilesImpl(this); + this.diagnosticSettings = new DiagnosticSettingsImpl(this); + this.diagnosticSettingsCategory = new DiagnosticSettingsCategoryImpl(this); + this.actionGroups = new ActionGroupsImpl(this); + this.activityLogs = new ActivityLogsImpl(this); + this.eventCategories = new EventCategoriesImpl(this); + this.tenantActivityLogs = new TenantActivityLogsImpl(this); + this.metricDefinitions = new MetricDefinitionsImpl(this); + this.metrics = new MetricsImpl(this); + this.baselines = new BaselinesImpl(this); + this.metricAlerts = new MetricAlertsImpl(this); + this.metricAlertsStatus = new MetricAlertsStatusImpl(this); + this.scheduledQueryRules = new ScheduledQueryRulesImpl(this); + this.metricNamespaces = new MetricNamespacesImpl(this); + this.vMInsights = new VMInsightsImpl(this); + this.privateLinkScopes = new PrivateLinkScopesImpl(this); + this.privateLinkScopeOperationStatus = new PrivateLinkScopeOperationStatusImpl( + this + ); + this.privateLinkResources = new PrivateLinkResourcesImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); + this.privateLinkScopedResources = new PrivateLinkScopedResourcesImpl(this); + this.activityLogAlerts = new ActivityLogAlertsImpl(this); + this.dataCollectionEndpoints = new DataCollectionEndpointsImpl(this); + this.dataCollectionRuleAssociations = new DataCollectionRuleAssociationsImpl( + this + ); + this.dataCollectionRules = new DataCollectionRulesImpl(this); + } + + autoscaleSettings: AutoscaleSettings; + operations: Operations; + alertRuleIncidents: AlertRuleIncidents; + alertRules: AlertRules; + logProfiles: LogProfiles; + diagnosticSettings: DiagnosticSettings; + diagnosticSettingsCategory: DiagnosticSettingsCategory; + actionGroups: ActionGroups; + activityLogs: ActivityLogs; + eventCategories: EventCategories; + tenantActivityLogs: TenantActivityLogs; + metricDefinitions: MetricDefinitions; + metrics: Metrics; + baselines: Baselines; + metricAlerts: MetricAlerts; + metricAlertsStatus: MetricAlertsStatus; + scheduledQueryRules: ScheduledQueryRules; + metricNamespaces: MetricNamespaces; + vMInsights: VMInsights; + privateLinkScopes: PrivateLinkScopes; + privateLinkScopeOperationStatus: PrivateLinkScopeOperationStatus; + privateLinkResources: PrivateLinkResources; + privateEndpointConnections: PrivateEndpointConnections; + privateLinkScopedResources: PrivateLinkScopedResources; + activityLogAlerts: ActivityLogAlerts; + dataCollectionEndpoints: DataCollectionEndpoints; + dataCollectionRuleAssociations: DataCollectionRuleAssociations; + dataCollectionRules: DataCollectionRules; +} diff --git a/sdk/monitor/arm-monitor/src/monitorManagementClient.ts b/sdk/monitor/arm-monitor/src/monitorManagementClient.ts deleted file mode 100644 index a498d7b03d34..000000000000 --- a/sdk/monitor/arm-monitor/src/monitorManagementClient.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { MonitorManagementClientContext } from "./monitorManagementClientContext"; - - -class MonitorManagementClient extends MonitorManagementClientContext { - // Operation groups - autoscaleSettings: operations.AutoscaleSettings; - operations: operations.Operations; - alertRuleIncidents: operations.AlertRuleIncidents; - alertRules: operations.AlertRules; - logProfiles: operations.LogProfiles; - diagnosticSettings: operations.DiagnosticSettingsOperations; - diagnosticSettingsCategory: operations.DiagnosticSettingsCategoryOperations; - actionGroups: operations.ActionGroups; - activityLogAlerts: operations.ActivityLogAlerts; - activityLogs: operations.ActivityLogs; - eventCategories: operations.EventCategories; - tenantActivityLogs: operations.TenantActivityLogs; - metricDefinitions: operations.MetricDefinitions; - metrics: operations.Metrics; - metricBaseline: operations.MetricBaseline; - baselines: operations.Baselines; - metricAlerts: operations.MetricAlerts; - metricAlertsStatus: operations.MetricAlertsStatus; - scheduledQueryRules: operations.ScheduledQueryRules; - metricNamespaces: operations.MetricNamespaces; - vMInsights: operations.VMInsights; - - /** - * Initializes a new instance of the MonitorManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId The Azure subscription Id. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.MonitorManagementClientOptions) { - super(credentials, subscriptionId, options); - this.autoscaleSettings = new operations.AutoscaleSettings(this); - this.operations = new operations.Operations(this); - this.alertRuleIncidents = new operations.AlertRuleIncidents(this); - this.alertRules = new operations.AlertRules(this); - this.logProfiles = new operations.LogProfiles(this); - this.diagnosticSettings = new operations.DiagnosticSettingsOperations(this); - this.diagnosticSettingsCategory = new operations.DiagnosticSettingsCategoryOperations(this); - this.actionGroups = new operations.ActionGroups(this); - this.activityLogAlerts = new operations.ActivityLogAlerts(this); - this.activityLogs = new operations.ActivityLogs(this); - this.eventCategories = new operations.EventCategories(this); - this.tenantActivityLogs = new operations.TenantActivityLogs(this); - this.metricDefinitions = new operations.MetricDefinitions(this); - this.metrics = new operations.Metrics(this); - this.metricBaseline = new operations.MetricBaseline(this); - this.baselines = new operations.Baselines(this); - this.metricAlerts = new operations.MetricAlerts(this); - this.metricAlertsStatus = new operations.MetricAlertsStatus(this); - this.scheduledQueryRules = new operations.ScheduledQueryRules(this); - this.metricNamespaces = new operations.MetricNamespaces(this); - this.vMInsights = new operations.VMInsights(this); - } -} - -// Operation Specifications - -export { - MonitorManagementClient, - MonitorManagementClientContext, - Models as MonitorManagementModels, - Mappers as MonitorManagementMappers -}; -export * from "./operations"; diff --git a/sdk/monitor/arm-monitor/src/monitorManagementClientContext.ts b/sdk/monitor/arm-monitor/src/monitorManagementClientContext.ts deleted file mode 100644 index aacdc007667d..000000000000 --- a/sdk/monitor/arm-monitor/src/monitorManagementClientContext.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-monitor"; -const packageVersion = "5.4.0"; - -export class MonitorManagementClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials; - subscriptionId: string; - - /** - * Initializes a new instance of the MonitorManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId The Azure subscription Id. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.MonitorManagementClientOptions) { - if (credentials == undefined) { - throw new Error('\'credentials\' cannot be null.'); - } - if (subscriptionId == undefined) { - throw new Error('\'subscriptionId\' cannot be null.'); - } - - if (!options) { - options = {}; - } - if(!options.userAgent) { - const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); - options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; - } - - super(credentials, options); - - this.acceptLanguage = 'en-US'; - this.longRunningOperationRetryTimeout = 30; - this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; - this.requestContentType = "application/json; charset=utf-8"; - this.credentials = credentials; - this.subscriptionId = subscriptionId; - - if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { - this.acceptLanguage = options.acceptLanguage; - } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { - this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; - } - } -} diff --git a/sdk/monitor/arm-monitor/src/operations/actionGroups.ts b/sdk/monitor/arm-monitor/src/operations/actionGroups.ts index f0d61a682139..7f7ac81ef4fb 100644 --- a/sdk/monitor/arm-monitor/src/operations/actionGroups.ts +++ b/sdk/monitor/arm-monitor/src/operations/actionGroups.ts @@ -1,280 +1,357 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/actionGroupsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { ActionGroups } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MonitorManagementClientContext } from "../monitorManagementClientContext"; +import { MonitorClient } from "../monitorClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + ActionGroupResource, + ActionGroupsListBySubscriptionIdOptionalParams, + ActionGroupsListByResourceGroupOptionalParams, + ActionGroupsCreateOrUpdateOptionalParams, + ActionGroupsCreateOrUpdateResponse, + ActionGroupsGetOptionalParams, + ActionGroupsGetResponse, + ActionGroupsDeleteOptionalParams, + ActionGroupPatchBody, + ActionGroupsUpdateOptionalParams, + ActionGroupsUpdateResponse, + NotificationRequestBody, + ActionGroupsPostTestNotificationsOptionalParams, + ActionGroupsPostTestNotificationsResponse, + ActionGroupsGetTestNotificationsOptionalParams, + ActionGroupsGetTestNotificationsResponse, + ActionGroupsListBySubscriptionIdResponse, + ActionGroupsListByResourceGroupResponse, + EnableRequest, + ActionGroupsEnableReceiverOptionalParams +} from "../models"; -/** Class representing a ActionGroups. */ -export class ActionGroups { - private readonly client: MonitorManagementClientContext; +/// +/** Class containing ActionGroups operations. */ +export class ActionGroupsImpl implements ActionGroups { + private readonly client: MonitorClient; /** - * Create a ActionGroups. - * @param {MonitorManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class ActionGroups class. + * @param client Reference to the service client */ - constructor(client: MonitorManagementClientContext) { + constructor(client: MonitorClient) { this.client = client; } /** - * Create a new action group or update an existing one. - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param actionGroup The action group to create or use for the update. - * @param [options] The optional parameters - * @returns Promise + * Get a list of all action groups in a subscription. + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, actionGroupName: string, actionGroup: Models.ActionGroupResource, options?: msRest.RequestOptionsBase): Promise; + public listBySubscriptionId( + options?: ActionGroupsListBySubscriptionIdOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionIdPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionIdPagingPage(options); + } + }; + } + + private async *listBySubscriptionIdPagingPage( + options?: ActionGroupsListBySubscriptionIdOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscriptionId(options); + yield result.value || []; + } + + private async *listBySubscriptionIdPagingAll( + options?: ActionGroupsListBySubscriptionIdOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionIdPagingPage(options)) { + yield* page; + } + } + /** - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param actionGroup The action group to create or use for the update. - * @param callback The callback + * Get a list of all action groups in a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, actionGroupName: string, actionGroup: Models.ActionGroupResource, callback: msRest.ServiceCallback): void; + public listByResourceGroup( + resourceGroupName: string, + options?: ActionGroupsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: ActionGroupsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: ActionGroupsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + /** - * @param resourceGroupName The name of the resource group. + * Create a new action group or update an existing one. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param actionGroupName The name of the action group. * @param actionGroup The action group to create or use for the update. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, actionGroupName: string, actionGroup: Models.ActionGroupResource, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, actionGroupName: string, actionGroup: Models.ActionGroupResource, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + resourceGroupName: string, + actionGroupName: string, + actionGroup: ActionGroupResource, + options?: ActionGroupsCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - actionGroupName, - actionGroup, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; + { resourceGroupName, actionGroupName, actionGroup, options }, + createOrUpdateOperationSpec + ); } /** * Get an action group. - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, actionGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param callback The callback - */ - get(resourceGroupName: string, actionGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param actionGroupName The name of the action group. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, actionGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, actionGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + actionGroupName: string, + options?: ActionGroupsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - actionGroupName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, actionGroupName, options }, + getOperationSpec + ); } /** * Delete an action group. - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, actionGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param actionGroupName The name of the action group. - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, actionGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, actionGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, actionGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + actionGroupName: string, + options?: ActionGroupsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - actionGroupName, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, actionGroupName, options }, + deleteOperationSpec + ); } /** * Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param actionGroupPatch Parameters supplied to the operation. - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, actionGroupName: string, actionGroupPatch: Models.ActionGroupPatchBody, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param actionGroupPatch Parameters supplied to the operation. - * @param callback The callback - */ - update(resourceGroupName: string, actionGroupName: string, actionGroupPatch: Models.ActionGroupPatchBody, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param actionGroupName The name of the action group. * @param actionGroupPatch Parameters supplied to the operation. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - update(resourceGroupName: string, actionGroupName: string, actionGroupPatch: Models.ActionGroupPatchBody, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, actionGroupName: string, actionGroupPatch: Models.ActionGroupPatchBody, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + resourceGroupName: string, + actionGroupName: string, + actionGroupPatch: ActionGroupPatchBody, + options?: ActionGroupsUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - actionGroupName, - actionGroupPatch, - options - }, - updateOperationSpec, - callback) as Promise; + { resourceGroupName, actionGroupName, actionGroupPatch, options }, + updateOperationSpec + ); } /** - * Get a list of all action groups in a subscription. - * @param [options] The optional parameters - * @returns 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. */ - listBySubscriptionId(options?: msRest.RequestOptionsBase): Promise; + async beginPostTestNotifications( + notificationRequest: NotificationRequestBody, + options?: ActionGroupsPostTestNotificationsOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ActionGroupsPostTestNotificationsResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = 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 = new LroImpl( + sendOperation, + { notificationRequest, options }, + postTestNotificationsOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + } + /** - * @param callback The callback + * 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. */ - listBySubscriptionId(callback: msRest.ServiceCallback): void; + async beginPostTestNotificationsAndWait( + notificationRequest: NotificationRequestBody, + options?: ActionGroupsPostTestNotificationsOptionalParams + ): Promise { + const poller = await this.beginPostTestNotifications( + notificationRequest, + options + ); + return poller.pollUntilDone(); + } + /** - * @param options The optional parameters - * @param callback The callback + * Get the test notifications by the notification id + * @param notificationId The notification id + * @param options The options parameters. */ - listBySubscriptionId(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listBySubscriptionId(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getTestNotifications( + notificationId: string, + options?: ActionGroupsGetTestNotificationsOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - options - }, - listBySubscriptionIdOperationSpec, - callback) as Promise; + { notificationId, options }, + getTestNotificationsOperationSpec + ); } /** - * Get a list of all action groups in a resource group. - * @param resourceGroupName The name of the resource group. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param options The optional parameters - * @param callback The callback + * Get a list of all action groups in a subscription. + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listBySubscriptionId( + options?: ActionGroupsListBySubscriptionIdOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - listByResourceGroupOperationSpec, - callback) as Promise; + { options }, + listBySubscriptionIdOperationSpec + ); } /** - * 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. - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param receiverName The name of the receiver to resubscribe. - * @param [options] The optional parameters - * @returns Promise - */ - enableReceiver(resourceGroupName: string, actionGroupName: string, receiverName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param actionGroupName The name of the action group. - * @param receiverName The name of the receiver to resubscribe. - * @param callback The callback + * Get a list of all action groups in a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. */ - enableReceiver(resourceGroupName: string, actionGroupName: string, receiverName: string, callback: msRest.ServiceCallback): void; + private _listByResourceGroup( + resourceGroupName: string, + options?: ActionGroupsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + /** - * @param resourceGroupName The name of the resource group. + * 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. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param actionGroupName The name of the action group. - * @param receiverName The name of the receiver to resubscribe. - * @param options The optional parameters - * @param callback The callback + * @param enableRequest The receiver to re-enable. + * @param options The options parameters. */ - enableReceiver(resourceGroupName: string, actionGroupName: string, receiverName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - enableReceiver(resourceGroupName: string, actionGroupName: string, receiverName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + enableReceiver( + resourceGroupName: string, + actionGroupName: string, + enableRequest: EnableRequest, + options?: ActionGroupsEnableReceiverOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - actionGroupName, - receiverName, - options - }, - enableReceiverOperationSpec, - callback); + { resourceGroupName, actionGroupName, enableRequest, options }, + enableReceiverOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const createOrUpdateOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/actionGroups/{actionGroupName}", httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups/{actionGroupName}", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.actionGroupName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion3 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "actionGroup", - mapper: { - ...Mappers.ActionGroupResource, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.ActionGroupResource @@ -286,23 +363,22 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups/{actionGroupName}", + requestBody: Parameters.actionGroup, + queryParameters: [Parameters.apiVersion3], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, - Parameters.actionGroupName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion3 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.subscriptionId, + Parameters.actionGroupName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/actionGroups/{actionGroupName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ActionGroupResource @@ -311,23 +387,20 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups/{actionGroupName}", + queryParameters: [Parameters.apiVersion3], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, - Parameters.actionGroupName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion3 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.subscriptionId, + Parameters.actionGroupName ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/actionGroups/{actionGroupName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, @@ -335,53 +408,93 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion3], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.actionGroupName + ], + headerParameters: [Parameters.accept], serializer }; - -const updateOperationSpec: msRest.OperationSpec = { +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/actionGroups/{actionGroupName}", httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups/{actionGroupName}", + responses: { + 200: { + bodyMapper: Mappers.ActionGroupResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.actionGroupPatch, + queryParameters: [Parameters.apiVersion3], urlParameters: [ - Parameters.subscriptionId, + Parameters.$host, Parameters.resourceGroupName, + Parameters.subscriptionId, Parameters.actionGroupName ], - queryParameters: [ - Parameters.apiVersion3 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "actionGroupPatch", - mapper: { - ...Mappers.ActionGroupPatchBody, - required: true - } - }, + 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.ActionGroupResource + bodyMapper: Mappers.TestNotificationResponse + }, + 201: { + bodyMapper: Mappers.TestNotificationResponse + }, + 202: { + bodyMapper: Mappers.TestNotificationResponse + }, + 204: { + bodyMapper: Mappers.TestNotificationResponse }, default: { bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.notificationRequest, + queryParameters: [Parameters.apiVersion3], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listBySubscriptionIdOperationSpec: msRest.OperationSpec = { +const getTestNotificationsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/notificationStatus/{notificationId}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/microsoft.insights/actionGroups", + responses: { + 200: { + bodyMapper: Mappers.TestNotificationDetailsResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion3], urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion3 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.$host, + Parameters.subscriptionId, + Parameters.notificationId ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionIdOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/actionGroups", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ActionGroupList @@ -390,22 +503,15 @@ const listBySubscriptionIdOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion3], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/actionGroups", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion3 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ActionGroupList @@ -414,38 +520,37 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const enableReceiverOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups/{actionGroupName}/subscribe", + queryParameters: [Parameters.apiVersion3], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, - Parameters.actionGroupName, Parameters.subscriptionId ], - queryParameters: [ - Parameters.apiVersion3 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: { - receiverName: "receiverName" - }, - mapper: { - ...Mappers.EnableRequest, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const enableReceiverOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/actionGroups/{actionGroupName}/subscribe", + httpMethod: "POST", responses: { 200: {}, - 409: {}, + 409: { + isError: true + }, default: { bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.enableRequest, + queryParameters: [Parameters.apiVersion3], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.actionGroupName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; diff --git a/sdk/monitor/arm-monitor/src/operations/activityLogAlerts.ts b/sdk/monitor/arm-monitor/src/operations/activityLogAlerts.ts index 257a6277a91e..d8ea0ff086d6 100644 --- a/sdk/monitor/arm-monitor/src/operations/activityLogAlerts.ts +++ b/sdk/monitor/arm-monitor/src/operations/activityLogAlerts.ts @@ -1,157 +1,192 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/activityLogAlertsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { ActivityLogAlerts } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MonitorManagementClientContext } from "../monitorManagementClientContext"; +import { MonitorClient } from "../monitorClient"; +import { + ActivityLogAlertResource, + ActivityLogAlertsListBySubscriptionIdOptionalParams, + ActivityLogAlertsListByResourceGroupOptionalParams, + ActivityLogAlertsCreateOrUpdateOptionalParams, + ActivityLogAlertsCreateOrUpdateResponse, + ActivityLogAlertsGetOptionalParams, + ActivityLogAlertsGetResponse, + ActivityLogAlertsDeleteOptionalParams, + ActivityLogAlertPatchBody, + ActivityLogAlertsUpdateOptionalParams, + ActivityLogAlertsUpdateResponse, + ActivityLogAlertsListBySubscriptionIdResponse, + ActivityLogAlertsListByResourceGroupResponse +} from "../models"; -/** Class representing a ActivityLogAlerts. */ -export class ActivityLogAlerts { - private readonly client: MonitorManagementClientContext; +/// +/** Class containing ActivityLogAlerts operations. */ +export class ActivityLogAlertsImpl implements ActivityLogAlerts { + private readonly client: MonitorClient; /** - * Create a ActivityLogAlerts. - * @param {MonitorManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class ActivityLogAlerts class. + * @param client Reference to the service client */ - constructor(client: MonitorManagementClientContext) { + constructor(client: MonitorClient) { this.client = client; } /** - * Create a new activity log alert or update an existing one. - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlert The activity log alert to create or use for the update. - * @param [options] The optional parameters - * @returns Promise + * Get a list of all activity log alerts in a subscription. + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, activityLogAlertName: string, activityLogAlert: Models.ActivityLogAlertResource, options?: msRest.RequestOptionsBase): Promise; + public listBySubscriptionId( + options?: ActivityLogAlertsListBySubscriptionIdOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionIdPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionIdPagingPage(options); + } + }; + } + + private async *listBySubscriptionIdPagingPage( + options?: ActivityLogAlertsListBySubscriptionIdOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscriptionId(options); + yield result.value || []; + } + + private async *listBySubscriptionIdPagingAll( + options?: ActivityLogAlertsListBySubscriptionIdOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionIdPagingPage(options)) { + yield* page; + } + } + /** - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlert The activity log alert to create or use for the update. - * @param callback The callback + * Get a list of all activity log alerts in a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, activityLogAlertName: string, activityLogAlert: Models.ActivityLogAlertResource, callback: msRest.ServiceCallback): void; + public listByResourceGroup( + resourceGroupName: string, + options?: ActivityLogAlertsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: ActivityLogAlertsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: ActivityLogAlertsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + /** - * @param resourceGroupName The name of the resource group. + * Create a new activity log alert or update an existing one. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param activityLogAlertName The name of the activity log alert. * @param activityLogAlert The activity log alert to create or use for the update. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, activityLogAlertName: string, activityLogAlert: Models.ActivityLogAlertResource, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, activityLogAlertName: string, activityLogAlert: Models.ActivityLogAlertResource, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + resourceGroupName: string, + activityLogAlertName: string, + activityLogAlert: ActivityLogAlertResource, + options?: ActivityLogAlertsCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - activityLogAlertName, - activityLogAlert, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; + { resourceGroupName, activityLogAlertName, activityLogAlert, options }, + createOrUpdateOperationSpec + ); } /** * Get an activity log alert. - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, activityLogAlertName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param callback The callback - */ - get(resourceGroupName: string, activityLogAlertName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param activityLogAlertName The name of the activity log alert. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, activityLogAlertName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, activityLogAlertName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + activityLogAlertName: string, + options?: ActivityLogAlertsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - activityLogAlertName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, activityLogAlertName, options }, + getOperationSpec + ); } /** * Delete an activity log alert. - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, activityLogAlertName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param activityLogAlertName The name of the activity log alert. - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, activityLogAlertName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, activityLogAlertName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, activityLogAlertName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + activityLogAlertName: string, + options?: ActivityLogAlertsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - activityLogAlertName, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, activityLogAlertName, options }, + deleteOperationSpec + ); } /** - * Updates an existing ActivityLogAlertResource's tags. To update other fields use the - * CreateOrUpdate method. - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlertPatch Parameters supplied to the operation. - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, activityLogAlertName: string, activityLogAlertPatch: Models.ActivityLogAlertPatchBody, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. + * Updates an existing ActivityLogAlertResource's tags. To update other fields use the CreateOrUpdate + * method. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param activityLogAlertName The name of the activity log alert. * @param activityLogAlertPatch Parameters supplied to the operation. - * @param callback The callback + * @param options The options parameters. */ - update(resourceGroupName: string, activityLogAlertName: string, activityLogAlertPatch: Models.ActivityLogAlertPatchBody, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlertPatch Parameters supplied to the operation. - * @param options The optional parameters - * @param callback The callback - */ - update(resourceGroupName: string, activityLogAlertName: string, activityLogAlertPatch: Models.ActivityLogAlertPatchBody, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, activityLogAlertName: string, activityLogAlertPatch: Models.ActivityLogAlertPatchBody, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + resourceGroupName: string, + activityLogAlertName: string, + activityLogAlertPatch: ActivityLogAlertPatchBody, + options?: ActivityLogAlertsUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -159,86 +194,45 @@ export class ActivityLogAlerts { activityLogAlertPatch, options }, - updateOperationSpec, - callback) as Promise; + updateOperationSpec + ); } /** * Get a list of all activity log alerts in a subscription. - * @param [options] The optional parameters - * @returns Promise - */ - listBySubscriptionId(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback + * @param options The options parameters. */ - listBySubscriptionId(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - listBySubscriptionId(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listBySubscriptionId(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listBySubscriptionId( + options?: ActivityLogAlertsListBySubscriptionIdOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - options - }, - listBySubscriptionIdOperationSpec, - callback) as Promise; + { options }, + listBySubscriptionIdOperationSpec + ); } /** * Get a list of all activity log alerts in a resource group. - * @param resourceGroupName The name of the resource group. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param options The optional parameters - * @param callback The callback + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroup( + resourceGroupName: string, + options?: ActivityLogAlertsListByResourceGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - listByResourceGroupOperationSpec, - callback) as Promise; + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const createOrUpdateOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName}", httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.activityLogAlertName - ], - queryParameters: [ - Parameters.apiVersion4 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "activityLogAlert", - mapper: { - ...Mappers.ActivityLogAlertResource, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.ActivityLogAlertResource @@ -250,23 +244,22 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName}", + requestBody: Parameters.activityLogAlert, + queryParameters: [Parameters.apiVersion11], urlParameters: [ - Parameters.subscriptionId, + Parameters.$host, Parameters.resourceGroupName, + Parameters.subscriptionId, Parameters.activityLogAlertName ], - queryParameters: [ - Parameters.apiVersion4 - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ActivityLogAlertResource @@ -275,23 +268,20 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName}", + queryParameters: [Parameters.apiVersion11], urlParameters: [ - Parameters.subscriptionId, + Parameters.$host, Parameters.resourceGroupName, + Parameters.subscriptionId, Parameters.activityLogAlertName ], - queryParameters: [ - Parameters.apiVersion4 - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, @@ -299,30 +289,20 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName}", + queryParameters: [Parameters.apiVersion11], urlParameters: [ - Parameters.subscriptionId, + Parameters.$host, Parameters.resourceGroupName, + Parameters.subscriptionId, Parameters.activityLogAlertName ], - queryParameters: [ - Parameters.apiVersion4 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "activityLogAlertPatch", - mapper: { - ...Mappers.ActivityLogAlertPatchBody, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.ActivityLogAlertResource @@ -331,21 +311,22 @@ const updateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.activityLogAlertPatch, + queryParameters: [Parameters.apiVersion11], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.activityLogAlertName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listBySubscriptionIdOperationSpec: msRest.OperationSpec = { +const listBySubscriptionIdOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/microsoft.insights/activityLogAlerts", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/microsoft.insights/activityLogAlerts", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion4 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ActivityLogAlertList @@ -354,22 +335,15 @@ const listBySubscriptionIdOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion11], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion4 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ActivityLogAlertList @@ -378,5 +352,12 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion11], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/monitor/arm-monitor/src/operations/activityLogs.ts b/sdk/monitor/arm-monitor/src/operations/activityLogs.ts index 561f7d7f4eba..3f74b1dfe5c1 100644 --- a/sdk/monitor/arm-monitor/src/operations/activityLogs.ts +++ b/sdk/monitor/arm-monitor/src/operations/activityLogs.ts @@ -1,143 +1,159 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/activityLogsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { ActivityLogs } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MonitorManagementClientContext } from "../monitorManagementClientContext"; +import { MonitorClient } from "../monitorClient"; +import { + EventData, + ActivityLogsListNextOptionalParams, + ActivityLogsListOptionalParams, + ActivityLogsListResponse, + ActivityLogsListNextResponse +} from "../models"; -/** Class representing a ActivityLogs. */ -export class ActivityLogs { - private readonly client: MonitorManagementClientContext; +/// +/** Class containing ActivityLogs operations. */ +export class ActivityLogsImpl implements ActivityLogs { + private readonly client: MonitorClient; /** - * Create a ActivityLogs. - * @param {MonitorManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class ActivityLogs class. + * @param client Reference to the service client */ - constructor(client: MonitorManagementClientContext) { + constructor(client: MonitorClient) { this.client = client; } /** * Provides the list of records from the activity logs. - * @param filter Reduces the set of data collected.
This argument is required and it also - * requires at least the start date/time.
The **$filter** argument is very restricted and allows - * only the following patterns.
- *List events for a resource group*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and - * resourceGroupName eq 'resourceGroupName'.
- *List events for resource*: - * $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and resourceUri eq 'resourceURI'.
- *List events for a - * subscription in a time range*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and - * eventTimestamp le '2014-07-20T04:36:37.6407898Z'.
- *List events for a resource provider*: - * $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and resourceProvider eq 'resourceProviderName'.
- *List events - * for a correlation Id*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and - * eventTimestamp le '2014-07-20T04:36:37.6407898Z' and correlationId eq - * 'correlationID'.

**NOTE**: No other syntax is allowed. - * @param [options] The optional parameters - * @returns Promise + * @param filter Reduces the set of data collected.
This argument is required and it also requires + * at least the start date/time.
The **$filter** argument is very restricted and allows only the + * following patterns.
- *List events for a resource group*: $filter=eventTimestamp ge + * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and + * resourceGroupName eq 'resourceGroupName'.
- *List events for resource*: $filter=eventTimestamp ge + * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri + * eq 'resourceURI'.
- *List events for a subscription in a time range*: $filter=eventTimestamp ge + * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'.
- *List + * events for a resource provider*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and + * eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceProvider eq + * 'resourceProviderName'.
- *List events for a correlation Id*: $filter=eventTimestamp ge + * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and + * correlationId eq 'correlationID'.

**NOTE**: No other syntax is allowed. + * @param options The options parameters. */ - list(filter: string, options?: Models.ActivityLogsListOptionalParams): Promise; - /** - * @param filter Reduces the set of data collected.
This argument is required and it also - * requires at least the start date/time.
The **$filter** argument is very restricted and allows - * only the following patterns.
- *List events for a resource group*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and - * resourceGroupName eq 'resourceGroupName'.
- *List events for resource*: - * $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and resourceUri eq 'resourceURI'.
- *List events for a - * subscription in a time range*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and - * eventTimestamp le '2014-07-20T04:36:37.6407898Z'.
- *List events for a resource provider*: - * $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and resourceProvider eq 'resourceProviderName'.
- *List events - * for a correlation Id*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and - * eventTimestamp le '2014-07-20T04:36:37.6407898Z' and correlationId eq - * 'correlationID'.

**NOTE**: No other syntax is allowed. - * @param callback The callback - */ - list(filter: string, callback: msRest.ServiceCallback): void; - /** - * @param filter Reduces the set of data collected.
This argument is required and it also - * requires at least the start date/time.
The **$filter** argument is very restricted and allows - * only the following patterns.
- *List events for a resource group*: $filter=eventTimestamp ge - * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and - * resourceGroupName eq 'resourceGroupName'.
- *List events for resource*: - * $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and resourceUri eq 'resourceURI'.
- *List events for a - * subscription in a time range*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and - * eventTimestamp le '2014-07-20T04:36:37.6407898Z'.
- *List events for a resource provider*: - * $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - * '2014-07-20T04:36:37.6407898Z' and resourceProvider eq 'resourceProviderName'.
- *List events - * for a correlation Id*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and - * eventTimestamp le '2014-07-20T04:36:37.6407898Z' and correlationId eq - * 'correlationID'.

**NOTE**: No other syntax is allowed. - * @param options The optional parameters - * @param callback The callback - */ - list(filter: string, options: Models.ActivityLogsListOptionalParams, callback: msRest.ServiceCallback): void; - list(filter: string, options?: Models.ActivityLogsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - filter, - options + public list( + filter: string, + options?: ActivityLogsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(filter, options); + return { + next() { + return iter.next(); }, - listOperationSpec, - callback) as Promise; + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(filter, options); + } + }; + } + + private async *listPagingPage( + filter: string, + options?: ActivityLogsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(filter, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(filter, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + filter: string, + options?: ActivityLogsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(filter, options)) { + yield* page; + } } /** * Provides the list of records from the activity logs. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise + * @param filter Reduces the set of data collected.
This argument is required and it also requires + * at least the start date/time.
The **$filter** argument is very restricted and allows only the + * following patterns.
- *List events for a resource group*: $filter=eventTimestamp ge + * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and + * resourceGroupName eq 'resourceGroupName'.
- *List events for resource*: $filter=eventTimestamp ge + * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri + * eq 'resourceURI'.
- *List events for a subscription in a time range*: $filter=eventTimestamp ge + * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'.
- *List + * events for a resource provider*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and + * eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceProvider eq + * 'resourceProviderName'.
- *List events for a correlation Id*: $filter=eventTimestamp ge + * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and + * correlationId eq 'correlationID'.

**NOTE**: No other syntax is allowed. + * @param options The options parameters. */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + private _list( + filter: string, + options?: ActivityLogsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { filter, options }, + listOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param filter Reduces the set of data collected.
This argument is required and it also requires + * at least the start date/time.
The **$filter** argument is very restricted and allows only the + * following patterns.
- *List events for a resource group*: $filter=eventTimestamp ge + * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and + * resourceGroupName eq 'resourceGroupName'.
- *List events for resource*: $filter=eventTimestamp ge + * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri + * eq 'resourceURI'.
- *List events for a subscription in a time range*: $filter=eventTimestamp ge + * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'.
- *List + * events for a resource provider*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and + * eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceProvider eq + * 'resourceProviderName'.
- *List events for a correlation Id*: $filter=eventTimestamp ge + * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and + * correlationId eq 'correlationID'.

**NOTE**: No other syntax is allowed. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + filter: string, + nextLink: string, + options?: ActivityLogsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { filter, nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/eventtypes/management/values", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/microsoft.insights/eventtypes/management/values", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion0, - Parameters.filter0, - Parameters.select - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.EventDataCollection @@ -146,19 +162,18 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.select + ], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.EventDataCollection @@ -167,5 +182,16 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.select + ], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/monitor/arm-monitor/src/operations/alertRuleIncidents.ts b/sdk/monitor/arm-monitor/src/operations/alertRuleIncidents.ts index 77453e3b2b0f..2726907e57bd 100644 --- a/sdk/monitor/arm-monitor/src/operations/alertRuleIncidents.ts +++ b/sdk/monitor/arm-monitor/src/operations/alertRuleIncidents.ts @@ -1,117 +1,141 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/alertRuleIncidentsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { AlertRuleIncidents } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MonitorManagementClientContext } from "../monitorManagementClientContext"; +import { MonitorClient } from "../monitorClient"; +import { + Incident, + AlertRuleIncidentsListByAlertRuleOptionalParams, + AlertRuleIncidentsGetOptionalParams, + AlertRuleIncidentsGetResponse, + AlertRuleIncidentsListByAlertRuleResponse +} from "../models"; -/** Class representing a AlertRuleIncidents. */ -export class AlertRuleIncidents { - private readonly client: MonitorManagementClientContext; +/// +/** Class containing AlertRuleIncidents operations. */ +export class AlertRuleIncidentsImpl implements AlertRuleIncidents { + private readonly client: MonitorClient; /** - * Create a AlertRuleIncidents. - * @param {MonitorManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class AlertRuleIncidents class. + * @param client Reference to the service client */ - constructor(client: MonitorManagementClientContext) { + constructor(client: MonitorClient) { this.client = client; } /** - * Gets an incident associated to an alert rule - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param incidentName The name of the incident to retrieve. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, ruleName: string, incidentName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. + * Gets a list of incidents associated to an alert rule + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ruleName The name of the rule. - * @param incidentName The name of the incident to retrieve. - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, ruleName: string, incidentName: string, callback: msRest.ServiceCallback): void; + public listByAlertRule( + resourceGroupName: string, + ruleName: string, + options?: AlertRuleIncidentsListByAlertRuleOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByAlertRulePagingAll( + resourceGroupName, + ruleName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByAlertRulePagingPage( + resourceGroupName, + ruleName, + options + ); + } + }; + } + + private async *listByAlertRulePagingPage( + resourceGroupName: string, + ruleName: string, + options?: AlertRuleIncidentsListByAlertRuleOptionalParams + ): AsyncIterableIterator { + let result = await this._listByAlertRule( + resourceGroupName, + ruleName, + options + ); + yield result.value || []; + } + + private async *listByAlertRulePagingAll( + resourceGroupName: string, + ruleName: string, + options?: AlertRuleIncidentsListByAlertRuleOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByAlertRulePagingPage( + resourceGroupName, + ruleName, + options + )) { + yield* page; + } + } + /** - * @param resourceGroupName The name of the resource group. + * Gets an incident associated to an alert rule + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ruleName The name of the rule. * @param incidentName The name of the incident to retrieve. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, ruleName: string, incidentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, ruleName: string, incidentName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + ruleName: string, + incidentName: string, + options?: AlertRuleIncidentsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - ruleName, - incidentName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, ruleName, incidentName, options }, + getOperationSpec + ); } /** * Gets a list of incidents associated to an alert rule - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param [options] The optional parameters - * @returns Promise - */ - listByAlertRule(resourceGroupName: string, ruleName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param callback The callback - */ - listByAlertRule(resourceGroupName: string, ruleName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ruleName The name of the rule. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByAlertRule(resourceGroupName: string, ruleName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByAlertRule(resourceGroupName: string, ruleName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByAlertRule( + resourceGroupName: string, + ruleName: string, + options?: AlertRuleIncidentsListByAlertRuleOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - ruleName, - options - }, - listByAlertRuleOperationSpec, - callback) as Promise; + { resourceGroupName, ruleName, options }, + listByAlertRuleOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}/incidents/{incidentName}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}/incidents/{incidentName}", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.ruleName, - Parameters.incidentName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.Incident @@ -120,30 +144,33 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listByAlertRuleOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}/incidents", + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, + Parameters.subscriptionId, Parameters.ruleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.incidentName ], + headerParameters: [Parameters.accept], + serializer +}; +const listByAlertRuleOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}/incidents", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.IncidentListResult - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion1], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.ruleName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/monitor/arm-monitor/src/operations/alertRules.ts b/sdk/monitor/arm-monitor/src/operations/alertRules.ts index 79429b70aaf1..57b8e8588415 100644 --- a/sdk/monitor/arm-monitor/src/operations/alertRules.ts +++ b/sdk/monitor/arm-monitor/src/operations/alertRules.ts @@ -1,243 +1,233 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/alertRulesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { AlertRules } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MonitorManagementClientContext } from "../monitorManagementClientContext"; +import { MonitorClient } from "../monitorClient"; +import { + AlertRuleResource, + AlertRulesListByResourceGroupOptionalParams, + AlertRulesListBySubscriptionOptionalParams, + AlertRulesCreateOrUpdateOptionalParams, + AlertRulesCreateOrUpdateResponse, + AlertRulesDeleteOptionalParams, + AlertRulesGetOptionalParams, + AlertRulesGetResponse, + AlertRuleResourcePatch, + AlertRulesUpdateOptionalParams, + AlertRulesUpdateResponse, + AlertRulesListByResourceGroupResponse, + AlertRulesListBySubscriptionResponse +} from "../models"; -/** Class representing a AlertRules. */ -export class AlertRules { - private readonly client: MonitorManagementClientContext; +/// +/** Class containing AlertRules operations. */ +export class AlertRulesImpl implements AlertRules { + private readonly client: MonitorClient; /** - * Create a AlertRules. - * @param {MonitorManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class AlertRules class. + * @param client Reference to the service client */ - constructor(client: MonitorManagementClientContext) { + constructor(client: MonitorClient) { this.client = client; } /** - * Creates or updates an alert rule. - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @param [options] The optional parameters - * @returns Promise + * List the classic metric alert rules within a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, ruleName: string, parameters: Models.AlertRuleResource, options?: msRest.RequestOptionsBase): Promise; + public listByResourceGroup( + resourceGroupName: string, + options?: AlertRulesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: AlertRulesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: AlertRulesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + /** - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @param callback The callback + * List the classic metric alert rules within a subscription. + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, ruleName: string, parameters: Models.AlertRuleResource, callback: msRest.ServiceCallback): void; + public listBySubscription( + options?: AlertRulesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: AlertRulesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(options); + yield result.value || []; + } + + private async *listBySubscriptionPagingAll( + options?: AlertRulesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + /** - * @param resourceGroupName The name of the resource group. + * Creates or updates a classic metric alert rule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ruleName The name of the rule. * @param parameters The parameters of the rule to create or update. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, ruleName: string, parameters: Models.AlertRuleResource, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, ruleName: string, parameters: Models.AlertRuleResource, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + resourceGroupName: string, + ruleName: string, + parameters: AlertRuleResource, + options?: AlertRulesCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - ruleName, - parameters, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; + { resourceGroupName, ruleName, parameters, options }, + createOrUpdateOperationSpec + ); } /** - * Deletes an alert rule - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, ruleName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, ruleName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. + * Deletes a classic metric alert rule + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ruleName The name of the rule. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, ruleName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, ruleName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + ruleName: string, + options?: AlertRulesDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - ruleName, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, ruleName, options }, + deleteOperationSpec + ); } /** - * Gets an alert rule - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, ruleName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. + * Gets a classic metric alert rule + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ruleName The name of the rule. - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, ruleName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, ruleName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, ruleName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + ruleName: string, + options?: AlertRulesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - ruleName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, ruleName, options }, + getOperationSpec + ); } /** - * Updates an existing AlertRuleResource. To update other fields use the CreateOrUpdate method. - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param alertRulesResource Parameters supplied to the operation. - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, ruleName: string, alertRulesResource: Models.AlertRuleResourcePatch, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. + * Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate + * method. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ruleName The name of the rule. * @param alertRulesResource Parameters supplied to the operation. - * @param callback The callback + * @param options The options parameters. */ - update(resourceGroupName: string, ruleName: string, alertRulesResource: Models.AlertRuleResourcePatch, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param alertRulesResource Parameters supplied to the operation. - * @param options The optional parameters - * @param callback The callback - */ - update(resourceGroupName: string, ruleName: string, alertRulesResource: Models.AlertRuleResourcePatch, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, ruleName: string, alertRulesResource: Models.AlertRuleResourcePatch, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + resourceGroupName: string, + ruleName: string, + alertRulesResource: AlertRuleResourcePatch, + options?: AlertRulesUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - ruleName, - alertRulesResource, - options - }, - updateOperationSpec, - callback) as Promise; + { resourceGroupName, ruleName, alertRulesResource, options }, + updateOperationSpec + ); } /** - * List the alert rules within a resource group. - * @param resourceGroupName The name of the resource group. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param options The optional parameters - * @param callback The callback + * List the classic metric alert rules within a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroup( + resourceGroupName: string, + options?: AlertRulesListByResourceGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - listByResourceGroupOperationSpec, - callback) as Promise; + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); } /** - * List the alert rules within a subscription. - * @param [options] The optional parameters - * @returns Promise - */ - listBySubscription(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback + * List the classic metric alert rules within a subscription. + * @param options The options parameters. */ - listBySubscription(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - listBySubscription(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listBySubscription(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listBySubscription( + options?: AlertRulesListBySubscriptionOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - options - }, - listBySubscriptionOperationSpec, - callback) as Promise; + { options }, + listBySubscriptionOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const createOrUpdateOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName}", httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.ruleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.AlertRuleResource, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.AlertRuleResource @@ -249,79 +239,65 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}", + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, - Parameters.ruleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.subscriptionId, + Parameters.ruleName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}", + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, - Parameters.ruleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.subscriptionId, + Parameters.ruleName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AlertRuleResource }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}", + queryParameters: [Parameters.apiVersion1], urlParameters: [ - Parameters.subscriptionId, + Parameters.$host, Parameters.resourceGroupName, + Parameters.subscriptionId, Parameters.ruleName ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "alertRulesResource", - mapper: { - ...Mappers.AlertRuleResourcePatch, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.AlertRuleResource @@ -333,52 +309,53 @@ const updateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules", + requestBody: Parameters.alertRulesResource, + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.subscriptionId, + Parameters.ruleName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AlertRuleResourceCollection }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listBySubscriptionOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/microsoft.insights/alertrules", + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, Parameters.subscriptionId ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/alertrules", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AlertRuleResourceCollection }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion1], + 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 fa3828276d8e..0cceab313eac 100644 --- a/sdk/monitor/arm-monitor/src/operations/autoscaleSettings.ts +++ b/sdk/monitor/arm-monitor/src/operations/autoscaleSettings.ts @@ -1,185 +1,226 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/autoscaleSettingsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { AutoscaleSettings } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MonitorManagementClientContext } from "../monitorManagementClientContext"; +import { MonitorClient } from "../monitorClient"; +import { + AutoscaleSettingResource, + AutoscaleSettingsListByResourceGroupNextOptionalParams, + AutoscaleSettingsListByResourceGroupOptionalParams, + AutoscaleSettingsListBySubscriptionNextOptionalParams, + AutoscaleSettingsListBySubscriptionOptionalParams, + AutoscaleSettingsListByResourceGroupResponse, + AutoscaleSettingsCreateOrUpdateOptionalParams, + AutoscaleSettingsCreateOrUpdateResponse, + AutoscaleSettingsDeleteOptionalParams, + AutoscaleSettingsGetOptionalParams, + AutoscaleSettingsGetResponse, + AutoscaleSettingResourcePatch, + AutoscaleSettingsUpdateOptionalParams, + AutoscaleSettingsUpdateResponse, + AutoscaleSettingsListBySubscriptionResponse, + AutoscaleSettingsListByResourceGroupNextResponse, + AutoscaleSettingsListBySubscriptionNextResponse +} from "../models"; -/** Class representing a AutoscaleSettings. */ -export class AutoscaleSettings { - private readonly client: MonitorManagementClientContext; +/// +/** Class containing AutoscaleSettings operations. */ +export class AutoscaleSettingsImpl implements AutoscaleSettings { + private readonly client: MonitorClient; /** - * Create a AutoscaleSettings. - * @param {MonitorManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class AutoscaleSettings class. + * @param client Reference to the service client */ - constructor(client: MonitorManagementClientContext) { + constructor(client: MonitorClient) { this.client = client; } /** * Lists the autoscale settings for a resource group - * @param resourceGroupName The name of the resource group. - * @param [options] The optional parameters - * @returns Promise + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param options The optional parameters - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByResourceGroup( + resourceGroupName: string, + options?: AutoscaleSettingsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: AutoscaleSettingsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( resourceGroupName, + continuationToken, options - }, - listByResourceGroupOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: AutoscaleSettingsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } } /** - * Creates or updates an autoscale setting. - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param parameters Parameters supplied to the operation. - * @param [options] The optional parameters - * @returns Promise + * Lists the autoscale settings for a subscription + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, autoscaleSettingName: string, parameters: Models.AutoscaleSettingResource, options?: msRest.RequestOptionsBase): Promise; + public listBySubscription( + options?: AutoscaleSettingsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: AutoscaleSettingsListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listBySubscriptionPagingAll( + options?: AutoscaleSettingsListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + /** - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param parameters Parameters supplied to the operation. - * @param callback The callback + * Lists the autoscale settings for a resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, autoscaleSettingName: string, parameters: Models.AutoscaleSettingResource, callback: msRest.ServiceCallback): void; + private _listByResourceGroup( + resourceGroupName: string, + options?: AutoscaleSettingsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + /** - * @param resourceGroupName The name of the resource group. + * Creates or updates an autoscale setting. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param autoscaleSettingName The autoscale setting name. * @param parameters Parameters supplied to the operation. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, autoscaleSettingName: string, parameters: Models.AutoscaleSettingResource, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, autoscaleSettingName: string, parameters: Models.AutoscaleSettingResource, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + resourceGroupName: string, + autoscaleSettingName: string, + parameters: AutoscaleSettingResource, + options?: AutoscaleSettingsCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - autoscaleSettingName, - parameters, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; + { resourceGroupName, autoscaleSettingName, parameters, options }, + createOrUpdateOperationSpec + ); } /** * Deletes and autoscale setting - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, autoscaleSettingName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, autoscaleSettingName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param autoscaleSettingName The autoscale setting name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, autoscaleSettingName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, autoscaleSettingName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + autoscaleSettingName: string, + options?: AutoscaleSettingsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - autoscaleSettingName, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, autoscaleSettingName, options }, + deleteOperationSpec + ); } /** * Gets an autoscale setting - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, autoscaleSettingName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param autoscaleSettingName The autoscale setting name. - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, autoscaleSettingName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, autoscaleSettingName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, autoscaleSettingName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + autoscaleSettingName: string, + options?: AutoscaleSettingsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - autoscaleSettingName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, autoscaleSettingName, options }, + getOperationSpec + ); } /** - * Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate - * method. - * @param resourceGroupName The name of the resource group. + * Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param autoscaleSettingName The autoscale setting name. * @param autoscaleSettingResource Parameters supplied to the operation. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - update(resourceGroupName: string, autoscaleSettingName: string, autoscaleSettingResource: Models.AutoscaleSettingResourcePatch, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param autoscaleSettingResource Parameters supplied to the operation. - * @param callback The callback - */ - update(resourceGroupName: string, autoscaleSettingName: string, autoscaleSettingResource: Models.AutoscaleSettingResourcePatch, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param autoscaleSettingName The autoscale setting name. - * @param autoscaleSettingResource Parameters supplied to the operation. - * @param options The optional parameters - * @param callback The callback - */ - update(resourceGroupName: string, autoscaleSettingName: string, autoscaleSettingResource: Models.AutoscaleSettingResourcePatch, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, autoscaleSettingName: string, autoscaleSettingResource: Models.AutoscaleSettingResourcePatch, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + resourceGroupName: string, + autoscaleSettingName: string, + autoscaleSettingResource: AutoscaleSettingResourcePatch, + options?: AutoscaleSettingsUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -187,106 +228,62 @@ export class AutoscaleSettings { autoscaleSettingResource, options }, - updateOperationSpec, - callback) as Promise; + updateOperationSpec + ); } /** * Lists the autoscale settings for a subscription - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listBySubscription(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - listBySubscription(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - listBySubscription(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listBySubscription(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listBySubscription( + options?: AutoscaleSettingsListBySubscriptionOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - options - }, - listBySubscriptionOperationSpec, - callback) as Promise; + { options }, + listBySubscriptionOperationSpec + ); } /** - * Lists the autoscale settings for a resource group - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. */ - listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: AutoscaleSettingsListByResourceGroupNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByResourceGroupNextOperationSpec, - callback) as Promise; + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); } /** - * Lists the autoscale settings for a subscription - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listBySubscriptionNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. */ - listBySubscriptionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listBySubscriptionNext( + nextLink: string, + options?: AutoscaleSettingsListBySubscriptionNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listBySubscriptionNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByResourceGroupOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.AutoscaleSettingResourceCollection @@ -295,30 +292,19 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings/{autoscaleSettingName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, - Parameters.autoscaleSettingName, Parameters.subscriptionId ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.AutoscaleSettingResource, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.AutoscaleSettingResource @@ -330,23 +316,22 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings/{autoscaleSettingName}", + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, - Parameters.autoscaleSettingName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.subscriptionId, + Parameters.autoscaleSettingName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, @@ -354,23 +339,20 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings/{autoscaleSettingName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, - Parameters.autoscaleSettingName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.subscriptionId, + Parameters.autoscaleSettingName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AutoscaleSettingResource @@ -379,30 +361,20 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings/{autoscaleSettingName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.subscriptionId, + Parameters.$host, Parameters.resourceGroupName, + Parameters.subscriptionId, Parameters.autoscaleSettingName ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "autoscaleSettingResource", - mapper: { - ...Mappers.AutoscaleSettingResourcePatch, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.AutoscaleSettingResource @@ -411,21 +383,22 @@ const updateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.autoscaleSettingResource, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.autoscaleSettingName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listBySubscriptionOperationSpec: msRest.OperationSpec = { +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/autoscalesettings", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/microsoft.insights/autoscalesettings", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.AutoscaleSettingResourceCollection @@ -434,19 +407,14 @@ const listBySubscriptionOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AutoscaleSettingResourceCollection @@ -455,19 +423,19 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; - -const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AutoscaleSettingResourceCollection @@ -476,5 +444,12 @@ const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/monitor/arm-monitor/src/operations/baselines.ts b/sdk/monitor/arm-monitor/src/operations/baselines.ts index 60e9fb93f39a..c7bab98ecf31 100644 --- a/sdk/monitor/arm-monitor/src/operations/baselines.ts +++ b/sdk/monitor/arm-monitor/src/operations/baselines.ts @@ -1,82 +1,97 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/baselinesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Baselines } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MonitorManagementClientContext } from "../monitorManagementClientContext"; +import { MonitorClient } from "../monitorClient"; +import { + SingleMetricBaseline, + BaselinesListOptionalParams, + BaselinesListResponse +} from "../models"; -/** Class representing a Baselines. */ -export class Baselines { - private readonly client: MonitorManagementClientContext; +/// +/** Class containing Baselines operations. */ +export class BaselinesImpl implements Baselines { + private readonly client: MonitorClient; /** - * Create a Baselines. - * @param {MonitorManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Baselines class. + * @param client Reference to the service client */ - constructor(client: MonitorManagementClientContext) { + constructor(client: MonitorClient) { this.client = client; } /** * **Lists the metric baseline values for a resource**. * @param resourceUri The identifier of the resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(resourceUri: string, options?: Models.BaselinesListOptionalParams): Promise; - /** - * @param resourceUri The identifier of the resource. - * @param callback The callback - */ - list(resourceUri: string, callback: msRest.ServiceCallback): void; + public list( + resourceUri: string, + options?: BaselinesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceUri, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceUri, options); + } + }; + } + + private async *listPagingPage( + resourceUri: string, + options?: BaselinesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceUri, options); + yield result.value || []; + } + + private async *listPagingAll( + resourceUri: string, + options?: BaselinesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(resourceUri, options)) { + yield* page; + } + } + /** + * **Lists the metric baseline values for a resource**. * @param resourceUri The identifier of the resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - list(resourceUri: string, options: Models.BaselinesListOptionalParams, callback: msRest.ServiceCallback): void; - list(resourceUri: string, options?: Models.BaselinesListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _list( + resourceUri: string, + options?: BaselinesListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceUri, - options - }, - listOperationSpec, - callback) as Promise; + { resourceUri, options }, + listOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/{resourceUri}/providers/Microsoft.Insights/metricBaselines", httpMethod: "GET", - path: "{resourceUri}/providers/microsoft.insights/metricBaselines", - urlParameters: [ - Parameters.resourceUri - ], - queryParameters: [ - Parameters.metricnames, - Parameters.metricnamespace, - Parameters.timespan, - Parameters.interval, - Parameters.aggregation, - Parameters.sensitivities, - Parameters.filter1, - Parameters.resultType, - Parameters.apiVersion7 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.MetricBaselinesResponse @@ -85,5 +100,18 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [ + Parameters.filter1, + Parameters.metricnamespace, + Parameters.timespan, + Parameters.interval, + Parameters.metricnames, + Parameters.aggregation, + Parameters.resultType, + Parameters.sensitivities, + Parameters.apiVersion5 + ], + urlParameters: [Parameters.$host, Parameters.resourceUri], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/monitor/arm-monitor/src/operations/dataCollectionEndpoints.ts b/sdk/monitor/arm-monitor/src/operations/dataCollectionEndpoints.ts new file mode 100644 index 000000000000..d5d6460f2aed --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operations/dataCollectionEndpoints.ts @@ -0,0 +1,449 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { DataCollectionEndpoints } 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 { + DataCollectionEndpointResource, + DataCollectionEndpointsListByResourceGroupNextOptionalParams, + DataCollectionEndpointsListByResourceGroupOptionalParams, + DataCollectionEndpointsListBySubscriptionNextOptionalParams, + DataCollectionEndpointsListBySubscriptionOptionalParams, + DataCollectionEndpointsListByResourceGroupResponse, + DataCollectionEndpointsListBySubscriptionResponse, + DataCollectionEndpointsGetOptionalParams, + DataCollectionEndpointsGetResponse, + DataCollectionEndpointsCreateOptionalParams, + DataCollectionEndpointsCreateResponse, + DataCollectionEndpointsUpdateOptionalParams, + DataCollectionEndpointsUpdateResponse, + DataCollectionEndpointsDeleteOptionalParams, + DataCollectionEndpointsListByResourceGroupNextResponse, + DataCollectionEndpointsListBySubscriptionNextResponse +} from "../models"; + +/// +/** Class containing DataCollectionEndpoints operations. */ +export class DataCollectionEndpointsImpl implements DataCollectionEndpoints { + private readonly client: MonitorClient; + + /** + * Initialize a new instance of the class DataCollectionEndpoints class. + * @param client Reference to the service client + */ + constructor(client: MonitorClient) { + this.client = client; + } + + /** + * Lists all data collection endpoints in the specified resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: DataCollectionEndpointsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: DataCollectionEndpointsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: DataCollectionEndpointsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Lists all data collection endpoints in the specified subscription + * @param options The options parameters. + */ + public listBySubscription( + options?: DataCollectionEndpointsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: DataCollectionEndpointsListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listBySubscriptionPagingAll( + options?: DataCollectionEndpointsListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Lists all data collection endpoints in the specified resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: DataCollectionEndpointsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Lists all data collection endpoints in the specified subscription + * @param options The options parameters. + */ + private _listBySubscription( + options?: DataCollectionEndpointsListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * Returns the specified data collection endpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case + * insensitive. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + dataCollectionEndpointName: string, + options?: DataCollectionEndpointsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, dataCollectionEndpointName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates a data collection endpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case + * insensitive. + * @param options The options parameters. + */ + create( + resourceGroupName: string, + dataCollectionEndpointName: string, + options?: DataCollectionEndpointsCreateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, dataCollectionEndpointName, options }, + createOperationSpec + ); + } + + /** + * Updates part of a data collection endpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case + * insensitive. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + dataCollectionEndpointName: string, + options?: DataCollectionEndpointsUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, dataCollectionEndpointName, options }, + updateOperationSpec + ); + } + + /** + * Deletes a data collection endpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case + * insensitive. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + dataCollectionEndpointName: string, + options?: DataCollectionEndpointsDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, dataCollectionEndpointName, options }, + deleteOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: DataCollectionEndpointsListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: DataCollectionEndpointsListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionEndpoints", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DataCollectionEndpointResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseCommonV2 + } + }, + queryParameters: [Parameters.apiVersion12], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/dataCollectionEndpoints", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DataCollectionEndpointResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseCommonV2 + } + }, + queryParameters: [Parameters.apiVersion12], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionEndpoints/{dataCollectionEndpointName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DataCollectionEndpointResource + }, + default: { + bodyMapper: Mappers.ErrorResponseCommonV2 + } + }, + queryParameters: [Parameters.apiVersion12], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.dataCollectionEndpointName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionEndpoints/{dataCollectionEndpointName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.DataCollectionEndpointResource + }, + 201: { + bodyMapper: Mappers.DataCollectionEndpointResource + }, + default: { + bodyMapper: Mappers.ErrorResponseCommonV2 + } + }, + requestBody: Parameters.body, + queryParameters: [Parameters.apiVersion12], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.dataCollectionEndpointName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionEndpoints/{dataCollectionEndpointName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.DataCollectionEndpointResource + }, + default: { + bodyMapper: Mappers.ErrorResponseCommonV2 + } + }, + requestBody: Parameters.body1, + queryParameters: [Parameters.apiVersion12], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.dataCollectionEndpointName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionEndpoints/{dataCollectionEndpointName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponseCommonV2 + } + }, + queryParameters: [Parameters.apiVersion12], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.dataCollectionEndpointName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DataCollectionEndpointResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseCommonV2 + } + }, + queryParameters: [Parameters.apiVersion12], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DataCollectionEndpointResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseCommonV2 + } + }, + queryParameters: [Parameters.apiVersion12], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/monitor/arm-monitor/src/operations/dataCollectionRuleAssociations.ts b/sdk/monitor/arm-monitor/src/operations/dataCollectionRuleAssociations.ts new file mode 100644 index 000000000000..07beb51228ee --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operations/dataCollectionRuleAssociations.ts @@ -0,0 +1,447 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { DataCollectionRuleAssociations } 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 { + DataCollectionRuleAssociationProxyOnlyResource, + DataCollectionRuleAssociationsListByResourceNextOptionalParams, + DataCollectionRuleAssociationsListByResourceOptionalParams, + DataCollectionRuleAssociationsListByRuleNextOptionalParams, + DataCollectionRuleAssociationsListByRuleOptionalParams, + DataCollectionRuleAssociationsListByResourceResponse, + DataCollectionRuleAssociationsListByRuleResponse, + DataCollectionRuleAssociationsGetOptionalParams, + DataCollectionRuleAssociationsGetResponse, + DataCollectionRuleAssociationsCreateOptionalParams, + DataCollectionRuleAssociationsCreateResponse, + DataCollectionRuleAssociationsDeleteOptionalParams, + DataCollectionRuleAssociationsListByResourceNextResponse, + DataCollectionRuleAssociationsListByRuleNextResponse +} from "../models"; + +/// +/** Class containing DataCollectionRuleAssociations operations. */ +export class DataCollectionRuleAssociationsImpl + implements DataCollectionRuleAssociations { + private readonly client: MonitorClient; + + /** + * Initialize a new instance of the class DataCollectionRuleAssociations class. + * @param client Reference to the service client + */ + constructor(client: MonitorClient) { + this.client = client; + } + + /** + * Lists associations for the specified resource. + * @param resourceUri The identifier of the resource. + * @param options The options parameters. + */ + public listByResource( + resourceUri: string, + options?: DataCollectionRuleAssociationsListByResourceOptionalParams + ): PagedAsyncIterableIterator< + DataCollectionRuleAssociationProxyOnlyResource + > { + const iter = this.listByResourcePagingAll(resourceUri, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourcePagingPage(resourceUri, options); + } + }; + } + + private async *listByResourcePagingPage( + resourceUri: string, + options?: DataCollectionRuleAssociationsListByResourceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResource(resourceUri, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceNext( + resourceUri, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourcePagingAll( + resourceUri: string, + options?: DataCollectionRuleAssociationsListByResourceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourcePagingPage( + resourceUri, + options + )) { + yield* page; + } + } + + /** + * Lists associations for the specified data collection rule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. + * @param options The options parameters. + */ + public listByRule( + resourceGroupName: string, + dataCollectionRuleName: string, + options?: DataCollectionRuleAssociationsListByRuleOptionalParams + ): PagedAsyncIterableIterator< + DataCollectionRuleAssociationProxyOnlyResource + > { + const iter = this.listByRulePagingAll( + resourceGroupName, + dataCollectionRuleName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByRulePagingPage( + resourceGroupName, + dataCollectionRuleName, + options + ); + } + }; + } + + private async *listByRulePagingPage( + resourceGroupName: string, + dataCollectionRuleName: string, + options?: DataCollectionRuleAssociationsListByRuleOptionalParams + ): AsyncIterableIterator { + let result = await this._listByRule( + resourceGroupName, + dataCollectionRuleName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByRuleNext( + resourceGroupName, + dataCollectionRuleName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByRulePagingAll( + resourceGroupName: string, + dataCollectionRuleName: string, + options?: DataCollectionRuleAssociationsListByRuleOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByRulePagingPage( + resourceGroupName, + dataCollectionRuleName, + options + )) { + yield* page; + } + } + + /** + * Lists associations for the specified resource. + * @param resourceUri The identifier of the resource. + * @param options The options parameters. + */ + private _listByResource( + resourceUri: string, + options?: DataCollectionRuleAssociationsListByResourceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceUri, options }, + listByResourceOperationSpec + ); + } + + /** + * Lists associations for the specified data collection rule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. + * @param options The options parameters. + */ + private _listByRule( + resourceGroupName: string, + dataCollectionRuleName: string, + options?: DataCollectionRuleAssociationsListByRuleOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, dataCollectionRuleName, options }, + listByRuleOperationSpec + ); + } + + /** + * Returns the specified association. + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @param options The options parameters. + */ + get( + resourceUri: string, + associationName: string, + options?: DataCollectionRuleAssociationsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceUri, associationName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates an association. + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @param options The options parameters. + */ + create( + resourceUri: string, + associationName: string, + options?: DataCollectionRuleAssociationsCreateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceUri, associationName, options }, + createOperationSpec + ); + } + + /** + * Deletes an association. + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @param options The options parameters. + */ + delete( + resourceUri: string, + associationName: string, + options?: DataCollectionRuleAssociationsDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceUri, associationName, options }, + deleteOperationSpec + ); + } + + /** + * ListByResourceNext + * @param resourceUri The identifier of the resource. + * @param nextLink The nextLink from the previous successful call to the ListByResource method. + * @param options The options parameters. + */ + private _listByResourceNext( + resourceUri: string, + nextLink: string, + options?: DataCollectionRuleAssociationsListByResourceNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceUri, nextLink, options }, + listByResourceNextOperationSpec + ); + } + + /** + * ListByRuleNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByRule method. + * @param options The options parameters. + */ + private _listByRuleNext( + resourceGroupName: string, + dataCollectionRuleName: string, + nextLink: string, + options?: DataCollectionRuleAssociationsListByRuleNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, dataCollectionRuleName, nextLink, options }, + listByRuleNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByResourceOperationSpec: coreClient.OperationSpec = { + path: + "/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: + Mappers.DataCollectionRuleAssociationProxyOnlyResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseCommonV2 + } + }, + queryParameters: [Parameters.apiVersion12], + urlParameters: [Parameters.$host, Parameters.resourceUri1], + headerParameters: [Parameters.accept], + serializer +}; +const listByRuleOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}/associations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: + Mappers.DataCollectionRuleAssociationProxyOnlyResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseCommonV2 + } + }, + queryParameters: [Parameters.apiVersion12], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.dataCollectionRuleName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DataCollectionRuleAssociationProxyOnlyResource + }, + default: { + bodyMapper: Mappers.ErrorResponseCommonV2 + } + }, + queryParameters: [Parameters.apiVersion12], + urlParameters: [ + Parameters.$host, + Parameters.resourceUri1, + Parameters.associationName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.DataCollectionRuleAssociationProxyOnlyResource + }, + 201: { + bodyMapper: Mappers.DataCollectionRuleAssociationProxyOnlyResource + }, + default: { + bodyMapper: Mappers.ErrorResponseCommonV2 + } + }, + requestBody: Parameters.body2, + queryParameters: [Parameters.apiVersion12], + urlParameters: [ + Parameters.$host, + Parameters.resourceUri1, + Parameters.associationName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponseCommonV2 + } + }, + queryParameters: [Parameters.apiVersion12], + urlParameters: [ + Parameters.$host, + Parameters.resourceUri1, + Parameters.associationName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: + Mappers.DataCollectionRuleAssociationProxyOnlyResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseCommonV2 + } + }, + queryParameters: [Parameters.apiVersion12], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.resourceUri1 + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByRuleNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: + Mappers.DataCollectionRuleAssociationProxyOnlyResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseCommonV2 + } + }, + queryParameters: [Parameters.apiVersion12], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.dataCollectionRuleName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/monitor/arm-monitor/src/operations/dataCollectionRules.ts b/sdk/monitor/arm-monitor/src/operations/dataCollectionRules.ts new file mode 100644 index 000000000000..3a93f3014a56 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operations/dataCollectionRules.ts @@ -0,0 +1,445 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { DataCollectionRules } 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 { + DataCollectionRuleResource, + DataCollectionRulesListByResourceGroupNextOptionalParams, + DataCollectionRulesListByResourceGroupOptionalParams, + DataCollectionRulesListBySubscriptionNextOptionalParams, + DataCollectionRulesListBySubscriptionOptionalParams, + DataCollectionRulesListByResourceGroupResponse, + DataCollectionRulesListBySubscriptionResponse, + DataCollectionRulesGetOptionalParams, + DataCollectionRulesGetResponse, + DataCollectionRulesCreateOptionalParams, + DataCollectionRulesCreateResponse, + DataCollectionRulesUpdateOptionalParams, + DataCollectionRulesUpdateResponse, + DataCollectionRulesDeleteOptionalParams, + DataCollectionRulesListByResourceGroupNextResponse, + DataCollectionRulesListBySubscriptionNextResponse +} from "../models"; + +/// +/** Class containing DataCollectionRules operations. */ +export class DataCollectionRulesImpl implements DataCollectionRules { + private readonly client: MonitorClient; + + /** + * Initialize a new instance of the class DataCollectionRules class. + * @param client Reference to the service client + */ + constructor(client: MonitorClient) { + this.client = client; + } + + /** + * Lists all data collection rules in the specified resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: DataCollectionRulesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: DataCollectionRulesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: DataCollectionRulesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Lists all data collection rules in the specified subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: DataCollectionRulesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: DataCollectionRulesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listBySubscriptionPagingAll( + options?: DataCollectionRulesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Lists all data collection rules in the specified resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: DataCollectionRulesListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Lists all data collection rules in the specified subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: DataCollectionRulesListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * Returns the specified data collection rule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + dataCollectionRuleName: string, + options?: DataCollectionRulesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, dataCollectionRuleName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates a data collection rule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. + * @param options The options parameters. + */ + create( + resourceGroupName: string, + dataCollectionRuleName: string, + options?: DataCollectionRulesCreateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, dataCollectionRuleName, options }, + createOperationSpec + ); + } + + /** + * Updates part of a data collection rule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + dataCollectionRuleName: string, + options?: DataCollectionRulesUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, dataCollectionRuleName, options }, + updateOperationSpec + ); + } + + /** + * Deletes a data collection rule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + dataCollectionRuleName: string, + options?: DataCollectionRulesDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, dataCollectionRuleName, options }, + deleteOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: DataCollectionRulesListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: DataCollectionRulesListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DataCollectionRuleResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseCommonV2 + } + }, + queryParameters: [Parameters.apiVersion12], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/dataCollectionRules", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DataCollectionRuleResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseCommonV2 + } + }, + queryParameters: [Parameters.apiVersion12], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DataCollectionRuleResource + }, + default: { + bodyMapper: Mappers.ErrorResponseCommonV2 + } + }, + queryParameters: [Parameters.apiVersion12], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.dataCollectionRuleName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.DataCollectionRuleResource + }, + 201: { + bodyMapper: Mappers.DataCollectionRuleResource + }, + default: { + bodyMapper: Mappers.ErrorResponseCommonV2 + } + }, + requestBody: Parameters.body3, + queryParameters: [Parameters.apiVersion12], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.dataCollectionRuleName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.DataCollectionRuleResource + }, + default: { + bodyMapper: Mappers.ErrorResponseCommonV2 + } + }, + requestBody: Parameters.body1, + queryParameters: [Parameters.apiVersion12], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.dataCollectionRuleName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponseCommonV2 + } + }, + queryParameters: [Parameters.apiVersion12], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.dataCollectionRuleName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DataCollectionRuleResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseCommonV2 + } + }, + queryParameters: [Parameters.apiVersion12], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DataCollectionRuleResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseCommonV2 + } + }, + queryParameters: [Parameters.apiVersion12], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/monitor/arm-monitor/src/operations/diagnosticSettings.ts b/sdk/monitor/arm-monitor/src/operations/diagnosticSettings.ts new file mode 100644 index 000000000000..b905d7a0fb71 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operations/diagnosticSettings.ts @@ -0,0 +1,172 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { DiagnosticSettings } 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 { + DiagnosticSettingsGetOptionalParams, + DiagnosticSettingsGetResponse, + DiagnosticSettingsResource, + DiagnosticSettingsCreateOrUpdateOptionalParams, + DiagnosticSettingsCreateOrUpdateResponse, + DiagnosticSettingsDeleteOptionalParams, + DiagnosticSettingsListOptionalParams, + DiagnosticSettingsListResponse +} from "../models"; + +/** Class containing DiagnosticSettings operations. */ +export class DiagnosticSettingsImpl implements DiagnosticSettings { + private readonly client: MonitorClient; + + /** + * Initialize a new instance of the class DiagnosticSettings class. + * @param client Reference to the service client + */ + constructor(client: MonitorClient) { + this.client = client; + } + + /** + * Gets the active diagnostic settings for the specified resource. + * @param resourceUri The identifier of the resource. + * @param name The name of the diagnostic setting. + * @param options The options parameters. + */ + get( + resourceUri: string, + name: string, + options?: DiagnosticSettingsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceUri, name, options }, + getOperationSpec + ); + } + + /** + * Creates or updates diagnostic settings for the specified resource. + * @param resourceUri The identifier of the resource. + * @param name The name of the diagnostic setting. + * @param parameters Parameters supplied to the operation. + * @param options The options parameters. + */ + createOrUpdate( + resourceUri: string, + name: string, + parameters: DiagnosticSettingsResource, + options?: DiagnosticSettingsCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceUri, name, parameters, options }, + createOrUpdateOperationSpec + ); + } + + /** + * Deletes existing diagnostic settings for the specified resource. + * @param resourceUri The identifier of the resource. + * @param name The name of the diagnostic setting. + * @param options The options parameters. + */ + delete( + resourceUri: string, + name: string, + options?: DiagnosticSettingsDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceUri, name, options }, + deleteOperationSpec + ); + } + + /** + * Gets the active diagnostic settings list for the specified resource. + * @param resourceUri The identifier of the resource. + * @param options The options parameters. + */ + list( + resourceUri: string, + options?: DiagnosticSettingsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceUri, options }, + listOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DiagnosticSettingsResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion2], + urlParameters: [Parameters.$host, Parameters.resourceUri, Parameters.name], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.DiagnosticSettingsResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion2], + urlParameters: [Parameters.$host, Parameters.resourceUri, Parameters.name], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion2], + urlParameters: [Parameters.$host, Parameters.resourceUri, Parameters.name], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DiagnosticSettingsResourceCollection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion2], + 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 new file mode 100644 index 000000000000..0ba529a76642 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operations/diagnosticSettingsCategory.ts @@ -0,0 +1,102 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { DiagnosticSettingsCategory } 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 { + DiagnosticSettingsCategoryGetOptionalParams, + DiagnosticSettingsCategoryGetResponse, + DiagnosticSettingsCategoryListOptionalParams, + DiagnosticSettingsCategoryListResponse +} from "../models"; + +/** Class containing DiagnosticSettingsCategory operations. */ +export class DiagnosticSettingsCategoryImpl + implements DiagnosticSettingsCategory { + private readonly client: MonitorClient; + + /** + * Initialize a new instance of the class DiagnosticSettingsCategory class. + * @param client Reference to the service client + */ + constructor(client: MonitorClient) { + this.client = client; + } + + /** + * Gets the diagnostic settings category for the specified resource. + * @param resourceUri The identifier of the resource. + * @param name The name of the diagnostic setting. + * @param options The options parameters. + */ + get( + resourceUri: string, + name: string, + options?: DiagnosticSettingsCategoryGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceUri, name, options }, + getOperationSpec + ); + } + + /** + * Lists the diagnostic settings categories for the specified resource. + * @param resourceUri The identifier of the resource. + * @param options The options parameters. + */ + list( + resourceUri: string, + options?: DiagnosticSettingsCategoryListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceUri, options }, + listOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettingsCategories/{name}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DiagnosticSettingsCategoryResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion2], + urlParameters: [Parameters.$host, Parameters.resourceUri, Parameters.name], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettingsCategories", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DiagnosticSettingsCategoryResourceCollection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion2], + urlParameters: [Parameters.$host, Parameters.resourceUri], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/monitor/arm-monitor/src/operations/diagnosticSettingsCategoryOperations.ts b/sdk/monitor/arm-monitor/src/operations/diagnosticSettingsCategoryOperations.ts deleted file mode 100644 index 696518269cd8..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/diagnosticSettingsCategoryOperations.ts +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/diagnosticSettingsCategoryOperationsMappers"; -import * as Parameters from "../models/parameters"; -import { MonitorManagementClientContext } from "../monitorManagementClientContext"; - -/** Class representing a DiagnosticSettingsCategoryOperations. */ -export class DiagnosticSettingsCategoryOperations { - private readonly client: MonitorManagementClientContext; - - /** - * Create a DiagnosticSettingsCategoryOperations. - * @param {MonitorManagementClientContext} client Reference to the service client. - */ - constructor(client: MonitorManagementClientContext) { - this.client = client; - } - - /** - * Gets the diagnostic settings category for the specified resource. - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceUri: string, name: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param callback The callback - */ - get(resourceUri: string, name: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceUri: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceUri: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceUri, - name, - options - }, - getOperationSpec, - callback) as Promise; - } - - /** - * Lists the diagnostic settings categories for the specified resource. - * @param resourceUri The identifier of the resource. - * @param [options] The optional parameters - * @returns Promise - */ - list(resourceUri: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceUri The identifier of the resource. - * @param callback The callback - */ - list(resourceUri: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceUri The identifier of the resource. - * @param options The optional parameters - * @param callback The callback - */ - list(resourceUri: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(resourceUri: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceUri, - options - }, - listOperationSpec, - callback) as Promise; - } -} - -// Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "{resourceUri}/providers/microsoft.insights/diagnosticSettingsCategories/{name}", - urlParameters: [ - Parameters.resourceUri, - Parameters.name - ], - queryParameters: [ - Parameters.apiVersion2 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.DiagnosticSettingsCategoryResource - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "{resourceUri}/providers/microsoft.insights/diagnosticSettingsCategories", - urlParameters: [ - Parameters.resourceUri - ], - queryParameters: [ - Parameters.apiVersion2 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.DiagnosticSettingsCategoryResourceCollection - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; diff --git a/sdk/monitor/arm-monitor/src/operations/diagnosticSettingsOperations.ts b/sdk/monitor/arm-monitor/src/operations/diagnosticSettingsOperations.ts deleted file mode 100644 index 8153aa322d65..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/diagnosticSettingsOperations.ts +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/diagnosticSettingsOperationsMappers"; -import * as Parameters from "../models/parameters"; -import { MonitorManagementClientContext } from "../monitorManagementClientContext"; - -/** Class representing a DiagnosticSettingsOperations. */ -export class DiagnosticSettingsOperations { - private readonly client: MonitorManagementClientContext; - - /** - * Create a DiagnosticSettingsOperations. - * @param {MonitorManagementClientContext} client Reference to the service client. - */ - constructor(client: MonitorManagementClientContext) { - this.client = client; - } - - /** - * Gets the active diagnostic settings for the specified resource. - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceUri: string, name: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param callback The callback - */ - get(resourceUri: string, name: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceUri: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceUri: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceUri, - name, - options - }, - getOperationSpec, - callback) as Promise; - } - - /** - * Creates or updates diagnostic settings for the specified resource. - * @param resourceUri The identifier of the resource. - * @param parameters Parameters supplied to the operation. - * @param name The name of the diagnostic setting. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate(resourceUri: string, parameters: Models.DiagnosticSettingsResource, name: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceUri The identifier of the resource. - * @param parameters Parameters supplied to the operation. - * @param name The name of the diagnostic setting. - * @param callback The callback - */ - createOrUpdate(resourceUri: string, parameters: Models.DiagnosticSettingsResource, name: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceUri The identifier of the resource. - * @param parameters Parameters supplied to the operation. - * @param name The name of the diagnostic setting. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate(resourceUri: string, parameters: Models.DiagnosticSettingsResource, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceUri: string, parameters: Models.DiagnosticSettingsResource, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceUri, - parameters, - name, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; - } - - /** - * Deletes existing diagnostic settings for the specified resource. - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceUri: string, name: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param callback The callback - */ - deleteMethod(resourceUri: string, name: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceUri The identifier of the resource. - * @param name The name of the diagnostic setting. - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod(resourceUri: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceUri: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceUri, - name, - options - }, - deleteMethodOperationSpec, - callback); - } - - /** - * Gets the active diagnostic settings list for the specified resource. - * @param resourceUri The identifier of the resource. - * @param [options] The optional parameters - * @returns Promise - */ - list(resourceUri: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceUri The identifier of the resource. - * @param callback The callback - */ - list(resourceUri: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceUri The identifier of the resource. - * @param options The optional parameters - * @param callback The callback - */ - list(resourceUri: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(resourceUri: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceUri, - options - }, - listOperationSpec, - callback) as Promise; - } -} - -// Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "{resourceUri}/providers/microsoft.insights/diagnosticSettings/{name}", - urlParameters: [ - Parameters.resourceUri, - Parameters.name - ], - queryParameters: [ - Parameters.apiVersion2 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.DiagnosticSettingsResource - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "{resourceUri}/providers/microsoft.insights/diagnosticSettings/{name}", - urlParameters: [ - Parameters.resourceUri, - Parameters.name - ], - queryParameters: [ - Parameters.apiVersion2 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.DiagnosticSettingsResource, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.DiagnosticSettingsResource - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "{resourceUri}/providers/microsoft.insights/diagnosticSettings/{name}", - urlParameters: [ - Parameters.resourceUri, - Parameters.name - ], - queryParameters: [ - Parameters.apiVersion2 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "{resourceUri}/providers/microsoft.insights/diagnosticSettings", - urlParameters: [ - Parameters.resourceUri - ], - queryParameters: [ - Parameters.apiVersion2 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.DiagnosticSettingsResourceCollection - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; diff --git a/sdk/monitor/arm-monitor/src/operations/eventCategories.ts b/sdk/monitor/arm-monitor/src/operations/eventCategories.ts index 67bd8f4311b4..ee70105354f5 100644 --- a/sdk/monitor/arm-monitor/src/operations/eventCategories.ts +++ b/sdk/monitor/arm-monitor/src/operations/eventCategories.ts @@ -1,69 +1,90 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/eventCategoriesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { EventCategories } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MonitorManagementClientContext } from "../monitorManagementClientContext"; +import { MonitorClient } from "../monitorClient"; +import { + LocalizableString, + EventCategoriesListOptionalParams, + EventCategoriesListResponse +} from "../models"; -/** Class representing a EventCategories. */ -export class EventCategories { - private readonly client: MonitorManagementClientContext; +/// +/** Class containing EventCategories operations. */ +export class EventCategoriesImpl implements EventCategories { + private readonly client: MonitorClient; /** - * Create a EventCategories. - * @param {MonitorManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class EventCategories class. + * @param client Reference to the service client */ - constructor(client: MonitorManagementClientContext) { + constructor(client: MonitorClient) { this.client = client; } /** - * Get the list of available event categories supported in the Activity Logs Service.
The - * current list includes the following: Administrative, Security, ServiceHealth, Alert, - * Recommendation, Policy. - * @param [options] The optional parameters - * @returns Promise + * Get the list of available event categories supported in the Activity Logs Service.
The current + * list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. + * @param options The options parameters. */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; + public list( + options?: EventCategoriesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: EventCategoriesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + } + + private async *listPagingAll( + options?: EventCategoriesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + /** - * @param options The optional parameters - * @param callback The callback + * Get the list of available event categories supported in the Activity Logs Service.
The current + * list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. + * @param options The options parameters. */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback) as Promise; + private _list( + options?: EventCategoriesListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Insights/eventcategories", httpMethod: "GET", - path: "providers/microsoft.insights/eventcategories", - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.EventCategoryCollection @@ -72,5 +93,8 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + 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 a7964c5cac32..5096ba531b24 100644 --- a/sdk/monitor/arm-monitor/src/operations/index.ts +++ b/sdk/monitor/arm-monitor/src/operations/index.ts @@ -1,11 +1,9 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export * from "./autoscaleSettings"; @@ -13,19 +11,26 @@ export * from "./operations"; export * from "./alertRuleIncidents"; export * from "./alertRules"; export * from "./logProfiles"; -export * from "./diagnosticSettingsOperations"; -export * from "./diagnosticSettingsCategoryOperations"; +export * from "./diagnosticSettings"; +export * from "./diagnosticSettingsCategory"; export * from "./actionGroups"; -export * from "./activityLogAlerts"; export * from "./activityLogs"; export * from "./eventCategories"; export * from "./tenantActivityLogs"; export * from "./metricDefinitions"; export * from "./metrics"; -export * from "./metricBaseline"; export * from "./baselines"; export * from "./metricAlerts"; export * from "./metricAlertsStatus"; export * from "./scheduledQueryRules"; export * from "./metricNamespaces"; export * from "./vMInsights"; +export * from "./privateLinkScopes"; +export * from "./privateLinkScopeOperationStatus"; +export * from "./privateLinkResources"; +export * from "./privateEndpointConnections"; +export * from "./privateLinkScopedResources"; +export * from "./activityLogAlerts"; +export * from "./dataCollectionEndpoints"; +export * from "./dataCollectionRuleAssociations"; +export * from "./dataCollectionRules"; diff --git a/sdk/monitor/arm-monitor/src/operations/logProfiles.ts b/sdk/monitor/arm-monitor/src/operations/logProfiles.ts index 1ae52e5613b7..4a47c6c5cb43 100644 --- a/sdk/monitor/arm-monitor/src/operations/logProfiles.ts +++ b/sdk/monitor/arm-monitor/src/operations/logProfiles.ts @@ -1,213 +1,174 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/logProfilesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { LogProfiles } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MonitorManagementClientContext } from "../monitorManagementClientContext"; +import { MonitorClient } from "../monitorClient"; +import { + LogProfileResource, + LogProfilesListOptionalParams, + LogProfilesDeleteOptionalParams, + LogProfilesGetOptionalParams, + LogProfilesGetResponse, + LogProfilesCreateOrUpdateOptionalParams, + LogProfilesCreateOrUpdateResponse, + LogProfileResourcePatch, + LogProfilesUpdateOptionalParams, + LogProfilesUpdateResponse, + LogProfilesListResponse +} from "../models"; -/** Class representing a LogProfiles. */ -export class LogProfiles { - private readonly client: MonitorManagementClientContext; +/// +/** Class containing LogProfiles operations. */ +export class LogProfilesImpl implements LogProfiles { + private readonly client: MonitorClient; /** - * Create a LogProfiles. - * @param {MonitorManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class LogProfiles class. + * @param client Reference to the service client */ - constructor(client: MonitorManagementClientContext) { + constructor(client: MonitorClient) { this.client = client; } /** - * Deletes the log profile. - * @param logProfileName The name of the log profile. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(logProfileName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param logProfileName The name of the log profile. - * @param callback The callback - */ - deleteMethod(logProfileName: string, callback: msRest.ServiceCallback): void; + * List the log profiles. + * @param options The options parameters. + */ + public list( + options?: LogProfilesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: LogProfilesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + } + + private async *listPagingAll( + options?: LogProfilesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + /** + * Deletes the log profile. * @param logProfileName The name of the log profile. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(logProfileName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(logProfileName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + logProfileName: string, + options?: LogProfilesDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - logProfileName, - options - }, - deleteMethodOperationSpec, - callback); + { logProfileName, options }, + deleteOperationSpec + ); } /** * Gets the log profile. * @param logProfileName The name of the log profile. - * @param [options] The optional parameters - * @returns Promise - */ - get(logProfileName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param logProfileName The name of the log profile. - * @param callback The callback - */ - get(logProfileName: string, callback: msRest.ServiceCallback): void; - /** - * @param logProfileName The name of the log profile. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(logProfileName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(logProfileName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + logProfileName: string, + options?: LogProfilesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - logProfileName, - options - }, - getOperationSpec, - callback) as Promise; + { logProfileName, options }, + getOperationSpec + ); } /** * Create or update a log profile in Azure Monitoring REST API. * @param logProfileName The name of the log profile. * @param parameters Parameters supplied to the operation. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate(logProfileName: string, parameters: Models.LogProfileResource, options?: msRest.RequestOptionsBase): Promise; - /** - * @param logProfileName The name of the log profile. - * @param parameters Parameters supplied to the operation. - * @param callback The callback - */ - createOrUpdate(logProfileName: string, parameters: Models.LogProfileResource, callback: msRest.ServiceCallback): void; - /** - * @param logProfileName The name of the log profile. - * @param parameters Parameters supplied to the operation. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate(logProfileName: string, parameters: Models.LogProfileResource, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(logProfileName: string, parameters: Models.LogProfileResource, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + logProfileName: string, + parameters: LogProfileResource, + options?: LogProfilesCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - logProfileName, - parameters, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; + { logProfileName, parameters, options }, + createOrUpdateOperationSpec + ); } /** * Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. * @param logProfileName The name of the log profile. * @param logProfilesResource Parameters supplied to the operation. - * @param [options] The optional parameters - * @returns Promise - */ - update(logProfileName: string, logProfilesResource: Models.LogProfileResourcePatch, options?: msRest.RequestOptionsBase): Promise; - /** - * @param logProfileName The name of the log profile. - * @param logProfilesResource Parameters supplied to the operation. - * @param callback The callback + * @param options The options parameters. */ - update(logProfileName: string, logProfilesResource: Models.LogProfileResourcePatch, callback: msRest.ServiceCallback): void; - /** - * @param logProfileName The name of the log profile. - * @param logProfilesResource Parameters supplied to the operation. - * @param options The optional parameters - * @param callback The callback - */ - update(logProfileName: string, logProfilesResource: Models.LogProfileResourcePatch, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(logProfileName: string, logProfilesResource: Models.LogProfileResourcePatch, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + logProfileName: string, + logProfilesResource: LogProfileResourcePatch, + options?: LogProfilesUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - logProfileName, - logProfilesResource, - options - }, - updateOperationSpec, - callback) as Promise; + { logProfileName, logProfilesResource, options }, + updateOperationSpec + ); } /** * List the log profiles. - * @param [options] The optional parameters - * @returns Promise - */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback) as Promise; + private _list( + options?: LogProfilesListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const deleteMethodOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName}", httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}", + responses: { 200: {} }, + queryParameters: [Parameters.apiVersion1], urlParameters: [ - Parameters.logProfileName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.$host, + Parameters.subscriptionId, + Parameters.logProfileName ], - responses: { - 200: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, serializer }; - -const getOperationSpec: msRest.OperationSpec = { +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}", - urlParameters: [ - Parameters.logProfileName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.LogProfileResource @@ -216,60 +177,39 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion1], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.logProfileName + ], + headerParameters: [Parameters.accept], serializer }; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName}", httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}", - urlParameters: [ - Parameters.logProfileName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.LogProfileResource, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.LogProfileResource - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}", + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.logProfileName ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "logProfilesResource", - mapper: { - ...Mappers.LogProfileResourcePatch, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.LogProfileResource @@ -278,28 +218,28 @@ const updateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.logProfilesResource, + queryParameters: [Parameters.apiVersion1], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.logProfileName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listOperationSpec: msRest.OperationSpec = { +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.LogProfileCollection - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion1], + 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 f7d435bd6048..b80c03b77fbc 100644 --- a/sdk/monitor/arm-monitor/src/operations/metricAlerts.ts +++ b/sdk/monitor/arm-monitor/src/operations/metricAlerts.ts @@ -1,234 +1,232 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/metricAlertsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { MetricAlerts } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MonitorManagementClientContext } from "../monitorManagementClientContext"; +import { MonitorClient } from "../monitorClient"; +import { + MetricAlertResource, + MetricAlertsListBySubscriptionOptionalParams, + MetricAlertsListByResourceGroupOptionalParams, + MetricAlertsListBySubscriptionResponse, + MetricAlertsListByResourceGroupResponse, + MetricAlertsGetOptionalParams, + MetricAlertsGetResponse, + MetricAlertsCreateOrUpdateOptionalParams, + MetricAlertsCreateOrUpdateResponse, + MetricAlertResourcePatch, + MetricAlertsUpdateOptionalParams, + MetricAlertsUpdateResponse, + MetricAlertsDeleteOptionalParams +} from "../models"; -/** Class representing a MetricAlerts. */ -export class MetricAlerts { - private readonly client: MonitorManagementClientContext; +/// +/** Class containing MetricAlerts operations. */ +export class MetricAlertsImpl implements MetricAlerts { + private readonly client: MonitorClient; /** - * Create a MetricAlerts. - * @param {MonitorManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class MetricAlerts class. + * @param client Reference to the service client */ - constructor(client: MonitorManagementClientContext) { + constructor(client: MonitorClient) { this.client = client; } /** * Retrieve alert rule definitions in a subscription. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listBySubscription(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - listBySubscription(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - listBySubscription(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listBySubscription(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options + public listBySubscription( + options?: MetricAlertsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listBySubscriptionOperationSpec, - callback) as Promise; + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: MetricAlertsListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(options); + yield result.value || []; + } + + private async *listBySubscriptionPagingAll( + options?: MetricAlertsListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } } /** * Retrieve alert rule definitions in a resource group. - * @param resourceGroupName The name of the resource group. - * @param [options] The optional parameters - * @returns Promise + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + public listByResourceGroup( + resourceGroupName: string, + options?: MetricAlertsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: MetricAlertsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: MetricAlertsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + /** - * @param resourceGroupName The name of the resource group. - * @param callback The callback + * Retrieve alert rule definitions in a subscription. + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + private _listBySubscription( + options?: MetricAlertsListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + /** - * @param resourceGroupName The name of the resource group. - * @param options The optional parameters - * @param callback The callback + * Retrieve alert rule definitions in a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroup( + resourceGroupName: string, + options?: MetricAlertsListByResourceGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - listByResourceGroupOperationSpec, - callback) as Promise; + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); } /** * Retrieve an alert rule definition. - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, ruleName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param callback The callback - */ - get(resourceGroupName: string, ruleName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ruleName The name of the rule. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, ruleName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, ruleName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + ruleName: string, + options?: MetricAlertsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - ruleName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, ruleName, options }, + getOperationSpec + ); } /** * Create or update an metric alert definition. - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate(resourceGroupName: string, ruleName: string, parameters: Models.MetricAlertResource, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, ruleName: string, parameters: Models.MetricAlertResource, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ruleName The name of the rule. * @param parameters The parameters of the rule to create or update. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, ruleName: string, parameters: Models.MetricAlertResource, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, ruleName: string, parameters: Models.MetricAlertResource, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + resourceGroupName: string, + ruleName: string, + parameters: MetricAlertResource, + options?: MetricAlertsCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - ruleName, - parameters, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; + { resourceGroupName, ruleName, parameters, options }, + createOrUpdateOperationSpec + ); } /** * Update an metric alert definition. - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to update. - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, ruleName: string, parameters: Models.MetricAlertResourcePatch, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ruleName The name of the rule. * @param parameters The parameters of the rule to update. - * @param callback The callback + * @param options The options parameters. */ - update(resourceGroupName: string, ruleName: string, parameters: Models.MetricAlertResourcePatch, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to update. - * @param options The optional parameters - * @param callback The callback - */ - update(resourceGroupName: string, ruleName: string, parameters: Models.MetricAlertResourcePatch, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, ruleName: string, parameters: Models.MetricAlertResourcePatch, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + resourceGroupName: string, + ruleName: string, + parameters: MetricAlertResourcePatch, + options?: MetricAlertsUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - ruleName, - parameters, - options - }, - updateOperationSpec, - callback) as Promise; + { resourceGroupName, ruleName, parameters, options }, + updateOperationSpec + ); } /** * Delete an alert rule definition. - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, ruleName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ruleName The name of the rule. - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, ruleName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, ruleName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, ruleName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + ruleName: string, + options?: MetricAlertsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - ruleName, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, ruleName, options }, + deleteOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listBySubscriptionOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metricAlerts", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Insights/metricAlerts", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion8 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.MetricAlertResourceCollection @@ -237,22 +235,15 @@ const listBySubscriptionOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion6], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion8 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.MetricAlertResourceCollection @@ -261,23 +252,19 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}", + queryParameters: [Parameters.apiVersion6], urlParameters: [ - Parameters.subscriptionId, + Parameters.$host, Parameters.resourceGroupName, - Parameters.ruleName - ], - queryParameters: [ - Parameters.apiVersion8 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.subscriptionId ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.MetricAlertResource @@ -286,30 +273,20 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}", + queryParameters: [Parameters.apiVersion6], urlParameters: [ - Parameters.subscriptionId, + Parameters.$host, Parameters.resourceGroupName, + Parameters.subscriptionId, Parameters.ruleName ], - queryParameters: [ - Parameters.apiVersion8 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.MetricAlertResource, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.MetricAlertResource @@ -318,30 +295,22 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}", + requestBody: Parameters.parameters4, + queryParameters: [Parameters.apiVersion6], urlParameters: [ - Parameters.subscriptionId, + Parameters.$host, Parameters.resourceGroupName, + Parameters.subscriptionId, Parameters.ruleName ], - queryParameters: [ - Parameters.apiVersion8 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.MetricAlertResourcePatch, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.MetricAlertResource @@ -350,29 +319,36 @@ const updateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}", + requestBody: Parameters.parameters5, + queryParameters: [Parameters.apiVersion6], urlParameters: [ - Parameters.subscriptionId, + Parameters.$host, Parameters.resourceGroupName, + Parameters.subscriptionId, Parameters.ruleName ], - queryParameters: [ - Parameters.apiVersion8 - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion6], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.ruleName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/monitor/arm-monitor/src/operations/metricAlertsStatus.ts b/sdk/monitor/arm-monitor/src/operations/metricAlertsStatus.ts index 018c13a6bff6..7f9330532cb9 100644 --- a/sdk/monitor/arm-monitor/src/operations/metricAlertsStatus.ts +++ b/sdk/monitor/arm-monitor/src/operations/metricAlertsStatus.ts @@ -1,116 +1,78 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/metricAlertsStatusMappers"; +import { MetricAlertsStatus } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MonitorManagementClientContext } from "../monitorManagementClientContext"; +import { MonitorClient } from "../monitorClient"; +import { + MetricAlertsStatusListOptionalParams, + MetricAlertsStatusListResponse, + MetricAlertsStatusListByNameOptionalParams, + MetricAlertsStatusListByNameResponse +} from "../models"; -/** Class representing a MetricAlertsStatus. */ -export class MetricAlertsStatus { - private readonly client: MonitorManagementClientContext; +/** Class containing MetricAlertsStatus operations. */ +export class MetricAlertsStatusImpl implements MetricAlertsStatus { + private readonly client: MonitorClient; /** - * Create a MetricAlertsStatus. - * @param {MonitorManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class MetricAlertsStatus class. + * @param client Reference to the service client */ - constructor(client: MonitorManagementClientContext) { + constructor(client: MonitorClient) { this.client = client; } /** * Retrieve an alert rule status. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ruleName The name of the rule. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(resourceGroupName: string, ruleName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param callback The callback - */ - list(resourceGroupName: string, ruleName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param options The optional parameters - * @param callback The callback - */ - list(resourceGroupName: string, ruleName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(resourceGroupName: string, ruleName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + list( + resourceGroupName: string, + ruleName: string, + options?: MetricAlertsStatusListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - ruleName, - options - }, - listOperationSpec, - callback) as Promise; + { resourceGroupName, ruleName, options }, + listOperationSpec + ); } /** * Retrieve an alert rule status. - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param statusName The name of the status. - * @param [options] The optional parameters - * @returns Promise - */ - listByName(resourceGroupName: string, ruleName: string, statusName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param statusName The name of the status. - * @param callback The callback - */ - listByName(resourceGroupName: string, ruleName: string, statusName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ruleName The name of the rule. * @param statusName The name of the status. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByName(resourceGroupName: string, ruleName: string, statusName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByName(resourceGroupName: string, ruleName: string, statusName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listByName( + resourceGroupName: string, + ruleName: string, + statusName: string, + options?: MetricAlertsStatusListByNameOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - ruleName, - statusName, - options - }, - listByNameOperationSpec, - callback) as Promise; + { resourceGroupName, ruleName, statusName, options }, + listByNameOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}/status", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}/status", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.ruleName - ], - queryParameters: [ - Parameters.apiVersion8 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.MetricAlertStatusCollection @@ -119,24 +81,20 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listByNameOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}/status/{statusName}", + queryParameters: [Parameters.apiVersion6], urlParameters: [ - Parameters.subscriptionId, + Parameters.$host, Parameters.resourceGroupName, - Parameters.ruleName, - Parameters.statusName - ], - queryParameters: [ - Parameters.apiVersion8 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.subscriptionId, + Parameters.ruleName ], + headerParameters: [Parameters.accept], + serializer +}; +const listByNameOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}/status/{statusName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.MetricAlertStatusCollection @@ -145,5 +103,14 @@ const listByNameOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion6], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.ruleName, + Parameters.statusName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/monitor/arm-monitor/src/operations/metricBaseline.ts b/sdk/monitor/arm-monitor/src/operations/metricBaseline.ts deleted file mode 100644 index 0cd73b9d1c3e..000000000000 --- a/sdk/monitor/arm-monitor/src/operations/metricBaseline.ts +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/metricBaselineMappers"; -import * as Parameters from "../models/parameters"; -import { MonitorManagementClientContext } from "../monitorManagementClientContext"; - -/** Class representing a MetricBaseline. */ -export class MetricBaseline { - private readonly client: MonitorManagementClientContext; - - /** - * Create a MetricBaseline. - * @param {MonitorManagementClientContext} client Reference to the service client. - */ - constructor(client: MonitorManagementClientContext) { - this.client = client; - } - - /** - * **Gets the baseline values for a specific metric**. - * @param resourceUri The identifier of the resource. It has the following structure: - * subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - * For example: - * subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1 - * @param metricName The name of the metric to retrieve the baseline for. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceUri: string, metricName: string, options?: Models.MetricBaselineGetOptionalParams): Promise; - /** - * @param resourceUri The identifier of the resource. It has the following structure: - * subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - * For example: - * subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1 - * @param metricName The name of the metric to retrieve the baseline for. - * @param callback The callback - */ - get(resourceUri: string, metricName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceUri The identifier of the resource. It has the following structure: - * subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - * For example: - * subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1 - * @param metricName The name of the metric to retrieve the baseline for. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceUri: string, metricName: string, options: Models.MetricBaselineGetOptionalParams, callback: msRest.ServiceCallback): void; - get(resourceUri: string, metricName: string, options?: Models.MetricBaselineGetOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceUri, - metricName, - options - }, - getOperationSpec, - callback) as Promise; - } - - /** - * **Lists the baseline values for a resource**. - * @param resourceUri The identifier of the resource. It has the following structure: - * subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - * For example: - * subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1 - * @param timeSeriesInformation Information that need to be specified to calculate a baseline on a - * time series. - * @param [options] The optional parameters - * @returns Promise - */ - calculateBaseline(resourceUri: string, timeSeriesInformation: Models.TimeSeriesInformation, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceUri The identifier of the resource. It has the following structure: - * subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - * For example: - * subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1 - * @param timeSeriesInformation Information that need to be specified to calculate a baseline on a - * time series. - * @param callback The callback - */ - calculateBaseline(resourceUri: string, timeSeriesInformation: Models.TimeSeriesInformation, callback: msRest.ServiceCallback): void; - /** - * @param resourceUri The identifier of the resource. It has the following structure: - * subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - * For example: - * subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1 - * @param timeSeriesInformation Information that need to be specified to calculate a baseline on a - * time series. - * @param options The optional parameters - * @param callback The callback - */ - calculateBaseline(resourceUri: string, timeSeriesInformation: Models.TimeSeriesInformation, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - calculateBaseline(resourceUri: string, timeSeriesInformation: Models.TimeSeriesInformation, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceUri, - timeSeriesInformation, - options - }, - calculateBaselineOperationSpec, - callback) as Promise; - } -} - -// Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "{resourceUri}/providers/microsoft.insights/baseline/{metricName}", - urlParameters: [ - Parameters.resourceUri, - Parameters.metricName - ], - queryParameters: [ - Parameters.timespan, - Parameters.interval, - Parameters.aggregation, - Parameters.sensitivities, - Parameters.resultType, - Parameters.apiVersion6 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.BaselineResponse - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const calculateBaselineOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "{resourceUri}/providers/microsoft.insights/calculatebaseline", - urlParameters: [ - Parameters.resourceUri - ], - queryParameters: [ - Parameters.apiVersion6 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "timeSeriesInformation", - mapper: { - ...Mappers.TimeSeriesInformation, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.CalculateBaselineResponse - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; diff --git a/sdk/monitor/arm-monitor/src/operations/metricDefinitions.ts b/sdk/monitor/arm-monitor/src/operations/metricDefinitions.ts index 23a9932d767b..1f173b4709c2 100644 --- a/sdk/monitor/arm-monitor/src/operations/metricDefinitions.ts +++ b/sdk/monitor/arm-monitor/src/operations/metricDefinitions.ts @@ -1,75 +1,97 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/metricDefinitionsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { MetricDefinitions } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MonitorManagementClientContext } from "../monitorManagementClientContext"; +import { MonitorClient } from "../monitorClient"; +import { + MetricDefinition, + MetricDefinitionsListOptionalParams, + MetricDefinitionsListResponse +} from "../models"; -/** Class representing a MetricDefinitions. */ -export class MetricDefinitions { - private readonly client: MonitorManagementClientContext; +/// +/** Class containing MetricDefinitions operations. */ +export class MetricDefinitionsImpl implements MetricDefinitions { + private readonly client: MonitorClient; /** - * Create a MetricDefinitions. - * @param {MonitorManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class MetricDefinitions class. + * @param client Reference to the service client */ - constructor(client: MonitorManagementClientContext) { + constructor(client: MonitorClient) { this.client = client; } /** * Lists the metric definitions for the resource. * @param resourceUri The identifier of the resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(resourceUri: string, options?: Models.MetricDefinitionsListOptionalParams): Promise; - /** - * @param resourceUri The identifier of the resource. - * @param callback The callback - */ - list(resourceUri: string, callback: msRest.ServiceCallback): void; + public list( + resourceUri: string, + options?: MetricDefinitionsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceUri, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceUri, options); + } + }; + } + + private async *listPagingPage( + resourceUri: string, + options?: MetricDefinitionsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceUri, options); + yield result.value || []; + } + + private async *listPagingAll( + resourceUri: string, + options?: MetricDefinitionsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(resourceUri, options)) { + yield* page; + } + } + /** + * Lists the metric definitions for the resource. * @param resourceUri The identifier of the resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - list(resourceUri: string, options: Models.MetricDefinitionsListOptionalParams, callback: msRest.ServiceCallback): void; - list(resourceUri: string, options?: Models.MetricDefinitionsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _list( + resourceUri: string, + options?: MetricDefinitionsListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceUri, - options - }, - listOperationSpec, - callback) as Promise; + { resourceUri, options }, + listOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/{resourceUri}/providers/Microsoft.Insights/metricDefinitions", httpMethod: "GET", - path: "{resourceUri}/providers/microsoft.insights/metricDefinitions", - urlParameters: [ - Parameters.resourceUri - ], - queryParameters: [ - Parameters.apiVersion5, - Parameters.metricnamespace - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.MetricDefinitionCollection @@ -78,5 +100,8 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion4, 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 447750b8340e..32aa4eb89e9b 100644 --- a/sdk/monitor/arm-monitor/src/operations/metricNamespaces.ts +++ b/sdk/monitor/arm-monitor/src/operations/metricNamespaces.ts @@ -1,75 +1,97 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/metricNamespacesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { MetricNamespaces } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MonitorManagementClientContext } from "../monitorManagementClientContext"; +import { MonitorClient } from "../monitorClient"; +import { + MetricNamespace, + MetricNamespacesListOptionalParams, + MetricNamespacesListResponse +} from "../models"; -/** Class representing a MetricNamespaces. */ -export class MetricNamespaces { - private readonly client: MonitorManagementClientContext; +/// +/** Class containing MetricNamespaces operations. */ +export class MetricNamespacesImpl implements MetricNamespaces { + private readonly client: MonitorClient; /** - * Create a MetricNamespaces. - * @param {MonitorManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class MetricNamespaces class. + * @param client Reference to the service client */ - constructor(client: MonitorManagementClientContext) { + constructor(client: MonitorClient) { this.client = client; } /** * Lists the metric namespaces for the resource. * @param resourceUri The identifier of the resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(resourceUri: string, options?: Models.MetricNamespacesListOptionalParams): Promise; - /** - * @param resourceUri The identifier of the resource. - * @param callback The callback - */ - list(resourceUri: string, callback: msRest.ServiceCallback): void; + public list( + resourceUri: string, + options?: MetricNamespacesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceUri, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceUri, options); + } + }; + } + + private async *listPagingPage( + resourceUri: string, + options?: MetricNamespacesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceUri, options); + yield result.value || []; + } + + private async *listPagingAll( + resourceUri: string, + options?: MetricNamespacesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(resourceUri, options)) { + yield* page; + } + } + /** + * Lists the metric namespaces for the resource. * @param resourceUri The identifier of the resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - list(resourceUri: string, options: Models.MetricNamespacesListOptionalParams, callback: msRest.ServiceCallback): void; - list(resourceUri: string, options?: Models.MetricNamespacesListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _list( + resourceUri: string, + options?: MetricNamespacesListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceUri, - options - }, - listOperationSpec, - callback) as Promise; + { resourceUri, options }, + listOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/{resourceUri}/providers/microsoft.insights/metricNamespaces", httpMethod: "GET", - path: "{resourceUri}/providers/microsoft.insights/metricNamespaces", - urlParameters: [ - Parameters.resourceUri - ], - queryParameters: [ - Parameters.apiVersion10, - Parameters.startTime - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.MetricNamespaceCollection @@ -78,5 +100,8 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion8, Parameters.startTime], + urlParameters: [Parameters.$host, Parameters.resourceUri], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/monitor/arm-monitor/src/operations/metrics.ts b/sdk/monitor/arm-monitor/src/operations/metrics.ts index 9f613ea4236f..a374ed7772ac 100644 --- a/sdk/monitor/arm-monitor/src/operations/metrics.ts +++ b/sdk/monitor/arm-monitor/src/operations/metrics.ts @@ -1,83 +1,51 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/metricsMappers"; +import { Metrics } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MonitorManagementClientContext } from "../monitorManagementClientContext"; +import { MonitorClient } from "../monitorClient"; +import { MetricsListOptionalParams, MetricsListResponse } from "../models"; -/** Class representing a Metrics. */ -export class Metrics { - private readonly client: MonitorManagementClientContext; +/** Class containing Metrics operations. */ +export class MetricsImpl implements Metrics { + private readonly client: MonitorClient; /** - * Create a Metrics. - * @param {MonitorManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Metrics class. + * @param client Reference to the service client */ - constructor(client: MonitorManagementClientContext) { + constructor(client: MonitorClient) { this.client = client; } /** * **Lists the metric values for a resource**. * @param resourceUri The identifier of the resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(resourceUri: string, options?: Models.MetricsListOptionalParams): Promise; - /** - * @param resourceUri The identifier of the resource. - * @param callback The callback - */ - list(resourceUri: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceUri The identifier of the resource. - * @param options The optional parameters - * @param callback The callback - */ - list(resourceUri: string, options: Models.MetricsListOptionalParams, callback: msRest.ServiceCallback): void; - list(resourceUri: string, options?: Models.MetricsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + list( + resourceUri: string, + options?: MetricsListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceUri, - options - }, - listOperationSpec, - callback) as Promise; + { resourceUri, options }, + listOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/{resourceUri}/providers/Microsoft.Insights/metrics", httpMethod: "GET", - path: "{resourceUri}/providers/microsoft.insights/metrics", - urlParameters: [ - Parameters.resourceUri - ], - queryParameters: [ - Parameters.timespan, - Parameters.interval, - Parameters.metricnames, - Parameters.aggregation, - Parameters.top, - Parameters.orderby, - Parameters.filter1, - Parameters.resultType, - Parameters.apiVersion5, - Parameters.metricnamespace - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.Response @@ -86,5 +54,19 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [ + Parameters.filter1, + Parameters.apiVersion4, + Parameters.metricnamespace, + Parameters.timespan, + Parameters.interval, + Parameters.metricnames, + Parameters.aggregation, + Parameters.top, + Parameters.orderby, + Parameters.resultType + ], + urlParameters: [Parameters.$host, Parameters.resourceUri], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/monitor/arm-monitor/src/operations/operations.ts b/sdk/monitor/arm-monitor/src/operations/operations.ts index a6faf8a59a89..73674c9395f8 100644 --- a/sdk/monitor/arm-monitor/src/operations/operations.ts +++ b/sdk/monitor/arm-monitor/src/operations/operations.ts @@ -1,74 +1,56 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/operationsMappers"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MonitorManagementClientContext } from "../monitorManagementClientContext"; +import { MonitorClient } from "../monitorClient"; +import { + OperationsListOptionalParams, + OperationsListResponse +} from "../models"; -/** Class representing a Operations. */ -export class Operations { - private readonly client: MonitorManagementClientContext; +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: MonitorClient; /** - * Create a Operations. - * @param {MonitorManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client */ - constructor(client: MonitorManagementClientContext) { + constructor(client: MonitorClient) { this.client = client; } /** * Lists all of the available operations from Microsoft.Insights provider. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback) as Promise; + list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Insights/operations", httpMethod: "GET", - path: "providers/microsoft.insights/operations", - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.OperationListResult - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/monitor/arm-monitor/src/operations/privateEndpointConnections.ts b/sdk/monitor/arm-monitor/src/operations/privateEndpointConnections.ts new file mode 100644 index 000000000000..23d81a18fab0 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operations/privateEndpointConnections.ts @@ -0,0 +1,462 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { PrivateEndpointConnections } 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 { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + PrivateEndpointConnection, + PrivateEndpointConnectionsListByPrivateLinkScopeNextOptionalParams, + PrivateEndpointConnectionsListByPrivateLinkScopeOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse, + PrivateEndpointConnectionsCreateOrUpdateOptionalParams, + PrivateEndpointConnectionsCreateOrUpdateResponse, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsListByPrivateLinkScopeResponse, + PrivateEndpointConnectionsListByPrivateLinkScopeNextResponse +} from "../models"; + +/// +/** Class containing PrivateEndpointConnections operations. */ +export class PrivateEndpointConnectionsImpl + implements PrivateEndpointConnections { + private readonly client: MonitorClient; + + /** + * Initialize a new instance of the class PrivateEndpointConnections class. + * @param client Reference to the service client + */ + constructor(client: MonitorClient) { + this.client = client; + } + + /** + * Gets all private endpoint connections on a private link scope. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param options The options parameters. + */ + public listByPrivateLinkScope( + resourceGroupName: string, + scopeName: string, + options?: PrivateEndpointConnectionsListByPrivateLinkScopeOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByPrivateLinkScopePagingAll( + resourceGroupName, + scopeName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByPrivateLinkScopePagingPage( + resourceGroupName, + scopeName, + options + ); + } + }; + } + + private async *listByPrivateLinkScopePagingPage( + resourceGroupName: string, + scopeName: string, + options?: PrivateEndpointConnectionsListByPrivateLinkScopeOptionalParams + ): AsyncIterableIterator { + let result = await this._listByPrivateLinkScope( + resourceGroupName, + scopeName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByPrivateLinkScopeNext( + resourceGroupName, + scopeName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByPrivateLinkScopePagingAll( + resourceGroupName: string, + scopeName: string, + options?: PrivateEndpointConnectionsListByPrivateLinkScopeOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByPrivateLinkScopePagingPage( + resourceGroupName, + scopeName, + options + )) { + yield* page; + } + } + + /** + * Gets a private endpoint connection. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + scopeName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, scopeName, privateEndpointConnectionName, options }, + getOperationSpec + ); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + scopeName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PrivateEndpointConnectionsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = 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 = new LroImpl( + sendOperation, + { + resourceGroupName, + scopeName, + privateEndpointConnectionName, + parameters, + options + }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + scopeName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + scopeName, + privateEndpointConnectionName, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a private endpoint connection with a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + scopeName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = 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 = new LroImpl( + sendOperation, + { resourceGroupName, scopeName, privateEndpointConnectionName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Deletes a private endpoint connection with a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + scopeName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + scopeName, + privateEndpointConnectionName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Gets all private endpoint connections on a private link scope. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param options The options parameters. + */ + private _listByPrivateLinkScope( + resourceGroupName: string, + scopeName: string, + options?: PrivateEndpointConnectionsListByPrivateLinkScopeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, scopeName, options }, + listByPrivateLinkScopeOperationSpec + ); + } + + /** + * ListByPrivateLinkScopeNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param nextLink The nextLink from the previous successful call to the ListByPrivateLinkScope method. + * @param options The options parameters. + */ + private _listByPrivateLinkScopeNext( + resourceGroupName: string, + scopeName: string, + nextLink: string, + options?: PrivateEndpointConnectionsListByPrivateLinkScopeNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, scopeName, nextLink, options }, + listByPrivateLinkScopeNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + } + }, + queryParameters: [Parameters.apiVersion10], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.scopeName, + Parameters.privateEndpointConnectionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + 201: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + 202: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + 204: { + bodyMapper: Mappers.PrivateEndpointConnection + } + }, + requestBody: Parameters.parameters8, + queryParameters: [Parameters.apiVersion10], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.scopeName, + Parameters.privateEndpointConnectionName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "DELETE", + responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + queryParameters: [Parameters.apiVersion10], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.scopeName, + Parameters.privateEndpointConnectionName + ], + serializer +}; +const listByPrivateLinkScopeOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/privateEndpointConnections", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnectionListResult + } + }, + queryParameters: [Parameters.apiVersion10], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.scopeName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByPrivateLinkScopeNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnectionListResult + } + }, + queryParameters: [Parameters.apiVersion10], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.scopeName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/monitor/arm-monitor/src/operations/privateLinkResources.ts b/sdk/monitor/arm-monitor/src/operations/privateLinkResources.ts new file mode 100644 index 000000000000..cc676d114ba7 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operations/privateLinkResources.ts @@ -0,0 +1,224 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { PrivateLinkResources } 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 { + PrivateLinkResource, + PrivateLinkResourcesListByPrivateLinkScopeNextOptionalParams, + PrivateLinkResourcesListByPrivateLinkScopeOptionalParams, + PrivateLinkResourcesListByPrivateLinkScopeResponse, + PrivateLinkResourcesGetOptionalParams, + PrivateLinkResourcesGetResponse, + PrivateLinkResourcesListByPrivateLinkScopeNextResponse +} from "../models"; + +/// +/** Class containing PrivateLinkResources operations. */ +export class PrivateLinkResourcesImpl implements PrivateLinkResources { + private readonly client: MonitorClient; + + /** + * Initialize a new instance of the class PrivateLinkResources class. + * @param client Reference to the service client + */ + constructor(client: MonitorClient) { + this.client = client; + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param options The options parameters. + */ + public listByPrivateLinkScope( + resourceGroupName: string, + scopeName: string, + options?: PrivateLinkResourcesListByPrivateLinkScopeOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByPrivateLinkScopePagingAll( + resourceGroupName, + scopeName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByPrivateLinkScopePagingPage( + resourceGroupName, + scopeName, + options + ); + } + }; + } + + private async *listByPrivateLinkScopePagingPage( + resourceGroupName: string, + scopeName: string, + options?: PrivateLinkResourcesListByPrivateLinkScopeOptionalParams + ): AsyncIterableIterator { + let result = await this._listByPrivateLinkScope( + resourceGroupName, + scopeName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByPrivateLinkScopeNext( + resourceGroupName, + scopeName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByPrivateLinkScopePagingAll( + resourceGroupName: string, + scopeName: string, + options?: PrivateLinkResourcesListByPrivateLinkScopeOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByPrivateLinkScopePagingPage( + resourceGroupName, + scopeName, + options + )) { + yield* page; + } + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param options The options parameters. + */ + private _listByPrivateLinkScope( + resourceGroupName: string, + scopeName: string, + options?: PrivateLinkResourcesListByPrivateLinkScopeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, scopeName, options }, + listByPrivateLinkScopeOperationSpec + ); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param groupName The name of the private link resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + scopeName: string, + groupName: string, + options?: PrivateLinkResourcesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, scopeName, groupName, options }, + getOperationSpec + ); + } + + /** + * ListByPrivateLinkScopeNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param nextLink The nextLink from the previous successful call to the ListByPrivateLinkScope method. + * @param options The options parameters. + */ + private _listByPrivateLinkScopeNext( + resourceGroupName: string, + scopeName: string, + nextLink: string, + options?: PrivateLinkResourcesListByPrivateLinkScopeNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, scopeName, nextLink, options }, + listByPrivateLinkScopeNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByPrivateLinkScopeOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/privateLinkResources", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResourceListResult + } + }, + queryParameters: [Parameters.apiVersion10], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.scopeName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/privateLinkResources/{groupName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResource + } + }, + queryParameters: [Parameters.apiVersion10], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.scopeName, + Parameters.groupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByPrivateLinkScopeNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResourceListResult + } + }, + queryParameters: [Parameters.apiVersion10], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.scopeName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/monitor/arm-monitor/src/operations/privateLinkScopeOperationStatus.ts b/sdk/monitor/arm-monitor/src/operations/privateLinkScopeOperationStatus.ts new file mode 100644 index 000000000000..b33205d0f4e4 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operations/privateLinkScopeOperationStatus.ts @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PrivateLinkScopeOperationStatus } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MonitorClient } from "../monitorClient"; +import { + PrivateLinkScopeOperationStatusGetOptionalParams, + PrivateLinkScopeOperationStatusGetResponse +} from "../models"; + +/** Class containing PrivateLinkScopeOperationStatus operations. */ +export class PrivateLinkScopeOperationStatusImpl + implements PrivateLinkScopeOperationStatus { + private readonly client: MonitorClient; + + /** + * Initialize a new instance of the class PrivateLinkScopeOperationStatus class. + * @param client Reference to the service client + */ + constructor(client: MonitorClient) { + this.client = client; + } + + /** + * Get the status of an azure asynchronous operation associated with a private link scope operation. + * @param asyncOperationId The operation Id. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + get( + asyncOperationId: string, + resourceGroupName: string, + options?: PrivateLinkScopeOperationStatusGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { asyncOperationId, resourceGroupName, options }, + getOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopeOperationStatuses/{asyncOperationId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationStatus + } + }, + queryParameters: [Parameters.apiVersion10], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.asyncOperationId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/monitor/arm-monitor/src/operations/privateLinkScopedResources.ts b/sdk/monitor/arm-monitor/src/operations/privateLinkScopedResources.ts new file mode 100644 index 000000000000..94599b7fb244 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operations/privateLinkScopedResources.ts @@ -0,0 +1,456 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { PrivateLinkScopedResources } 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 { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + ScopedResource, + PrivateLinkScopedResourcesListByPrivateLinkScopeNextOptionalParams, + PrivateLinkScopedResourcesListByPrivateLinkScopeOptionalParams, + PrivateLinkScopedResourcesGetOptionalParams, + PrivateLinkScopedResourcesGetResponse, + PrivateLinkScopedResourcesCreateOrUpdateOptionalParams, + PrivateLinkScopedResourcesCreateOrUpdateResponse, + PrivateLinkScopedResourcesDeleteOptionalParams, + PrivateLinkScopedResourcesListByPrivateLinkScopeResponse, + PrivateLinkScopedResourcesListByPrivateLinkScopeNextResponse +} from "../models"; + +/// +/** Class containing PrivateLinkScopedResources operations. */ +export class PrivateLinkScopedResourcesImpl + implements PrivateLinkScopedResources { + private readonly client: MonitorClient; + + /** + * Initialize a new instance of the class PrivateLinkScopedResources class. + * @param client Reference to the service client + */ + constructor(client: MonitorClient) { + this.client = client; + } + + /** + * Gets all private endpoint connections on a private link scope. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param options The options parameters. + */ + public listByPrivateLinkScope( + resourceGroupName: string, + scopeName: string, + options?: PrivateLinkScopedResourcesListByPrivateLinkScopeOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByPrivateLinkScopePagingAll( + resourceGroupName, + scopeName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByPrivateLinkScopePagingPage( + resourceGroupName, + scopeName, + options + ); + } + }; + } + + private async *listByPrivateLinkScopePagingPage( + resourceGroupName: string, + scopeName: string, + options?: PrivateLinkScopedResourcesListByPrivateLinkScopeOptionalParams + ): AsyncIterableIterator { + let result = await this._listByPrivateLinkScope( + resourceGroupName, + scopeName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByPrivateLinkScopeNext( + resourceGroupName, + scopeName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByPrivateLinkScopePagingAll( + resourceGroupName: string, + scopeName: string, + options?: PrivateLinkScopedResourcesListByPrivateLinkScopeOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByPrivateLinkScopePagingPage( + resourceGroupName, + scopeName, + options + )) { + yield* page; + } + } + + /** + * Gets a scoped resource in a private link scope. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + scopeName: string, + name: string, + options?: PrivateLinkScopedResourcesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, scopeName, name, options }, + getOperationSpec + ); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @param parameters A private link scoped resource + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + scopeName: string, + name: string, + parameters: ScopedResource, + options?: PrivateLinkScopedResourcesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PrivateLinkScopedResourcesCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = 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 = new LroImpl( + sendOperation, + { resourceGroupName, scopeName, name, parameters, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @param parameters A private link scoped resource + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + scopeName: string, + name: string, + parameters: ScopedResource, + options?: PrivateLinkScopedResourcesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + scopeName, + name, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a private endpoint connection with a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + scopeName: string, + name: string, + options?: PrivateLinkScopedResourcesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = 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 = new LroImpl( + sendOperation, + { resourceGroupName, scopeName, name, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Deletes a private endpoint connection with a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + scopeName: string, + name: string, + options?: PrivateLinkScopedResourcesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + scopeName, + name, + options + ); + return poller.pollUntilDone(); + } + + /** + * Gets all private endpoint connections on a private link scope. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param options The options parameters. + */ + private _listByPrivateLinkScope( + resourceGroupName: string, + scopeName: string, + options?: PrivateLinkScopedResourcesListByPrivateLinkScopeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, scopeName, options }, + listByPrivateLinkScopeOperationSpec + ); + } + + /** + * ListByPrivateLinkScopeNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param nextLink The nextLink from the previous successful call to the ListByPrivateLinkScope method. + * @param options The options parameters. + */ + private _listByPrivateLinkScopeNext( + resourceGroupName: string, + scopeName: string, + nextLink: string, + options?: PrivateLinkScopedResourcesListByPrivateLinkScopeNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, scopeName, nextLink, options }, + listByPrivateLinkScopeNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/scopedResources/{name}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ScopedResource + } + }, + queryParameters: [Parameters.apiVersion10], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.name, + Parameters.scopeName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/scopedResources/{name}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ScopedResource + }, + 201: { + bodyMapper: Mappers.ScopedResource + }, + 202: { + bodyMapper: Mappers.ScopedResource + }, + 204: { + bodyMapper: Mappers.ScopedResource + } + }, + requestBody: Parameters.parameters9, + queryParameters: [Parameters.apiVersion10], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.name, + Parameters.scopeName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/scopedResources/{name}", + httpMethod: "DELETE", + responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + queryParameters: [Parameters.apiVersion10], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.name, + Parameters.scopeName + ], + serializer +}; +const listByPrivateLinkScopeOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/scopedResources", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ScopedResourceListResult + } + }, + queryParameters: [Parameters.apiVersion10], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.scopeName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByPrivateLinkScopeNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ScopedResourceListResult + } + }, + queryParameters: [Parameters.apiVersion10], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.scopeName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/monitor/arm-monitor/src/operations/privateLinkScopes.ts b/sdk/monitor/arm-monitor/src/operations/privateLinkScopes.ts new file mode 100644 index 000000000000..4639130f45fe --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operations/privateLinkScopes.ts @@ -0,0 +1,491 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { PrivateLinkScopes } 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 { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + AzureMonitorPrivateLinkScope, + PrivateLinkScopesListNextOptionalParams, + PrivateLinkScopesListOptionalParams, + PrivateLinkScopesListByResourceGroupNextOptionalParams, + PrivateLinkScopesListByResourceGroupOptionalParams, + PrivateLinkScopesListResponse, + PrivateLinkScopesListByResourceGroupResponse, + PrivateLinkScopesDeleteOptionalParams, + PrivateLinkScopesGetOptionalParams, + PrivateLinkScopesGetResponse, + PrivateLinkScopesCreateOrUpdateOptionalParams, + PrivateLinkScopesCreateOrUpdateResponse, + TagsResource, + PrivateLinkScopesUpdateTagsOptionalParams, + PrivateLinkScopesUpdateTagsResponse, + PrivateLinkScopesListNextResponse, + PrivateLinkScopesListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing PrivateLinkScopes operations. */ +export class PrivateLinkScopesImpl implements PrivateLinkScopes { + private readonly client: MonitorClient; + + /** + * Initialize a new instance of the class PrivateLinkScopes class. + * @param client Reference to the service client + */ + constructor(client: MonitorClient) { + this.client = client; + } + + /** + * Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. + * @param options The options parameters. + */ + public list( + options?: PrivateLinkScopesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: PrivateLinkScopesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: PrivateLinkScopesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Gets a list of Azure Monitor PrivateLinkScopes within a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: PrivateLinkScopesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: PrivateLinkScopesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: PrivateLinkScopesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. + * @param options The options parameters. + */ + private _list( + options?: PrivateLinkScopesListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * Gets a list of Azure Monitor PrivateLinkScopes within a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: PrivateLinkScopesListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Deletes a Azure Monitor PrivateLinkScope. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + scopeName: string, + options?: PrivateLinkScopesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = 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 = new LroImpl( + sendOperation, + { resourceGroupName, scopeName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Deletes a Azure Monitor PrivateLinkScope. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + scopeName: string, + options?: PrivateLinkScopesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + scopeName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Returns a Azure Monitor PrivateLinkScope. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + scopeName: string, + options?: PrivateLinkScopesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, scopeName, options }, + getOperationSpec + ); + } + + /** + * Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value + * for InstrumentationKey nor AppId in the Put operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param azureMonitorPrivateLinkScopePayload Properties that need to be specified to create or update + * a Azure Monitor PrivateLinkScope. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + scopeName: string, + azureMonitorPrivateLinkScopePayload: AzureMonitorPrivateLinkScope, + options?: PrivateLinkScopesCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + scopeName, + azureMonitorPrivateLinkScopePayload, + options + }, + createOrUpdateOperationSpec + ); + } + + /** + * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateLinkScopeTags Updated tag information to set into the PrivateLinkScope instance. + * @param options The options parameters. + */ + updateTags( + resourceGroupName: string, + scopeName: string, + privateLinkScopeTags: TagsResource, + options?: PrivateLinkScopesUpdateTagsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, scopeName, privateLinkScopeTags, options }, + updateTagsOperationSpec + ); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: PrivateLinkScopesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: PrivateLinkScopesListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/microsoft.insights/privateLinkScopes", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AzureMonitorPrivateLinkScopeListResult + } + }, + queryParameters: [Parameters.apiVersion10], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopes", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AzureMonitorPrivateLinkScopeListResult + } + }, + queryParameters: [Parameters.apiVersion10], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopes/{scopeName}", + httpMethod: "DELETE", + responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + queryParameters: [Parameters.apiVersion10], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.scopeName + ], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopes/{scopeName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AzureMonitorPrivateLinkScope + } + }, + queryParameters: [Parameters.apiVersion10], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.scopeName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopes/{scopeName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.AzureMonitorPrivateLinkScope + }, + 201: { + bodyMapper: Mappers.AzureMonitorPrivateLinkScope + } + }, + requestBody: Parameters.azureMonitorPrivateLinkScopePayload, + queryParameters: [Parameters.apiVersion10], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.scopeName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateTagsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopes/{scopeName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.AzureMonitorPrivateLinkScope + } + }, + requestBody: Parameters.privateLinkScopeTags, + queryParameters: [Parameters.apiVersion10], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.scopeName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AzureMonitorPrivateLinkScopeListResult + } + }, + queryParameters: [Parameters.apiVersion10], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AzureMonitorPrivateLinkScopeListResult + } + }, + queryParameters: [Parameters.apiVersion10], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/monitor/arm-monitor/src/operations/scheduledQueryRules.ts b/sdk/monitor/arm-monitor/src/operations/scheduledQueryRules.ts index 2e49d3d94545..70c564955279 100644 --- a/sdk/monitor/arm-monitor/src/operations/scheduledQueryRules.ts +++ b/sdk/monitor/arm-monitor/src/operations/scheduledQueryRules.ts @@ -1,243 +1,232 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/scheduledQueryRulesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { ScheduledQueryRules } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MonitorManagementClientContext } from "../monitorManagementClientContext"; +import { MonitorClient } from "../monitorClient"; +import { + LogSearchRuleResource, + ScheduledQueryRulesListBySubscriptionOptionalParams, + ScheduledQueryRulesListByResourceGroupOptionalParams, + ScheduledQueryRulesCreateOrUpdateOptionalParams, + ScheduledQueryRulesCreateOrUpdateResponse, + ScheduledQueryRulesGetOptionalParams, + ScheduledQueryRulesGetResponse, + LogSearchRuleResourcePatch, + ScheduledQueryRulesUpdateOptionalParams, + ScheduledQueryRulesUpdateResponse, + ScheduledQueryRulesDeleteOptionalParams, + ScheduledQueryRulesListBySubscriptionResponse, + ScheduledQueryRulesListByResourceGroupResponse +} from "../models"; -/** Class representing a ScheduledQueryRules. */ -export class ScheduledQueryRules { - private readonly client: MonitorManagementClientContext; +/// +/** Class containing ScheduledQueryRules operations. */ +export class ScheduledQueryRulesImpl implements ScheduledQueryRules { + private readonly client: MonitorClient; /** - * Create a ScheduledQueryRules. - * @param {MonitorManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class ScheduledQueryRules class. + * @param client Reference to the service client */ - constructor(client: MonitorManagementClientContext) { + constructor(client: MonitorClient) { this.client = client; } /** - * Creates or updates an log search rule. - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @param [options] The optional parameters - * @returns Promise + * List the Log Search rules within a subscription group. + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, ruleName: string, parameters: Models.LogSearchRuleResource, options?: msRest.RequestOptionsBase): Promise; + public listBySubscription( + options?: ScheduledQueryRulesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: ScheduledQueryRulesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(options); + yield result.value || []; + } + + private async *listBySubscriptionPagingAll( + options?: ScheduledQueryRulesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + /** - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to create or update. - * @param callback The callback + * List the Log Search rules within a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, ruleName: string, parameters: Models.LogSearchRuleResource, callback: msRest.ServiceCallback): void; + public listByResourceGroup( + resourceGroupName: string, + options?: ScheduledQueryRulesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: ScheduledQueryRulesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: ScheduledQueryRulesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + /** - * @param resourceGroupName The name of the resource group. + * Creates or updates an log search rule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ruleName The name of the rule. * @param parameters The parameters of the rule to create or update. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, ruleName: string, parameters: Models.LogSearchRuleResource, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, ruleName: string, parameters: Models.LogSearchRuleResource, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + resourceGroupName: string, + ruleName: string, + parameters: LogSearchRuleResource, + options?: ScheduledQueryRulesCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - ruleName, - parameters, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; + { resourceGroupName, ruleName, parameters, options }, + createOrUpdateOperationSpec + ); } /** * Gets an Log Search rule - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, ruleName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param callback The callback - */ - get(resourceGroupName: string, ruleName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ruleName The name of the rule. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, ruleName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, ruleName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + ruleName: string, + options?: ScheduledQueryRulesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - ruleName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, ruleName, options }, + getOperationSpec + ); } /** * Update log search Rule. - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to update. - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, ruleName: string, parameters: Models.LogSearchRuleResourcePatch, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param parameters The parameters of the rule to update. - * @param callback The callback - */ - update(resourceGroupName: string, ruleName: string, parameters: Models.LogSearchRuleResourcePatch, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ruleName The name of the rule. * @param parameters The parameters of the rule to update. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - update(resourceGroupName: string, ruleName: string, parameters: Models.LogSearchRuleResourcePatch, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, ruleName: string, parameters: Models.LogSearchRuleResourcePatch, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + resourceGroupName: string, + ruleName: string, + parameters: LogSearchRuleResourcePatch, + options?: ScheduledQueryRulesUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - ruleName, - parameters, - options - }, - updateOperationSpec, - callback) as Promise; + { resourceGroupName, ruleName, parameters, options }, + updateOperationSpec + ); } /** * Deletes a Log Search rule - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, ruleName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param ruleName The name of the rule. - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, ruleName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ruleName The name of the rule. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, ruleName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, ruleName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + ruleName: string, + options?: ScheduledQueryRulesDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - ruleName, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, ruleName, options }, + deleteOperationSpec + ); } /** * List the Log Search rules within a subscription group. - * @param [options] The optional parameters - * @returns Promise - */ - listBySubscription(options?: Models.ScheduledQueryRulesListBySubscriptionOptionalParams): Promise; - /** - * @param callback The callback - */ - listBySubscription(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listBySubscription(options: Models.ScheduledQueryRulesListBySubscriptionOptionalParams, callback: msRest.ServiceCallback): void; - listBySubscription(options?: Models.ScheduledQueryRulesListBySubscriptionOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listBySubscription( + options?: ScheduledQueryRulesListBySubscriptionOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - options - }, - listBySubscriptionOperationSpec, - callback) as Promise; + { options }, + listBySubscriptionOperationSpec + ); } /** * List the Log Search rules within a resource group. - * @param resourceGroupName The name of the resource group. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroup(resourceGroupName: string, options?: Models.ScheduledQueryRulesListByResourceGroupOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param callback The callback + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param options The optional parameters - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, options: Models.ScheduledQueryRulesListByResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: Models.ScheduledQueryRulesListByResourceGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroup( + resourceGroupName: string, + options?: ScheduledQueryRulesListByResourceGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - listByResourceGroupOperationSpec, - callback) as Promise; + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const createOrUpdateOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}", httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/scheduledQueryRules/{ruleName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.ruleName - ], - queryParameters: [ - Parameters.apiVersion9 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.LogSearchRuleResource, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.LogSearchRuleResource @@ -246,138 +235,123 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.LogSearchRuleResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorContract } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/scheduledQueryRules/{ruleName}", + requestBody: Parameters.parameters6, + queryParameters: [Parameters.apiVersion7], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, - Parameters.ruleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion9 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.subscriptionId, + Parameters.ruleName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.LogSearchRuleResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorContract } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/scheduledQueryRules/{ruleName}", + queryParameters: [Parameters.apiVersion7], urlParameters: [ - Parameters.subscriptionId, + Parameters.$host, Parameters.resourceGroupName, + Parameters.subscriptionId, Parameters.ruleName ], - queryParameters: [ - Parameters.apiVersion9 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.LogSearchRuleResourcePatch, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.LogSearchRuleResource }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorContract } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/scheduledQueryRules/{ruleName}", + requestBody: Parameters.parameters7, + queryParameters: [Parameters.apiVersion7], urlParameters: [ + Parameters.$host, Parameters.resourceGroupName, - Parameters.ruleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion9 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.subscriptionId, + Parameters.ruleName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorContract } }, + queryParameters: [Parameters.apiVersion7], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.ruleName + ], + headerParameters: [Parameters.accept], serializer }; - -const listBySubscriptionOperationSpec: msRest.OperationSpec = { +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/scheduledQueryRules", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/microsoft.insights/scheduledQueryRules", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion9, - Parameters.filter1 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.LogSearchRuleResourceCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorContract } }, + queryParameters: [Parameters.filter1, Parameters.apiVersion7], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/scheduledQueryRules", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion9, - Parameters.filter1 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.LogSearchRuleResourceCollection }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorContract } }, + queryParameters: [Parameters.filter1, Parameters.apiVersion7], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/monitor/arm-monitor/src/operations/tenantActivityLogs.ts b/sdk/monitor/arm-monitor/src/operations/tenantActivityLogs.ts index 330e604f77f1..5487e61f3aba 100644 --- a/sdk/monitor/arm-monitor/src/operations/tenantActivityLogs.ts +++ b/sdk/monitor/arm-monitor/src/operations/tenantActivityLogs.ts @@ -1,105 +1,117 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/tenantActivityLogsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { TenantActivityLogs } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MonitorManagementClientContext } from "../monitorManagementClientContext"; +import { MonitorClient } from "../monitorClient"; +import { + EventData, + TenantActivityLogsListNextOptionalParams, + TenantActivityLogsListOptionalParams, + TenantActivityLogsListResponse, + TenantActivityLogsListNextResponse +} from "../models"; -/** Class representing a TenantActivityLogs. */ -export class TenantActivityLogs { - private readonly client: MonitorManagementClientContext; +/// +/** Class containing TenantActivityLogs operations. */ +export class TenantActivityLogsImpl implements TenantActivityLogs { + private readonly client: MonitorClient; /** - * Create a TenantActivityLogs. - * @param {MonitorManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class TenantActivityLogs class. + * @param client Reference to the service client */ - constructor(client: MonitorManagementClientContext) { + constructor(client: MonitorClient) { this.client = client; } /** * Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the - * Activity Logs for the subscription is applicable to this API (the parameters, $filter, - * etc.).
One thing to point out here is that this API does *not* retrieve the logs at the - * individual subscription of the tenant but only surfaces the logs that were generated at the - * tenant level. - * @param [options] The optional parameters - * @returns Promise + * Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One + * thing to point out here is that this API does *not* retrieve the logs at the individual subscription + * of the tenant but only surfaces the logs that were generated at the tenant level. + * @param options The options parameters. */ - list(options?: Models.TenantActivityLogsListOptionalParams): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list(options: Models.TenantActivityLogsListOptionalParams, callback: msRest.ServiceCallback): void; - list(options?: Models.TenantActivityLogsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options + public list( + options?: TenantActivityLogsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback) as Promise; + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: TenantActivityLogsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: TenantActivityLogsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } } /** * Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the - * Activity Logs for the subscription is applicable to this API (the parameters, $filter, - * etc.).
One thing to point out here is that this API does *not* retrieve the logs at the - * individual subscription of the tenant but only surfaces the logs that were generated at the - * tenant level. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise + * Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One + * thing to point out here is that this API does *not* retrieve the logs at the individual subscription + * of the tenant but only surfaces the logs that were generated at the tenant level. + * @param options The options parameters. */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + private _list( + options?: TenantActivityLogsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + nextLink: string, + options?: TenantActivityLogsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Insights/eventtypes/management/values", httpMethod: "GET", - path: "providers/microsoft.insights/eventtypes/management/values", - queryParameters: [ - Parameters.apiVersion0, - Parameters.filter1, - Parameters.select - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.EventDataCollection @@ -108,19 +120,18 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [ + Parameters.apiVersion, + Parameters.select, + Parameters.filter1 + ], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.EventDataCollection @@ -129,5 +140,12 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [ + Parameters.apiVersion, + Parameters.select, + Parameters.filter1 + ], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/monitor/arm-monitor/src/operations/vMInsights.ts b/sdk/monitor/arm-monitor/src/operations/vMInsights.ts index 1b0ecbdbe27e..b484326ac64f 100644 --- a/sdk/monitor/arm-monitor/src/operations/vMInsights.ts +++ b/sdk/monitor/arm-monitor/src/operations/vMInsights.ts @@ -1,77 +1,56 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/vMInsightsMappers"; +import { VMInsights } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { MonitorManagementClientContext } from "../monitorManagementClientContext"; +import { MonitorClient } from "../monitorClient"; +import { + VMInsightsGetOnboardingStatusOptionalParams, + VMInsightsGetOnboardingStatusResponse +} from "../models"; -/** Class representing a VMInsights. */ -export class VMInsights { - private readonly client: MonitorManagementClientContext; +/** Class containing VMInsights operations. */ +export class VMInsightsImpl implements VMInsights { + private readonly client: MonitorClient; /** - * Create a VMInsights. - * @param {MonitorManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class VMInsights class. + * @param client Reference to the service client */ - constructor(client: MonitorManagementClientContext) { + constructor(client: MonitorClient) { this.client = client; } /** * Retrieves the VM Insights onboarding status for the specified resource or resource scope. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource, or - * scope, whose status to retrieve. - * @param [options] The optional parameters - * @returns Promise + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource, or scope, + * whose status to retrieve. + * @param options The options parameters. */ - getOnboardingStatus(resourceUri: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource, or - * scope, whose status to retrieve. - * @param callback The callback - */ - getOnboardingStatus(resourceUri: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource, or - * scope, whose status to retrieve. - * @param options The optional parameters - * @param callback The callback - */ - getOnboardingStatus(resourceUri: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getOnboardingStatus(resourceUri: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getOnboardingStatus( + resourceUri: string, + options?: VMInsightsGetOnboardingStatusOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceUri, - options - }, - getOnboardingStatusOperationSpec, - callback) as Promise; + { resourceUri, options }, + getOnboardingStatusOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOnboardingStatusOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOnboardingStatusOperationSpec: coreClient.OperationSpec = { + path: + "/{resourceUri}/providers/Microsoft.Insights/vmInsightsOnboardingStatuses/default", httpMethod: "GET", - path: "{resourceUri}/providers/Microsoft.Insights/vmInsightsOnboardingStatuses/default", - urlParameters: [ - Parameters.resourceUri - ], - queryParameters: [ - Parameters.apiVersion11 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.VMInsightsOnboardingStatus @@ -80,5 +59,8 @@ const getOnboardingStatusOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ResponseWithError } }, + queryParameters: [Parameters.apiVersion9], + 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 new file mode 100644 index 000000000000..84b78e336b6a --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/actionGroups.ts @@ -0,0 +1,145 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + ActionGroupResource, + ActionGroupsListBySubscriptionIdOptionalParams, + ActionGroupsListByResourceGroupOptionalParams, + ActionGroupsCreateOrUpdateOptionalParams, + ActionGroupsCreateOrUpdateResponse, + ActionGroupsGetOptionalParams, + ActionGroupsGetResponse, + ActionGroupsDeleteOptionalParams, + ActionGroupPatchBody, + ActionGroupsUpdateOptionalParams, + ActionGroupsUpdateResponse, + NotificationRequestBody, + ActionGroupsPostTestNotificationsOptionalParams, + ActionGroupsPostTestNotificationsResponse, + ActionGroupsGetTestNotificationsOptionalParams, + ActionGroupsGetTestNotificationsResponse, + EnableRequest, + ActionGroupsEnableReceiverOptionalParams +} from "../models"; + +/// +/** Interface representing a ActionGroups. */ +export interface ActionGroups { + /** + * Get a list of all action groups in a subscription. + * @param options The options parameters. + */ + listBySubscriptionId( + options?: ActionGroupsListBySubscriptionIdOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a list of all action groups in a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: ActionGroupsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create a new action group or update an existing one. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param actionGroupName The name of the action group. + * @param actionGroup The action group to create or use for the update. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + actionGroupName: string, + actionGroup: ActionGroupResource, + options?: ActionGroupsCreateOrUpdateOptionalParams + ): Promise; + /** + * Get an action group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param actionGroupName The name of the action group. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + actionGroupName: string, + options?: ActionGroupsGetOptionalParams + ): Promise; + /** + * Delete an action group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param actionGroupName The name of the action group. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + actionGroupName: string, + options?: ActionGroupsDeleteOptionalParams + ): Promise; + /** + * Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param actionGroupName The name of the action group. + * @param actionGroupPatch Parameters supplied to the operation. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + actionGroupName: string, + 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< + PollerLike< + PollOperationState, + 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; + /** + * Get the test notifications by the notification id + * @param notificationId The notification id + * @param options The options parameters. + */ + getTestNotifications( + notificationId: string, + options?: ActionGroupsGetTestNotificationsOptionalParams + ): Promise; + /** + * 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. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param actionGroupName The name of the action group. + * @param enableRequest The receiver to re-enable. + * @param options The options parameters. + */ + enableReceiver( + resourceGroupName: string, + actionGroupName: string, + enableRequest: EnableRequest, + options?: ActionGroupsEnableReceiverOptionalParams + ): Promise; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/activityLogAlerts.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/activityLogAlerts.ts new file mode 100644 index 000000000000..d35ac04a99e4 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/activityLogAlerts.ts @@ -0,0 +1,92 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + ActivityLogAlertResource, + ActivityLogAlertsListBySubscriptionIdOptionalParams, + ActivityLogAlertsListByResourceGroupOptionalParams, + ActivityLogAlertsCreateOrUpdateOptionalParams, + ActivityLogAlertsCreateOrUpdateResponse, + ActivityLogAlertsGetOptionalParams, + ActivityLogAlertsGetResponse, + ActivityLogAlertsDeleteOptionalParams, + ActivityLogAlertPatchBody, + ActivityLogAlertsUpdateOptionalParams, + ActivityLogAlertsUpdateResponse +} from "../models"; + +/// +/** Interface representing a ActivityLogAlerts. */ +export interface ActivityLogAlerts { + /** + * Get a list of all activity log alerts in a subscription. + * @param options The options parameters. + */ + listBySubscriptionId( + options?: ActivityLogAlertsListBySubscriptionIdOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a list of all activity log alerts in a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: ActivityLogAlertsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create a new activity log alert or update an existing one. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param activityLogAlertName The name of the activity log alert. + * @param activityLogAlert The activity log alert to create or use for the update. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + activityLogAlertName: string, + activityLogAlert: ActivityLogAlertResource, + options?: ActivityLogAlertsCreateOrUpdateOptionalParams + ): Promise; + /** + * Get an activity log alert. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param activityLogAlertName The name of the activity log alert. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + activityLogAlertName: string, + options?: ActivityLogAlertsGetOptionalParams + ): Promise; + /** + * Delete an activity log alert. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param activityLogAlertName The name of the activity log alert. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + activityLogAlertName: string, + options?: ActivityLogAlertsDeleteOptionalParams + ): Promise; + /** + * Updates an existing ActivityLogAlertResource's tags. To update other fields use the CreateOrUpdate + * method. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param activityLogAlertName The name of the activity log alert. + * @param activityLogAlertPatch Parameters supplied to the operation. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + activityLogAlertName: string, + activityLogAlertPatch: ActivityLogAlertPatchBody, + options?: ActivityLogAlertsUpdateOptionalParams + ): Promise; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/activityLogs.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/activityLogs.ts new file mode 100644 index 000000000000..3747e36c2bf2 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/activityLogs.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { EventData, ActivityLogsListOptionalParams } from "../models"; + +/// +/** Interface representing a ActivityLogs. */ +export interface ActivityLogs { + /** + * Provides the list of records from the activity logs. + * @param filter Reduces the set of data collected.
This argument is required and it also requires + * at least the start date/time.
The **$filter** argument is very restricted and allows only the + * following patterns.
- *List events for a resource group*: $filter=eventTimestamp ge + * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and + * resourceGroupName eq 'resourceGroupName'.
- *List events for resource*: $filter=eventTimestamp ge + * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri + * eq 'resourceURI'.
- *List events for a subscription in a time range*: $filter=eventTimestamp ge + * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'.
- *List + * events for a resource provider*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and + * eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceProvider eq + * 'resourceProviderName'.
- *List events for a correlation Id*: $filter=eventTimestamp ge + * '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and + * correlationId eq 'correlationID'.

**NOTE**: No other syntax is allowed. + * @param options The options parameters. + */ + list( + filter: string, + options?: ActivityLogsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/alertRuleIncidents.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/alertRuleIncidents.ts new file mode 100644 index 000000000000..1879ba078d03 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/alertRuleIncidents.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + Incident, + AlertRuleIncidentsListByAlertRuleOptionalParams, + AlertRuleIncidentsGetOptionalParams, + AlertRuleIncidentsGetResponse +} from "../models"; + +/// +/** Interface representing a AlertRuleIncidents. */ +export interface AlertRuleIncidents { + /** + * Gets a list of incidents associated to an alert rule + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ruleName The name of the rule. + * @param options The options parameters. + */ + listByAlertRule( + resourceGroupName: string, + ruleName: string, + options?: AlertRuleIncidentsListByAlertRuleOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets an incident associated to an alert rule + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ruleName The name of the rule. + * @param incidentName The name of the incident to retrieve. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + ruleName: string, + incidentName: string, + options?: AlertRuleIncidentsGetOptionalParams + ): Promise; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/alertRules.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/alertRules.ts new file mode 100644 index 000000000000..71aea8243309 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/alertRules.ts @@ -0,0 +1,92 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + AlertRuleResource, + AlertRulesListByResourceGroupOptionalParams, + AlertRulesListBySubscriptionOptionalParams, + AlertRulesCreateOrUpdateOptionalParams, + AlertRulesCreateOrUpdateResponse, + AlertRulesDeleteOptionalParams, + AlertRulesGetOptionalParams, + AlertRulesGetResponse, + AlertRuleResourcePatch, + AlertRulesUpdateOptionalParams, + AlertRulesUpdateResponse +} from "../models"; + +/// +/** Interface representing a AlertRules. */ +export interface AlertRules { + /** + * List the classic metric alert rules within a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: AlertRulesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * List the classic metric alert rules within a subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: AlertRulesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Creates or updates a classic metric alert rule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ruleName The name of the rule. + * @param parameters The parameters of the rule to create or update. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + ruleName: string, + parameters: AlertRuleResource, + options?: AlertRulesCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes a classic metric alert rule + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ruleName The name of the rule. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + ruleName: string, + options?: AlertRulesDeleteOptionalParams + ): Promise; + /** + * Gets a classic metric alert rule + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ruleName The name of the rule. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + ruleName: string, + options?: AlertRulesGetOptionalParams + ): Promise; + /** + * Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate + * method. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ruleName The name of the rule. + * @param alertRulesResource Parameters supplied to the operation. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + ruleName: string, + alertRulesResource: AlertRuleResourcePatch, + options?: AlertRulesUpdateOptionalParams + ): Promise; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/autoscaleSettings.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/autoscaleSettings.ts new file mode 100644 index 000000000000..5d28397b09c0 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/autoscaleSettings.ts @@ -0,0 +1,91 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + AutoscaleSettingResource, + AutoscaleSettingsListByResourceGroupOptionalParams, + AutoscaleSettingsListBySubscriptionOptionalParams, + AutoscaleSettingsCreateOrUpdateOptionalParams, + AutoscaleSettingsCreateOrUpdateResponse, + AutoscaleSettingsDeleteOptionalParams, + AutoscaleSettingsGetOptionalParams, + AutoscaleSettingsGetResponse, + AutoscaleSettingResourcePatch, + AutoscaleSettingsUpdateOptionalParams, + AutoscaleSettingsUpdateResponse +} from "../models"; + +/// +/** Interface representing a AutoscaleSettings. */ +export interface AutoscaleSettings { + /** + * Lists the autoscale settings for a resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: AutoscaleSettingsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists the autoscale settings for a subscription + * @param options The options parameters. + */ + listBySubscription( + options?: AutoscaleSettingsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Creates or updates an autoscale setting. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param autoscaleSettingName The autoscale setting name. + * @param parameters Parameters supplied to the operation. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + autoscaleSettingName: string, + parameters: AutoscaleSettingResource, + options?: AutoscaleSettingsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes and autoscale setting + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param autoscaleSettingName The autoscale setting name. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + autoscaleSettingName: string, + options?: AutoscaleSettingsDeleteOptionalParams + ): Promise; + /** + * Gets an autoscale setting + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param autoscaleSettingName The autoscale setting name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + autoscaleSettingName: string, + options?: AutoscaleSettingsGetOptionalParams + ): Promise; + /** + * Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param autoscaleSettingName The autoscale setting name. + * @param autoscaleSettingResource Parameters supplied to the operation. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + autoscaleSettingName: string, + autoscaleSettingResource: AutoscaleSettingResourcePatch, + options?: AutoscaleSettingsUpdateOptionalParams + ): Promise; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/baselines.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/baselines.ts new file mode 100644 index 000000000000..fa85b4da1607 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/baselines.ts @@ -0,0 +1,24 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SingleMetricBaseline, BaselinesListOptionalParams } from "../models"; + +/// +/** Interface representing a Baselines. */ +export interface Baselines { + /** + * **Lists the metric baseline values for a resource**. + * @param resourceUri The identifier of the resource. + * @param options The options parameters. + */ + list( + resourceUri: string, + options?: BaselinesListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/dataCollectionEndpoints.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/dataCollectionEndpoints.ts new file mode 100644 index 000000000000..2645134b52c5 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/dataCollectionEndpoints.ts @@ -0,0 +1,90 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + DataCollectionEndpointResource, + DataCollectionEndpointsListByResourceGroupOptionalParams, + DataCollectionEndpointsListBySubscriptionOptionalParams, + DataCollectionEndpointsGetOptionalParams, + DataCollectionEndpointsGetResponse, + DataCollectionEndpointsCreateOptionalParams, + DataCollectionEndpointsCreateResponse, + DataCollectionEndpointsUpdateOptionalParams, + DataCollectionEndpointsUpdateResponse, + DataCollectionEndpointsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a DataCollectionEndpoints. */ +export interface DataCollectionEndpoints { + /** + * Lists all data collection endpoints in the specified resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: DataCollectionEndpointsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists all data collection endpoints in the specified subscription + * @param options The options parameters. + */ + listBySubscription( + options?: DataCollectionEndpointsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the specified data collection endpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case + * insensitive. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + dataCollectionEndpointName: string, + options?: DataCollectionEndpointsGetOptionalParams + ): Promise; + /** + * Creates or updates a data collection endpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case + * insensitive. + * @param options The options parameters. + */ + create( + resourceGroupName: string, + dataCollectionEndpointName: string, + options?: DataCollectionEndpointsCreateOptionalParams + ): Promise; + /** + * Updates part of a data collection endpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case + * insensitive. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + dataCollectionEndpointName: string, + options?: DataCollectionEndpointsUpdateOptionalParams + ): Promise; + /** + * Deletes a data collection endpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case + * insensitive. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + dataCollectionEndpointName: string, + options?: DataCollectionEndpointsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/dataCollectionRuleAssociations.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/dataCollectionRuleAssociations.ts new file mode 100644 index 000000000000..fc91c6f1a043 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/dataCollectionRuleAssociations.ts @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + DataCollectionRuleAssociationProxyOnlyResource, + DataCollectionRuleAssociationsListByResourceOptionalParams, + DataCollectionRuleAssociationsListByRuleOptionalParams, + DataCollectionRuleAssociationsGetOptionalParams, + DataCollectionRuleAssociationsGetResponse, + DataCollectionRuleAssociationsCreateOptionalParams, + DataCollectionRuleAssociationsCreateResponse, + DataCollectionRuleAssociationsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a DataCollectionRuleAssociations. */ +export interface DataCollectionRuleAssociations { + /** + * Lists associations for the specified resource. + * @param resourceUri The identifier of the resource. + * @param options The options parameters. + */ + listByResource( + resourceUri: string, + options?: DataCollectionRuleAssociationsListByResourceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists associations for the specified data collection rule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. + * @param options The options parameters. + */ + listByRule( + resourceGroupName: string, + dataCollectionRuleName: string, + options?: DataCollectionRuleAssociationsListByRuleOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the specified association. + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @param options The options parameters. + */ + get( + resourceUri: string, + associationName: string, + options?: DataCollectionRuleAssociationsGetOptionalParams + ): Promise; + /** + * Creates or updates an association. + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @param options The options parameters. + */ + create( + resourceUri: string, + associationName: string, + options?: DataCollectionRuleAssociationsCreateOptionalParams + ): Promise; + /** + * Deletes an association. + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @param options The options parameters. + */ + delete( + resourceUri: string, + associationName: string, + options?: DataCollectionRuleAssociationsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/dataCollectionRules.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/dataCollectionRules.ts new file mode 100644 index 000000000000..ed2cf87b83be --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/dataCollectionRules.ts @@ -0,0 +1,86 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + DataCollectionRuleResource, + DataCollectionRulesListByResourceGroupOptionalParams, + DataCollectionRulesListBySubscriptionOptionalParams, + DataCollectionRulesGetOptionalParams, + DataCollectionRulesGetResponse, + DataCollectionRulesCreateOptionalParams, + DataCollectionRulesCreateResponse, + DataCollectionRulesUpdateOptionalParams, + DataCollectionRulesUpdateResponse, + DataCollectionRulesDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a DataCollectionRules. */ +export interface DataCollectionRules { + /** + * Lists all data collection rules in the specified resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: DataCollectionRulesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists all data collection rules in the specified subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: DataCollectionRulesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the specified data collection rule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + dataCollectionRuleName: string, + options?: DataCollectionRulesGetOptionalParams + ): Promise; + /** + * Creates or updates a data collection rule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. + * @param options The options parameters. + */ + create( + resourceGroupName: string, + dataCollectionRuleName: string, + options?: DataCollectionRulesCreateOptionalParams + ): Promise; + /** + * Updates part of a data collection rule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + dataCollectionRuleName: string, + options?: DataCollectionRulesUpdateOptionalParams + ): Promise; + /** + * Deletes a data collection rule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + dataCollectionRuleName: string, + options?: DataCollectionRulesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/diagnosticSettings.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/diagnosticSettings.ts new file mode 100644 index 000000000000..be3f2186fb09 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/diagnosticSettings.ts @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { + DiagnosticSettingsGetOptionalParams, + DiagnosticSettingsGetResponse, + DiagnosticSettingsResource, + DiagnosticSettingsCreateOrUpdateOptionalParams, + DiagnosticSettingsCreateOrUpdateResponse, + DiagnosticSettingsDeleteOptionalParams, + DiagnosticSettingsListOptionalParams, + DiagnosticSettingsListResponse +} from "../models"; + +/** Interface representing a DiagnosticSettings. */ +export interface DiagnosticSettings { + /** + * Gets the active diagnostic settings for the specified resource. + * @param resourceUri The identifier of the resource. + * @param name The name of the diagnostic setting. + * @param options The options parameters. + */ + get( + resourceUri: string, + name: string, + options?: DiagnosticSettingsGetOptionalParams + ): Promise; + /** + * Creates or updates diagnostic settings for the specified resource. + * @param resourceUri The identifier of the resource. + * @param name The name of the diagnostic setting. + * @param parameters Parameters supplied to the operation. + * @param options The options parameters. + */ + createOrUpdate( + resourceUri: string, + name: string, + parameters: DiagnosticSettingsResource, + options?: DiagnosticSettingsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes existing diagnostic settings for the specified resource. + * @param resourceUri The identifier of the resource. + * @param name The name of the diagnostic setting. + * @param options The options parameters. + */ + delete( + resourceUri: string, + name: string, + options?: DiagnosticSettingsDeleteOptionalParams + ): Promise; + /** + * Gets the active diagnostic settings list for the specified resource. + * @param resourceUri The identifier of the resource. + * @param options The options parameters. + */ + list( + resourceUri: string, + options?: DiagnosticSettingsListOptionalParams + ): Promise; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/diagnosticSettingsCategory.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/diagnosticSettingsCategory.ts new file mode 100644 index 000000000000..950e9dc787fd --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/diagnosticSettingsCategory.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { + DiagnosticSettingsCategoryGetOptionalParams, + DiagnosticSettingsCategoryGetResponse, + DiagnosticSettingsCategoryListOptionalParams, + DiagnosticSettingsCategoryListResponse +} from "../models"; + +/** Interface representing a DiagnosticSettingsCategory. */ +export interface DiagnosticSettingsCategory { + /** + * Gets the diagnostic settings category for the specified resource. + * @param resourceUri The identifier of the resource. + * @param name The name of the diagnostic setting. + * @param options The options parameters. + */ + get( + resourceUri: string, + name: string, + options?: DiagnosticSettingsCategoryGetOptionalParams + ): Promise; + /** + * Lists the diagnostic settings categories for the specified resource. + * @param resourceUri The identifier of the resource. + * @param options The options parameters. + */ + list( + resourceUri: string, + options?: DiagnosticSettingsCategoryListOptionalParams + ): Promise; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/eventCategories.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/eventCategories.ts new file mode 100644 index 000000000000..1e37506d088d --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/eventCategories.ts @@ -0,0 +1,26 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { + LocalizableString, + EventCategoriesListOptionalParams +} from "../models"; + +/// +/** Interface representing a EventCategories. */ +export interface EventCategories { + /** + * Get the list of available event categories supported in the Activity Logs Service.
The current + * list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. + * @param options The options parameters. + */ + list( + options?: EventCategoriesListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/index.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..5096ba531b24 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/index.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./autoscaleSettings"; +export * from "./operations"; +export * from "./alertRuleIncidents"; +export * from "./alertRules"; +export * from "./logProfiles"; +export * from "./diagnosticSettings"; +export * from "./diagnosticSettingsCategory"; +export * from "./actionGroups"; +export * from "./activityLogs"; +export * from "./eventCategories"; +export * from "./tenantActivityLogs"; +export * from "./metricDefinitions"; +export * from "./metrics"; +export * from "./baselines"; +export * from "./metricAlerts"; +export * from "./metricAlertsStatus"; +export * from "./scheduledQueryRules"; +export * from "./metricNamespaces"; +export * from "./vMInsights"; +export * from "./privateLinkScopes"; +export * from "./privateLinkScopeOperationStatus"; +export * from "./privateLinkResources"; +export * from "./privateEndpointConnections"; +export * from "./privateLinkScopedResources"; +export * from "./activityLogAlerts"; +export * from "./dataCollectionEndpoints"; +export * from "./dataCollectionRuleAssociations"; +export * from "./dataCollectionRules"; diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/logProfiles.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/logProfiles.ts new file mode 100644 index 000000000000..8c43d9f62e8a --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/logProfiles.ts @@ -0,0 +1,73 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + LogProfileResource, + LogProfilesListOptionalParams, + LogProfilesDeleteOptionalParams, + LogProfilesGetOptionalParams, + LogProfilesGetResponse, + LogProfilesCreateOrUpdateOptionalParams, + LogProfilesCreateOrUpdateResponse, + LogProfileResourcePatch, + LogProfilesUpdateOptionalParams, + LogProfilesUpdateResponse +} from "../models"; + +/// +/** Interface representing a LogProfiles. */ +export interface LogProfiles { + /** + * List the log profiles. + * @param options The options parameters. + */ + list( + options?: LogProfilesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Deletes the log profile. + * @param logProfileName The name of the log profile. + * @param options The options parameters. + */ + delete( + logProfileName: string, + options?: LogProfilesDeleteOptionalParams + ): Promise; + /** + * Gets the log profile. + * @param logProfileName The name of the log profile. + * @param options The options parameters. + */ + get( + logProfileName: string, + options?: LogProfilesGetOptionalParams + ): Promise; + /** + * Create or update a log profile in Azure Monitoring REST API. + * @param logProfileName The name of the log profile. + * @param parameters Parameters supplied to the operation. + * @param options The options parameters. + */ + createOrUpdate( + logProfileName: string, + parameters: LogProfileResource, + options?: LogProfilesCreateOrUpdateOptionalParams + ): Promise; + /** + * Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. + * @param logProfileName The name of the log profile. + * @param logProfilesResource Parameters supplied to the operation. + * @param options The options parameters. + */ + update( + logProfileName: string, + logProfilesResource: LogProfileResourcePatch, + options?: LogProfilesUpdateOptionalParams + ): Promise; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/metricAlerts.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/metricAlerts.ts new file mode 100644 index 000000000000..2d84b9ef6dbd --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/metricAlerts.ts @@ -0,0 +1,91 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + MetricAlertResource, + MetricAlertsListBySubscriptionOptionalParams, + MetricAlertsListByResourceGroupOptionalParams, + MetricAlertsGetOptionalParams, + MetricAlertsGetResponse, + MetricAlertsCreateOrUpdateOptionalParams, + MetricAlertsCreateOrUpdateResponse, + MetricAlertResourcePatch, + MetricAlertsUpdateOptionalParams, + MetricAlertsUpdateResponse, + MetricAlertsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a MetricAlerts. */ +export interface MetricAlerts { + /** + * Retrieve alert rule definitions in a subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: MetricAlertsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Retrieve alert rule definitions in a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: MetricAlertsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Retrieve an alert rule definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ruleName The name of the rule. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + ruleName: string, + options?: MetricAlertsGetOptionalParams + ): Promise; + /** + * Create or update an metric alert definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ruleName The name of the rule. + * @param parameters The parameters of the rule to create or update. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + ruleName: string, + parameters: MetricAlertResource, + options?: MetricAlertsCreateOrUpdateOptionalParams + ): Promise; + /** + * Update an metric alert definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ruleName The name of the rule. + * @param parameters The parameters of the rule to update. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + ruleName: string, + parameters: MetricAlertResourcePatch, + options?: MetricAlertsUpdateOptionalParams + ): Promise; + /** + * Delete an alert rule definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ruleName The name of the rule. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + ruleName: string, + options?: MetricAlertsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/metricAlertsStatus.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/metricAlertsStatus.ts new file mode 100644 index 000000000000..58300ce0a2e5 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/metricAlertsStatus.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + MetricAlertsStatusListOptionalParams, + MetricAlertsStatusListResponse, + MetricAlertsStatusListByNameOptionalParams, + MetricAlertsStatusListByNameResponse +} from "../models"; + +/** Interface representing a MetricAlertsStatus. */ +export interface MetricAlertsStatus { + /** + * Retrieve an alert rule status. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ruleName The name of the rule. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + ruleName: string, + options?: MetricAlertsStatusListOptionalParams + ): Promise; + /** + * Retrieve an alert rule status. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ruleName The name of the rule. + * @param statusName The name of the status. + * @param options The options parameters. + */ + listByName( + resourceGroupName: string, + ruleName: string, + statusName: string, + options?: MetricAlertsStatusListByNameOptionalParams + ): Promise; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/metricDefinitions.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/metricDefinitions.ts new file mode 100644 index 000000000000..1a98f35a1568 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/metricDefinitions.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { + MetricDefinition, + MetricDefinitionsListOptionalParams +} from "../models"; + +/// +/** Interface representing a MetricDefinitions. */ +export interface MetricDefinitions { + /** + * Lists the metric definitions for the resource. + * @param resourceUri The identifier of the resource. + * @param options The options parameters. + */ + list( + resourceUri: string, + options?: MetricDefinitionsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/metricNamespaces.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/metricNamespaces.ts new file mode 100644 index 000000000000..1dc7f7090db4 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/metricNamespaces.ts @@ -0,0 +1,24 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { MetricNamespace, MetricNamespacesListOptionalParams } from "../models"; + +/// +/** Interface representing a MetricNamespaces. */ +export interface MetricNamespaces { + /** + * Lists the metric namespaces for the resource. + * @param resourceUri The identifier of the resource. + * @param options The options parameters. + */ + list( + resourceUri: string, + options?: MetricNamespacesListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/metrics.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/metrics.ts new file mode 100644 index 000000000000..ad60c0009c95 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/metrics.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { MetricsListOptionalParams, MetricsListResponse } from "../models"; + +/** Interface representing a Metrics. */ +export interface Metrics { + /** + * **Lists the metric values for a resource**. + * @param resourceUri The identifier of the resource. + * @param options The options parameters. + */ + list( + resourceUri: string, + options?: MetricsListOptionalParams + ): Promise; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/operations.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..da425201c313 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/operations.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + OperationsListOptionalParams, + OperationsListResponse +} from "../models"; + +/** Interface representing a Operations. */ +export interface Operations { + /** + * Lists all of the available operations from Microsoft.Insights provider. + * @param options The options parameters. + */ + list(options?: OperationsListOptionalParams): Promise; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/privateEndpointConnections.ts new file mode 100644 index 000000000000..ebbeb106c13e --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/privateEndpointConnections.ts @@ -0,0 +1,109 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + PrivateEndpointConnection, + PrivateEndpointConnectionsListByPrivateLinkScopeOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse, + PrivateEndpointConnectionsCreateOrUpdateOptionalParams, + PrivateEndpointConnectionsCreateOrUpdateResponse, + PrivateEndpointConnectionsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a PrivateEndpointConnections. */ +export interface PrivateEndpointConnections { + /** + * Gets all private endpoint connections on a private link scope. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param options The options parameters. + */ + listByPrivateLinkScope( + resourceGroupName: string, + scopeName: string, + options?: PrivateEndpointConnectionsListByPrivateLinkScopeOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a private endpoint connection. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + scopeName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams + ): Promise; + /** + * Approve or reject a private endpoint connection with a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + scopeName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PrivateEndpointConnectionsCreateOrUpdateResponse + > + >; + /** + * Approve or reject a private endpoint connection with a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + scopeName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes a private endpoint connection with a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + scopeName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a private endpoint connection with a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + scopeName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/privateLinkResources.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/privateLinkResources.ts new file mode 100644 index 000000000000..54a37da83667 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/privateLinkResources.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { + PrivateLinkResource, + PrivateLinkResourcesListByPrivateLinkScopeOptionalParams, + PrivateLinkResourcesGetOptionalParams, + PrivateLinkResourcesGetResponse +} from "../models"; + +/// +/** Interface representing a PrivateLinkResources. */ +export interface PrivateLinkResources { + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param options The options parameters. + */ + listByPrivateLinkScope( + resourceGroupName: string, + scopeName: string, + options?: PrivateLinkResourcesListByPrivateLinkScopeOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param groupName The name of the private link resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + scopeName: string, + groupName: string, + options?: PrivateLinkResourcesGetOptionalParams + ): Promise; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/privateLinkScopeOperationStatus.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/privateLinkScopeOperationStatus.ts new file mode 100644 index 000000000000..08156f47a625 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/privateLinkScopeOperationStatus.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + PrivateLinkScopeOperationStatusGetOptionalParams, + PrivateLinkScopeOperationStatusGetResponse +} from "../models"; + +/** Interface representing a PrivateLinkScopeOperationStatus. */ +export interface PrivateLinkScopeOperationStatus { + /** + * Get the status of an azure asynchronous operation associated with a private link scope operation. + * @param asyncOperationId The operation Id. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + get( + asyncOperationId: string, + resourceGroupName: string, + options?: PrivateLinkScopeOperationStatusGetOptionalParams + ): Promise; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/privateLinkScopedResources.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/privateLinkScopedResources.ts new file mode 100644 index 000000000000..bed8ecd97510 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/privateLinkScopedResources.ts @@ -0,0 +1,109 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + ScopedResource, + PrivateLinkScopedResourcesListByPrivateLinkScopeOptionalParams, + PrivateLinkScopedResourcesGetOptionalParams, + PrivateLinkScopedResourcesGetResponse, + PrivateLinkScopedResourcesCreateOrUpdateOptionalParams, + PrivateLinkScopedResourcesCreateOrUpdateResponse, + PrivateLinkScopedResourcesDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a PrivateLinkScopedResources. */ +export interface PrivateLinkScopedResources { + /** + * Gets all private endpoint connections on a private link scope. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param options The options parameters. + */ + listByPrivateLinkScope( + resourceGroupName: string, + scopeName: string, + options?: PrivateLinkScopedResourcesListByPrivateLinkScopeOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a scoped resource in a private link scope. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + scopeName: string, + name: string, + options?: PrivateLinkScopedResourcesGetOptionalParams + ): Promise; + /** + * Approve or reject a private endpoint connection with a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @param parameters A private link scoped resource + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + scopeName: string, + name: string, + parameters: ScopedResource, + options?: PrivateLinkScopedResourcesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PrivateLinkScopedResourcesCreateOrUpdateResponse + > + >; + /** + * Approve or reject a private endpoint connection with a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @param parameters A private link scoped resource + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + scopeName: string, + name: string, + parameters: ScopedResource, + options?: PrivateLinkScopedResourcesCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes a private endpoint connection with a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + scopeName: string, + name: string, + options?: PrivateLinkScopedResourcesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a private endpoint connection with a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + scopeName: string, + name: string, + options?: PrivateLinkScopedResourcesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/privateLinkScopes.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/privateLinkScopes.ts new file mode 100644 index 000000000000..c70e5a33bfdb --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/privateLinkScopes.ts @@ -0,0 +1,105 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + AzureMonitorPrivateLinkScope, + PrivateLinkScopesListOptionalParams, + PrivateLinkScopesListByResourceGroupOptionalParams, + PrivateLinkScopesDeleteOptionalParams, + PrivateLinkScopesGetOptionalParams, + PrivateLinkScopesGetResponse, + PrivateLinkScopesCreateOrUpdateOptionalParams, + PrivateLinkScopesCreateOrUpdateResponse, + TagsResource, + PrivateLinkScopesUpdateTagsOptionalParams, + PrivateLinkScopesUpdateTagsResponse +} from "../models"; + +/// +/** Interface representing a PrivateLinkScopes. */ +export interface PrivateLinkScopes { + /** + * Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. + * @param options The options parameters. + */ + list( + options?: PrivateLinkScopesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a list of Azure Monitor PrivateLinkScopes within a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: PrivateLinkScopesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Deletes a Azure Monitor PrivateLinkScope. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + scopeName: string, + options?: PrivateLinkScopesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a Azure Monitor PrivateLinkScope. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + scopeName: string, + options?: PrivateLinkScopesDeleteOptionalParams + ): Promise; + /** + * Returns a Azure Monitor PrivateLinkScope. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + scopeName: string, + options?: PrivateLinkScopesGetOptionalParams + ): Promise; + /** + * Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value + * for InstrumentationKey nor AppId in the Put operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param azureMonitorPrivateLinkScopePayload Properties that need to be specified to create or update + * a Azure Monitor PrivateLinkScope. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + scopeName: string, + azureMonitorPrivateLinkScopePayload: AzureMonitorPrivateLinkScope, + options?: PrivateLinkScopesCreateOrUpdateOptionalParams + ): Promise; + /** + * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateLinkScopeTags Updated tag information to set into the PrivateLinkScope instance. + * @param options The options parameters. + */ + updateTags( + resourceGroupName: string, + scopeName: string, + privateLinkScopeTags: TagsResource, + options?: PrivateLinkScopesUpdateTagsOptionalParams + ): Promise; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/scheduledQueryRules.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/scheduledQueryRules.ts new file mode 100644 index 000000000000..711c2180f5b2 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/scheduledQueryRules.ts @@ -0,0 +1,91 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { + LogSearchRuleResource, + ScheduledQueryRulesListBySubscriptionOptionalParams, + ScheduledQueryRulesListByResourceGroupOptionalParams, + ScheduledQueryRulesCreateOrUpdateOptionalParams, + ScheduledQueryRulesCreateOrUpdateResponse, + ScheduledQueryRulesGetOptionalParams, + ScheduledQueryRulesGetResponse, + LogSearchRuleResourcePatch, + ScheduledQueryRulesUpdateOptionalParams, + ScheduledQueryRulesUpdateResponse, + ScheduledQueryRulesDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a ScheduledQueryRules. */ +export interface ScheduledQueryRules { + /** + * List the Log Search rules within a subscription group. + * @param options The options parameters. + */ + listBySubscription( + options?: ScheduledQueryRulesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * List the Log Search rules within a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: ScheduledQueryRulesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Creates or updates an log search rule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ruleName The name of the rule. + * @param parameters The parameters of the rule to create or update. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + ruleName: string, + parameters: LogSearchRuleResource, + options?: ScheduledQueryRulesCreateOrUpdateOptionalParams + ): Promise; + /** + * Gets an Log Search rule + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ruleName The name of the rule. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + ruleName: string, + options?: ScheduledQueryRulesGetOptionalParams + ): Promise; + /** + * Update log search Rule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ruleName The name of the rule. + * @param parameters The parameters of the rule to update. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + ruleName: string, + parameters: LogSearchRuleResourcePatch, + options?: ScheduledQueryRulesUpdateOptionalParams + ): Promise; + /** + * Deletes a Log Search rule + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ruleName The name of the rule. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + ruleName: string, + options?: ScheduledQueryRulesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/tenantActivityLogs.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/tenantActivityLogs.ts new file mode 100644 index 000000000000..48c0ae888772 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/tenantActivityLogs.ts @@ -0,0 +1,25 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { EventData, TenantActivityLogsListOptionalParams } from "../models"; + +/// +/** Interface representing a TenantActivityLogs. */ +export interface TenantActivityLogs { + /** + * Gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the + * Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).
One + * thing to point out here is that this API does *not* retrieve the logs at the individual subscription + * of the tenant but only surfaces the logs that were generated at the tenant level. + * @param options The options parameters. + */ + list( + options?: TenantActivityLogsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/monitor/arm-monitor/src/operationsInterfaces/vMInsights.ts b/sdk/monitor/arm-monitor/src/operationsInterfaces/vMInsights.ts new file mode 100644 index 000000000000..aa140be77c62 --- /dev/null +++ b/sdk/monitor/arm-monitor/src/operationsInterfaces/vMInsights.ts @@ -0,0 +1,26 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + VMInsightsGetOnboardingStatusOptionalParams, + VMInsightsGetOnboardingStatusResponse +} from "../models"; + +/** Interface representing a VMInsights. */ +export interface VMInsights { + /** + * Retrieves the VM Insights onboarding status for the specified resource or resource scope. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource, or scope, + * whose status to retrieve. + * @param options The options parameters. + */ + getOnboardingStatus( + resourceUri: string, + options?: VMInsightsGetOnboardingStatusOptionalParams + ): Promise; +} diff --git a/sdk/monitor/arm-monitor/test/sampleTest.ts b/sdk/monitor/arm-monitor/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/monitor/arm-monitor/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + 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" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + 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 422b584abd5e..6e3251194117 100644 --- a/sdk/monitor/arm-monitor/tsconfig.json +++ b/sdk/monitor/arm-monitor/tsconfig.json @@ -3,7 +3,7 @@ "module": "es6", "moduleResolution": "node", "strict": true, - "target": "es5", + "target": "es6", "sourceMap": true, "declarationMap": true, "esModuleInterop": true, @@ -11,9 +11,9 @@ "forceConsistentCasingInFileNames": true, "lib": ["es6", "dom"], "declaration": true, - "outDir": "./esm", + "outDir": "./dist-esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./src/**/*.ts", "./test/**/*.ts"], "exclude": ["node_modules"] } diff --git a/sdk/monitor/ci.yml b/sdk/monitor/ci.yml index 568cb7b5a231..8d07913c2138 100644 --- a/sdk/monitor/ci.yml +++ b/sdk/monitor/ci.yml @@ -1,6 +1,3 @@ -# DO NOT EDIT THIS FILE -# This file is generated automatically and any changes will be lost. - trigger: branches: include: @@ -10,7 +7,6 @@ trigger: paths: include: - sdk/monitor/ - pr: branches: include: @@ -18,10 +14,11 @@ pr: - feature/* - release/* - hotfix/* + exclude: + - feature/v4 paths: include: - sdk/monitor/ - extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: @@ -32,3 +29,5 @@ extends: safeName: azuremonitoropentelemetryexporter - name: azure-monitor-query safeName: azuremonitorquery + - name: azure-arm-monitor + safeName: azurearmmonitor