From c4bcd0c67e396cb0fd718af582396b4635b07f49 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 8 Jan 2024 07:55:07 +0000 Subject: [PATCH] CodeGen from PR 3168 in test-repo-billy/azure-rest-api-specs Merge bd17a55da84491db851285461c49917f63d53fc2 into 67f4b5ff52fd6a0f6a4bfae872b3f16b31c25362 --- sdk/loadtesting/ci.yml | 4 +- .../load-testing-rest/api-extractor.json | 25 +- .../load-testing-rest/package.json | 2 +- .../review/load-testing.api.md | 1822 ++++++++--------- .../load-testing-rest/src/azureLoadTesting.ts | 27 +- .../src/clientDefinitions.ts | 470 +++-- .../src/getFileValidationPoller.ts | 160 -- .../src/getTestRunCompletionPoller.ts | 143 -- .../load-testing-rest/src/index.ts | 2 +- .../load-testing-rest/src/isUnexpected.ts | 529 ++--- .../load-testing-rest/src/logger.ts | 5 + .../load-testing-rest/src/models.ts | 425 ++-- .../load-testing-rest/src/outputModels.ts | 581 +++--- .../load-testing-rest/src/paginateHelper.ts | 33 +- .../load-testing-rest/src/parameters.ts | 319 +-- .../load-testing-rest/src/pollingHelper.ts | 40 - .../load-testing-rest/src/responses.ts | 498 ++--- .../load-testing-rest/src/util/LROUtil.ts | 52 - .../load-testing-rest/tsconfig.json | 16 +- .../load-testing-rest/tsp-location.yaml | 5 + 20 files changed, 2485 insertions(+), 2673 deletions(-) delete mode 100644 sdk/loadtesting/load-testing-rest/src/getFileValidationPoller.ts delete mode 100644 sdk/loadtesting/load-testing-rest/src/getTestRunCompletionPoller.ts create mode 100644 sdk/loadtesting/load-testing-rest/src/logger.ts delete mode 100644 sdk/loadtesting/load-testing-rest/src/pollingHelper.ts delete mode 100644 sdk/loadtesting/load-testing-rest/src/util/LROUtil.ts create mode 100644 sdk/loadtesting/load-testing-rest/tsp-location.yaml diff --git a/sdk/loadtesting/ci.yml b/sdk/loadtesting/ci.yml index f55b619c3cd5..2bb74a6c8335 100644 --- a/sdk/loadtesting/ci.yml +++ b/sdk/loadtesting/ci.yml @@ -1,5 +1,5 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - + trigger: branches: include: @@ -19,6 +19,8 @@ pr: - feature/* - release/* - hotfix/* + exclude: + - feature/v4 paths: include: - sdk/loadtesting/ diff --git a/sdk/loadtesting/load-testing-rest/api-extractor.json b/sdk/loadtesting/load-testing-rest/api-extractor.json index 2f752668f341..33ad9ba8da5c 100644 --- a/sdk/loadtesting/load-testing-rest/api-extractor.json +++ b/sdk/loadtesting/load-testing-rest/api-extractor.json @@ -1,18 +1,31 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", "mainEntryPointFilePath": "./types/src/index.d.ts", - "docModel": { "enabled": true }, - "apiReport": { "enabled": true, "reportFolder": "./review" }, + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, "dtsRollup": { "enabled": true, "untrimmedFilePath": "", "publicTrimmedFilePath": "./types/load-testing.d.ts" }, "messages": { - "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, "extractorMessageReporting": { - "ae-missing-release-tag": { "logLevel": "none" }, - "ae-unresolved-link": { "logLevel": "none" } + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } } } -} +} \ No newline at end of file diff --git a/sdk/loadtesting/load-testing-rest/package.json b/sdk/loadtesting/load-testing-rest/package.json index 9c896a80b0b6..5da973e058c5 100644 --- a/sdk/loadtesting/load-testing-rest/package.json +++ b/sdk/loadtesting/load-testing-rest/package.json @@ -134,4 +134,4 @@ "browser": { "./dist-esm/test/public/utils/env.js": "./dist-esm/test/public/utils/env.browser.js" } -} +} \ No newline at end of file diff --git a/sdk/loadtesting/load-testing-rest/review/load-testing.api.md b/sdk/loadtesting/load-testing-rest/review/load-testing.api.md index 9d3dab82be1a..bc431cdab932 100644 --- a/sdk/loadtesting/load-testing-rest/review/load-testing.api.md +++ b/sdk/loadtesting/load-testing-rest/review/load-testing.api.md @@ -8,13 +8,13 @@ import { Client } from '@azure-rest/core-client'; import { ClientOptions } from '@azure-rest/core-client'; +import { ErrorResponse } from '@azure-rest/core-client'; import { HttpResponse } from '@azure-rest/core-client'; -import { OperationState } from '@azure/core-lro'; +import { Paged } from '@azure/core-paging'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; import { PathUncheckedResponse } from '@azure-rest/core-client'; import { RawHttpHeaders } from '@azure/core-rest-pipeline'; import { RequestParameters } from '@azure-rest/core-client'; -import { SimplePollerLike } from '@azure/core-lro'; import { StreamableMethod } from '@azure-rest/core-client'; import { TokenCredential } from '@azure/core-auth'; @@ -22,22 +22,45 @@ import { TokenCredential } from '@azure/core-auth'; export interface AppComponent { displayName?: string; kind?: string; - resourceGroup?: string; - resourceId?: string; - resourceName?: string; - resourceType?: string; - subscriptionId?: string; + resourceName: string; + resourceType: string; } // @public export interface AppComponentOutput { displayName?: string; kind?: string; - resourceGroup?: string; - resourceId?: string; - resourceName?: string; - resourceType?: string; - subscriptionId?: string; + readonly resourceGroup?: string; + readonly resourceId: string; + resourceName: string; + resourceType: string; + readonly subscriptionId?: string; +} + +// @public +export interface ArtifactsContainerInfo { + expireDateTime?: Date | string; + url?: string; +} + +// @public +export interface ArtifactsContainerInfoOutput { + expireDateTime?: string; + url?: string; +} + +// @public +export interface AutoStopCriteria { + autoStopDisabled?: boolean; + errorRate?: number; + errorRateTimeWindowInSeconds?: number; +} + +// @public +export interface AutoStopCriteriaOutput { + autoStopDisabled?: boolean; + errorRate?: number; + errorRateTimeWindowInSeconds?: number; } // @public (undocumented) @@ -48,31 +71,32 @@ export type AzureLoadTestingClient = Client & { // @public export interface CertificateMetadata { name?: string; - type?: "AKV_CERT_URI"; + type?: string; value?: string; } // @public export interface CertificateMetadataOutput { name?: string; - type?: "AKV_CERT_URI"; + type?: string; value?: string; } // @public -function createClient(Endpoint: string, credentials: TokenCredential, options?: ClientOptions): AzureLoadTestingClient; +function createClient(endpoint: string, credentials: TokenCredential, options?: ClientOptions): AzureLoadTestingClient; export default createClient; // @public export interface DimensionFilter { name?: string; - values?: Array; + values?: string[]; } // @public export interface DimensionValueListOutput { + readonly name?: string; nextLink?: string; - value?: Array; + value?: string[]; } // @public @@ -83,65 +107,16 @@ export interface DimensionValueOutput { // @public export interface ErrorDetails { - message?: string; } // @public export interface ErrorDetailsOutput { - message?: string; -} - -// @public -export interface ErrorModelOutput { - code: string; - details?: Array; - message: string; - target?: string; -} - -// @public -export interface ErrorResponseBodyOutput { - error: ErrorModelOutput; -} - -// @public -export interface FileInfo { - expireDateTime?: Date | string; - fileName?: string; - fileType?: "JMX_FILE" | "USER_PROPERTIES" | "ADDITIONAL_ARTIFACTS"; - url?: string; - validationFailureDetails?: string; - validationStatus?: "NOT_VALIDATED" | "VALIDATION_SUCCESS" | "VALIDATION_FAILURE" | "VALIDATION_INITIATED" | "VALIDATION_NOT_REQUIRED"; -} - -// @public -export interface FileInfoListOutput { - nextLink?: string; - value: Array; -} - -// @public -export interface FileInfoOutput { - expireDateTime?: string; - fileName?: string; - fileType?: "JMX_FILE" | "USER_PROPERTIES" | "ADDITIONAL_ARTIFACTS"; - url?: string; - validationFailureDetails?: string; - validationStatus?: "NOT_VALIDATED" | "VALIDATION_SUCCESS" | "VALIDATION_FAILURE" | "VALIDATION_INITIATED" | "VALIDATION_NOT_REQUIRED"; + readonly message?: string; } -// @public -export type FileUploadAndValidatePoller = SimplePollerLike, TestGetFile200Response>; - // @public export type GetArrayType = T extends Array ? TData : never; -// @public (undocumented) -export function getLongRunningPoller(client: AzureLoadTestingClient, initialResponse: TestUploadFileSuccessResponse): Promise; - -// @public (undocumented) -export function getLongRunningPoller(client: AzureLoadTestingClient, initialResponse: TestRunCreateOrUpdateSuccessResponse): Promise; - // @public export type GetPage = (pageLink: string, maxPageSize?: number) => Promise<{ page: TPage; @@ -149,526 +124,336 @@ export type GetPage = (pageLink: string, maxPageSize?: number) => Promise }>; // @public (undocumented) -export function isUnexpected(response: TestCreateOrUpdate200Response | TestCreateOrUpdate201Response | TestCreateOrUpdateDefaultResponse): response is TestCreateOrUpdateDefaultResponse; +export function isUnexpected(response: LoadTestAdministrationCreateOrUpdateTest200Response | LoadTestAdministrationCreateOrUpdateTest201Response | LoadTestAdministrationCreateOrUpdateTestDefaultResponse): response is LoadTestAdministrationCreateOrUpdateTestDefaultResponse; // @public (undocumented) -export function isUnexpected(response: TestDelete204Response | TestDeleteDefaultResponse): response is TestDeleteDefaultResponse; +export function isUnexpected(response: LoadTestAdministrationDeleteTest204Response | LoadTestAdministrationDeleteTestDefaultResponse): response is LoadTestAdministrationDeleteTestDefaultResponse; // @public (undocumented) -export function isUnexpected(response: TestGet200Response | TestGetDefaultResponse): response is TestGetDefaultResponse; +export function isUnexpected(response: LoadTestAdministrationGetTest200Response | LoadTestAdministrationGetTestDefaultResponse): response is LoadTestAdministrationGetTestDefaultResponse; // @public (undocumented) -export function isUnexpected(response: TestList200Response | TestListDefaultResponse): response is TestListDefaultResponse; +export function isUnexpected(response: LoadTestAdministrationListTests200Response | LoadTestAdministrationListTestsDefaultResponse): response is LoadTestAdministrationListTestsDefaultResponse; // @public (undocumented) -export function isUnexpected(response: TestUploadFile201Response | TestUploadFileDefaultResponse): response is TestUploadFileDefaultResponse; +export function isUnexpected(response: LoadTestAdministrationUploadTestFile201Response | LoadTestAdministrationUploadTestFileDefaultResponse): response is LoadTestAdministrationUploadTestFileDefaultResponse; // @public (undocumented) -export function isUnexpected(response: TestGetFile200Response | TestGetFileDefaultResponse): response is TestGetFileDefaultResponse; +export function isUnexpected(response: LoadTestAdministrationGetTestFile200Response | LoadTestAdministrationGetTestFileDefaultResponse): response is LoadTestAdministrationGetTestFileDefaultResponse; // @public (undocumented) -export function isUnexpected(response: TestDeleteFile204Response | TestDeleteFileDefaultResponse): response is TestDeleteFileDefaultResponse; +export function isUnexpected(response: LoadTestAdministrationDeleteTestFile204Response | LoadTestAdministrationDeleteTestFileDefaultResponse): response is LoadTestAdministrationDeleteTestFileDefaultResponse; // @public (undocumented) -export function isUnexpected(response: TestListFiles200Response | TestListFilesDefaultResponse): response is TestListFilesDefaultResponse; +export function isUnexpected(response: LoadTestAdministrationListTestFiles200Response | LoadTestAdministrationListTestFilesDefaultResponse): response is LoadTestAdministrationListTestFilesDefaultResponse; // @public (undocumented) -export function isUnexpected(response: TestCreateOrUpdateAppComponents200Response | TestCreateOrUpdateAppComponents201Response | TestCreateOrUpdateAppComponentsDefaultResponse): response is TestCreateOrUpdateAppComponentsDefaultResponse; +export function isUnexpected(response: LoadTestAdministrationCreateOrUpdateAppComponents200Response | LoadTestAdministrationCreateOrUpdateAppComponents201Response | LoadTestAdministrationCreateOrUpdateAppComponentsDefaultResponse): response is LoadTestAdministrationCreateOrUpdateAppComponentsDefaultResponse; // @public (undocumented) -export function isUnexpected(response: TestListAppComponents200Response | TestListAppComponentsDefaultResponse): response is TestListAppComponentsDefaultResponse; +export function isUnexpected(response: LoadTestAdministrationGetAppComponents200Response | LoadTestAdministrationGetAppComponentsDefaultResponse): response is LoadTestAdministrationGetAppComponentsDefaultResponse; // @public (undocumented) -export function isUnexpected(response: TestCreateOrUpdateServerMetricsConfig200Response | TestCreateOrUpdateServerMetricsConfig201Response | TestCreateOrUpdateServerMetricsConfigDefaultResponse): response is TestCreateOrUpdateServerMetricsConfigDefaultResponse; +export function isUnexpected(response: LoadTestAdministrationCreateOrUpdateServerMetricsConfig200Response | LoadTestAdministrationCreateOrUpdateServerMetricsConfig201Response | LoadTestAdministrationCreateOrUpdateServerMetricsConfigDefaultResponse): response is LoadTestAdministrationCreateOrUpdateServerMetricsConfigDefaultResponse; // @public (undocumented) -export function isUnexpected(response: TestListServerMetricsConfig200Response | TestListServerMetricsConfigDefaultResponse): response is TestListServerMetricsConfigDefaultResponse; +export function isUnexpected(response: LoadTestAdministrationGetServerMetricsConfig200Response | LoadTestAdministrationGetServerMetricsConfigDefaultResponse): response is LoadTestAdministrationGetServerMetricsConfigDefaultResponse; // @public (undocumented) -export function isUnexpected(response: TestRunDelete204Response | TestRunDeleteDefaultResponse): response is TestRunDeleteDefaultResponse; +export function isUnexpected(response: LoadTestRunGetTestRun200Response | LoadTestRunGetTestRunDefaultResponse): response is LoadTestRunGetTestRunDefaultResponse; // @public (undocumented) -export function isUnexpected(response: TestRunCreateOrUpdate200Response | TestRunCreateOrUpdate201Response | TestRunCreateOrUpdateDefaultResponse): response is TestRunCreateOrUpdateDefaultResponse; +export function isUnexpected(response: LoadTestRunCreateOrUpdateTestRun200Response | LoadTestRunCreateOrUpdateTestRun201Response | LoadTestRunCreateOrUpdateTestRunDefaultResponse): response is LoadTestRunCreateOrUpdateTestRunDefaultResponse; // @public (undocumented) -export function isUnexpected(response: TestRunGet200Response | TestRunGetDefaultResponse): response is TestRunGetDefaultResponse; +export function isUnexpected(response: LoadTestRunDeleteTestRun204Response | LoadTestRunDeleteTestRunDefaultResponse): response is LoadTestRunDeleteTestRunDefaultResponse; // @public (undocumented) -export function isUnexpected(response: TestRunGetFile200Response | TestRunGetFileDefaultResponse): response is TestRunGetFileDefaultResponse; +export function isUnexpected(response: LoadTestRunListTestRuns200Response | LoadTestRunListTestRunsDefaultResponse): response is LoadTestRunListTestRunsDefaultResponse; // @public (undocumented) -export function isUnexpected(response: TestRunList200Response | TestRunListDefaultResponse): response is TestRunListDefaultResponse; +export function isUnexpected(response: LoadTestRunGetTestRunFile200Response | LoadTestRunGetTestRunFileDefaultResponse): response is LoadTestRunGetTestRunFileDefaultResponse; // @public (undocumented) -export function isUnexpected(response: TestRunStop200Response | TestRunStopDefaultResponse): response is TestRunStopDefaultResponse; +export function isUnexpected(response: LoadTestRunStop200Response | LoadTestRunStopDefaultResponse): response is LoadTestRunStopDefaultResponse; // @public (undocumented) -export function isUnexpected(response: TestRunListMetricNamespaces200Response | TestRunListMetricNamespacesDefaultResponse): response is TestRunListMetricNamespacesDefaultResponse; +export function isUnexpected(response: LoadTestRunListMetricNamespaces200Response | LoadTestRunListMetricNamespacesDefaultResponse): response is LoadTestRunListMetricNamespacesDefaultResponse; // @public (undocumented) -export function isUnexpected(response: TestRunListMetricDefinitions200Response | TestRunListMetricDefinitionsDefaultResponse): response is TestRunListMetricDefinitionsDefaultResponse; +export function isUnexpected(response: LoadTestRunListMetricDefinitions200Response | LoadTestRunListMetricDefinitionsDefaultResponse): response is LoadTestRunListMetricDefinitionsDefaultResponse; // @public (undocumented) -export function isUnexpected(response: TestRunListMetrics200Response | TestRunListMetricsDefaultResponse): response is TestRunListMetricsDefaultResponse; +export function isUnexpected(response: LoadTestRunListMetrics200Response | LoadTestRunListMetricsDefaultResponse): response is LoadTestRunListMetricsDefaultResponse; // @public (undocumented) -export function isUnexpected(response: TestRunListMetricDimensionValues200Response | TestRunListMetricDimensionValuesDefaultResponse): response is TestRunListMetricDimensionValuesDefaultResponse; +export function isUnexpected(response: LoadTestRunListMetricDimensionValues200Response | LoadTestRunListMetricDimensionValuesDefaultResponse): response is LoadTestRunListMetricDimensionValuesDefaultResponse; // @public (undocumented) -export function isUnexpected(response: TestRunCreateOrUpdateAppComponents200Response | TestRunCreateOrUpdateAppComponents201Response | TestRunCreateOrUpdateAppComponentsDefaultResponse): response is TestRunCreateOrUpdateAppComponentsDefaultResponse; +export function isUnexpected(response: LoadTestRunCreateOrUpdateAppComponents200Response | LoadTestRunCreateOrUpdateAppComponents201Response | LoadTestRunCreateOrUpdateAppComponentsDefaultResponse): response is LoadTestRunCreateOrUpdateAppComponentsDefaultResponse; // @public (undocumented) -export function isUnexpected(response: TestRunListAppComponents200Response | TestRunListAppComponentsDefaultResponse): response is TestRunListAppComponentsDefaultResponse; +export function isUnexpected(response: LoadTestRunGetAppComponents200Response | LoadTestRunGetAppComponentsDefaultResponse): response is LoadTestRunGetAppComponentsDefaultResponse; // @public (undocumented) -export function isUnexpected(response: TestRunCreateOrUpdateServerMetricsConfig200Response | TestRunCreateOrUpdateServerMetricsConfig201Response | TestRunCreateOrUpdateServerMetricsConfigDefaultResponse): response is TestRunCreateOrUpdateServerMetricsConfigDefaultResponse; +export function isUnexpected(response: LoadTestRunCreateOrUpdateServerMetricsConfig200Response | LoadTestRunCreateOrUpdateServerMetricsConfig201Response | LoadTestRunCreateOrUpdateServerMetricsConfigDefaultResponse): response is LoadTestRunCreateOrUpdateServerMetricsConfigDefaultResponse; // @public (undocumented) -export function isUnexpected(response: TestRunListServerMetricsConfig200Response | TestRunListServerMetricsConfigDefaultResponse): response is TestRunListServerMetricsConfigDefaultResponse; - -// @public -export interface LoadTestConfiguration { - engineInstances?: number; - optionalLoadTestConfig?: OptionalLoadTestConfig; - quickStartTest?: boolean; - splitAllCSVs?: boolean; -} - -// @public -export interface LoadTestConfigurationOutput { - engineInstances?: number; - optionalLoadTestConfig?: OptionalLoadTestConfigOutput; - quickStartTest?: boolean; - splitAllCSVs?: boolean; -} - -// @public -export interface MetricAvailabilityOutput { - timeGrain?: "PT5S" | "PT10S" | "PT1M" | "PT5M" | "PT1H"; -} - -// @public -export interface MetricDefinitionCollectionOutput { - value: Array; -} - -// @public -export interface MetricDefinitionOutput { - description?: string; - dimensions?: Array; - metricAvailabilities?: Array; - name?: string; - namespace?: string; - primaryAggregationType?: "Average" | "Count" | "None" | "Total" | "Percentile90" | "Percentile95" | "Percentile99"; - supportedAggregationTypes?: Array; - unit?: "NotSpecified" | "Percent" | "Count" | "Seconds" | "Milliseconds" | "Bytes" | "BytesPerSecond" | "CountPerSecond"; -} - -// @public -export interface MetricNamespaceCollectionOutput { - value: Array; -} - -// @public -export interface MetricNamespaceOutput { - description?: string; - name?: string; -} - -// @public -export interface MetricRequestPayload { - filters?: Array; -} - -// @public -export interface MetricsOutput { - nextLink?: string; - timeseries?: Array; -} - -// @public -export interface MetricValueOutput { - timestamp?: string; - value?: number; -} - -// @public -export interface NameAndDescOutput { - description?: string; - name?: string; -} - -// @public -export interface OptionalLoadTestConfig { - duration?: number; - endpointUrl?: string; - rampUpTime?: number; - virtualUsers?: number; -} - -// @public -export interface OptionalLoadTestConfigOutput { - duration?: number; - endpointUrl?: string; - rampUpTime?: number; - virtualUsers?: number; -} - -// @public -export function paginate(client: Client, initialResponse: TResponse, options?: PagingOptions): PagedAsyncIterableIterator>; - -// @public -export type PaginateReturn = TResult extends { - body: { - value?: infer TPage; - }; -} ? GetArrayType : Array; - -// @public -export interface PagingOptions { - customGetPage?: GetPage[]>; -} - -// @public -export interface PassFailCriteria { - passFailMetrics?: Record; -} +export function isUnexpected(response: LoadTestRunGetServerMetricsConfig200Response | LoadTestRunGetServerMetricsConfigDefaultResponse): response is LoadTestRunGetServerMetricsConfigDefaultResponse; -// @public -export interface PassFailCriteriaOutput { - passFailMetrics?: Record; +// @public (undocumented) +export interface LoadTestAdministrationCreateOrUpdateAppComponents { + get(options?: LoadTestAdministrationGetAppComponentsParameters): StreamableMethod; + patch(options: LoadTestAdministrationCreateOrUpdateAppComponentsParameters): StreamableMethod; } // @public -export interface PassFailMetric { - action?: "stop" | "continue"; - actualValue?: number; - aggregate?: "count" | "percentage" | "avg" | "p50" | "p90" | "p95" | "p99" | "min" | "max"; - clientMetric?: "response_time_ms" | "latency" | "error" | "requests" | "requests_per_sec"; - condition?: string; - requestName?: string; - result?: "passed" | "undetermined" | "failed"; - value?: number; +export interface LoadTestAdministrationCreateOrUpdateAppComponents200Response extends HttpResponse { + // (undocumented) + body: TestAppComponentsOutput; + // (undocumented) + status: "200"; } // @public -export interface PassFailMetricOutput { - action?: "stop" | "continue"; - actualValue?: number; - aggregate?: "count" | "percentage" | "avg" | "p50" | "p90" | "p95" | "p99" | "min" | "max"; - clientMetric?: "response_time_ms" | "latency" | "error" | "requests" | "requests_per_sec"; - condition?: string; - requestName?: string; - result?: "passed" | "undetermined" | "failed"; - value?: number; +export interface LoadTestAdministrationCreateOrUpdateAppComponents201Response extends HttpResponse { + // (undocumented) + body: TestAppComponentsOutput; + // (undocumented) + status: "201"; } // @public (undocumented) -export interface PolledOperationOptions { - updateIntervalInMs?: number; +export interface LoadTestAdministrationCreateOrUpdateAppComponentsBodyParam { + body: TestAppComponentsResourceMergeAndPatch; } -// @public -export interface ResourceMetric { - aggregation: string; - displayDescription?: string; - id?: string; - metricNamespace: string; - name: string; - resourceId: string; - resourceType: string; - unit?: string; +// @public (undocumented) +export interface LoadTestAdministrationCreateOrUpdateAppComponentsDefaultHeaders { + "x-ms-error-code"?: string; } -// @public -export interface ResourceMetricOutput { - aggregation: string; - displayDescription?: string; - id?: string; - metricNamespace: string; - name: string; - resourceId: string; - resourceType: string; - unit?: string; +// @public (undocumented) +export interface LoadTestAdministrationCreateOrUpdateAppComponentsDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & LoadTestAdministrationCreateOrUpdateAppComponentsDefaultHeaders; + // (undocumented) + status: string; } // @public (undocumented) -export interface Routes { - (path: "/tests/{testId}", testId: string): TestCreateOrUpdate; - (path: "/tests"): TestList; - (path: "/tests/{testId}/files/{fileName}", testId: string, fileName: string): TestUploadFile; - (path: "/tests/{testId}/files", testId: string): TestListFiles; - (path: "/tests/{testId}/app-components", testId: string): TestCreateOrUpdateAppComponents; - (path: "/tests/{testId}/server-metrics-config", testId: string): TestCreateOrUpdateServerMetricsConfig; - (path: "/test-runs/{testRunId}", testRunId: string): TestRunDelete; - (path: "/test-runs/{testRunId}/files/{fileName}", testRunId: string, fileName: string): TestRunGetFile; - (path: "/test-runs"): TestRunList; - (path: "/test-runs/{testRunId}:stop", testRunId: string): TestRunStop; - (path: "/test-runs/{testRunId}/metric-namespaces", testRunId: string): TestRunListMetricNamespaces; - (path: "/test-runs/{testRunId}/metric-definitions", testRunId: string): TestRunListMetricDefinitions; - (path: "/test-runs/{testRunId}/metrics", testRunId: string): TestRunListMetrics; - (path: "/test-runs/{testRunId}/metric-dimensions/{name}/values", testRunId: string, name: string): TestRunListMetricDimensionValues; - (path: "/test-runs/{testRunId}/app-components", testRunId: string): TestRunCreateOrUpdateAppComponents; - (path: "/test-runs/{testRunId}/server-metrics-config", testRunId: string): TestRunCreateOrUpdateServerMetricsConfig; +export interface LoadTestAdministrationCreateOrUpdateAppComponentsMediaTypesParam { + contentType: "application/merge-patch+json"; } -// @public -export interface Secret { - type?: "AKV_SECRET_URI" | "SECRET_VALUE"; - value?: string; -} +// @public (undocumented) +export type LoadTestAdministrationCreateOrUpdateAppComponentsParameters = LoadTestAdministrationCreateOrUpdateAppComponentsMediaTypesParam & LoadTestAdministrationCreateOrUpdateAppComponentsBodyParam & RequestParameters; -// @public -export interface SecretOutput { - type?: "AKV_SECRET_URI" | "SECRET_VALUE"; - value?: string; +// @public (undocumented) +export interface LoadTestAdministrationCreateOrUpdateServerMetricsConfig { + get(options?: LoadTestAdministrationGetServerMetricsConfigParameters): StreamableMethod; + patch(options: LoadTestAdministrationCreateOrUpdateServerMetricsConfigParameters): StreamableMethod; } // @public -export interface Test { - certificate?: CertificateMetadata; - createdBy?: string; - createdDateTime?: Date | string; - description?: string; - displayName?: string; - environmentVariables?: Record; - inputArtifacts?: TestInputArtifacts; - keyvaultReferenceIdentityId?: string; - keyvaultReferenceIdentityType?: string; - lastModifiedBy?: string; - lastModifiedDateTime?: Date | string; - loadTestConfiguration?: LoadTestConfiguration; - passFailCriteria?: PassFailCriteria; - secrets?: Record; - subnetId?: string; - testId?: string; +export interface LoadTestAdministrationCreateOrUpdateServerMetricsConfig200Response extends HttpResponse { + // (undocumented) + body: TestServerMetricConfigOutput; + // (undocumented) + status: "200"; } // @public -export interface TestAppComponents { - components: Record; - createdBy?: string; - createdDateTime?: Date | string; - lastModifiedBy?: string; - lastModifiedDateTime?: Date | string; - testId?: string; +export interface LoadTestAdministrationCreateOrUpdateServerMetricsConfig201Response extends HttpResponse { + // (undocumented) + body: TestServerMetricConfigOutput; + // (undocumented) + status: "201"; } -// @public -export interface TestAppComponentsOutput { - components: Record; - createdBy?: string; - createdDateTime?: string; - lastModifiedBy?: string; - lastModifiedDateTime?: string; - testId?: string; +// @public (undocumented) +export interface LoadTestAdministrationCreateOrUpdateServerMetricsConfigBodyParam { + body: TestServerMetricConfigResourceMergeAndPatch; } // @public (undocumented) -export interface TestCreateOrUpdate { - delete(options?: TestDeleteParameters): StreamableMethod; - get(options?: TestGetParameters): StreamableMethod; - patch(options: TestCreateOrUpdateParameters): StreamableMethod; +export interface LoadTestAdministrationCreateOrUpdateServerMetricsConfigDefaultHeaders { + "x-ms-error-code"?: string; } -// @public -export interface TestCreateOrUpdate200Response extends HttpResponse { +// @public (undocumented) +export interface LoadTestAdministrationCreateOrUpdateServerMetricsConfigDefaultResponse extends HttpResponse { // (undocumented) - body: TestOutput; + body: ErrorResponse; // (undocumented) - status: "200"; + headers: RawHttpHeaders & LoadTestAdministrationCreateOrUpdateServerMetricsConfigDefaultHeaders; + // (undocumented) + status: string; } -// @public -export interface TestCreateOrUpdate201Response extends HttpResponse { - // (undocumented) - body: TestOutput; - // (undocumented) - status: "201"; +// @public (undocumented) +export interface LoadTestAdministrationCreateOrUpdateServerMetricsConfigMediaTypesParam { + contentType: "application/merge-patch+json"; } // @public (undocumented) -export interface TestCreateOrUpdateAppComponents { - get(options?: TestListAppComponentsParameters): StreamableMethod; - patch(options: TestCreateOrUpdateAppComponentsParameters): StreamableMethod; +export type LoadTestAdministrationCreateOrUpdateServerMetricsConfigParameters = LoadTestAdministrationCreateOrUpdateServerMetricsConfigMediaTypesParam & LoadTestAdministrationCreateOrUpdateServerMetricsConfigBodyParam & RequestParameters; + +// @public (undocumented) +export interface LoadTestAdministrationCreateOrUpdateTest { + delete(options?: LoadTestAdministrationDeleteTestParameters): StreamableMethod; + get(options?: LoadTestAdministrationGetTestParameters): StreamableMethod; + patch(options: LoadTestAdministrationCreateOrUpdateTestParameters): StreamableMethod; } // @public -export interface TestCreateOrUpdateAppComponents200Response extends HttpResponse { +export interface LoadTestAdministrationCreateOrUpdateTest200Response extends HttpResponse { // (undocumented) - body: TestAppComponentsOutput; + body: TestOutput; // (undocumented) status: "200"; } // @public -export interface TestCreateOrUpdateAppComponents201Response extends HttpResponse { +export interface LoadTestAdministrationCreateOrUpdateTest201Response extends HttpResponse { // (undocumented) - body: TestAppComponentsOutput; + body: TestOutput; // (undocumented) status: "201"; } // @public (undocumented) -export interface TestCreateOrUpdateAppComponentsBodyParam { - body: TestAppComponents; +export interface LoadTestAdministrationCreateOrUpdateTestBodyParam { + body: TestResourceMergeAndPatch; } // @public (undocumented) -export interface TestCreateOrUpdateAppComponentsDefaultHeaders { +export interface LoadTestAdministrationCreateOrUpdateTestDefaultHeaders { "x-ms-error-code"?: string; } -// @public -export interface TestCreateOrUpdateAppComponentsDefaultResponse extends HttpResponse { +// @public (undocumented) +export interface LoadTestAdministrationCreateOrUpdateTestDefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponseBodyOutput; + body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & TestCreateOrUpdateAppComponentsDefaultHeaders; + headers: RawHttpHeaders & LoadTestAdministrationCreateOrUpdateTestDefaultHeaders; // (undocumented) status: string; } // @public (undocumented) -export interface TestCreateOrUpdateAppComponentsMediaTypesParam { - contentType?: "application/merge-patch+json"; +export interface LoadTestAdministrationCreateOrUpdateTestMediaTypesParam { + contentType: "application/merge-patch+json"; } // @public (undocumented) -export type TestCreateOrUpdateAppComponentsParameters = TestCreateOrUpdateAppComponentsMediaTypesParam & TestCreateOrUpdateAppComponentsBodyParam & RequestParameters; +export type LoadTestAdministrationCreateOrUpdateTestParameters = LoadTestAdministrationCreateOrUpdateTestMediaTypesParam & LoadTestAdministrationCreateOrUpdateTestBodyParam & RequestParameters; -// @public (undocumented) -export interface TestCreateOrUpdateBodyParam { - body: Test; +// @public +export interface LoadTestAdministrationDeleteTest204Response extends HttpResponse { + // (undocumented) + status: "204"; } // @public (undocumented) -export interface TestCreateOrUpdateDefaultHeaders { +export interface LoadTestAdministrationDeleteTestDefaultHeaders { "x-ms-error-code"?: string; } -// @public -export interface TestCreateOrUpdateDefaultResponse extends HttpResponse { +// @public (undocumented) +export interface LoadTestAdministrationDeleteTestDefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponseBodyOutput; + body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & TestCreateOrUpdateDefaultHeaders; + headers: RawHttpHeaders & LoadTestAdministrationDeleteTestDefaultHeaders; // (undocumented) status: string; } -// @public (undocumented) -export interface TestCreateOrUpdateMediaTypesParam { - contentType?: "application/merge-patch+json"; -} - -// @public (undocumented) -export type TestCreateOrUpdateParameters = TestCreateOrUpdateMediaTypesParam & TestCreateOrUpdateBodyParam & RequestParameters; - -// @public (undocumented) -export interface TestCreateOrUpdateServerMetricsConfig { - get(options?: TestListServerMetricsConfigParameters): StreamableMethod; - patch(options: TestCreateOrUpdateServerMetricsConfigParameters): StreamableMethod; -} - // @public -export interface TestCreateOrUpdateServerMetricsConfig200Response extends HttpResponse { - // (undocumented) - body: TestServerMetricConfigOutput; - // (undocumented) - status: "200"; -} - -// @public -export interface TestCreateOrUpdateServerMetricsConfig201Response extends HttpResponse { - // (undocumented) - body: TestServerMetricConfigOutput; +export interface LoadTestAdministrationDeleteTestFile204Response extends HttpResponse { // (undocumented) - status: "201"; -} - -// @public (undocumented) -export interface TestCreateOrUpdateServerMetricsConfigBodyParam { - body: TestServerMetricConfig; + status: "204"; } // @public (undocumented) -export interface TestCreateOrUpdateServerMetricsConfigDefaultHeaders { +export interface LoadTestAdministrationDeleteTestFileDefaultHeaders { "x-ms-error-code"?: string; } -// @public -export interface TestCreateOrUpdateServerMetricsConfigDefaultResponse extends HttpResponse { +// @public (undocumented) +export interface LoadTestAdministrationDeleteTestFileDefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponseBodyOutput; + body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & TestCreateOrUpdateServerMetricsConfigDefaultHeaders; + headers: RawHttpHeaders & LoadTestAdministrationDeleteTestFileDefaultHeaders; // (undocumented) status: string; } // @public (undocumented) -export interface TestCreateOrUpdateServerMetricsConfigMediaTypesParam { - contentType?: "application/merge-patch+json"; -} +export type LoadTestAdministrationDeleteTestFileParameters = RequestParameters; // @public (undocumented) -export type TestCreateOrUpdateServerMetricsConfigParameters = TestCreateOrUpdateServerMetricsConfigMediaTypesParam & TestCreateOrUpdateServerMetricsConfigBodyParam & RequestParameters; +export type LoadTestAdministrationDeleteTestParameters = RequestParameters; // @public -export interface TestDelete204Response extends HttpResponse { +export interface LoadTestAdministrationGetAppComponents200Response extends HttpResponse { // (undocumented) - body: Record; + body: TestAppComponentsOutput; // (undocumented) - status: "204"; + status: "200"; } // @public (undocumented) -export interface TestDeleteDefaultHeaders { +export interface LoadTestAdministrationGetAppComponentsDefaultHeaders { "x-ms-error-code"?: string; } -// @public -export interface TestDeleteDefaultResponse extends HttpResponse { +// @public (undocumented) +export interface LoadTestAdministrationGetAppComponentsDefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponseBodyOutput; + body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & TestDeleteDefaultHeaders; + headers: RawHttpHeaders & LoadTestAdministrationGetAppComponentsDefaultHeaders; // (undocumented) status: string; } +// @public (undocumented) +export type LoadTestAdministrationGetAppComponentsParameters = RequestParameters; + // @public -export interface TestDeleteFile204Response extends HttpResponse { +export interface LoadTestAdministrationGetServerMetricsConfig200Response extends HttpResponse { // (undocumented) - body: Record; + body: TestServerMetricConfigOutput; // (undocumented) - status: "204"; + status: "200"; } // @public (undocumented) -export interface TestDeleteFileDefaultHeaders { +export interface LoadTestAdministrationGetServerMetricsConfigDefaultHeaders { "x-ms-error-code"?: string; } -// @public -export interface TestDeleteFileDefaultResponse extends HttpResponse { +// @public (undocumented) +export interface LoadTestAdministrationGetServerMetricsConfigDefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponseBodyOutput; + body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & TestDeleteFileDefaultHeaders; + headers: RawHttpHeaders & LoadTestAdministrationGetServerMetricsConfigDefaultHeaders; // (undocumented) status: string; } // @public (undocumented) -export type TestDeleteFileParameters = RequestParameters; - -// @public (undocumented) -export type TestDeleteParameters = RequestParameters; +export type LoadTestAdministrationGetServerMetricsConfigParameters = RequestParameters; // @public -export interface TestGet200Response extends HttpResponse { +export interface LoadTestAdministrationGetTest200Response extends HttpResponse { // (undocumented) body: TestOutput; // (undocumented) @@ -676,175 +461,119 @@ export interface TestGet200Response extends HttpResponse { } // @public (undocumented) -export interface TestGetDefaultHeaders { +export interface LoadTestAdministrationGetTestDefaultHeaders { "x-ms-error-code"?: string; } -// @public -export interface TestGetDefaultResponse extends HttpResponse { +// @public (undocumented) +export interface LoadTestAdministrationGetTestDefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponseBodyOutput; + body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & TestGetDefaultHeaders; + headers: RawHttpHeaders & LoadTestAdministrationGetTestDefaultHeaders; // (undocumented) status: string; } // @public -export interface TestGetFile200Response extends HttpResponse { +export interface LoadTestAdministrationGetTestFile200Response extends HttpResponse { // (undocumented) - body: FileInfoOutput; + body: TestFileInfoOutput; // (undocumented) status: "200"; } // @public (undocumented) -export interface TestGetFileDefaultHeaders { +export interface LoadTestAdministrationGetTestFileDefaultHeaders { "x-ms-error-code"?: string; } -// @public -export interface TestGetFileDefaultResponse extends HttpResponse { +// @public (undocumented) +export interface LoadTestAdministrationGetTestFileDefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponseBodyOutput; + body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & TestGetFileDefaultHeaders; + headers: RawHttpHeaders & LoadTestAdministrationGetTestFileDefaultHeaders; // (undocumented) status: string; } // @public (undocumented) -export type TestGetFileParameters = RequestParameters; +export type LoadTestAdministrationGetTestFileParameters = RequestParameters; // @public (undocumented) -export type TestGetParameters = RequestParameters; - -// @public -export interface TestInputArtifacts { - additionalFileInfo?: Array; - configFileInfo?: FileInfo; - inputArtifactsZipFileInfo?: FileInfo; - testScriptFileInfo?: FileInfo; - userPropFileInfo?: FileInfo; -} - -// @public -export interface TestInputArtifactsOutput { - additionalFileInfo?: Array; - configFileInfo?: FileInfoOutput; - inputArtifactsZipFileInfo?: FileInfoOutput; - testScriptFileInfo?: FileInfoOutput; - userPropFileInfo?: FileInfoOutput; -} +export type LoadTestAdministrationGetTestParameters = RequestParameters; // @public (undocumented) -export interface TestList { - get(options?: TestListParameters): StreamableMethod; -} - -// @public -export interface TestList200Response extends HttpResponse { - // (undocumented) - body: TestsListOutput; - // (undocumented) - status: "200"; +export interface LoadTestAdministrationListTestFiles { + get(options?: LoadTestAdministrationListTestFilesParameters): StreamableMethod; } // @public -export interface TestListAppComponents200Response extends HttpResponse { +export interface LoadTestAdministrationListTestFiles200Response extends HttpResponse { // (undocumented) - body: TestAppComponentsOutput; + body: PagedTestFileInfoOutput; // (undocumented) status: "200"; } // @public (undocumented) -export interface TestListAppComponentsDefaultHeaders { +export interface LoadTestAdministrationListTestFilesDefaultHeaders { "x-ms-error-code"?: string; } -// @public -export interface TestListAppComponentsDefaultResponse extends HttpResponse { +// @public (undocumented) +export interface LoadTestAdministrationListTestFilesDefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponseBodyOutput; + body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & TestListAppComponentsDefaultHeaders; + headers: RawHttpHeaders & LoadTestAdministrationListTestFilesDefaultHeaders; // (undocumented) status: string; } // @public (undocumented) -export type TestListAppComponentsParameters = RequestParameters; - -// @public (undocumented) -export interface TestListDefaultHeaders { - "x-ms-error-code"?: string; -} - -// @public -export interface TestListDefaultResponse extends HttpResponse { - // (undocumented) - body: ErrorResponseBodyOutput; - // (undocumented) - headers: RawHttpHeaders & TestListDefaultHeaders; - // (undocumented) - status: string; -} +export type LoadTestAdministrationListTestFilesParameters = RequestParameters; // @public (undocumented) -export interface TestListFiles { - get(options?: TestListFilesParameters): StreamableMethod; +export interface LoadTestAdministrationListTests { + get(options?: LoadTestAdministrationListTestsParameters): StreamableMethod; } // @public -export interface TestListFiles200Response extends HttpResponse { +export interface LoadTestAdministrationListTests200Response extends HttpResponse { // (undocumented) - body: FileInfoListOutput; + body: PagedTestOutput; // (undocumented) status: "200"; } // @public (undocumented) -export interface TestListFilesDefaultHeaders { +export interface LoadTestAdministrationListTestsDefaultHeaders { "x-ms-error-code"?: string; } -// @public -export interface TestListFilesDefaultResponse extends HttpResponse { +// @public (undocumented) +export interface LoadTestAdministrationListTestsDefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponseBodyOutput; + body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & TestListFilesDefaultHeaders; + headers: RawHttpHeaders & LoadTestAdministrationListTestsDefaultHeaders; // (undocumented) status: string; } // @public (undocumented) -export type TestListFilesParameters = TestListFilesQueryParam & RequestParameters; - -// @public (undocumented) -export interface TestListFilesQueryParam { - // (undocumented) - queryParameters?: TestListFilesQueryParamProperties; -} - -// @public (undocumented) -export interface TestListFilesQueryParamProperties { - continuationToken?: string; -} - -// @public (undocumented) -export type TestListParameters = TestListQueryParam & RequestParameters; +export type LoadTestAdministrationListTestsParameters = LoadTestAdministrationListTestsQueryParam & RequestParameters; // @public (undocumented) -export interface TestListQueryParam { +export interface LoadTestAdministrationListTestsQueryParam { // (undocumented) - queryParameters?: TestListQueryParamProperties; + queryParameters?: LoadTestAdministrationListTestsQueryParamProperties; } // @public (undocumented) -export interface TestListQueryParamProperties { - continuationToken?: string; +export interface LoadTestAdministrationListTestsQueryParamProperties { lastModifiedEndTime?: Date | string; lastModifiedStartTime?: Date | string; maxpagesize?: number; @@ -852,140 +581,84 @@ export interface TestListQueryParamProperties { search?: string; } +// @public (undocumented) +export interface LoadTestAdministrationUploadTestFile { + delete(options?: LoadTestAdministrationDeleteTestFileParameters): StreamableMethod; + get(options?: LoadTestAdministrationGetTestFileParameters): StreamableMethod; + put(options: LoadTestAdministrationUploadTestFileParameters): StreamableMethod; +} + // @public -export interface TestListServerMetricsConfig200Response extends HttpResponse { +export interface LoadTestAdministrationUploadTestFile201Response extends HttpResponse { // (undocumented) - body: TestServerMetricConfigOutput; + body: TestFileInfoOutput; // (undocumented) - status: "200"; + status: "201"; } // @public (undocumented) -export interface TestListServerMetricsConfigDefaultHeaders { +export interface LoadTestAdministrationUploadTestFileBodyParam { + body: string | Uint8Array | ReadableStream | NodeJS.ReadableStream; +} + +// @public (undocumented) +export interface LoadTestAdministrationUploadTestFileDefaultHeaders { "x-ms-error-code"?: string; } -// @public -export interface TestListServerMetricsConfigDefaultResponse extends HttpResponse { +// @public (undocumented) +export interface LoadTestAdministrationUploadTestFileDefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponseBodyOutput; + body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & TestListServerMetricsConfigDefaultHeaders; + headers: RawHttpHeaders & LoadTestAdministrationUploadTestFileDefaultHeaders; // (undocumented) status: string; } // @public (undocumented) -export type TestListServerMetricsConfigParameters = RequestParameters; - -// @public -export interface TestOutput { - certificate?: CertificateMetadataOutput; - createdBy?: string; - createdDateTime?: string; - description?: string; - displayName?: string; - environmentVariables?: Record; - inputArtifacts?: TestInputArtifactsOutput; - keyvaultReferenceIdentityId?: string; - keyvaultReferenceIdentityType?: string; - lastModifiedBy?: string; - lastModifiedDateTime?: string; - loadTestConfiguration?: LoadTestConfigurationOutput; - passFailCriteria?: PassFailCriteriaOutput; - secrets?: Record; - subnetId?: string; - testId?: string; -} - -// @public -export interface TestRun { - certificate?: CertificateMetadata; - createdBy?: string; - createdDateTime?: Date | string; - description?: string; - displayName?: string; - duration?: number; - endDateTime?: Date | string; - environmentVariables?: Record; - errorDetails?: Array; - executedDateTime?: Date | string; - lastModifiedBy?: string; - lastModifiedDateTime?: Date | string; - loadTestConfiguration?: LoadTestConfiguration; - passFailCriteria?: PassFailCriteria; - portalUrl?: string; - secrets?: Record; - startDateTime?: Date | string; - status?: "ACCEPTED" | "NOTSTARTED" | "PROVISIONING" | "PROVISIONED" | "CONFIGURING" | "CONFIGURED" | "EXECUTING" | "EXECUTED" | "DEPROVISIONING" | "DEPROVISIONED" | "DONE" | "CANCELLING" | "CANCELLED" | "FAILED" | "VALIDATION_SUCCESS" | "VALIDATION_FAILURE"; - subnetId?: string; - testArtifacts?: TestRunArtifacts; - testId?: string; - testResult?: "PASSED" | "NOT_APPLICABLE" | "FAILED"; - testRunId?: string; - testRunStatistics?: Record; - virtualUsers?: number; -} - -// @public -export interface TestRunAppComponents { - components: Record; - createdBy?: string; - createdDateTime?: Date | string; - lastModifiedBy?: string; - lastModifiedDateTime?: Date | string; - testRunId?: string; +export interface LoadTestAdministrationUploadTestFileMediaTypesParam { + contentType: "application/octet-stream"; } -// @public -export interface TestRunAppComponentsOutput { - components: Record; - createdBy?: string; - createdDateTime?: string; - lastModifiedBy?: string; - lastModifiedDateTime?: string; - testRunId?: string; -} - -// @public -export interface TestRunArtifacts { - inputArtifacts?: TestRunInputArtifacts; - outputArtifacts?: TestRunOutputArtifacts; -} +// @public (undocumented) +export type LoadTestAdministrationUploadTestFileParameters = LoadTestAdministrationUploadTestFileQueryParam & LoadTestAdministrationUploadTestFileMediaTypesParam & LoadTestAdministrationUploadTestFileBodyParam & RequestParameters; -// @public -export interface TestRunArtifactsOutput { - inputArtifacts?: TestRunInputArtifactsOutput; - outputArtifacts?: TestRunOutputArtifactsOutput; +// @public (undocumented) +export interface LoadTestAdministrationUploadTestFileQueryParam { + // (undocumented) + queryParameters?: LoadTestAdministrationUploadTestFileQueryParamProperties; } // @public (undocumented) -export type TestRunCompletionPoller = SimplePollerLike, TestRunGet200Response>; +export interface LoadTestAdministrationUploadTestFileQueryParamProperties { + fileType?: string; +} // @public -export interface TestRunCreateOrUpdate200Response extends HttpResponse { - // (undocumented) - body: TestRunOutput; - // (undocumented) - status: "200"; +export interface LoadTestConfiguration { + engineInstances?: number; + optionalLoadTestConfig?: OptionalLoadTestConfig; + quickStartTest?: boolean; + splitAllCSVs?: boolean; } // @public -export interface TestRunCreateOrUpdate201Response extends HttpResponse { - // (undocumented) - body: TestRunOutput; - // (undocumented) - status: "201"; +export interface LoadTestConfigurationOutput { + engineInstances?: number; + optionalLoadTestConfig?: OptionalLoadTestConfigOutput; + quickStartTest?: boolean; + splitAllCSVs?: boolean; } // @public (undocumented) -export interface TestRunCreateOrUpdateAppComponents { - get(options?: TestRunListAppComponentsParameters): StreamableMethod; - patch(options: TestRunCreateOrUpdateAppComponentsParameters): StreamableMethod; +export interface LoadTestRunCreateOrUpdateAppComponents { + get(options?: LoadTestRunGetAppComponentsParameters): StreamableMethod; + patch(options: LoadTestRunCreateOrUpdateAppComponentsParameters): StreamableMethod; } // @public -export interface TestRunCreateOrUpdateAppComponents200Response extends HttpResponse { +export interface LoadTestRunCreateOrUpdateAppComponents200Response extends HttpResponse { // (undocumented) body: TestRunAppComponentsOutput; // (undocumented) @@ -993,7 +666,7 @@ export interface TestRunCreateOrUpdateAppComponents200Response extends HttpRespo } // @public -export interface TestRunCreateOrUpdateAppComponents201Response extends HttpResponse { +export interface LoadTestRunCreateOrUpdateAppComponents201Response extends HttpResponse { // (undocumented) body: TestRunAppComponentsOutput; // (undocumented) @@ -1001,294 +674,285 @@ export interface TestRunCreateOrUpdateAppComponents201Response extends HttpRespo } // @public (undocumented) -export interface TestRunCreateOrUpdateAppComponentsBodyParam { - body: TestRunAppComponents; +export interface LoadTestRunCreateOrUpdateAppComponentsBodyParam { + body: TestRunAppComponentsResourceMergeAndPatch; } // @public (undocumented) -export interface TestRunCreateOrUpdateAppComponentsDefaultHeaders { +export interface LoadTestRunCreateOrUpdateAppComponentsDefaultHeaders { "x-ms-error-code"?: string; } -// @public -export interface TestRunCreateOrUpdateAppComponentsDefaultResponse extends HttpResponse { +// @public (undocumented) +export interface LoadTestRunCreateOrUpdateAppComponentsDefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponseBodyOutput; + body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & TestRunCreateOrUpdateAppComponentsDefaultHeaders; + headers: RawHttpHeaders & LoadTestRunCreateOrUpdateAppComponentsDefaultHeaders; // (undocumented) status: string; } // @public (undocumented) -export interface TestRunCreateOrUpdateAppComponentsMediaTypesParam { - contentType?: "application/merge-patch+json"; +export interface LoadTestRunCreateOrUpdateAppComponentsMediaTypesParam { + contentType: "application/merge-patch+json"; } // @public (undocumented) -export type TestRunCreateOrUpdateAppComponentsParameters = TestRunCreateOrUpdateAppComponentsMediaTypesParam & TestRunCreateOrUpdateAppComponentsBodyParam & RequestParameters; +export type LoadTestRunCreateOrUpdateAppComponentsParameters = LoadTestRunCreateOrUpdateAppComponentsMediaTypesParam & LoadTestRunCreateOrUpdateAppComponentsBodyParam & RequestParameters; // @public (undocumented) -export interface TestRunCreateOrUpdateBodyParam { - body: TestRun; +export interface LoadTestRunCreateOrUpdateServerMetricsConfig { + get(options?: LoadTestRunGetServerMetricsConfigParameters): StreamableMethod; + patch(options: LoadTestRunCreateOrUpdateServerMetricsConfigParameters): StreamableMethod; } -// @public (undocumented) -export interface TestRunCreateOrUpdateDefaultHeaders { - "x-ms-error-code"?: string; +// @public +export interface LoadTestRunCreateOrUpdateServerMetricsConfig200Response extends HttpResponse { + // (undocumented) + body: TestRunServerMetricConfigOutput; + // (undocumented) + status: "200"; } // @public -export interface TestRunCreateOrUpdateDefaultResponse extends HttpResponse { - // (undocumented) - body: ErrorResponseBodyOutput; +export interface LoadTestRunCreateOrUpdateServerMetricsConfig201Response extends HttpResponse { // (undocumented) - headers: RawHttpHeaders & TestRunCreateOrUpdateDefaultHeaders; + body: TestRunServerMetricConfigOutput; // (undocumented) - status: string; + status: "201"; } // @public (undocumented) -export interface TestRunCreateOrUpdateMediaTypesParam { - contentType?: "application/merge-patch+json"; +export interface LoadTestRunCreateOrUpdateServerMetricsConfigBodyParam { + body: TestRunServerMetricConfigResourceMergeAndPatch; } // @public (undocumented) -export type TestRunCreateOrUpdateParameters = TestRunCreateOrUpdateQueryParam & TestRunCreateOrUpdateMediaTypesParam & TestRunCreateOrUpdateBodyParam & RequestParameters; +export interface LoadTestRunCreateOrUpdateServerMetricsConfigDefaultHeaders { + "x-ms-error-code"?: string; +} // @public (undocumented) -export interface TestRunCreateOrUpdateQueryParam { +export interface LoadTestRunCreateOrUpdateServerMetricsConfigDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; // (undocumented) - queryParameters?: TestRunCreateOrUpdateQueryParamProperties; + headers: RawHttpHeaders & LoadTestRunCreateOrUpdateServerMetricsConfigDefaultHeaders; + // (undocumented) + status: string; } // @public (undocumented) -export interface TestRunCreateOrUpdateQueryParamProperties { - oldTestRunId?: string; +export interface LoadTestRunCreateOrUpdateServerMetricsConfigMediaTypesParam { + contentType: "application/merge-patch+json"; } // @public (undocumented) -export interface TestRunCreateOrUpdateServerMetricsConfig { - get(options?: TestRunListServerMetricsConfigParameters): StreamableMethod; - patch(options: TestRunCreateOrUpdateServerMetricsConfigParameters): StreamableMethod; -} +export type LoadTestRunCreateOrUpdateServerMetricsConfigParameters = LoadTestRunCreateOrUpdateServerMetricsConfigMediaTypesParam & LoadTestRunCreateOrUpdateServerMetricsConfigBodyParam & RequestParameters; // @public -export interface TestRunCreateOrUpdateServerMetricsConfig200Response extends HttpResponse { +export interface LoadTestRunCreateOrUpdateTestRun200Response extends HttpResponse { // (undocumented) - body: TestRunServerMetricConfigOutput; + body: TestRunOutput; // (undocumented) status: "200"; } // @public -export interface TestRunCreateOrUpdateServerMetricsConfig201Response extends HttpResponse { +export interface LoadTestRunCreateOrUpdateTestRun201Response extends HttpResponse { // (undocumented) - body: TestRunServerMetricConfigOutput; + body: TestRunOutput; // (undocumented) status: "201"; } // @public (undocumented) -export interface TestRunCreateOrUpdateServerMetricsConfigBodyParam { - body: TestRunServerMetricConfig; +export interface LoadTestRunCreateOrUpdateTestRunBodyParam { + body: TestRunResourceMergeAndPatch; } // @public (undocumented) -export interface TestRunCreateOrUpdateServerMetricsConfigDefaultHeaders { +export interface LoadTestRunCreateOrUpdateTestRunDefaultHeaders { "x-ms-error-code"?: string; } -// @public -export interface TestRunCreateOrUpdateServerMetricsConfigDefaultResponse extends HttpResponse { +// @public (undocumented) +export interface LoadTestRunCreateOrUpdateTestRunDefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponseBodyOutput; + body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & TestRunCreateOrUpdateServerMetricsConfigDefaultHeaders; + headers: RawHttpHeaders & LoadTestRunCreateOrUpdateTestRunDefaultHeaders; // (undocumented) status: string; } // @public (undocumented) -export interface TestRunCreateOrUpdateServerMetricsConfigMediaTypesParam { - contentType?: "application/merge-patch+json"; +export interface LoadTestRunCreateOrUpdateTestRunMediaTypesParam { + contentType: "application/merge-patch+json"; } // @public (undocumented) -export type TestRunCreateOrUpdateServerMetricsConfigParameters = TestRunCreateOrUpdateServerMetricsConfigMediaTypesParam & TestRunCreateOrUpdateServerMetricsConfigBodyParam & RequestParameters; +export type LoadTestRunCreateOrUpdateTestRunParameters = LoadTestRunCreateOrUpdateTestRunQueryParam & LoadTestRunCreateOrUpdateTestRunMediaTypesParam & LoadTestRunCreateOrUpdateTestRunBodyParam & RequestParameters; // @public (undocumented) -export type TestRunCreateOrUpdateSuccessResponse = TestRunCreateOrUpdate200Response | TestRunCreateOrUpdate201Response; +export interface LoadTestRunCreateOrUpdateTestRunQueryParam { + // (undocumented) + queryParameters?: LoadTestRunCreateOrUpdateTestRunQueryParamProperties; +} // @public (undocumented) -export interface TestRunDelete { - delete(options?: TestRunDeleteParameters): StreamableMethod; - get(options?: TestRunGetParameters): StreamableMethod; - patch(options: TestRunCreateOrUpdateParameters): StreamableMethod; +export interface LoadTestRunCreateOrUpdateTestRunQueryParamProperties { + oldTestRunId?: string; } // @public -export interface TestRunDelete204Response extends HttpResponse { - // (undocumented) - body: Record; +export interface LoadTestRunDeleteTestRun204Response extends HttpResponse { // (undocumented) status: "204"; } // @public (undocumented) -export interface TestRunDeleteDefaultHeaders { +export interface LoadTestRunDeleteTestRunDefaultHeaders { "x-ms-error-code"?: string; } -// @public -export interface TestRunDeleteDefaultResponse extends HttpResponse { +// @public (undocumented) +export interface LoadTestRunDeleteTestRunDefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponseBodyOutput; + body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & TestRunDeleteDefaultHeaders; + headers: RawHttpHeaders & LoadTestRunDeleteTestRunDefaultHeaders; // (undocumented) status: string; } // @public (undocumented) -export type TestRunDeleteParameters = RequestParameters; +export type LoadTestRunDeleteTestRunParameters = RequestParameters; // @public -export interface TestRunGet200Response extends HttpResponse { +export interface LoadTestRunGetAppComponents200Response extends HttpResponse { // (undocumented) - body: TestRunOutput; + body: TestRunAppComponentsOutput; // (undocumented) status: "200"; } // @public (undocumented) -export interface TestRunGetDefaultHeaders { +export interface LoadTestRunGetAppComponentsDefaultHeaders { "x-ms-error-code"?: string; } -// @public -export interface TestRunGetDefaultResponse extends HttpResponse { +// @public (undocumented) +export interface LoadTestRunGetAppComponentsDefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponseBodyOutput; + body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & TestRunGetDefaultHeaders; + headers: RawHttpHeaders & LoadTestRunGetAppComponentsDefaultHeaders; // (undocumented) status: string; } // @public (undocumented) -export interface TestRunGetFile { - get(options?: TestRunGetFileParameters): StreamableMethod; -} +export type LoadTestRunGetAppComponentsParameters = RequestParameters; // @public -export interface TestRunGetFile200Response extends HttpResponse { +export interface LoadTestRunGetServerMetricsConfig200Response extends HttpResponse { // (undocumented) - body: FileInfoOutput; + body: TestRunServerMetricConfigOutput; // (undocumented) status: "200"; } // @public (undocumented) -export interface TestRunGetFileDefaultHeaders { +export interface LoadTestRunGetServerMetricsConfigDefaultHeaders { "x-ms-error-code"?: string; } -// @public -export interface TestRunGetFileDefaultResponse extends HttpResponse { +// @public (undocumented) +export interface LoadTestRunGetServerMetricsConfigDefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponseBodyOutput; + body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & TestRunGetFileDefaultHeaders; + headers: RawHttpHeaders & LoadTestRunGetServerMetricsConfigDefaultHeaders; // (undocumented) status: string; } // @public (undocumented) -export type TestRunGetFileParameters = RequestParameters; +export type LoadTestRunGetServerMetricsConfigParameters = RequestParameters; // @public (undocumented) -export type TestRunGetParameters = RequestParameters; - -// @public -export interface TestRunInputArtifacts { - additionalFileInfo?: Array; - configFileInfo?: FileInfo; - inputArtifactsZipFileInfo?: FileInfo; - testScriptFileInfo?: FileInfo; - userPropFileInfo?: FileInfo; +export interface LoadTestRunGetTestRun { + delete(options?: LoadTestRunDeleteTestRunParameters): StreamableMethod; + get(options?: LoadTestRunGetTestRunParameters): StreamableMethod; + patch(options: LoadTestRunCreateOrUpdateTestRunParameters): StreamableMethod; } // @public -export interface TestRunInputArtifactsOutput { - additionalFileInfo?: Array; - configFileInfo?: FileInfoOutput; - inputArtifactsZipFileInfo?: FileInfoOutput; - testScriptFileInfo?: FileInfoOutput; - userPropFileInfo?: FileInfoOutput; +export interface LoadTestRunGetTestRun200Response extends HttpResponse { + // (undocumented) + body: TestRunOutput; + // (undocumented) + status: "200"; } // @public (undocumented) -export interface TestRunList { - get(options?: TestRunListParameters): StreamableMethod; +export interface LoadTestRunGetTestRunDefaultHeaders { + "x-ms-error-code"?: string; } -// @public -export interface TestRunList200Response extends HttpResponse { +// @public (undocumented) +export interface LoadTestRunGetTestRunDefaultResponse extends HttpResponse { // (undocumented) - body: TestRunsListOutput; + body: ErrorResponse; // (undocumented) - status: "200"; + headers: RawHttpHeaders & LoadTestRunGetTestRunDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export interface LoadTestRunGetTestRunFile { + get(options?: LoadTestRunGetTestRunFileParameters): StreamableMethod; } // @public -export interface TestRunListAppComponents200Response extends HttpResponse { +export interface LoadTestRunGetTestRunFile200Response extends HttpResponse { // (undocumented) - body: TestRunAppComponentsOutput; + body: TestRunFileInfoOutput; // (undocumented) status: "200"; } // @public (undocumented) -export interface TestRunListAppComponentsDefaultHeaders { +export interface LoadTestRunGetTestRunFileDefaultHeaders { "x-ms-error-code"?: string; } -// @public -export interface TestRunListAppComponentsDefaultResponse extends HttpResponse { +// @public (undocumented) +export interface LoadTestRunGetTestRunFileDefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponseBodyOutput; + body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & TestRunListAppComponentsDefaultHeaders; + headers: RawHttpHeaders & LoadTestRunGetTestRunFileDefaultHeaders; // (undocumented) status: string; } // @public (undocumented) -export type TestRunListAppComponentsParameters = RequestParameters; +export type LoadTestRunGetTestRunFileParameters = RequestParameters; // @public (undocumented) -export interface TestRunListDefaultHeaders { - "x-ms-error-code"?: string; -} - -// @public -export interface TestRunListDefaultResponse extends HttpResponse { - // (undocumented) - body: ErrorResponseBodyOutput; - // (undocumented) - headers: RawHttpHeaders & TestRunListDefaultHeaders; - // (undocumented) - status: string; -} +export type LoadTestRunGetTestRunParameters = RequestParameters; // @public (undocumented) -export interface TestRunListMetricDefinitions { - get(options: TestRunListMetricDefinitionsParameters): StreamableMethod; +export interface LoadTestRunListMetricDefinitions { + get(options: LoadTestRunListMetricDefinitionsParameters): StreamableMethod; } // @public -export interface TestRunListMetricDefinitions200Response extends HttpResponse { +export interface LoadTestRunListMetricDefinitions200Response extends HttpResponse { // (undocumented) body: MetricDefinitionCollectionOutput; // (undocumented) @@ -1296,41 +960,41 @@ export interface TestRunListMetricDefinitions200Response extends HttpResponse { } // @public (undocumented) -export interface TestRunListMetricDefinitionsDefaultHeaders { +export interface LoadTestRunListMetricDefinitionsDefaultHeaders { "x-ms-error-code"?: string; } -// @public -export interface TestRunListMetricDefinitionsDefaultResponse extends HttpResponse { +// @public (undocumented) +export interface LoadTestRunListMetricDefinitionsDefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponseBodyOutput; + body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & TestRunListMetricDefinitionsDefaultHeaders; + headers: RawHttpHeaders & LoadTestRunListMetricDefinitionsDefaultHeaders; // (undocumented) status: string; } // @public (undocumented) -export type TestRunListMetricDefinitionsParameters = TestRunListMetricDefinitionsQueryParam & RequestParameters; +export type LoadTestRunListMetricDefinitionsParameters = LoadTestRunListMetricDefinitionsQueryParam & RequestParameters; // @public (undocumented) -export interface TestRunListMetricDefinitionsQueryParam { +export interface LoadTestRunListMetricDefinitionsQueryParam { // (undocumented) - queryParameters: TestRunListMetricDefinitionsQueryParamProperties; + queryParameters: LoadTestRunListMetricDefinitionsQueryParamProperties; } // @public (undocumented) -export interface TestRunListMetricDefinitionsQueryParamProperties { +export interface LoadTestRunListMetricDefinitionsQueryParamProperties { metricNamespace: string; } // @public (undocumented) -export interface TestRunListMetricDimensionValues { - get(options: TestRunListMetricDimensionValuesParameters): StreamableMethod; +export interface LoadTestRunListMetricDimensionValues { + get(options: LoadTestRunListMetricDimensionValuesParameters): StreamableMethod; } // @public -export interface TestRunListMetricDimensionValues200Response extends HttpResponse { +export interface LoadTestRunListMetricDimensionValues200Response extends HttpResponse { // (undocumented) body: DimensionValueListOutput; // (undocumented) @@ -1338,44 +1002,44 @@ export interface TestRunListMetricDimensionValues200Response extends HttpRespons } // @public (undocumented) -export interface TestRunListMetricDimensionValuesDefaultHeaders { +export interface LoadTestRunListMetricDimensionValuesDefaultHeaders { "x-ms-error-code"?: string; } -// @public -export interface TestRunListMetricDimensionValuesDefaultResponse extends HttpResponse { +// @public (undocumented) +export interface LoadTestRunListMetricDimensionValuesDefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponseBodyOutput; + body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & TestRunListMetricDimensionValuesDefaultHeaders; + headers: RawHttpHeaders & LoadTestRunListMetricDimensionValuesDefaultHeaders; // (undocumented) status: string; } // @public (undocumented) -export type TestRunListMetricDimensionValuesParameters = TestRunListMetricDimensionValuesQueryParam & RequestParameters; +export type LoadTestRunListMetricDimensionValuesParameters = LoadTestRunListMetricDimensionValuesQueryParam & RequestParameters; // @public (undocumented) -export interface TestRunListMetricDimensionValuesQueryParam { +export interface LoadTestRunListMetricDimensionValuesQueryParam { // (undocumented) - queryParameters: TestRunListMetricDimensionValuesQueryParamProperties; + queryParameters: LoadTestRunListMetricDimensionValuesQueryParamProperties; } // @public (undocumented) -export interface TestRunListMetricDimensionValuesQueryParamProperties { - interval?: "PT5S" | "PT10S" | "PT1M" | "PT5M" | "PT1H"; +export interface LoadTestRunListMetricDimensionValuesQueryParamProperties { + interval?: string; metricname: string; metricNamespace: string; timespan: string; } // @public (undocumented) -export interface TestRunListMetricNamespaces { - get(options?: TestRunListMetricNamespacesParameters): StreamableMethod; +export interface LoadTestRunListMetricNamespaces { + get(options?: LoadTestRunListMetricNamespacesParameters): StreamableMethod; } // @public -export interface TestRunListMetricNamespaces200Response extends HttpResponse { +export interface LoadTestRunListMetricNamespaces200Response extends HttpResponse { // (undocumented) body: MetricNamespaceCollectionOutput; // (undocumented) @@ -1383,30 +1047,30 @@ export interface TestRunListMetricNamespaces200Response extends HttpResponse { } // @public (undocumented) -export interface TestRunListMetricNamespacesDefaultHeaders { +export interface LoadTestRunListMetricNamespacesDefaultHeaders { "x-ms-error-code"?: string; } -// @public -export interface TestRunListMetricNamespacesDefaultResponse extends HttpResponse { +// @public (undocumented) +export interface LoadTestRunListMetricNamespacesDefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponseBodyOutput; + body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & TestRunListMetricNamespacesDefaultHeaders; + headers: RawHttpHeaders & LoadTestRunListMetricNamespacesDefaultHeaders; // (undocumented) status: string; } // @public (undocumented) -export type TestRunListMetricNamespacesParameters = RequestParameters; +export type LoadTestRunListMetricNamespacesParameters = RequestParameters; // @public (undocumented) -export interface TestRunListMetrics { - post(options: TestRunListMetricsParameters): StreamableMethod; +export interface LoadTestRunListMetrics { + post(options: LoadTestRunListMetricsParameters): StreamableMethod; } // @public -export interface TestRunListMetrics200Response extends HttpResponse { +export interface LoadTestRunListMetrics200Response extends HttpResponse { // (undocumented) body: MetricsOutput; // (undocumented) @@ -1414,311 +1078,585 @@ export interface TestRunListMetrics200Response extends HttpResponse { } // @public (undocumented) -export interface TestRunListMetricsBodyParam { +export interface LoadTestRunListMetricsBodyParam { body?: MetricRequestPayload; } // @public (undocumented) -export interface TestRunListMetricsDefaultHeaders { +export interface LoadTestRunListMetricsDefaultHeaders { "x-ms-error-code"?: string; } -// @public -export interface TestRunListMetricsDefaultResponse extends HttpResponse { +// @public (undocumented) +export interface LoadTestRunListMetricsDefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponseBodyOutput; + body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & TestRunListMetricsDefaultHeaders; + headers: RawHttpHeaders & LoadTestRunListMetricsDefaultHeaders; // (undocumented) status: string; } // @public (undocumented) -export interface TestRunListMetricsMediaTypesParam { - contentType?: "application/json"; -} - -// @public (undocumented) -export type TestRunListMetricsParameters = TestRunListMetricsQueryParam & TestRunListMetricsMediaTypesParam & TestRunListMetricsBodyParam & RequestParameters; +export type LoadTestRunListMetricsParameters = LoadTestRunListMetricsQueryParam & LoadTestRunListMetricsBodyParam & RequestParameters; // @public (undocumented) -export interface TestRunListMetricsQueryParam { +export interface LoadTestRunListMetricsQueryParam { // (undocumented) - queryParameters: TestRunListMetricsQueryParamProperties; + queryParameters: LoadTestRunListMetricsQueryParamProperties; } // @public (undocumented) -export interface TestRunListMetricsQueryParamProperties { +export interface LoadTestRunListMetricsQueryParamProperties { aggregation?: string; - interval?: "PT5S" | "PT10S" | "PT1M" | "PT5M" | "PT1H"; + interval?: string; metricname: string; metricNamespace: string; timespan: string; } // @public (undocumented) -export type TestRunListParameters = TestRunListQueryParam & RequestParameters; - -// @public (undocumented) -export interface TestRunListQueryParam { - // (undocumented) - queryParameters?: TestRunListQueryParamProperties; -} - -// @public (undocumented) -export interface TestRunListQueryParamProperties { - continuationToken?: string; - executionFrom?: Date | string; - executionTo?: Date | string; - maxpagesize?: number; - orderby?: string; - search?: string; - status?: string; - testId?: string; +export interface LoadTestRunListTestRuns { + get(options?: LoadTestRunListTestRunsParameters): StreamableMethod; } // @public -export interface TestRunListServerMetricsConfig200Response extends HttpResponse { +export interface LoadTestRunListTestRuns200Response extends HttpResponse { // (undocumented) - body: TestRunServerMetricConfigOutput; + body: PagedTestRunOutput; // (undocumented) status: "200"; } // @public (undocumented) -export interface TestRunListServerMetricsConfigDefaultHeaders { +export interface LoadTestRunListTestRunsDefaultHeaders { "x-ms-error-code"?: string; } +// @public (undocumented) +export interface LoadTestRunListTestRunsDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & LoadTestRunListTestRunsDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type LoadTestRunListTestRunsParameters = LoadTestRunListTestRunsQueryParam & RequestParameters; + +// @public (undocumented) +export interface LoadTestRunListTestRunsQueryParam { + // (undocumented) + queryParameters?: LoadTestRunListTestRunsQueryParamProperties; +} + +// @public (undocumented) +export interface LoadTestRunListTestRunsQueryParamProperties { + executionFrom?: Date | string; + executionTo?: Date | string; + maxpagesize?: number; + orderby?: string; + search?: string; + status?: string; + testId?: string; +} + +// @public (undocumented) +export interface LoadTestRunStop { + post(options?: LoadTestRunStopParameters): StreamableMethod; +} + // @public -export interface TestRunListServerMetricsConfigDefaultResponse extends HttpResponse { +export interface LoadTestRunStop200Response extends HttpResponse { + // (undocumented) + body: TestRunOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface LoadTestRunStopDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface LoadTestRunStopDefaultResponse extends HttpResponse { // (undocumented) - body: ErrorResponseBodyOutput; + body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & TestRunListServerMetricsConfigDefaultHeaders; + headers: RawHttpHeaders & LoadTestRunStopDefaultHeaders; // (undocumented) status: string; } // @public (undocumented) -export type TestRunListServerMetricsConfigParameters = RequestParameters; +export type LoadTestRunStopParameters = RequestParameters; // @public -export interface TestRunOutput { - certificate?: CertificateMetadataOutput; - createdBy?: string; - createdDateTime?: string; +export interface MetricAvailabilityOutput { + timeGrain?: string; +} + +// @public +export interface MetricDefinitionCollectionOutput { + value: Array; +} + +// @public +export interface MetricDefinitionOutput { description?: string; - displayName?: string; + dimensions?: Array; + metricAvailabilities?: Array; + name?: string; + namespace?: string; + primaryAggregationType?: string; + supportedAggregationTypes?: string[]; + unit?: string; +} + +// @public +export interface MetricNamespaceCollectionOutput { + value: Array; +} + +// @public +export interface MetricNamespaceOutput { + description?: string; + name?: string; +} + +// @public +export interface MetricRequestPayload { + filters?: Array; +} + +// @public +export type MetricsOutput = Paged; + +// @public +export interface MetricValueOutput { + timestamp?: string; + value?: number; +} + +// @public +export interface NameAndDescOutput { + description?: string; + name?: string; +} + +// @public +export interface OptionalLoadTestConfig { duration?: number; - endDateTime?: string; - environmentVariables?: Record; - errorDetails?: Array; - executedDateTime?: string; - lastModifiedBy?: string; - lastModifiedDateTime?: string; - loadTestConfiguration?: LoadTestConfigurationOutput; - passFailCriteria?: PassFailCriteriaOutput; - portalUrl?: string; - secrets?: Record; - startDateTime?: string; - status?: "ACCEPTED" | "NOTSTARTED" | "PROVISIONING" | "PROVISIONED" | "CONFIGURING" | "CONFIGURED" | "EXECUTING" | "EXECUTED" | "DEPROVISIONING" | "DEPROVISIONED" | "DONE" | "CANCELLING" | "CANCELLED" | "FAILED" | "VALIDATION_SUCCESS" | "VALIDATION_FAILURE"; - subnetId?: string; - testArtifacts?: TestRunArtifactsOutput; - testId?: string; - testResult?: "PASSED" | "NOT_APPLICABLE" | "FAILED"; - testRunId?: string; - testRunStatistics?: Record; + endpointUrl?: string; + maxResponseTimeInMs?: number; + rampUpTime?: number; + requestsPerSecond?: number; virtualUsers?: number; } // @public -export interface TestRunOutputArtifacts { - logsFileInfo?: FileInfo; - resultFileInfo?: FileInfo; +export interface OptionalLoadTestConfigOutput { + duration?: number; + endpointUrl?: string; + maxResponseTimeInMs?: number; + rampUpTime?: number; + requestsPerSecond?: number; + virtualUsers?: number; } // @public -export interface TestRunOutputArtifactsOutput { - logsFileInfo?: FileInfoOutput; - resultFileInfo?: FileInfoOutput; +export type PagedTestFileInfoOutput = Paged; + +// @public +export type PagedTestOutput = Paged; + +// @public +export type PagedTestRunOutput = Paged; + +// @public +export function paginate(client: Client, initialResponse: TResponse, options?: PagingOptions): PagedAsyncIterableIterator>; + +// @public +export type PaginateReturn = TResult extends { + body: { + value?: infer TPage; + }; +} ? GetArrayType : Array; + +// @public +export interface PagingOptions { + customGetPage?: GetPage[]>; } // @public -export interface TestRunServerMetricConfig { - createdBy?: string; - createdDateTime?: Date | string; - lastModifiedBy?: string; - lastModifiedDateTime?: Date | string; - metrics?: Record; - testRunId?: string; +export interface PassFailCriteria { + passFailMetrics?: Record; } // @public -export interface TestRunServerMetricConfigOutput { - createdBy?: string; - createdDateTime?: string; - lastModifiedBy?: string; - lastModifiedDateTime?: string; - metrics?: Record; - testRunId?: string; +export interface PassFailCriteriaOutput { + passFailMetrics?: Record; } // @public -export interface TestRunsListOutput { - nextLink?: string; - value: Array; +export interface PassFailMetric { + action?: string; + aggregate?: string; + clientMetric?: string; + condition?: string; + requestName?: string; + value?: number; } // @public -export interface TestRunStatistics { - errorCount?: number; - errorPct?: number; - maxResTime?: number; - meanResTime?: number; - medianResTime?: number; - minResTime?: number; - pct1ResTime?: number; - pct2ResTime?: number; - pct3ResTime?: number; - receivedKBytesPerSec?: number; - sampleCount?: number; - sentKBytesPerSec?: number; - throughput?: number; - transaction?: string; +export interface PassFailMetricOutput { + action?: string; + readonly actualValue?: number; + aggregate?: string; + clientMetric?: string; + condition?: string; + requestName?: string; + readonly result?: string; + value?: number; } // @public -export interface TestRunStatisticsOutput { - errorCount?: number; - errorPct?: number; - maxResTime?: number; - meanResTime?: number; - medianResTime?: number; - minResTime?: number; - pct1ResTime?: number; - pct2ResTime?: number; - pct3ResTime?: number; - receivedKBytesPerSec?: number; - sampleCount?: number; - sentKBytesPerSec?: number; - throughput?: number; - transaction?: string; +export interface ResourceMetric { + aggregation: string; + displayDescription?: string; + metricNamespace: string; + name: string; + resourceId: string; + resourceType: string; + unit?: string; +} + +// @public +export interface ResourceMetricOutput { + aggregation: string; + displayDescription?: string; + readonly id?: string; + metricNamespace: string; + name: string; + resourceId: string; + resourceType: string; + unit?: string; } // @public (undocumented) -export interface TestRunStop { - post(options?: TestRunStopParameters): StreamableMethod; +export interface Routes { + (path: "/tests/{testId}", testId: string): LoadTestAdministrationCreateOrUpdateTest; + (path: "/tests"): LoadTestAdministrationListTests; + (path: "/tests/{testId}/files/{fileName}", testId: string, fileName: string): LoadTestAdministrationUploadTestFile; + (path: "/tests/{testId}/files", testId: string): LoadTestAdministrationListTestFiles; + (path: "/tests/{testId}/app-components", testId: string): LoadTestAdministrationCreateOrUpdateAppComponents; + (path: "/tests/{testId}/server-metrics-config", testId: string): LoadTestAdministrationCreateOrUpdateServerMetricsConfig; + (path: "/test-runs/{testRunId}", testRunId: string): LoadTestRunGetTestRun; + (path: "/test-runs"): LoadTestRunListTestRuns; + (path: "/test-runs/{testRunId}/files/{fileName}", testRunId: string, fileName: string): LoadTestRunGetTestRunFile; + (path: "/test-runs/{testRunId}:stop", testRunId: string): LoadTestRunStop; + (path: "/test-runs/{testRunId}/metric-namespaces", testRunId: string): LoadTestRunListMetricNamespaces; + (path: "/test-runs/{testRunId}/metric-definitions", testRunId: string): LoadTestRunListMetricDefinitions; + (path: "/test-runs/{testRunId}/metrics", testRunId: string): LoadTestRunListMetrics; + (path: "/test-runs/{testRunId}/metric-dimensions/{name}/values", testRunId: string, name: string): LoadTestRunListMetricDimensionValues; + (path: "/test-runs/{testRunId}/app-components", testRunId: string): LoadTestRunCreateOrUpdateAppComponents; + (path: "/test-runs/{testRunId}/server-metrics-config", testRunId: string): LoadTestRunCreateOrUpdateServerMetricsConfig; } // @public -export interface TestRunStop200Response extends HttpResponse { - // (undocumented) - body: TestRunOutput; - // (undocumented) - status: "200"; +export interface Secret { + type?: string; + value?: string; } -// @public (undocumented) -export interface TestRunStopDefaultHeaders { - "x-ms-error-code"?: string; +// @public +export interface SecretOutput { + type?: string; + value?: string; } // @public -export interface TestRunStopDefaultResponse extends HttpResponse { - // (undocumented) - body: ErrorResponseBodyOutput; - // (undocumented) - headers: RawHttpHeaders & TestRunStopDefaultHeaders; - // (undocumented) - status: string; +export interface Test { + autoStopCriteria?: AutoStopCriteria; + baselineTestRunId?: string; + certificate?: CertificateMetadata; + description?: string; + displayName?: string; + environmentVariables?: Record; + keyvaultReferenceIdentityId?: string; + keyvaultReferenceIdentityType?: string; + kind?: string; + loadTestConfiguration?: LoadTestConfiguration; + passFailCriteria?: PassFailCriteria; + publicIPDisabled?: boolean; + secrets?: Record; + subnetId?: string; } -// @public (undocumented) -export type TestRunStopParameters = RequestParameters; +// @public +export interface TestAppComponents { + components: Record; +} // @public -export interface TestServerMetricConfig { - createdBy?: string; - createdDateTime?: Date | string; - lastModifiedBy?: string; - lastModifiedDateTime?: Date | string; - metrics?: Record; - testId?: string; +export interface TestAppComponentsOutput { + components: Record; + readonly createdBy?: string; + readonly createdDateTime?: string; + readonly lastModifiedBy?: string; + readonly lastModifiedDateTime?: string; + readonly testId?: string; } // @public -export interface TestServerMetricConfigOutput { - createdBy?: string; - createdDateTime?: string; - lastModifiedBy?: string; - lastModifiedDateTime?: string; - metrics?: Record; +export type TestAppComponentsResourceMergeAndPatch = Partial; + +// @public +export interface TestFileInfo { + fileName: string; +} + +// @public +export interface TestFileInfoOutput { + readonly expireDateTime?: string; + fileName: string; + readonly fileType?: string; + readonly url?: string; + readonly validationFailureDetails?: string; + readonly validationStatus?: string; +} + +// @public +export interface TestInputArtifacts { + configFileInfo?: TestFileInfo; + inputArtifactsZipFileInfo?: TestFileInfo; + testScriptFileInfo?: TestFileInfo; + urlTestConfigFileInfo?: TestFileInfo; + userPropFileInfo?: TestFileInfo; +} + +// @public +export interface TestInputArtifactsOutput { + readonly additionalFileInfo?: Array; + configFileInfo?: TestFileInfoOutput; + inputArtifactsZipFileInfo?: TestFileInfoOutput; + testScriptFileInfo?: TestFileInfoOutput; + urlTestConfigFileInfo?: TestFileInfoOutput; + userPropFileInfo?: TestFileInfoOutput; +} + +// @public +export interface TestOutput { + autoStopCriteria?: AutoStopCriteriaOutput; + baselineTestRunId?: string; + certificate?: CertificateMetadataOutput; + readonly createdBy?: string; + readonly createdDateTime?: string; + description?: string; + displayName?: string; + environmentVariables?: Record; + readonly inputArtifacts?: TestInputArtifactsOutput; + keyvaultReferenceIdentityId?: string; + keyvaultReferenceIdentityType?: string; + kind?: string; + readonly lastModifiedBy?: string; + readonly lastModifiedDateTime?: string; + loadTestConfiguration?: LoadTestConfigurationOutput; + passFailCriteria?: PassFailCriteriaOutput; + publicIPDisabled?: boolean; + secrets?: Record; + subnetId?: string; + readonly testId: string; +} + +// @public +export type TestResourceMergeAndPatch = Partial; + +// @public +export interface TestRun { + autoStopCriteria?: AutoStopCriteria; + certificate?: CertificateMetadata; + description?: string; + displayName?: string; + environmentVariables?: Record; + loadTestConfiguration?: LoadTestConfiguration; + passFailCriteria?: PassFailCriteria; + secrets?: Record; testId?: string; } // @public -export interface TestsListOutput { - nextLink?: string; - value: Array; +export interface TestRunAppComponents { + components: Record; } -// @public (undocumented) -export interface TestUploadFile { - delete(options?: TestDeleteFileParameters): StreamableMethod; - get(options?: TestGetFileParameters): StreamableMethod; - put(options: TestUploadFileParameters): StreamableMethod; +// @public +export interface TestRunAppComponentsOutput { + components: Record; + readonly createdBy?: string; + readonly createdDateTime?: string; + readonly lastModifiedBy?: string; + readonly lastModifiedDateTime?: string; + readonly testRunId?: string; } // @public -export interface TestUploadFile201Response extends HttpResponse { - // (undocumented) - body: FileInfoOutput; - // (undocumented) - status: "201"; +export type TestRunAppComponentsResourceMergeAndPatch = Partial; + +// @public +export interface TestRunArtifacts { + outputArtifacts?: TestRunOutputArtifacts; } -// @public (undocumented) -export interface TestUploadFileBodyParam { - body: string | Uint8Array | ReadableStream | NodeJS.ReadableStream; +// @public +export interface TestRunArtifactsOutput { + readonly inputArtifacts?: TestRunInputArtifactsOutput; + outputArtifacts?: TestRunOutputArtifactsOutput; } -// @public (undocumented) -export interface TestUploadFileDefaultHeaders { - "x-ms-error-code"?: string; +// @public +export interface TestRunFileInfo { + fileName: string; } // @public -export interface TestUploadFileDefaultResponse extends HttpResponse { - // (undocumented) - body: ErrorResponseBodyOutput; - // (undocumented) - headers: RawHttpHeaders & TestUploadFileDefaultHeaders; - // (undocumented) - status: string; +export interface TestRunFileInfoOutput { + readonly expireDateTime?: string; + fileName: string; + readonly fileType?: string; + readonly url?: string; + readonly validationFailureDetails?: string; + readonly validationStatus?: string; } -// @public (undocumented) -export interface TestUploadFileMediaTypesParam { - contentType?: "application/octet-stream"; +// @public +export interface TestRunInputArtifacts { + configFileInfo?: TestRunFileInfo; + inputArtifactsZipFileInfo?: TestRunFileInfo; + testScriptFileInfo?: TestRunFileInfo; + urlTestConfigFileInfo?: TestRunFileInfo; + userPropFileInfo?: TestRunFileInfo; } -// @public (undocumented) -export type TestUploadFileParameters = TestUploadFileQueryParam & TestUploadFileMediaTypesParam & TestUploadFileBodyParam & RequestParameters; +// @public +export interface TestRunInputArtifactsOutput { + readonly additionalFileInfo?: Array; + configFileInfo?: TestRunFileInfoOutput; + inputArtifactsZipFileInfo?: TestRunFileInfoOutput; + testScriptFileInfo?: TestRunFileInfoOutput; + urlTestConfigFileInfo?: TestRunFileInfoOutput; + userPropFileInfo?: TestRunFileInfoOutput; +} -// @public (undocumented) -export interface TestUploadFileQueryParam { - // (undocumented) - queryParameters?: TestUploadFileQueryParamProperties; +// @public +export interface TestRunOutput { + autoStopCriteria?: AutoStopCriteriaOutput; + certificate?: CertificateMetadataOutput; + readonly createdBy?: string; + readonly createdDateTime?: string; + description?: string; + displayName?: string; + readonly duration?: number; + readonly endDateTime?: string; + environmentVariables?: Record; + readonly errorDetails?: Array; + readonly executedDateTime?: string; + readonly kind?: string; + readonly lastModifiedBy?: string; + readonly lastModifiedDateTime?: string; + loadTestConfiguration?: LoadTestConfigurationOutput; + passFailCriteria?: PassFailCriteriaOutput; + readonly portalUrl?: string; + readonly publicIPDisabled?: boolean; + secrets?: Record; + readonly startDateTime?: string; + readonly status?: string; + readonly subnetId?: string; + readonly testArtifacts?: TestRunArtifactsOutput; + testId?: string; + readonly testResult?: string; + readonly testRunId: string; + readonly testRunStatistics?: Record; + readonly virtualUsers?: number; } -// @public (undocumented) -export interface TestUploadFileQueryParamProperties { - fileType?: "JMX_FILE" | "USER_PROPERTIES" | "ADDITIONAL_ARTIFACTS"; +// @public +export interface TestRunOutputArtifacts { + artifactsContainerInfo?: ArtifactsContainerInfo; + logsFileInfo?: TestRunFileInfo; + resultFileInfo?: TestRunFileInfo; } -// @public (undocumented) -export type TestUploadFileSuccessResponse = TestUploadFile201Response; +// @public +export interface TestRunOutputArtifactsOutput { + artifactsContainerInfo?: ArtifactsContainerInfoOutput; + logsFileInfo?: TestRunFileInfoOutput; + resultFileInfo?: TestRunFileInfoOutput; +} + +// @public +export type TestRunResourceMergeAndPatch = Partial; + +// @public +export interface TestRunServerMetricConfig { + metrics?: Record; +} + +// @public +export interface TestRunServerMetricConfigOutput { + readonly createdBy?: string; + readonly createdDateTime?: string; + readonly lastModifiedBy?: string; + readonly lastModifiedDateTime?: string; + metrics?: Record; + readonly testRunId?: string; +} + +// @public +export type TestRunServerMetricConfigResourceMergeAndPatch = Partial; + +// @public +export interface TestRunStatistics { +} + +// @public +export interface TestRunStatisticsOutput { + readonly errorCount?: number; + readonly errorPct?: number; + readonly maxResTime?: number; + readonly meanResTime?: number; + readonly medianResTime?: number; + readonly minResTime?: number; + readonly pct1ResTime?: number; + readonly pct2ResTime?: number; + readonly pct3ResTime?: number; + readonly receivedKBytesPerSec?: number; + readonly sampleCount?: number; + readonly sentKBytesPerSec?: number; + readonly throughput?: number; + readonly transaction?: string; +} + +// @public +export interface TestServerMetricConfig { + metrics: Record; +} + +// @public +export interface TestServerMetricConfigOutput { + readonly createdBy?: string; + readonly createdDateTime?: string; + readonly lastModifiedBy?: string; + readonly lastModifiedDateTime?: string; + metrics: Record; + readonly testId?: string; +} + +// @public +export type TestServerMetricConfigResourceMergeAndPatch = Partial; // @public export interface TimeSeriesElementOutput { diff --git a/sdk/loadtesting/load-testing-rest/src/azureLoadTesting.ts b/sdk/loadtesting/load-testing-rest/src/azureLoadTesting.ts index 6bc7f2adbd68..d8294f98f3e2 100644 --- a/sdk/loadtesting/load-testing-rest/src/azureLoadTesting.ts +++ b/sdk/loadtesting/load-testing-rest/src/azureLoadTesting.ts @@ -2,25 +2,29 @@ // Licensed under the MIT license. import { getClient, ClientOptions } from "@azure-rest/core-client"; +import { logger } from "./logger"; import { TokenCredential } from "@azure/core-auth"; import { AzureLoadTestingClient } from "./clientDefinitions"; /** - * Initialize a new instance of the class AzureLoadTestingClient class. - * @param Endpoint type: string URL to perform data plane API operations on the resource. - * @param credentials type: TokenCredential + * Initialize a new instance of `AzureLoadTestingClient` + * @param endpoint - A sequence of textual characters. + * @param credentials - uniquely identify client credential + * @param options - the parameter for all optional parameters */ export default function createClient( - Endpoint: string, + endpoint: string, credentials: TokenCredential, options: ClientOptions = {} ): AzureLoadTestingClient { - const baseUrl = options.baseUrl ?? `https://${Endpoint}`; - options.apiVersion = options.apiVersion ?? "2022-11-01"; + const baseUrl = options.baseUrl ?? `https://${endpoint}`; + options.apiVersion = options.apiVersion ?? "2023-04-01-preview"; options = { ...options, credentials: { - scopes: ["https://cnt-prod.loadtesting.azure.com/.default"], + scopes: options.credentials?.scopes ?? [ + "https://cnt-prod.loadtesting.azure.com/.default", + ], }, }; @@ -34,9 +38,16 @@ export default function createClient( userAgentOptions: { userAgentPrefix, }, + loggingOptions: { + logger: options.loggingOptions?.logger ?? logger.info, + }, }; - const client = getClient(baseUrl, credentials, options) as AzureLoadTestingClient; + const client = getClient( + baseUrl, + credentials, + options + ) as AzureLoadTestingClient; return client; } diff --git a/sdk/loadtesting/load-testing-rest/src/clientDefinitions.ts b/sdk/loadtesting/load-testing-rest/src/clientDefinitions.ts index aac5c99ec252..80b4ecb88618 100644 --- a/sdk/loadtesting/load-testing-rest/src/clientDefinitions.ts +++ b/sdk/loadtesting/load-testing-rest/src/clientDefinitions.ts @@ -2,337 +2,409 @@ // Licensed under the MIT license. import { - TestCreateOrUpdateParameters, - TestDeleteParameters, - TestGetParameters, - TestListParameters, - TestUploadFileParameters, - TestGetFileParameters, - TestDeleteFileParameters, - TestListFilesParameters, - TestCreateOrUpdateAppComponentsParameters, - TestListAppComponentsParameters, - TestCreateOrUpdateServerMetricsConfigParameters, - TestListServerMetricsConfigParameters, - TestRunDeleteParameters, - TestRunCreateOrUpdateParameters, - TestRunGetParameters, - TestRunGetFileParameters, - TestRunListParameters, - TestRunStopParameters, - TestRunListMetricNamespacesParameters, - TestRunListMetricDefinitionsParameters, - TestRunListMetricsParameters, - TestRunListMetricDimensionValuesParameters, - TestRunCreateOrUpdateAppComponentsParameters, - TestRunListAppComponentsParameters, - TestRunCreateOrUpdateServerMetricsConfigParameters, - TestRunListServerMetricsConfigParameters, + LoadTestAdministrationCreateOrUpdateTestParameters, + LoadTestAdministrationDeleteTestParameters, + LoadTestAdministrationGetTestParameters, + LoadTestAdministrationListTestsParameters, + LoadTestAdministrationUploadTestFileParameters, + LoadTestAdministrationGetTestFileParameters, + LoadTestAdministrationDeleteTestFileParameters, + LoadTestAdministrationListTestFilesParameters, + LoadTestAdministrationCreateOrUpdateAppComponentsParameters, + LoadTestAdministrationGetAppComponentsParameters, + LoadTestAdministrationCreateOrUpdateServerMetricsConfigParameters, + LoadTestAdministrationGetServerMetricsConfigParameters, + LoadTestRunGetTestRunParameters, + LoadTestRunCreateOrUpdateTestRunParameters, + LoadTestRunDeleteTestRunParameters, + LoadTestRunListTestRunsParameters, + LoadTestRunGetTestRunFileParameters, + LoadTestRunStopParameters, + LoadTestRunListMetricNamespacesParameters, + LoadTestRunListMetricDefinitionsParameters, + LoadTestRunListMetricsParameters, + LoadTestRunListMetricDimensionValuesParameters, + LoadTestRunCreateOrUpdateAppComponentsParameters, + LoadTestRunGetAppComponentsParameters, + LoadTestRunCreateOrUpdateServerMetricsConfigParameters, + LoadTestRunGetServerMetricsConfigParameters, } from "./parameters"; import { - TestCreateOrUpdate200Response, - TestCreateOrUpdate201Response, - TestCreateOrUpdateDefaultResponse, - TestDelete204Response, - TestDeleteDefaultResponse, - TestGet200Response, - TestGetDefaultResponse, - TestList200Response, - TestListDefaultResponse, - TestUploadFile201Response, - TestUploadFileDefaultResponse, - TestGetFile200Response, - TestGetFileDefaultResponse, - TestDeleteFile204Response, - TestDeleteFileDefaultResponse, - TestListFiles200Response, - TestListFilesDefaultResponse, - TestCreateOrUpdateAppComponents200Response, - TestCreateOrUpdateAppComponents201Response, - TestCreateOrUpdateAppComponentsDefaultResponse, - TestListAppComponents200Response, - TestListAppComponentsDefaultResponse, - TestCreateOrUpdateServerMetricsConfig200Response, - TestCreateOrUpdateServerMetricsConfig201Response, - TestCreateOrUpdateServerMetricsConfigDefaultResponse, - TestListServerMetricsConfig200Response, - TestListServerMetricsConfigDefaultResponse, - TestRunDelete204Response, - TestRunDeleteDefaultResponse, - TestRunCreateOrUpdate200Response, - TestRunCreateOrUpdate201Response, - TestRunCreateOrUpdateDefaultResponse, - TestRunGet200Response, - TestRunGetDefaultResponse, - TestRunGetFile200Response, - TestRunGetFileDefaultResponse, - TestRunList200Response, - TestRunListDefaultResponse, - TestRunStop200Response, - TestRunStopDefaultResponse, - TestRunListMetricNamespaces200Response, - TestRunListMetricNamespacesDefaultResponse, - TestRunListMetricDefinitions200Response, - TestRunListMetricDefinitionsDefaultResponse, - TestRunListMetrics200Response, - TestRunListMetricsDefaultResponse, - TestRunListMetricDimensionValues200Response, - TestRunListMetricDimensionValuesDefaultResponse, - TestRunCreateOrUpdateAppComponents200Response, - TestRunCreateOrUpdateAppComponents201Response, - TestRunCreateOrUpdateAppComponentsDefaultResponse, - TestRunListAppComponents200Response, - TestRunListAppComponentsDefaultResponse, - TestRunCreateOrUpdateServerMetricsConfig200Response, - TestRunCreateOrUpdateServerMetricsConfig201Response, - TestRunCreateOrUpdateServerMetricsConfigDefaultResponse, - TestRunListServerMetricsConfig200Response, - TestRunListServerMetricsConfigDefaultResponse, + LoadTestAdministrationCreateOrUpdateTest200Response, + LoadTestAdministrationCreateOrUpdateTest201Response, + LoadTestAdministrationCreateOrUpdateTestDefaultResponse, + LoadTestAdministrationDeleteTest204Response, + LoadTestAdministrationDeleteTestDefaultResponse, + LoadTestAdministrationGetTest200Response, + LoadTestAdministrationGetTestDefaultResponse, + LoadTestAdministrationListTests200Response, + LoadTestAdministrationListTestsDefaultResponse, + LoadTestAdministrationUploadTestFile201Response, + LoadTestAdministrationUploadTestFileDefaultResponse, + LoadTestAdministrationGetTestFile200Response, + LoadTestAdministrationGetTestFileDefaultResponse, + LoadTestAdministrationDeleteTestFile204Response, + LoadTestAdministrationDeleteTestFileDefaultResponse, + LoadTestAdministrationListTestFiles200Response, + LoadTestAdministrationListTestFilesDefaultResponse, + LoadTestAdministrationCreateOrUpdateAppComponents200Response, + LoadTestAdministrationCreateOrUpdateAppComponents201Response, + LoadTestAdministrationCreateOrUpdateAppComponentsDefaultResponse, + LoadTestAdministrationGetAppComponents200Response, + LoadTestAdministrationGetAppComponentsDefaultResponse, + LoadTestAdministrationCreateOrUpdateServerMetricsConfig200Response, + LoadTestAdministrationCreateOrUpdateServerMetricsConfig201Response, + LoadTestAdministrationCreateOrUpdateServerMetricsConfigDefaultResponse, + LoadTestAdministrationGetServerMetricsConfig200Response, + LoadTestAdministrationGetServerMetricsConfigDefaultResponse, + LoadTestRunGetTestRun200Response, + LoadTestRunGetTestRunDefaultResponse, + LoadTestRunCreateOrUpdateTestRun200Response, + LoadTestRunCreateOrUpdateTestRun201Response, + LoadTestRunCreateOrUpdateTestRunDefaultResponse, + LoadTestRunDeleteTestRun204Response, + LoadTestRunDeleteTestRunDefaultResponse, + LoadTestRunListTestRuns200Response, + LoadTestRunListTestRunsDefaultResponse, + LoadTestRunGetTestRunFile200Response, + LoadTestRunGetTestRunFileDefaultResponse, + LoadTestRunStop200Response, + LoadTestRunStopDefaultResponse, + LoadTestRunListMetricNamespaces200Response, + LoadTestRunListMetricNamespacesDefaultResponse, + LoadTestRunListMetricDefinitions200Response, + LoadTestRunListMetricDefinitionsDefaultResponse, + LoadTestRunListMetrics200Response, + LoadTestRunListMetricsDefaultResponse, + LoadTestRunListMetricDimensionValues200Response, + LoadTestRunListMetricDimensionValuesDefaultResponse, + LoadTestRunCreateOrUpdateAppComponents200Response, + LoadTestRunCreateOrUpdateAppComponents201Response, + LoadTestRunCreateOrUpdateAppComponentsDefaultResponse, + LoadTestRunGetAppComponents200Response, + LoadTestRunGetAppComponentsDefaultResponse, + LoadTestRunCreateOrUpdateServerMetricsConfig200Response, + LoadTestRunCreateOrUpdateServerMetricsConfig201Response, + LoadTestRunCreateOrUpdateServerMetricsConfigDefaultResponse, + LoadTestRunGetServerMetricsConfig200Response, + LoadTestRunGetServerMetricsConfigDefaultResponse, } from "./responses"; import { Client, StreamableMethod } from "@azure-rest/core-client"; -export interface TestCreateOrUpdate { - /** Create a new test or update an existing test. */ +export interface LoadTestAdministrationCreateOrUpdateTest { + /** Create a new test or update an existing test by providing the test Id. */ patch( - options: TestCreateOrUpdateParameters + options: LoadTestAdministrationCreateOrUpdateTestParameters ): StreamableMethod< - | TestCreateOrUpdate200Response - | TestCreateOrUpdate201Response - | TestCreateOrUpdateDefaultResponse + | LoadTestAdministrationCreateOrUpdateTest200Response + | LoadTestAdministrationCreateOrUpdateTest201Response + | LoadTestAdministrationCreateOrUpdateTestDefaultResponse >; - /** Delete a test by its name. */ + /** Delete a test by its test Id. */ delete( - options?: TestDeleteParameters - ): StreamableMethod; - /** Get load test details by test name */ - get(options?: TestGetParameters): StreamableMethod; + options?: LoadTestAdministrationDeleteTestParameters + ): StreamableMethod< + | LoadTestAdministrationDeleteTest204Response + | LoadTestAdministrationDeleteTestDefaultResponse + >; + /** Get load test details by test Id */ + get( + options?: LoadTestAdministrationGetTestParameters + ): StreamableMethod< + | LoadTestAdministrationGetTest200Response + | LoadTestAdministrationGetTestDefaultResponse + >; } -export interface TestList { - /** Get all load tests by the fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. */ +export interface LoadTestAdministrationListTests { + /** + * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + */ get( - options?: TestListParameters - ): StreamableMethod; + options?: LoadTestAdministrationListTestsParameters + ): StreamableMethod< + | LoadTestAdministrationListTests200Response + | LoadTestAdministrationListTestsDefaultResponse + >; } -export interface TestUploadFile { - /** Upload input file for a given test name. File size can't be more than 50 MB. Existing file with same name for the given test will be overwritten. File should be provided in the request body as application/octet-stream. */ +export interface LoadTestAdministrationUploadTestFile { + /** + * Upload input file for a given test Id. File size can't be more than 50 MB. + * Existing file with same name for the given test will be overwritten. File + * should be provided in the request body as application/octet-stream. + */ put( - options: TestUploadFileParameters - ): StreamableMethod; - /** Get test file by the file name. */ + options: LoadTestAdministrationUploadTestFileParameters + ): StreamableMethod< + | LoadTestAdministrationUploadTestFile201Response + | LoadTestAdministrationUploadTestFileDefaultResponse + >; + /** Get all the files that are associated with a test. */ get( - options?: TestGetFileParameters - ): StreamableMethod; + options?: LoadTestAdministrationGetTestFileParameters + ): StreamableMethod< + | LoadTestAdministrationGetTestFile200Response + | LoadTestAdministrationGetTestFileDefaultResponse + >; /** Delete file by the file name for a test */ delete( - options?: TestDeleteFileParameters - ): StreamableMethod; + options?: LoadTestAdministrationDeleteTestFileParameters + ): StreamableMethod< + | LoadTestAdministrationDeleteTestFile204Response + | LoadTestAdministrationDeleteTestFileDefaultResponse + >; } -export interface TestListFiles { +export interface LoadTestAdministrationListTestFiles { /** Get all test files. */ get( - options?: TestListFilesParameters - ): StreamableMethod; + options?: LoadTestAdministrationListTestFilesParameters + ): StreamableMethod< + | LoadTestAdministrationListTestFiles200Response + | LoadTestAdministrationListTestFilesDefaultResponse + >; } -export interface TestCreateOrUpdateAppComponents { - /** Associate an app component (collection of azure resources) to a test */ +export interface LoadTestAdministrationCreateOrUpdateAppComponents { + /** Add an app component to a test by providing the resource Id, name and type. */ patch( - options: TestCreateOrUpdateAppComponentsParameters + options: LoadTestAdministrationCreateOrUpdateAppComponentsParameters ): StreamableMethod< - | TestCreateOrUpdateAppComponents200Response - | TestCreateOrUpdateAppComponents201Response - | TestCreateOrUpdateAppComponentsDefaultResponse + | LoadTestAdministrationCreateOrUpdateAppComponents200Response + | LoadTestAdministrationCreateOrUpdateAppComponents201Response + | LoadTestAdministrationCreateOrUpdateAppComponentsDefaultResponse >; /** Get associated app component (collection of azure resources) for the given test. */ get( - options?: TestListAppComponentsParameters - ): StreamableMethod; + options?: LoadTestAdministrationGetAppComponentsParameters + ): StreamableMethod< + | LoadTestAdministrationGetAppComponents200Response + | LoadTestAdministrationGetAppComponentsDefaultResponse + >; } -export interface TestCreateOrUpdateServerMetricsConfig { +export interface LoadTestAdministrationCreateOrUpdateServerMetricsConfig { /** Configure server metrics for a test */ patch( - options: TestCreateOrUpdateServerMetricsConfigParameters + options: LoadTestAdministrationCreateOrUpdateServerMetricsConfigParameters ): StreamableMethod< - | TestCreateOrUpdateServerMetricsConfig200Response - | TestCreateOrUpdateServerMetricsConfig201Response - | TestCreateOrUpdateServerMetricsConfigDefaultResponse + | LoadTestAdministrationCreateOrUpdateServerMetricsConfig200Response + | LoadTestAdministrationCreateOrUpdateServerMetricsConfig201Response + | LoadTestAdministrationCreateOrUpdateServerMetricsConfigDefaultResponse >; /** List server metrics configuration for the given test. */ get( - options?: TestListServerMetricsConfigParameters + options?: LoadTestAdministrationGetServerMetricsConfigParameters ): StreamableMethod< - TestListServerMetricsConfig200Response | TestListServerMetricsConfigDefaultResponse + | LoadTestAdministrationGetServerMetricsConfig200Response + | LoadTestAdministrationGetServerMetricsConfigDefaultResponse >; } -export interface TestRunDelete { - /** Delete a test run by its name. */ - delete( - options?: TestRunDeleteParameters - ): StreamableMethod; - /** Create and start a new test run with the given name. */ +export interface LoadTestRunGetTestRun { + /** Get test run details by test run Id. */ + get( + options?: LoadTestRunGetTestRunParameters + ): StreamableMethod< + LoadTestRunGetTestRun200Response | LoadTestRunGetTestRunDefaultResponse + >; + /** Create and start a new test run with the given test run Id. */ patch( - options: TestRunCreateOrUpdateParameters + options: LoadTestRunCreateOrUpdateTestRunParameters ): StreamableMethod< - | TestRunCreateOrUpdate200Response - | TestRunCreateOrUpdate201Response - | TestRunCreateOrUpdateDefaultResponse + | LoadTestRunCreateOrUpdateTestRun200Response + | LoadTestRunCreateOrUpdateTestRun201Response + | LoadTestRunCreateOrUpdateTestRunDefaultResponse + >; + /** Delete an existing load test run by providing the testRunId. */ + delete( + options?: LoadTestRunDeleteTestRunParameters + ): StreamableMethod< + | LoadTestRunDeleteTestRun204Response + | LoadTestRunDeleteTestRunDefaultResponse >; - /** Get test run details by name. */ - get( - options?: TestRunGetParameters - ): StreamableMethod; } -export interface TestRunGetFile { - /** Get test run file by file name. */ +export interface LoadTestRunListTestRuns { + /** Get all test runs for the given filters. */ get( - options?: TestRunGetFileParameters - ): StreamableMethod; + options?: LoadTestRunListTestRunsParameters + ): StreamableMethod< + LoadTestRunListTestRuns200Response | LoadTestRunListTestRunsDefaultResponse + >; } -export interface TestRunList { - /** Get all test runs with given filters */ +export interface LoadTestRunGetTestRunFile { + /** Get test run file by file name. */ get( - options?: TestRunListParameters - ): StreamableMethod; + options?: LoadTestRunGetTestRunFileParameters + ): StreamableMethod< + | LoadTestRunGetTestRunFile200Response + | LoadTestRunGetTestRunFileDefaultResponse + >; } -export interface TestRunStop { - /** Stop test run by name. */ +export interface LoadTestRunStop { + /** Stop test run by test run Id. */ post( - options?: TestRunStopParameters - ): StreamableMethod; + options?: LoadTestRunStopParameters + ): StreamableMethod< + LoadTestRunStop200Response | LoadTestRunStopDefaultResponse + >; } -export interface TestRunListMetricNamespaces { +export interface LoadTestRunListMetricNamespaces { /** List the metric namespaces for a load test run. */ get( - options?: TestRunListMetricNamespacesParameters + options?: LoadTestRunListMetricNamespacesParameters ): StreamableMethod< - TestRunListMetricNamespaces200Response | TestRunListMetricNamespacesDefaultResponse + | LoadTestRunListMetricNamespaces200Response + | LoadTestRunListMetricNamespacesDefaultResponse >; } -export interface TestRunListMetricDefinitions { +export interface LoadTestRunListMetricDefinitions { /** List the metric definitions for a load test run. */ get( - options: TestRunListMetricDefinitionsParameters + options: LoadTestRunListMetricDefinitionsParameters ): StreamableMethod< - TestRunListMetricDefinitions200Response | TestRunListMetricDefinitionsDefaultResponse + | LoadTestRunListMetricDefinitions200Response + | LoadTestRunListMetricDefinitionsDefaultResponse >; } -export interface TestRunListMetrics { +export interface LoadTestRunListMetrics { /** List the metric values for a load test run. */ post( - options: TestRunListMetricsParameters - ): StreamableMethod; + options: LoadTestRunListMetricsParameters + ): StreamableMethod< + LoadTestRunListMetrics200Response | LoadTestRunListMetricsDefaultResponse + >; } -export interface TestRunListMetricDimensionValues { +export interface LoadTestRunListMetricDimensionValues { /** List the dimension values for the given metric dimension name. */ get( - options: TestRunListMetricDimensionValuesParameters + options: LoadTestRunListMetricDimensionValuesParameters ): StreamableMethod< - TestRunListMetricDimensionValues200Response | TestRunListMetricDimensionValuesDefaultResponse + | LoadTestRunListMetricDimensionValues200Response + | LoadTestRunListMetricDimensionValuesDefaultResponse >; } -export interface TestRunCreateOrUpdateAppComponents { - /** Associate an app component (collection of azure resources) to a test run */ +export interface LoadTestRunCreateOrUpdateAppComponents { + /** Add an app component to a test run by providing the resource Id, name and type. */ patch( - options: TestRunCreateOrUpdateAppComponentsParameters + options: LoadTestRunCreateOrUpdateAppComponentsParameters ): StreamableMethod< - | TestRunCreateOrUpdateAppComponents200Response - | TestRunCreateOrUpdateAppComponents201Response - | TestRunCreateOrUpdateAppComponentsDefaultResponse + | LoadTestRunCreateOrUpdateAppComponents200Response + | LoadTestRunCreateOrUpdateAppComponents201Response + | LoadTestRunCreateOrUpdateAppComponentsDefaultResponse >; - /** Get associated app component (collection of azure resources) for the given test run. */ + /** + * Get associated app component (collection of azure resources) for the given test + * run. + */ get( - options?: TestRunListAppComponentsParameters + options?: LoadTestRunGetAppComponentsParameters ): StreamableMethod< - TestRunListAppComponents200Response | TestRunListAppComponentsDefaultResponse + | LoadTestRunGetAppComponents200Response + | LoadTestRunGetAppComponentsDefaultResponse >; } -export interface TestRunCreateOrUpdateServerMetricsConfig { +export interface LoadTestRunCreateOrUpdateServerMetricsConfig { /** Configure server metrics for a test run */ patch( - options: TestRunCreateOrUpdateServerMetricsConfigParameters + options: LoadTestRunCreateOrUpdateServerMetricsConfigParameters ): StreamableMethod< - | TestRunCreateOrUpdateServerMetricsConfig200Response - | TestRunCreateOrUpdateServerMetricsConfig201Response - | TestRunCreateOrUpdateServerMetricsConfigDefaultResponse + | LoadTestRunCreateOrUpdateServerMetricsConfig200Response + | LoadTestRunCreateOrUpdateServerMetricsConfig201Response + | LoadTestRunCreateOrUpdateServerMetricsConfigDefaultResponse >; - /** List server metrics configuration for the given test run. */ + /** Get associated server metrics configuration for the given test run. */ get( - options?: TestRunListServerMetricsConfigParameters + options?: LoadTestRunGetServerMetricsConfigParameters ): StreamableMethod< - TestRunListServerMetricsConfig200Response | TestRunListServerMetricsConfigDefaultResponse + | LoadTestRunGetServerMetricsConfig200Response + | LoadTestRunGetServerMetricsConfigDefaultResponse >; } export interface Routes { /** Resource for '/tests/\{testId\}' has methods for the following verbs: patch, delete, get */ - (path: "/tests/{testId}", testId: string): TestCreateOrUpdate; + ( + path: "/tests/{testId}", + testId: string + ): LoadTestAdministrationCreateOrUpdateTest; /** Resource for '/tests' has methods for the following verbs: get */ - (path: "/tests"): TestList; + (path: "/tests"): LoadTestAdministrationListTests; /** Resource for '/tests/\{testId\}/files/\{fileName\}' has methods for the following verbs: put, get, delete */ - (path: "/tests/{testId}/files/{fileName}", testId: string, fileName: string): TestUploadFile; + ( + path: "/tests/{testId}/files/{fileName}", + testId: string, + fileName: string + ): LoadTestAdministrationUploadTestFile; /** Resource for '/tests/\{testId\}/files' has methods for the following verbs: get */ - (path: "/tests/{testId}/files", testId: string): TestListFiles; + ( + path: "/tests/{testId}/files", + testId: string + ): LoadTestAdministrationListTestFiles; /** Resource for '/tests/\{testId\}/app-components' has methods for the following verbs: patch, get */ - (path: "/tests/{testId}/app-components", testId: string): TestCreateOrUpdateAppComponents; + ( + path: "/tests/{testId}/app-components", + testId: string + ): LoadTestAdministrationCreateOrUpdateAppComponents; /** Resource for '/tests/\{testId\}/server-metrics-config' has methods for the following verbs: patch, get */ ( path: "/tests/{testId}/server-metrics-config", testId: string - ): TestCreateOrUpdateServerMetricsConfig; - /** Resource for '/test-runs/\{testRunId\}' has methods for the following verbs: delete, patch, get */ - (path: "/test-runs/{testRunId}", testRunId: string): TestRunDelete; + ): LoadTestAdministrationCreateOrUpdateServerMetricsConfig; + /** Resource for '/test-runs/\{testRunId\}' has methods for the following verbs: get, patch, delete */ + (path: "/test-runs/{testRunId}", testRunId: string): LoadTestRunGetTestRun; + /** Resource for '/test-runs' has methods for the following verbs: get */ + (path: "/test-runs"): LoadTestRunListTestRuns; /** Resource for '/test-runs/\{testRunId\}/files/\{fileName\}' has methods for the following verbs: get */ ( path: "/test-runs/{testRunId}/files/{fileName}", testRunId: string, fileName: string - ): TestRunGetFile; - /** Resource for '/test-runs' has methods for the following verbs: get */ - (path: "/test-runs"): TestRunList; + ): LoadTestRunGetTestRunFile; /** Resource for '/test-runs/\{testRunId\}:stop' has methods for the following verbs: post */ - (path: "/test-runs/{testRunId}:stop", testRunId: string): TestRunStop; + (path: "/test-runs/{testRunId}:stop", testRunId: string): LoadTestRunStop; /** Resource for '/test-runs/\{testRunId\}/metric-namespaces' has methods for the following verbs: get */ ( path: "/test-runs/{testRunId}/metric-namespaces", testRunId: string - ): TestRunListMetricNamespaces; + ): LoadTestRunListMetricNamespaces; /** Resource for '/test-runs/\{testRunId\}/metric-definitions' has methods for the following verbs: get */ ( path: "/test-runs/{testRunId}/metric-definitions", testRunId: string - ): TestRunListMetricDefinitions; + ): LoadTestRunListMetricDefinitions; /** Resource for '/test-runs/\{testRunId\}/metrics' has methods for the following verbs: post */ - (path: "/test-runs/{testRunId}/metrics", testRunId: string): TestRunListMetrics; + ( + path: "/test-runs/{testRunId}/metrics", + testRunId: string + ): LoadTestRunListMetrics; /** Resource for '/test-runs/\{testRunId\}/metric-dimensions/\{name\}/values' has methods for the following verbs: get */ ( path: "/test-runs/{testRunId}/metric-dimensions/{name}/values", testRunId: string, name: string - ): TestRunListMetricDimensionValues; + ): LoadTestRunListMetricDimensionValues; /** Resource for '/test-runs/\{testRunId\}/app-components' has methods for the following verbs: patch, get */ ( path: "/test-runs/{testRunId}/app-components", testRunId: string - ): TestRunCreateOrUpdateAppComponents; + ): LoadTestRunCreateOrUpdateAppComponents; /** Resource for '/test-runs/\{testRunId\}/server-metrics-config' has methods for the following verbs: patch, get */ ( path: "/test-runs/{testRunId}/server-metrics-config", testRunId: string - ): TestRunCreateOrUpdateServerMetricsConfig; + ): LoadTestRunCreateOrUpdateServerMetricsConfig; } export type AzureLoadTestingClient = Client & { diff --git a/sdk/loadtesting/load-testing-rest/src/getFileValidationPoller.ts b/sdk/loadtesting/load-testing-rest/src/getFileValidationPoller.ts deleted file mode 100644 index adaf586b85b5..000000000000 --- a/sdk/loadtesting/load-testing-rest/src/getFileValidationPoller.ts +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import { AbortController, AbortError, AbortSignalLike } from "@azure/abort-controller"; -import { CancelOnProgress, OperationState, SimplePollerLike } from "@azure/core-lro"; -import { FileUploadAndValidatePoller, PolledOperationOptions } from "./models"; -import { AzureLoadTestingClient } from "./clientDefinitions"; -import { TestGetFile200Response, TestUploadFile201Response } from "./responses"; -import { isUnexpected } from "./isUnexpected"; -import { sleep } from "./util/LROUtil"; - -/** - * Uploads a file and creates a poller to poll for validation. - * @param client - The Load Testing client. - * @param options - The operation options. - * @returns A poller which can be called to poll until completion of the job. - */ -export async function getFileValidationPoller( - client: AzureLoadTestingClient, - fileUploadResult: TestUploadFile201Response, - polledOperationOptions: PolledOperationOptions = {} -): Promise { - // get filename and testid from initial response - const fileName = fileUploadResult.body.fileName; - const requestUrl = fileUploadResult.request.url; - const testId = requestUrl.substring( - requestUrl.indexOf("tests/") + 6, - requestUrl.lastIndexOf("/files") - ); - type Handler = (state: OperationState) => void; - - const state: OperationState = { - status: "notStarted", - }; - - const progressCallbacks = new Map(); - const processProgressCallbacks = async (): Promise => - progressCallbacks.forEach((h) => h(state)); - let resultPromise: Promise | undefined; - let cancelJob: (() => void) | undefined; - const abortController = new AbortController(); - const currentPollIntervalInMs = polledOperationOptions.updateIntervalInMs ?? 2000; - - const poller: SimplePollerLike, TestGetFile200Response> = { - async poll(options?: { abortSignal?: AbortSignalLike }): Promise { - if (options?.abortSignal?.aborted) { - throw new AbortError("The polling was aborted."); - } - - if (fileName) { - const fileValidationResponse = await client - .path("/tests/{testId}/files/{fileName}", testId, fileName) - .get(); - if (isUnexpected(fileValidationResponse)) { - state.status = "failed"; - state.error = new Error(fileValidationResponse.body.error.message); - return; - } - - switch (fileValidationResponse.body.validationStatus) { - case "NOT_VALIDATED": { - if (fileValidationResponse.body.fileType === "JMX_FILE") { - state.status = "running"; - } else { - state.status = "succeeded"; - } - break; - } - case "VALIDATION_INITIATED": { - state.status = "running"; - break; - } - case "VALIDATION_SUCCESS": - case "VALIDATION_NOT_REQUIRED": { - state.status = "succeeded"; - break; - } - case "VALIDATION_FAILURE": { - state.status = "failed"; - state.error = new Error(fileValidationResponse.body.validationFailureDetails); - break; - } - } - state.result = fileValidationResponse; - - await processProgressCallbacks(); - } - }, - - pollUntilDone(pollOptions?: { - abortSignal?: AbortSignalLike; - }): Promise { - return (resultPromise ??= (async () => { - const { abortSignal: inputAbortSignal } = pollOptions || {}; - const { signal: abortSignal } = inputAbortSignal - ? new AbortController([inputAbortSignal, abortController.signal]) - : abortController; - if (!poller.isDone()) { - await poller.poll({ abortSignal }); - while (!poller.isDone()) { - const delay = sleep(currentPollIntervalInMs, abortSignal); - cancelJob = () => abortController.abort(); - await delay; - await poller.poll({ abortSignal }); - } - } - switch (state.status) { - case "succeeded": - case "failed": - case "canceled": { - return poller.getResult() as TestGetFile200Response; - } - case "notStarted": - case "running": { - // Unreachable - throw new Error(`polling completed without succeeding or failing`); - } - } - })().finally(() => { - resultPromise = undefined; - })); - }, - - onProgress( - callback: (state: OperationState) => void - ): CancelOnProgress { - const s = Symbol(); - progressCallbacks.set(s, callback); - - return () => progressCallbacks.delete(s); - }, - - isDone(): boolean { - return ["succeeded", "failed", "canceled"].includes(state.status); - }, - - stopPolling(): void { - abortController.abort(); - cancelJob?.(); - }, - - isStopped(): boolean { - return resultPromise === undefined; - }, - - getOperationState(): OperationState { - return state; - }, - - getResult(): TestGetFile200Response | undefined { - return state.result; - }, - - toString() { - return JSON.stringify({ state }); - }, - }; - - return poller; -} diff --git a/sdk/loadtesting/load-testing-rest/src/getTestRunCompletionPoller.ts b/sdk/loadtesting/load-testing-rest/src/getTestRunCompletionPoller.ts deleted file mode 100644 index 4566f025ce00..000000000000 --- a/sdk/loadtesting/load-testing-rest/src/getTestRunCompletionPoller.ts +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import { AbortController, AbortError, AbortSignalLike } from "@azure/abort-controller"; -import { CancelOnProgress, OperationState, SimplePollerLike } from "@azure/core-lro"; -import { TestRunCompletionPoller, PolledOperationOptions } from "./models"; -import { AzureLoadTestingClient } from "./clientDefinitions"; -import { - TestRunCreateOrUpdate200Response, - TestRunCreateOrUpdate201Response, - TestRunGet200Response, -} from "./responses"; -import { isUnexpected } from "./isUnexpected"; -import { sleep, isTestRunInProgress } from "./util/LROUtil"; - -/** - * Creates a poller to poll for test run status. - * @param client - The Load Testing client. - * @param options - The operation options. - * @returns A poller which can be called to poll until completion of the job. - */ -export async function getTestRunCompletionPoller( - client: AzureLoadTestingClient, - createTestRunResponse: TestRunCreateOrUpdate200Response | TestRunCreateOrUpdate201Response, - polledOperationOptions: PolledOperationOptions = {} -): Promise { - type Handler = (state: OperationState) => void; - - const state: OperationState = { - status: "notStarted", - }; - - const progressCallbacks = new Map(); - const processProgressCallbacks = async (): Promise => - progressCallbacks.forEach((h) => h(state)); - let resultPromise: Promise | undefined; - let cancelJob: (() => void) | undefined; - const abortController = new AbortController(); - const currentPollIntervalInMs = polledOperationOptions.updateIntervalInMs ?? 2000; - const testRunId = createTestRunResponse.body.testRunId; - - const poller: SimplePollerLike, TestRunGet200Response> = { - async poll(options?: { abortSignal?: AbortSignalLike }): Promise { - if (options?.abortSignal?.aborted) { - throw new AbortError("The polling was aborted."); - } - - if (testRunId) { - const getTestRunResult = await client.path("/test-runs/{testRunId}", testRunId).get(); - if (isUnexpected(getTestRunResult)) { - state.status = "failed"; - state.error = new Error(getTestRunResult.body.error.message); - return; - } - - if (getTestRunResult.body.status === "FAILED") { - state.status = "failed"; - state.error = new Error(getTestRunResult.body.status); - } - - if (getTestRunResult.body.status === "CANCELLED") { - state.status = "canceled"; - } - - if (getTestRunResult.body.status === "DONE") { - state.status = "succeeded"; - } - - if (isTestRunInProgress(getTestRunResult.body)) { - state.status = "running"; - } - state.result = getTestRunResult; - await processProgressCallbacks(); - } - }, - - pollUntilDone(pollOptions?: { abortSignal?: AbortSignalLike }): Promise { - return (resultPromise ??= (async () => { - const { abortSignal: inputAbortSignal } = pollOptions || {}; - const { signal: abortSignal } = inputAbortSignal - ? new AbortController([inputAbortSignal, abortController.signal]) - : abortController; - if (!poller.isDone()) { - await poller.poll({ abortSignal }); - while (!poller.isDone()) { - const delay = sleep(currentPollIntervalInMs, abortSignal); - cancelJob = () => abortController.abort(); - await delay; - await poller.poll({ abortSignal }); - } - } - switch (state.status) { - case "succeeded": - case "failed": - case "canceled": { - return poller.getResult() as TestRunGet200Response; - } - case "notStarted": - case "running": { - // Unreachable - throw new Error(`polling completed without succeeding or failing`); - } - } - })().finally(() => { - resultPromise = undefined; - })); - }, - - onProgress(callback: (state: OperationState) => void): CancelOnProgress { - const s = Symbol(); - progressCallbacks.set(s, callback); - - return () => progressCallbacks.delete(s); - }, - - isDone(): boolean { - return ["succeeded", "failed", "canceled"].includes(state.status); - }, - - stopPolling(): void { - abortController.abort(); - cancelJob?.(); - }, - - isStopped(): boolean { - return resultPromise === undefined; - }, - - getOperationState(): OperationState { - return state; - }, - - getResult(): TestRunGet200Response | undefined { - return state.result; - }, - - toString() { - return JSON.stringify({ state }); - }, - }; - - return poller; -} diff --git a/sdk/loadtesting/load-testing-rest/src/index.ts b/sdk/loadtesting/load-testing-rest/src/index.ts index 3dc576e82dcc..c89f862565f6 100644 --- a/sdk/loadtesting/load-testing-rest/src/index.ts +++ b/sdk/loadtesting/load-testing-rest/src/index.ts @@ -11,5 +11,5 @@ export * from "./isUnexpected"; export * from "./models"; export * from "./outputModels"; export * from "./paginateHelper"; -export { getLongRunningPoller } from "./pollingHelper"; + export default AzureLoadTesting; diff --git a/sdk/loadtesting/load-testing-rest/src/isUnexpected.ts b/sdk/loadtesting/load-testing-rest/src/isUnexpected.ts index 80cb61595245..66e069e21390 100644 --- a/sdk/loadtesting/load-testing-rest/src/isUnexpected.ts +++ b/sdk/loadtesting/load-testing-rest/src/isUnexpected.ts @@ -2,64 +2,64 @@ // Licensed under the MIT license. import { - TestCreateOrUpdate200Response, - TestCreateOrUpdate201Response, - TestCreateOrUpdateDefaultResponse, - TestDelete204Response, - TestDeleteDefaultResponse, - TestGet200Response, - TestGetDefaultResponse, - TestList200Response, - TestListDefaultResponse, - TestUploadFile201Response, - TestUploadFileDefaultResponse, - TestGetFile200Response, - TestGetFileDefaultResponse, - TestDeleteFile204Response, - TestDeleteFileDefaultResponse, - TestListFiles200Response, - TestListFilesDefaultResponse, - TestCreateOrUpdateAppComponents200Response, - TestCreateOrUpdateAppComponents201Response, - TestCreateOrUpdateAppComponentsDefaultResponse, - TestListAppComponents200Response, - TestListAppComponentsDefaultResponse, - TestCreateOrUpdateServerMetricsConfig200Response, - TestCreateOrUpdateServerMetricsConfig201Response, - TestCreateOrUpdateServerMetricsConfigDefaultResponse, - TestListServerMetricsConfig200Response, - TestListServerMetricsConfigDefaultResponse, - TestRunDelete204Response, - TestRunDeleteDefaultResponse, - TestRunCreateOrUpdate200Response, - TestRunCreateOrUpdate201Response, - TestRunCreateOrUpdateDefaultResponse, - TestRunGet200Response, - TestRunGetDefaultResponse, - TestRunGetFile200Response, - TestRunGetFileDefaultResponse, - TestRunList200Response, - TestRunListDefaultResponse, - TestRunStop200Response, - TestRunStopDefaultResponse, - TestRunListMetricNamespaces200Response, - TestRunListMetricNamespacesDefaultResponse, - TestRunListMetricDefinitions200Response, - TestRunListMetricDefinitionsDefaultResponse, - TestRunListMetrics200Response, - TestRunListMetricsDefaultResponse, - TestRunListMetricDimensionValues200Response, - TestRunListMetricDimensionValuesDefaultResponse, - TestRunCreateOrUpdateAppComponents200Response, - TestRunCreateOrUpdateAppComponents201Response, - TestRunCreateOrUpdateAppComponentsDefaultResponse, - TestRunListAppComponents200Response, - TestRunListAppComponentsDefaultResponse, - TestRunCreateOrUpdateServerMetricsConfig200Response, - TestRunCreateOrUpdateServerMetricsConfig201Response, - TestRunCreateOrUpdateServerMetricsConfigDefaultResponse, - TestRunListServerMetricsConfig200Response, - TestRunListServerMetricsConfigDefaultResponse, + LoadTestAdministrationCreateOrUpdateTest200Response, + LoadTestAdministrationCreateOrUpdateTest201Response, + LoadTestAdministrationCreateOrUpdateTestDefaultResponse, + LoadTestAdministrationDeleteTest204Response, + LoadTestAdministrationDeleteTestDefaultResponse, + LoadTestAdministrationGetTest200Response, + LoadTestAdministrationGetTestDefaultResponse, + LoadTestAdministrationListTests200Response, + LoadTestAdministrationListTestsDefaultResponse, + LoadTestAdministrationUploadTestFile201Response, + LoadTestAdministrationUploadTestFileDefaultResponse, + LoadTestAdministrationGetTestFile200Response, + LoadTestAdministrationGetTestFileDefaultResponse, + LoadTestAdministrationDeleteTestFile204Response, + LoadTestAdministrationDeleteTestFileDefaultResponse, + LoadTestAdministrationListTestFiles200Response, + LoadTestAdministrationListTestFilesDefaultResponse, + LoadTestAdministrationCreateOrUpdateAppComponents200Response, + LoadTestAdministrationCreateOrUpdateAppComponents201Response, + LoadTestAdministrationCreateOrUpdateAppComponentsDefaultResponse, + LoadTestAdministrationGetAppComponents200Response, + LoadTestAdministrationGetAppComponentsDefaultResponse, + LoadTestAdministrationCreateOrUpdateServerMetricsConfig200Response, + LoadTestAdministrationCreateOrUpdateServerMetricsConfig201Response, + LoadTestAdministrationCreateOrUpdateServerMetricsConfigDefaultResponse, + LoadTestAdministrationGetServerMetricsConfig200Response, + LoadTestAdministrationGetServerMetricsConfigDefaultResponse, + LoadTestRunGetTestRun200Response, + LoadTestRunGetTestRunDefaultResponse, + LoadTestRunCreateOrUpdateTestRun200Response, + LoadTestRunCreateOrUpdateTestRun201Response, + LoadTestRunCreateOrUpdateTestRunDefaultResponse, + LoadTestRunDeleteTestRun204Response, + LoadTestRunDeleteTestRunDefaultResponse, + LoadTestRunListTestRuns200Response, + LoadTestRunListTestRunsDefaultResponse, + LoadTestRunGetTestRunFile200Response, + LoadTestRunGetTestRunFileDefaultResponse, + LoadTestRunStop200Response, + LoadTestRunStopDefaultResponse, + LoadTestRunListMetricNamespaces200Response, + LoadTestRunListMetricNamespacesDefaultResponse, + LoadTestRunListMetricDefinitions200Response, + LoadTestRunListMetricDefinitionsDefaultResponse, + LoadTestRunListMetrics200Response, + LoadTestRunListMetricsDefaultResponse, + LoadTestRunListMetricDimensionValues200Response, + LoadTestRunListMetricDimensionValuesDefaultResponse, + LoadTestRunCreateOrUpdateAppComponents200Response, + LoadTestRunCreateOrUpdateAppComponents201Response, + LoadTestRunCreateOrUpdateAppComponentsDefaultResponse, + LoadTestRunGetAppComponents200Response, + LoadTestRunGetAppComponentsDefaultResponse, + LoadTestRunCreateOrUpdateServerMetricsConfig200Response, + LoadTestRunCreateOrUpdateServerMetricsConfig201Response, + LoadTestRunCreateOrUpdateServerMetricsConfigDefaultResponse, + LoadTestRunGetServerMetricsConfig200Response, + LoadTestRunGetServerMetricsConfigDefaultResponse, } from "./responses"; const responseMap: Record = { @@ -75,11 +75,11 @@ const responseMap: Record = { "GET /tests/{testId}/app-components": ["200"], "PATCH /tests/{testId}/server-metrics-config": ["200", "201"], "GET /tests/{testId}/server-metrics-config": ["200"], - "DELETE /test-runs/{testRunId}": ["204"], - "PATCH /test-runs/{testRunId}": ["200", "201"], "GET /test-runs/{testRunId}": ["200"], - "GET /test-runs/{testRunId}/files/{fileName}": ["200"], + "PATCH /test-runs/{testRunId}": ["200", "201"], + "DELETE /test-runs/{testRunId}": ["204"], "GET /test-runs": ["200"], + "GET /test-runs/{testRunId}/files/{fileName}": ["200"], "POST /test-runs/{testRunId}:stop": ["200"], "GET /test-runs/{testRunId}/metric-namespaces": ["200"], "GET /test-runs/{testRunId}/metric-definitions": ["200"], @@ -93,204 +93,244 @@ const responseMap: Record = { export function isUnexpected( response: - | TestCreateOrUpdate200Response - | TestCreateOrUpdate201Response - | TestCreateOrUpdateDefaultResponse -): response is TestCreateOrUpdateDefaultResponse; + | LoadTestAdministrationCreateOrUpdateTest200Response + | LoadTestAdministrationCreateOrUpdateTest201Response + | LoadTestAdministrationCreateOrUpdateTestDefaultResponse +): response is LoadTestAdministrationCreateOrUpdateTestDefaultResponse; export function isUnexpected( - response: TestDelete204Response | TestDeleteDefaultResponse -): response is TestDeleteDefaultResponse; + response: + | LoadTestAdministrationDeleteTest204Response + | LoadTestAdministrationDeleteTestDefaultResponse +): response is LoadTestAdministrationDeleteTestDefaultResponse; export function isUnexpected( - response: TestGet200Response | TestGetDefaultResponse -): response is TestGetDefaultResponse; + response: + | LoadTestAdministrationGetTest200Response + | LoadTestAdministrationGetTestDefaultResponse +): response is LoadTestAdministrationGetTestDefaultResponse; export function isUnexpected( - response: TestList200Response | TestListDefaultResponse -): response is TestListDefaultResponse; + response: + | LoadTestAdministrationListTests200Response + | LoadTestAdministrationListTestsDefaultResponse +): response is LoadTestAdministrationListTestsDefaultResponse; export function isUnexpected( - response: TestUploadFile201Response | TestUploadFileDefaultResponse -): response is TestUploadFileDefaultResponse; + response: + | LoadTestAdministrationUploadTestFile201Response + | LoadTestAdministrationUploadTestFileDefaultResponse +): response is LoadTestAdministrationUploadTestFileDefaultResponse; export function isUnexpected( - response: TestGetFile200Response | TestGetFileDefaultResponse -): response is TestGetFileDefaultResponse; + response: + | LoadTestAdministrationGetTestFile200Response + | LoadTestAdministrationGetTestFileDefaultResponse +): response is LoadTestAdministrationGetTestFileDefaultResponse; export function isUnexpected( - response: TestDeleteFile204Response | TestDeleteFileDefaultResponse -): response is TestDeleteFileDefaultResponse; + response: + | LoadTestAdministrationDeleteTestFile204Response + | LoadTestAdministrationDeleteTestFileDefaultResponse +): response is LoadTestAdministrationDeleteTestFileDefaultResponse; export function isUnexpected( - response: TestListFiles200Response | TestListFilesDefaultResponse -): response is TestListFilesDefaultResponse; + response: + | LoadTestAdministrationListTestFiles200Response + | LoadTestAdministrationListTestFilesDefaultResponse +): response is LoadTestAdministrationListTestFilesDefaultResponse; export function isUnexpected( response: - | TestCreateOrUpdateAppComponents200Response - | TestCreateOrUpdateAppComponents201Response - | TestCreateOrUpdateAppComponentsDefaultResponse -): response is TestCreateOrUpdateAppComponentsDefaultResponse; + | LoadTestAdministrationCreateOrUpdateAppComponents200Response + | LoadTestAdministrationCreateOrUpdateAppComponents201Response + | LoadTestAdministrationCreateOrUpdateAppComponentsDefaultResponse +): response is LoadTestAdministrationCreateOrUpdateAppComponentsDefaultResponse; export function isUnexpected( - response: TestListAppComponents200Response | TestListAppComponentsDefaultResponse -): response is TestListAppComponentsDefaultResponse; + response: + | LoadTestAdministrationGetAppComponents200Response + | LoadTestAdministrationGetAppComponentsDefaultResponse +): response is LoadTestAdministrationGetAppComponentsDefaultResponse; export function isUnexpected( response: - | TestCreateOrUpdateServerMetricsConfig200Response - | TestCreateOrUpdateServerMetricsConfig201Response - | TestCreateOrUpdateServerMetricsConfigDefaultResponse -): response is TestCreateOrUpdateServerMetricsConfigDefaultResponse; + | LoadTestAdministrationCreateOrUpdateServerMetricsConfig200Response + | LoadTestAdministrationCreateOrUpdateServerMetricsConfig201Response + | LoadTestAdministrationCreateOrUpdateServerMetricsConfigDefaultResponse +): response is LoadTestAdministrationCreateOrUpdateServerMetricsConfigDefaultResponse; export function isUnexpected( - response: TestListServerMetricsConfig200Response | TestListServerMetricsConfigDefaultResponse -): response is TestListServerMetricsConfigDefaultResponse; + response: + | LoadTestAdministrationGetServerMetricsConfig200Response + | LoadTestAdministrationGetServerMetricsConfigDefaultResponse +): response is LoadTestAdministrationGetServerMetricsConfigDefaultResponse; export function isUnexpected( - response: TestRunDelete204Response | TestRunDeleteDefaultResponse -): response is TestRunDeleteDefaultResponse; + response: + | LoadTestRunGetTestRun200Response + | LoadTestRunGetTestRunDefaultResponse +): response is LoadTestRunGetTestRunDefaultResponse; export function isUnexpected( response: - | TestRunCreateOrUpdate200Response - | TestRunCreateOrUpdate201Response - | TestRunCreateOrUpdateDefaultResponse -): response is TestRunCreateOrUpdateDefaultResponse; + | LoadTestRunCreateOrUpdateTestRun200Response + | LoadTestRunCreateOrUpdateTestRun201Response + | LoadTestRunCreateOrUpdateTestRunDefaultResponse +): response is LoadTestRunCreateOrUpdateTestRunDefaultResponse; export function isUnexpected( - response: TestRunGet200Response | TestRunGetDefaultResponse -): response is TestRunGetDefaultResponse; + response: + | LoadTestRunDeleteTestRun204Response + | LoadTestRunDeleteTestRunDefaultResponse +): response is LoadTestRunDeleteTestRunDefaultResponse; export function isUnexpected( - response: TestRunGetFile200Response | TestRunGetFileDefaultResponse -): response is TestRunGetFileDefaultResponse; + response: + | LoadTestRunListTestRuns200Response + | LoadTestRunListTestRunsDefaultResponse +): response is LoadTestRunListTestRunsDefaultResponse; export function isUnexpected( - response: TestRunList200Response | TestRunListDefaultResponse -): response is TestRunListDefaultResponse; + response: + | LoadTestRunGetTestRunFile200Response + | LoadTestRunGetTestRunFileDefaultResponse +): response is LoadTestRunGetTestRunFileDefaultResponse; export function isUnexpected( - response: TestRunStop200Response | TestRunStopDefaultResponse -): response is TestRunStopDefaultResponse; + response: LoadTestRunStop200Response | LoadTestRunStopDefaultResponse +): response is LoadTestRunStopDefaultResponse; export function isUnexpected( - response: TestRunListMetricNamespaces200Response | TestRunListMetricNamespacesDefaultResponse -): response is TestRunListMetricNamespacesDefaultResponse; + response: + | LoadTestRunListMetricNamespaces200Response + | LoadTestRunListMetricNamespacesDefaultResponse +): response is LoadTestRunListMetricNamespacesDefaultResponse; export function isUnexpected( - response: TestRunListMetricDefinitions200Response | TestRunListMetricDefinitionsDefaultResponse -): response is TestRunListMetricDefinitionsDefaultResponse; + response: + | LoadTestRunListMetricDefinitions200Response + | LoadTestRunListMetricDefinitionsDefaultResponse +): response is LoadTestRunListMetricDefinitionsDefaultResponse; export function isUnexpected( - response: TestRunListMetrics200Response | TestRunListMetricsDefaultResponse -): response is TestRunListMetricsDefaultResponse; + response: + | LoadTestRunListMetrics200Response + | LoadTestRunListMetricsDefaultResponse +): response is LoadTestRunListMetricsDefaultResponse; export function isUnexpected( response: - | TestRunListMetricDimensionValues200Response - | TestRunListMetricDimensionValuesDefaultResponse -): response is TestRunListMetricDimensionValuesDefaultResponse; + | LoadTestRunListMetricDimensionValues200Response + | LoadTestRunListMetricDimensionValuesDefaultResponse +): response is LoadTestRunListMetricDimensionValuesDefaultResponse; export function isUnexpected( response: - | TestRunCreateOrUpdateAppComponents200Response - | TestRunCreateOrUpdateAppComponents201Response - | TestRunCreateOrUpdateAppComponentsDefaultResponse -): response is TestRunCreateOrUpdateAppComponentsDefaultResponse; + | LoadTestRunCreateOrUpdateAppComponents200Response + | LoadTestRunCreateOrUpdateAppComponents201Response + | LoadTestRunCreateOrUpdateAppComponentsDefaultResponse +): response is LoadTestRunCreateOrUpdateAppComponentsDefaultResponse; export function isUnexpected( - response: TestRunListAppComponents200Response | TestRunListAppComponentsDefaultResponse -): response is TestRunListAppComponentsDefaultResponse; + response: + | LoadTestRunGetAppComponents200Response + | LoadTestRunGetAppComponentsDefaultResponse +): response is LoadTestRunGetAppComponentsDefaultResponse; export function isUnexpected( response: - | TestRunCreateOrUpdateServerMetricsConfig200Response - | TestRunCreateOrUpdateServerMetricsConfig201Response - | TestRunCreateOrUpdateServerMetricsConfigDefaultResponse -): response is TestRunCreateOrUpdateServerMetricsConfigDefaultResponse; + | LoadTestRunCreateOrUpdateServerMetricsConfig200Response + | LoadTestRunCreateOrUpdateServerMetricsConfig201Response + | LoadTestRunCreateOrUpdateServerMetricsConfigDefaultResponse +): response is LoadTestRunCreateOrUpdateServerMetricsConfigDefaultResponse; export function isUnexpected( response: - | TestRunListServerMetricsConfig200Response - | TestRunListServerMetricsConfigDefaultResponse -): response is TestRunListServerMetricsConfigDefaultResponse; + | LoadTestRunGetServerMetricsConfig200Response + | LoadTestRunGetServerMetricsConfigDefaultResponse +): response is LoadTestRunGetServerMetricsConfigDefaultResponse; export function isUnexpected( response: - | TestCreateOrUpdate200Response - | TestCreateOrUpdate201Response - | TestCreateOrUpdateDefaultResponse - | TestDelete204Response - | TestDeleteDefaultResponse - | TestGet200Response - | TestGetDefaultResponse - | TestList200Response - | TestListDefaultResponse - | TestUploadFile201Response - | TestUploadFileDefaultResponse - | TestGetFile200Response - | TestGetFileDefaultResponse - | TestDeleteFile204Response - | TestDeleteFileDefaultResponse - | TestListFiles200Response - | TestListFilesDefaultResponse - | TestCreateOrUpdateAppComponents200Response - | TestCreateOrUpdateAppComponents201Response - | TestCreateOrUpdateAppComponentsDefaultResponse - | TestListAppComponents200Response - | TestListAppComponentsDefaultResponse - | TestCreateOrUpdateServerMetricsConfig200Response - | TestCreateOrUpdateServerMetricsConfig201Response - | TestCreateOrUpdateServerMetricsConfigDefaultResponse - | TestListServerMetricsConfig200Response - | TestListServerMetricsConfigDefaultResponse - | TestRunDelete204Response - | TestRunDeleteDefaultResponse - | TestRunCreateOrUpdate200Response - | TestRunCreateOrUpdate201Response - | TestRunCreateOrUpdateDefaultResponse - | TestRunGet200Response - | TestRunGetDefaultResponse - | TestRunGetFile200Response - | TestRunGetFileDefaultResponse - | TestRunList200Response - | TestRunListDefaultResponse - | TestRunStop200Response - | TestRunStopDefaultResponse - | TestRunListMetricNamespaces200Response - | TestRunListMetricNamespacesDefaultResponse - | TestRunListMetricDefinitions200Response - | TestRunListMetricDefinitionsDefaultResponse - | TestRunListMetrics200Response - | TestRunListMetricsDefaultResponse - | TestRunListMetricDimensionValues200Response - | TestRunListMetricDimensionValuesDefaultResponse - | TestRunCreateOrUpdateAppComponents200Response - | TestRunCreateOrUpdateAppComponents201Response - | TestRunCreateOrUpdateAppComponentsDefaultResponse - | TestRunListAppComponents200Response - | TestRunListAppComponentsDefaultResponse - | TestRunCreateOrUpdateServerMetricsConfig200Response - | TestRunCreateOrUpdateServerMetricsConfig201Response - | TestRunCreateOrUpdateServerMetricsConfigDefaultResponse - | TestRunListServerMetricsConfig200Response - | TestRunListServerMetricsConfigDefaultResponse + | LoadTestAdministrationCreateOrUpdateTest200Response + | LoadTestAdministrationCreateOrUpdateTest201Response + | LoadTestAdministrationCreateOrUpdateTestDefaultResponse + | LoadTestAdministrationDeleteTest204Response + | LoadTestAdministrationDeleteTestDefaultResponse + | LoadTestAdministrationGetTest200Response + | LoadTestAdministrationGetTestDefaultResponse + | LoadTestAdministrationListTests200Response + | LoadTestAdministrationListTestsDefaultResponse + | LoadTestAdministrationUploadTestFile201Response + | LoadTestAdministrationUploadTestFileDefaultResponse + | LoadTestAdministrationGetTestFile200Response + | LoadTestAdministrationGetTestFileDefaultResponse + | LoadTestAdministrationDeleteTestFile204Response + | LoadTestAdministrationDeleteTestFileDefaultResponse + | LoadTestAdministrationListTestFiles200Response + | LoadTestAdministrationListTestFilesDefaultResponse + | LoadTestAdministrationCreateOrUpdateAppComponents200Response + | LoadTestAdministrationCreateOrUpdateAppComponents201Response + | LoadTestAdministrationCreateOrUpdateAppComponentsDefaultResponse + | LoadTestAdministrationGetAppComponents200Response + | LoadTestAdministrationGetAppComponentsDefaultResponse + | LoadTestAdministrationCreateOrUpdateServerMetricsConfig200Response + | LoadTestAdministrationCreateOrUpdateServerMetricsConfig201Response + | LoadTestAdministrationCreateOrUpdateServerMetricsConfigDefaultResponse + | LoadTestAdministrationGetServerMetricsConfig200Response + | LoadTestAdministrationGetServerMetricsConfigDefaultResponse + | LoadTestRunGetTestRun200Response + | LoadTestRunGetTestRunDefaultResponse + | LoadTestRunCreateOrUpdateTestRun200Response + | LoadTestRunCreateOrUpdateTestRun201Response + | LoadTestRunCreateOrUpdateTestRunDefaultResponse + | LoadTestRunDeleteTestRun204Response + | LoadTestRunDeleteTestRunDefaultResponse + | LoadTestRunListTestRuns200Response + | LoadTestRunListTestRunsDefaultResponse + | LoadTestRunGetTestRunFile200Response + | LoadTestRunGetTestRunFileDefaultResponse + | LoadTestRunStop200Response + | LoadTestRunStopDefaultResponse + | LoadTestRunListMetricNamespaces200Response + | LoadTestRunListMetricNamespacesDefaultResponse + | LoadTestRunListMetricDefinitions200Response + | LoadTestRunListMetricDefinitionsDefaultResponse + | LoadTestRunListMetrics200Response + | LoadTestRunListMetricsDefaultResponse + | LoadTestRunListMetricDimensionValues200Response + | LoadTestRunListMetricDimensionValuesDefaultResponse + | LoadTestRunCreateOrUpdateAppComponents200Response + | LoadTestRunCreateOrUpdateAppComponents201Response + | LoadTestRunCreateOrUpdateAppComponentsDefaultResponse + | LoadTestRunGetAppComponents200Response + | LoadTestRunGetAppComponentsDefaultResponse + | LoadTestRunCreateOrUpdateServerMetricsConfig200Response + | LoadTestRunCreateOrUpdateServerMetricsConfig201Response + | LoadTestRunCreateOrUpdateServerMetricsConfigDefaultResponse + | LoadTestRunGetServerMetricsConfig200Response + | LoadTestRunGetServerMetricsConfigDefaultResponse ): response is - | TestCreateOrUpdateDefaultResponse - | TestDeleteDefaultResponse - | TestGetDefaultResponse - | TestListDefaultResponse - | TestUploadFileDefaultResponse - | TestGetFileDefaultResponse - | TestDeleteFileDefaultResponse - | TestListFilesDefaultResponse - | TestCreateOrUpdateAppComponentsDefaultResponse - | TestListAppComponentsDefaultResponse - | TestCreateOrUpdateServerMetricsConfigDefaultResponse - | TestListServerMetricsConfigDefaultResponse - | TestRunDeleteDefaultResponse - | TestRunCreateOrUpdateDefaultResponse - | TestRunGetDefaultResponse - | TestRunGetFileDefaultResponse - | TestRunListDefaultResponse - | TestRunStopDefaultResponse - | TestRunListMetricNamespacesDefaultResponse - | TestRunListMetricDefinitionsDefaultResponse - | TestRunListMetricsDefaultResponse - | TestRunListMetricDimensionValuesDefaultResponse - | TestRunCreateOrUpdateAppComponentsDefaultResponse - | TestRunListAppComponentsDefaultResponse - | TestRunCreateOrUpdateServerMetricsConfigDefaultResponse - | TestRunListServerMetricsConfigDefaultResponse { + | LoadTestAdministrationCreateOrUpdateTestDefaultResponse + | LoadTestAdministrationDeleteTestDefaultResponse + | LoadTestAdministrationGetTestDefaultResponse + | LoadTestAdministrationListTestsDefaultResponse + | LoadTestAdministrationUploadTestFileDefaultResponse + | LoadTestAdministrationGetTestFileDefaultResponse + | LoadTestAdministrationDeleteTestFileDefaultResponse + | LoadTestAdministrationListTestFilesDefaultResponse + | LoadTestAdministrationCreateOrUpdateAppComponentsDefaultResponse + | LoadTestAdministrationGetAppComponentsDefaultResponse + | LoadTestAdministrationCreateOrUpdateServerMetricsConfigDefaultResponse + | LoadTestAdministrationGetServerMetricsConfigDefaultResponse + | LoadTestRunGetTestRunDefaultResponse + | LoadTestRunCreateOrUpdateTestRunDefaultResponse + | LoadTestRunDeleteTestRunDefaultResponse + | LoadTestRunListTestRunsDefaultResponse + | LoadTestRunGetTestRunFileDefaultResponse + | LoadTestRunStopDefaultResponse + | LoadTestRunListMetricNamespacesDefaultResponse + | LoadTestRunListMetricDefinitionsDefaultResponse + | LoadTestRunListMetricsDefaultResponse + | LoadTestRunListMetricDimensionValuesDefaultResponse + | LoadTestRunCreateOrUpdateAppComponentsDefaultResponse + | LoadTestRunGetAppComponentsDefaultResponse + | LoadTestRunCreateOrUpdateServerMetricsConfigDefaultResponse + | LoadTestRunGetServerMetricsConfigDefaultResponse { const lroOriginal = response.headers["x-ms-original-url"]; const url = new URL(lroOriginal ?? response.request.url); const method = response.request.method; let pathDetails = responseMap[`${method} ${url.pathname}`]; if (!pathDetails) { - pathDetails = geParametrizedPathSuccess(method, url.pathname); + pathDetails = getParametrizedPathSuccess(method, url.pathname); } return !pathDetails.includes(response.status); } -function geParametrizedPathSuccess(method: string, path: string): string[] { +function getParametrizedPathSuccess(method: string, path: string): string[] { const pathParts = path.split("/"); + // Traverse list to match the longest candidate + // matchedLen: the length of candidate path + // matchedValue: the matched status code array + let matchedLen = -1, + matchedValue: string[] = []; + // Iterate the responseMap to find a match for (const [key, value] of Object.entries(responseMap)) { // Extracting the path from the map key which is in format @@ -302,43 +342,52 @@ function geParametrizedPathSuccess(method: string, path: string): string[] { // Get each part of the url path const candidateParts = candidatePath.split("/"); - // If the candidate and actual paths don't match in size - // we move on to the next candidate path - if (candidateParts.length === pathParts.length && hasParametrizedPath(key)) { - // track if we have found a match to return the values found. - let found = true; - for (let i = 0; i < candidateParts.length; i++) { - if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.endsWith("}")) { - // If the current part of the candidate is a "template" part - // it is a match with the actual path part on hand - // skip as the parameterized part can match anything - continue; - } + // track if we have found a match to return the values found. + let found = true; + for ( + let i = candidateParts.length - 1, j = pathParts.length - 1; + i >= 1 && j >= 1; + i--, j-- + ) { + if ( + candidateParts[i]?.startsWith("{") && + candidateParts[i]?.indexOf("}") !== -1 + ) { + const start = candidateParts[i]!.indexOf("}") + 1, + end = candidateParts[i]?.length; + // If the current part of the candidate is a "template" part + // Try to use the suffix of pattern to match the path + // {guid} ==> $ + // {guid}:export ==> :export$ + const isMatched = new RegExp( + `${candidateParts[i]?.slice(start, end)}` + ).test(pathParts[j] || ""); - // If the candidate part is not a template and - // the parts don't match mark the candidate as not found - // to move on with the next candidate path. - if (candidateParts[i] !== pathParts[i]) { + if (!isMatched) { found = false; break; } + continue; } - // We finished evaluating the current candidate parts - // if all parts matched we return the success values form - // the path mapping. - if (found) { - return value; + // If the candidate part is not a template and + // the parts don't match mark the candidate as not found + // to move on with the next candidate path. + if (candidateParts[i] !== pathParts[j]) { + found = false; + break; } } - } - // No match was found, return an empty array. - return []; -} + // We finished evaluating the current candidate parts + // Update the matched value if and only if we found the longer pattern + if (found && candidatePath.length > matchedLen) { + matchedLen = candidatePath.length; + matchedValue = value; + } + } -function hasParametrizedPath(path: string): boolean { - return path.includes("/{"); + return matchedValue; } function getPathFromMapKey(mapKey: string): string { diff --git a/sdk/loadtesting/load-testing-rest/src/logger.ts b/sdk/loadtesting/load-testing-rest/src/logger.ts new file mode 100644 index 000000000000..4879d9f4b0f5 --- /dev/null +++ b/sdk/loadtesting/load-testing-rest/src/logger.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { createClientLogger } from "@azure/logger"; +export const logger = createClientLogger("load-testing"); diff --git a/sdk/loadtesting/load-testing-rest/src/models.ts b/sdk/loadtesting/load-testing-rest/src/models.ts index 3e412088d625..ed370f65dcab 100644 --- a/sdk/loadtesting/load-testing-rest/src/models.ts +++ b/sdk/loadtesting/load-testing-rest/src/models.ts @@ -1,49 +1,46 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { OperationState, SimplePollerLike } from "@azure/core-lro"; -import { - TestGetFile200Response, - TestRunCreateOrUpdate200Response, - TestRunCreateOrUpdate201Response, - TestRunGet200Response, - TestUploadFile201Response, -} from "./responses"; - -/** Load test model */ +/** Load test model. */ export interface Test { /** Pass fail criteria for a test. */ passFailCriteria?: PassFailCriteria; - /** Secrets can be stored in an Azure Key Vault or any other secret store. If the secret is stored in an Azure Key Vault, the value should be the secret identifier and the type should be AKV_SECRET_URI. If the secret is stored elsewhere, the secret value should be provided directly and the type should be SECRET_VALUE. */ + /** Auto stop criteria for a test. This will automatically stop a load test if the error percentage is high for a certain time window. */ + autoStopCriteria?: AutoStopCriteria; + /** + * Secrets can be stored in an Azure Key Vault or any other secret store. If the + * secret is stored in an Azure Key Vault, the value should be the secret + * identifier and the type should be AKV_SECRET_URI. If the secret is stored + * elsewhere, the secret value should be provided directly and the type should be + * SECRET_VALUE. + */ secrets?: Record; - /** Certificates metadata */ + /** Certificates metadata. */ certificate?: CertificateMetadata; /** Environment variables which are defined as a set of pairs. */ environmentVariables?: Record; /** The load test configuration. */ loadTestConfiguration?: LoadTestConfiguration; - /** The input artifacts for the test. */ - inputArtifacts?: TestInputArtifacts; - /** Unique test name as identifier. */ - testId?: string; + /** Id of the test run to be marked as baseline to view trends of client-side metrics from recent test runs */ + baselineTestRunId?: string; /** The test description. */ description?: string; /** Display name of a test. */ displayName?: string; /** Subnet ID on which the load test instances should run. */ subnetId?: string; + /** + * Kind of test. + * + * Possible values: URL, JMX + */ + kind?: string; + /** Inject load test engines without deploying public IP for outbound access */ + publicIPDisabled?: boolean; /** Type of the managed identity referencing the Key vault. */ keyvaultReferenceIdentityType?: string; /** Resource Id of the managed identity referencing the Key vault. */ keyvaultReferenceIdentityId?: string; - /** The creation datetime(ISO 8601 literal format). */ - createdDateTime?: Date | string; - /** The user that created. */ - createdBy?: string; - /** The last Modified datetime(ISO 8601 literal format). */ - lastModifiedDateTime?: Date | string; - /** The user that last modified. */ - lastModifiedBy?: string; } /** Pass fail criteria for a test. */ @@ -54,155 +51,168 @@ export interface PassFailCriteria { /** Pass fail metric */ export interface PassFailMetric { - /** The client metric on which the criteria should be applied. */ - clientMetric?: "response_time_ms" | "latency" | "error" | "requests" | "requests_per_sec"; - /** The aggregation function to be applied on the client metric. Allowed functions - ‘percentage’ - for error metric , ‘avg’, ‘p50’, ‘p90’, ‘p95’, ‘p99’, ‘min’, ‘max’ - for response_time_ms and latency metric, ‘avg’ - for requests_per_sec, ‘count’ - for requests */ - aggregate?: "count" | "percentage" | "avg" | "p50" | "p90" | "p95" | "p99" | "min" | "max"; + /** + * The client metric on which the criteria should be applied. + * + * Possible values: response_time_ms, latency, error, requests, requests_per_sec + */ + clientMetric?: string; + /** + * The aggregation function to be applied on the client metric. Allowed functions + * - ‘percentage’ - for error metric , ‘avg’, ‘p50’, ‘p90’, ‘p95’, ‘p99’, ‘min’, + * ‘max’ - for response_time_ms and latency metric, ‘avg’ - for requests_per_sec, + * ‘count’ - for requests + * + * Possible values: count, percentage, avg, p50, p90, p95, p99, min, max + */ + aggregate?: string; /** The comparison operator. Supported types ‘>’, ‘<’ */ condition?: string; /** Request name for which the Pass fail criteria has to be applied */ requestName?: string; - /** The value to compare with the client metric. Allowed values - ‘error : [0.0 , 100.0] unit- % ’, response_time_ms and latency : any integer value unit- ms. */ + /** + * The value to compare with the client metric. Allowed values - ‘error : [0.0 , + * 100.0] unit- % ’, response_time_ms and latency : any integer value unit- ms. + */ value?: number; - /** Action taken after the threshold is met. Default is ‘continue’. */ - action?: "stop" | "continue"; - /** The actual value of the client metric for the test run. */ - actualValue?: number; - /** Outcome of the test run. */ - result?: "passed" | "undetermined" | "failed"; + /** + * Action taken after the threshold is met. Default is ‘continue’. + * + * Possible values: continue, stop + */ + action?: string; +} + +/** Auto stop criteria for a test. This will automatically stop a load test if the error percentage is high for a certain time window. */ +export interface AutoStopCriteria { + /** Whether auto-stop should be disabled. The default value is false. */ + autoStopDisabled?: boolean; + /** Threshold percentage of errors on which test run should be automatically stopped. Allowed values are in range of 0.0-100.0 */ + errorRate?: number; + /** Time window during which the error percentage should be evaluated in seconds. */ + errorRateTimeWindowInSeconds?: number; } /** Secret */ export interface Secret { /** The value of the secret for the respective type */ value?: string; - /** Type of secret */ - type?: "AKV_SECRET_URI" | "SECRET_VALUE"; + /** + * Type of secret + * + * Possible values: AKV_SECRET_URI, SECRET_VALUE + */ + type?: string; } /** Certificates metadata */ export interface CertificateMetadata { /** The value of the certificate for respective type */ value?: string; - /** Type of certificate */ - type?: "AKV_CERT_URI"; + /** + * Type of certificate + * + * Possible values: AKV_CERT_URI + */ + type?: string; /** Name of the certificate. */ name?: string; } -/** The load test configuration. */ +/** Configurations for the load test. */ export interface LoadTestConfiguration { - /** The number of engine instances to execute load test. Supported values are in range of 1-45. Required for creating a new test. */ + /** The number of engine instances to execute load test. Supported values are in range of 1-400. Required for creating a new test. */ engineInstances?: number; - /** If false, Azure Load Testing copies and processes your input files unmodified across all test engine instances. If true, Azure Load Testing splits the CSV input data evenly across all engine instances. If you provide multiple CSV files, each file will be split evenly. */ + /** + * If false, Azure Load Testing copies and processes your input files unmodified + * across all test engine instances. If true, Azure Load Testing splits the CSV + * input data evenly across all engine instances. If you provide multiple CSV + * files, each file will be split evenly. + */ splitAllCSVs?: boolean; - /** If true, optionalLoadTestConfig is required and JMX script for the load test is not required to upload. */ + /** + * If true, optionalLoadTestConfig is required and JMX script for the load test is + * not required to upload. + */ quickStartTest?: boolean; - /** Optional load test config */ + /** Configuration for quick load test */ optionalLoadTestConfig?: OptionalLoadTestConfig; } -/** Optional load test config */ +/** Configuration for quick load test */ export interface OptionalLoadTestConfig { - /** Test URL. Provide the complete HTTP URL. For example, http://contoso-app.azurewebsites.net/login */ + /** Test URL. Provide the complete HTTP URL. For example, https://contoso-app.azurewebsites.net/login */ endpointUrl?: string; - /** No of concurrent virtual users */ + /** Target throughput (requests per second). This may not be necessarily achieved. The actual throughput will be lower if the application is not capable of handling it. */ + requestsPerSecond?: number; + /** Maximum response time in milliseconds of the API/endpoint. */ + maxResponseTimeInMs?: number; + /** No of concurrent virtual users. */ virtualUsers?: number; - /** Ramp up time */ + /** Ramp up time in seconds. */ rampUpTime?: number; - /** Test run duration */ + /** Test run duration in seconds. */ duration?: number; } /** The input artifacts for the test. */ export interface TestInputArtifacts { /** File info */ - configFileInfo?: FileInfo; + configFileInfo?: TestFileInfo; /** File info */ - testScriptFileInfo?: FileInfo; + testScriptFileInfo?: TestFileInfo; /** File info */ - userPropFileInfo?: FileInfo; + userPropFileInfo?: TestFileInfo; /** File info */ - inputArtifactsZipFileInfo?: FileInfo; - /** Additional supported files for the test run */ - additionalFileInfo?: Array; + inputArtifactsZipFileInfo?: TestFileInfo; + /** The config json file for url based test */ + urlTestConfigFileInfo?: TestFileInfo; } -/** File info */ -export interface FileInfo { - /** File URL. */ - url?: string; +/** Test file info. */ +export interface TestFileInfo { /** Name of the file. */ - fileName?: string; - /** File type */ - fileType?: "JMX_FILE" | "USER_PROPERTIES" | "ADDITIONAL_ARTIFACTS"; - /** Expiry time of the file (ISO 8601 literal format) */ - expireDateTime?: Date | string; - /** Validation status of the file */ - validationStatus?: - | "NOT_VALIDATED" - | "VALIDATION_SUCCESS" - | "VALIDATION_FAILURE" - | "VALIDATION_INITIATED" - | "VALIDATION_NOT_REQUIRED"; - /** Validation failure error details */ - validationFailureDetails?: string; + fileName: string; } -/** Test app component */ +/** Test app components */ export interface TestAppComponents { - /** Azure resource collection { resource id (fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}) : resource object } */ + /** + * Azure resource collection { resource id (fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}) + * : resource object } + */ components: Record; - /** Test identifier */ - testId?: string; - /** The creation datetime(ISO 8601 literal format). */ - createdDateTime?: Date | string; - /** The user that created. */ - createdBy?: string; - /** The last Modified datetime(ISO 8601 literal format). */ - lastModifiedDateTime?: Date | string; - /** The user that last modified. */ - lastModifiedBy?: string; } -/** An Azure resource object (Refer azure generic resource model : https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id#genericresource) */ +/** An Azure resource object (Refer azure generic resource model :https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id#genericresource) */ export interface AppComponent { - /** fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} */ - resourceId?: string; /** Azure resource name, required while creating the app component. */ - resourceName?: string; + resourceName: string; /** Azure resource type, required while creating the app component. */ - resourceType?: string; + resourceType: string; /** Azure resource display name */ displayName?: string; - /** Resource group name of the Azure resource */ - resourceGroup?: string; - /** Subscription Id of the Azure resource */ - subscriptionId?: string; /** Kind of Azure resource type */ kind?: string; } /** Test server metrics configuration */ export interface TestServerMetricConfig { - /** Test identifier */ - testId?: string; - /** Azure resource metrics collection {metric id : metrics object} (Refer : https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition for metric id). */ - metrics?: Record; - /** The creation datetime(ISO 8601 literal format). */ - createdDateTime?: Date | string; - /** The user that created. */ - createdBy?: string; - /** The last Modified datetime(ISO 8601 literal format). */ - lastModifiedDateTime?: Date | string; - /** The user that last modified. */ - lastModifiedBy?: string; + /** + * Azure resource metrics collection {metric id : metrics object} (Refer : + * https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition + * for metric id). + */ + metrics: Record; } -/** Associated metric definition for particular metrics of the azure resource ( Refer : https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition). */ +/** + * Associated metric definition for particular metrics of the azure resource ( + * Refer : + * https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition). + */ export interface ResourceMetric { - /** Unique name for metric. */ - id?: string; /** Azure resource id. */ resourceId: string; /** Metric name space. */ @@ -223,114 +233,38 @@ export interface ResourceMetric { export interface TestRun { /** Pass fail criteria for a test. */ passFailCriteria?: PassFailCriteria; - /** Secrets can be stored in an Azure Key Vault or any other secret store. If the secret is stored in an Azure Key Vault, the value should be the secret identifier and the type should be AKV_SECRET_URI. If the secret is stored elsewhere, the secret value should be provided directly and the type should be SECRET_VALUE. */ + /** Auto stop criteria for a test. This will automatically stop a load test if the error percentage is high for a certain time window. */ + autoStopCriteria?: AutoStopCriteria; + /** + * Secrets can be stored in an Azure Key Vault or any other secret store. If the + * secret is stored in an Azure Key Vault, the value should be the secret + * identifier and the type should be AKV_SECRET_URI. If the secret is stored + * elsewhere, the secret value should be provided directly and the type should be + * SECRET_VALUE. + */ secrets?: Record; /** Certificates metadata */ certificate?: CertificateMetadata; /** Environment variables which are defined as a set of pairs. */ environmentVariables?: Record; - /** Error details if there is any failure in load test run */ - errorDetails?: Array; - /** Test run statistics. */ - testRunStatistics?: Record; /** The load test configuration. */ loadTestConfiguration?: LoadTestConfiguration; - /** Collection of test run artifacts */ - testArtifacts?: TestRunArtifacts; - /** Test result for pass/Fail criteria used during the test run. */ - testResult?: "PASSED" | "NOT_APPLICABLE" | "FAILED"; - /** Number of virtual users, for which test has been run. */ - virtualUsers?: number; - /** Unique test run name as identifier */ - testRunId?: string; /** Display name of a testRun. */ displayName?: string; /** Associated test Id. */ testId?: string; /** The test run description. */ description?: string; - /** The test run status. */ - status?: - | "ACCEPTED" - | "NOTSTARTED" - | "PROVISIONING" - | "PROVISIONED" - | "CONFIGURING" - | "CONFIGURED" - | "EXECUTING" - | "EXECUTED" - | "DEPROVISIONING" - | "DEPROVISIONED" - | "DONE" - | "CANCELLING" - | "CANCELLED" - | "FAILED" - | "VALIDATION_SUCCESS" - | "VALIDATION_FAILURE"; - /** The test run start DateTime(ISO 8601 literal format). */ - startDateTime?: Date | string; - /** The test run end DateTime(ISO 8601 literal format). */ - endDateTime?: Date | string; - /** Test run initiated time. */ - executedDateTime?: Date | string; - /** Portal url. */ - portalUrl?: string; - /** Test run duration in milliseconds. */ - duration?: number; - /** Subnet ID on which the load test instances should run. */ - subnetId?: string; - /** The creation datetime(ISO 8601 literal format). */ - createdDateTime?: Date | string; - /** The user that created. */ - createdBy?: string; - /** The last Modified datetime(ISO 8601 literal format). */ - lastModifiedDateTime?: Date | string; - /** The user that last modified. */ - lastModifiedBy?: string; } /** Error details if there is any failure in load test run */ -export interface ErrorDetails { - /** Error details in case test run was not successfully run. */ - message?: string; -} +export interface ErrorDetails {} /** Test run statistics. */ -export interface TestRunStatistics { - /** Transaction name. */ - transaction?: string; - /** Sampler count. */ - sampleCount?: number; - /** Error count. */ - errorCount?: number; - /** Error percentage. */ - errorPct?: number; - /** Mean response time. */ - meanResTime?: number; - /** Median response time. */ - medianResTime?: number; - /** Max response time. */ - maxResTime?: number; - /** Minimum response time. */ - minResTime?: number; - /** 90 percentile response time. */ - pct1ResTime?: number; - /** 95 percentile response time. */ - pct2ResTime?: number; - /** 99 percentile response time. */ - pct3ResTime?: number; - /** Throughput. */ - throughput?: number; - /** Received network bytes. */ - receivedKBytesPerSec?: number; - /** Send network bytes. */ - sentKBytesPerSec?: number; -} +export interface TestRunStatistics {} /** Collection of test run artifacts */ export interface TestRunArtifacts { - /** The input artifacts for the test run. */ - inputArtifacts?: TestRunInputArtifacts; /** The output artifacts for the test run. */ outputArtifacts?: TestRunOutputArtifacts; } @@ -338,28 +272,49 @@ export interface TestRunArtifacts { /** The input artifacts for the test run. */ export interface TestRunInputArtifacts { /** File info */ - configFileInfo?: FileInfo; + configFileInfo?: TestRunFileInfo; /** File info */ - testScriptFileInfo?: FileInfo; + testScriptFileInfo?: TestRunFileInfo; /** File info */ - userPropFileInfo?: FileInfo; + userPropFileInfo?: TestRunFileInfo; /** File info */ - inputArtifactsZipFileInfo?: FileInfo; - /** Additional supported files for the test run */ - additionalFileInfo?: Array; + inputArtifactsZipFileInfo?: TestRunFileInfo; + /** The config json file for url based test */ + urlTestConfigFileInfo?: TestRunFileInfo; +} + +/** Test run file info. */ +export interface TestRunFileInfo { + /** Name of the file. */ + fileName: string; } /** The output artifacts for the test run. */ export interface TestRunOutputArtifacts { /** File info */ - resultFileInfo?: FileInfo; + resultFileInfo?: TestRunFileInfo; /** File info */ - logsFileInfo?: FileInfo; + logsFileInfo?: TestRunFileInfo; + /** The container for test run artifacts. */ + artifactsContainerInfo?: ArtifactsContainerInfo; } -/** Filters to fetch the set of metric */ +/** Artifacts container info. */ +export interface ArtifactsContainerInfo { + /** This is a SAS URI to an Azure Storage Container that contains the test run artifacts. */ + url?: string; + /** Expiry time of the container (RFC 3339 literal format) */ + expireDateTime?: Date | string; +} + +/** Filters to fetch the set of metric. */ export interface MetricRequestPayload { - /** Get metrics for specific dimension values. Example: Metric contains dimension like SamplerName, Error. To retrieve all the time series data where SamplerName is equals to HTTPRequest1 or HTTPRequest2, the DimensionFilter value will be {"SamplerName", ["HTTPRequest1", "HTTPRequest2"} */ + /** + * Get metrics for specific dimension values. Example: Metric contains dimension + * like SamplerName, Error. To retrieve all the time series data where SamplerName + * is equals to HTTPRequest1 or HTTPRequest2, the DimensionFilter value will be + * {"SamplerName", ["HTTPRequest1", "HTTPRequest2"} + */ filters?: Array; } @@ -368,63 +323,25 @@ export interface DimensionFilter { /** The dimension name */ name?: string; /** The dimension values. Maximum values can be 20. */ - values?: Array; + values?: string[]; } /** Test run app component */ export interface TestRunAppComponents { - /** Azure resource collection { resource id (fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}) : resource object } */ + /** + * Azure resource collection { resource id (fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}) + * : resource object } + */ components: Record; - /** Test run identifier */ - testRunId?: string; - /** The creation datetime(ISO 8601 literal format). */ - createdDateTime?: Date | string; - /** The user that created. */ - createdBy?: string; - /** The last Modified datetime(ISO 8601 literal format). */ - lastModifiedDateTime?: Date | string; - /** The user that last modified. */ - lastModifiedBy?: string; } /** Test run server metrics configuration */ export interface TestRunServerMetricConfig { - /** Test run identifier */ - testRunId?: string; - /** Azure resource metrics collection {metric id : metrics object} (Refer : https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition for metric id). */ - metrics?: Record; - /** The creation datetime(ISO 8601 literal format). */ - createdDateTime?: Date | string; - /** The user that created. */ - createdBy?: string; - /** The last Modified datetime(ISO 8601 literal format). */ - lastModifiedDateTime?: Date | string; - /** The user that last modified. */ - lastModifiedBy?: string; -} - -/** - * Describes a poller for NotificationHubJob types. - */ -export type FileUploadAndValidatePoller = SimplePollerLike< - OperationState, - TestGetFile200Response ->; - -export type TestRunCompletionPoller = SimplePollerLike< - OperationState, - TestRunGet200Response ->; - -export type TestRunCreateOrUpdateSuccessResponse = - | TestRunCreateOrUpdate200Response - | TestRunCreateOrUpdate201Response; - -export type TestUploadFileSuccessResponse = TestUploadFile201Response; - -export interface PolledOperationOptions { /** - * Time delay between poll requests, in milliseconds. + * Azure resource metrics collection {metric id : metrics object} (Refer : + * https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition + * for metric id). */ - updateIntervalInMs?: number; + metrics?: Record; } diff --git a/sdk/loadtesting/load-testing-rest/src/outputModels.ts b/sdk/loadtesting/load-testing-rest/src/outputModels.ts index 6b117ce1e44f..3b0d502c0336 100644 --- a/sdk/loadtesting/load-testing-rest/src/outputModels.ts +++ b/sdk/loadtesting/load-testing-rest/src/outputModels.ts @@ -1,40 +1,60 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -/** Load test model */ +import { Paged } from "@azure/core-paging"; + +/** Load test model. */ export interface TestOutput { /** Pass fail criteria for a test. */ passFailCriteria?: PassFailCriteriaOutput; - /** Secrets can be stored in an Azure Key Vault or any other secret store. If the secret is stored in an Azure Key Vault, the value should be the secret identifier and the type should be AKV_SECRET_URI. If the secret is stored elsewhere, the secret value should be provided directly and the type should be SECRET_VALUE. */ + /** Auto stop criteria for a test. This will automatically stop a load test if the error percentage is high for a certain time window. */ + autoStopCriteria?: AutoStopCriteriaOutput; + /** + * Secrets can be stored in an Azure Key Vault or any other secret store. If the + * secret is stored in an Azure Key Vault, the value should be the secret + * identifier and the type should be AKV_SECRET_URI. If the secret is stored + * elsewhere, the secret value should be provided directly and the type should be + * SECRET_VALUE. + */ secrets?: Record; - /** Certificates metadata */ + /** Certificates metadata. */ certificate?: CertificateMetadataOutput; /** Environment variables which are defined as a set of pairs. */ environmentVariables?: Record; /** The load test configuration. */ loadTestConfiguration?: LoadTestConfigurationOutput; + /** Id of the test run to be marked as baseline to view trends of client-side metrics from recent test runs */ + baselineTestRunId?: string; /** The input artifacts for the test. */ - inputArtifacts?: TestInputArtifactsOutput; - /** Unique test name as identifier. */ - testId?: string; + readonly inputArtifacts?: TestInputArtifactsOutput; + /** Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, underscore or hyphen characters. */ + readonly testId: string; /** The test description. */ description?: string; /** Display name of a test. */ displayName?: string; /** Subnet ID on which the load test instances should run. */ subnetId?: string; + /** + * Kind of test. + * + * Possible values: URL, JMX + */ + kind?: string; + /** Inject load test engines without deploying public IP for outbound access */ + publicIPDisabled?: boolean; /** Type of the managed identity referencing the Key vault. */ keyvaultReferenceIdentityType?: string; /** Resource Id of the managed identity referencing the Key vault. */ keyvaultReferenceIdentityId?: string; - /** The creation datetime(ISO 8601 literal format). */ - createdDateTime?: string; + /** The creation datetime(RFC 3339 literal format). */ + readonly createdDateTime?: string; /** The user that created. */ - createdBy?: string; - /** The last Modified datetime(ISO 8601 literal format). */ - lastModifiedDateTime?: string; + readonly createdBy?: string; + /** The last Modified datetime(RFC 3339 literal format). */ + readonly lastModifiedDateTime?: string; /** The user that last modified. */ - lastModifiedBy?: string; + readonly lastModifiedBy?: string; } /** Pass fail criteria for a test. */ @@ -45,165 +65,192 @@ export interface PassFailCriteriaOutput { /** Pass fail metric */ export interface PassFailMetricOutput { - /** The client metric on which the criteria should be applied. */ - clientMetric?: "response_time_ms" | "latency" | "error" | "requests" | "requests_per_sec"; - /** The aggregation function to be applied on the client metric. Allowed functions - ‘percentage’ - for error metric , ‘avg’, ‘p50’, ‘p90’, ‘p95’, ‘p99’, ‘min’, ‘max’ - for response_time_ms and latency metric, ‘avg’ - for requests_per_sec, ‘count’ - for requests */ - aggregate?: "count" | "percentage" | "avg" | "p50" | "p90" | "p95" | "p99" | "min" | "max"; + /** + * The client metric on which the criteria should be applied. + * + * Possible values: response_time_ms, latency, error, requests, requests_per_sec + */ + clientMetric?: string; + /** + * The aggregation function to be applied on the client metric. Allowed functions + * - ‘percentage’ - for error metric , ‘avg’, ‘p50’, ‘p90’, ‘p95’, ‘p99’, ‘min’, + * ‘max’ - for response_time_ms and latency metric, ‘avg’ - for requests_per_sec, + * ‘count’ - for requests + * + * Possible values: count, percentage, avg, p50, p90, p95, p99, min, max + */ + aggregate?: string; /** The comparison operator. Supported types ‘>’, ‘<’ */ condition?: string; /** Request name for which the Pass fail criteria has to be applied */ requestName?: string; - /** The value to compare with the client metric. Allowed values - ‘error : [0.0 , 100.0] unit- % ’, response_time_ms and latency : any integer value unit- ms. */ + /** + * The value to compare with the client metric. Allowed values - ‘error : [0.0 , + * 100.0] unit- % ’, response_time_ms and latency : any integer value unit- ms. + */ value?: number; - /** Action taken after the threshold is met. Default is ‘continue’. */ - action?: "stop" | "continue"; + /** + * Action taken after the threshold is met. Default is ‘continue’. + * + * Possible values: continue, stop + */ + action?: string; /** The actual value of the client metric for the test run. */ - actualValue?: number; - /** Outcome of the test run. */ - result?: "passed" | "undetermined" | "failed"; + readonly actualValue?: number; + /** + * Outcome of the test run. + * + * Possible values: passed, undetermined, failed + */ + readonly result?: string; +} + +/** Auto stop criteria for a test. This will automatically stop a load test if the error percentage is high for a certain time window. */ +export interface AutoStopCriteriaOutput { + /** Whether auto-stop should be disabled. The default value is false. */ + autoStopDisabled?: boolean; + /** Threshold percentage of errors on which test run should be automatically stopped. Allowed values are in range of 0.0-100.0 */ + errorRate?: number; + /** Time window during which the error percentage should be evaluated in seconds. */ + errorRateTimeWindowInSeconds?: number; } /** Secret */ export interface SecretOutput { /** The value of the secret for the respective type */ value?: string; - /** Type of secret */ - type?: "AKV_SECRET_URI" | "SECRET_VALUE"; + /** + * Type of secret + * + * Possible values: AKV_SECRET_URI, SECRET_VALUE + */ + type?: string; } /** Certificates metadata */ export interface CertificateMetadataOutput { /** The value of the certificate for respective type */ value?: string; - /** Type of certificate */ - type?: "AKV_CERT_URI"; + /** + * Type of certificate + * + * Possible values: AKV_CERT_URI + */ + type?: string; /** Name of the certificate. */ name?: string; } -/** The load test configuration. */ +/** Configurations for the load test. */ export interface LoadTestConfigurationOutput { - /** The number of engine instances to execute load test. Supported values are in range of 1-45. Required for creating a new test. */ + /** The number of engine instances to execute load test. Supported values are in range of 1-400. Required for creating a new test. */ engineInstances?: number; - /** If false, Azure Load Testing copies and processes your input files unmodified across all test engine instances. If true, Azure Load Testing splits the CSV input data evenly across all engine instances. If you provide multiple CSV files, each file will be split evenly. */ + /** + * If false, Azure Load Testing copies and processes your input files unmodified + * across all test engine instances. If true, Azure Load Testing splits the CSV + * input data evenly across all engine instances. If you provide multiple CSV + * files, each file will be split evenly. + */ splitAllCSVs?: boolean; - /** If true, optionalLoadTestConfig is required and JMX script for the load test is not required to upload. */ + /** + * If true, optionalLoadTestConfig is required and JMX script for the load test is + * not required to upload. + */ quickStartTest?: boolean; - /** Optional load test config */ + /** Configuration for quick load test */ optionalLoadTestConfig?: OptionalLoadTestConfigOutput; } -/** Optional load test config */ +/** Configuration for quick load test */ export interface OptionalLoadTestConfigOutput { - /** Test URL. Provide the complete HTTP URL. For example, http://contoso-app.azurewebsites.net/login */ + /** Test URL. Provide the complete HTTP URL. For example, https://contoso-app.azurewebsites.net/login */ endpointUrl?: string; - /** No of concurrent virtual users */ + /** Target throughput (requests per second). This may not be necessarily achieved. The actual throughput will be lower if the application is not capable of handling it. */ + requestsPerSecond?: number; + /** Maximum response time in milliseconds of the API/endpoint. */ + maxResponseTimeInMs?: number; + /** No of concurrent virtual users. */ virtualUsers?: number; - /** Ramp up time */ + /** Ramp up time in seconds. */ rampUpTime?: number; - /** Test run duration */ + /** Test run duration in seconds. */ duration?: number; } /** The input artifacts for the test. */ export interface TestInputArtifactsOutput { /** File info */ - configFileInfo?: FileInfoOutput; + configFileInfo?: TestFileInfoOutput; /** File info */ - testScriptFileInfo?: FileInfoOutput; + testScriptFileInfo?: TestFileInfoOutput; /** File info */ - userPropFileInfo?: FileInfoOutput; + userPropFileInfo?: TestFileInfoOutput; /** File info */ - inputArtifactsZipFileInfo?: FileInfoOutput; + inputArtifactsZipFileInfo?: TestFileInfoOutput; + /** The config json file for url based test */ + urlTestConfigFileInfo?: TestFileInfoOutput; /** Additional supported files for the test run */ - additionalFileInfo?: Array; + readonly additionalFileInfo?: Array; } -/** File info */ -export interface FileInfoOutput { - /** File URL. */ - url?: string; +/** Test file info. */ +export interface TestFileInfoOutput { /** Name of the file. */ - fileName?: string; - /** File type */ - fileType?: "JMX_FILE" | "USER_PROPERTIES" | "ADDITIONAL_ARTIFACTS"; - /** Expiry time of the file (ISO 8601 literal format) */ - expireDateTime?: string; - /** Validation status of the file */ - validationStatus?: - | "NOT_VALIDATED" - | "VALIDATION_SUCCESS" - | "VALIDATION_FAILURE" - | "VALIDATION_INITIATED" - | "VALIDATION_NOT_REQUIRED"; + fileName: string; + /** File URL. */ + readonly url?: string; + /** + * File type + * + * Possible values: JMX_FILE, USER_PROPERTIES, ADDITIONAL_ARTIFACTS, ZIPPED_ARTIFACTS, URL_TEST_CONFIG_JSON + */ + readonly fileType?: string; + /** Expiry time of the file (RFC 3339 literal format) */ + readonly expireDateTime?: string; + /** + * Validation status of the file + * + * Possible values: NOT_VALIDATED, VALIDATION_SUCCESS, VALIDATION_FAILURE, VALIDATION_INITIATED, VALIDATION_NOT_REQUIRED + */ + readonly validationStatus?: string; /** Validation failure error details */ - validationFailureDetails?: string; -} - -/** The definition of an error object. */ -export interface ErrorResponseBodyOutput { - /** Error from a REST request. */ - error: ErrorModelOutput; -} - -/** Error from a REST request. */ -export interface ErrorModelOutput { - /** The error code. */ - code: string; - /** The error message. */ - message: string; - /** The error target. */ - target?: string; - /** Additional details and inner errors. */ - details?: Array; -} - -/** Collection of tests */ -export interface TestsListOutput { - /** List of tests */ - value: Array; - /** Link for the next list of tests in case of paginated results, if applicable */ - nextLink?: string; + readonly validationFailureDetails?: string; } -/** Collection of files. */ -export interface FileInfoListOutput { - /** List of file info. */ - value: Array; - /** Link for the next list of file URLs, if applicable */ - nextLink?: string; -} - -/** Test app component */ +/** Test app components */ export interface TestAppComponentsOutput { - /** Azure resource collection { resource id (fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}) : resource object } */ + /** + * Azure resource collection { resource id (fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}) + * : resource object } + */ components: Record; /** Test identifier */ - testId?: string; - /** The creation datetime(ISO 8601 literal format). */ - createdDateTime?: string; + readonly testId?: string; + /** The creation datetime(RFC 3339 literal format). */ + readonly createdDateTime?: string; /** The user that created. */ - createdBy?: string; - /** The last Modified datetime(ISO 8601 literal format). */ - lastModifiedDateTime?: string; + readonly createdBy?: string; + /** The last Modified datetime(RFC 3339 literal format). */ + readonly lastModifiedDateTime?: string; /** The user that last modified. */ - lastModifiedBy?: string; + readonly lastModifiedBy?: string; } -/** An Azure resource object (Refer azure generic resource model : https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id#genericresource) */ +/** An Azure resource object (Refer azure generic resource model :https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id#genericresource) */ export interface AppComponentOutput { /** fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} */ - resourceId?: string; + readonly resourceId: string; /** Azure resource name, required while creating the app component. */ - resourceName?: string; + resourceName: string; /** Azure resource type, required while creating the app component. */ - resourceType?: string; + resourceType: string; /** Azure resource display name */ displayName?: string; /** Resource group name of the Azure resource */ - resourceGroup?: string; + readonly resourceGroup?: string; /** Subscription Id of the Azure resource */ - subscriptionId?: string; + readonly subscriptionId?: string; /** Kind of Azure resource type */ kind?: string; } @@ -211,23 +258,31 @@ export interface AppComponentOutput { /** Test server metrics configuration */ export interface TestServerMetricConfigOutput { /** Test identifier */ - testId?: string; - /** Azure resource metrics collection {metric id : metrics object} (Refer : https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition for metric id). */ - metrics?: Record; - /** The creation datetime(ISO 8601 literal format). */ - createdDateTime?: string; + readonly testId?: string; + /** + * Azure resource metrics collection {metric id : metrics object} (Refer : + * https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition + * for metric id). + */ + metrics: Record; + /** The creation datetime(RFC 3339 literal format). */ + readonly createdDateTime?: string; /** The user that created. */ - createdBy?: string; - /** The last Modified datetime(ISO 8601 literal format). */ - lastModifiedDateTime?: string; + readonly createdBy?: string; + /** The last Modified datetime(RFC 3339 literal format). */ + readonly lastModifiedDateTime?: string; /** The user that last modified. */ - lastModifiedBy?: string; + readonly lastModifiedBy?: string; } -/** Associated metric definition for particular metrics of the azure resource ( Refer : https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition). */ +/** + * Associated metric definition for particular metrics of the azure resource ( + * Refer : + * https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition). + */ export interface ResourceMetricOutput { /** Unique name for metric. */ - id?: string; + readonly id?: string; /** Azure resource id. */ resourceId: string; /** Metric name space. */ @@ -246,116 +301,124 @@ export interface ResourceMetricOutput { /** Load test run model */ export interface TestRunOutput { + /** Unique test run identifier for the load test run, must contain only lower-case alphabetic, numeric, underscore or hyphen characters. */ + readonly testRunId: string; /** Pass fail criteria for a test. */ passFailCriteria?: PassFailCriteriaOutput; - /** Secrets can be stored in an Azure Key Vault or any other secret store. If the secret is stored in an Azure Key Vault, the value should be the secret identifier and the type should be AKV_SECRET_URI. If the secret is stored elsewhere, the secret value should be provided directly and the type should be SECRET_VALUE. */ + /** Auto stop criteria for a test. This will automatically stop a load test if the error percentage is high for a certain time window. */ + autoStopCriteria?: AutoStopCriteriaOutput; + /** + * Secrets can be stored in an Azure Key Vault or any other secret store. If the + * secret is stored in an Azure Key Vault, the value should be the secret + * identifier and the type should be AKV_SECRET_URI. If the secret is stored + * elsewhere, the secret value should be provided directly and the type should be + * SECRET_VALUE. + */ secrets?: Record; /** Certificates metadata */ certificate?: CertificateMetadataOutput; /** Environment variables which are defined as a set of pairs. */ environmentVariables?: Record; /** Error details if there is any failure in load test run */ - errorDetails?: Array; + readonly errorDetails?: Array; /** Test run statistics. */ - testRunStatistics?: Record; + readonly testRunStatistics?: Record; /** The load test configuration. */ loadTestConfiguration?: LoadTestConfigurationOutput; /** Collection of test run artifacts */ - testArtifacts?: TestRunArtifactsOutput; - /** Test result for pass/Fail criteria used during the test run. */ - testResult?: "PASSED" | "NOT_APPLICABLE" | "FAILED"; + readonly testArtifacts?: TestRunArtifactsOutput; + /** + * Test result for pass/Fail criteria used during the test run. + * + * Possible values: PASSED, NOT_APPLICABLE, FAILED + */ + readonly testResult?: string; /** Number of virtual users, for which test has been run. */ - virtualUsers?: number; - /** Unique test run name as identifier */ - testRunId?: string; + readonly virtualUsers?: number; /** Display name of a testRun. */ displayName?: string; /** Associated test Id. */ testId?: string; /** The test run description. */ description?: string; - /** The test run status. */ - status?: - | "ACCEPTED" - | "NOTSTARTED" - | "PROVISIONING" - | "PROVISIONED" - | "CONFIGURING" - | "CONFIGURED" - | "EXECUTING" - | "EXECUTED" - | "DEPROVISIONING" - | "DEPROVISIONED" - | "DONE" - | "CANCELLING" - | "CANCELLED" - | "FAILED" - | "VALIDATION_SUCCESS" - | "VALIDATION_FAILURE"; - /** The test run start DateTime(ISO 8601 literal format). */ - startDateTime?: string; - /** The test run end DateTime(ISO 8601 literal format). */ - endDateTime?: string; + /** + * The test run status. + * + * Possible values: ACCEPTED, NOTSTARTED, PROVISIONING, PROVISIONED, CONFIGURING, CONFIGURED, EXECUTING, EXECUTED, DEPROVISIONING, DEPROVISIONED, DONE, CANCELLING, CANCELLED, FAILED, VALIDATION_SUCCESS, VALIDATION_FAILURE + */ + readonly status?: string; + /** The test run start DateTime(RFC 3339 literal format). */ + readonly startDateTime?: string; + /** The test run end DateTime(RFC 3339 literal format). */ + readonly endDateTime?: string; /** Test run initiated time. */ - executedDateTime?: string; + readonly executedDateTime?: string; /** Portal url. */ - portalUrl?: string; + readonly portalUrl?: string; /** Test run duration in milliseconds. */ - duration?: number; + readonly duration?: number; /** Subnet ID on which the load test instances should run. */ - subnetId?: string; - /** The creation datetime(ISO 8601 literal format). */ - createdDateTime?: string; + readonly subnetId?: string; + /** + * Type of test. + * + * Possible values: URL, JMX + */ + readonly kind?: string; + /** Inject load test engines without deploying public IP for outbound access */ + readonly publicIPDisabled?: boolean; + /** The creation datetime(RFC 3339 literal format). */ + readonly createdDateTime?: string; /** The user that created. */ - createdBy?: string; - /** The last Modified datetime(ISO 8601 literal format). */ - lastModifiedDateTime?: string; + readonly createdBy?: string; + /** The last Modified datetime(RFC 3339 literal format). */ + readonly lastModifiedDateTime?: string; /** The user that last modified. */ - lastModifiedBy?: string; + readonly lastModifiedBy?: string; } /** Error details if there is any failure in load test run */ export interface ErrorDetailsOutput { /** Error details in case test run was not successfully run. */ - message?: string; + readonly message?: string; } /** Test run statistics. */ export interface TestRunStatisticsOutput { /** Transaction name. */ - transaction?: string; + readonly transaction?: string; /** Sampler count. */ - sampleCount?: number; + readonly sampleCount?: number; /** Error count. */ - errorCount?: number; + readonly errorCount?: number; /** Error percentage. */ - errorPct?: number; + readonly errorPct?: number; /** Mean response time. */ - meanResTime?: number; + readonly meanResTime?: number; /** Median response time. */ - medianResTime?: number; + readonly medianResTime?: number; /** Max response time. */ - maxResTime?: number; + readonly maxResTime?: number; /** Minimum response time. */ - minResTime?: number; + readonly minResTime?: number; /** 90 percentile response time. */ - pct1ResTime?: number; + readonly pct1ResTime?: number; /** 95 percentile response time. */ - pct2ResTime?: number; + readonly pct2ResTime?: number; /** 99 percentile response time. */ - pct3ResTime?: number; + readonly pct3ResTime?: number; /** Throughput. */ - throughput?: number; + readonly throughput?: number; /** Received network bytes. */ - receivedKBytesPerSec?: number; + readonly receivedKBytesPerSec?: number; /** Send network bytes. */ - sentKBytesPerSec?: number; + readonly sentKBytesPerSec?: number; } /** Collection of test run artifacts */ export interface TestRunArtifactsOutput { /** The input artifacts for the test run. */ - inputArtifacts?: TestRunInputArtifactsOutput; + readonly inputArtifacts?: TestRunInputArtifactsOutput; /** The output artifacts for the test run. */ outputArtifacts?: TestRunOutputArtifactsOutput; } @@ -363,31 +426,59 @@ export interface TestRunArtifactsOutput { /** The input artifacts for the test run. */ export interface TestRunInputArtifactsOutput { /** File info */ - configFileInfo?: FileInfoOutput; + configFileInfo?: TestRunFileInfoOutput; /** File info */ - testScriptFileInfo?: FileInfoOutput; + testScriptFileInfo?: TestRunFileInfoOutput; /** File info */ - userPropFileInfo?: FileInfoOutput; + userPropFileInfo?: TestRunFileInfoOutput; /** File info */ - inputArtifactsZipFileInfo?: FileInfoOutput; + inputArtifactsZipFileInfo?: TestRunFileInfoOutput; + /** The config json file for url based test */ + urlTestConfigFileInfo?: TestRunFileInfoOutput; /** Additional supported files for the test run */ - additionalFileInfo?: Array; + readonly additionalFileInfo?: Array; +} + +/** Test run file info. */ +export interface TestRunFileInfoOutput { + /** Name of the file. */ + fileName: string; + /** File URL. */ + readonly url?: string; + /** + * File type + * + * Possible values: JMX_FILE, USER_PROPERTIES, ADDITIONAL_ARTIFACTS, ZIPPED_ARTIFACTS, URL_TEST_CONFIG_JSON + */ + readonly fileType?: string; + /** Expiry time of the file (RFC 3339 literal format) */ + readonly expireDateTime?: string; + /** + * Validation status of the file + * + * Possible values: NOT_VALIDATED, VALIDATION_SUCCESS, VALIDATION_FAILURE, VALIDATION_INITIATED, VALIDATION_NOT_REQUIRED + */ + readonly validationStatus?: string; + /** Validation failure error details */ + readonly validationFailureDetails?: string; } /** The output artifacts for the test run. */ export interface TestRunOutputArtifactsOutput { /** File info */ - resultFileInfo?: FileInfoOutput; + resultFileInfo?: TestRunFileInfoOutput; /** File info */ - logsFileInfo?: FileInfoOutput; + logsFileInfo?: TestRunFileInfoOutput; + /** The container for test run artifacts. */ + artifactsContainerInfo?: ArtifactsContainerInfoOutput; } -/** Collection of test runs */ -export interface TestRunsListOutput { - /** List of test runs */ - value: Array; - /** Link for the next list of test runs in case of paginated results, if applicable */ - nextLink?: string; +/** Artifacts container info. */ +export interface ArtifactsContainerInfoOutput { + /** This is a SAS URI to an Azure Storage Container that contains the test run artifacts. */ + url?: string; + /** Expiry time of the container (RFC 3339 literal format) */ + expireDateTime?: string; } /** Represents collection of metric namespaces. */ @@ -420,28 +511,24 @@ export interface MetricDefinitionOutput { name?: string; /** The namespace the metric belongs to. */ namespace?: string; - /** The primary aggregation type value defining how to use the values for display. */ - primaryAggregationType?: - | "Average" - | "Count" - | "None" - | "Total" - | "Percentile90" - | "Percentile95" - | "Percentile99"; + /** + * The primary aggregation type value defining how to use the values for display. + * + * Possible values: Average, Count, None, Total, Percentile90, Percentile95, Percentile99 + */ + primaryAggregationType?: string; /** The collection of what all aggregation types are supported. */ - supportedAggregationTypes?: Array; - /** The unit of the metric. */ - unit?: - | "NotSpecified" - | "Percent" - | "Count" - | "Seconds" - | "Milliseconds" - | "Bytes" - | "BytesPerSecond" - | "CountPerSecond"; - /** Metric availability specifies the time grain (aggregation interval or frequency). */ + supportedAggregationTypes?: string[]; + /** + * The unit of the metric. + * + * Possible values: NotSpecified, Percent, Count, Seconds, Milliseconds, Bytes, BytesPerSecond, CountPerSecond + */ + unit?: string; + /** + * Metric availability specifies the time grain (aggregation interval or + * frequency). + */ metricAvailabilities?: Array; } @@ -455,16 +542,13 @@ export interface NameAndDescOutput { /** Metric availability specifies the time grain (aggregation interval or frequency) */ export interface MetricAvailabilityOutput { - /** The time grain specifies the aggregation interval for the metric. Expressed as a duration 'PT1M', 'PT1H', etc. */ - timeGrain?: "PT5S" | "PT10S" | "PT1M" | "PT5M" | "PT1H"; -} - -/** The response to a metrics query. */ -export interface MetricsOutput { - /** Timeseries data for metric query. */ - timeseries?: Array; - /** Link for the next set of timeseries in case of paginated results, if applicable */ - nextLink?: string; + /** + * The time grain specifies the aggregation interval for the metric. Expressed as + * a duration 'PT1M', 'PT1H', etc. + * + * Possible values: PT5S, PT10S, PT1M, PT5M, PT1H + */ + timeGrain?: string; } /** The time series returned when a data query is performed. */ @@ -477,7 +561,7 @@ export interface TimeSeriesElementOutput { /** Represents a metric value. */ export interface MetricValueOutput { - /** The timestamp for the metric value in ISO 8601 format. */ + /** The timestamp for the metric value in RFC 3339 format. */ timestamp?: string; /** The metric value. */ value?: number; @@ -493,40 +577,59 @@ export interface DimensionValueOutput { /** Metrics dimension values. */ export interface DimensionValueListOutput { - /** The dimension values */ - value?: Array; - /** Link for the next set of values in case of paginated results, if applicable */ + /** The dimension name */ + readonly name?: string; + /** The dimension value */ + value?: string[]; + /** Link for the next set of values in case of paginated results, if applicable. */ nextLink?: string; } /** Test run app component */ export interface TestRunAppComponentsOutput { - /** Azure resource collection { resource id (fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}) : resource object } */ + /** + * Azure resource collection { resource id (fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}) + * : resource object } + */ components: Record; /** Test run identifier */ - testRunId?: string; - /** The creation datetime(ISO 8601 literal format). */ - createdDateTime?: string; + readonly testRunId?: string; + /** The creation datetime(RFC 3339 literal format). */ + readonly createdDateTime?: string; /** The user that created. */ - createdBy?: string; - /** The last Modified datetime(ISO 8601 literal format). */ - lastModifiedDateTime?: string; + readonly createdBy?: string; + /** The last Modified datetime(RFC 3339 literal format). */ + readonly lastModifiedDateTime?: string; /** The user that last modified. */ - lastModifiedBy?: string; + readonly lastModifiedBy?: string; } /** Test run server metrics configuration */ export interface TestRunServerMetricConfigOutput { /** Test run identifier */ - testRunId?: string; - /** Azure resource metrics collection {metric id : metrics object} (Refer : https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition for metric id). */ + readonly testRunId?: string; + /** + * Azure resource metrics collection {metric id : metrics object} (Refer : + * https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition + * for metric id). + */ metrics?: Record; - /** The creation datetime(ISO 8601 literal format). */ - createdDateTime?: string; + /** The creation datetime(RFC 3339 literal format). */ + readonly createdDateTime?: string; /** The user that created. */ - createdBy?: string; - /** The last Modified datetime(ISO 8601 literal format). */ - lastModifiedDateTime?: string; + readonly createdBy?: string; + /** The last Modified datetime(RFC 3339 literal format). */ + readonly lastModifiedDateTime?: string; /** The user that last modified. */ - lastModifiedBy?: string; + readonly lastModifiedBy?: string; } + +/** Paged collection of Test items */ +export type PagedTestOutput = Paged; +/** Paged collection of TestFileInfo items */ +export type PagedTestFileInfoOutput = Paged; +/** Paged collection of TestRun items */ +export type PagedTestRunOutput = Paged; +/** The response to a metrics query. */ +export type MetricsOutput = Paged; diff --git a/sdk/loadtesting/load-testing-rest/src/paginateHelper.ts b/sdk/loadtesting/load-testing-rest/src/paginateHelper.ts index 477bace4a37f..1c9af35b1efd 100644 --- a/sdk/loadtesting/load-testing-rest/src/paginateHelper.ts +++ b/sdk/loadtesting/load-testing-rest/src/paginateHelper.ts @@ -1,8 +1,16 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { getPagedAsyncIterator, PagedAsyncIterableIterator, PagedResult } from "@azure/core-paging"; -import { Client, createRestError, PathUncheckedResponse } from "@azure-rest/core-client"; +import { + getPagedAsyncIterator, + PagedAsyncIterableIterator, + PagedResult, +} from "@azure/core-paging"; +import { + Client, + createRestError, + PathUncheckedResponse, +} from "@azure-rest/core-client"; /** * Helper type to extract the type of an array @@ -67,7 +75,9 @@ export function paginate( typeof customGetPage === "function" ? customGetPage : async (pageLink: string) => { - const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get(); + const result = firstRun + ? initialResponse + : await client.pathUnchecked(pageLink).get(); firstRun = false; checkPagingRequest(result); const nextLink = getNextLink(result.body, nextLinkName); @@ -93,7 +103,9 @@ function getNextLink(body: unknown, nextLinkName?: string): string | undefined { const nextLink = (body as Record)[nextLinkName]; if (typeof nextLink !== "string" && typeof nextLink !== "undefined") { - throw new Error(`Body Property ${nextLinkName} should be a string or undefined`); + throw new Error( + `Body Property ${nextLinkName} should be a string or undefined` + ); } return nextLink; @@ -121,7 +133,18 @@ function getElements(body: unknown, itemName: string): T[] { * Checks if a request failed */ function checkPagingRequest(response: PathUncheckedResponse): void { - const Http2xxStatusCodes = ["200", "201", "202", "203", "204", "205", "206", "207", "208", "226"]; + const Http2xxStatusCodes = [ + "200", + "201", + "202", + "203", + "204", + "205", + "206", + "207", + "208", + "226", + ]; if (!Http2xxStatusCodes.includes(response.status)) { throw createRestError( `Pagination failed with unexpected statusCode ${response.status}`, diff --git a/sdk/loadtesting/load-testing-rest/src/parameters.ts b/sdk/loadtesting/load-testing-rest/src/parameters.ts index 1852d0e063c6..73abbd330360 100644 --- a/sdk/loadtesting/load-testing-rest/src/parameters.ts +++ b/sdk/loadtesting/load-testing-rest/src/parameters.ts @@ -12,155 +12,183 @@ import { TestRunServerMetricConfig, } from "./models"; -export interface TestCreateOrUpdateBodyParam { - /** Load test model */ - body: Test; +/** The resource instance. */ +export type TestResourceMergeAndPatch = Partial; + +export interface LoadTestAdministrationCreateOrUpdateTestBodyParam { + /** The resource instance. */ + body: TestResourceMergeAndPatch; } -export interface TestCreateOrUpdateMediaTypesParam { - /** Request content type */ - contentType?: "application/merge-patch+json"; +export interface LoadTestAdministrationCreateOrUpdateTestMediaTypesParam { + /** This request has a JSON Merge Patch body. */ + contentType: "application/merge-patch+json"; } -export type TestCreateOrUpdateParameters = TestCreateOrUpdateMediaTypesParam & - TestCreateOrUpdateBodyParam & - RequestParameters; -export type TestDeleteParameters = RequestParameters; -export type TestGetParameters = RequestParameters; +export type LoadTestAdministrationCreateOrUpdateTestParameters = + LoadTestAdministrationCreateOrUpdateTestMediaTypesParam & + LoadTestAdministrationCreateOrUpdateTestBodyParam & + RequestParameters; +export type LoadTestAdministrationDeleteTestParameters = RequestParameters; +export type LoadTestAdministrationGetTestParameters = RequestParameters; -export interface TestListQueryParamProperties { - /** Sort on the supported fields in (field asc/desc) format. eg: lastModifiedDateTime asc. Supported fields - lastModifiedDateTime */ +export interface LoadTestAdministrationListTestsQueryParamProperties { + /** + * Sort on the supported fields in (field asc/desc) format. eg: + * lastModifiedDateTime asc. Supported fields - lastModifiedDateTime + */ orderby?: string; - /** Prefix based, case sensitive search on searchable fields - displayName, createdBy. For example, to search for a test, with display name is Login Test, the search parameter can be Login. */ + /** + * Prefix based, case sensitive search on searchable fields - displayName, + * createdBy. For example, to search for a test, with display name is Login Test, + * the search parameter can be Login. + */ search?: string; - /** Start DateTime(ISO 8601 literal format) of the last updated time range to filter tests. */ + /** Start DateTime(RFC 3339 literal format) of the last updated time range to filter tests. */ lastModifiedStartTime?: Date | string; - /** End DateTime(ISO 8601 literal format) of the last updated time range to filter tests. */ + /** End DateTime(RFC 3339 literal format) of the last updated time range to filter tests. */ lastModifiedEndTime?: Date | string; - /** Continuation token to get the next page of response */ - continuationToken?: string; /** Number of results in response. */ maxpagesize?: number; } -export interface TestListQueryParam { - queryParameters?: TestListQueryParamProperties; +export interface LoadTestAdministrationListTestsQueryParam { + queryParameters?: LoadTestAdministrationListTestsQueryParamProperties; } -export type TestListParameters = TestListQueryParam & RequestParameters; +export type LoadTestAdministrationListTestsParameters = + LoadTestAdministrationListTestsQueryParam & RequestParameters; -export interface TestUploadFileBodyParam { +export interface LoadTestAdministrationUploadTestFileBodyParam { /** * The file content as application/octet-stream. * * Value may contain any sequence of octets */ - body: string | Uint8Array | ReadableStream | NodeJS.ReadableStream; + body: + | string + | Uint8Array + | ReadableStream + | NodeJS.ReadableStream; } -export interface TestUploadFileQueryParamProperties { - /** File type */ - fileType?: "JMX_FILE" | "USER_PROPERTIES" | "ADDITIONAL_ARTIFACTS"; -} - -export interface TestUploadFileQueryParam { - queryParameters?: TestUploadFileQueryParamProperties; -} - -export interface TestUploadFileMediaTypesParam { - /** Request content type */ - contentType?: "application/octet-stream"; +export interface LoadTestAdministrationUploadTestFileQueryParamProperties { + /** + * File type + * + * Possible values: JMX_FILE, USER_PROPERTIES, ADDITIONAL_ARTIFACTS, ZIPPED_ARTIFACTS, URL_TEST_CONFIG_JSON + */ + fileType?: string; } -export type TestUploadFileParameters = TestUploadFileQueryParam & - TestUploadFileMediaTypesParam & - TestUploadFileBodyParam & - RequestParameters; -export type TestGetFileParameters = RequestParameters; -export type TestDeleteFileParameters = RequestParameters; - -export interface TestListFilesQueryParamProperties { - /** Continuation token to get the next page of response */ - continuationToken?: string; +export interface LoadTestAdministrationUploadTestFileQueryParam { + queryParameters?: LoadTestAdministrationUploadTestFileQueryParamProperties; } -export interface TestListFilesQueryParam { - queryParameters?: TestListFilesQueryParamProperties; +export interface LoadTestAdministrationUploadTestFileMediaTypesParam { + /** Content type. */ + contentType: "application/octet-stream"; } -export type TestListFilesParameters = TestListFilesQueryParam & RequestParameters; +export type LoadTestAdministrationUploadTestFileParameters = + LoadTestAdministrationUploadTestFileQueryParam & + LoadTestAdministrationUploadTestFileMediaTypesParam & + LoadTestAdministrationUploadTestFileBodyParam & + RequestParameters; +export type LoadTestAdministrationGetTestFileParameters = RequestParameters; +export type LoadTestAdministrationDeleteTestFileParameters = RequestParameters; +export type LoadTestAdministrationListTestFilesParameters = RequestParameters; +/** App Component model. */ +export type TestAppComponentsResourceMergeAndPatch = Partial; -export interface TestCreateOrUpdateAppComponentsBodyParam { +export interface LoadTestAdministrationCreateOrUpdateAppComponentsBodyParam { /** App Component model. */ - body: TestAppComponents; + body: TestAppComponentsResourceMergeAndPatch; } -export interface TestCreateOrUpdateAppComponentsMediaTypesParam { - /** Request content type */ - contentType?: "application/merge-patch+json"; +export interface LoadTestAdministrationCreateOrUpdateAppComponentsMediaTypesParam { + /** Content type. */ + contentType: "application/merge-patch+json"; } -export type TestCreateOrUpdateAppComponentsParameters = - TestCreateOrUpdateAppComponentsMediaTypesParam & - TestCreateOrUpdateAppComponentsBodyParam & +export type LoadTestAdministrationCreateOrUpdateAppComponentsParameters = + LoadTestAdministrationCreateOrUpdateAppComponentsMediaTypesParam & + LoadTestAdministrationCreateOrUpdateAppComponentsBodyParam & RequestParameters; -export type TestListAppComponentsParameters = RequestParameters; +export type LoadTestAdministrationGetAppComponentsParameters = + RequestParameters; +/** Server metric configuration model. */ +export type TestServerMetricConfigResourceMergeAndPatch = + Partial; -export interface TestCreateOrUpdateServerMetricsConfigBodyParam { +export interface LoadTestAdministrationCreateOrUpdateServerMetricsConfigBodyParam { /** Server metric configuration model. */ - body: TestServerMetricConfig; + body: TestServerMetricConfigResourceMergeAndPatch; } -export interface TestCreateOrUpdateServerMetricsConfigMediaTypesParam { - /** Request content type */ - contentType?: "application/merge-patch+json"; +export interface LoadTestAdministrationCreateOrUpdateServerMetricsConfigMediaTypesParam { + /** Content type. */ + contentType: "application/merge-patch+json"; } -export type TestCreateOrUpdateServerMetricsConfigParameters = - TestCreateOrUpdateServerMetricsConfigMediaTypesParam & - TestCreateOrUpdateServerMetricsConfigBodyParam & +export type LoadTestAdministrationCreateOrUpdateServerMetricsConfigParameters = + LoadTestAdministrationCreateOrUpdateServerMetricsConfigMediaTypesParam & + LoadTestAdministrationCreateOrUpdateServerMetricsConfigBodyParam & RequestParameters; -export type TestListServerMetricsConfigParameters = RequestParameters; -export type TestRunDeleteParameters = RequestParameters; +export type LoadTestAdministrationGetServerMetricsConfigParameters = + RequestParameters; +export type LoadTestRunGetTestRunParameters = RequestParameters; +/** The resource instance. */ +export type TestRunResourceMergeAndPatch = Partial; -export interface TestRunCreateOrUpdateBodyParam { - /** Load test run model */ - body: TestRun; +export interface LoadTestRunCreateOrUpdateTestRunBodyParam { + /** The resource instance. */ + body: TestRunResourceMergeAndPatch; } -export interface TestRunCreateOrUpdateQueryParamProperties { - /** Existing test run identifier that should be rerun, if this is provided, the test will run with the JMX file, configuration and app components from the existing test run. You can override the configuration values for new test run in the request body. */ +export interface LoadTestRunCreateOrUpdateTestRunQueryParamProperties { + /** + * Existing test run identifier that should be rerun, if this is provided, the + * test will run with the JMX file, configuration and app components from the + * existing test run. You can override the configuration values for new test run + * in the request body. + */ oldTestRunId?: string; } -export interface TestRunCreateOrUpdateQueryParam { - queryParameters?: TestRunCreateOrUpdateQueryParamProperties; +export interface LoadTestRunCreateOrUpdateTestRunQueryParam { + queryParameters?: LoadTestRunCreateOrUpdateTestRunQueryParamProperties; } -export interface TestRunCreateOrUpdateMediaTypesParam { - /** Request content type */ - contentType?: "application/merge-patch+json"; +export interface LoadTestRunCreateOrUpdateTestRunMediaTypesParam { + /** This request has a JSON Merge Patch body. */ + contentType: "application/merge-patch+json"; } -export type TestRunCreateOrUpdateParameters = TestRunCreateOrUpdateQueryParam & - TestRunCreateOrUpdateMediaTypesParam & - TestRunCreateOrUpdateBodyParam & - RequestParameters; -export type TestRunGetParameters = RequestParameters; -export type TestRunGetFileParameters = RequestParameters; +export type LoadTestRunCreateOrUpdateTestRunParameters = + LoadTestRunCreateOrUpdateTestRunQueryParam & + LoadTestRunCreateOrUpdateTestRunMediaTypesParam & + LoadTestRunCreateOrUpdateTestRunBodyParam & + RequestParameters; +export type LoadTestRunDeleteTestRunParameters = RequestParameters; -export interface TestRunListQueryParamProperties { - /** Sort on the supported fields in (field asc/desc) format. eg: executedDateTime asc. Supported fields - executedDateTime */ +export interface LoadTestRunListTestRunsQueryParamProperties { + /** + * Sort on the supported fields in (field asc/desc) format. eg: executedDateTime + * asc. Supported fields - executedDateTime + */ orderby?: string; - /** Continuation token to get the next page of response */ - continuationToken?: string; - /** Prefix based, case sensitive search on searchable fields - description, executedUser. For example, to search for a test run, with description 500 VUs, the search parameter can be 500. */ + /** + * Prefix based, case sensitive search on searchable fields - description, + * executedUser. For example, to search for a test run, with description 500 VUs, + * the search parameter can be 500. + */ search?: string; /** Unique name of an existing load test. */ testId?: string; - /** Start DateTime(ISO 8601 literal format) of test-run execution time filter range. */ + /** Start DateTime(RFC 3339 literal format) of test-run execution time filter range. */ executionFrom?: Date | string; - /** End DateTime(ISO 8601 literal format) of test-run execution time filter range. */ + /** End DateTime(RFC 3339 literal format) of test-run execution time filter range. */ executionTo?: Date | string; /** Comma separated list of test run status. */ status?: string; @@ -168,104 +196,115 @@ export interface TestRunListQueryParamProperties { maxpagesize?: number; } -export interface TestRunListQueryParam { - queryParameters?: TestRunListQueryParamProperties; +export interface LoadTestRunListTestRunsQueryParam { + queryParameters?: LoadTestRunListTestRunsQueryParamProperties; } -export type TestRunListParameters = TestRunListQueryParam & RequestParameters; -export type TestRunStopParameters = RequestParameters; -export type TestRunListMetricNamespacesParameters = RequestParameters; +export type LoadTestRunListTestRunsParameters = + LoadTestRunListTestRunsQueryParam & RequestParameters; +export type LoadTestRunGetTestRunFileParameters = RequestParameters; +export type LoadTestRunStopParameters = RequestParameters; +export type LoadTestRunListMetricNamespacesParameters = RequestParameters; -export interface TestRunListMetricDefinitionsQueryParamProperties { +export interface LoadTestRunListMetricDefinitionsQueryParamProperties { /** Metric namespace to query metric definitions for. */ metricNamespace: string; } -export interface TestRunListMetricDefinitionsQueryParam { - queryParameters: TestRunListMetricDefinitionsQueryParamProperties; +export interface LoadTestRunListMetricDefinitionsQueryParam { + queryParameters: LoadTestRunListMetricDefinitionsQueryParamProperties; } -export type TestRunListMetricDefinitionsParameters = TestRunListMetricDefinitionsQueryParam & - RequestParameters; +export type LoadTestRunListMetricDefinitionsParameters = + LoadTestRunListMetricDefinitionsQueryParam & RequestParameters; -export interface TestRunListMetricsBodyParam { +export interface LoadTestRunListMetricsBodyParam { /** Metric dimension filter */ body?: MetricRequestPayload; } -export interface TestRunListMetricsQueryParamProperties { +export interface LoadTestRunListMetricsQueryParamProperties { /** The aggregation */ aggregation?: string; - /** The interval (i.e. timegrain) of the query. */ - interval?: "PT5S" | "PT10S" | "PT1M" | "PT5M" | "PT1H"; /** Metric name */ metricname: string; + /** + * The interval (i.e. timegrain) of the query. + * + * Possible values: PT5S, PT10S, PT1M, PT5M, PT1H + */ + interval?: string; /** Metric namespace to query metric definitions for. */ metricNamespace: string; /** The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'. */ timespan: string; } -export interface TestRunListMetricsQueryParam { - queryParameters: TestRunListMetricsQueryParamProperties; +export interface LoadTestRunListMetricsQueryParam { + queryParameters: LoadTestRunListMetricsQueryParamProperties; } -export interface TestRunListMetricsMediaTypesParam { - /** Request content type */ - contentType?: "application/json"; -} - -export type TestRunListMetricsParameters = TestRunListMetricsQueryParam & - TestRunListMetricsMediaTypesParam & - TestRunListMetricsBodyParam & - RequestParameters; +export type LoadTestRunListMetricsParameters = + LoadTestRunListMetricsQueryParam & + LoadTestRunListMetricsBodyParam & + RequestParameters; -export interface TestRunListMetricDimensionValuesQueryParamProperties { - /** The interval (i.e. timegrain) of the query. */ - interval?: "PT5S" | "PT10S" | "PT1M" | "PT5M" | "PT1H"; +export interface LoadTestRunListMetricDimensionValuesQueryParamProperties { /** Metric name */ metricname: string; + /** + * The interval (i.e. timegrain) of the query. + * + * Possible values: PT5S, PT10S, PT1M, PT5M, PT1H + */ + interval?: string; /** Metric namespace to query metric definitions for. */ metricNamespace: string; /** The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'. */ timespan: string; } -export interface TestRunListMetricDimensionValuesQueryParam { - queryParameters: TestRunListMetricDimensionValuesQueryParamProperties; +export interface LoadTestRunListMetricDimensionValuesQueryParam { + queryParameters: LoadTestRunListMetricDimensionValuesQueryParamProperties; } -export type TestRunListMetricDimensionValuesParameters = - TestRunListMetricDimensionValuesQueryParam & RequestParameters; +export type LoadTestRunListMetricDimensionValuesParameters = + LoadTestRunListMetricDimensionValuesQueryParam & RequestParameters; +/** App Component model. */ +export type TestRunAppComponentsResourceMergeAndPatch = + Partial; -export interface TestRunCreateOrUpdateAppComponentsBodyParam { +export interface LoadTestRunCreateOrUpdateAppComponentsBodyParam { /** App Component model. */ - body: TestRunAppComponents; + body: TestRunAppComponentsResourceMergeAndPatch; } -export interface TestRunCreateOrUpdateAppComponentsMediaTypesParam { - /** Request content type */ - contentType?: "application/merge-patch+json"; +export interface LoadTestRunCreateOrUpdateAppComponentsMediaTypesParam { + /** Content type. */ + contentType: "application/merge-patch+json"; } -export type TestRunCreateOrUpdateAppComponentsParameters = - TestRunCreateOrUpdateAppComponentsMediaTypesParam & - TestRunCreateOrUpdateAppComponentsBodyParam & +export type LoadTestRunCreateOrUpdateAppComponentsParameters = + LoadTestRunCreateOrUpdateAppComponentsMediaTypesParam & + LoadTestRunCreateOrUpdateAppComponentsBodyParam & RequestParameters; -export type TestRunListAppComponentsParameters = RequestParameters; +export type LoadTestRunGetAppComponentsParameters = RequestParameters; +/** Server metric configuration model. */ +export type TestRunServerMetricConfigResourceMergeAndPatch = + Partial; -export interface TestRunCreateOrUpdateServerMetricsConfigBodyParam { +export interface LoadTestRunCreateOrUpdateServerMetricsConfigBodyParam { /** Server metric configuration model. */ - body: TestRunServerMetricConfig; + body: TestRunServerMetricConfigResourceMergeAndPatch; } -export interface TestRunCreateOrUpdateServerMetricsConfigMediaTypesParam { - /** Request content type */ - contentType?: "application/merge-patch+json"; +export interface LoadTestRunCreateOrUpdateServerMetricsConfigMediaTypesParam { + /** Content type. */ + contentType: "application/merge-patch+json"; } -export type TestRunCreateOrUpdateServerMetricsConfigParameters = - TestRunCreateOrUpdateServerMetricsConfigMediaTypesParam & - TestRunCreateOrUpdateServerMetricsConfigBodyParam & +export type LoadTestRunCreateOrUpdateServerMetricsConfigParameters = + LoadTestRunCreateOrUpdateServerMetricsConfigMediaTypesParam & + LoadTestRunCreateOrUpdateServerMetricsConfigBodyParam & RequestParameters; -export type TestRunListServerMetricsConfigParameters = RequestParameters; +export type LoadTestRunGetServerMetricsConfigParameters = RequestParameters; diff --git a/sdk/loadtesting/load-testing-rest/src/pollingHelper.ts b/sdk/loadtesting/load-testing-rest/src/pollingHelper.ts deleted file mode 100644 index cbd1726a4c84..000000000000 --- a/sdk/loadtesting/load-testing-rest/src/pollingHelper.ts +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import { AzureLoadTestingClient } from "./clientDefinitions"; -import { getFileValidationPoller } from "./getFileValidationPoller"; -import { getTestRunCompletionPoller } from "./getTestRunCompletionPoller"; -import { - FileUploadAndValidatePoller, - TestUploadFileSuccessResponse, - TestRunCompletionPoller, - TestRunCreateOrUpdateSuccessResponse, -} from "./models"; - -export async function getLongRunningPoller( - client: AzureLoadTestingClient, - initialResponse: TestUploadFileSuccessResponse -): Promise; -export async function getLongRunningPoller( - client: AzureLoadTestingClient, - initialResponse: TestRunCreateOrUpdateSuccessResponse -): Promise; -export async function getLongRunningPoller( - client: AzureLoadTestingClient, - initialResponse: TestRunCreateOrUpdateSuccessResponse | TestUploadFileSuccessResponse -): Promise { - if (isFileUpload(initialResponse)) { - return getFileValidationPoller(client, initialResponse); - } else if (isTestRunCreation(initialResponse)) { - return getTestRunCompletionPoller(client, initialResponse); - } - throw new Error("The Operation is not a long running operation."); -} - -function isFileUpload(response: any): response is TestUploadFileSuccessResponse { - return response.request.url.includes("/files/"); -} - -function isTestRunCreation(response: any): response is TestRunCreateOrUpdateSuccessResponse { - return response.request.url.includes("/test-runs/"); -} diff --git a/sdk/loadtesting/load-testing-rest/src/responses.ts b/sdk/loadtesting/load-testing-rest/src/responses.ts index 1f47b6e230de..eab7aff79b87 100644 --- a/sdk/loadtesting/load-testing-rest/src/responses.ts +++ b/sdk/loadtesting/load-testing-rest/src/responses.ts @@ -2,17 +2,17 @@ // Licensed under the MIT license. import { RawHttpHeaders } from "@azure/core-rest-pipeline"; -import { HttpResponse } from "@azure-rest/core-client"; +import { HttpResponse, ErrorResponse } from "@azure-rest/core-client"; import { TestOutput, - ErrorResponseBodyOutput, - TestsListOutput, - FileInfoOutput, - FileInfoListOutput, + PagedTestOutput, + TestFileInfoOutput, + PagedTestFileInfoOutput, TestAppComponentsOutput, TestServerMetricConfigOutput, TestRunOutput, - TestRunsListOutput, + PagedTestRunOutput, + TestRunFileInfoOutput, MetricNamespaceCollectionOutput, MetricDefinitionCollectionOutput, MetricsOutput, @@ -21,506 +21,528 @@ import { TestRunServerMetricConfigOutput, } from "./outputModels"; -/** Create a new test or update an existing test. */ -export interface TestCreateOrUpdate200Response extends HttpResponse { +/** The request has succeeded. */ +export interface LoadTestAdministrationCreateOrUpdateTest200Response + extends HttpResponse { status: "200"; body: TestOutput; } -/** Create a new test or update an existing test. */ -export interface TestCreateOrUpdate201Response extends HttpResponse { +/** The request has succeeded and a new resource has been created as a result. */ +export interface LoadTestAdministrationCreateOrUpdateTest201Response + extends HttpResponse { status: "201"; body: TestOutput; } -export interface TestCreateOrUpdateDefaultHeaders { - /** The error code for specific error that occurred. */ +export interface LoadTestAdministrationCreateOrUpdateTestDefaultHeaders { + /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -/** Create a new test or update an existing test. */ -export interface TestCreateOrUpdateDefaultResponse extends HttpResponse { +export interface LoadTestAdministrationCreateOrUpdateTestDefaultResponse + extends HttpResponse { status: string; - body: ErrorResponseBodyOutput; - headers: RawHttpHeaders & TestCreateOrUpdateDefaultHeaders; + body: ErrorResponse; + headers: RawHttpHeaders & + LoadTestAdministrationCreateOrUpdateTestDefaultHeaders; } -/** Delete a test by its name. */ -export interface TestDelete204Response extends HttpResponse { +/** There is no content to send for this request, but the headers may be useful. */ +export interface LoadTestAdministrationDeleteTest204Response + extends HttpResponse { status: "204"; - body: Record; } -export interface TestDeleteDefaultHeaders { - /** The error code for specific error that occurred. */ +export interface LoadTestAdministrationDeleteTestDefaultHeaders { + /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -/** Delete a test by its name. */ -export interface TestDeleteDefaultResponse extends HttpResponse { +export interface LoadTestAdministrationDeleteTestDefaultResponse + extends HttpResponse { status: string; - body: ErrorResponseBodyOutput; - headers: RawHttpHeaders & TestDeleteDefaultHeaders; + body: ErrorResponse; + headers: RawHttpHeaders & LoadTestAdministrationDeleteTestDefaultHeaders; } -/** Get load test details by test name */ -export interface TestGet200Response extends HttpResponse { +/** The request has succeeded. */ +export interface LoadTestAdministrationGetTest200Response extends HttpResponse { status: "200"; body: TestOutput; } -export interface TestGetDefaultHeaders { - /** The error code for specific error that occurred. */ +export interface LoadTestAdministrationGetTestDefaultHeaders { + /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -/** Get load test details by test name */ -export interface TestGetDefaultResponse extends HttpResponse { +export interface LoadTestAdministrationGetTestDefaultResponse + extends HttpResponse { status: string; - body: ErrorResponseBodyOutput; - headers: RawHttpHeaders & TestGetDefaultHeaders; + body: ErrorResponse; + headers: RawHttpHeaders & LoadTestAdministrationGetTestDefaultHeaders; } -/** Get all load tests by the fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. */ -export interface TestList200Response extends HttpResponse { +/** The request has succeeded. */ +export interface LoadTestAdministrationListTests200Response + extends HttpResponse { status: "200"; - body: TestsListOutput; + body: PagedTestOutput; } -export interface TestListDefaultHeaders { - /** The error code for specific error that occurred. */ +export interface LoadTestAdministrationListTestsDefaultHeaders { + /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -/** Get all load tests by the fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. */ -export interface TestListDefaultResponse extends HttpResponse { +export interface LoadTestAdministrationListTestsDefaultResponse + extends HttpResponse { status: string; - body: ErrorResponseBodyOutput; - headers: RawHttpHeaders & TestListDefaultHeaders; + body: ErrorResponse; + headers: RawHttpHeaders & LoadTestAdministrationListTestsDefaultHeaders; } -/** Upload input file for a given test name. File size can't be more than 50 MB. Existing file with same name for the given test will be overwritten. File should be provided in the request body as application/octet-stream. */ -export interface TestUploadFile201Response extends HttpResponse { +/** The request has succeeded and a new resource has been created as a result. */ +export interface LoadTestAdministrationUploadTestFile201Response + extends HttpResponse { status: "201"; - body: FileInfoOutput; + body: TestFileInfoOutput; } -export interface TestUploadFileDefaultHeaders { - /** The error code for specific error that occurred. */ +export interface LoadTestAdministrationUploadTestFileDefaultHeaders { + /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -/** Upload input file for a given test name. File size can't be more than 50 MB. Existing file with same name for the given test will be overwritten. File should be provided in the request body as application/octet-stream. */ -export interface TestUploadFileDefaultResponse extends HttpResponse { +export interface LoadTestAdministrationUploadTestFileDefaultResponse + extends HttpResponse { status: string; - body: ErrorResponseBodyOutput; - headers: RawHttpHeaders & TestUploadFileDefaultHeaders; + body: ErrorResponse; + headers: RawHttpHeaders & LoadTestAdministrationUploadTestFileDefaultHeaders; } -/** Get test file by the file name. */ -export interface TestGetFile200Response extends HttpResponse { +/** The request has succeeded. */ +export interface LoadTestAdministrationGetTestFile200Response + extends HttpResponse { status: "200"; - body: FileInfoOutput; + body: TestFileInfoOutput; } -export interface TestGetFileDefaultHeaders { - /** The error code for specific error that occurred. */ +export interface LoadTestAdministrationGetTestFileDefaultHeaders { + /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -/** Get test file by the file name. */ -export interface TestGetFileDefaultResponse extends HttpResponse { +export interface LoadTestAdministrationGetTestFileDefaultResponse + extends HttpResponse { status: string; - body: ErrorResponseBodyOutput; - headers: RawHttpHeaders & TestGetFileDefaultHeaders; + body: ErrorResponse; + headers: RawHttpHeaders & LoadTestAdministrationGetTestFileDefaultHeaders; } -/** Delete file by the file name for a test */ -export interface TestDeleteFile204Response extends HttpResponse { +/** There is no content to send for this request, but the headers may be useful. */ +export interface LoadTestAdministrationDeleteTestFile204Response + extends HttpResponse { status: "204"; - body: Record; } -export interface TestDeleteFileDefaultHeaders { - /** The error code for specific error that occurred. */ +export interface LoadTestAdministrationDeleteTestFileDefaultHeaders { + /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -/** Delete file by the file name for a test */ -export interface TestDeleteFileDefaultResponse extends HttpResponse { +export interface LoadTestAdministrationDeleteTestFileDefaultResponse + extends HttpResponse { status: string; - body: ErrorResponseBodyOutput; - headers: RawHttpHeaders & TestDeleteFileDefaultHeaders; + body: ErrorResponse; + headers: RawHttpHeaders & LoadTestAdministrationDeleteTestFileDefaultHeaders; } -/** Get all test files. */ -export interface TestListFiles200Response extends HttpResponse { +/** The request has succeeded. */ +export interface LoadTestAdministrationListTestFiles200Response + extends HttpResponse { status: "200"; - body: FileInfoListOutput; + body: PagedTestFileInfoOutput; } -export interface TestListFilesDefaultHeaders { - /** The error code for specific error that occurred. */ +export interface LoadTestAdministrationListTestFilesDefaultHeaders { + /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -/** Get all test files. */ -export interface TestListFilesDefaultResponse extends HttpResponse { +export interface LoadTestAdministrationListTestFilesDefaultResponse + extends HttpResponse { status: string; - body: ErrorResponseBodyOutput; - headers: RawHttpHeaders & TestListFilesDefaultHeaders; + body: ErrorResponse; + headers: RawHttpHeaders & LoadTestAdministrationListTestFilesDefaultHeaders; } -/** Associate an app component (collection of azure resources) to a test */ -export interface TestCreateOrUpdateAppComponents200Response extends HttpResponse { +/** The request has succeeded. */ +export interface LoadTestAdministrationCreateOrUpdateAppComponents200Response + extends HttpResponse { status: "200"; body: TestAppComponentsOutput; } -/** Associate an app component (collection of azure resources) to a test */ -export interface TestCreateOrUpdateAppComponents201Response extends HttpResponse { +/** The request has succeeded and a new resource has been created as a result. */ +export interface LoadTestAdministrationCreateOrUpdateAppComponents201Response + extends HttpResponse { status: "201"; body: TestAppComponentsOutput; } -export interface TestCreateOrUpdateAppComponentsDefaultHeaders { - /** The error code for specific error that occurred. */ +export interface LoadTestAdministrationCreateOrUpdateAppComponentsDefaultHeaders { + /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -/** Associate an app component (collection of azure resources) to a test */ -export interface TestCreateOrUpdateAppComponentsDefaultResponse extends HttpResponse { +export interface LoadTestAdministrationCreateOrUpdateAppComponentsDefaultResponse + extends HttpResponse { status: string; - body: ErrorResponseBodyOutput; - headers: RawHttpHeaders & TestCreateOrUpdateAppComponentsDefaultHeaders; + body: ErrorResponse; + headers: RawHttpHeaders & + LoadTestAdministrationCreateOrUpdateAppComponentsDefaultHeaders; } -/** Get associated app component (collection of azure resources) for the given test. */ -export interface TestListAppComponents200Response extends HttpResponse { +/** The request has succeeded. */ +export interface LoadTestAdministrationGetAppComponents200Response + extends HttpResponse { status: "200"; body: TestAppComponentsOutput; } -export interface TestListAppComponentsDefaultHeaders { - /** The error code for specific error that occurred. */ +export interface LoadTestAdministrationGetAppComponentsDefaultHeaders { + /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -/** Get associated app component (collection of azure resources) for the given test. */ -export interface TestListAppComponentsDefaultResponse extends HttpResponse { +export interface LoadTestAdministrationGetAppComponentsDefaultResponse + extends HttpResponse { status: string; - body: ErrorResponseBodyOutput; - headers: RawHttpHeaders & TestListAppComponentsDefaultHeaders; + body: ErrorResponse; + headers: RawHttpHeaders & + LoadTestAdministrationGetAppComponentsDefaultHeaders; } -/** Configure server metrics for a test */ -export interface TestCreateOrUpdateServerMetricsConfig200Response extends HttpResponse { +/** The request has succeeded. */ +export interface LoadTestAdministrationCreateOrUpdateServerMetricsConfig200Response + extends HttpResponse { status: "200"; body: TestServerMetricConfigOutput; } -/** Configure server metrics for a test */ -export interface TestCreateOrUpdateServerMetricsConfig201Response extends HttpResponse { +/** The request has succeeded and a new resource has been created as a result. */ +export interface LoadTestAdministrationCreateOrUpdateServerMetricsConfig201Response + extends HttpResponse { status: "201"; body: TestServerMetricConfigOutput; } -export interface TestCreateOrUpdateServerMetricsConfigDefaultHeaders { - /** The error code for specific error that occurred. */ +export interface LoadTestAdministrationCreateOrUpdateServerMetricsConfigDefaultHeaders { + /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -/** Configure server metrics for a test */ -export interface TestCreateOrUpdateServerMetricsConfigDefaultResponse extends HttpResponse { +export interface LoadTestAdministrationCreateOrUpdateServerMetricsConfigDefaultResponse + extends HttpResponse { status: string; - body: ErrorResponseBodyOutput; - headers: RawHttpHeaders & TestCreateOrUpdateServerMetricsConfigDefaultHeaders; + body: ErrorResponse; + headers: RawHttpHeaders & + LoadTestAdministrationCreateOrUpdateServerMetricsConfigDefaultHeaders; } -/** List server metrics configuration for the given test. */ -export interface TestListServerMetricsConfig200Response extends HttpResponse { +/** The request has succeeded. */ +export interface LoadTestAdministrationGetServerMetricsConfig200Response + extends HttpResponse { status: "200"; body: TestServerMetricConfigOutput; } -export interface TestListServerMetricsConfigDefaultHeaders { - /** The error code for specific error that occurred. */ +export interface LoadTestAdministrationGetServerMetricsConfigDefaultHeaders { + /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -/** List server metrics configuration for the given test. */ -export interface TestListServerMetricsConfigDefaultResponse extends HttpResponse { +export interface LoadTestAdministrationGetServerMetricsConfigDefaultResponse + extends HttpResponse { status: string; - body: ErrorResponseBodyOutput; - headers: RawHttpHeaders & TestListServerMetricsConfigDefaultHeaders; + body: ErrorResponse; + headers: RawHttpHeaders & + LoadTestAdministrationGetServerMetricsConfigDefaultHeaders; } -/** Delete a test run by its name. */ -export interface TestRunDelete204Response extends HttpResponse { - status: "204"; - body: Record; +/** The request has succeeded. */ +export interface LoadTestRunGetTestRun200Response extends HttpResponse { + status: "200"; + body: TestRunOutput; } -export interface TestRunDeleteDefaultHeaders { - /** The error code for specific error that occurred. */ +export interface LoadTestRunGetTestRunDefaultHeaders { + /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -/** Delete a test run by its name. */ -export interface TestRunDeleteDefaultResponse extends HttpResponse { +export interface LoadTestRunGetTestRunDefaultResponse extends HttpResponse { status: string; - body: ErrorResponseBodyOutput; - headers: RawHttpHeaders & TestRunDeleteDefaultHeaders; + body: ErrorResponse; + headers: RawHttpHeaders & LoadTestRunGetTestRunDefaultHeaders; } -/** Create and start a new test run with the given name. */ -export interface TestRunCreateOrUpdate200Response extends HttpResponse { +/** The request has succeeded. */ +export interface LoadTestRunCreateOrUpdateTestRun200Response + extends HttpResponse { status: "200"; body: TestRunOutput; } -/** Create and start a new test run with the given name. */ -export interface TestRunCreateOrUpdate201Response extends HttpResponse { +/** The request has succeeded and a new resource has been created as a result. */ +export interface LoadTestRunCreateOrUpdateTestRun201Response + extends HttpResponse { status: "201"; body: TestRunOutput; } -export interface TestRunCreateOrUpdateDefaultHeaders { - /** The error code for specific error that occurred. */ +export interface LoadTestRunCreateOrUpdateTestRunDefaultHeaders { + /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -/** Create and start a new test run with the given name. */ -export interface TestRunCreateOrUpdateDefaultResponse extends HttpResponse { +export interface LoadTestRunCreateOrUpdateTestRunDefaultResponse + extends HttpResponse { status: string; - body: ErrorResponseBodyOutput; - headers: RawHttpHeaders & TestRunCreateOrUpdateDefaultHeaders; + body: ErrorResponse; + headers: RawHttpHeaders & LoadTestRunCreateOrUpdateTestRunDefaultHeaders; } -/** Get test run details by name. */ -export interface TestRunGet200Response extends HttpResponse { - status: "200"; - body: TestRunOutput; +/** There is no content to send for this request, but the headers may be useful. */ +export interface LoadTestRunDeleteTestRun204Response extends HttpResponse { + status: "204"; } -export interface TestRunGetDefaultHeaders { - /** The error code for specific error that occurred. */ +export interface LoadTestRunDeleteTestRunDefaultHeaders { + /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -/** Get test run details by name. */ -export interface TestRunGetDefaultResponse extends HttpResponse { +export interface LoadTestRunDeleteTestRunDefaultResponse extends HttpResponse { status: string; - body: ErrorResponseBodyOutput; - headers: RawHttpHeaders & TestRunGetDefaultHeaders; + body: ErrorResponse; + headers: RawHttpHeaders & LoadTestRunDeleteTestRunDefaultHeaders; } -/** Get test run file by file name. */ -export interface TestRunGetFile200Response extends HttpResponse { +/** The request has succeeded. */ +export interface LoadTestRunListTestRuns200Response extends HttpResponse { status: "200"; - body: FileInfoOutput; + body: PagedTestRunOutput; } -export interface TestRunGetFileDefaultHeaders { - /** The error code for specific error that occurred. */ +export interface LoadTestRunListTestRunsDefaultHeaders { + /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -/** Get test run file by file name. */ -export interface TestRunGetFileDefaultResponse extends HttpResponse { +export interface LoadTestRunListTestRunsDefaultResponse extends HttpResponse { status: string; - body: ErrorResponseBodyOutput; - headers: RawHttpHeaders & TestRunGetFileDefaultHeaders; + body: ErrorResponse; + headers: RawHttpHeaders & LoadTestRunListTestRunsDefaultHeaders; } -/** Get all test runs with given filters */ -export interface TestRunList200Response extends HttpResponse { +/** The request has succeeded. */ +export interface LoadTestRunGetTestRunFile200Response extends HttpResponse { status: "200"; - body: TestRunsListOutput; + body: TestRunFileInfoOutput; } -export interface TestRunListDefaultHeaders { - /** The error code for specific error that occurred. */ +export interface LoadTestRunGetTestRunFileDefaultHeaders { + /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -/** Get all test runs with given filters */ -export interface TestRunListDefaultResponse extends HttpResponse { +export interface LoadTestRunGetTestRunFileDefaultResponse extends HttpResponse { status: string; - body: ErrorResponseBodyOutput; - headers: RawHttpHeaders & TestRunListDefaultHeaders; + body: ErrorResponse; + headers: RawHttpHeaders & LoadTestRunGetTestRunFileDefaultHeaders; } -/** Stop test run by name. */ -export interface TestRunStop200Response extends HttpResponse { +/** The request has succeeded. */ +export interface LoadTestRunStop200Response extends HttpResponse { status: "200"; body: TestRunOutput; } -export interface TestRunStopDefaultHeaders { - /** The error code for specific error that occurred. */ +export interface LoadTestRunStopDefaultHeaders { + /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -/** Stop test run by name. */ -export interface TestRunStopDefaultResponse extends HttpResponse { +export interface LoadTestRunStopDefaultResponse extends HttpResponse { status: string; - body: ErrorResponseBodyOutput; - headers: RawHttpHeaders & TestRunStopDefaultHeaders; + body: ErrorResponse; + headers: RawHttpHeaders & LoadTestRunStopDefaultHeaders; } -/** List the metric namespaces for a load test run. */ -export interface TestRunListMetricNamespaces200Response extends HttpResponse { +/** The request has succeeded. */ +export interface LoadTestRunListMetricNamespaces200Response + extends HttpResponse { status: "200"; body: MetricNamespaceCollectionOutput; } -export interface TestRunListMetricNamespacesDefaultHeaders { - /** The error code for specific error that occurred. */ +export interface LoadTestRunListMetricNamespacesDefaultHeaders { + /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -/** List the metric namespaces for a load test run. */ -export interface TestRunListMetricNamespacesDefaultResponse extends HttpResponse { +export interface LoadTestRunListMetricNamespacesDefaultResponse + extends HttpResponse { status: string; - body: ErrorResponseBodyOutput; - headers: RawHttpHeaders & TestRunListMetricNamespacesDefaultHeaders; + body: ErrorResponse; + headers: RawHttpHeaders & LoadTestRunListMetricNamespacesDefaultHeaders; } -/** List the metric definitions for a load test run. */ -export interface TestRunListMetricDefinitions200Response extends HttpResponse { +/** The request has succeeded. */ +export interface LoadTestRunListMetricDefinitions200Response + extends HttpResponse { status: "200"; body: MetricDefinitionCollectionOutput; } -export interface TestRunListMetricDefinitionsDefaultHeaders { - /** The error code for specific error that occurred. */ +export interface LoadTestRunListMetricDefinitionsDefaultHeaders { + /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -/** List the metric definitions for a load test run. */ -export interface TestRunListMetricDefinitionsDefaultResponse extends HttpResponse { +export interface LoadTestRunListMetricDefinitionsDefaultResponse + extends HttpResponse { status: string; - body: ErrorResponseBodyOutput; - headers: RawHttpHeaders & TestRunListMetricDefinitionsDefaultHeaders; + body: ErrorResponse; + headers: RawHttpHeaders & LoadTestRunListMetricDefinitionsDefaultHeaders; } -/** List the metric values for a load test run. */ -export interface TestRunListMetrics200Response extends HttpResponse { +/** The request has succeeded. */ +export interface LoadTestRunListMetrics200Response extends HttpResponse { status: "200"; body: MetricsOutput; } -export interface TestRunListMetricsDefaultHeaders { - /** The error code for specific error that occurred. */ +export interface LoadTestRunListMetricsDefaultHeaders { + /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -/** List the metric values for a load test run. */ -export interface TestRunListMetricsDefaultResponse extends HttpResponse { +export interface LoadTestRunListMetricsDefaultResponse extends HttpResponse { status: string; - body: ErrorResponseBodyOutput; - headers: RawHttpHeaders & TestRunListMetricsDefaultHeaders; + body: ErrorResponse; + headers: RawHttpHeaders & LoadTestRunListMetricsDefaultHeaders; } -/** List the dimension values for the given metric dimension name. */ -export interface TestRunListMetricDimensionValues200Response extends HttpResponse { +/** The request has succeeded. */ +export interface LoadTestRunListMetricDimensionValues200Response + extends HttpResponse { status: "200"; body: DimensionValueListOutput; } -export interface TestRunListMetricDimensionValuesDefaultHeaders { - /** The error code for specific error that occurred. */ +export interface LoadTestRunListMetricDimensionValuesDefaultHeaders { + /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -/** List the dimension values for the given metric dimension name. */ -export interface TestRunListMetricDimensionValuesDefaultResponse extends HttpResponse { +export interface LoadTestRunListMetricDimensionValuesDefaultResponse + extends HttpResponse { status: string; - body: ErrorResponseBodyOutput; - headers: RawHttpHeaders & TestRunListMetricDimensionValuesDefaultHeaders; + body: ErrorResponse; + headers: RawHttpHeaders & LoadTestRunListMetricDimensionValuesDefaultHeaders; } -/** Associate an app component (collection of azure resources) to a test run */ -export interface TestRunCreateOrUpdateAppComponents200Response extends HttpResponse { +/** The request has succeeded. */ +export interface LoadTestRunCreateOrUpdateAppComponents200Response + extends HttpResponse { status: "200"; body: TestRunAppComponentsOutput; } -/** Associate an app component (collection of azure resources) to a test run */ -export interface TestRunCreateOrUpdateAppComponents201Response extends HttpResponse { +/** The request has succeeded and a new resource has been created as a result. */ +export interface LoadTestRunCreateOrUpdateAppComponents201Response + extends HttpResponse { status: "201"; body: TestRunAppComponentsOutput; } -export interface TestRunCreateOrUpdateAppComponentsDefaultHeaders { - /** The error code for specific error that occurred. */ +export interface LoadTestRunCreateOrUpdateAppComponentsDefaultHeaders { + /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -/** Associate an app component (collection of azure resources) to a test run */ -export interface TestRunCreateOrUpdateAppComponentsDefaultResponse extends HttpResponse { +export interface LoadTestRunCreateOrUpdateAppComponentsDefaultResponse + extends HttpResponse { status: string; - body: ErrorResponseBodyOutput; - headers: RawHttpHeaders & TestRunCreateOrUpdateAppComponentsDefaultHeaders; + body: ErrorResponse; + headers: RawHttpHeaders & + LoadTestRunCreateOrUpdateAppComponentsDefaultHeaders; } -/** Get associated app component (collection of azure resources) for the given test run. */ -export interface TestRunListAppComponents200Response extends HttpResponse { +/** The request has succeeded. */ +export interface LoadTestRunGetAppComponents200Response extends HttpResponse { status: "200"; body: TestRunAppComponentsOutput; } -export interface TestRunListAppComponentsDefaultHeaders { - /** The error code for specific error that occurred. */ +export interface LoadTestRunGetAppComponentsDefaultHeaders { + /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -/** Get associated app component (collection of azure resources) for the given test run. */ -export interface TestRunListAppComponentsDefaultResponse extends HttpResponse { +export interface LoadTestRunGetAppComponentsDefaultResponse + extends HttpResponse { status: string; - body: ErrorResponseBodyOutput; - headers: RawHttpHeaders & TestRunListAppComponentsDefaultHeaders; + body: ErrorResponse; + headers: RawHttpHeaders & LoadTestRunGetAppComponentsDefaultHeaders; } -/** Configure server metrics for a test run */ -export interface TestRunCreateOrUpdateServerMetricsConfig200Response extends HttpResponse { +/** The request has succeeded. */ +export interface LoadTestRunCreateOrUpdateServerMetricsConfig200Response + extends HttpResponse { status: "200"; body: TestRunServerMetricConfigOutput; } -/** Configure server metrics for a test run */ -export interface TestRunCreateOrUpdateServerMetricsConfig201Response extends HttpResponse { +/** The request has succeeded and a new resource has been created as a result. */ +export interface LoadTestRunCreateOrUpdateServerMetricsConfig201Response + extends HttpResponse { status: "201"; body: TestRunServerMetricConfigOutput; } -export interface TestRunCreateOrUpdateServerMetricsConfigDefaultHeaders { - /** The error code for specific error that occurred. */ +export interface LoadTestRunCreateOrUpdateServerMetricsConfigDefaultHeaders { + /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -/** Configure server metrics for a test run */ -export interface TestRunCreateOrUpdateServerMetricsConfigDefaultResponse extends HttpResponse { +export interface LoadTestRunCreateOrUpdateServerMetricsConfigDefaultResponse + extends HttpResponse { status: string; - body: ErrorResponseBodyOutput; - headers: RawHttpHeaders & TestRunCreateOrUpdateServerMetricsConfigDefaultHeaders; + body: ErrorResponse; + headers: RawHttpHeaders & + LoadTestRunCreateOrUpdateServerMetricsConfigDefaultHeaders; } -/** List server metrics configuration for the given test run. */ -export interface TestRunListServerMetricsConfig200Response extends HttpResponse { +/** The request has succeeded. */ +export interface LoadTestRunGetServerMetricsConfig200Response + extends HttpResponse { status: "200"; body: TestRunServerMetricConfigOutput; } -export interface TestRunListServerMetricsConfigDefaultHeaders { - /** The error code for specific error that occurred. */ +export interface LoadTestRunGetServerMetricsConfigDefaultHeaders { + /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -/** List server metrics configuration for the given test run. */ -export interface TestRunListServerMetricsConfigDefaultResponse extends HttpResponse { +export interface LoadTestRunGetServerMetricsConfigDefaultResponse + extends HttpResponse { status: string; - body: ErrorResponseBodyOutput; - headers: RawHttpHeaders & TestRunListServerMetricsConfigDefaultHeaders; + body: ErrorResponse; + headers: RawHttpHeaders & LoadTestRunGetServerMetricsConfigDefaultHeaders; } diff --git a/sdk/loadtesting/load-testing-rest/src/util/LROUtil.ts b/sdk/loadtesting/load-testing-rest/src/util/LROUtil.ts deleted file mode 100644 index b6df213724f6..000000000000 --- a/sdk/loadtesting/load-testing-rest/src/util/LROUtil.ts +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -import { AbortError, AbortSignalLike } from "@azure/abort-controller"; -import { TestRunOutput } from "../outputModels"; - -const REJECTED_ERR = new AbortError("The polling was aborted."); - -export function sleep(ms: number, signal: AbortSignalLike): Promise { - return new Promise((resolve, reject) => { - if (signal.aborted) { - reject(REJECTED_ERR); - return; - } - - const id = setTimeout(() => { - signal.removeEventListener("abort", onAbort); - - if (signal.aborted) { - reject(REJECTED_ERR); - return; - } - - resolve(); - }, ms); - - signal.addEventListener("abort", onAbort, { once: true }); - - function onAbort(): void { - clearTimeout(id); - reject(REJECTED_ERR); - } - }); -} - -export function isTestRunInProgress(testRunOutput: TestRunOutput): boolean { - switch (testRunOutput.status) { - case "ACCEPTED": - case "NOTSTARTED": - case "PROVISIONING": - case "PROVISIONED": - case "CONFIGURING": - case "CONFIGURED": - case "EXECUTING": - case "EXECUTED": - case "DEPROVISIONING": - case "DEPROVISIONED": - case "CANCELLING": - return true; - default: - return false; - } -} diff --git a/sdk/loadtesting/load-testing-rest/tsconfig.json b/sdk/loadtesting/load-testing-rest/tsconfig.json index 694bb33d95f3..6350b3e81772 100644 --- a/sdk/loadtesting/load-testing-rest/tsconfig.json +++ b/sdk/loadtesting/load-testing-rest/tsconfig.json @@ -6,13 +6,21 @@ "declarationDir": "./types", "esModuleInterop": true, "paths": { - "@azure-rest/load-testing": ["./src/index"] + "@azure-rest/load-testing": [ + "./src/index" + ] }, "types": [], - "lib": ["DOM"], + "lib": [ + "DOM" + ], "target": "ES6", "module": "commonjs", "skipLibCheck": true }, - "include": ["src/**/*.ts", "./test/**/*.ts", "samples-dev/**/*.ts"] -} + "include": [ + "src/**/*.ts", + "./test/**/*.ts", + "samples-dev/**/*.ts" + ] +} \ No newline at end of file diff --git a/sdk/loadtesting/load-testing-rest/tsp-location.yaml b/sdk/loadtesting/load-testing-rest/tsp-location.yaml new file mode 100644 index 000000000000..c884e106e7dd --- /dev/null +++ b/sdk/loadtesting/load-testing-rest/tsp-location.yaml @@ -0,0 +1,5 @@ +repo: test-repo-billy/azure-rest-api-specs +additionalDirectories: [] +commit: 65419d38e87e31fdcf41ca951512db158e2aa779 +directory: specification/loadtestservice/LoadTestService +