From f5bf0c8d72ebff20f8f670b9fa331071a8271d34 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 10 May 2022 02:46:15 +0000 Subject: [PATCH] CodeGen from PR 18890 in Azure/azure-rest-api-specs Adding Dynatrace.Observability swagger version 2021-09-01-preview (#18890) * Adding Dynatrace.Observability swagger version 2021-09-01-preview * Fixing spellcheck * Update specification/dynatrace/resource-manager/readme.md * Update readme.python.md * Resolved comments * Adding 401 response in SSO Api Co-authored-by: Yuchao Yan --- common/config/rush/pnpm-lock.yaml | 29 + rush.json | 9 +- sdk/dynatrace/arm-dynatrace/CHANGELOG.md | 5 + sdk/dynatrace/arm-dynatrace/LICENSE | 21 + sdk/dynatrace/arm-dynatrace/README.md | 98 ++ sdk/dynatrace/arm-dynatrace/_meta.json | 8 + .../arm-dynatrace/api-extractor.json | 31 + sdk/dynatrace/arm-dynatrace/package.json | 102 ++ .../arm-dynatrace/review/arm-dynatrace.api.md | 910 ++++++++++ sdk/dynatrace/arm-dynatrace/rollup.config.js | 188 +++ .../src/dynatraceObservability.ts | 91 + sdk/dynatrace/arm-dynatrace/src/index.ts | 12 + sdk/dynatrace/arm-dynatrace/src/lroImpl.ts | 34 + .../arm-dynatrace/src/models/index.ts | 1218 ++++++++++++++ .../arm-dynatrace/src/models/mappers.ts | 1480 +++++++++++++++++ .../arm-dynatrace/src/models/parameters.ts | 179 ++ .../arm-dynatrace/src/operations/index.ts | 12 + .../arm-dynatrace/src/operations/monitors.ts | 1363 +++++++++++++++ .../src/operations/operations.ts | 137 ++ .../src/operations/singleSignOn.ts | 355 ++++ .../arm-dynatrace/src/operations/tagRules.ts | 515 ++++++ .../src/operationsInterfaces/index.ts | 12 + .../src/operationsInterfaces/monitors.ts | 216 +++ .../src/operationsInterfaces/operations.ts | 22 + .../src/operationsInterfaces/singleSignOn.ts | 82 + .../src/operationsInterfaces/tagRules.ts | 127 ++ .../arm-dynatrace/test/sampleTest.ts | 48 + sdk/dynatrace/arm-dynatrace/tsconfig.json | 27 + sdk/dynatrace/ci.mgmt.yml | 38 + 29 files changed, 7367 insertions(+), 2 deletions(-) create mode 100644 sdk/dynatrace/arm-dynatrace/CHANGELOG.md create mode 100644 sdk/dynatrace/arm-dynatrace/LICENSE create mode 100644 sdk/dynatrace/arm-dynatrace/README.md create mode 100644 sdk/dynatrace/arm-dynatrace/_meta.json create mode 100644 sdk/dynatrace/arm-dynatrace/api-extractor.json create mode 100644 sdk/dynatrace/arm-dynatrace/package.json create mode 100644 sdk/dynatrace/arm-dynatrace/review/arm-dynatrace.api.md create mode 100644 sdk/dynatrace/arm-dynatrace/rollup.config.js create mode 100644 sdk/dynatrace/arm-dynatrace/src/dynatraceObservability.ts create mode 100644 sdk/dynatrace/arm-dynatrace/src/index.ts create mode 100644 sdk/dynatrace/arm-dynatrace/src/lroImpl.ts create mode 100644 sdk/dynatrace/arm-dynatrace/src/models/index.ts create mode 100644 sdk/dynatrace/arm-dynatrace/src/models/mappers.ts create mode 100644 sdk/dynatrace/arm-dynatrace/src/models/parameters.ts create mode 100644 sdk/dynatrace/arm-dynatrace/src/operations/index.ts create mode 100644 sdk/dynatrace/arm-dynatrace/src/operations/monitors.ts create mode 100644 sdk/dynatrace/arm-dynatrace/src/operations/operations.ts create mode 100644 sdk/dynatrace/arm-dynatrace/src/operations/singleSignOn.ts create mode 100644 sdk/dynatrace/arm-dynatrace/src/operations/tagRules.ts create mode 100644 sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/index.ts create mode 100644 sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/monitors.ts create mode 100644 sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/operations.ts create mode 100644 sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/singleSignOn.ts create mode 100644 sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/tagRules.ts create mode 100644 sdk/dynatrace/arm-dynatrace/test/sampleTest.ts create mode 100644 sdk/dynatrace/arm-dynatrace/tsconfig.json create mode 100644 sdk/dynatrace/ci.mgmt.yml diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 3df37c100915..50c13409ca46 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -64,6 +64,7 @@ specifiers: '@rush-temp/arm-dns-profile-2020-09-01-hybrid': file:./projects/arm-dns-profile-2020-09-01-hybrid.tgz '@rush-temp/arm-dnsresolver': file:./projects/arm-dnsresolver.tgz '@rush-temp/arm-domainservices': file:./projects/arm-domainservices.tgz + '@rush-temp/arm-dynatrace': file:./projects/arm-dynatrace.tgz '@rush-temp/arm-eventgrid': file:./projects/arm-eventgrid.tgz '@rush-temp/arm-eventhub': file:./projects/arm-eventhub.tgz '@rush-temp/arm-eventhub-profile-2020-09-01-hybrid': file:./projects/arm-eventhub-profile-2020-09-01-hybrid.tgz @@ -340,6 +341,7 @@ dependencies: '@rush-temp/arm-dns-profile-2020-09-01-hybrid': file:projects/arm-dns-profile-2020-09-01-hybrid.tgz '@rush-temp/arm-dnsresolver': file:projects/arm-dnsresolver.tgz '@rush-temp/arm-domainservices': file:projects/arm-domainservices.tgz + '@rush-temp/arm-dynatrace': file:projects/arm-dynatrace.tgz '@rush-temp/arm-eventgrid': file:projects/arm-eventgrid.tgz '@rush-temp/arm-eventhub': file:projects/arm-eventhub.tgz '@rush-temp/arm-eventhub-profile-2020-09-01-hybrid': file:projects/arm-eventhub-profile-2020-09-01-hybrid.tgz @@ -10837,6 +10839,33 @@ packages: - supports-color dev: false + file:projects/arm-dynatrace.tgz: + resolution: {integrity: sha512-dKsiQiTg/WnbxTjscNzonn/Nkq9Wog7SZfoHD+7/dKhUOriiTAifOktdk4caJs1PvL+VVtVpNY8MBelpTPf/Sw==, tarball: file:projects/arm-dynatrace.tgz} + name: '@rush-temp/arm-dynatrace' + version: 0.0.0 + dependencies: + '@azure-tools/test-recorder': 1.0.2 + '@azure/identity': 2.0.4 + '@microsoft/api-extractor': 7.23.1 + '@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.4.0 + typescript: 4.2.4 + uglify-js: 3.15.4 + transitivePeerDependencies: + - debug + - encoding + - supports-color + dev: false + file:projects/arm-eventgrid.tgz: resolution: {integrity: sha512-XscA7PNd+AncG9fYsHq0qfE3n7vA1whsgIEJxPoELsmZMlst8wc+n55LeYiEROwpemNQrAzUddFYWoa3/Hk0Jg==, tarball: file:projects/arm-eventgrid.tgz} name: '@rush-temp/arm-eventgrid' diff --git a/rush.json b/rush.json index f051c1fab022..12588146a9d7 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. @@ -1690,6 +1690,11 @@ "packageName": "@azure/arm-servicelinker", "projectFolder": "sdk/servicelinker/arm-servicelinker", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-dynatrace", + "projectFolder": "sdk/dynatrace/arm-dynatrace", + "versionPolicyName": "management" } ] -} +} \ No newline at end of file diff --git a/sdk/dynatrace/arm-dynatrace/CHANGELOG.md b/sdk/dynatrace/arm-dynatrace/CHANGELOG.md new file mode 100644 index 000000000000..a2a4c5411df9 --- /dev/null +++ b/sdk/dynatrace/arm-dynatrace/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-05-10) + +The package of @azure/arm-dynatrace is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/dynatrace/arm-dynatrace/LICENSE b/sdk/dynatrace/arm-dynatrace/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/dynatrace/arm-dynatrace/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +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. \ No newline at end of file diff --git a/sdk/dynatrace/arm-dynatrace/README.md b/sdk/dynatrace/arm-dynatrace/README.md new file mode 100644 index 000000000000..bd794c9c5982 --- /dev/null +++ b/sdk/dynatrace/arm-dynatrace/README.md @@ -0,0 +1,98 @@ +# Azure Service client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Service client. + + + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dynatrace/arm-dynatrace) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-dynatrace) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-dynatrace?view=azure-node-preview) | +[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. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-dynatrace` package + +Install the Azure Service client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-dynatrace +``` + +### Create and authenticate a `DynatraceObservability` + +To create a client object to access the Azure Service API, you will need the `endpoint` of your Azure Service resource and a `credential`. The Azure Service client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure Service resource in the [Azure Portal][azure_portal]. + +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: + +```bash +npm install @azure/identity +``` + +You will also need to **register a new AAD application and grant access to Azure Service** 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 { DynatraceObservability } = require("@azure/arm-dynatrace"); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new DynatraceObservability(new DefaultAzureCredential(), subscriptionId); +``` + + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### DynatraceObservability + +`DynatraceObservability` is the primary interface for developers using the Azure Service client library. Explore the methods on this client object to understand the different features of the Azure Service 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) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fdynatrace%2Farm-dynatrace%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/dynatrace/arm-dynatrace/_meta.json b/sdk/dynatrace/arm-dynatrace/_meta.json new file mode 100644 index 000000000000..6de7bec60b75 --- /dev/null +++ b/sdk/dynatrace/arm-dynatrace/_meta.json @@ -0,0 +1,8 @@ +{ + "commit": "fd4dd3abc8bf0cdaebdf74215d0dbe3ec705fe9c", + "readme": "specification/dynatrace/resource-manager/readme.md", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/dynatrace/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220105.1", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.3.0", + "use": "@autorest/typescript@6.0.0-alpha.16.20220105.1" +} \ No newline at end of file diff --git a/sdk/dynatrace/arm-dynatrace/api-extractor.json b/sdk/dynatrace/arm-dynatrace/api-extractor.json new file mode 100644 index 000000000000..ed3610105861 --- /dev/null +++ b/sdk/dynatrace/arm-dynatrace/api-extractor.json @@ -0,0 +1,31 @@ +{ + "$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-dynatrace.d.ts" + }, + "messages": { + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, + "extractorMessageReporting": { + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } + } + } +} \ No newline at end of file diff --git a/sdk/dynatrace/arm-dynatrace/package.json b/sdk/dynatrace/arm-dynatrace/package.json new file mode 100644 index 000000000000..0222071888ce --- /dev/null +++ b/sdk/dynatrace/arm-dynatrace/package.json @@ -0,0 +1,102 @@ +{ + "name": "@azure/arm-dynatrace", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for DynatraceObservability.", + "version": "1.0.0-beta.1", + "engines": { + "node": ">=12.0.0" + }, + "dependencies": { + "@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" + ], + "license": "MIT", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-dynatrace.d.ts", + "devDependencies": { + "@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", + "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/dynatrace/arm-dynatrace", + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.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", + "review/*", + "CHANGELOG.md", + "types/*" + ], + "scripts": { + "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 +} \ No newline at end of file diff --git a/sdk/dynatrace/arm-dynatrace/review/arm-dynatrace.api.md b/sdk/dynatrace/arm-dynatrace/review/arm-dynatrace.api.md new file mode 100644 index 000000000000..c5c7e70b032d --- /dev/null +++ b/sdk/dynatrace/arm-dynatrace/review/arm-dynatrace.api.md @@ -0,0 +1,910 @@ +## API Report File for "@azure/arm-dynatrace" + +> 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 AccountInfo { + accountId?: string; + regionId?: string; +} + +// @public +export interface AccountInfoSecure { + readonly accountId?: string; + readonly apiKey?: string; + readonly regionId?: string; +} + +// @public +export type ActionType = string; + +// @public +export interface AppServiceInfo { + autoUpdateSetting?: AutoUpdateSetting; + availabilityState?: AvailabilityState; + hostGroup?: string; + hostName?: string; + logModule?: LogModule; + monitoringType?: MonitoringType; + resourceId?: string; + updateStatus?: UpdateStatus; + version?: string; +} + +// @public +export interface AppServiceListResponse { + nextLink: string; + value: AppServiceInfo[]; +} + +// @public +export type AutoUpdateSetting = string; + +// @public +export type AvailabilityState = string; + +// @public +export type CreatedByType = string; + +// @public +export interface DynatraceEnvironmentProperties { + accountInfo?: AccountInfo; + environmentInfo?: EnvironmentInfo; + singleSignOnProperties?: DynatraceSingleSignOnProperties; + userId?: string; +} + +// @public (undocumented) +export class DynatraceObservability extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: DynatraceObservabilityOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + monitors: Monitors; + // (undocumented) + operations: Operations; + // (undocumented) + singleSignOn: SingleSignOn; + // (undocumented) + subscriptionId: string; + // (undocumented) + tagRules: TagRules; +} + +// @public +export interface DynatraceObservabilityOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface DynatraceSingleSignOnProperties { + aadDomains?: string[]; + enterpriseAppId?: string; + readonly provisioningState?: ProvisioningState; + singleSignOnState?: SingleSignOnStates; + singleSignOnUrl?: string; +} + +// @public +export type DynatraceSingleSignOnResource = ProxyResource & { + readonly systemData?: SystemData; + singleSignOnState?: SingleSignOnStates; + enterpriseAppId?: string; + singleSignOnUrl?: string; + aadDomains?: string[]; + readonly provisioningState?: ProvisioningState; +}; + +// @public +export interface DynatraceSingleSignOnResourceListResult { + nextLink: string; + value: DynatraceSingleSignOnResource[]; +} + +// @public +export interface EnvironmentInfo { + environmentId?: string; + ingestionKey?: string; + landingURL?: string; + logsIngestionEndpoint?: string; +} + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export interface FilteringTag { + action?: TagAction; + name?: string; + value?: string; +} + +// @public +export interface IdentityProperties { + readonly principalId?: string; + readonly tenantId?: string; + type: ManagedIdentityType; + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentity; + }; +} + +// @public +export enum KnownActionType { + // (undocumented) + Internal = "Internal" +} + +// @public +export enum KnownAutoUpdateSetting { + // (undocumented) + Disabled = "DISABLED", + // (undocumented) + Enabled = "ENABLED" +} + +// @public +export enum KnownAvailabilityState { + // (undocumented) + Crashed = "CRASHED", + // (undocumented) + Lost = "LOST", + // (undocumented) + Monitored = "MONITORED", + // (undocumented) + PREMonitored = "PRE_MONITORED", + // (undocumented) + Shutdown = "SHUTDOWN", + // (undocumented) + UnexpectedShutdown = "UNEXPECTED_SHUTDOWN", + // (undocumented) + Unknown = "UNKNOWN", + // (undocumented) + Unmonitored = "UNMONITORED" +} + +// @public +export enum KnownCreatedByType { + // (undocumented) + Application = "Application", + // (undocumented) + Key = "Key", + // (undocumented) + ManagedIdentity = "ManagedIdentity", + // (undocumented) + User = "User" +} + +// @public +export enum KnownLiftrResourceCategories { + // (undocumented) + MonitorLogs = "MonitorLogs", + // (undocumented) + Unknown = "Unknown" +} + +// @public +export enum KnownLogModule { + // (undocumented) + Disabled = "DISABLED", + // (undocumented) + Enabled = "ENABLED" +} + +// @public +export enum KnownManagedIdentityType { + // (undocumented) + SystemAndUserAssigned = "SystemAndUserAssigned", + // (undocumented) + SystemAssigned = "SystemAssigned", + // (undocumented) + UserAssigned = "UserAssigned" +} + +// @public +export enum KnownMarketplaceSubscriptionStatus { + // (undocumented) + Active = "Active", + // (undocumented) + Suspended = "Suspended" +} + +// @public +export enum KnownMonitoringStatus { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled" +} + +// @public +export enum KnownMonitoringType { + // (undocumented) + CloudInfrastructure = "CLOUD_INFRASTRUCTURE", + // (undocumented) + FullStack = "FULL_STACK" +} + +// @public +export enum KnownOrigin { + // (undocumented) + System = "system", + // (undocumented) + User = "user", + // (undocumented) + UserSystem = "user,system" +} + +// @public +export enum KnownProvisioningState { + // (undocumented) + Accepted = "Accepted", + // (undocumented) + Canceled = "Canceled", + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleted = "Deleted", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + NotSpecified = "NotSpecified", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Updating = "Updating" +} + +// @public +export enum KnownSendAadLogsStatus { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled" +} + +// @public +export enum KnownSendActivityLogsStatus { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled" +} + +// @public +export enum KnownSendingLogsStatus { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled" +} + +// @public +export enum KnownSendingMetricsStatus { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled" +} + +// @public +export enum KnownSendSubscriptionLogsStatus { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled" +} + +// @public +export enum KnownSingleSignOnStates { + // (undocumented) + Disable = "Disable", + // (undocumented) + Enable = "Enable", + // (undocumented) + Existing = "Existing", + // (undocumented) + Initial = "Initial" +} + +// @public +export enum KnownSSOStatus { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled" +} + +// @public +export enum KnownTagAction { + // (undocumented) + Exclude = "Exclude", + // (undocumented) + Include = "Include" +} + +// @public +export enum KnownUpdateStatus { + // (undocumented) + Incompatible = "INCOMPATIBLE", + // (undocumented) + Outdated = "OUTDATED", + // (undocumented) + Scheduled = "SCHEDULED", + // (undocumented) + Suppressed = "SUPPRESSED", + // (undocumented) + Unknown = "UNKNOWN", + // (undocumented) + UP2Date = "UP2DATE", + // (undocumented) + UpdateINProgress = "UPDATE_IN_PROGRESS", + // (undocumented) + UpdatePending = "UPDATE_PENDING", + // (undocumented) + UpdateProblem = "UPDATE_PROBLEM" +} + +// @public +export type LiftrResourceCategories = string; + +// @public +export interface LinkableEnvironmentListResponse { + nextLink?: string; + value?: LinkableEnvironmentResponse[]; +} + +// @public +export interface LinkableEnvironmentRequest { + region?: string; + tenantId?: string; + userPrincipal?: string; +} + +// @public +export interface LinkableEnvironmentResponse { + environmentId?: string; + environmentName?: string; + planData?: PlanData; +} + +// @public +export type LogModule = string; + +// @public +export interface LogRules { + filteringTags?: FilteringTag[]; + sendAadLogs?: SendAadLogsStatus; + sendActivityLogs?: SendActivityLogsStatus; + sendSubscriptionLogs?: SendSubscriptionLogsStatus; +} + +// @public +export type ManagedIdentityType = string; + +// @public +export type MarketplaceSubscriptionStatus = string; + +// @public +export interface MetricRules { + filteringTags?: FilteringTag[]; +} + +// @public +export interface MonitoredResource { + id?: string; + reasonForLogsStatus?: string; + reasonForMetricsStatus?: string; + sendingLogs?: SendingLogsStatus; + sendingMetrics?: SendingMetricsStatus; +} + +// @public +export interface MonitoredResourceListResponse { + nextLink: string; + value: MonitoredResource[]; +} + +// @public +export type MonitoringStatus = string; + +// @public +export type MonitoringType = string; + +// @public +export type MonitorResource = TrackedResource & { + readonly systemData?: SystemData; + identity?: IdentityProperties; + monitoringStatus?: MonitoringStatus; + marketplaceSubscriptionStatus?: MarketplaceSubscriptionStatus; + dynatraceEnvironmentProperties?: DynatraceEnvironmentProperties; + userInfo?: UserInfo; + planData?: PlanData; + readonly liftrResourceCategory?: LiftrResourceCategories; + readonly liftrResourcePreference?: number; + readonly provisioningState?: ProvisioningState; +}; + +// @public +export interface MonitorResourceListResult { + nextLink: string; + value: MonitorResource[]; +} + +// @public +export interface MonitorResourceUpdate { + dynatraceEnvironmentProperties?: DynatraceEnvironmentProperties; + marketplaceSubscriptionStatus?: MarketplaceSubscriptionStatus; + monitoringStatus?: MonitoringStatus; + planData?: PlanData; + tags?: { + [propertyName: string]: string; + }; + userInfo?: UserInfo; +} + +// @public +export interface Monitors { + beginCreateOrUpdate(resourceGroupName: string, monitorName: string, resource: MonitorResource, options?: MonitorsCreateOrUpdateOptionalParams): Promise, MonitorsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, monitorName: string, resource: MonitorResource, options?: MonitorsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, monitorName: string, options?: MonitorsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, monitorName: string, options?: MonitorsDeleteOptionalParams): Promise; + get(resourceGroupName: string, monitorName: string, options?: MonitorsGetOptionalParams): Promise; + getAccountCredentials(resourceGroupName: string, monitorName: string, options?: MonitorsGetAccountCredentialsOptionalParams): Promise; + getSSODetails(resourceGroupName: string, monitorName: string, options?: MonitorsGetSSODetailsOptionalParams): Promise; + getVMHostPayload(resourceGroupName: string, monitorName: string, options?: MonitorsGetVMHostPayloadOptionalParams): Promise; + listAppServices(resourceGroupName: string, monitorName: string, options?: MonitorsListAppServicesOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: MonitorsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscriptionId(options?: MonitorsListBySubscriptionIdOptionalParams): PagedAsyncIterableIterator; + listHosts(resourceGroupName: string, monitorName: string, options?: MonitorsListHostsOptionalParams): PagedAsyncIterableIterator; + listLinkableEnvironments(resourceGroupName: string, monitorName: string, request: LinkableEnvironmentRequest, options?: MonitorsListLinkableEnvironmentsOptionalParams): PagedAsyncIterableIterator; + listMonitoredResources(resourceGroupName: string, monitorName: string, options?: MonitorsListMonitoredResourcesOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, monitorName: string, resource: MonitorResourceUpdate, options?: MonitorsUpdateOptionalParams): Promise; +} + +// @public +export interface MonitorsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type MonitorsCreateOrUpdateResponse = MonitorResource; + +// @public +export interface MonitorsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface MonitorsGetAccountCredentialsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsGetAccountCredentialsResponse = AccountInfoSecure; + +// @public +export interface MonitorsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsGetResponse = MonitorResource; + +// @public +export interface MonitorsGetSSODetailsOptionalParams extends coreClient.OperationOptions { + request?: SSODetailsRequest; +} + +// @public +export type MonitorsGetSSODetailsResponse = SSODetailsResponse; + +// @public +export interface MonitorsGetVMHostPayloadOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsGetVMHostPayloadResponse = VMExtensionPayload; + +// @public +export interface MonitorsListAppServicesNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsListAppServicesNextResponse = AppServiceListResponse; + +// @public +export interface MonitorsListAppServicesOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsListAppServicesResponse = AppServiceListResponse; + +// @public +export interface MonitorsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsListByResourceGroupNextResponse = MonitorResourceListResult; + +// @public +export interface MonitorsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsListByResourceGroupResponse = MonitorResourceListResult; + +// @public +export interface MonitorsListBySubscriptionIdNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsListBySubscriptionIdNextResponse = MonitorResourceListResult; + +// @public +export interface MonitorsListBySubscriptionIdOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsListBySubscriptionIdResponse = MonitorResourceListResult; + +// @public +export interface MonitorsListHostsNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsListHostsNextResponse = VMHostsListResponse; + +// @public +export interface MonitorsListHostsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsListHostsResponse = VMHostsListResponse; + +// @public +export interface MonitorsListLinkableEnvironmentsNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsListLinkableEnvironmentsNextResponse = LinkableEnvironmentListResponse; + +// @public +export interface MonitorsListLinkableEnvironmentsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsListLinkableEnvironmentsResponse = LinkableEnvironmentListResponse; + +// @public +export interface MonitorsListMonitoredResourcesNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsListMonitoredResourcesNextResponse = MonitoredResourceListResponse; + +// @public +export interface MonitorsListMonitoredResourcesOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsListMonitoredResourcesResponse = MonitoredResourceListResponse; + +// @public +export interface MonitorsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsUpdateResponse = MonitorResource; + +// @public +export interface Operation { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export type Origin = string; + +// @public +export interface PlanData { + billingCycle?: string; + effectiveDate?: Date; + planDetails?: string; + usageType?: string; +} + +// @public +export type ProvisioningState = string; + +// @public +export type ProxyResource = Resource & {}; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export type SendAadLogsStatus = string; + +// @public +export type SendActivityLogsStatus = string; + +// @public +export type SendingLogsStatus = string; + +// @public +export type SendingMetricsStatus = string; + +// @public +export type SendSubscriptionLogsStatus = string; + +// @public +export interface SingleSignOn { + beginCreateOrUpdate(resourceGroupName: string, monitorName: string, configurationName: string, resource: DynatraceSingleSignOnResource, options?: SingleSignOnCreateOrUpdateOptionalParams): Promise, SingleSignOnCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, monitorName: string, configurationName: string, resource: DynatraceSingleSignOnResource, options?: SingleSignOnCreateOrUpdateOptionalParams): Promise; + get(resourceGroupName: string, monitorName: string, configurationName: string, options?: SingleSignOnGetOptionalParams): Promise; + list(resourceGroupName: string, monitorName: string, options?: SingleSignOnListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface SingleSignOnCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SingleSignOnCreateOrUpdateResponse = DynatraceSingleSignOnResource; + +// @public +export interface SingleSignOnGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SingleSignOnGetResponse = DynatraceSingleSignOnResource; + +// @public +export interface SingleSignOnListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SingleSignOnListNextResponse = DynatraceSingleSignOnResourceListResult; + +// @public +export interface SingleSignOnListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SingleSignOnListResponse = DynatraceSingleSignOnResourceListResult; + +// @public +export type SingleSignOnStates = string; + +// @public +export interface SSODetailsRequest { + userPrincipal?: string; +} + +// @public +export interface SSODetailsResponse { + aadDomains?: string[]; + adminUsers?: string[]; + isSsoEnabled?: SSOStatus; + metadataUrl?: string; + singleSignOnUrl?: string; +} + +// @public +export type SSOStatus = string; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export type TagAction = string; + +// @public +export type TagRule = ProxyResource & { + readonly systemData?: SystemData; + logRules?: LogRules; + metricRules?: MetricRules; + readonly provisioningState?: ProvisioningState; +}; + +// @public +export interface TagRuleListResult { + nextLink: string; + value: TagRule[]; +} + +// @public +export interface TagRules { + beginCreateOrUpdate(resourceGroupName: string, monitorName: string, ruleSetName: string, resource: TagRule, options?: TagRulesCreateOrUpdateOptionalParams): Promise, TagRulesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, monitorName: string, ruleSetName: string, resource: TagRule, options?: TagRulesCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, monitorName: string, ruleSetName: string, options?: TagRulesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, monitorName: string, ruleSetName: string, options?: TagRulesDeleteOptionalParams): Promise; + get(resourceGroupName: string, monitorName: string, ruleSetName: string, options?: TagRulesGetOptionalParams): Promise; + list(resourceGroupName: string, monitorName: string, options?: TagRulesListOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, monitorName: string, ruleSetName: string, resource: TagRuleUpdate, options?: TagRulesUpdateOptionalParams): Promise; +} + +// @public +export interface TagRulesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type TagRulesCreateOrUpdateResponse = TagRule; + +// @public +export interface TagRulesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface TagRulesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TagRulesGetResponse = TagRule; + +// @public +export interface TagRulesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TagRulesListNextResponse = TagRuleListResult; + +// @public +export interface TagRulesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TagRulesListResponse = TagRuleListResult; + +// @public +export interface TagRulesUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TagRulesUpdateResponse = TagRule; + +// @public +export interface TagRuleUpdate { + logRules?: LogRules; + metricRules?: MetricRules; +} + +// @public +export type TrackedResource = Resource & { + tags?: { + [propertyName: string]: string; + }; + location: string; +}; + +// @public +export type UpdateStatus = string; + +// @public +export interface UserAssignedIdentity { + clientId: string; + principalId: string; +} + +// @public +export interface UserInfo { + country?: string; + emailAddress?: string; + firstName?: string; + lastName?: string; + phoneNumber?: string; +} + +// @public +export interface VMExtensionPayload { + environmentId?: string; + ingestionKey?: string; +} + +// @public +export interface VMHostsListResponse { + nextLink: string; + value: VMInfo[]; +} + +// @public +export interface VMInfo { + autoUpdateSetting?: AutoUpdateSetting; + availabilityState?: AvailabilityState; + hostGroup?: string; + hostName?: string; + logModule?: LogModule; + monitoringType?: MonitoringType; + resourceId?: string; + updateStatus?: UpdateStatus; + version?: string; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/dynatrace/arm-dynatrace/rollup.config.js b/sdk/dynatrace/arm-dynatrace/rollup.config.js new file mode 100644 index 000000000000..9be1955eb7f1 --- /dev/null +++ b/sdk/dynatrace/arm-dynatrace/rollup.config.js @@ -0,0 +1,188 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 + +/** + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +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/**"] + }, + 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 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/dynatrace/arm-dynatrace/src/dynatraceObservability.ts b/sdk/dynatrace/arm-dynatrace/src/dynatraceObservability.ts new file mode 100644 index 000000000000..69f40c497920 --- /dev/null +++ b/sdk/dynatrace/arm-dynatrace/src/dynatraceObservability.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 * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + MonitorsImpl, + OperationsImpl, + TagRulesImpl, + SingleSignOnImpl +} from "./operations"; +import { + Monitors, + Operations, + TagRules, + SingleSignOn +} from "./operationsInterfaces"; +import { DynatraceObservabilityOptionalParams } from "./models"; + +export class DynatraceObservability extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + + /** + * Initializes a new instance of the DynatraceObservability 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?: DynatraceObservabilityOptionalParams + ) { + 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: DynatraceObservabilityOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-dynatrace/1.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.apiVersion = options.apiVersion || "2021-09-01-preview"; + this.monitors = new MonitorsImpl(this); + this.operations = new OperationsImpl(this); + this.tagRules = new TagRulesImpl(this); + this.singleSignOn = new SingleSignOnImpl(this); + } + + monitors: Monitors; + operations: Operations; + tagRules: TagRules; + singleSignOn: SingleSignOn; +} diff --git a/sdk/dynatrace/arm-dynatrace/src/index.ts b/sdk/dynatrace/arm-dynatrace/src/index.ts new file mode 100644 index 000000000000..996eb59a2ee2 --- /dev/null +++ b/sdk/dynatrace/arm-dynatrace/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 { DynatraceObservability } from "./dynatraceObservability"; +export * from "./operationsInterfaces"; diff --git a/sdk/dynatrace/arm-dynatrace/src/lroImpl.ts b/sdk/dynatrace/arm-dynatrace/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/dynatrace/arm-dynatrace/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/dynatrace/arm-dynatrace/src/models/index.ts b/sdk/dynatrace/arm-dynatrace/src/models/index.ts new file mode 100644 index 000000000000..5b8fe6dba357 --- /dev/null +++ b/sdk/dynatrace/arm-dynatrace/src/models/index.ts @@ -0,0 +1,1218 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; + +/** Dynatrace account API Key */ +export interface AccountInfoSecure { + /** + * Account Id of the account this environment is linked to + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly accountId?: string; + /** + * API Key of the user account + * This value contains a credential. Consider obscuring before showing to users + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly apiKey?: string; + /** + * Region in which the account is created + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly regionId?: string; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { + /** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly info?: Record; +} + +/** List of all the resources being monitored by Dynatrace monitor resource */ +export interface MonitoredResourceListResponse { + /** The items on this page */ + value: MonitoredResource[]; + /** The link to the next page of items */ + nextLink: string; +} + +/** Details of resource being monitored by Dynatrace monitor resource */ +export interface MonitoredResource { + /** The ARM id of the resource. */ + id?: string; + /** Flag indicating if resource is sending metrics to Dynatrace. */ + sendingMetrics?: SendingMetricsStatus; + /** Reason for why the resource is sending metrics (or why it is not sending). */ + reasonForMetricsStatus?: string; + /** Flag indicating if resource is sending logs to Dynatrace. */ + sendingLogs?: SendingLogsStatus; + /** Reason for why the resource is sending logs (or why it is not sending). */ + reasonForLogsStatus?: string; +} + +/** Response of payload to be passed while installing VM agent. */ +export interface VMExtensionPayload { + /** Ingestion key of the environment */ + ingestionKey?: string; + /** Id of the environment created */ + environmentId?: string; +} + +/** Properties of the Dynatrace environment. */ +export interface DynatraceEnvironmentProperties { + /** User id */ + userId?: string; + /** Dynatrace Account Information */ + accountInfo?: AccountInfo; + /** Dynatrace Environment Information */ + environmentInfo?: EnvironmentInfo; + /** The details of a Dynatrace single sign-on. */ + singleSignOnProperties?: DynatraceSingleSignOnProperties; +} + +/** Dynatrace Account Information */ +export interface AccountInfo { + /** Account Id of the account this environment is linked to */ + accountId?: string; + /** Region in which the account is created */ + regionId?: string; +} + +/** Dynatrace Environment Information */ +export interface EnvironmentInfo { + /** Id of the environment created */ + environmentId?: string; + /** Ingestion key of the environment */ + ingestionKey?: string; + /** Ingestion endpoint used for sending logs */ + logsIngestionEndpoint?: string; + /** Landing URL for Dynatrace environment */ + landingURL?: string; +} + +/** The details of a Dynatrace single sign-on. */ +export interface DynatraceSingleSignOnProperties { + /** State of Single Sign On */ + singleSignOnState?: SingleSignOnStates; + /** Version of the Dynatrace agent installed on the VM. */ + enterpriseAppId?: string; + /** The login URL specific to this Dynatrace Environment */ + singleSignOnUrl?: string; + /** array of Aad(azure active directory) domains */ + aadDomains?: string[]; + /** + * Provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; +} + +/** User info. */ +export interface UserInfo { + /** First Name of the user */ + firstName?: string; + /** Last Name of the user */ + lastName?: string; + /** Email of the user used by Dynatrace for contacting them if needed */ + emailAddress?: string; + /** Phone number of the user used by Dynatrace for contacting them if needed */ + phoneNumber?: string; + /** Country of the user */ + country?: string; +} + +/** Billing plan information. */ +export interface PlanData { + /** different usage type like PAYG/COMMITTED. this could be enum */ + usageType?: string; + /** different billing cycles like MONTHLY/WEEKLY. this could be enum */ + billingCycle?: string; + /** plan id as published by Dynatrace */ + planDetails?: string; + /** date when plan was applied */ + effectiveDate?: Date; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +/** The properties of the managed service identities assigned to this resource. */ +export interface IdentityProperties { + /** + * The Active Directory tenant id of the principal. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** + * The active directory identifier of this principal. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** The type of managed identity assigned to this resource. */ + type: ManagedIdentityType; + /** The identities assigned to this resource by the user. */ + userAssignedIdentities?: { [propertyName: string]: UserAssignedIdentity }; +} + +/** A managed identity assigned by the user. */ +export interface UserAssignedIdentity { + /** The active directory client identifier for this principal. */ + clientId: string; + /** The active directory identifier for this principal. */ + principalId: string; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; +} + +/** The updatable properties of the MonitorResource. */ +export interface MonitorResourceUpdate { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** Status of the monitor. */ + monitoringStatus?: MonitoringStatus; + /** Marketplace subscription status. */ + marketplaceSubscriptionStatus?: MarketplaceSubscriptionStatus; + /** Properties of the Dynatrace environment. */ + dynatraceEnvironmentProperties?: DynatraceEnvironmentProperties; + /** User info. */ + userInfo?: UserInfo; + /** Billing plan information. */ + planData?: PlanData; +} + +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface OperationListResult { + /** + * List of operations supported by the resource provider + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Operation[]; + /** + * URL to get the next set of operation list results (if there are any). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { + /** + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; + /** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly origin?: Origin; + /** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly actionType?: ActionType; +} + +/** Localized display information for this particular operation. */ +export interface OperationDisplay { + /** + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provider?: string; + /** + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resource?: string; + /** + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operation?: string; + /** + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; +} + +/** The response of a MonitorResource list operation. */ +export interface MonitorResourceListResult { + /** The items on this page */ + value: MonitorResource[]; + /** The link to the next page of items */ + nextLink: string; +} + +/** Set of rules for sending logs for the Monitor resource. */ +export interface LogRules { + /** Flag specifying if AAD logs should be sent for the Monitor resource. */ + sendAadLogs?: SendAadLogsStatus; + /** Flag specifying if subscription logs should be sent for the Monitor resource. */ + sendSubscriptionLogs?: SendSubscriptionLogsStatus; + /** Flag specifying if activity logs from Azure resources should be sent for the Monitor resource. */ + sendActivityLogs?: SendActivityLogsStatus; + /** + * List of filtering tags to be used for capturing logs. This only takes effect if SendActivityLogs flag is enabled. If empty, all resources will be captured. + * If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags. + */ + filteringTags?: FilteringTag[]; +} + +/** The definition of a filtering tag. Filtering tags are used for capturing resources and include/exclude them from being monitored. */ +export interface FilteringTag { + /** The name (also known as the key) of the tag. */ + name?: string; + /** The value of the tag. */ + value?: string; + /** Valid actions for a filtering tag. Exclusion takes priority over inclusion. */ + action?: TagAction; +} + +/** Set of rules for sending metrics for the Monitor resource. */ +export interface MetricRules { + /** List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags. */ + filteringTags?: FilteringTag[]; +} + +/** The updatable properties of the TagRule. */ +export interface TagRuleUpdate { + /** Set of rules for sending logs for the Monitor resource. */ + logRules?: LogRules; + /** Set of rules for sending metrics for the Monitor resource. */ + metricRules?: MetricRules; +} + +/** The response of a TagRule list operation. */ +export interface TagRuleListResult { + /** The items on this page */ + value: TagRule[]; + /** The link to the next page of items */ + nextLink: string; +} + +/** The response of a DynatraceSingleSignOnResource list operation. */ +export interface DynatraceSingleSignOnResourceListResult { + /** The items on this page */ + value: DynatraceSingleSignOnResource[]; + /** The link to the next page of items */ + nextLink: string; +} + +/** Response of a list VM Host Operation. */ +export interface VMHostsListResponse { + /** The items on this page */ + value: VMInfo[]; + /** The link to the next page of items */ + nextLink: string; +} + +/** Details of VM Resource having Dynatrace OneAgent installed */ +export interface VMInfo { + /** Azure VM resource ID */ + resourceId?: string; + /** Version of the Dynatrace agent installed on the VM. */ + version?: string; + /** The monitoring mode of OneAgent */ + monitoringType?: MonitoringType; + /** Update settings of OneAgent. */ + autoUpdateSetting?: AutoUpdateSetting; + /** The current update status of OneAgent. */ + updateStatus?: UpdateStatus; + /** The availability state of OneAgent. */ + availabilityState?: AvailabilityState; + /** Tells whether log modules are enabled or not */ + logModule?: LogModule; + /** The name of the host group */ + hostGroup?: string; + /** The name of the host */ + hostName?: string; +} + +/** Response of a list App Services Operation. */ +export interface AppServiceListResponse { + /** The items on this page */ + value: AppServiceInfo[]; + /** The link to the next page of items */ + nextLink: string; +} + +/** Details of App Services having Dynatrace OneAgent installed */ +export interface AppServiceInfo { + /** App service resource ID */ + resourceId?: string; + /** Version of the Dynatrace agent installed on the App Service. */ + version?: string; + /** The monitoring mode of OneAgent */ + monitoringType?: MonitoringType; + /** Update settings of OneAgent. */ + autoUpdateSetting?: AutoUpdateSetting; + /** The current update status of OneAgent. */ + updateStatus?: UpdateStatus; + /** The availability state of OneAgent. */ + availabilityState?: AvailabilityState; + /** Tells whether log modules are enabled or not */ + logModule?: LogModule; + /** The name of the host group */ + hostGroup?: string; + /** The name of the host */ + hostName?: string; +} + +/** Request for getting sso details for a user */ +export interface SSODetailsRequest { + /** user principal id of the user */ + userPrincipal?: string; +} + +/** SSO details from the Dynatrace partner */ +export interface SSODetailsResponse { + /** Whether the SSO is enabled for this resource or not. */ + isSsoEnabled?: SSOStatus; + /** URL for Azure AD metadata */ + metadataUrl?: string; + /** The login URL specific to this Dynatrace Environment */ + singleSignOnUrl?: string; + /** array of Aad(azure active directory) domains */ + aadDomains?: string[]; + /** Array of admin user emails. */ + adminUsers?: string[]; +} + +/** Request for getting all the linkable environments for a user */ +export interface LinkableEnvironmentRequest { + /** Tenant Id of the user in which they want to link the environment */ + tenantId?: string; + /** user principal id of the user */ + userPrincipal?: string; + /** Azure region in which we want to link the environment */ + region?: string; +} + +/** Response for getting all the linkable environments */ +export interface LinkableEnvironmentListResponse { + /** List of environments for which user is an admin */ + value?: LinkableEnvironmentResponse[]; + /** Link to the next set of results, if any. */ + nextLink?: string; +} + +/** Response for getting all the linkable environments */ +export interface LinkableEnvironmentResponse { + /** environment id for which user is an admin */ + environmentId?: string; + /** Name of the environment */ + environmentName?: string; + /** Billing plan information. */ + planData?: PlanData; +} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export type TrackedResource = Resource & { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +}; + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export type ProxyResource = Resource & {}; + +/** Dynatrace Monitor Resource */ +export type MonitorResource = TrackedResource & { + /** + * System metadata for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** The managed service identities assigned to this resource. */ + identity?: IdentityProperties; + /** Status of the monitor. */ + monitoringStatus?: MonitoringStatus; + /** Marketplace subscription status. */ + marketplaceSubscriptionStatus?: MarketplaceSubscriptionStatus; + /** Properties of the Dynatrace environment. */ + dynatraceEnvironmentProperties?: DynatraceEnvironmentProperties; + /** User info. */ + userInfo?: UserInfo; + /** Billing plan information. */ + planData?: PlanData; + /** + * Liftr Resource category. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly liftrResourceCategory?: LiftrResourceCategories; + /** + * The priority of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly liftrResourcePreference?: number; + /** + * Provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; +}; + +/** Tag rules for a monitor resource */ +export type TagRule = ProxyResource & { + /** + * System metadata for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** Set of rules for sending logs for the Monitor resource. */ + logRules?: LogRules; + /** Set of rules for sending metrics for the Monitor resource. */ + metricRules?: MetricRules; + /** + * Provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; +}; + +/** Single sign-on configurations for a given monitor resource. */ +export type DynatraceSingleSignOnResource = ProxyResource & { + /** + * System metadata for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** State of Single Sign On */ + singleSignOnState?: SingleSignOnStates; + /** Version of the Dynatrace agent installed on the VM. */ + enterpriseAppId?: string; + /** The login URL specific to this Dynatrace Environment */ + singleSignOnUrl?: string; + /** array of Aad(azure active directory) domains */ + aadDomains?: string[]; + /** + * Provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; +}; + +/** Known values of {@link SendingMetricsStatus} that the service accepts. */ +export enum KnownSendingMetricsStatus { + Enabled = "Enabled", + Disabled = "Disabled" +} + +/** + * Defines values for SendingMetricsStatus. \ + * {@link KnownSendingMetricsStatus} can be used interchangeably with SendingMetricsStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** + */ +export type SendingMetricsStatus = string; + +/** Known values of {@link SendingLogsStatus} that the service accepts. */ +export enum KnownSendingLogsStatus { + Enabled = "Enabled", + Disabled = "Disabled" +} + +/** + * Defines values for SendingLogsStatus. \ + * {@link KnownSendingLogsStatus} can be used interchangeably with SendingLogsStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** + */ +export type SendingLogsStatus = string; + +/** Known values of {@link MonitoringStatus} that the service accepts. */ +export enum KnownMonitoringStatus { + Enabled = "Enabled", + Disabled = "Disabled" +} + +/** + * Defines values for MonitoringStatus. \ + * {@link KnownMonitoringStatus} can be used interchangeably with MonitoringStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** + */ +export type MonitoringStatus = string; + +/** Known values of {@link MarketplaceSubscriptionStatus} that the service accepts. */ +export enum KnownMarketplaceSubscriptionStatus { + Active = "Active", + Suspended = "Suspended" +} + +/** + * Defines values for MarketplaceSubscriptionStatus. \ + * {@link KnownMarketplaceSubscriptionStatus} can be used interchangeably with MarketplaceSubscriptionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Active** \ + * **Suspended** + */ +export type MarketplaceSubscriptionStatus = string; + +/** Known values of {@link SingleSignOnStates} that the service accepts. */ +export enum KnownSingleSignOnStates { + Initial = "Initial", + Enable = "Enable", + Disable = "Disable", + Existing = "Existing" +} + +/** + * Defines values for SingleSignOnStates. \ + * {@link KnownSingleSignOnStates} can be used interchangeably with SingleSignOnStates, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Initial** \ + * **Enable** \ + * **Disable** \ + * **Existing** + */ +export type SingleSignOnStates = string; + +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + Accepted = "Accepted", + Creating = "Creating", + Updating = "Updating", + Deleting = "Deleting", + Succeeded = "Succeeded", + Failed = "Failed", + Canceled = "Canceled", + Deleted = "Deleted", + NotSpecified = "NotSpecified" +} + +/** + * 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 + * **Accepted** \ + * **Creating** \ + * **Updating** \ + * **Deleting** \ + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Deleted** \ + * **NotSpecified** + */ +export type ProvisioningState = string; + +/** Known values of {@link LiftrResourceCategories} that the service accepts. */ +export enum KnownLiftrResourceCategories { + Unknown = "Unknown", + MonitorLogs = "MonitorLogs" +} + +/** + * Defines values for LiftrResourceCategories. \ + * {@link KnownLiftrResourceCategories} can be used interchangeably with LiftrResourceCategories, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **MonitorLogs** + */ +export type LiftrResourceCategories = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + User = "User", + Application = "Application", + ManagedIdentity = "ManagedIdentity", + Key = "Key" +} + +/** + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type CreatedByType = string; + +/** Known values of {@link ManagedIdentityType} that the service accepts. */ +export enum KnownManagedIdentityType { + SystemAssigned = "SystemAssigned", + UserAssigned = "UserAssigned", + SystemAndUserAssigned = "SystemAndUserAssigned" +} + +/** + * Defines values for ManagedIdentityType. \ + * {@link KnownManagedIdentityType} can be used interchangeably with ManagedIdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **SystemAssigned** \ + * **UserAssigned** \ + * **SystemAndUserAssigned** + */ +export type ManagedIdentityType = string; + +/** Known values of {@link Origin} that the service accepts. */ +export enum KnownOrigin { + User = "user", + System = "system", + UserSystem = "user,system" +} + +/** + * Defines values for Origin. \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user** \ + * **system** \ + * **user,system** + */ +export type Origin = string; + +/** Known values of {@link ActionType} that the service accepts. */ +export enum KnownActionType { + Internal = "Internal" +} + +/** + * Defines values for ActionType. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal** + */ +export type ActionType = string; + +/** Known values of {@link SendAadLogsStatus} that the service accepts. */ +export enum KnownSendAadLogsStatus { + Enabled = "Enabled", + Disabled = "Disabled" +} + +/** + * Defines values for SendAadLogsStatus. \ + * {@link KnownSendAadLogsStatus} can be used interchangeably with SendAadLogsStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** + */ +export type SendAadLogsStatus = string; + +/** Known values of {@link SendSubscriptionLogsStatus} that the service accepts. */ +export enum KnownSendSubscriptionLogsStatus { + Enabled = "Enabled", + Disabled = "Disabled" +} + +/** + * Defines values for SendSubscriptionLogsStatus. \ + * {@link KnownSendSubscriptionLogsStatus} can be used interchangeably with SendSubscriptionLogsStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** + */ +export type SendSubscriptionLogsStatus = string; + +/** Known values of {@link SendActivityLogsStatus} that the service accepts. */ +export enum KnownSendActivityLogsStatus { + Enabled = "Enabled", + Disabled = "Disabled" +} + +/** + * Defines values for SendActivityLogsStatus. \ + * {@link KnownSendActivityLogsStatus} can be used interchangeably with SendActivityLogsStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** + */ +export type SendActivityLogsStatus = string; + +/** Known values of {@link TagAction} that the service accepts. */ +export enum KnownTagAction { + Include = "Include", + Exclude = "Exclude" +} + +/** + * Defines values for TagAction. \ + * {@link KnownTagAction} can be used interchangeably with TagAction, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Include** \ + * **Exclude** + */ +export type TagAction = string; + +/** Known values of {@link MonitoringType} that the service accepts. */ +export enum KnownMonitoringType { + CloudInfrastructure = "CLOUD_INFRASTRUCTURE", + FullStack = "FULL_STACK" +} + +/** + * Defines values for MonitoringType. \ + * {@link KnownMonitoringType} can be used interchangeably with MonitoringType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **CLOUD_INFRASTRUCTURE** \ + * **FULL_STACK** + */ +export type MonitoringType = string; + +/** Known values of {@link AutoUpdateSetting} that the service accepts. */ +export enum KnownAutoUpdateSetting { + Enabled = "ENABLED", + Disabled = "DISABLED" +} + +/** + * Defines values for AutoUpdateSetting. \ + * {@link KnownAutoUpdateSetting} can be used interchangeably with AutoUpdateSetting, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ENABLED** \ + * **DISABLED** + */ +export type AutoUpdateSetting = string; + +/** Known values of {@link UpdateStatus} that the service accepts. */ +export enum KnownUpdateStatus { + Incompatible = "INCOMPATIBLE", + Outdated = "OUTDATED", + Scheduled = "SCHEDULED", + Suppressed = "SUPPRESSED", + Unknown = "UNKNOWN", + UP2Date = "UP2DATE", + UpdateINProgress = "UPDATE_IN_PROGRESS", + UpdatePending = "UPDATE_PENDING", + UpdateProblem = "UPDATE_PROBLEM" +} + +/** + * Defines values for UpdateStatus. \ + * {@link KnownUpdateStatus} can be used interchangeably with UpdateStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **INCOMPATIBLE** \ + * **OUTDATED** \ + * **SCHEDULED** \ + * **SUPPRESSED** \ + * **UNKNOWN** \ + * **UP2DATE** \ + * **UPDATE_IN_PROGRESS** \ + * **UPDATE_PENDING** \ + * **UPDATE_PROBLEM** + */ +export type UpdateStatus = string; + +/** Known values of {@link AvailabilityState} that the service accepts. */ +export enum KnownAvailabilityState { + Crashed = "CRASHED", + Lost = "LOST", + Monitored = "MONITORED", + PREMonitored = "PRE_MONITORED", + Shutdown = "SHUTDOWN", + UnexpectedShutdown = "UNEXPECTED_SHUTDOWN", + Unknown = "UNKNOWN", + Unmonitored = "UNMONITORED" +} + +/** + * Defines values for AvailabilityState. \ + * {@link KnownAvailabilityState} can be used interchangeably with AvailabilityState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **CRASHED** \ + * **LOST** \ + * **MONITORED** \ + * **PRE_MONITORED** \ + * **SHUTDOWN** \ + * **UNEXPECTED_SHUTDOWN** \ + * **UNKNOWN** \ + * **UNMONITORED** + */ +export type AvailabilityState = string; + +/** Known values of {@link LogModule} that the service accepts. */ +export enum KnownLogModule { + Enabled = "ENABLED", + Disabled = "DISABLED" +} + +/** + * Defines values for LogModule. \ + * {@link KnownLogModule} can be used interchangeably with LogModule, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ENABLED** \ + * **DISABLED** + */ +export type LogModule = string; + +/** Known values of {@link SSOStatus} that the service accepts. */ +export enum KnownSSOStatus { + Enabled = "Enabled", + Disabled = "Disabled" +} + +/** + * Defines values for SSOStatus. \ + * {@link KnownSSOStatus} can be used interchangeably with SSOStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** + */ +export type SSOStatus = string; + +/** Optional parameters. */ +export interface MonitorsGetAccountCredentialsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getAccountCredentials operation. */ +export type MonitorsGetAccountCredentialsResponse = AccountInfoSecure; + +/** Optional parameters. */ +export interface MonitorsListMonitoredResourcesOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listMonitoredResources operation. */ +export type MonitorsListMonitoredResourcesResponse = MonitoredResourceListResponse; + +/** Optional parameters. */ +export interface MonitorsGetVMHostPayloadOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getVMHostPayload operation. */ +export type MonitorsGetVMHostPayloadResponse = VMExtensionPayload; + +/** Optional parameters. */ +export interface MonitorsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type MonitorsGetResponse = MonitorResource; + +/** Optional parameters. */ +export interface MonitorsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type MonitorsCreateOrUpdateResponse = MonitorResource; + +/** Optional parameters. */ +export interface MonitorsUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type MonitorsUpdateResponse = MonitorResource; + +/** Optional parameters. */ +export interface MonitorsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface MonitorsListBySubscriptionIdOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionId operation. */ +export type MonitorsListBySubscriptionIdResponse = MonitorResourceListResult; + +/** Optional parameters. */ +export interface MonitorsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type MonitorsListByResourceGroupResponse = MonitorResourceListResult; + +/** Optional parameters. */ +export interface MonitorsListHostsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listHosts operation. */ +export type MonitorsListHostsResponse = VMHostsListResponse; + +/** Optional parameters. */ +export interface MonitorsListAppServicesOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listAppServices operation. */ +export type MonitorsListAppServicesResponse = AppServiceListResponse; + +/** Optional parameters. */ +export interface MonitorsGetSSODetailsOptionalParams + extends coreClient.OperationOptions { + /** The details of the get sso details request. */ + request?: SSODetailsRequest; +} + +/** Contains response data for the getSSODetails operation. */ +export type MonitorsGetSSODetailsResponse = SSODetailsResponse; + +/** Optional parameters. */ +export interface MonitorsListLinkableEnvironmentsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listLinkableEnvironments operation. */ +export type MonitorsListLinkableEnvironmentsResponse = LinkableEnvironmentListResponse; + +/** Optional parameters. */ +export interface MonitorsListMonitoredResourcesNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listMonitoredResourcesNext operation. */ +export type MonitorsListMonitoredResourcesNextResponse = MonitoredResourceListResponse; + +/** Optional parameters. */ +export interface MonitorsListBySubscriptionIdNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionIdNext operation. */ +export type MonitorsListBySubscriptionIdNextResponse = MonitorResourceListResult; + +/** Optional parameters. */ +export interface MonitorsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type MonitorsListByResourceGroupNextResponse = MonitorResourceListResult; + +/** Optional parameters. */ +export interface MonitorsListHostsNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listHostsNext operation. */ +export type MonitorsListHostsNextResponse = VMHostsListResponse; + +/** Optional parameters. */ +export interface MonitorsListAppServicesNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listAppServicesNext operation. */ +export type MonitorsListAppServicesNextResponse = AppServiceListResponse; + +/** Optional parameters. */ +export interface MonitorsListLinkableEnvironmentsNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listLinkableEnvironmentsNext operation. */ +export type MonitorsListLinkableEnvironmentsNextResponse = LinkableEnvironmentListResponse; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; + +/** Optional parameters. */ +export interface TagRulesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type TagRulesGetResponse = TagRule; + +/** Optional parameters. */ +export interface TagRulesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type TagRulesCreateOrUpdateResponse = TagRule; + +/** Optional parameters. */ +export interface TagRulesUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type TagRulesUpdateResponse = TagRule; + +/** Optional parameters. */ +export interface TagRulesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface TagRulesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type TagRulesListResponse = TagRuleListResult; + +/** Optional parameters. */ +export interface TagRulesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type TagRulesListNextResponse = TagRuleListResult; + +/** Optional parameters. */ +export interface SingleSignOnCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type SingleSignOnCreateOrUpdateResponse = DynatraceSingleSignOnResource; + +/** Optional parameters. */ +export interface SingleSignOnGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type SingleSignOnGetResponse = DynatraceSingleSignOnResource; + +/** Optional parameters. */ +export interface SingleSignOnListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type SingleSignOnListResponse = DynatraceSingleSignOnResourceListResult; + +/** Optional parameters. */ +export interface SingleSignOnListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type SingleSignOnListNextResponse = DynatraceSingleSignOnResourceListResult; + +/** Optional parameters. */ +export interface DynatraceObservabilityOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/dynatrace/arm-dynatrace/src/models/mappers.ts b/sdk/dynatrace/arm-dynatrace/src/models/mappers.ts new file mode 100644 index 000000000000..e7a1bd35113e --- /dev/null +++ b/sdk/dynatrace/arm-dynatrace/src/models/mappers.ts @@ -0,0 +1,1480 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; + +export const AccountInfoSecure: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountInfoSecure", + modelProperties: { + accountId: { + serializedName: "accountId", + readOnly: true, + type: { + name: "String" + } + }, + apiKey: { + serializedName: "apiKey", + readOnly: true, + type: { + name: "String" + } + }, + regionId: { + serializedName: "regionId", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String" + } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const MonitoredResourceListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoredResourceListResponse", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MonitoredResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const MonitoredResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoredResource", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + sendingMetrics: { + serializedName: "sendingMetrics", + type: { + name: "String" + } + }, + reasonForMetricsStatus: { + serializedName: "reasonForMetricsStatus", + type: { + name: "String" + } + }, + sendingLogs: { + serializedName: "sendingLogs", + type: { + name: "String" + } + }, + reasonForLogsStatus: { + serializedName: "reasonForLogsStatus", + type: { + name: "String" + } + } + } + } +}; + +export const VMExtensionPayload: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VMExtensionPayload", + modelProperties: { + ingestionKey: { + serializedName: "ingestionKey", + type: { + name: "String" + } + }, + environmentId: { + serializedName: "environmentId", + type: { + name: "String" + } + } + } + } +}; + +export const DynatraceEnvironmentProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DynatraceEnvironmentProperties", + modelProperties: { + userId: { + serializedName: "userId", + type: { + name: "String" + } + }, + accountInfo: { + serializedName: "accountInfo", + type: { + name: "Composite", + className: "AccountInfo" + } + }, + environmentInfo: { + serializedName: "environmentInfo", + type: { + name: "Composite", + className: "EnvironmentInfo" + } + }, + singleSignOnProperties: { + serializedName: "singleSignOnProperties", + type: { + name: "Composite", + className: "DynatraceSingleSignOnProperties" + } + } + } + } +}; + +export const AccountInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountInfo", + modelProperties: { + accountId: { + serializedName: "accountId", + type: { + name: "String" + } + }, + regionId: { + serializedName: "regionId", + type: { + name: "String" + } + } + } + } +}; + +export const EnvironmentInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnvironmentInfo", + modelProperties: { + environmentId: { + serializedName: "environmentId", + type: { + name: "String" + } + }, + ingestionKey: { + serializedName: "ingestionKey", + type: { + name: "String" + } + }, + logsIngestionEndpoint: { + serializedName: "logsIngestionEndpoint", + type: { + name: "String" + } + }, + landingURL: { + serializedName: "landingURL", + type: { + name: "String" + } + } + } + } +}; + +export const DynatraceSingleSignOnProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DynatraceSingleSignOnProperties", + modelProperties: { + singleSignOnState: { + serializedName: "singleSignOnState", + type: { + name: "String" + } + }, + enterpriseAppId: { + serializedName: "enterpriseAppId", + type: { + name: "String" + } + }, + singleSignOnUrl: { + serializedName: "singleSignOnUrl", + type: { + name: "String" + } + }, + aadDomains: { + serializedName: "aadDomains", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const UserInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserInfo", + modelProperties: { + firstName: { + constraints: { + MaxLength: 50 + }, + serializedName: "firstName", + type: { + name: "String" + } + }, + lastName: { + constraints: { + MaxLength: 50 + }, + serializedName: "lastName", + type: { + name: "String" + } + }, + emailAddress: { + constraints: { + Pattern: new RegExp( + "^[A-Za-z0-9._%+-]+@(?:[A-Za-z0-9-]+\\.)+[A-Za-z]{2,}$" + ) + }, + serializedName: "emailAddress", + type: { + name: "String" + } + }, + phoneNumber: { + constraints: { + MaxLength: 40 + }, + serializedName: "phoneNumber", + type: { + name: "String" + } + }, + country: { + serializedName: "country", + type: { + name: "String" + } + } + } + } +}; + +export const PlanData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PlanData", + modelProperties: { + usageType: { + constraints: { + MaxLength: 50 + }, + serializedName: "usageType", + type: { + name: "String" + } + }, + billingCycle: { + constraints: { + MaxLength: 50 + }, + serializedName: "billingCycle", + type: { + name: "String" + } + }, + planDetails: { + constraints: { + MaxLength: 50 + }, + serializedName: "planDetails", + type: { + name: "String" + } + }, + effectiveDate: { + serializedName: "effectiveDate", + type: { + name: "DateTime" + } + } + } + } +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } + } + } + } +}; + +export const IdentityProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IdentityProperties", + modelProperties: { + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "String" + } + }, + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + required: true, + type: { + name: "String" + } + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { name: "Composite", className: "UserAssignedIdentity" } + } + } + } + } + } +}; + +export const UserAssignedIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserAssignedIdentity", + modelProperties: { + clientId: { + serializedName: "clientId", + required: true, + type: { + name: "String" + } + }, + principalId: { + serializedName: "principalId", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + 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 MonitorResourceUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitorResourceUpdate", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + monitoringStatus: { + serializedName: "monitoringStatus", + type: { + name: "String" + } + }, + marketplaceSubscriptionStatus: { + serializedName: "marketplaceSubscriptionStatus", + type: { + name: "String" + } + }, + dynatraceEnvironmentProperties: { + serializedName: "dynatraceEnvironmentProperties", + type: { + name: "Composite", + className: "DynatraceEnvironmentProperties" + } + }, + userInfo: { + serializedName: "userInfo", + type: { + name: "Composite", + className: "UserInfo" + } + }, + planData: { + serializedName: "planData", + type: { + name: "Composite", + className: "PlanData" + } + } + } + } +}; + +export const OperationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + readOnly: true, + type: { + name: "Boolean" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + readOnly: true, + type: { + name: "String" + } + }, + actionType: { + serializedName: "actionType", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + readOnly: true, + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + readOnly: true, + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const MonitorResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitorResourceListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MonitorResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const LogRules: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LogRules", + modelProperties: { + sendAadLogs: { + serializedName: "sendAadLogs", + type: { + name: "String" + } + }, + sendSubscriptionLogs: { + serializedName: "sendSubscriptionLogs", + type: { + name: "String" + } + }, + sendActivityLogs: { + serializedName: "sendActivityLogs", + type: { + name: "String" + } + }, + filteringTags: { + serializedName: "filteringTags", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FilteringTag" + } + } + } + } + } + } +}; + +export const FilteringTag: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FilteringTag", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "String" + } + }, + action: { + serializedName: "action", + type: { + name: "String" + } + } + } + } +}; + +export const MetricRules: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricRules", + modelProperties: { + filteringTags: { + serializedName: "filteringTags", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FilteringTag" + } + } + } + } + } + } +}; + +export const TagRuleUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TagRuleUpdate", + modelProperties: { + logRules: { + serializedName: "logRules", + type: { + name: "Composite", + className: "LogRules" + } + }, + metricRules: { + serializedName: "metricRules", + type: { + name: "Composite", + className: "MetricRules" + } + } + } + } +}; + +export const TagRuleListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TagRuleListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TagRule" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const DynatraceSingleSignOnResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DynatraceSingleSignOnResourceListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DynatraceSingleSignOnResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const VMHostsListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VMHostsListResponse", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VMInfo" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const VMInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VMInfo", + modelProperties: { + resourceId: { + serializedName: "resourceId", + type: { + name: "String" + } + }, + version: { + serializedName: "version", + type: { + name: "String" + } + }, + monitoringType: { + serializedName: "monitoringType", + type: { + name: "String" + } + }, + autoUpdateSetting: { + serializedName: "autoUpdateSetting", + type: { + name: "String" + } + }, + updateStatus: { + serializedName: "updateStatus", + type: { + name: "String" + } + }, + availabilityState: { + serializedName: "availabilityState", + type: { + name: "String" + } + }, + logModule: { + serializedName: "logModule", + type: { + name: "String" + } + }, + hostGroup: { + serializedName: "hostGroup", + type: { + name: "String" + } + }, + hostName: { + serializedName: "hostName", + type: { + name: "String" + } + } + } + } +}; + +export const AppServiceListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AppServiceListResponse", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AppServiceInfo" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const AppServiceInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AppServiceInfo", + modelProperties: { + resourceId: { + serializedName: "resourceId", + type: { + name: "String" + } + }, + version: { + serializedName: "version", + type: { + name: "String" + } + }, + monitoringType: { + serializedName: "monitoringType", + type: { + name: "String" + } + }, + autoUpdateSetting: { + serializedName: "autoUpdateSetting", + type: { + name: "String" + } + }, + updateStatus: { + serializedName: "updateStatus", + type: { + name: "String" + } + }, + availabilityState: { + serializedName: "availabilityState", + type: { + name: "String" + } + }, + logModule: { + serializedName: "logModule", + type: { + name: "String" + } + }, + hostGroup: { + serializedName: "hostGroup", + type: { + name: "String" + } + }, + hostName: { + serializedName: "hostName", + type: { + name: "String" + } + } + } + } +}; + +export const SSODetailsRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SSODetailsRequest", + modelProperties: { + userPrincipal: { + serializedName: "userPrincipal", + type: { + name: "String" + } + } + } + } +}; + +export const SSODetailsResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SSODetailsResponse", + modelProperties: { + isSsoEnabled: { + serializedName: "isSsoEnabled", + type: { + name: "String" + } + }, + metadataUrl: { + serializedName: "metadataUrl", + type: { + name: "String" + } + }, + singleSignOnUrl: { + serializedName: "singleSignOnUrl", + type: { + name: "String" + } + }, + aadDomains: { + serializedName: "aadDomains", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + adminUsers: { + serializedName: "adminUsers", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const LinkableEnvironmentRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LinkableEnvironmentRequest", + modelProperties: { + tenantId: { + serializedName: "tenantId", + type: { + name: "String" + } + }, + userPrincipal: { + serializedName: "userPrincipal", + type: { + name: "String" + } + }, + region: { + serializedName: "region", + type: { + name: "String" + } + } + } + } +}; + +export const LinkableEnvironmentListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LinkableEnvironmentListResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LinkableEnvironmentResponse" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const LinkableEnvironmentResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LinkableEnvironmentResponse", + modelProperties: { + environmentId: { + serializedName: "environmentId", + type: { + name: "String" + } + }, + environmentName: { + serializedName: "environmentName", + type: { + name: "String" + } + }, + planData: { + serializedName: "planData", + type: { + name: "Composite", + className: "PlanData" + } + } + } + } +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + +export const MonitorResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitorResource", + modelProperties: { + ...TrackedResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "IdentityProperties" + } + }, + monitoringStatus: { + serializedName: "properties.monitoringStatus", + type: { + name: "String" + } + }, + marketplaceSubscriptionStatus: { + serializedName: "properties.marketplaceSubscriptionStatus", + type: { + name: "String" + } + }, + dynatraceEnvironmentProperties: { + serializedName: "properties.dynatraceEnvironmentProperties", + type: { + name: "Composite", + className: "DynatraceEnvironmentProperties" + } + }, + userInfo: { + serializedName: "properties.userInfo", + type: { + name: "Composite", + className: "UserInfo" + } + }, + planData: { + serializedName: "properties.planData", + type: { + name: "Composite", + className: "PlanData" + } + }, + liftrResourceCategory: { + serializedName: "properties.liftrResourceCategory", + readOnly: true, + type: { + name: "String" + } + }, + liftrResourcePreference: { + serializedName: "properties.liftrResourcePreference", + readOnly: true, + type: { + name: "Number" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const TagRule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TagRule", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + logRules: { + serializedName: "properties.logRules", + type: { + name: "Composite", + className: "LogRules" + } + }, + metricRules: { + serializedName: "properties.metricRules", + type: { + name: "Composite", + className: "MetricRules" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const DynatraceSingleSignOnResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DynatraceSingleSignOnResource", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + singleSignOnState: { + serializedName: "properties.singleSignOnState", + type: { + name: "String" + } + }, + enterpriseAppId: { + serializedName: "properties.enterpriseAppId", + type: { + name: "String" + } + }, + singleSignOnUrl: { + serializedName: "properties.singleSignOnUrl", + type: { + name: "String" + } + }, + aadDomains: { + serializedName: "properties.aadDomains", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/dynatrace/arm-dynatrace/src/models/parameters.ts b/sdk/dynatrace/arm-dynatrace/src/models/parameters.ts new file mode 100644 index 000000000000..698f996f4e48 --- /dev/null +++ b/sdk/dynatrace/arm-dynatrace/src/models/parameters.ts @@ -0,0 +1,179 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + MonitorResource as MonitorResourceMapper, + MonitorResourceUpdate as MonitorResourceUpdateMapper, + SSODetailsRequest as SSODetailsRequestMapper, + LinkableEnvironmentRequest as LinkableEnvironmentRequestMapper, + TagRule as TagRuleMapper, + TagRuleUpdate as TagRuleUpdateMapper, + DynatraceSingleSignOnResource as DynatraceSingleSignOnResourceMapper +} from "../models/mappers"; + +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" + } + } +}; + +export const $host: OperationURLParameter = { + parameterPath: "$host", + mapper: { + serializedName: "$host", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2021-09-01-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "subscriptionId", + required: true, + type: { + name: "String" + } + } +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + constraints: { + MaxLength: 90, + MinLength: 1 + }, + serializedName: "resourceGroupName", + required: true, + type: { + name: "String" + } + } +}; + +export const monitorName: OperationURLParameter = { + parameterPath: "monitorName", + mapper: { + serializedName: "monitorName", + required: true, + type: { + name: "String" + } + } +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const resource: OperationParameter = { + parameterPath: "resource", + mapper: MonitorResourceMapper +}; + +export const resource1: OperationParameter = { + parameterPath: "resource", + mapper: MonitorResourceUpdateMapper +}; + +export const request: OperationParameter = { + parameterPath: ["options", "request"], + mapper: SSODetailsRequestMapper +}; + +export const request1: OperationParameter = { + parameterPath: "request", + mapper: LinkableEnvironmentRequestMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const ruleSetName: OperationURLParameter = { + parameterPath: "ruleSetName", + mapper: { + serializedName: "ruleSetName", + required: true, + type: { + name: "String" + } + } +}; + +export const resource2: OperationParameter = { + parameterPath: "resource", + mapper: TagRuleMapper +}; + +export const resource3: OperationParameter = { + parameterPath: "resource", + mapper: TagRuleUpdateMapper +}; + +export const resource4: OperationParameter = { + parameterPath: "resource", + mapper: DynatraceSingleSignOnResourceMapper +}; + +export const configurationName: OperationURLParameter = { + parameterPath: "configurationName", + mapper: { + serializedName: "configurationName", + required: true, + type: { + name: "String" + } + } +}; diff --git a/sdk/dynatrace/arm-dynatrace/src/operations/index.ts b/sdk/dynatrace/arm-dynatrace/src/operations/index.ts new file mode 100644 index 000000000000..e0edfa7549f3 --- /dev/null +++ b/sdk/dynatrace/arm-dynatrace/src/operations/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 "./monitors"; +export * from "./operations"; +export * from "./tagRules"; +export * from "./singleSignOn"; diff --git a/sdk/dynatrace/arm-dynatrace/src/operations/monitors.ts b/sdk/dynatrace/arm-dynatrace/src/operations/monitors.ts new file mode 100644 index 000000000000..55547c764459 --- /dev/null +++ b/sdk/dynatrace/arm-dynatrace/src/operations/monitors.ts @@ -0,0 +1,1363 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { Monitors } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DynatraceObservability } from "../dynatraceObservability"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + MonitoredResource, + MonitorsListMonitoredResourcesNextOptionalParams, + MonitorsListMonitoredResourcesOptionalParams, + MonitorResource, + MonitorsListBySubscriptionIdNextOptionalParams, + MonitorsListBySubscriptionIdOptionalParams, + MonitorsListByResourceGroupNextOptionalParams, + MonitorsListByResourceGroupOptionalParams, + VMInfo, + MonitorsListHostsNextOptionalParams, + MonitorsListHostsOptionalParams, + AppServiceInfo, + MonitorsListAppServicesNextOptionalParams, + MonitorsListAppServicesOptionalParams, + LinkableEnvironmentResponse, + LinkableEnvironmentRequest, + MonitorsListLinkableEnvironmentsNextOptionalParams, + MonitorsListLinkableEnvironmentsOptionalParams, + MonitorsGetAccountCredentialsOptionalParams, + MonitorsGetAccountCredentialsResponse, + MonitorsListMonitoredResourcesResponse, + MonitorsGetVMHostPayloadOptionalParams, + MonitorsGetVMHostPayloadResponse, + MonitorsGetOptionalParams, + MonitorsGetResponse, + MonitorsCreateOrUpdateOptionalParams, + MonitorsCreateOrUpdateResponse, + MonitorResourceUpdate, + MonitorsUpdateOptionalParams, + MonitorsUpdateResponse, + MonitorsDeleteOptionalParams, + MonitorsListBySubscriptionIdResponse, + MonitorsListByResourceGroupResponse, + MonitorsListHostsResponse, + MonitorsListAppServicesResponse, + MonitorsGetSSODetailsOptionalParams, + MonitorsGetSSODetailsResponse, + MonitorsListLinkableEnvironmentsResponse, + MonitorsListMonitoredResourcesNextResponse, + MonitorsListBySubscriptionIdNextResponse, + MonitorsListByResourceGroupNextResponse, + MonitorsListHostsNextResponse, + MonitorsListAppServicesNextResponse, + MonitorsListLinkableEnvironmentsNextResponse +} from "../models"; + +/// +/** Class containing Monitors operations. */ +export class MonitorsImpl implements Monitors { + private readonly client: DynatraceObservability; + + /** + * Initialize a new instance of the class Monitors class. + * @param client Reference to the service client + */ + constructor(client: DynatraceObservability) { + this.client = client; + } + + /** + * List the resources currently being monitored by the Dynatrace monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + public listMonitoredResources( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListMonitoredResourcesOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listMonitoredResourcesPagingAll( + resourceGroupName, + monitorName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listMonitoredResourcesPagingPage( + resourceGroupName, + monitorName, + options + ); + } + }; + } + + private async *listMonitoredResourcesPagingPage( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListMonitoredResourcesOptionalParams + ): AsyncIterableIterator { + let result = await this._listMonitoredResources( + resourceGroupName, + monitorName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listMonitoredResourcesNext( + resourceGroupName, + monitorName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listMonitoredResourcesPagingAll( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListMonitoredResourcesOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listMonitoredResourcesPagingPage( + resourceGroupName, + monitorName, + options + )) { + yield* page; + } + } + + /** + * List all MonitorResource by subscriptionId + * @param options The options parameters. + */ + public listBySubscriptionId( + options?: MonitorsListBySubscriptionIdOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionIdPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionIdPagingPage(options); + } + }; + } + + private async *listBySubscriptionIdPagingPage( + options?: MonitorsListBySubscriptionIdOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscriptionId(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listBySubscriptionIdNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listBySubscriptionIdPagingAll( + options?: MonitorsListBySubscriptionIdOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionIdPagingPage(options)) { + yield* page; + } + } + + /** + * List MonitorResource resources by 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?: MonitorsListByResourceGroupOptionalParams + ): 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?: MonitorsListByResourceGroupOptionalParams + ): 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?: MonitorsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * List the compute resources currently being monitored by the Dynatrace resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + public listHosts( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListHostsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listHostsPagingAll( + resourceGroupName, + monitorName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listHostsPagingPage( + resourceGroupName, + monitorName, + options + ); + } + }; + } + + private async *listHostsPagingPage( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListHostsOptionalParams + ): AsyncIterableIterator { + let result = await this._listHosts(resourceGroupName, monitorName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listHostsNext( + resourceGroupName, + monitorName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listHostsPagingAll( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListHostsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listHostsPagingPage( + resourceGroupName, + monitorName, + options + )) { + yield* page; + } + } + + /** + * Gets list of App Services with Dynatrace PaaS OneAgent enabled + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + public listAppServices( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListAppServicesOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAppServicesPagingAll( + resourceGroupName, + monitorName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listAppServicesPagingPage( + resourceGroupName, + monitorName, + options + ); + } + }; + } + + private async *listAppServicesPagingPage( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListAppServicesOptionalParams + ): AsyncIterableIterator { + let result = await this._listAppServices( + resourceGroupName, + monitorName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAppServicesNext( + resourceGroupName, + monitorName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listAppServicesPagingAll( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListAppServicesOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAppServicesPagingPage( + resourceGroupName, + monitorName, + options + )) { + yield* page; + } + } + + /** + * Gets all the Dynatrace environments that a user can link a azure resource to + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param request The details of the linkable environment request. + * @param options The options parameters. + */ + public listLinkableEnvironments( + resourceGroupName: string, + monitorName: string, + request: LinkableEnvironmentRequest, + options?: MonitorsListLinkableEnvironmentsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listLinkableEnvironmentsPagingAll( + resourceGroupName, + monitorName, + request, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listLinkableEnvironmentsPagingPage( + resourceGroupName, + monitorName, + request, + options + ); + } + }; + } + + private async *listLinkableEnvironmentsPagingPage( + resourceGroupName: string, + monitorName: string, + request: LinkableEnvironmentRequest, + options?: MonitorsListLinkableEnvironmentsOptionalParams + ): AsyncIterableIterator { + let result = await this._listLinkableEnvironments( + resourceGroupName, + monitorName, + request, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listLinkableEnvironmentsNext( + resourceGroupName, + monitorName, + request, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listLinkableEnvironmentsPagingAll( + resourceGroupName: string, + monitorName: string, + request: LinkableEnvironmentRequest, + options?: MonitorsListLinkableEnvironmentsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listLinkableEnvironmentsPagingPage( + resourceGroupName, + monitorName, + request, + options + )) { + yield* page; + } + } + + /** + * Gets the user account credentials for a Monitor + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + getAccountCredentials( + resourceGroupName: string, + monitorName: string, + options?: MonitorsGetAccountCredentialsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + getAccountCredentialsOperationSpec + ); + } + + /** + * List the resources currently being monitored by the Dynatrace monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + private _listMonitoredResources( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListMonitoredResourcesOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + listMonitoredResourcesOperationSpec + ); + } + + /** + * Returns the payload that needs to be passed in the request body for installing Dynatrace agent on a + * VM. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + getVMHostPayload( + resourceGroupName: string, + monitorName: string, + options?: MonitorsGetVMHostPayloadOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + getVMHostPayloadOperationSpec + ); + } + + /** + * Get a MonitorResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + options?: MonitorsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + getOperationSpec + ); + } + + /** + * Create a MonitorResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + monitorName: string, + resource: MonitorResource, + options?: MonitorsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + MonitorsCreateOrUpdateResponse + > + > { + 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, monitorName, resource, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Create a MonitorResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + monitorName: string, + resource: MonitorResource, + options?: MonitorsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + monitorName, + resource, + options + ); + return poller.pollUntilDone(); + } + + /** + * Update a MonitorResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param resource The resource properties to be updated. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + monitorName: string, + resource: MonitorResourceUpdate, + options?: MonitorsUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, resource, options }, + updateOperationSpec + ); + } + + /** + * Delete a MonitorResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + monitorName: string, + options?: MonitorsDeleteOptionalParams + ): 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, monitorName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Delete a MonitorResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + monitorName: string, + options?: MonitorsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + monitorName, + options + ); + return poller.pollUntilDone(); + } + + /** + * List all MonitorResource by subscriptionId + * @param options The options parameters. + */ + private _listBySubscriptionId( + options?: MonitorsListBySubscriptionIdOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionIdOperationSpec + ); + } + + /** + * List MonitorResource resources by 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?: MonitorsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * List the compute resources currently being monitored by the Dynatrace resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + private _listHosts( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListHostsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + listHostsOperationSpec + ); + } + + /** + * Gets list of App Services with Dynatrace PaaS OneAgent enabled + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + private _listAppServices( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListAppServicesOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + listAppServicesOperationSpec + ); + } + + /** + * Gets the SSO configuration details from the partner. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + getSSODetails( + resourceGroupName: string, + monitorName: string, + options?: MonitorsGetSSODetailsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + getSSODetailsOperationSpec + ); + } + + /** + * Gets all the Dynatrace environments that a user can link a azure resource to + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param request The details of the linkable environment request. + * @param options The options parameters. + */ + private _listLinkableEnvironments( + resourceGroupName: string, + monitorName: string, + request: LinkableEnvironmentRequest, + options?: MonitorsListLinkableEnvironmentsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, request, options }, + listLinkableEnvironmentsOperationSpec + ); + } + + /** + * ListMonitoredResourcesNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param nextLink The nextLink from the previous successful call to the ListMonitoredResources method. + * @param options The options parameters. + */ + private _listMonitoredResourcesNext( + resourceGroupName: string, + monitorName: string, + nextLink: string, + options?: MonitorsListMonitoredResourcesNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, nextLink, options }, + listMonitoredResourcesNextOperationSpec + ); + } + + /** + * ListBySubscriptionIdNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscriptionId method. + * @param options The options parameters. + */ + private _listBySubscriptionIdNext( + nextLink: string, + options?: MonitorsListBySubscriptionIdNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionIdNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: MonitorsListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } + + /** + * ListHostsNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param nextLink The nextLink from the previous successful call to the ListHosts method. + * @param options The options parameters. + */ + private _listHostsNext( + resourceGroupName: string, + monitorName: string, + nextLink: string, + options?: MonitorsListHostsNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, nextLink, options }, + listHostsNextOperationSpec + ); + } + + /** + * ListAppServicesNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param nextLink The nextLink from the previous successful call to the ListAppServices method. + * @param options The options parameters. + */ + private _listAppServicesNext( + resourceGroupName: string, + monitorName: string, + nextLink: string, + options?: MonitorsListAppServicesNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, nextLink, options }, + listAppServicesNextOperationSpec + ); + } + + /** + * ListLinkableEnvironmentsNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param request The details of the linkable environment request. + * @param nextLink The nextLink from the previous successful call to the ListLinkableEnvironments + * method. + * @param options The options parameters. + */ + private _listLinkableEnvironmentsNext( + resourceGroupName: string, + monitorName: string, + request: LinkableEnvironmentRequest, + nextLink: string, + options?: MonitorsListLinkableEnvironmentsNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, request, nextLink, options }, + listLinkableEnvironmentsNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getAccountCredentialsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/getAccountCredentials", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.AccountInfoSecure + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listMonitoredResourcesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/listMonitoredResources", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.MonitoredResourceListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getVMHostPayloadOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/getVMHostPayload", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.VMExtensionPayload + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MonitorResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.MonitorResource + }, + 201: { + bodyMapper: Mappers.MonitorResource + }, + 202: { + bodyMapper: Mappers.MonitorResource + }, + 204: { + bodyMapper: Mappers.MonitorResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.resource, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.MonitorResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.resource1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionIdOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Dynatrace.Observability/monitors", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MonitorResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MonitorResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listHostsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/listHosts", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.VMHostsListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listAppServicesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/listAppServices", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.AppServiceListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getSSODetailsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/getSSODetails", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.SSODetailsResponse + }, + 401: { + isError: true + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.request, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listLinkableEnvironmentsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/listLinkableEnvironments", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.LinkableEnvironmentListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.request1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listMonitoredResourcesNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MonitoredResourceListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionIdNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MonitorResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MonitorResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listHostsNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VMHostsListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listAppServicesNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AppServiceListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listLinkableEnvironmentsNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.LinkableEnvironmentListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; diff --git a/sdk/dynatrace/arm-dynatrace/src/operations/operations.ts b/sdk/dynatrace/arm-dynatrace/src/operations/operations.ts new file mode 100644 index 000000000000..3c161ef12d98 --- /dev/null +++ b/sdk/dynatrace/arm-dynatrace/src/operations/operations.ts @@ -0,0 +1,137 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DynatraceObservability } from "../dynatraceObservability"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: DynatraceObservability; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: DynatraceObservability) { + this.client = client; + } + + /** + * List the operations for Dynatrace.Observability + * @param options The options parameters. + */ + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams + ): 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?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * List the operations for Dynatrace.Observability + * @param options The options parameters. + */ + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Dynatrace.Observability/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/dynatrace/arm-dynatrace/src/operations/singleSignOn.ts b/sdk/dynatrace/arm-dynatrace/src/operations/singleSignOn.ts new file mode 100644 index 000000000000..2b142fc4f366 --- /dev/null +++ b/sdk/dynatrace/arm-dynatrace/src/operations/singleSignOn.ts @@ -0,0 +1,355 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { SingleSignOn } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DynatraceObservability } from "../dynatraceObservability"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + DynatraceSingleSignOnResource, + SingleSignOnListNextOptionalParams, + SingleSignOnListOptionalParams, + SingleSignOnCreateOrUpdateOptionalParams, + SingleSignOnCreateOrUpdateResponse, + SingleSignOnGetOptionalParams, + SingleSignOnGetResponse, + SingleSignOnListResponse, + SingleSignOnListNextResponse +} from "../models"; + +/// +/** Class containing SingleSignOn operations. */ +export class SingleSignOnImpl implements SingleSignOn { + private readonly client: DynatraceObservability; + + /** + * Initialize a new instance of the class SingleSignOn class. + * @param client Reference to the service client + */ + constructor(client: DynatraceObservability) { + this.client = client; + } + + /** + * List all DynatraceSingleSignOnResource by monitorName + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + monitorName: string, + options?: SingleSignOnListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, monitorName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceGroupName, monitorName, options); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + monitorName: string, + options?: SingleSignOnListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, monitorName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + monitorName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + monitorName: string, + options?: SingleSignOnListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + monitorName, + options + )) { + yield* page; + } + } + + /** + * Create a DynatraceSingleSignOnResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param configurationName Single Sign On Configuration Name + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + monitorName: string, + configurationName: string, + resource: DynatraceSingleSignOnResource, + options?: SingleSignOnCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SingleSignOnCreateOrUpdateResponse + > + > { + 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, monitorName, configurationName, resource, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Create a DynatraceSingleSignOnResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param configurationName Single Sign On Configuration Name + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + monitorName: string, + configurationName: string, + resource: DynatraceSingleSignOnResource, + options?: SingleSignOnCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + monitorName, + configurationName, + resource, + options + ); + return poller.pollUntilDone(); + } + + /** + * Get a DynatraceSingleSignOnResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param configurationName Single Sign On Configuration Name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + configurationName: string, + options?: SingleSignOnGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, configurationName, options }, + getOperationSpec + ); + } + + /** + * List all DynatraceSingleSignOnResource by monitorName + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + monitorName: string, + options?: SingleSignOnListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + monitorName: string, + nextLink: string, + options?: SingleSignOnListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.DynatraceSingleSignOnResource + }, + 201: { + bodyMapper: Mappers.DynatraceSingleSignOnResource + }, + 202: { + bodyMapper: Mappers.DynatraceSingleSignOnResource + }, + 204: { + bodyMapper: Mappers.DynatraceSingleSignOnResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.resource4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.configurationName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DynatraceSingleSignOnResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.configurationName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/singleSignOnConfigurations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DynatraceSingleSignOnResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DynatraceSingleSignOnResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/dynatrace/arm-dynatrace/src/operations/tagRules.ts b/sdk/dynatrace/arm-dynatrace/src/operations/tagRules.ts new file mode 100644 index 000000000000..111c60855720 --- /dev/null +++ b/sdk/dynatrace/arm-dynatrace/src/operations/tagRules.ts @@ -0,0 +1,515 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { TagRules } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DynatraceObservability } from "../dynatraceObservability"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + TagRule, + TagRulesListNextOptionalParams, + TagRulesListOptionalParams, + TagRulesGetOptionalParams, + TagRulesGetResponse, + TagRulesCreateOrUpdateOptionalParams, + TagRulesCreateOrUpdateResponse, + TagRuleUpdate, + TagRulesUpdateOptionalParams, + TagRulesUpdateResponse, + TagRulesDeleteOptionalParams, + TagRulesListResponse, + TagRulesListNextResponse +} from "../models"; + +/// +/** Class containing TagRules operations. */ +export class TagRulesImpl implements TagRules { + private readonly client: DynatraceObservability; + + /** + * Initialize a new instance of the class TagRules class. + * @param client Reference to the service client + */ + constructor(client: DynatraceObservability) { + this.client = client; + } + + /** + * List all TagRule by monitorName + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + monitorName: string, + options?: TagRulesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, monitorName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceGroupName, monitorName, options); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + monitorName: string, + options?: TagRulesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, monitorName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + monitorName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + monitorName: string, + options?: TagRulesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + monitorName, + options + )) { + yield* page; + } + } + + /** + * Get a TagRule + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param ruleSetName Monitor resource name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + ruleSetName: string, + options?: TagRulesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, ruleSetName, options }, + getOperationSpec + ); + } + + /** + * Create a TagRule + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param ruleSetName Monitor resource name + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + monitorName: string, + ruleSetName: string, + resource: TagRule, + options?: TagRulesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + TagRulesCreateOrUpdateResponse + > + > { + 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, monitorName, ruleSetName, resource, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Create a TagRule + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param ruleSetName Monitor resource name + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + monitorName: string, + ruleSetName: string, + resource: TagRule, + options?: TagRulesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + monitorName, + ruleSetName, + resource, + options + ); + return poller.pollUntilDone(); + } + + /** + * Update a TagRule + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param ruleSetName Monitor resource name + * @param resource The resource properties to be updated. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + monitorName: string, + ruleSetName: string, + resource: TagRuleUpdate, + options?: TagRulesUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, ruleSetName, resource, options }, + updateOperationSpec + ); + } + + /** + * Delete a TagRule + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param ruleSetName Monitor resource name + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + monitorName: string, + ruleSetName: string, + options?: TagRulesDeleteOptionalParams + ): 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, monitorName, ruleSetName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Delete a TagRule + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param ruleSetName Monitor resource name + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + monitorName: string, + ruleSetName: string, + options?: TagRulesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + monitorName, + ruleSetName, + options + ); + return poller.pollUntilDone(); + } + + /** + * List all TagRule by monitorName + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + monitorName: string, + options?: TagRulesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + monitorName: string, + nextLink: string, + options?: TagRulesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/tagRules/{ruleSetName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TagRule + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.ruleSetName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/tagRules/{ruleSetName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.TagRule + }, + 201: { + bodyMapper: Mappers.TagRule + }, + 202: { + bodyMapper: Mappers.TagRule + }, + 204: { + bodyMapper: Mappers.TagRule + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.resource2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.ruleSetName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/tagRules/{ruleSetName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.TagRule + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.resource3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.ruleSetName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/tagRules/{ruleSetName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.ruleSetName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/tagRules", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TagRuleListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TagRuleListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/index.ts b/sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..e0edfa7549f3 --- /dev/null +++ b/sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/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 "./monitors"; +export * from "./operations"; +export * from "./tagRules"; +export * from "./singleSignOn"; diff --git a/sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/monitors.ts b/sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/monitors.ts new file mode 100644 index 000000000000..e48dbd1d1fd8 --- /dev/null +++ b/sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/monitors.ts @@ -0,0 +1,216 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { + MonitoredResource, + MonitorsListMonitoredResourcesOptionalParams, + MonitorResource, + MonitorsListBySubscriptionIdOptionalParams, + MonitorsListByResourceGroupOptionalParams, + VMInfo, + MonitorsListHostsOptionalParams, + AppServiceInfo, + MonitorsListAppServicesOptionalParams, + LinkableEnvironmentResponse, + LinkableEnvironmentRequest, + MonitorsListLinkableEnvironmentsOptionalParams, + MonitorsGetAccountCredentialsOptionalParams, + MonitorsGetAccountCredentialsResponse, + MonitorsGetVMHostPayloadOptionalParams, + MonitorsGetVMHostPayloadResponse, + MonitorsGetOptionalParams, + MonitorsGetResponse, + MonitorsCreateOrUpdateOptionalParams, + MonitorsCreateOrUpdateResponse, + MonitorResourceUpdate, + MonitorsUpdateOptionalParams, + MonitorsUpdateResponse, + MonitorsDeleteOptionalParams, + MonitorsGetSSODetailsOptionalParams, + MonitorsGetSSODetailsResponse +} from "../models"; + +/// +/** Interface representing a Monitors. */ +export interface Monitors { + /** + * List the resources currently being monitored by the Dynatrace monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + listMonitoredResources( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListMonitoredResourcesOptionalParams + ): PagedAsyncIterableIterator; + /** + * List all MonitorResource by subscriptionId + * @param options The options parameters. + */ + listBySubscriptionId( + options?: MonitorsListBySubscriptionIdOptionalParams + ): PagedAsyncIterableIterator; + /** + * List MonitorResource resources by resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: MonitorsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * List the compute resources currently being monitored by the Dynatrace resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + listHosts( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListHostsOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets list of App Services with Dynatrace PaaS OneAgent enabled + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + listAppServices( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListAppServicesOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets all the Dynatrace environments that a user can link a azure resource to + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param request The details of the linkable environment request. + * @param options The options parameters. + */ + listLinkableEnvironments( + resourceGroupName: string, + monitorName: string, + request: LinkableEnvironmentRequest, + options?: MonitorsListLinkableEnvironmentsOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the user account credentials for a Monitor + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + getAccountCredentials( + resourceGroupName: string, + monitorName: string, + options?: MonitorsGetAccountCredentialsOptionalParams + ): Promise; + /** + * Returns the payload that needs to be passed in the request body for installing Dynatrace agent on a + * VM. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + getVMHostPayload( + resourceGroupName: string, + monitorName: string, + options?: MonitorsGetVMHostPayloadOptionalParams + ): Promise; + /** + * Get a MonitorResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + options?: MonitorsGetOptionalParams + ): Promise; + /** + * Create a MonitorResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + monitorName: string, + resource: MonitorResource, + options?: MonitorsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + MonitorsCreateOrUpdateResponse + > + >; + /** + * Create a MonitorResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + monitorName: string, + resource: MonitorResource, + options?: MonitorsCreateOrUpdateOptionalParams + ): Promise; + /** + * Update a MonitorResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param resource The resource properties to be updated. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + monitorName: string, + resource: MonitorResourceUpdate, + options?: MonitorsUpdateOptionalParams + ): Promise; + /** + * Delete a MonitorResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + monitorName: string, + options?: MonitorsDeleteOptionalParams + ): Promise, void>>; + /** + * Delete a MonitorResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + monitorName: string, + options?: MonitorsDeleteOptionalParams + ): Promise; + /** + * Gets the SSO configuration details from the partner. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + getSSODetails( + resourceGroupName: string, + monitorName: string, + options?: MonitorsGetSSODetailsOptionalParams + ): Promise; +} diff --git a/sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/operations.ts b/sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..8096242e06b4 --- /dev/null +++ b/sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/operations.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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operation, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * List the operations for Dynatrace.Observability + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/singleSignOn.ts b/sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/singleSignOn.ts new file mode 100644 index 000000000000..85553edafc80 --- /dev/null +++ b/sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/singleSignOn.ts @@ -0,0 +1,82 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { + DynatraceSingleSignOnResource, + SingleSignOnListOptionalParams, + SingleSignOnCreateOrUpdateOptionalParams, + SingleSignOnCreateOrUpdateResponse, + SingleSignOnGetOptionalParams, + SingleSignOnGetResponse +} from "../models"; + +/// +/** Interface representing a SingleSignOn. */ +export interface SingleSignOn { + /** + * List all DynatraceSingleSignOnResource by monitorName + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + list( + resourceGroupName: string, + monitorName: string, + options?: SingleSignOnListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create a DynatraceSingleSignOnResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param configurationName Single Sign On Configuration Name + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + monitorName: string, + configurationName: string, + resource: DynatraceSingleSignOnResource, + options?: SingleSignOnCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SingleSignOnCreateOrUpdateResponse + > + >; + /** + * Create a DynatraceSingleSignOnResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param configurationName Single Sign On Configuration Name + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + monitorName: string, + configurationName: string, + resource: DynatraceSingleSignOnResource, + options?: SingleSignOnCreateOrUpdateOptionalParams + ): Promise; + /** + * Get a DynatraceSingleSignOnResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param configurationName Single Sign On Configuration Name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + configurationName: string, + options?: SingleSignOnGetOptionalParams + ): Promise; +} diff --git a/sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/tagRules.ts b/sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/tagRules.ts new file mode 100644 index 000000000000..19294950afb1 --- /dev/null +++ b/sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/tagRules.ts @@ -0,0 +1,127 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { + TagRule, + TagRulesListOptionalParams, + TagRulesGetOptionalParams, + TagRulesGetResponse, + TagRulesCreateOrUpdateOptionalParams, + TagRulesCreateOrUpdateResponse, + TagRuleUpdate, + TagRulesUpdateOptionalParams, + TagRulesUpdateResponse, + TagRulesDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a TagRules. */ +export interface TagRules { + /** + * List all TagRule by monitorName + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + list( + resourceGroupName: string, + monitorName: string, + options?: TagRulesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a TagRule + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param ruleSetName Monitor resource name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + ruleSetName: string, + options?: TagRulesGetOptionalParams + ): Promise; + /** + * Create a TagRule + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param ruleSetName Monitor resource name + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + monitorName: string, + ruleSetName: string, + resource: TagRule, + options?: TagRulesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + TagRulesCreateOrUpdateResponse + > + >; + /** + * Create a TagRule + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param ruleSetName Monitor resource name + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + monitorName: string, + ruleSetName: string, + resource: TagRule, + options?: TagRulesCreateOrUpdateOptionalParams + ): Promise; + /** + * Update a TagRule + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param ruleSetName Monitor resource name + * @param resource The resource properties to be updated. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + monitorName: string, + ruleSetName: string, + resource: TagRuleUpdate, + options?: TagRulesUpdateOptionalParams + ): Promise; + /** + * Delete a TagRule + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param ruleSetName Monitor resource name + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + monitorName: string, + ruleSetName: string, + options?: TagRulesDeleteOptionalParams + ): Promise, void>>; + /** + * Delete a TagRule + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param ruleSetName Monitor resource name + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + monitorName: string, + ruleSetName: string, + options?: TagRulesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/dynatrace/arm-dynatrace/test/sampleTest.ts b/sdk/dynatrace/arm-dynatrace/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/dynatrace/arm-dynatrace/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/dynatrace/arm-dynatrace/tsconfig.json b/sdk/dynatrace/arm-dynatrace/tsconfig.json new file mode 100644 index 000000000000..3e6ae96443f3 --- /dev/null +++ b/sdk/dynatrace/arm-dynatrace/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "dom" + ], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true + }, + "include": [ + "./src/**/*.ts", + "./test/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/sdk/dynatrace/ci.mgmt.yml b/sdk/dynatrace/ci.mgmt.yml new file mode 100644 index 000000000000..9a81934dc1ab --- /dev/null +++ b/sdk/dynatrace/ci.mgmt.yml @@ -0,0 +1,38 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/dynatrace/arm-dynatrace + - sdk/dynatrace/ci.mgmt.yml + +pr: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/dynatrace/arm-dynatrace + - sdk/dynatrace/ci.mgmt.yml + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: dynatrace + Artifacts: + - name: azure-arm-dynatrace + safeName: azurearmdynatrace + \ No newline at end of file