diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 9cab88dbd6ea..7c9bb8f30cd6 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -2675,12 +2675,6 @@ packages: type-detect: 4.0.8 dev: false - /@sinonjs/fake-timers/10.0.2: - resolution: {integrity: sha512-SwUDyjWnah1AaNl7kxsa7cfLhlTYoiyhDAIgyh+El30YvXs/o7OLXpYH88Zdhyx9JExKrmHDJ+10bwIcY80Jmw==} - dependencies: - '@sinonjs/commons': 2.0.0 - dev: false - /@sinonjs/fake-timers/10.3.0: resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==} dependencies: @@ -4420,6 +4414,7 @@ packages: /debuglog/1.0.1: resolution: {integrity: sha512-syBZ+rnAK3EgMsH2aYEOLUW7mZSY9Gb+0wUMCFsZvcmiz+HigA0LOcq/HoQqVuGG+EKykunc7QG2bzrponfaSw==} + deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. dev: false /decamelize-keys/1.1.1: @@ -4716,7 +4711,7 @@ packages: dependencies: semver: 7.5.3 shelljs: 0.8.5 - typescript: 5.2.0-dev.20230629 + typescript: 5.2.0-dev.20230705 dev: false /duplexer3/0.1.5: @@ -10180,8 +10175,8 @@ packages: hasBin: true dev: false - /typescript/5.2.0-dev.20230629: - resolution: {integrity: sha512-/8eGjHX3BI9Cpb2ghyC3qeWD4PTXx7npbvZuKsphLdvFJkbOrKbvmnYGW+3QKs5rREjTq5/0A4IIlp9yCIit0g==} + /typescript/5.2.0-dev.20230705: + resolution: {integrity: sha512-eMgfQ/e5CgYYSaduGhDc2UiY2EzzgrBMfHyagjUP70jj4VDCmLlIp1EftT5AMiLvNc7PYNCeziRFY5fBZhD9uA==} engines: {node: '>=14.17'} hasBin: true dev: false @@ -13532,7 +13527,7 @@ packages: dev: false file:projects/arm-dynatrace.tgz: - resolution: {integrity: sha512-+JUPYTYa1sK3TAoSSi4a8MTHI+ptAboCznISNDzfUxGz6LefeL69pEUj/iLdZ8BREhMeSp8In6UOgMzVoMJFyw==, tarball: file:projects/arm-dynatrace.tgz} + resolution: {integrity: sha512-k0JWi5xb7CKh9vmyCipoUAvCTbhZDcfHYV1//DBVz02rC9kjpwWUM2iy8xxroiEjVxYRkYIZ679MGBo0eCCAIQ==, tarball: file:projects/arm-dynatrace.tgz} name: '@rush-temp/arm-dynatrace' version: 0.0.0 dependencies: @@ -13546,8 +13541,8 @@ packages: '@types/node': 14.18.51 chai: 4.3.7 cross-env: 7.0.3 - dotenv: 8.6.0 - mkdirp: 1.0.4 + dotenv: 16.3.1 + mkdirp: 2.1.6 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 @@ -18170,7 +18165,7 @@ packages: dev: false file:projects/core-client.tgz: - resolution: {integrity: sha512-DD1MezAP4ZkP3o8F2g80m0zqnyYXxrvexL35titsE8+UprlOKcrJVMYF++ZUYgMEHrdn0ty6v7tUctmPgqQOwg==, tarball: file:projects/core-client.tgz} + resolution: {integrity: sha512-0f6tvrsFDRRLUf6atVFtPIUCMCDCIZDBMFSobCRb25oZ/1UFenVZLZ60MYTTtTswPKJfR3gvlwt4J5JCCACxOg==, tarball: file:projects/core-client.tgz} name: '@rush-temp/core-client' version: 0.0.0 dependencies: @@ -18535,13 +18530,13 @@ packages: dev: false file:projects/cosmos.tgz: - resolution: {integrity: sha512-YFCaW1JpVf6hza6MzlJ9v9wWbgl/C4MG8/RZ7R8D7li+fnhDi9PPZUfaxlPd/on5bdWX+7yK5U2JNVh28jEUXA==, tarball: file:projects/cosmos.tgz} + resolution: {integrity: sha512-LJz+1OIFq2SgnmWTitdaXdnVjEhoeYKGPGZpktlZRmqzTYQXHYXuxgNW2wvvJrKUfJ2eKkOnf3P5HFBSCAw2DQ==, tarball: file:projects/cosmos.tgz} name: '@rush-temp/cosmos' version: 0.0.0 dependencies: '@azure/identity': 2.1.0 '@microsoft/api-extractor': 7.36.0_@types+node@14.18.51 - '@sinonjs/fake-timers': 10.0.2 + '@sinonjs/fake-timers': 10.3.0 '@types/debug': 4.1.8 '@types/mocha': 7.0.2 '@types/node': 14.18.51 diff --git a/sdk/dynatrace/arm-dynatrace/CHANGELOG.md b/sdk/dynatrace/arm-dynatrace/CHANGELOG.md index 962bfb5dfbaf..a09f95281000 100644 --- a/sdk/dynatrace/arm-dynatrace/CHANGELOG.md +++ b/sdk/dynatrace/arm-dynatrace/CHANGELOG.md @@ -1,15 +1,34 @@ # Release History + +## 2.0.0 (2023-07-05) + +**Features** -## 1.0.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added operation Monitors.getMarketplaceSaaSResourceDetails + - Added operation Monitors.getMetricStatus + - Added Interface MarketplaceSaaSResourceDetailsRequest + - Added Interface MarketplaceSaaSResourceDetailsResponse + - Added Interface MetricsStatusResponse + - Added Interface MonitorsGetMarketplaceSaaSResourceDetailsOptionalParams + - Added Interface MonitorsGetMetricStatusOptionalParams + - Added Type Alias MonitorsGetMarketplaceSaaSResourceDetailsResponse + - Added Type Alias MonitorsGetMetricStatusResponse + - Interface MetricRules has a new optional parameter sendingMetrics + +**Breaking Changes** + + - Removed operation Monitors.getAccountCredentials + - Removed operation TagRules.update + - Interface MonitorResourceUpdate no longer has parameter dynatraceEnvironmentProperties + - Interface MonitorResourceUpdate no longer has parameter marketplaceSubscriptionStatus + - Interface MonitorResourceUpdate no longer has parameter monitoringStatus + - Interface MonitorResourceUpdate no longer has parameter planData + - Interface MonitorResourceUpdate no longer has parameter userInfo + - Parameter region of interface LinkableEnvironmentRequest is now required + - Parameter tenantId of interface LinkableEnvironmentRequest is now required + - Parameter userPrincipal of interface LinkableEnvironmentRequest is now required + - Parameter userPrincipal of interface SSODetailsRequest is now required + ## 1.0.1 (2023-01-09) **Features** diff --git a/sdk/dynatrace/arm-dynatrace/_meta.json b/sdk/dynatrace/arm-dynatrace/_meta.json index e6db4ccc1ea7..dc3a715e0e06 100644 --- a/sdk/dynatrace/arm-dynatrace/_meta.json +++ b/sdk/dynatrace/arm-dynatrace/_meta.json @@ -1,8 +1,8 @@ { - "commit": "e24bbf6a66cb0a19c072c6f15cee163acbd7acf7", - "readme": "specification\\dynatrace\\resource-manager\\readme.md", - "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=F:\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\dynatrace\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.6.20221226.1 --generate-sample=true", + "commit": "726693d250796ded352667193197a3d1d31fef5d", + "readme": "specification/dynatrace/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/dynatrace/resource-manager/readme.md --use=@autorest/typescript@^6.0.4", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.5.4", - "use": "@autorest/typescript@6.0.0-rc.6.20221226.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.1", + "use": "@autorest/typescript@^6.0.4" } \ No newline at end of file diff --git a/sdk/dynatrace/arm-dynatrace/package.json b/sdk/dynatrace/arm-dynatrace/package.json index 9736602dcb12..91bed262e1ed 100644 --- a/sdk/dynatrace/arm-dynatrace/package.json +++ b/sdk/dynatrace/arm-dynatrace/package.json @@ -3,15 +3,15 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for DynatraceObservability.", - "version": "1.0.2", + "version": "2.0.0", "engines": { "node": ">=14.0.0" }, "dependencies": { - "@azure/core-lro": "^2.2.0", + "@azure/core-lro": "^2.5.3", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.6.1", + "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" @@ -33,13 +33,13 @@ "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-multi-entry": "^6.0.0", "@rollup/plugin-node-resolve": "^13.1.3", - "mkdirp": "^1.0.4", + "mkdirp": "^2.1.2", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "~5.0.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", - "dotenv": "^8.2.0", + "dotenv": "^16.0.0", "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", @@ -111,13 +111,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dynatrace/arm-dynatrace", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-dynatrace?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dynatrace/arm-dynatrace" +} \ 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 index 0feae7baa1da..be94f70994ca 100644 --- a/sdk/dynatrace/arm-dynatrace/review/arm-dynatrace.api.md +++ b/sdk/dynatrace/arm-dynatrace/review/arm-dynatrace.api.md @@ -6,9 +6,9 @@ import * as coreAuth from '@azure/core-auth'; import * as coreClient from '@azure/core-client'; +import { OperationState } from '@azure/core-lro'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; -import { PollerLike } from '@azure/core-lro'; -import { PollOperationState } from '@azure/core-lro'; +import { SimplePollerLike } from '@azure/core-lro'; // @public export interface AccountInfo { @@ -16,13 +16,6 @@ export interface AccountInfo { regionId?: string; } -// @public -export interface AccountInfoSecure { - readonly accountId?: string; - readonly apiKey?: string; - readonly regionId?: string; -} - // @public export type ActionType = string; @@ -323,9 +316,9 @@ export interface LinkableEnvironmentListResponse { // @public export interface LinkableEnvironmentRequest { - region?: string; - tenantId?: string; - userPrincipal?: string; + region: string; + tenantId: string; + userPrincipal: string; } // @public @@ -349,12 +342,30 @@ export interface LogRules { // @public export type ManagedIdentityType = string; +// @public +export interface MarketplaceSaaSResourceDetailsRequest { + tenantId: string; +} + +// @public +export interface MarketplaceSaaSResourceDetailsResponse { + marketplaceSaaSResourceId?: string; + marketplaceSubscriptionStatus?: MarketplaceSubscriptionStatus; + planId?: string; +} + // @public export type MarketplaceSubscriptionStatus = string; // @public export interface MetricRules { filteringTags?: FilteringTag[]; + sendingMetrics?: SendingMetricsStatus; +} + +// @public +export interface MetricsStatusResponse { + azureResourceIds?: string[]; } // @public @@ -400,24 +411,20 @@ export interface MonitorResourceListResult { // @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>>; + 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>>; + 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; + getMarketplaceSaaSResourceDetails(request: MarketplaceSaaSResourceDetailsRequest, options?: MonitorsGetMarketplaceSaaSResourceDetailsOptionalParams): Promise; + getMetricStatus(resourceGroupName: string, monitorName: string, options?: MonitorsGetMetricStatusOptionalParams): 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; @@ -445,11 +452,18 @@ export interface MonitorsDeleteOptionalParams extends coreClient.OperationOption } // @public -export interface MonitorsGetAccountCredentialsOptionalParams extends coreClient.OperationOptions { +export interface MonitorsGetMarketplaceSaaSResourceDetailsOptionalParams extends coreClient.OperationOptions { } // @public -export type MonitorsGetAccountCredentialsResponse = AccountInfoSecure; +export type MonitorsGetMarketplaceSaaSResourceDetailsResponse = MarketplaceSaaSResourceDetailsResponse; + +// @public +export interface MonitorsGetMetricStatusOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsGetMetricStatusResponse = MetricsStatusResponse; // @public export interface MonitorsGetOptionalParams extends coreClient.OperationOptions { @@ -648,7 +662,7 @@ export type SendSubscriptionLogsStatus = string; // @public export interface SingleSignOn { - beginCreateOrUpdate(resourceGroupName: string, monitorName: string, configurationName: string, resource: DynatraceSingleSignOnResource, options?: SingleSignOnCreateOrUpdateOptionalParams): Promise, SingleSignOnCreateOrUpdateResponse>>; + 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; @@ -689,7 +703,7 @@ export type SingleSignOnStates = string; // @public export interface SSODetailsRequest { - userPrincipal?: string; + userPrincipal: string; } // @public @@ -733,13 +747,12 @@ export interface TagRuleListResult { // @public export interface TagRules { - beginCreateOrUpdate(resourceGroupName: string, monitorName: string, ruleSetName: string, resource: TagRule, options?: TagRulesCreateOrUpdateOptionalParams): Promise, TagRulesCreateOrUpdateResponse>>; + 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>>; + 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 @@ -778,19 +791,6 @@ 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 interface TrackedResource extends Resource { location: string; diff --git a/sdk/dynatrace/arm-dynatrace/src/dynatraceObservability.ts b/sdk/dynatrace/arm-dynatrace/src/dynatraceObservability.ts index 20a2f8efd5e1..01a8509fa828 100644 --- a/sdk/dynatrace/arm-dynatrace/src/dynatraceObservability.ts +++ b/sdk/dynatrace/arm-dynatrace/src/dynatraceObservability.ts @@ -60,7 +60,7 @@ export class DynatraceObservability extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-dynatrace/1.0.2`; + const packageDetails = `azsdk-js-arm-dynatrace/2.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -113,7 +113,7 @@ export class DynatraceObservability extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-09-01"; + this.apiVersion = options.apiVersion || "2023-04-27"; this.monitors = new MonitorsImpl(this); this.operations = new OperationsImpl(this); this.tagRules = new TagRulesImpl(this); diff --git a/sdk/dynatrace/arm-dynatrace/src/lroImpl.ts b/sdk/dynatrace/arm-dynatrace/src/lroImpl.ts index 518d5f053b4e..dd803cd5e28c 100644 --- a/sdk/dynatrace/arm-dynatrace/src/lroImpl.ts +++ b/sdk/dynatrace/arm-dynatrace/src/lroImpl.ts @@ -6,29 +6,37 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { AbortSignalLike } from "@azure/abort-controller"; 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" - }); - } +export function createLroSpec(inputs: { + sendOperationFn: (args: any, spec: any) => Promise>; + args: Record; + spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record; +}): LongRunningOperation { + const { args, spec, sendOperationFn } = inputs; + return { + requestMethod: spec.httpMethod, + requestPath: spec.path!, + sendInitialRequest: () => sendOperationFn(args, spec), + sendPollRequest: ( + path: string, + options?: { abortSignal?: AbortSignalLike } + ) => { + const { requestBody, ...restSpec } = spec; + return sendOperationFn(args, { + ...restSpec, + httpMethod: "GET", + path, + abortSignal: options?.abortSignal + }); + } + }; } diff --git a/sdk/dynatrace/arm-dynatrace/src/models/index.ts b/sdk/dynatrace/arm-dynatrace/src/models/index.ts index 898609c224f0..8a8fa2826fc6 100644 --- a/sdk/dynatrace/arm-dynatrace/src/models/index.ts +++ b/sdk/dynatrace/arm-dynatrace/src/models/index.ts @@ -8,24 +8,26 @@ 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; +/** 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; } /** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ @@ -77,28 +79,6 @@ export interface ErrorAdditionalInfo { 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 */ @@ -247,16 +227,6 @@ export interface Resource { 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. */ @@ -358,18 +328,12 @@ export interface FilteringTag { /** Set of rules for sending metrics for the Monitor resource. */ export interface MetricRules { + /** Flag specifying if metrics from Azure resources should be sent for the Monitor resource. */ + sendingMetrics?: SendingMetricsStatus; /** 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 */ @@ -378,6 +342,22 @@ export interface TagRuleListResult { nextLink?: string; } +/** Request for getting Marketplace SaaS resource details for a tenant Id */ +export interface MarketplaceSaaSResourceDetailsRequest { + /** Tenant Id */ + tenantId: string; +} + +/** Marketplace SaaS resource details linked to the given tenant Id */ +export interface MarketplaceSaaSResourceDetailsResponse { + /** Id of the Marketplace SaaS Resource */ + marketplaceSaaSResourceId?: string; + /** Id of the plan */ + planId?: string; + /** Marketplace subscription status */ + marketplaceSubscriptionStatus?: MarketplaceSubscriptionStatus; +} + /** The response of a DynatraceSingleSignOnResource list operation. */ export interface DynatraceSingleSignOnResourceListResult { /** The items on this page */ @@ -416,6 +396,12 @@ export interface VMInfo { hostName?: string; } +/** Response of get metrics status operation */ +export interface MetricsStatusResponse { + /** Azure resource IDs */ + azureResourceIds?: string[]; +} + /** Response of a list App Services Operation. */ export interface AppServiceListResponse { /** The items on this page */ @@ -449,7 +435,7 @@ export interface AppServiceInfo { /** Request for getting sso details for a user */ export interface SSODetailsRequest { /** user principal id of the user */ - userPrincipal?: string; + userPrincipal: string; } /** SSO details from the Dynatrace partner */ @@ -469,11 +455,11 @@ export interface SSODetailsResponse { /** 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; + tenantId: string; /** user principal id of the user */ - userPrincipal?: string; + userPrincipal: string; /** Azure region in which we want to link the environment */ - region?: string; + region: string; } /** Response for getting all the linkable environments */ @@ -1034,13 +1020,6 @@ export enum KnownSSOStatus { */ 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 {} @@ -1104,6 +1083,13 @@ export interface MonitorsListByResourceGroupOptionalParams /** Contains response data for the listByResourceGroup operation. */ export type MonitorsListByResourceGroupResponse = MonitorResourceListResult; +/** Optional parameters. */ +export interface MonitorsGetMarketplaceSaaSResourceDetailsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getMarketplaceSaaSResourceDetails operation. */ +export type MonitorsGetMarketplaceSaaSResourceDetailsResponse = MarketplaceSaaSResourceDetailsResponse; + /** Optional parameters. */ export interface MonitorsListHostsOptionalParams extends coreClient.OperationOptions {} @@ -1111,6 +1097,13 @@ export interface MonitorsListHostsOptionalParams /** Contains response data for the listHosts operation. */ export type MonitorsListHostsResponse = VMHostsListResponse; +/** Optional parameters. */ +export interface MonitorsGetMetricStatusOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getMetricStatus operation. */ +export type MonitorsGetMetricStatusResponse = MetricsStatusResponse; + /** Optional parameters. */ export interface MonitorsListAppServicesOptionalParams extends coreClient.OperationOptions {} @@ -1210,13 +1203,6 @@ export interface TagRulesCreateOrUpdateOptionalParams /** 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 { diff --git a/sdk/dynatrace/arm-dynatrace/src/models/mappers.ts b/sdk/dynatrace/arm-dynatrace/src/models/mappers.ts index b3609bcbade9..cc582bf0291c 100644 --- a/sdk/dynatrace/arm-dynatrace/src/models/mappers.ts +++ b/sdk/dynatrace/arm-dynatrace/src/models/mappers.ts @@ -8,28 +8,64 @@ import * as coreClient from "@azure/core-client"; -export const AccountInfoSecure: coreClient.CompositeMapper = { +export const MonitoredResourceListResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccountInfoSecure", + className: "MonitoredResourceListResponse", modelProperties: { - accountId: { - serializedName: "accountId", - readOnly: true, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MonitoredResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const MonitoredResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoredResource", + modelProperties: { + id: { + serializedName: "id", type: { name: "String" } }, - apiKey: { - serializedName: "apiKey", - readOnly: true, + sendingMetrics: { + serializedName: "sendingMetrics", type: { name: "String" } }, - regionId: { - serializedName: "regionId", - readOnly: true, + reasonForMetricsStatus: { + serializedName: "reasonForMetricsStatus", + type: { + name: "String" + } + }, + sendingLogs: { + serializedName: "sendingLogs", + type: { + name: "String" + } + }, + reasonForLogsStatus: { + serializedName: "reasonForLogsStatus", type: { name: "String" } @@ -134,72 +170,6 @@ export const ErrorAdditionalInfo: coreClient.CompositeMapper = { } }; -export const MonitoredResourceListResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MonitoredResourceListResponse", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MonitoredResource" - } - } - } - }, - nextLink: { - serializedName: "nextLink", - 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", @@ -584,39 +554,6 @@ export const MonitorResourceUpdate: coreClient.CompositeMapper = { 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" - } } } } @@ -831,6 +768,12 @@ export const MetricRules: coreClient.CompositeMapper = { name: "Composite", className: "MetricRules", modelProperties: { + sendingMetrics: { + serializedName: "sendingMetrics", + type: { + name: "String" + } + }, filteringTags: { serializedName: "filteringTags", type: { @@ -847,29 +790,6 @@ export const MetricRules: coreClient.CompositeMapper = { } }; -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", @@ -898,6 +818,49 @@ export const TagRuleListResult: coreClient.CompositeMapper = { } }; +export const MarketplaceSaaSResourceDetailsRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MarketplaceSaaSResourceDetailsRequest", + modelProperties: { + tenantId: { + serializedName: "tenantId", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const MarketplaceSaaSResourceDetailsResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MarketplaceSaaSResourceDetailsResponse", + modelProperties: { + marketplaceSaaSResourceId: { + serializedName: "marketplaceSaaSResourceId", + type: { + name: "String" + } + }, + planId: { + serializedName: "planId", + type: { + name: "String" + } + }, + marketplaceSubscriptionStatus: { + serializedName: "marketplaceSubscriptionStatus", + type: { + name: "String" + } + } + } + } +}; + export const DynatraceSingleSignOnResourceListResult: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1016,6 +979,26 @@ export const VMInfo: coreClient.CompositeMapper = { } }; +export const MetricsStatusResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricsStatusResponse", + modelProperties: { + azureResourceIds: { + serializedName: "azureResourceIds", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + export const AppServiceListResponse: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1113,6 +1096,7 @@ export const SSODetailsRequest: coreClient.CompositeMapper = { modelProperties: { userPrincipal: { serializedName: "userPrincipal", + required: true, type: { name: "String" } @@ -1177,18 +1161,21 @@ export const LinkableEnvironmentRequest: coreClient.CompositeMapper = { modelProperties: { tenantId: { serializedName: "tenantId", + required: true, type: { name: "String" } }, userPrincipal: { serializedName: "userPrincipal", + required: true, type: { name: "String" } }, region: { serializedName: "region", + required: true, type: { name: "String" } diff --git a/sdk/dynatrace/arm-dynatrace/src/models/parameters.ts b/sdk/dynatrace/arm-dynatrace/src/models/parameters.ts index 03daa25b55eb..a72cd56da36b 100644 --- a/sdk/dynatrace/arm-dynatrace/src/models/parameters.ts +++ b/sdk/dynatrace/arm-dynatrace/src/models/parameters.ts @@ -14,10 +14,10 @@ import { import { MonitorResource as MonitorResourceMapper, MonitorResourceUpdate as MonitorResourceUpdateMapper, + MarketplaceSaaSResourceDetailsRequest as MarketplaceSaaSResourceDetailsRequestMapper, SSODetailsRequest as SSODetailsRequestMapper, LinkableEnvironmentRequest as LinkableEnvironmentRequestMapper, TagRule as TagRuleMapper, - TagRuleUpdate as TagRuleUpdateMapper, DynatraceSingleSignOnResource as DynatraceSingleSignOnResourceMapper } from "../models/mappers"; @@ -48,7 +48,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-09-01", + defaultValue: "2023-04-27", isConstant: true, serializedName: "api-version", type: { @@ -120,11 +120,16 @@ export const resource1: OperationParameter = { }; export const request: OperationParameter = { + parameterPath: "request", + mapper: MarketplaceSaaSResourceDetailsRequestMapper +}; + +export const request1: OperationParameter = { parameterPath: ["options", "request"], mapper: SSODetailsRequestMapper }; -export const request1: OperationParameter = { +export const request2: OperationParameter = { parameterPath: "request", mapper: LinkableEnvironmentRequestMapper }; @@ -158,11 +163,6 @@ export const resource2: OperationParameter = { }; export const resource3: OperationParameter = { - parameterPath: "resource", - mapper: TagRuleUpdateMapper -}; - -export const resource4: OperationParameter = { parameterPath: "resource", mapper: DynatraceSingleSignOnResourceMapper }; diff --git a/sdk/dynatrace/arm-dynatrace/src/operations/monitors.ts b/sdk/dynatrace/arm-dynatrace/src/operations/monitors.ts index 31e485e23cb7..6786b584910a 100644 --- a/sdk/dynatrace/arm-dynatrace/src/operations/monitors.ts +++ b/sdk/dynatrace/arm-dynatrace/src/operations/monitors.ts @@ -13,8 +13,12 @@ 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 { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { MonitoredResource, MonitorsListMonitoredResourcesNextOptionalParams, @@ -40,8 +44,6 @@ import { MonitorsListLinkableEnvironmentsNextOptionalParams, MonitorsListLinkableEnvironmentsOptionalParams, MonitorsListLinkableEnvironmentsResponse, - MonitorsGetAccountCredentialsOptionalParams, - MonitorsGetAccountCredentialsResponse, MonitorsGetVMHostPayloadOptionalParams, MonitorsGetVMHostPayloadResponse, MonitorsGetOptionalParams, @@ -52,6 +54,11 @@ import { MonitorsUpdateOptionalParams, MonitorsUpdateResponse, MonitorsDeleteOptionalParams, + MarketplaceSaaSResourceDetailsRequest, + MonitorsGetMarketplaceSaaSResourceDetailsOptionalParams, + MonitorsGetMarketplaceSaaSResourceDetailsResponse, + MonitorsGetMetricStatusOptionalParams, + MonitorsGetMetricStatusResponse, MonitorsGetSSODetailsOptionalParams, MonitorsGetSSODetailsResponse, MonitorsListMonitoredResourcesNextResponse, @@ -283,7 +290,7 @@ export class MonitorsImpl implements Monitors { } /** - * List the compute resources currently being monitored by the Dynatrace resource. + * List the VM/VMSS 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. @@ -539,23 +546,6 @@ export class MonitorsImpl implements Monitors { } } - /** - * 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. @@ -621,8 +611,8 @@ export class MonitorsImpl implements Monitors { resource: MonitorResource, options?: MonitorsCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, MonitorsCreateOrUpdateResponse > > { @@ -632,7 +622,7 @@ export class MonitorsImpl implements Monitors { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -665,15 +655,18 @@ export class MonitorsImpl implements Monitors { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, monitorName, resource, options }, - createOrUpdateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, monitorName, resource, options }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + MonitorsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -730,14 +723,14 @@ export class MonitorsImpl implements Monitors { resourceGroupName: string, monitorName: string, options?: MonitorsDeleteOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -770,15 +763,15 @@ export class MonitorsImpl implements Monitors { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, monitorName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, monitorName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -832,7 +825,22 @@ export class MonitorsImpl implements Monitors { } /** - * List the compute resources currently being monitored by the Dynatrace resource. + * Get Marketplace SaaS resource details of a tenant under a specific subscription + * @param request Tenant Id + * @param options The options parameters. + */ + getMarketplaceSaaSResourceDetails( + request: MarketplaceSaaSResourceDetailsRequest, + options?: MonitorsGetMarketplaceSaaSResourceDetailsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { request, options }, + getMarketplaceSaaSResourceDetailsOperationSpec + ); + } + + /** + * List the VM/VMSS 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. @@ -848,6 +856,23 @@ export class MonitorsImpl implements Monitors { ); } + /** + * Get metric status + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitor resource + * @param options The options parameters. + */ + getMetricStatus( + resourceGroupName: string, + monitorName: string, + options?: MonitorsGetMetricStatusOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + getMetricStatusOperationSpec + ); + } + /** * Gets list of App Services with Dynatrace PaaS OneAgent enabled * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -1015,28 +1040,6 @@ export class MonitorsImpl implements Monitors { // 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", @@ -1221,6 +1224,28 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const getMarketplaceSaaSResourceDetailsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Dynatrace.Observability/getMarketplaceSaaSResourceDetails", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.MarketplaceSaaSResourceDetailsResponse + }, + 404: { + isError: true + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.request, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; const listHostsOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/listHosts", @@ -1243,6 +1268,28 @@ const listHostsOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const getMetricStatusOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/getMetricStatus", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.MetricsStatusResponse + }, + 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", @@ -1280,7 +1327,7 @@ const getSSODetailsOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - requestBody: Parameters.request, + requestBody: Parameters.request1, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -1304,7 +1351,7 @@ const listLinkableEnvironmentsOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - requestBody: Parameters.request1, + requestBody: Parameters.request2, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, diff --git a/sdk/dynatrace/arm-dynatrace/src/operations/singleSignOn.ts b/sdk/dynatrace/arm-dynatrace/src/operations/singleSignOn.ts index 8406ddb1e195..6bac13bb1ad2 100644 --- a/sdk/dynatrace/arm-dynatrace/src/operations/singleSignOn.ts +++ b/sdk/dynatrace/arm-dynatrace/src/operations/singleSignOn.ts @@ -13,8 +13,12 @@ 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 { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { DynatraceSingleSignOnResource, SingleSignOnListNextOptionalParams, @@ -131,8 +135,8 @@ export class SingleSignOnImpl implements SingleSignOn { resource: DynatraceSingleSignOnResource, options?: SingleSignOnCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, SingleSignOnCreateOrUpdateResponse > > { @@ -142,7 +146,7 @@ export class SingleSignOnImpl implements SingleSignOn { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -175,15 +179,24 @@ export class SingleSignOnImpl implements SingleSignOn { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, monitorName, configurationName, resource, options }, - createOrUpdateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + monitorName, + configurationName, + resource, + options + }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + SingleSignOnCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -293,7 +306,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - requestBody: Parameters.resource4, + requestBody: Parameters.resource3, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, diff --git a/sdk/dynatrace/arm-dynatrace/src/operations/tagRules.ts b/sdk/dynatrace/arm-dynatrace/src/operations/tagRules.ts index 6ba7d02ceca5..5a71402112ab 100644 --- a/sdk/dynatrace/arm-dynatrace/src/operations/tagRules.ts +++ b/sdk/dynatrace/arm-dynatrace/src/operations/tagRules.ts @@ -13,8 +13,12 @@ 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 { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { TagRule, TagRulesListNextOptionalParams, @@ -24,9 +28,6 @@ import { TagRulesGetResponse, TagRulesCreateOrUpdateOptionalParams, TagRulesCreateOrUpdateResponse, - TagRuleUpdate, - TagRulesUpdateOptionalParams, - TagRulesUpdateResponse, TagRulesDeleteOptionalParams, TagRulesListNextResponse } from "../models"; @@ -154,8 +155,8 @@ export class TagRulesImpl implements TagRules { resource: TagRule, options?: TagRulesCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, TagRulesCreateOrUpdateResponse > > { @@ -165,7 +166,7 @@ export class TagRulesImpl implements TagRules { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -198,15 +199,18 @@ export class TagRulesImpl implements TagRules { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, monitorName, ruleSetName, resource, options }, - createOrUpdateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, monitorName, ruleSetName, resource, options }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + TagRulesCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -237,27 +241,6 @@ export class TagRulesImpl implements TagRules { 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. @@ -270,14 +253,14 @@ export class TagRulesImpl implements TagRules { monitorName: string, ruleSetName: string, options?: TagRulesDeleteOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -310,15 +293,15 @@ export class TagRulesImpl implements TagRules { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, monitorName, ruleSetName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, monitorName, ruleSetName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -442,31 +425,6 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { 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}", diff --git a/sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/monitors.ts b/sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/monitors.ts index e48dbd1d1fd8..2278a6f39475 100644 --- a/sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/monitors.ts +++ b/sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/monitors.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { MonitoredResource, MonitorsListMonitoredResourcesOptionalParams, @@ -21,8 +21,6 @@ import { LinkableEnvironmentResponse, LinkableEnvironmentRequest, MonitorsListLinkableEnvironmentsOptionalParams, - MonitorsGetAccountCredentialsOptionalParams, - MonitorsGetAccountCredentialsResponse, MonitorsGetVMHostPayloadOptionalParams, MonitorsGetVMHostPayloadResponse, MonitorsGetOptionalParams, @@ -33,6 +31,11 @@ import { MonitorsUpdateOptionalParams, MonitorsUpdateResponse, MonitorsDeleteOptionalParams, + MarketplaceSaaSResourceDetailsRequest, + MonitorsGetMarketplaceSaaSResourceDetailsOptionalParams, + MonitorsGetMarketplaceSaaSResourceDetailsResponse, + MonitorsGetMetricStatusOptionalParams, + MonitorsGetMetricStatusResponse, MonitorsGetSSODetailsOptionalParams, MonitorsGetSSODetailsResponse } from "../models"; @@ -68,7 +71,7 @@ export interface Monitors { options?: MonitorsListByResourceGroupOptionalParams ): PagedAsyncIterableIterator; /** - * List the compute resources currently being monitored by the Dynatrace resource. + * List the VM/VMSS 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. @@ -102,17 +105,6 @@ export interface Monitors { 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. @@ -149,8 +141,8 @@ export interface Monitors { resource: MonitorResource, options?: MonitorsCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, MonitorsCreateOrUpdateResponse > >; @@ -190,7 +182,7 @@ export interface Monitors { resourceGroupName: string, monitorName: string, options?: MonitorsDeleteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Delete a MonitorResource * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -202,6 +194,26 @@ export interface Monitors { monitorName: string, options?: MonitorsDeleteOptionalParams ): Promise; + /** + * Get Marketplace SaaS resource details of a tenant under a specific subscription + * @param request Tenant Id + * @param options The options parameters. + */ + getMarketplaceSaaSResourceDetails( + request: MarketplaceSaaSResourceDetailsRequest, + options?: MonitorsGetMarketplaceSaaSResourceDetailsOptionalParams + ): Promise; + /** + * Get metric status + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitor resource + * @param options The options parameters. + */ + getMetricStatus( + resourceGroupName: string, + monitorName: string, + options?: MonitorsGetMetricStatusOptionalParams + ): Promise; /** * Gets the SSO configuration details from the partner. * @param resourceGroupName The name of the resource group. The name is case insensitive. diff --git a/sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/singleSignOn.ts b/sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/singleSignOn.ts index 85553edafc80..5be1e37b1856 100644 --- a/sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/singleSignOn.ts +++ b/sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/singleSignOn.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { DynatraceSingleSignOnResource, SingleSignOnListOptionalParams, @@ -46,8 +46,8 @@ export interface SingleSignOn { resource: DynatraceSingleSignOnResource, options?: SingleSignOnCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, SingleSignOnCreateOrUpdateResponse > >; diff --git a/sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/tagRules.ts b/sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/tagRules.ts index 19294950afb1..eea3841e6fd8 100644 --- a/sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/tagRules.ts +++ b/sdk/dynatrace/arm-dynatrace/src/operationsInterfaces/tagRules.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { TagRule, TagRulesListOptionalParams, @@ -15,9 +15,6 @@ import { TagRulesGetResponse, TagRulesCreateOrUpdateOptionalParams, TagRulesCreateOrUpdateResponse, - TagRuleUpdate, - TagRulesUpdateOptionalParams, - TagRulesUpdateResponse, TagRulesDeleteOptionalParams } from "../models"; @@ -63,8 +60,8 @@ export interface TagRules { resource: TagRule, options?: TagRulesCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, TagRulesCreateOrUpdateResponse > >; @@ -83,21 +80,6 @@ export interface TagRules { 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. @@ -110,7 +92,7 @@ export interface TagRules { monitorName: string, ruleSetName: string, options?: TagRulesDeleteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Delete a TagRule * @param resourceGroupName The name of the resource group. The name is case insensitive. diff --git a/sdk/dynatrace/arm-dynatrace/test/sampleTest.ts b/sdk/dynatrace/arm-dynatrace/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/dynatrace/arm-dynatrace/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/dynatrace/arm-dynatrace/tsconfig.json b/sdk/dynatrace/arm-dynatrace/tsconfig.json index 59b9e75094ee..3e6ae96443f3 100644 --- a/sdk/dynatrace/arm-dynatrace/tsconfig.json +++ b/sdk/dynatrace/arm-dynatrace/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-dynatrace": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"