@azure-rest/load-testing 1.1.0-beta.1 → 1.2.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/LICENSE +1 -1
- package/README.md +12 -13
- package/dist/browser/azureLoadTesting.js +14 -12
- package/dist/browser/azureLoadTesting.js.map +1 -1
- package/dist/browser/clientDefinitions.d.ts +66 -34
- package/dist/browser/clientDefinitions.js.map +1 -1
- package/dist/browser/getFileValidationPoller.js +16 -11
- package/dist/browser/getFileValidationPoller.js.map +1 -1
- package/dist/browser/getTestProfileRunCompletionPoller.js +16 -11
- package/dist/browser/getTestProfileRunCompletionPoller.js.map +1 -1
- package/dist/browser/getTestRunCompletionPoller.js +16 -11
- package/dist/browser/getTestRunCompletionPoller.js.map +1 -1
- package/dist/browser/index.d.ts +6 -6
- package/dist/browser/index.js +1 -7
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/isUnexpected.d.ts +15 -9
- package/dist/browser/isUnexpected.js +21 -13
- package/dist/browser/isUnexpected.js.map +1 -1
- package/dist/browser/models.d.ts +205 -172
- package/dist/browser/models.js.map +1 -1
- package/dist/browser/outputModels.d.ts +290 -208
- package/dist/browser/outputModels.js.map +1 -1
- package/dist/browser/paginateHelper.js +43 -73
- package/dist/browser/paginateHelper.js.map +1 -1
- package/dist/browser/parameters.d.ts +107 -66
- package/dist/browser/parameters.js.map +1 -1
- package/dist/browser/pollingHelper.d.ts +82 -4
- package/dist/browser/pollingHelper.js +119 -15
- package/dist/browser/pollingHelper.js.map +1 -1
- package/dist/browser/responses.d.ts +234 -121
- package/dist/browser/responses.js.map +1 -1
- package/dist/commonjs/azureLoadTesting.js +53 -45
- package/dist/commonjs/azureLoadTesting.js.map +7 -1
- package/dist/commonjs/clientDefinitions.d.ts +66 -34
- package/dist/commonjs/clientDefinitions.js +15 -5
- package/dist/commonjs/clientDefinitions.js.map +7 -1
- package/dist/commonjs/getFileValidationPoller.js +151 -137
- package/dist/commonjs/getFileValidationPoller.js.map +7 -1
- package/dist/commonjs/getTestProfileRunCompletionPoller.js +139 -127
- package/dist/commonjs/getTestProfileRunCompletionPoller.js.map +7 -1
- package/dist/commonjs/getTestRunCompletionPoller.js +139 -125
- package/dist/commonjs/getTestRunCompletionPoller.js.map +7 -1
- package/dist/commonjs/index.d.ts +6 -6
- package/dist/commonjs/index.js +46 -20
- package/dist/commonjs/index.js.map +7 -1
- package/dist/commonjs/isUnexpected.d.ts +15 -9
- package/dist/commonjs/isUnexpected.js +118 -105
- package/dist/commonjs/isUnexpected.js.map +7 -1
- package/dist/commonjs/logger.js +28 -8
- package/dist/commonjs/logger.js.map +7 -1
- package/dist/commonjs/models.d.ts +205 -172
- package/dist/commonjs/models.js +15 -5
- package/dist/commonjs/models.js.map +7 -1
- package/dist/commonjs/outputModels.d.ts +290 -208
- package/dist/commonjs/outputModels.js +15 -5
- package/dist/commonjs/outputModels.js.map +7 -1
- package/dist/commonjs/paginateHelper.js +118 -158
- package/dist/commonjs/paginateHelper.js.map +7 -1
- package/dist/commonjs/parameters.d.ts +107 -66
- package/dist/commonjs/parameters.js +15 -5
- package/dist/commonjs/parameters.js.map +7 -1
- package/dist/commonjs/pollingHelper.d.ts +82 -4
- package/dist/commonjs/pollingHelper.js +143 -24
- package/dist/commonjs/pollingHelper.js.map +7 -1
- package/dist/commonjs/responses.d.ts +234 -121
- package/dist/commonjs/responses.js +15 -5
- package/dist/commonjs/responses.js.map +7 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/commonjs/util/LROUtil.js +76 -54
- package/dist/commonjs/util/LROUtil.js.map +7 -1
- package/dist/esm/azureLoadTesting.js +32 -40
- package/dist/esm/azureLoadTesting.js.map +7 -1
- package/dist/esm/clientDefinitions.d.ts +66 -34
- package/dist/esm/clientDefinitions.js +0 -4
- package/dist/esm/clientDefinitions.js.map +7 -1
- package/dist/esm/getFileValidationPoller.js +126 -132
- package/dist/esm/getFileValidationPoller.js.map +7 -1
- package/dist/esm/getTestProfileRunCompletionPoller.js +114 -122
- package/dist/esm/getTestProfileRunCompletionPoller.js.map +7 -1
- package/dist/esm/getTestRunCompletionPoller.js +114 -120
- package/dist/esm/getTestRunCompletionPoller.js.map +7 -1
- package/dist/esm/index.d.ts +6 -6
- package/dist/esm/index.js +5 -11
- package/dist/esm/index.js.map +7 -1
- package/dist/esm/isUnexpected.d.ts +15 -9
- package/dist/esm/isUnexpected.js +96 -103
- package/dist/esm/isUnexpected.js.map +7 -1
- package/dist/esm/logger.js +4 -4
- package/dist/esm/logger.js.map +7 -1
- package/dist/esm/models.d.ts +205 -172
- package/dist/esm/models.js +0 -4
- package/dist/esm/models.js.map +7 -1
- package/dist/esm/outputModels.d.ts +290 -208
- package/dist/esm/outputModels.js +0 -4
- package/dist/esm/outputModels.js.map +7 -1
- package/dist/esm/paginateHelper.js +95 -155
- package/dist/esm/paginateHelper.js.map +7 -1
- package/dist/esm/parameters.d.ts +107 -66
- package/dist/esm/parameters.js +0 -4
- package/dist/esm/parameters.js.map +7 -1
- package/dist/esm/pollingHelper.d.ts +82 -4
- package/dist/esm/pollingHelper.js +117 -18
- package/dist/esm/pollingHelper.js.map +7 -1
- package/dist/esm/responses.d.ts +234 -121
- package/dist/esm/responses.js +0 -4
- package/dist/esm/responses.js.map +7 -1
- package/dist/esm/util/LROUtil.js +52 -50
- package/dist/esm/util/LROUtil.js.map +7 -1
- package/dist/react-native/azureLoadTesting.js +14 -12
- package/dist/react-native/azureLoadTesting.js.map +1 -1
- package/dist/react-native/clientDefinitions.d.ts +66 -34
- package/dist/react-native/clientDefinitions.js.map +1 -1
- package/dist/react-native/getFileValidationPoller.js +16 -11
- package/dist/react-native/getFileValidationPoller.js.map +1 -1
- package/dist/react-native/getTestProfileRunCompletionPoller.js +16 -11
- package/dist/react-native/getTestProfileRunCompletionPoller.js.map +1 -1
- package/dist/react-native/getTestRunCompletionPoller.js +16 -11
- package/dist/react-native/getTestRunCompletionPoller.js.map +1 -1
- package/dist/react-native/index.d.ts +6 -6
- package/dist/react-native/index.js +1 -7
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native/isUnexpected.d.ts +15 -9
- package/dist/react-native/isUnexpected.js +21 -13
- package/dist/react-native/isUnexpected.js.map +1 -1
- package/dist/react-native/models.d.ts +205 -172
- package/dist/react-native/models.js.map +1 -1
- package/dist/react-native/outputModels.d.ts +290 -208
- package/dist/react-native/outputModels.js.map +1 -1
- package/dist/react-native/paginateHelper.js +43 -73
- package/dist/react-native/paginateHelper.js.map +1 -1
- package/dist/react-native/parameters.d.ts +107 -66
- package/dist/react-native/parameters.js.map +1 -1
- package/dist/react-native/pollingHelper.d.ts +82 -4
- package/dist/react-native/pollingHelper.js +119 -15
- package/dist/react-native/pollingHelper.js.map +1 -1
- package/dist/react-native/responses.d.ts +234 -121
- package/dist/react-native/responses.js.map +1 -1
- package/package.json +69 -86
- package/review/{load-testing.api.md → load-testing-node.api.md} +420 -23
- package/dist/browser/azureLoadTesting.d.ts.map +0 -1
- package/dist/browser/clientDefinitions.d.ts.map +0 -1
- package/dist/browser/getFileValidationPoller.d.ts.map +0 -1
- package/dist/browser/getTestProfileRunCompletionPoller.d.ts.map +0 -1
- package/dist/browser/getTestRunCompletionPoller.d.ts.map +0 -1
- package/dist/browser/index.d.ts.map +0 -1
- package/dist/browser/isUnexpected.d.ts.map +0 -1
- package/dist/browser/logger.d.ts.map +0 -1
- package/dist/browser/models.d.ts.map +0 -1
- package/dist/browser/outputModels.d.ts.map +0 -1
- package/dist/browser/paginateHelper.d.ts.map +0 -1
- package/dist/browser/parameters.d.ts.map +0 -1
- package/dist/browser/pollingHelper.d.ts.map +0 -1
- package/dist/browser/responses.d.ts.map +0 -1
- package/dist/browser/util/LROUtil.d.ts.map +0 -1
- package/dist/commonjs/azureLoadTesting.d.ts.map +0 -1
- package/dist/commonjs/clientDefinitions.d.ts.map +0 -1
- package/dist/commonjs/getFileValidationPoller.d.ts.map +0 -1
- package/dist/commonjs/getTestProfileRunCompletionPoller.d.ts.map +0 -1
- package/dist/commonjs/getTestRunCompletionPoller.d.ts.map +0 -1
- package/dist/commonjs/index.d.ts.map +0 -1
- package/dist/commonjs/isUnexpected.d.ts.map +0 -1
- package/dist/commonjs/logger.d.ts.map +0 -1
- package/dist/commonjs/models.d.ts.map +0 -1
- package/dist/commonjs/outputModels.d.ts.map +0 -1
- package/dist/commonjs/paginateHelper.d.ts.map +0 -1
- package/dist/commonjs/parameters.d.ts.map +0 -1
- package/dist/commonjs/pollingHelper.d.ts.map +0 -1
- package/dist/commonjs/responses.d.ts.map +0 -1
- package/dist/commonjs/util/LROUtil.d.ts.map +0 -1
- package/dist/esm/azureLoadTesting.d.ts.map +0 -1
- package/dist/esm/clientDefinitions.d.ts.map +0 -1
- package/dist/esm/getFileValidationPoller.d.ts.map +0 -1
- package/dist/esm/getTestProfileRunCompletionPoller.d.ts.map +0 -1
- package/dist/esm/getTestRunCompletionPoller.d.ts.map +0 -1
- package/dist/esm/index.d.ts.map +0 -1
- package/dist/esm/isUnexpected.d.ts.map +0 -1
- package/dist/esm/logger.d.ts.map +0 -1
- package/dist/esm/models.d.ts.map +0 -1
- package/dist/esm/outputModels.d.ts.map +0 -1
- package/dist/esm/paginateHelper.d.ts.map +0 -1
- package/dist/esm/parameters.d.ts.map +0 -1
- package/dist/esm/pollingHelper.d.ts.map +0 -1
- package/dist/esm/responses.d.ts.map +0 -1
- package/dist/esm/util/LROUtil.d.ts.map +0 -1
- package/dist/react-native/azureLoadTesting.d.ts.map +0 -1
- package/dist/react-native/clientDefinitions.d.ts.map +0 -1
- package/dist/react-native/getFileValidationPoller.d.ts.map +0 -1
- package/dist/react-native/getTestProfileRunCompletionPoller.d.ts.map +0 -1
- package/dist/react-native/getTestRunCompletionPoller.d.ts.map +0 -1
- package/dist/react-native/index.d.ts.map +0 -1
- package/dist/react-native/isUnexpected.d.ts.map +0 -1
- package/dist/react-native/logger.d.ts.map +0 -1
- package/dist/react-native/models.d.ts.map +0 -1
- package/dist/react-native/outputModels.d.ts.map +0 -1
- package/dist/react-native/paginateHelper.d.ts.map +0 -1
- package/dist/react-native/parameters.d.ts.map +0 -1
- package/dist/react-native/pollingHelper.d.ts.map +0 -1
- package/dist/react-native/responses.d.ts.map +0 -1
- package/dist/react-native/util/LROUtil.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"azureLoadTesting.js","sourceRoot":"","sources":["../../src/azureLoadTesting.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC
|
|
1
|
+
{"version":3,"file":"azureLoadTesting.js","sourceRoot":"","sources":["../../src/azureLoadTesting.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,aAAqB,EACrB,WAA4B,EAC5B,EAAE,UAAU,GAAG,oBAAoB,EAAE,GAAG,OAAO,KAAoC,EAAE;IAErF,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,OAAO,IAAI,WAAW,aAAa,EAAE,CAAC;IACtF,MAAM,aAAa,GAAG,yCAAyC,CAAC;IAChE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;QAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,aAAa,EAAE;QAChE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC;IACzB,OAAO,GAAG;QACR,GAAG,OAAO;QACV,gBAAgB,EAAE;YAChB,eAAe;SAChB;QACD,cAAc,EAAE;YACd,MAAM,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,IAAI,MAAM,CAAC,IAAI;SACtD;QACD,WAAW,EAAE;YACX,MAAM,EAAE,OAAO,CAAC,WAAW,EAAE,MAAM,IAAI,CAAC,iDAAiD,CAAC;SAC3F;KACF,CAAC;IACF,MAAM,MAAM,GAAG,SAAS,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,CAA2B,CAAC;IAEtF,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAC3D,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;QACxB,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,qDAAqD;YACrD,yEAAyE;YACzE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,UAAU,EAAE,CAAC;gBACvD,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { AzureLoadTestingClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface AzureLoadTestingClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `AzureLoadTestingClient`\n * @param endpointParam - A sequence of textual characters.\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpointParam: string,\n credentials: TokenCredential,\n { apiVersion = \"2025-11-01-preview\", ...options }: AzureLoadTestingClientOptions = {},\n): AzureLoadTestingClient {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? `https://${endpointParam}`;\n const userAgentInfo = `azsdk-js-load-testing-rest/1.2.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://cnt-prod.loadtesting.azure.com/.default\"],\n },\n };\n const client = getClient(endpointUrl, credentials, options) as AzureLoadTestingClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && apiVersion) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n\n return client;\n}\n"]}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import type { LoadTestAdministrationCreateOrUpdateTestParameters, LoadTestAdministrationDeleteTestParameters, LoadTestAdministrationGetTestParameters, LoadTestAdministrationListTestsParameters, LoadTestAdministrationUploadTestFileParameters, LoadTestAdministrationGetTestFileParameters, LoadTestAdministrationDeleteTestFileParameters, LoadTestAdministrationListTestFilesParameters, LoadTestAdministrationCreateOrUpdateAppComponentsParameters, LoadTestAdministrationGetAppComponentsParameters, LoadTestAdministrationCreateOrUpdateServerMetricsConfigParameters, LoadTestAdministrationGetServerMetricsConfigParameters, TestProfileAdministrationCreateOrUpdateTestProfileParameters, TestProfileAdministrationDeleteTestProfileParameters, TestProfileAdministrationGetTestProfileParameters, TestProfileAdministrationListTestProfilesParameters, LoadTestRunGetTestRunParameters, LoadTestRunCreateOrUpdateTestRunParameters, LoadTestRunDeleteTestRunParameters, LoadTestRunListTestRunsParameters, LoadTestRunGetTestRunFileParameters, LoadTestRunStopParameters, LoadTestRunListMetricNamespacesParameters, LoadTestRunListMetricDefinitionsParameters, LoadTestRunListMetricsParameters, LoadTestRunListMetricDimensionValuesParameters, LoadTestRunCreateOrUpdateAppComponentsParameters, LoadTestRunGetAppComponentsParameters, LoadTestRunCreateOrUpdateServerMetricsConfigParameters, LoadTestRunGetServerMetricsConfigParameters, TestProfileRunAdministrationGetTestProfileRunParameters, TestProfileRunAdministrationCreateOrUpdateTestProfileRunParameters, TestProfileRunAdministrationDeleteTestProfileRunParameters, TestProfileRunAdministrationStopParameters, TestProfileRunAdministrationListTestProfileRunsParameters
|
|
2
|
-
import type { 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, TestProfileAdministrationCreateOrUpdateTestProfile200Response, TestProfileAdministrationCreateOrUpdateTestProfile201Response, TestProfileAdministrationCreateOrUpdateTestProfileDefaultResponse, TestProfileAdministrationDeleteTestProfile204Response, TestProfileAdministrationDeleteTestProfileDefaultResponse, TestProfileAdministrationGetTestProfile200Response, TestProfileAdministrationGetTestProfileDefaultResponse, TestProfileAdministrationListTestProfiles200Response, TestProfileAdministrationListTestProfilesDefaultResponse, 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, TestProfileRunAdministrationGetTestProfileRun200Response, TestProfileRunAdministrationGetTestProfileRunDefaultResponse, TestProfileRunAdministrationCreateOrUpdateTestProfileRun200Response, TestProfileRunAdministrationCreateOrUpdateTestProfileRun201Response, TestProfileRunAdministrationCreateOrUpdateTestProfileRunDefaultResponse, TestProfileRunAdministrationDeleteTestProfileRun204Response, TestProfileRunAdministrationDeleteTestProfileRunDefaultResponse, TestProfileRunAdministrationStop200Response, TestProfileRunAdministrationStopDefaultResponse, TestProfileRunAdministrationListTestProfileRuns200Response, TestProfileRunAdministrationListTestProfileRunsDefaultResponse
|
|
1
|
+
import type { OperationsGetStatusParameters, LoadTestAdministrationCreateOrUpdateTestParameters, LoadTestAdministrationDeleteTestParameters, LoadTestAdministrationGetTestParameters, LoadTestAdministrationListTestsParameters, LoadTestAdministrationCloneTestParameters, LoadTestAdministrationGenerateTestPlanRecommendationsParameters, LoadTestAdministrationUploadTestFileParameters, LoadTestAdministrationGetTestFileParameters, LoadTestAdministrationDeleteTestFileParameters, LoadTestAdministrationListTestFilesParameters, LoadTestAdministrationCreateOrUpdateAppComponentsParameters, LoadTestAdministrationGetAppComponentsParameters, LoadTestAdministrationCreateOrUpdateServerMetricsConfigParameters, LoadTestAdministrationGetServerMetricsConfigParameters, TestProfileAdministrationCreateOrUpdateTestProfileParameters, TestProfileAdministrationDeleteTestProfileParameters, TestProfileAdministrationGetTestProfileParameters, TestProfileAdministrationListTestProfilesParameters, TriggerAdministrationGetTriggerParameters, TriggerAdministrationCreateOrUpdateTriggerParameters, TriggerAdministrationDeleteTriggerParameters, TriggerAdministrationListTriggerParameters, NotificationRuleAdministrationGetNotificationRuleParameters, NotificationRuleAdministrationCreateOrUpdateNotificationRuleParameters, NotificationRuleAdministrationDeleteNotificationRuleParameters, NotificationRuleAdministrationListNotificationRuleParameters, LoadTestRunGetTestRunParameters, LoadTestRunCreateOrUpdateTestRunParameters, LoadTestRunDeleteTestRunParameters, LoadTestRunListTestRunsParameters, LoadTestRunGetTestRunFileParameters, LoadTestRunStopParameters, LoadTestRunGetLatestInsightsParameters, LoadTestRunUpdateLatestInsightsParameters, LoadTestRunGenerateInsightsParameters, LoadTestRunListMetricNamespacesParameters, LoadTestRunListMetricDefinitionsParameters, LoadTestRunListMetricsParameters, LoadTestRunListMetricDimensionValuesParameters, LoadTestRunCreateOrUpdateAppComponentsParameters, LoadTestRunGetAppComponentsParameters, LoadTestRunCreateOrUpdateServerMetricsConfigParameters, LoadTestRunGetServerMetricsConfigParameters, TestProfileRunAdministrationGetTestProfileRunParameters, TestProfileRunAdministrationCreateOrUpdateTestProfileRunParameters, TestProfileRunAdministrationDeleteTestProfileRunParameters, TestProfileRunAdministrationStopParameters, TestProfileRunAdministrationListTestProfileRunsParameters } from "./parameters.js";
|
|
2
|
+
import type { OperationsGetStatus200Response, OperationsGetStatusDefaultResponse, LoadTestAdministrationCreateOrUpdateTest200Response, LoadTestAdministrationCreateOrUpdateTest201Response, LoadTestAdministrationCreateOrUpdateTestDefaultResponse, LoadTestAdministrationDeleteTest204Response, LoadTestAdministrationDeleteTestDefaultResponse, LoadTestAdministrationGetTest200Response, LoadTestAdministrationGetTestDefaultResponse, LoadTestAdministrationListTests200Response, LoadTestAdministrationListTestsDefaultResponse, LoadTestAdministrationCloneTest202Response, LoadTestAdministrationCloneTestDefaultResponse, LoadTestAdministrationGenerateTestPlanRecommendations202Response, LoadTestAdministrationGenerateTestPlanRecommendationsDefaultResponse, LoadTestAdministrationUploadTestFile201Response, LoadTestAdministrationUploadTestFileDefaultResponse, LoadTestAdministrationGetTestFile200Response, LoadTestAdministrationGetTestFileDefaultResponse, LoadTestAdministrationDeleteTestFile204Response, LoadTestAdministrationDeleteTestFileDefaultResponse, LoadTestAdministrationListTestFiles200Response, LoadTestAdministrationListTestFilesDefaultResponse, LoadTestAdministrationCreateOrUpdateAppComponents200Response, LoadTestAdministrationCreateOrUpdateAppComponents201Response, LoadTestAdministrationCreateOrUpdateAppComponentsDefaultResponse, LoadTestAdministrationGetAppComponents200Response, LoadTestAdministrationGetAppComponentsDefaultResponse, LoadTestAdministrationCreateOrUpdateServerMetricsConfig200Response, LoadTestAdministrationCreateOrUpdateServerMetricsConfig201Response, LoadTestAdministrationCreateOrUpdateServerMetricsConfigDefaultResponse, LoadTestAdministrationGetServerMetricsConfig200Response, LoadTestAdministrationGetServerMetricsConfigDefaultResponse, TestProfileAdministrationCreateOrUpdateTestProfile200Response, TestProfileAdministrationCreateOrUpdateTestProfile201Response, TestProfileAdministrationCreateOrUpdateTestProfileDefaultResponse, TestProfileAdministrationDeleteTestProfile204Response, TestProfileAdministrationDeleteTestProfileDefaultResponse, TestProfileAdministrationGetTestProfile200Response, TestProfileAdministrationGetTestProfileDefaultResponse, TestProfileAdministrationListTestProfiles200Response, TestProfileAdministrationListTestProfilesDefaultResponse, TriggerAdministrationGetTrigger200Response, TriggerAdministrationGetTriggerDefaultResponse, TriggerAdministrationCreateOrUpdateTrigger200Response, TriggerAdministrationCreateOrUpdateTrigger201Response, TriggerAdministrationCreateOrUpdateTriggerDefaultResponse, TriggerAdministrationDeleteTrigger204Response, TriggerAdministrationDeleteTriggerDefaultResponse, TriggerAdministrationListTrigger200Response, TriggerAdministrationListTriggerDefaultResponse, NotificationRuleAdministrationGetNotificationRule200Response, NotificationRuleAdministrationGetNotificationRuleDefaultResponse, NotificationRuleAdministrationCreateOrUpdateNotificationRule200Response, NotificationRuleAdministrationCreateOrUpdateNotificationRule201Response, NotificationRuleAdministrationCreateOrUpdateNotificationRuleDefaultResponse, NotificationRuleAdministrationDeleteNotificationRule204Response, NotificationRuleAdministrationDeleteNotificationRuleDefaultResponse, NotificationRuleAdministrationListNotificationRule200Response, NotificationRuleAdministrationListNotificationRuleDefaultResponse, LoadTestRunGetTestRun200Response, LoadTestRunGetTestRunDefaultResponse, LoadTestRunCreateOrUpdateTestRun200Response, LoadTestRunCreateOrUpdateTestRun201Response, LoadTestRunCreateOrUpdateTestRunDefaultResponse, LoadTestRunDeleteTestRun204Response, LoadTestRunDeleteTestRunDefaultResponse, LoadTestRunListTestRuns200Response, LoadTestRunListTestRunsDefaultResponse, LoadTestRunGetTestRunFile200Response, LoadTestRunGetTestRunFileDefaultResponse, LoadTestRunStop200Response, LoadTestRunStopDefaultResponse, LoadTestRunGetLatestInsights200Response, LoadTestRunGetLatestInsightsDefaultResponse, LoadTestRunUpdateLatestInsights200Response, LoadTestRunUpdateLatestInsightsDefaultResponse, LoadTestRunGenerateInsights202Response, LoadTestRunGenerateInsightsDefaultResponse, LoadTestRunListMetricNamespaces200Response, LoadTestRunListMetricNamespacesDefaultResponse, LoadTestRunListMetricDefinitions200Response, LoadTestRunListMetricDefinitionsDefaultResponse, LoadTestRunListMetrics200Response, LoadTestRunListMetricsDefaultResponse, LoadTestRunListMetricDimensionValues200Response, LoadTestRunListMetricDimensionValuesDefaultResponse, LoadTestRunCreateOrUpdateAppComponents200Response, LoadTestRunCreateOrUpdateAppComponents201Response, LoadTestRunCreateOrUpdateAppComponentsDefaultResponse, LoadTestRunGetAppComponents200Response, LoadTestRunGetAppComponentsDefaultResponse, LoadTestRunCreateOrUpdateServerMetricsConfig200Response, LoadTestRunCreateOrUpdateServerMetricsConfig201Response, LoadTestRunCreateOrUpdateServerMetricsConfigDefaultResponse, LoadTestRunGetServerMetricsConfig200Response, LoadTestRunGetServerMetricsConfigDefaultResponse, TestProfileRunAdministrationGetTestProfileRun200Response, TestProfileRunAdministrationGetTestProfileRunDefaultResponse, TestProfileRunAdministrationCreateOrUpdateTestProfileRun200Response, TestProfileRunAdministrationCreateOrUpdateTestProfileRun201Response, TestProfileRunAdministrationCreateOrUpdateTestProfileRunDefaultResponse, TestProfileRunAdministrationDeleteTestProfileRun204Response, TestProfileRunAdministrationDeleteTestProfileRunDefaultResponse, TestProfileRunAdministrationStop200Response, TestProfileRunAdministrationStopDefaultResponse, TestProfileRunAdministrationListTestProfileRuns200Response, TestProfileRunAdministrationListTestProfileRunsDefaultResponse } from "./responses.js";
|
|
3
3
|
import type { Client, StreamableMethod } from "@azure-rest/core-client";
|
|
4
|
+
export interface OperationsGetStatus {
|
|
5
|
+
/** Get the status of a long running operation. */
|
|
6
|
+
get(options?: OperationsGetStatusParameters): StreamableMethod<OperationsGetStatus200Response | OperationsGetStatusDefaultResponse>;
|
|
7
|
+
}
|
|
4
8
|
export interface LoadTestAdministrationCreateOrUpdateTest {
|
|
5
9
|
/** Create a new test or update an existing test by providing the test Id. */
|
|
6
10
|
patch(options: LoadTestAdministrationCreateOrUpdateTestParameters): StreamableMethod<LoadTestAdministrationCreateOrUpdateTest200Response | LoadTestAdministrationCreateOrUpdateTest201Response | LoadTestAdministrationCreateOrUpdateTestDefaultResponse>;
|
|
@@ -16,6 +20,14 @@ export interface LoadTestAdministrationListTests {
|
|
|
16
20
|
*/
|
|
17
21
|
get(options?: LoadTestAdministrationListTestsParameters): StreamableMethod<LoadTestAdministrationListTests200Response | LoadTestAdministrationListTestsDefaultResponse>;
|
|
18
22
|
}
|
|
23
|
+
export interface LoadTestAdministrationCloneTest {
|
|
24
|
+
/** Clone the given test with optional overrides applied to the clone test. */
|
|
25
|
+
post(options: LoadTestAdministrationCloneTestParameters): StreamableMethod<LoadTestAdministrationCloneTest202Response | LoadTestAdministrationCloneTestDefaultResponse>;
|
|
26
|
+
}
|
|
27
|
+
export interface LoadTestAdministrationGenerateTestPlanRecommendations {
|
|
28
|
+
/** Generate AI Recommendations to author a load test plan using the uploaded browser recording file. */
|
|
29
|
+
post(options?: LoadTestAdministrationGenerateTestPlanRecommendationsParameters): StreamableMethod<LoadTestAdministrationGenerateTestPlanRecommendations202Response | LoadTestAdministrationGenerateTestPlanRecommendationsDefaultResponse>;
|
|
30
|
+
}
|
|
19
31
|
export interface LoadTestAdministrationUploadTestFile {
|
|
20
32
|
/**
|
|
21
33
|
* Upload input file for a given test Id. File size can't be more than 50 MB.
|
|
@@ -56,6 +68,30 @@ export interface TestProfileAdministrationListTestProfiles {
|
|
|
56
68
|
/** Get all test profiles for the given filters. */
|
|
57
69
|
get(options?: TestProfileAdministrationListTestProfilesParameters): StreamableMethod<TestProfileAdministrationListTestProfiles200Response | TestProfileAdministrationListTestProfilesDefaultResponse>;
|
|
58
70
|
}
|
|
71
|
+
export interface TriggerAdministrationGetTrigger {
|
|
72
|
+
/** Resource read operation template. */
|
|
73
|
+
get(options?: TriggerAdministrationGetTriggerParameters): StreamableMethod<TriggerAdministrationGetTrigger200Response | TriggerAdministrationGetTriggerDefaultResponse>;
|
|
74
|
+
/** Create or update operation template. */
|
|
75
|
+
patch(options: TriggerAdministrationCreateOrUpdateTriggerParameters): StreamableMethod<TriggerAdministrationCreateOrUpdateTrigger200Response | TriggerAdministrationCreateOrUpdateTrigger201Response | TriggerAdministrationCreateOrUpdateTriggerDefaultResponse>;
|
|
76
|
+
/** Resource delete operation template. */
|
|
77
|
+
delete(options?: TriggerAdministrationDeleteTriggerParameters): StreamableMethod<TriggerAdministrationDeleteTrigger204Response | TriggerAdministrationDeleteTriggerDefaultResponse>;
|
|
78
|
+
}
|
|
79
|
+
export interface TriggerAdministrationListTrigger {
|
|
80
|
+
/** Resource list operation template. */
|
|
81
|
+
get(options?: TriggerAdministrationListTriggerParameters): StreamableMethod<TriggerAdministrationListTrigger200Response | TriggerAdministrationListTriggerDefaultResponse>;
|
|
82
|
+
}
|
|
83
|
+
export interface NotificationRuleAdministrationGetNotificationRule {
|
|
84
|
+
/** Resource read operation template. */
|
|
85
|
+
get(options?: NotificationRuleAdministrationGetNotificationRuleParameters): StreamableMethod<NotificationRuleAdministrationGetNotificationRule200Response | NotificationRuleAdministrationGetNotificationRuleDefaultResponse>;
|
|
86
|
+
/** Create or update operation template. */
|
|
87
|
+
patch(options: NotificationRuleAdministrationCreateOrUpdateNotificationRuleParameters): StreamableMethod<NotificationRuleAdministrationCreateOrUpdateNotificationRule200Response | NotificationRuleAdministrationCreateOrUpdateNotificationRule201Response | NotificationRuleAdministrationCreateOrUpdateNotificationRuleDefaultResponse>;
|
|
88
|
+
/** Resource delete operation template. */
|
|
89
|
+
delete(options?: NotificationRuleAdministrationDeleteNotificationRuleParameters): StreamableMethod<NotificationRuleAdministrationDeleteNotificationRule204Response | NotificationRuleAdministrationDeleteNotificationRuleDefaultResponse>;
|
|
90
|
+
}
|
|
91
|
+
export interface NotificationRuleAdministrationListNotificationRule {
|
|
92
|
+
/** Resource list operation template. */
|
|
93
|
+
get(options?: NotificationRuleAdministrationListNotificationRuleParameters): StreamableMethod<NotificationRuleAdministrationListNotificationRule200Response | NotificationRuleAdministrationListNotificationRuleDefaultResponse>;
|
|
94
|
+
}
|
|
59
95
|
export interface LoadTestRunGetTestRun {
|
|
60
96
|
/** Get test run details by test run Id. */
|
|
61
97
|
get(options?: LoadTestRunGetTestRunParameters): StreamableMethod<LoadTestRunGetTestRun200Response | LoadTestRunGetTestRunDefaultResponse>;
|
|
@@ -76,6 +112,16 @@ export interface LoadTestRunStop {
|
|
|
76
112
|
/** Stop test run by test run Id. */
|
|
77
113
|
post(options?: LoadTestRunStopParameters): StreamableMethod<LoadTestRunStop200Response | LoadTestRunStopDefaultResponse>;
|
|
78
114
|
}
|
|
115
|
+
export interface LoadTestRunGetLatestInsights {
|
|
116
|
+
/** Get the latest insights for the test run. */
|
|
117
|
+
get(options?: LoadTestRunGetLatestInsightsParameters): StreamableMethod<LoadTestRunGetLatestInsights200Response | LoadTestRunGetLatestInsightsDefaultResponse>;
|
|
118
|
+
/** Update the latest insights for the test run. */
|
|
119
|
+
patch(options: LoadTestRunUpdateLatestInsightsParameters): StreamableMethod<LoadTestRunUpdateLatestInsights200Response | LoadTestRunUpdateLatestInsightsDefaultResponse>;
|
|
120
|
+
}
|
|
121
|
+
export interface LoadTestRunGenerateInsights {
|
|
122
|
+
/** Generate insights for the test run. */
|
|
123
|
+
post(options?: LoadTestRunGenerateInsightsParameters): StreamableMethod<LoadTestRunGenerateInsights202Response | LoadTestRunGenerateInsightsDefaultResponse>;
|
|
124
|
+
}
|
|
79
125
|
export interface LoadTestRunListMetricNamespaces {
|
|
80
126
|
/** List the metric namespaces for a load test run. */
|
|
81
127
|
get(options?: LoadTestRunListMetricNamespacesParameters): StreamableMethod<LoadTestRunListMetricNamespaces200Response | LoadTestRunListMetricNamespacesDefaultResponse>;
|
|
@@ -123,35 +169,17 @@ export interface TestProfileRunAdministrationListTestProfileRuns {
|
|
|
123
169
|
/** Get all test profile runs for the given filters. */
|
|
124
170
|
get(options?: TestProfileRunAdministrationListTestProfileRunsParameters): StreamableMethod<TestProfileRunAdministrationListTestProfileRuns200Response | TestProfileRunAdministrationListTestProfileRunsDefaultResponse>;
|
|
125
171
|
}
|
|
126
|
-
export interface TriggerAdministrationGetTrigger {
|
|
127
|
-
/** Resource read operation template. */
|
|
128
|
-
get(options?: TriggerAdministrationGetTriggerParameters): StreamableMethod<TriggerAdministrationGetTrigger200Response | TriggerAdministrationGetTriggerDefaultResponse>;
|
|
129
|
-
/** Create or update operation template. */
|
|
130
|
-
patch(options: TriggerAdministrationCreateOrUpdateTriggerParameters): StreamableMethod<TriggerAdministrationCreateOrUpdateTrigger200Response | TriggerAdministrationCreateOrUpdateTrigger201Response | TriggerAdministrationCreateOrUpdateTriggerDefaultResponse>;
|
|
131
|
-
/** Resource delete operation template. */
|
|
132
|
-
delete(options?: TriggerAdministrationDeleteTriggerParameters): StreamableMethod<TriggerAdministrationDeleteTrigger204Response | TriggerAdministrationDeleteTriggerDefaultResponse>;
|
|
133
|
-
}
|
|
134
|
-
export interface TriggerAdministrationListTrigger {
|
|
135
|
-
/** Resource list operation template. */
|
|
136
|
-
get(options?: TriggerAdministrationListTriggerParameters): StreamableMethod<TriggerAdministrationListTrigger200Response | TriggerAdministrationListTriggerDefaultResponse>;
|
|
137
|
-
}
|
|
138
|
-
export interface NotificationRuleAdministrationGetNotificationRule {
|
|
139
|
-
/** Resource read operation template. */
|
|
140
|
-
get(options?: NotificationRuleAdministrationGetNotificationRuleParameters): StreamableMethod<NotificationRuleAdministrationGetNotificationRule200Response | NotificationRuleAdministrationGetNotificationRuleDefaultResponse>;
|
|
141
|
-
/** Create or update operation template. */
|
|
142
|
-
patch(options: NotificationRuleAdministrationCreateOrUpdateNotificationRuleParameters): StreamableMethod<NotificationRuleAdministrationCreateOrUpdateNotificationRule200Response | NotificationRuleAdministrationCreateOrUpdateNotificationRule201Response | NotificationRuleAdministrationCreateOrUpdateNotificationRuleDefaultResponse>;
|
|
143
|
-
/** Resource delete operation template. */
|
|
144
|
-
delete(options?: NotificationRuleAdministrationDeleteNotificationRuleParameters): StreamableMethod<NotificationRuleAdministrationDeleteNotificationRule204Response | NotificationRuleAdministrationDeleteNotificationRuleDefaultResponse>;
|
|
145
|
-
}
|
|
146
|
-
export interface NotificationRuleAdministrationListNotificationRule {
|
|
147
|
-
/** Resource list operation template. */
|
|
148
|
-
get(options?: NotificationRuleAdministrationListNotificationRuleParameters): StreamableMethod<NotificationRuleAdministrationListNotificationRule200Response | NotificationRuleAdministrationListNotificationRuleDefaultResponse>;
|
|
149
|
-
}
|
|
150
172
|
export interface Routes {
|
|
173
|
+
/** Resource for '/operations/\{operationId\}' has methods for the following verbs: get */
|
|
174
|
+
(path: "/operations/{operationId}", operationId: string): OperationsGetStatus;
|
|
151
175
|
/** Resource for '/tests/\{testId\}' has methods for the following verbs: patch, delete, get */
|
|
152
176
|
(path: "/tests/{testId}", testId: string): LoadTestAdministrationCreateOrUpdateTest;
|
|
153
177
|
/** Resource for '/tests' has methods for the following verbs: get */
|
|
154
178
|
(path: "/tests"): LoadTestAdministrationListTests;
|
|
179
|
+
/** Resource for '/tests/\{testId\}:clone' has methods for the following verbs: post */
|
|
180
|
+
(path: "/tests/{testId}:clone", testId: string): LoadTestAdministrationCloneTest;
|
|
181
|
+
/** Resource for '/tests/\{testId\}:generateTestPlanRecommendations' has methods for the following verbs: post */
|
|
182
|
+
(path: "/tests/{testId}:generateTestPlanRecommendations", testId: string): LoadTestAdministrationGenerateTestPlanRecommendations;
|
|
155
183
|
/** Resource for '/tests/\{testId\}/files/\{fileName\}' has methods for the following verbs: put, get, delete */
|
|
156
184
|
(path: "/tests/{testId}/files/{fileName}", testId: string, fileName: string): LoadTestAdministrationUploadTestFile;
|
|
157
185
|
/** Resource for '/tests/\{testId\}/files' has methods for the following verbs: get */
|
|
@@ -164,6 +192,14 @@ export interface Routes {
|
|
|
164
192
|
(path: "/test-profiles/{testProfileId}", testProfileId: string): TestProfileAdministrationCreateOrUpdateTestProfile;
|
|
165
193
|
/** Resource for '/test-profiles' has methods for the following verbs: get */
|
|
166
194
|
(path: "/test-profiles"): TestProfileAdministrationListTestProfiles;
|
|
195
|
+
/** Resource for '/triggers/\{triggerId\}' has methods for the following verbs: get, patch, delete */
|
|
196
|
+
(path: "/triggers/{triggerId}", triggerId: string): TriggerAdministrationGetTrigger;
|
|
197
|
+
/** Resource for '/triggers' has methods for the following verbs: get */
|
|
198
|
+
(path: "/triggers"): TriggerAdministrationListTrigger;
|
|
199
|
+
/** Resource for '/notification-rules/\{notificationRuleId\}' has methods for the following verbs: get, patch, delete */
|
|
200
|
+
(path: "/notification-rules/{notificationRuleId}", notificationRuleId: string): NotificationRuleAdministrationGetNotificationRule;
|
|
201
|
+
/** Resource for '/notification-rules' has methods for the following verbs: get */
|
|
202
|
+
(path: "/notification-rules"): NotificationRuleAdministrationListNotificationRule;
|
|
167
203
|
/** Resource for '/test-runs/\{testRunId\}' has methods for the following verbs: get, patch, delete */
|
|
168
204
|
(path: "/test-runs/{testRunId}", testRunId: string): LoadTestRunGetTestRun;
|
|
169
205
|
/** Resource for '/test-runs' has methods for the following verbs: get */
|
|
@@ -172,6 +208,10 @@ export interface Routes {
|
|
|
172
208
|
(path: "/test-runs/{testRunId}/files/{fileName}", testRunId: string, fileName: string): LoadTestRunGetTestRunFile;
|
|
173
209
|
/** Resource for '/test-runs/\{testRunId\}:stop' has methods for the following verbs: post */
|
|
174
210
|
(path: "/test-runs/{testRunId}:stop", testRunId: string): LoadTestRunStop;
|
|
211
|
+
/** Resource for '/test-runs/\{testRunId\}/insights/latest' has methods for the following verbs: get, patch */
|
|
212
|
+
(path: "/test-runs/{testRunId}/insights/latest", testRunId: string): LoadTestRunGetLatestInsights;
|
|
213
|
+
/** Resource for '/test-runs/\{testRunId\}/insights:generate' has methods for the following verbs: post */
|
|
214
|
+
(path: "/test-runs/{testRunId}/insights:generate", testRunId: string): LoadTestRunGenerateInsights;
|
|
175
215
|
/** Resource for '/test-runs/\{testRunId\}/metric-namespaces' has methods for the following verbs: get */
|
|
176
216
|
(path: "/test-runs/{testRunId}/metric-namespaces", testRunId: string): LoadTestRunListMetricNamespaces;
|
|
177
217
|
/** Resource for '/test-runs/\{testRunId\}/metric-definitions' has methods for the following verbs: get */
|
|
@@ -190,14 +230,6 @@ export interface Routes {
|
|
|
190
230
|
(path: "/test-profile-runs/{testProfileRunId}:stop", testProfileRunId: string): TestProfileRunAdministrationStop;
|
|
191
231
|
/** Resource for '/test-profile-runs' has methods for the following verbs: get */
|
|
192
232
|
(path: "/test-profile-runs"): TestProfileRunAdministrationListTestProfileRuns;
|
|
193
|
-
/** Resource for '/triggers/\{triggerId\}' has methods for the following verbs: get, patch, delete */
|
|
194
|
-
(path: "/triggers/{triggerId}", triggerId: string): TriggerAdministrationGetTrigger;
|
|
195
|
-
/** Resource for '/triggers' has methods for the following verbs: get */
|
|
196
|
-
(path: "/triggers"): TriggerAdministrationListTrigger;
|
|
197
|
-
/** Resource for '/notification-rules/\{notificationRuleId\}' has methods for the following verbs: get, patch, delete */
|
|
198
|
-
(path: "/notification-rules/{notificationRuleId}", notificationRuleId: string): NotificationRuleAdministrationGetNotificationRule;
|
|
199
|
-
/** Resource for '/notification-rules' has methods for the following verbs: get */
|
|
200
|
-
(path: "/notification-rules"): NotificationRuleAdministrationListNotificationRule;
|
|
201
233
|
}
|
|
202
234
|
export type AzureLoadTestingClient = Client & {
|
|
203
235
|
path: Routes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../src/clientDefinitions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n LoadTestAdministrationCreateOrUpdateTestParameters,\n LoadTestAdministrationDeleteTestParameters,\n LoadTestAdministrationGetTestParameters,\n LoadTestAdministrationListTestsParameters,\n LoadTestAdministrationUploadTestFileParameters,\n LoadTestAdministrationGetTestFileParameters,\n LoadTestAdministrationDeleteTestFileParameters,\n LoadTestAdministrationListTestFilesParameters,\n LoadTestAdministrationCreateOrUpdateAppComponentsParameters,\n LoadTestAdministrationGetAppComponentsParameters,\n LoadTestAdministrationCreateOrUpdateServerMetricsConfigParameters,\n LoadTestAdministrationGetServerMetricsConfigParameters,\n TestProfileAdministrationCreateOrUpdateTestProfileParameters,\n TestProfileAdministrationDeleteTestProfileParameters,\n TestProfileAdministrationGetTestProfileParameters,\n TestProfileAdministrationListTestProfilesParameters,\n LoadTestRunGetTestRunParameters,\n LoadTestRunCreateOrUpdateTestRunParameters,\n LoadTestRunDeleteTestRunParameters,\n LoadTestRunListTestRunsParameters,\n LoadTestRunGetTestRunFileParameters,\n LoadTestRunStopParameters,\n LoadTestRunListMetricNamespacesParameters,\n LoadTestRunListMetricDefinitionsParameters,\n LoadTestRunListMetricsParameters,\n LoadTestRunListMetricDimensionValuesParameters,\n LoadTestRunCreateOrUpdateAppComponentsParameters,\n LoadTestRunGetAppComponentsParameters,\n LoadTestRunCreateOrUpdateServerMetricsConfigParameters,\n LoadTestRunGetServerMetricsConfigParameters,\n TestProfileRunAdministrationGetTestProfileRunParameters,\n TestProfileRunAdministrationCreateOrUpdateTestProfileRunParameters,\n TestProfileRunAdministrationDeleteTestProfileRunParameters,\n TestProfileRunAdministrationStopParameters,\n TestProfileRunAdministrationListTestProfileRunsParameters,\n TriggerAdministrationGetTriggerParameters,\n TriggerAdministrationCreateOrUpdateTriggerParameters,\n TriggerAdministrationDeleteTriggerParameters,\n TriggerAdministrationListTriggerParameters,\n NotificationRuleAdministrationGetNotificationRuleParameters,\n NotificationRuleAdministrationCreateOrUpdateNotificationRuleParameters,\n NotificationRuleAdministrationDeleteNotificationRuleParameters,\n NotificationRuleAdministrationListNotificationRuleParameters,\n} from \"./parameters.js\";\nimport type {\n LoadTestAdministrationCreateOrUpdateTest200Response,\n LoadTestAdministrationCreateOrUpdateTest201Response,\n LoadTestAdministrationCreateOrUpdateTestDefaultResponse,\n LoadTestAdministrationDeleteTest204Response,\n LoadTestAdministrationDeleteTestDefaultResponse,\n LoadTestAdministrationGetTest200Response,\n LoadTestAdministrationGetTestDefaultResponse,\n LoadTestAdministrationListTests200Response,\n LoadTestAdministrationListTestsDefaultResponse,\n LoadTestAdministrationUploadTestFile201Response,\n LoadTestAdministrationUploadTestFileDefaultResponse,\n LoadTestAdministrationGetTestFile200Response,\n LoadTestAdministrationGetTestFileDefaultResponse,\n LoadTestAdministrationDeleteTestFile204Response,\n LoadTestAdministrationDeleteTestFileDefaultResponse,\n LoadTestAdministrationListTestFiles200Response,\n LoadTestAdministrationListTestFilesDefaultResponse,\n LoadTestAdministrationCreateOrUpdateAppComponents200Response,\n LoadTestAdministrationCreateOrUpdateAppComponents201Response,\n LoadTestAdministrationCreateOrUpdateAppComponentsDefaultResponse,\n LoadTestAdministrationGetAppComponents200Response,\n LoadTestAdministrationGetAppComponentsDefaultResponse,\n LoadTestAdministrationCreateOrUpdateServerMetricsConfig200Response,\n LoadTestAdministrationCreateOrUpdateServerMetricsConfig201Response,\n LoadTestAdministrationCreateOrUpdateServerMetricsConfigDefaultResponse,\n LoadTestAdministrationGetServerMetricsConfig200Response,\n LoadTestAdministrationGetServerMetricsConfigDefaultResponse,\n TestProfileAdministrationCreateOrUpdateTestProfile200Response,\n TestProfileAdministrationCreateOrUpdateTestProfile201Response,\n TestProfileAdministrationCreateOrUpdateTestProfileDefaultResponse,\n TestProfileAdministrationDeleteTestProfile204Response,\n TestProfileAdministrationDeleteTestProfileDefaultResponse,\n TestProfileAdministrationGetTestProfile200Response,\n TestProfileAdministrationGetTestProfileDefaultResponse,\n TestProfileAdministrationListTestProfiles200Response,\n TestProfileAdministrationListTestProfilesDefaultResponse,\n LoadTestRunGetTestRun200Response,\n LoadTestRunGetTestRunDefaultResponse,\n LoadTestRunCreateOrUpdateTestRun200Response,\n LoadTestRunCreateOrUpdateTestRun201Response,\n LoadTestRunCreateOrUpdateTestRunDefaultResponse,\n LoadTestRunDeleteTestRun204Response,\n LoadTestRunDeleteTestRunDefaultResponse,\n LoadTestRunListTestRuns200Response,\n LoadTestRunListTestRunsDefaultResponse,\n LoadTestRunGetTestRunFile200Response,\n LoadTestRunGetTestRunFileDefaultResponse,\n LoadTestRunStop200Response,\n LoadTestRunStopDefaultResponse,\n LoadTestRunListMetricNamespaces200Response,\n LoadTestRunListMetricNamespacesDefaultResponse,\n LoadTestRunListMetricDefinitions200Response,\n LoadTestRunListMetricDefinitionsDefaultResponse,\n LoadTestRunListMetrics200Response,\n LoadTestRunListMetricsDefaultResponse,\n LoadTestRunListMetricDimensionValues200Response,\n LoadTestRunListMetricDimensionValuesDefaultResponse,\n LoadTestRunCreateOrUpdateAppComponents200Response,\n LoadTestRunCreateOrUpdateAppComponents201Response,\n LoadTestRunCreateOrUpdateAppComponentsDefaultResponse,\n LoadTestRunGetAppComponents200Response,\n LoadTestRunGetAppComponentsDefaultResponse,\n LoadTestRunCreateOrUpdateServerMetricsConfig200Response,\n LoadTestRunCreateOrUpdateServerMetricsConfig201Response,\n LoadTestRunCreateOrUpdateServerMetricsConfigDefaultResponse,\n LoadTestRunGetServerMetricsConfig200Response,\n LoadTestRunGetServerMetricsConfigDefaultResponse,\n TestProfileRunAdministrationGetTestProfileRun200Response,\n TestProfileRunAdministrationGetTestProfileRunDefaultResponse,\n TestProfileRunAdministrationCreateOrUpdateTestProfileRun200Response,\n TestProfileRunAdministrationCreateOrUpdateTestProfileRun201Response,\n TestProfileRunAdministrationCreateOrUpdateTestProfileRunDefaultResponse,\n TestProfileRunAdministrationDeleteTestProfileRun204Response,\n TestProfileRunAdministrationDeleteTestProfileRunDefaultResponse,\n TestProfileRunAdministrationStop200Response,\n TestProfileRunAdministrationStopDefaultResponse,\n TestProfileRunAdministrationListTestProfileRuns200Response,\n TestProfileRunAdministrationListTestProfileRunsDefaultResponse,\n TriggerAdministrationGetTrigger200Response,\n TriggerAdministrationGetTriggerDefaultResponse,\n TriggerAdministrationCreateOrUpdateTrigger200Response,\n TriggerAdministrationCreateOrUpdateTrigger201Response,\n TriggerAdministrationCreateOrUpdateTriggerDefaultResponse,\n TriggerAdministrationDeleteTrigger204Response,\n TriggerAdministrationDeleteTriggerDefaultResponse,\n TriggerAdministrationListTrigger200Response,\n TriggerAdministrationListTriggerDefaultResponse,\n NotificationRuleAdministrationGetNotificationRule200Response,\n NotificationRuleAdministrationGetNotificationRuleDefaultResponse,\n NotificationRuleAdministrationCreateOrUpdateNotificationRule200Response,\n NotificationRuleAdministrationCreateOrUpdateNotificationRule201Response,\n NotificationRuleAdministrationCreateOrUpdateNotificationRuleDefaultResponse,\n NotificationRuleAdministrationDeleteNotificationRule204Response,\n NotificationRuleAdministrationDeleteNotificationRuleDefaultResponse,\n NotificationRuleAdministrationListNotificationRule200Response,\n NotificationRuleAdministrationListNotificationRuleDefaultResponse,\n} from \"./responses.js\";\nimport type { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface LoadTestAdministrationCreateOrUpdateTest {\n /** Create a new test or update an existing test by providing the test Id. */\n patch(\n options: LoadTestAdministrationCreateOrUpdateTestParameters,\n ): StreamableMethod<\n | LoadTestAdministrationCreateOrUpdateTest200Response\n | LoadTestAdministrationCreateOrUpdateTest201Response\n | LoadTestAdministrationCreateOrUpdateTestDefaultResponse\n >;\n /** Delete a test by its test Id. */\n delete(\n options?: LoadTestAdministrationDeleteTestParameters,\n ): StreamableMethod<\n LoadTestAdministrationDeleteTest204Response | LoadTestAdministrationDeleteTestDefaultResponse\n >;\n /** Get load test details by test Id */\n get(\n options?: LoadTestAdministrationGetTestParameters,\n ): StreamableMethod<\n LoadTestAdministrationGetTest200Response | LoadTestAdministrationGetTestDefaultResponse\n >;\n}\n\nexport interface LoadTestAdministrationListTests {\n /**\n * Get all load tests by the fully qualified resource Id e.g\n * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}.\n */\n get(\n options?: LoadTestAdministrationListTestsParameters,\n ): StreamableMethod<\n LoadTestAdministrationListTests200Response | LoadTestAdministrationListTestsDefaultResponse\n >;\n}\n\nexport interface LoadTestAdministrationUploadTestFile {\n /**\n * Upload input file for a given test Id. File size can't be more than 50 MB.\n * Existing file with same name for the given test will be overwritten. File\n * should be provided in the request body as application/octet-stream.\n */\n put(\n options: LoadTestAdministrationUploadTestFileParameters,\n ): StreamableMethod<\n | LoadTestAdministrationUploadTestFile201Response\n | LoadTestAdministrationUploadTestFileDefaultResponse\n >;\n /** Get all the files that are associated with a test. */\n get(\n options?: LoadTestAdministrationGetTestFileParameters,\n ): StreamableMethod<\n LoadTestAdministrationGetTestFile200Response | LoadTestAdministrationGetTestFileDefaultResponse\n >;\n /** Delete file by the file name for a test */\n delete(\n options?: LoadTestAdministrationDeleteTestFileParameters,\n ): StreamableMethod<\n | LoadTestAdministrationDeleteTestFile204Response\n | LoadTestAdministrationDeleteTestFileDefaultResponse\n >;\n}\n\nexport interface LoadTestAdministrationListTestFiles {\n /** Get all test files. */\n get(\n options?: LoadTestAdministrationListTestFilesParameters,\n ): StreamableMethod<\n | LoadTestAdministrationListTestFiles200Response\n | LoadTestAdministrationListTestFilesDefaultResponse\n >;\n}\n\nexport interface LoadTestAdministrationCreateOrUpdateAppComponents {\n /** Add an app component to a test by providing the resource Id, name and type. */\n patch(\n options: LoadTestAdministrationCreateOrUpdateAppComponentsParameters,\n ): StreamableMethod<\n | LoadTestAdministrationCreateOrUpdateAppComponents200Response\n | LoadTestAdministrationCreateOrUpdateAppComponents201Response\n | LoadTestAdministrationCreateOrUpdateAppComponentsDefaultResponse\n >;\n /** Get associated app component (collection of azure resources) for the given test. */\n get(\n options?: LoadTestAdministrationGetAppComponentsParameters,\n ): StreamableMethod<\n | LoadTestAdministrationGetAppComponents200Response\n | LoadTestAdministrationGetAppComponentsDefaultResponse\n >;\n}\n\nexport interface LoadTestAdministrationCreateOrUpdateServerMetricsConfig {\n /** Configure server metrics for a test */\n patch(\n options: LoadTestAdministrationCreateOrUpdateServerMetricsConfigParameters,\n ): StreamableMethod<\n | LoadTestAdministrationCreateOrUpdateServerMetricsConfig200Response\n | LoadTestAdministrationCreateOrUpdateServerMetricsConfig201Response\n | LoadTestAdministrationCreateOrUpdateServerMetricsConfigDefaultResponse\n >;\n /** List server metrics configuration for the given test. */\n get(\n options?: LoadTestAdministrationGetServerMetricsConfigParameters,\n ): StreamableMethod<\n | LoadTestAdministrationGetServerMetricsConfig200Response\n | LoadTestAdministrationGetServerMetricsConfigDefaultResponse\n >;\n}\n\nexport interface TestProfileAdministrationCreateOrUpdateTestProfile {\n /** Create a new test profile or update an existing test profile by providing the test profile Id. */\n patch(\n options: TestProfileAdministrationCreateOrUpdateTestProfileParameters,\n ): StreamableMethod<\n | TestProfileAdministrationCreateOrUpdateTestProfile200Response\n | TestProfileAdministrationCreateOrUpdateTestProfile201Response\n | TestProfileAdministrationCreateOrUpdateTestProfileDefaultResponse\n >;\n /** Delete a test profile by its test profile Id. */\n delete(\n options?: TestProfileAdministrationDeleteTestProfileParameters,\n ): StreamableMethod<\n | TestProfileAdministrationDeleteTestProfile204Response\n | TestProfileAdministrationDeleteTestProfileDefaultResponse\n >;\n /** Get load test profile details by test profile Id. */\n get(\n options?: TestProfileAdministrationGetTestProfileParameters,\n ): StreamableMethod<\n | TestProfileAdministrationGetTestProfile200Response\n | TestProfileAdministrationGetTestProfileDefaultResponse\n >;\n}\n\nexport interface TestProfileAdministrationListTestProfiles {\n /** Get all test profiles for the given filters. */\n get(\n options?: TestProfileAdministrationListTestProfilesParameters,\n ): StreamableMethod<\n | TestProfileAdministrationListTestProfiles200Response\n | TestProfileAdministrationListTestProfilesDefaultResponse\n >;\n}\n\nexport interface LoadTestRunGetTestRun {\n /** Get test run details by test run Id. */\n get(\n options?: LoadTestRunGetTestRunParameters,\n ): StreamableMethod<LoadTestRunGetTestRun200Response | LoadTestRunGetTestRunDefaultResponse>;\n /** Create and start a new test run with the given test run Id. */\n patch(\n options: LoadTestRunCreateOrUpdateTestRunParameters,\n ): StreamableMethod<\n | LoadTestRunCreateOrUpdateTestRun200Response\n | LoadTestRunCreateOrUpdateTestRun201Response\n | LoadTestRunCreateOrUpdateTestRunDefaultResponse\n >;\n /** Delete an existing load test run by providing the testRunId. */\n delete(\n options?: LoadTestRunDeleteTestRunParameters,\n ): StreamableMethod<\n LoadTestRunDeleteTestRun204Response | LoadTestRunDeleteTestRunDefaultResponse\n >;\n}\n\nexport interface LoadTestRunListTestRuns {\n /** Get all test runs for the given filters. */\n get(\n options?: LoadTestRunListTestRunsParameters,\n ): StreamableMethod<LoadTestRunListTestRuns200Response | LoadTestRunListTestRunsDefaultResponse>;\n}\n\nexport interface LoadTestRunGetTestRunFile {\n /** Get test run file by file name. */\n get(\n options?: LoadTestRunGetTestRunFileParameters,\n ): StreamableMethod<\n LoadTestRunGetTestRunFile200Response | LoadTestRunGetTestRunFileDefaultResponse\n >;\n}\n\nexport interface LoadTestRunStop {\n /** Stop test run by test run Id. */\n post(\n options?: LoadTestRunStopParameters,\n ): StreamableMethod<LoadTestRunStop200Response | LoadTestRunStopDefaultResponse>;\n}\n\nexport interface LoadTestRunListMetricNamespaces {\n /** List the metric namespaces for a load test run. */\n get(\n options?: LoadTestRunListMetricNamespacesParameters,\n ): StreamableMethod<\n LoadTestRunListMetricNamespaces200Response | LoadTestRunListMetricNamespacesDefaultResponse\n >;\n}\n\nexport interface LoadTestRunListMetricDefinitions {\n /** List the metric definitions for a load test run. */\n get(\n options: LoadTestRunListMetricDefinitionsParameters,\n ): StreamableMethod<\n LoadTestRunListMetricDefinitions200Response | LoadTestRunListMetricDefinitionsDefaultResponse\n >;\n}\n\nexport interface LoadTestRunListMetrics {\n /** List the metric values for a load test run. */\n post(\n options: LoadTestRunListMetricsParameters,\n ): StreamableMethod<LoadTestRunListMetrics200Response | LoadTestRunListMetricsDefaultResponse>;\n}\n\nexport interface LoadTestRunListMetricDimensionValues {\n /** List the dimension values for the given metric dimension name. */\n get(\n options: LoadTestRunListMetricDimensionValuesParameters,\n ): StreamableMethod<\n | LoadTestRunListMetricDimensionValues200Response\n | LoadTestRunListMetricDimensionValuesDefaultResponse\n >;\n}\n\nexport interface LoadTestRunCreateOrUpdateAppComponents {\n /** Add an app component to a test run by providing the resource Id, name and type. */\n patch(\n options: LoadTestRunCreateOrUpdateAppComponentsParameters,\n ): StreamableMethod<\n | LoadTestRunCreateOrUpdateAppComponents200Response\n | LoadTestRunCreateOrUpdateAppComponents201Response\n | LoadTestRunCreateOrUpdateAppComponentsDefaultResponse\n >;\n /**\n * Get associated app component (collection of azure resources) for the given test\n * run.\n */\n get(\n options?: LoadTestRunGetAppComponentsParameters,\n ): StreamableMethod<\n LoadTestRunGetAppComponents200Response | LoadTestRunGetAppComponentsDefaultResponse\n >;\n}\n\nexport interface LoadTestRunCreateOrUpdateServerMetricsConfig {\n /** Configure server metrics for a test run */\n patch(\n options: LoadTestRunCreateOrUpdateServerMetricsConfigParameters,\n ): StreamableMethod<\n | LoadTestRunCreateOrUpdateServerMetricsConfig200Response\n | LoadTestRunCreateOrUpdateServerMetricsConfig201Response\n | LoadTestRunCreateOrUpdateServerMetricsConfigDefaultResponse\n >;\n /** Get associated server metrics configuration for the given test run. */\n get(\n options?: LoadTestRunGetServerMetricsConfigParameters,\n ): StreamableMethod<\n LoadTestRunGetServerMetricsConfig200Response | LoadTestRunGetServerMetricsConfigDefaultResponse\n >;\n}\n\nexport interface TestProfileRunAdministrationGetTestProfileRun {\n /** Get test profile run details by test profile run Id. */\n get(\n options?: TestProfileRunAdministrationGetTestProfileRunParameters,\n ): StreamableMethod<\n | TestProfileRunAdministrationGetTestProfileRun200Response\n | TestProfileRunAdministrationGetTestProfileRunDefaultResponse\n >;\n /** Create and start a new test profile run with the given test profile run Id. */\n patch(\n options: TestProfileRunAdministrationCreateOrUpdateTestProfileRunParameters,\n ): StreamableMethod<\n | TestProfileRunAdministrationCreateOrUpdateTestProfileRun200Response\n | TestProfileRunAdministrationCreateOrUpdateTestProfileRun201Response\n | TestProfileRunAdministrationCreateOrUpdateTestProfileRunDefaultResponse\n >;\n /** Delete an existing load test profile run by providing the test profile run Id. */\n delete(\n options?: TestProfileRunAdministrationDeleteTestProfileRunParameters,\n ): StreamableMethod<\n | TestProfileRunAdministrationDeleteTestProfileRun204Response\n | TestProfileRunAdministrationDeleteTestProfileRunDefaultResponse\n >;\n}\n\nexport interface TestProfileRunAdministrationStop {\n /** Stop test profile run for the given test profile run Id. */\n post(\n options?: TestProfileRunAdministrationStopParameters,\n ): StreamableMethod<\n TestProfileRunAdministrationStop200Response | TestProfileRunAdministrationStopDefaultResponse\n >;\n}\n\nexport interface TestProfileRunAdministrationListTestProfileRuns {\n /** Get all test profile runs for the given filters. */\n get(\n options?: TestProfileRunAdministrationListTestProfileRunsParameters,\n ): StreamableMethod<\n | TestProfileRunAdministrationListTestProfileRuns200Response\n | TestProfileRunAdministrationListTestProfileRunsDefaultResponse\n >;\n}\n\nexport interface TriggerAdministrationGetTrigger {\n /** Resource read operation template. */\n get(\n options?: TriggerAdministrationGetTriggerParameters,\n ): StreamableMethod<\n TriggerAdministrationGetTrigger200Response | TriggerAdministrationGetTriggerDefaultResponse\n >;\n /** Create or update operation template. */\n patch(\n options: TriggerAdministrationCreateOrUpdateTriggerParameters,\n ): StreamableMethod<\n | TriggerAdministrationCreateOrUpdateTrigger200Response\n | TriggerAdministrationCreateOrUpdateTrigger201Response\n | TriggerAdministrationCreateOrUpdateTriggerDefaultResponse\n >;\n /** Resource delete operation template. */\n delete(\n options?: TriggerAdministrationDeleteTriggerParameters,\n ): StreamableMethod<\n | TriggerAdministrationDeleteTrigger204Response\n | TriggerAdministrationDeleteTriggerDefaultResponse\n >;\n}\n\nexport interface TriggerAdministrationListTrigger {\n /** Resource list operation template. */\n get(\n options?: TriggerAdministrationListTriggerParameters,\n ): StreamableMethod<\n TriggerAdministrationListTrigger200Response | TriggerAdministrationListTriggerDefaultResponse\n >;\n}\n\nexport interface NotificationRuleAdministrationGetNotificationRule {\n /** Resource read operation template. */\n get(\n options?: NotificationRuleAdministrationGetNotificationRuleParameters,\n ): StreamableMethod<\n | NotificationRuleAdministrationGetNotificationRule200Response\n | NotificationRuleAdministrationGetNotificationRuleDefaultResponse\n >;\n /** Create or update operation template. */\n patch(\n options: NotificationRuleAdministrationCreateOrUpdateNotificationRuleParameters,\n ): StreamableMethod<\n | NotificationRuleAdministrationCreateOrUpdateNotificationRule200Response\n | NotificationRuleAdministrationCreateOrUpdateNotificationRule201Response\n | NotificationRuleAdministrationCreateOrUpdateNotificationRuleDefaultResponse\n >;\n /** Resource delete operation template. */\n delete(\n options?: NotificationRuleAdministrationDeleteNotificationRuleParameters,\n ): StreamableMethod<\n | NotificationRuleAdministrationDeleteNotificationRule204Response\n | NotificationRuleAdministrationDeleteNotificationRuleDefaultResponse\n >;\n}\n\nexport interface NotificationRuleAdministrationListNotificationRule {\n /** Resource list operation template. */\n get(\n options?: NotificationRuleAdministrationListNotificationRuleParameters,\n ): StreamableMethod<\n | NotificationRuleAdministrationListNotificationRule200Response\n | NotificationRuleAdministrationListNotificationRuleDefaultResponse\n >;\n}\n\nexport interface Routes {\n /** Resource for '/tests/\\{testId\\}' has methods for the following verbs: patch, delete, get */\n (path: \"/tests/{testId}\", testId: string): LoadTestAdministrationCreateOrUpdateTest;\n /** Resource for '/tests' has methods for the following verbs: get */\n (path: \"/tests\"): LoadTestAdministrationListTests;\n /** Resource for '/tests/\\{testId\\}/files/\\{fileName\\}' has methods for the following verbs: put, get, delete */\n (\n path: \"/tests/{testId}/files/{fileName}\",\n testId: string,\n fileName: string,\n ): LoadTestAdministrationUploadTestFile;\n /** Resource for '/tests/\\{testId\\}/files' has methods for the following verbs: get */\n (path: \"/tests/{testId}/files\", testId: string): LoadTestAdministrationListTestFiles;\n /** Resource for '/tests/\\{testId\\}/app-components' has methods for the following verbs: patch, get */\n (\n path: \"/tests/{testId}/app-components\",\n testId: string,\n ): LoadTestAdministrationCreateOrUpdateAppComponents;\n /** Resource for '/tests/\\{testId\\}/server-metrics-config' has methods for the following verbs: patch, get */\n (\n path: \"/tests/{testId}/server-metrics-config\",\n testId: string,\n ): LoadTestAdministrationCreateOrUpdateServerMetricsConfig;\n /** Resource for '/test-profiles/\\{testProfileId\\}' has methods for the following verbs: patch, delete, get */\n (\n path: \"/test-profiles/{testProfileId}\",\n testProfileId: string,\n ): TestProfileAdministrationCreateOrUpdateTestProfile;\n /** Resource for '/test-profiles' has methods for the following verbs: get */\n (path: \"/test-profiles\"): TestProfileAdministrationListTestProfiles;\n /** Resource for '/test-runs/\\{testRunId\\}' has methods for the following verbs: get, patch, delete */\n (path: \"/test-runs/{testRunId}\", testRunId: string): LoadTestRunGetTestRun;\n /** Resource for '/test-runs' has methods for the following verbs: get */\n (path: \"/test-runs\"): LoadTestRunListTestRuns;\n /** Resource for '/test-runs/\\{testRunId\\}/files/\\{fileName\\}' has methods for the following verbs: get */\n (\n path: \"/test-runs/{testRunId}/files/{fileName}\",\n testRunId: string,\n fileName: string,\n ): LoadTestRunGetTestRunFile;\n /** Resource for '/test-runs/\\{testRunId\\}:stop' has methods for the following verbs: post */\n (path: \"/test-runs/{testRunId}:stop\", testRunId: string): LoadTestRunStop;\n /** Resource for '/test-runs/\\{testRunId\\}/metric-namespaces' has methods for the following verbs: get */\n (\n path: \"/test-runs/{testRunId}/metric-namespaces\",\n testRunId: string,\n ): LoadTestRunListMetricNamespaces;\n /** Resource for '/test-runs/\\{testRunId\\}/metric-definitions' has methods for the following verbs: get */\n (\n path: \"/test-runs/{testRunId}/metric-definitions\",\n testRunId: string,\n ): LoadTestRunListMetricDefinitions;\n /** Resource for '/test-runs/\\{testRunId\\}/metrics' has methods for the following verbs: post */\n (path: \"/test-runs/{testRunId}/metrics\", testRunId: string): LoadTestRunListMetrics;\n /** Resource for '/test-runs/\\{testRunId\\}/metric-dimensions/\\{name\\}/values' has methods for the following verbs: get */\n (\n path: \"/test-runs/{testRunId}/metric-dimensions/{name}/values\",\n testRunId: string,\n name: string,\n ): LoadTestRunListMetricDimensionValues;\n /** Resource for '/test-runs/\\{testRunId\\}/app-components' has methods for the following verbs: patch, get */\n (\n path: \"/test-runs/{testRunId}/app-components\",\n testRunId: string,\n ): LoadTestRunCreateOrUpdateAppComponents;\n /** Resource for '/test-runs/\\{testRunId\\}/server-metrics-config' has methods for the following verbs: patch, get */\n (\n path: \"/test-runs/{testRunId}/server-metrics-config\",\n testRunId: string,\n ): LoadTestRunCreateOrUpdateServerMetricsConfig;\n /** Resource for '/test-profile-runs/\\{testProfileRunId\\}' has methods for the following verbs: get, patch, delete */\n (\n path: \"/test-profile-runs/{testProfileRunId}\",\n testProfileRunId: string,\n ): TestProfileRunAdministrationGetTestProfileRun;\n /** Resource for '/test-profile-runs/\\{testProfileRunId\\}:stop' has methods for the following verbs: post */\n (\n path: \"/test-profile-runs/{testProfileRunId}:stop\",\n testProfileRunId: string,\n ): TestProfileRunAdministrationStop;\n /** Resource for '/test-profile-runs' has methods for the following verbs: get */\n (path: \"/test-profile-runs\"): TestProfileRunAdministrationListTestProfileRuns;\n /** Resource for '/triggers/\\{triggerId\\}' has methods for the following verbs: get, patch, delete */\n (path: \"/triggers/{triggerId}\", triggerId: string): TriggerAdministrationGetTrigger;\n /** Resource for '/triggers' has methods for the following verbs: get */\n (path: \"/triggers\"): TriggerAdministrationListTrigger;\n /** Resource for '/notification-rules/\\{notificationRuleId\\}' has methods for the following verbs: get, patch, delete */\n (\n path: \"/notification-rules/{notificationRuleId}\",\n notificationRuleId: string,\n ): NotificationRuleAdministrationGetNotificationRule;\n /** Resource for '/notification-rules' has methods for the following verbs: get */\n (path: \"/notification-rules\"): NotificationRuleAdministrationListNotificationRule;\n}\n\nexport type AzureLoadTestingClient = Client & {\n path: Routes;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../src/clientDefinitions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n OperationsGetStatusParameters,\n LoadTestAdministrationCreateOrUpdateTestParameters,\n LoadTestAdministrationDeleteTestParameters,\n LoadTestAdministrationGetTestParameters,\n LoadTestAdministrationListTestsParameters,\n LoadTestAdministrationCloneTestParameters,\n LoadTestAdministrationGenerateTestPlanRecommendationsParameters,\n LoadTestAdministrationUploadTestFileParameters,\n LoadTestAdministrationGetTestFileParameters,\n LoadTestAdministrationDeleteTestFileParameters,\n LoadTestAdministrationListTestFilesParameters,\n LoadTestAdministrationCreateOrUpdateAppComponentsParameters,\n LoadTestAdministrationGetAppComponentsParameters,\n LoadTestAdministrationCreateOrUpdateServerMetricsConfigParameters,\n LoadTestAdministrationGetServerMetricsConfigParameters,\n TestProfileAdministrationCreateOrUpdateTestProfileParameters,\n TestProfileAdministrationDeleteTestProfileParameters,\n TestProfileAdministrationGetTestProfileParameters,\n TestProfileAdministrationListTestProfilesParameters,\n TriggerAdministrationGetTriggerParameters,\n TriggerAdministrationCreateOrUpdateTriggerParameters,\n TriggerAdministrationDeleteTriggerParameters,\n TriggerAdministrationListTriggerParameters,\n NotificationRuleAdministrationGetNotificationRuleParameters,\n NotificationRuleAdministrationCreateOrUpdateNotificationRuleParameters,\n NotificationRuleAdministrationDeleteNotificationRuleParameters,\n NotificationRuleAdministrationListNotificationRuleParameters,\n LoadTestRunGetTestRunParameters,\n LoadTestRunCreateOrUpdateTestRunParameters,\n LoadTestRunDeleteTestRunParameters,\n LoadTestRunListTestRunsParameters,\n LoadTestRunGetTestRunFileParameters,\n LoadTestRunStopParameters,\n LoadTestRunGetLatestInsightsParameters,\n LoadTestRunUpdateLatestInsightsParameters,\n LoadTestRunGenerateInsightsParameters,\n LoadTestRunListMetricNamespacesParameters,\n LoadTestRunListMetricDefinitionsParameters,\n LoadTestRunListMetricsParameters,\n LoadTestRunListMetricDimensionValuesParameters,\n LoadTestRunCreateOrUpdateAppComponentsParameters,\n LoadTestRunGetAppComponentsParameters,\n LoadTestRunCreateOrUpdateServerMetricsConfigParameters,\n LoadTestRunGetServerMetricsConfigParameters,\n TestProfileRunAdministrationGetTestProfileRunParameters,\n TestProfileRunAdministrationCreateOrUpdateTestProfileRunParameters,\n TestProfileRunAdministrationDeleteTestProfileRunParameters,\n TestProfileRunAdministrationStopParameters,\n TestProfileRunAdministrationListTestProfileRunsParameters,\n} from \"./parameters.js\";\nimport type {\n OperationsGetStatus200Response,\n OperationsGetStatusDefaultResponse,\n LoadTestAdministrationCreateOrUpdateTest200Response,\n LoadTestAdministrationCreateOrUpdateTest201Response,\n LoadTestAdministrationCreateOrUpdateTestDefaultResponse,\n LoadTestAdministrationDeleteTest204Response,\n LoadTestAdministrationDeleteTestDefaultResponse,\n LoadTestAdministrationGetTest200Response,\n LoadTestAdministrationGetTestDefaultResponse,\n LoadTestAdministrationListTests200Response,\n LoadTestAdministrationListTestsDefaultResponse,\n LoadTestAdministrationCloneTest202Response,\n LoadTestAdministrationCloneTestDefaultResponse,\n LoadTestAdministrationGenerateTestPlanRecommendations202Response,\n LoadTestAdministrationGenerateTestPlanRecommendationsDefaultResponse,\n LoadTestAdministrationUploadTestFile201Response,\n LoadTestAdministrationUploadTestFileDefaultResponse,\n LoadTestAdministrationGetTestFile200Response,\n LoadTestAdministrationGetTestFileDefaultResponse,\n LoadTestAdministrationDeleteTestFile204Response,\n LoadTestAdministrationDeleteTestFileDefaultResponse,\n LoadTestAdministrationListTestFiles200Response,\n LoadTestAdministrationListTestFilesDefaultResponse,\n LoadTestAdministrationCreateOrUpdateAppComponents200Response,\n LoadTestAdministrationCreateOrUpdateAppComponents201Response,\n LoadTestAdministrationCreateOrUpdateAppComponentsDefaultResponse,\n LoadTestAdministrationGetAppComponents200Response,\n LoadTestAdministrationGetAppComponentsDefaultResponse,\n LoadTestAdministrationCreateOrUpdateServerMetricsConfig200Response,\n LoadTestAdministrationCreateOrUpdateServerMetricsConfig201Response,\n LoadTestAdministrationCreateOrUpdateServerMetricsConfigDefaultResponse,\n LoadTestAdministrationGetServerMetricsConfig200Response,\n LoadTestAdministrationGetServerMetricsConfigDefaultResponse,\n TestProfileAdministrationCreateOrUpdateTestProfile200Response,\n TestProfileAdministrationCreateOrUpdateTestProfile201Response,\n TestProfileAdministrationCreateOrUpdateTestProfileDefaultResponse,\n TestProfileAdministrationDeleteTestProfile204Response,\n TestProfileAdministrationDeleteTestProfileDefaultResponse,\n TestProfileAdministrationGetTestProfile200Response,\n TestProfileAdministrationGetTestProfileDefaultResponse,\n TestProfileAdministrationListTestProfiles200Response,\n TestProfileAdministrationListTestProfilesDefaultResponse,\n TriggerAdministrationGetTrigger200Response,\n TriggerAdministrationGetTriggerDefaultResponse,\n TriggerAdministrationCreateOrUpdateTrigger200Response,\n TriggerAdministrationCreateOrUpdateTrigger201Response,\n TriggerAdministrationCreateOrUpdateTriggerDefaultResponse,\n TriggerAdministrationDeleteTrigger204Response,\n TriggerAdministrationDeleteTriggerDefaultResponse,\n TriggerAdministrationListTrigger200Response,\n TriggerAdministrationListTriggerDefaultResponse,\n NotificationRuleAdministrationGetNotificationRule200Response,\n NotificationRuleAdministrationGetNotificationRuleDefaultResponse,\n NotificationRuleAdministrationCreateOrUpdateNotificationRule200Response,\n NotificationRuleAdministrationCreateOrUpdateNotificationRule201Response,\n NotificationRuleAdministrationCreateOrUpdateNotificationRuleDefaultResponse,\n NotificationRuleAdministrationDeleteNotificationRule204Response,\n NotificationRuleAdministrationDeleteNotificationRuleDefaultResponse,\n NotificationRuleAdministrationListNotificationRule200Response,\n NotificationRuleAdministrationListNotificationRuleDefaultResponse,\n LoadTestRunGetTestRun200Response,\n LoadTestRunGetTestRunDefaultResponse,\n LoadTestRunCreateOrUpdateTestRun200Response,\n LoadTestRunCreateOrUpdateTestRun201Response,\n LoadTestRunCreateOrUpdateTestRunDefaultResponse,\n LoadTestRunDeleteTestRun204Response,\n LoadTestRunDeleteTestRunDefaultResponse,\n LoadTestRunListTestRuns200Response,\n LoadTestRunListTestRunsDefaultResponse,\n LoadTestRunGetTestRunFile200Response,\n LoadTestRunGetTestRunFileDefaultResponse,\n LoadTestRunStop200Response,\n LoadTestRunStopDefaultResponse,\n LoadTestRunGetLatestInsights200Response,\n LoadTestRunGetLatestInsightsDefaultResponse,\n LoadTestRunUpdateLatestInsights200Response,\n LoadTestRunUpdateLatestInsightsDefaultResponse,\n LoadTestRunGenerateInsights202Response,\n LoadTestRunGenerateInsightsDefaultResponse,\n LoadTestRunListMetricNamespaces200Response,\n LoadTestRunListMetricNamespacesDefaultResponse,\n LoadTestRunListMetricDefinitions200Response,\n LoadTestRunListMetricDefinitionsDefaultResponse,\n LoadTestRunListMetrics200Response,\n LoadTestRunListMetricsDefaultResponse,\n LoadTestRunListMetricDimensionValues200Response,\n LoadTestRunListMetricDimensionValuesDefaultResponse,\n LoadTestRunCreateOrUpdateAppComponents200Response,\n LoadTestRunCreateOrUpdateAppComponents201Response,\n LoadTestRunCreateOrUpdateAppComponentsDefaultResponse,\n LoadTestRunGetAppComponents200Response,\n LoadTestRunGetAppComponentsDefaultResponse,\n LoadTestRunCreateOrUpdateServerMetricsConfig200Response,\n LoadTestRunCreateOrUpdateServerMetricsConfig201Response,\n LoadTestRunCreateOrUpdateServerMetricsConfigDefaultResponse,\n LoadTestRunGetServerMetricsConfig200Response,\n LoadTestRunGetServerMetricsConfigDefaultResponse,\n TestProfileRunAdministrationGetTestProfileRun200Response,\n TestProfileRunAdministrationGetTestProfileRunDefaultResponse,\n TestProfileRunAdministrationCreateOrUpdateTestProfileRun200Response,\n TestProfileRunAdministrationCreateOrUpdateTestProfileRun201Response,\n TestProfileRunAdministrationCreateOrUpdateTestProfileRunDefaultResponse,\n TestProfileRunAdministrationDeleteTestProfileRun204Response,\n TestProfileRunAdministrationDeleteTestProfileRunDefaultResponse,\n TestProfileRunAdministrationStop200Response,\n TestProfileRunAdministrationStopDefaultResponse,\n TestProfileRunAdministrationListTestProfileRuns200Response,\n TestProfileRunAdministrationListTestProfileRunsDefaultResponse,\n} from \"./responses.js\";\nimport type { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface OperationsGetStatus {\n /** Get the status of a long running operation. */\n get(\n options?: OperationsGetStatusParameters,\n ): StreamableMethod<OperationsGetStatus200Response | OperationsGetStatusDefaultResponse>;\n}\n\nexport interface LoadTestAdministrationCreateOrUpdateTest {\n /** Create a new test or update an existing test by providing the test Id. */\n patch(\n options: LoadTestAdministrationCreateOrUpdateTestParameters,\n ): StreamableMethod<\n | LoadTestAdministrationCreateOrUpdateTest200Response\n | LoadTestAdministrationCreateOrUpdateTest201Response\n | LoadTestAdministrationCreateOrUpdateTestDefaultResponse\n >;\n /** Delete a test by its test Id. */\n delete(\n options?: LoadTestAdministrationDeleteTestParameters,\n ): StreamableMethod<\n LoadTestAdministrationDeleteTest204Response | LoadTestAdministrationDeleteTestDefaultResponse\n >;\n /** Get load test details by test Id */\n get(\n options?: LoadTestAdministrationGetTestParameters,\n ): StreamableMethod<\n LoadTestAdministrationGetTest200Response | LoadTestAdministrationGetTestDefaultResponse\n >;\n}\n\nexport interface LoadTestAdministrationListTests {\n /**\n * Get all load tests by the fully qualified resource Id e.g\n * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}.\n */\n get(\n options?: LoadTestAdministrationListTestsParameters,\n ): StreamableMethod<\n LoadTestAdministrationListTests200Response | LoadTestAdministrationListTestsDefaultResponse\n >;\n}\n\nexport interface LoadTestAdministrationCloneTest {\n /** Clone the given test with optional overrides applied to the clone test. */\n post(\n options: LoadTestAdministrationCloneTestParameters,\n ): StreamableMethod<\n LoadTestAdministrationCloneTest202Response | LoadTestAdministrationCloneTestDefaultResponse\n >;\n}\n\nexport interface LoadTestAdministrationGenerateTestPlanRecommendations {\n /** Generate AI Recommendations to author a load test plan using the uploaded browser recording file. */\n post(\n options?: LoadTestAdministrationGenerateTestPlanRecommendationsParameters,\n ): StreamableMethod<\n | LoadTestAdministrationGenerateTestPlanRecommendations202Response\n | LoadTestAdministrationGenerateTestPlanRecommendationsDefaultResponse\n >;\n}\n\nexport interface LoadTestAdministrationUploadTestFile {\n /**\n * Upload input file for a given test Id. File size can't be more than 50 MB.\n * Existing file with same name for the given test will be overwritten. File\n * should be provided in the request body as application/octet-stream.\n */\n put(\n options: LoadTestAdministrationUploadTestFileParameters,\n ): StreamableMethod<\n | LoadTestAdministrationUploadTestFile201Response\n | LoadTestAdministrationUploadTestFileDefaultResponse\n >;\n /** Get all the files that are associated with a test. */\n get(\n options?: LoadTestAdministrationGetTestFileParameters,\n ): StreamableMethod<\n LoadTestAdministrationGetTestFile200Response | LoadTestAdministrationGetTestFileDefaultResponse\n >;\n /** Delete file by the file name for a test */\n delete(\n options?: LoadTestAdministrationDeleteTestFileParameters,\n ): StreamableMethod<\n | LoadTestAdministrationDeleteTestFile204Response\n | LoadTestAdministrationDeleteTestFileDefaultResponse\n >;\n}\n\nexport interface LoadTestAdministrationListTestFiles {\n /** Get all test files. */\n get(\n options?: LoadTestAdministrationListTestFilesParameters,\n ): StreamableMethod<\n | LoadTestAdministrationListTestFiles200Response\n | LoadTestAdministrationListTestFilesDefaultResponse\n >;\n}\n\nexport interface LoadTestAdministrationCreateOrUpdateAppComponents {\n /** Add an app component to a test by providing the resource Id, name and type. */\n patch(\n options: LoadTestAdministrationCreateOrUpdateAppComponentsParameters,\n ): StreamableMethod<\n | LoadTestAdministrationCreateOrUpdateAppComponents200Response\n | LoadTestAdministrationCreateOrUpdateAppComponents201Response\n | LoadTestAdministrationCreateOrUpdateAppComponentsDefaultResponse\n >;\n /** Get associated app component (collection of azure resources) for the given test. */\n get(\n options?: LoadTestAdministrationGetAppComponentsParameters,\n ): StreamableMethod<\n | LoadTestAdministrationGetAppComponents200Response\n | LoadTestAdministrationGetAppComponentsDefaultResponse\n >;\n}\n\nexport interface LoadTestAdministrationCreateOrUpdateServerMetricsConfig {\n /** Configure server metrics for a test */\n patch(\n options: LoadTestAdministrationCreateOrUpdateServerMetricsConfigParameters,\n ): StreamableMethod<\n | LoadTestAdministrationCreateOrUpdateServerMetricsConfig200Response\n | LoadTestAdministrationCreateOrUpdateServerMetricsConfig201Response\n | LoadTestAdministrationCreateOrUpdateServerMetricsConfigDefaultResponse\n >;\n /** List server metrics configuration for the given test. */\n get(\n options?: LoadTestAdministrationGetServerMetricsConfigParameters,\n ): StreamableMethod<\n | LoadTestAdministrationGetServerMetricsConfig200Response\n | LoadTestAdministrationGetServerMetricsConfigDefaultResponse\n >;\n}\n\nexport interface TestProfileAdministrationCreateOrUpdateTestProfile {\n /** Create a new test profile or update an existing test profile by providing the test profile Id. */\n patch(\n options: TestProfileAdministrationCreateOrUpdateTestProfileParameters,\n ): StreamableMethod<\n | TestProfileAdministrationCreateOrUpdateTestProfile200Response\n | TestProfileAdministrationCreateOrUpdateTestProfile201Response\n | TestProfileAdministrationCreateOrUpdateTestProfileDefaultResponse\n >;\n /** Delete a test profile by its test profile Id. */\n delete(\n options?: TestProfileAdministrationDeleteTestProfileParameters,\n ): StreamableMethod<\n | TestProfileAdministrationDeleteTestProfile204Response\n | TestProfileAdministrationDeleteTestProfileDefaultResponse\n >;\n /** Get load test profile details by test profile Id. */\n get(\n options?: TestProfileAdministrationGetTestProfileParameters,\n ): StreamableMethod<\n | TestProfileAdministrationGetTestProfile200Response\n | TestProfileAdministrationGetTestProfileDefaultResponse\n >;\n}\n\nexport interface TestProfileAdministrationListTestProfiles {\n /** Get all test profiles for the given filters. */\n get(\n options?: TestProfileAdministrationListTestProfilesParameters,\n ): StreamableMethod<\n | TestProfileAdministrationListTestProfiles200Response\n | TestProfileAdministrationListTestProfilesDefaultResponse\n >;\n}\n\nexport interface TriggerAdministrationGetTrigger {\n /** Resource read operation template. */\n get(\n options?: TriggerAdministrationGetTriggerParameters,\n ): StreamableMethod<\n TriggerAdministrationGetTrigger200Response | TriggerAdministrationGetTriggerDefaultResponse\n >;\n /** Create or update operation template. */\n patch(\n options: TriggerAdministrationCreateOrUpdateTriggerParameters,\n ): StreamableMethod<\n | TriggerAdministrationCreateOrUpdateTrigger200Response\n | TriggerAdministrationCreateOrUpdateTrigger201Response\n | TriggerAdministrationCreateOrUpdateTriggerDefaultResponse\n >;\n /** Resource delete operation template. */\n delete(\n options?: TriggerAdministrationDeleteTriggerParameters,\n ): StreamableMethod<\n | TriggerAdministrationDeleteTrigger204Response\n | TriggerAdministrationDeleteTriggerDefaultResponse\n >;\n}\n\nexport interface TriggerAdministrationListTrigger {\n /** Resource list operation template. */\n get(\n options?: TriggerAdministrationListTriggerParameters,\n ): StreamableMethod<\n TriggerAdministrationListTrigger200Response | TriggerAdministrationListTriggerDefaultResponse\n >;\n}\n\nexport interface NotificationRuleAdministrationGetNotificationRule {\n /** Resource read operation template. */\n get(\n options?: NotificationRuleAdministrationGetNotificationRuleParameters,\n ): StreamableMethod<\n | NotificationRuleAdministrationGetNotificationRule200Response\n | NotificationRuleAdministrationGetNotificationRuleDefaultResponse\n >;\n /** Create or update operation template. */\n patch(\n options: NotificationRuleAdministrationCreateOrUpdateNotificationRuleParameters,\n ): StreamableMethod<\n | NotificationRuleAdministrationCreateOrUpdateNotificationRule200Response\n | NotificationRuleAdministrationCreateOrUpdateNotificationRule201Response\n | NotificationRuleAdministrationCreateOrUpdateNotificationRuleDefaultResponse\n >;\n /** Resource delete operation template. */\n delete(\n options?: NotificationRuleAdministrationDeleteNotificationRuleParameters,\n ): StreamableMethod<\n | NotificationRuleAdministrationDeleteNotificationRule204Response\n | NotificationRuleAdministrationDeleteNotificationRuleDefaultResponse\n >;\n}\n\nexport interface NotificationRuleAdministrationListNotificationRule {\n /** Resource list operation template. */\n get(\n options?: NotificationRuleAdministrationListNotificationRuleParameters,\n ): StreamableMethod<\n | NotificationRuleAdministrationListNotificationRule200Response\n | NotificationRuleAdministrationListNotificationRuleDefaultResponse\n >;\n}\n\nexport interface LoadTestRunGetTestRun {\n /** Get test run details by test run Id. */\n get(\n options?: LoadTestRunGetTestRunParameters,\n ): StreamableMethod<LoadTestRunGetTestRun200Response | LoadTestRunGetTestRunDefaultResponse>;\n /** Create and start a new test run with the given test run Id. */\n patch(\n options: LoadTestRunCreateOrUpdateTestRunParameters,\n ): StreamableMethod<\n | LoadTestRunCreateOrUpdateTestRun200Response\n | LoadTestRunCreateOrUpdateTestRun201Response\n | LoadTestRunCreateOrUpdateTestRunDefaultResponse\n >;\n /** Delete an existing load test run by providing the testRunId. */\n delete(\n options?: LoadTestRunDeleteTestRunParameters,\n ): StreamableMethod<\n LoadTestRunDeleteTestRun204Response | LoadTestRunDeleteTestRunDefaultResponse\n >;\n}\n\nexport interface LoadTestRunListTestRuns {\n /** Get all test runs for the given filters. */\n get(\n options?: LoadTestRunListTestRunsParameters,\n ): StreamableMethod<LoadTestRunListTestRuns200Response | LoadTestRunListTestRunsDefaultResponse>;\n}\n\nexport interface LoadTestRunGetTestRunFile {\n /** Get test run file by file name. */\n get(\n options?: LoadTestRunGetTestRunFileParameters,\n ): StreamableMethod<\n LoadTestRunGetTestRunFile200Response | LoadTestRunGetTestRunFileDefaultResponse\n >;\n}\n\nexport interface LoadTestRunStop {\n /** Stop test run by test run Id. */\n post(\n options?: LoadTestRunStopParameters,\n ): StreamableMethod<LoadTestRunStop200Response | LoadTestRunStopDefaultResponse>;\n}\n\nexport interface LoadTestRunGetLatestInsights {\n /** Get the latest insights for the test run. */\n get(\n options?: LoadTestRunGetLatestInsightsParameters,\n ): StreamableMethod<\n LoadTestRunGetLatestInsights200Response | LoadTestRunGetLatestInsightsDefaultResponse\n >;\n /** Update the latest insights for the test run. */\n patch(\n options: LoadTestRunUpdateLatestInsightsParameters,\n ): StreamableMethod<\n LoadTestRunUpdateLatestInsights200Response | LoadTestRunUpdateLatestInsightsDefaultResponse\n >;\n}\n\nexport interface LoadTestRunGenerateInsights {\n /** Generate insights for the test run. */\n post(\n options?: LoadTestRunGenerateInsightsParameters,\n ): StreamableMethod<\n LoadTestRunGenerateInsights202Response | LoadTestRunGenerateInsightsDefaultResponse\n >;\n}\n\nexport interface LoadTestRunListMetricNamespaces {\n /** List the metric namespaces for a load test run. */\n get(\n options?: LoadTestRunListMetricNamespacesParameters,\n ): StreamableMethod<\n LoadTestRunListMetricNamespaces200Response | LoadTestRunListMetricNamespacesDefaultResponse\n >;\n}\n\nexport interface LoadTestRunListMetricDefinitions {\n /** List the metric definitions for a load test run. */\n get(\n options: LoadTestRunListMetricDefinitionsParameters,\n ): StreamableMethod<\n LoadTestRunListMetricDefinitions200Response | LoadTestRunListMetricDefinitionsDefaultResponse\n >;\n}\n\nexport interface LoadTestRunListMetrics {\n /** List the metric values for a load test run. */\n post(\n options: LoadTestRunListMetricsParameters,\n ): StreamableMethod<LoadTestRunListMetrics200Response | LoadTestRunListMetricsDefaultResponse>;\n}\n\nexport interface LoadTestRunListMetricDimensionValues {\n /** List the dimension values for the given metric dimension name. */\n get(\n options: LoadTestRunListMetricDimensionValuesParameters,\n ): StreamableMethod<\n | LoadTestRunListMetricDimensionValues200Response\n | LoadTestRunListMetricDimensionValuesDefaultResponse\n >;\n}\n\nexport interface LoadTestRunCreateOrUpdateAppComponents {\n /** Add an app component to a test run by providing the resource Id, name and type. */\n patch(\n options: LoadTestRunCreateOrUpdateAppComponentsParameters,\n ): StreamableMethod<\n | LoadTestRunCreateOrUpdateAppComponents200Response\n | LoadTestRunCreateOrUpdateAppComponents201Response\n | LoadTestRunCreateOrUpdateAppComponentsDefaultResponse\n >;\n /**\n * Get associated app component (collection of azure resources) for the given test\n * run.\n */\n get(\n options?: LoadTestRunGetAppComponentsParameters,\n ): StreamableMethod<\n LoadTestRunGetAppComponents200Response | LoadTestRunGetAppComponentsDefaultResponse\n >;\n}\n\nexport interface LoadTestRunCreateOrUpdateServerMetricsConfig {\n /** Configure server metrics for a test run */\n patch(\n options: LoadTestRunCreateOrUpdateServerMetricsConfigParameters,\n ): StreamableMethod<\n | LoadTestRunCreateOrUpdateServerMetricsConfig200Response\n | LoadTestRunCreateOrUpdateServerMetricsConfig201Response\n | LoadTestRunCreateOrUpdateServerMetricsConfigDefaultResponse\n >;\n /** Get associated server metrics configuration for the given test run. */\n get(\n options?: LoadTestRunGetServerMetricsConfigParameters,\n ): StreamableMethod<\n LoadTestRunGetServerMetricsConfig200Response | LoadTestRunGetServerMetricsConfigDefaultResponse\n >;\n}\n\nexport interface TestProfileRunAdministrationGetTestProfileRun {\n /** Get test profile run details by test profile run Id. */\n get(\n options?: TestProfileRunAdministrationGetTestProfileRunParameters,\n ): StreamableMethod<\n | TestProfileRunAdministrationGetTestProfileRun200Response\n | TestProfileRunAdministrationGetTestProfileRunDefaultResponse\n >;\n /** Create and start a new test profile run with the given test profile run Id. */\n patch(\n options: TestProfileRunAdministrationCreateOrUpdateTestProfileRunParameters,\n ): StreamableMethod<\n | TestProfileRunAdministrationCreateOrUpdateTestProfileRun200Response\n | TestProfileRunAdministrationCreateOrUpdateTestProfileRun201Response\n | TestProfileRunAdministrationCreateOrUpdateTestProfileRunDefaultResponse\n >;\n /** Delete an existing load test profile run by providing the test profile run Id. */\n delete(\n options?: TestProfileRunAdministrationDeleteTestProfileRunParameters,\n ): StreamableMethod<\n | TestProfileRunAdministrationDeleteTestProfileRun204Response\n | TestProfileRunAdministrationDeleteTestProfileRunDefaultResponse\n >;\n}\n\nexport interface TestProfileRunAdministrationStop {\n /** Stop test profile run for the given test profile run Id. */\n post(\n options?: TestProfileRunAdministrationStopParameters,\n ): StreamableMethod<\n TestProfileRunAdministrationStop200Response | TestProfileRunAdministrationStopDefaultResponse\n >;\n}\n\nexport interface TestProfileRunAdministrationListTestProfileRuns {\n /** Get all test profile runs for the given filters. */\n get(\n options?: TestProfileRunAdministrationListTestProfileRunsParameters,\n ): StreamableMethod<\n | TestProfileRunAdministrationListTestProfileRuns200Response\n | TestProfileRunAdministrationListTestProfileRunsDefaultResponse\n >;\n}\n\nexport interface Routes {\n /** Resource for '/operations/\\{operationId\\}' has methods for the following verbs: get */\n (path: \"/operations/{operationId}\", operationId: string): OperationsGetStatus;\n /** Resource for '/tests/\\{testId\\}' has methods for the following verbs: patch, delete, get */\n (path: \"/tests/{testId}\", testId: string): LoadTestAdministrationCreateOrUpdateTest;\n /** Resource for '/tests' has methods for the following verbs: get */\n (path: \"/tests\"): LoadTestAdministrationListTests;\n /** Resource for '/tests/\\{testId\\}:clone' has methods for the following verbs: post */\n (path: \"/tests/{testId}:clone\", testId: string): LoadTestAdministrationCloneTest;\n /** Resource for '/tests/\\{testId\\}:generateTestPlanRecommendations' has methods for the following verbs: post */\n (\n path: \"/tests/{testId}:generateTestPlanRecommendations\",\n testId: string,\n ): LoadTestAdministrationGenerateTestPlanRecommendations;\n /** Resource for '/tests/\\{testId\\}/files/\\{fileName\\}' has methods for the following verbs: put, get, delete */\n (\n path: \"/tests/{testId}/files/{fileName}\",\n testId: string,\n fileName: string,\n ): LoadTestAdministrationUploadTestFile;\n /** Resource for '/tests/\\{testId\\}/files' has methods for the following verbs: get */\n (path: \"/tests/{testId}/files\", testId: string): LoadTestAdministrationListTestFiles;\n /** Resource for '/tests/\\{testId\\}/app-components' has methods for the following verbs: patch, get */\n (\n path: \"/tests/{testId}/app-components\",\n testId: string,\n ): LoadTestAdministrationCreateOrUpdateAppComponents;\n /** Resource for '/tests/\\{testId\\}/server-metrics-config' has methods for the following verbs: patch, get */\n (\n path: \"/tests/{testId}/server-metrics-config\",\n testId: string,\n ): LoadTestAdministrationCreateOrUpdateServerMetricsConfig;\n /** Resource for '/test-profiles/\\{testProfileId\\}' has methods for the following verbs: patch, delete, get */\n (\n path: \"/test-profiles/{testProfileId}\",\n testProfileId: string,\n ): TestProfileAdministrationCreateOrUpdateTestProfile;\n /** Resource for '/test-profiles' has methods for the following verbs: get */\n (path: \"/test-profiles\"): TestProfileAdministrationListTestProfiles;\n /** Resource for '/triggers/\\{triggerId\\}' has methods for the following verbs: get, patch, delete */\n (path: \"/triggers/{triggerId}\", triggerId: string): TriggerAdministrationGetTrigger;\n /** Resource for '/triggers' has methods for the following verbs: get */\n (path: \"/triggers\"): TriggerAdministrationListTrigger;\n /** Resource for '/notification-rules/\\{notificationRuleId\\}' has methods for the following verbs: get, patch, delete */\n (\n path: \"/notification-rules/{notificationRuleId}\",\n notificationRuleId: string,\n ): NotificationRuleAdministrationGetNotificationRule;\n /** Resource for '/notification-rules' has methods for the following verbs: get */\n (path: \"/notification-rules\"): NotificationRuleAdministrationListNotificationRule;\n /** Resource for '/test-runs/\\{testRunId\\}' has methods for the following verbs: get, patch, delete */\n (path: \"/test-runs/{testRunId}\", testRunId: string): LoadTestRunGetTestRun;\n /** Resource for '/test-runs' has methods for the following verbs: get */\n (path: \"/test-runs\"): LoadTestRunListTestRuns;\n /** Resource for '/test-runs/\\{testRunId\\}/files/\\{fileName\\}' has methods for the following verbs: get */\n (\n path: \"/test-runs/{testRunId}/files/{fileName}\",\n testRunId: string,\n fileName: string,\n ): LoadTestRunGetTestRunFile;\n /** Resource for '/test-runs/\\{testRunId\\}:stop' has methods for the following verbs: post */\n (path: \"/test-runs/{testRunId}:stop\", testRunId: string): LoadTestRunStop;\n /** Resource for '/test-runs/\\{testRunId\\}/insights/latest' has methods for the following verbs: get, patch */\n (path: \"/test-runs/{testRunId}/insights/latest\", testRunId: string): LoadTestRunGetLatestInsights;\n /** Resource for '/test-runs/\\{testRunId\\}/insights:generate' has methods for the following verbs: post */\n (\n path: \"/test-runs/{testRunId}/insights:generate\",\n testRunId: string,\n ): LoadTestRunGenerateInsights;\n /** Resource for '/test-runs/\\{testRunId\\}/metric-namespaces' has methods for the following verbs: get */\n (\n path: \"/test-runs/{testRunId}/metric-namespaces\",\n testRunId: string,\n ): LoadTestRunListMetricNamespaces;\n /** Resource for '/test-runs/\\{testRunId\\}/metric-definitions' has methods for the following verbs: get */\n (\n path: \"/test-runs/{testRunId}/metric-definitions\",\n testRunId: string,\n ): LoadTestRunListMetricDefinitions;\n /** Resource for '/test-runs/\\{testRunId\\}/metrics' has methods for the following verbs: post */\n (path: \"/test-runs/{testRunId}/metrics\", testRunId: string): LoadTestRunListMetrics;\n /** Resource for '/test-runs/\\{testRunId\\}/metric-dimensions/\\{name\\}/values' has methods for the following verbs: get */\n (\n path: \"/test-runs/{testRunId}/metric-dimensions/{name}/values\",\n testRunId: string,\n name: string,\n ): LoadTestRunListMetricDimensionValues;\n /** Resource for '/test-runs/\\{testRunId\\}/app-components' has methods for the following verbs: patch, get */\n (\n path: \"/test-runs/{testRunId}/app-components\",\n testRunId: string,\n ): LoadTestRunCreateOrUpdateAppComponents;\n /** Resource for '/test-runs/\\{testRunId\\}/server-metrics-config' has methods for the following verbs: patch, get */\n (\n path: \"/test-runs/{testRunId}/server-metrics-config\",\n testRunId: string,\n ): LoadTestRunCreateOrUpdateServerMetricsConfig;\n /** Resource for '/test-profile-runs/\\{testProfileRunId\\}' has methods for the following verbs: get, patch, delete */\n (\n path: \"/test-profile-runs/{testProfileRunId}\",\n testProfileRunId: string,\n ): TestProfileRunAdministrationGetTestProfileRun;\n /** Resource for '/test-profile-runs/\\{testProfileRunId\\}:stop' has methods for the following verbs: post */\n (\n path: \"/test-profile-runs/{testProfileRunId}:stop\",\n testProfileRunId: string,\n ): TestProfileRunAdministrationStop;\n /** Resource for '/test-profile-runs' has methods for the following verbs: get */\n (path: \"/test-profile-runs\"): TestProfileRunAdministrationListTestProfileRuns;\n}\n\nexport type AzureLoadTestingClient = Client & {\n path: Routes;\n};\n"]}
|
|
@@ -10,7 +10,6 @@ import { sleep } from "./util/LROUtil.js";
|
|
|
10
10
|
* @returns A poller which can be called to poll until completion of the job.
|
|
11
11
|
*/
|
|
12
12
|
export async function getFileValidationPoller(client, fileUploadResult, polledOperationOptions = {}) {
|
|
13
|
-
var _a;
|
|
14
13
|
// get filename and testid from initial response
|
|
15
14
|
const fileName = fileUploadResult.body.fileName;
|
|
16
15
|
const requestUrl = fileUploadResult.request.url;
|
|
@@ -23,11 +22,10 @@ export async function getFileValidationPoller(client, fileUploadResult, polledOp
|
|
|
23
22
|
let resultPromise;
|
|
24
23
|
let cancelJob;
|
|
25
24
|
const abortController = new AbortController();
|
|
26
|
-
const currentPollIntervalInMs =
|
|
25
|
+
const currentPollIntervalInMs = polledOperationOptions.updateIntervalInMs ?? 2000;
|
|
27
26
|
const poller = {
|
|
28
27
|
async poll(options) {
|
|
29
|
-
|
|
30
|
-
if ((_a = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) {
|
|
28
|
+
if (options?.abortSignal?.aborted) {
|
|
31
29
|
throw new AbortError("The polling was aborted.");
|
|
32
30
|
}
|
|
33
31
|
if (fileName) {
|
|
@@ -37,7 +35,7 @@ export async function getFileValidationPoller(client, fileUploadResult, polledOp
|
|
|
37
35
|
if (isUnexpected(fileValidationResponse)) {
|
|
38
36
|
state.status = "failed";
|
|
39
37
|
state.error = new Error(fileValidationResponse.body.error.message);
|
|
40
|
-
return;
|
|
38
|
+
return state;
|
|
41
39
|
}
|
|
42
40
|
switch (fileValidationResponse.body.validationStatus) {
|
|
43
41
|
case "NOT_VALIDATED": {
|
|
@@ -62,20 +60,21 @@ export async function getFileValidationPoller(client, fileUploadResult, polledOp
|
|
|
62
60
|
state.result = fileValidationResponse;
|
|
63
61
|
await processProgressCallbacks();
|
|
64
62
|
}
|
|
63
|
+
return state;
|
|
65
64
|
},
|
|
66
65
|
pollUntilDone(pollOptions) {
|
|
67
|
-
return (resultPromise
|
|
66
|
+
return (resultPromise ??= (async () => {
|
|
68
67
|
const { abortSignal: inputAbortSignal } = pollOptions || {};
|
|
69
68
|
// In the future we can use AbortSignal.any() instead
|
|
70
69
|
function abortListener() {
|
|
71
70
|
abortController.abort();
|
|
72
71
|
}
|
|
73
72
|
const abortSignal = abortController.signal;
|
|
74
|
-
if (inputAbortSignal
|
|
73
|
+
if (inputAbortSignal?.aborted) {
|
|
75
74
|
abortController.abort();
|
|
76
75
|
}
|
|
77
76
|
else if (!abortSignal.aborted) {
|
|
78
|
-
inputAbortSignal
|
|
77
|
+
inputAbortSignal?.addEventListener("abort", abortListener, { once: true });
|
|
79
78
|
}
|
|
80
79
|
try {
|
|
81
80
|
if (!poller.isDone()) {
|
|
@@ -89,7 +88,7 @@ export async function getFileValidationPoller(client, fileUploadResult, polledOp
|
|
|
89
88
|
}
|
|
90
89
|
}
|
|
91
90
|
finally {
|
|
92
|
-
inputAbortSignal
|
|
91
|
+
inputAbortSignal?.removeEventListener("abort", abortListener);
|
|
93
92
|
}
|
|
94
93
|
switch (state.status) {
|
|
95
94
|
case "succeeded":
|
|
@@ -105,7 +104,7 @@ export async function getFileValidationPoller(client, fileUploadResult, polledOp
|
|
|
105
104
|
}
|
|
106
105
|
})().finally(() => {
|
|
107
106
|
resultPromise = undefined;
|
|
108
|
-
}))
|
|
107
|
+
}));
|
|
109
108
|
},
|
|
110
109
|
onProgress(callback) {
|
|
111
110
|
const s = Symbol();
|
|
@@ -117,7 +116,7 @@ export async function getFileValidationPoller(client, fileUploadResult, polledOp
|
|
|
117
116
|
},
|
|
118
117
|
stopPolling() {
|
|
119
118
|
abortController.abort();
|
|
120
|
-
cancelJob
|
|
119
|
+
cancelJob?.();
|
|
121
120
|
},
|
|
122
121
|
isStopped() {
|
|
123
122
|
return resultPromise === undefined;
|
|
@@ -131,6 +130,12 @@ export async function getFileValidationPoller(client, fileUploadResult, polledOp
|
|
|
131
130
|
toString() {
|
|
132
131
|
return JSON.stringify({ state });
|
|
133
132
|
},
|
|
133
|
+
async serialize() {
|
|
134
|
+
return JSON.stringify({ state });
|
|
135
|
+
},
|
|
136
|
+
async submitted() {
|
|
137
|
+
// No-op: the file validation is a custom poller
|
|
138
|
+
},
|
|
134
139
|
};
|
|
135
140
|
return poller;
|
|
136
141
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFileValidationPoller.js","sourceRoot":"","sources":["../../src/getFileValidationPoller.ts"],"names":[],"mappings":"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","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport { AbortError } from \"@azure/abort-controller\";\nimport type { CancelOnProgress, OperationState, SimplePollerLike } from \"@azure/core-lro\";\nimport type { FileUploadAndValidatePoller, PolledOperationOptions } from \"./models.js\";\nimport type { AzureLoadTestingClient } from \"./clientDefinitions.js\";\nimport type {\n LoadTestAdministrationGetTestFile200Response,\n LoadTestAdministrationUploadTestFile201Response,\n} from \"./responses.js\";\nimport { isUnexpected } from \"./isUnexpected.js\";\nimport { sleep } from \"./util/LROUtil.js\";\n\n/**\n * Uploads a file and creates a poller to poll for validation.\n * @param client - The Load Testing client.\n * @param options - The operation options.\n * @returns A poller which can be called to poll until completion of the job.\n */\nexport async function getFileValidationPoller(\n client: AzureLoadTestingClient,\n fileUploadResult: LoadTestAdministrationUploadTestFile201Response,\n polledOperationOptions: PolledOperationOptions = {},\n): Promise<FileUploadAndValidatePoller> {\n // get filename and testid from initial response\n const fileName = fileUploadResult.body.fileName;\n const requestUrl = fileUploadResult.request.url;\n const testId = requestUrl.substring(\n requestUrl.indexOf(\"tests/\") + 6,\n requestUrl.lastIndexOf(\"/files\"),\n );\n type Handler = (state: OperationState<LoadTestAdministrationGetTestFile200Response>) => void;\n\n const state: OperationState<LoadTestAdministrationGetTestFile200Response> = {\n status: \"notStarted\",\n };\n\n const progressCallbacks = new Map<symbol, Handler>();\n const processProgressCallbacks = async (): Promise<void> =>\n progressCallbacks.forEach((h) => h(state));\n let resultPromise: Promise<LoadTestAdministrationGetTestFile200Response> | undefined;\n let cancelJob: (() => void) | undefined;\n const abortController = new AbortController();\n const currentPollIntervalInMs = polledOperationOptions.updateIntervalInMs ?? 2000;\n\n const poller: SimplePollerLike<\n OperationState<LoadTestAdministrationGetTestFile200Response>,\n LoadTestAdministrationGetTestFile200Response\n > = {\n async poll(options?: { abortSignal?: AbortSignalLike }): Promise<void> {\n if (options?.abortSignal?.aborted) {\n throw new AbortError(\"The polling was aborted.\");\n }\n\n if (fileName) {\n const fileValidationResponse = await client\n .path(\"/tests/{testId}/files/{fileName}\", testId, fileName)\n .get();\n if (isUnexpected(fileValidationResponse)) {\n state.status = \"failed\";\n state.error = new Error(fileValidationResponse.body.error.message);\n return;\n }\n\n switch (fileValidationResponse.body.validationStatus) {\n case \"NOT_VALIDATED\": {\n state.status = \"succeeded\";\n break;\n }\n case \"VALIDATION_INITIATED\": {\n state.status = \"running\";\n break;\n }\n case \"VALIDATION_SUCCESS\":\n case \"VALIDATION_NOT_REQUIRED\": {\n state.status = \"succeeded\";\n break;\n }\n case \"VALIDATION_FAILURE\": {\n state.status = \"failed\";\n state.error = new Error(fileValidationResponse.body.validationFailureDetails);\n break;\n }\n }\n state.result = fileValidationResponse;\n\n await processProgressCallbacks();\n }\n },\n\n pollUntilDone(pollOptions?: {\n abortSignal?: AbortSignalLike;\n }): Promise<LoadTestAdministrationGetTestFile200Response> {\n return (resultPromise ??= (async () => {\n const { abortSignal: inputAbortSignal } = pollOptions || {};\n // In the future we can use AbortSignal.any() instead\n function abortListener(): void {\n abortController.abort();\n }\n const abortSignal = abortController.signal;\n if (inputAbortSignal?.aborted) {\n abortController.abort();\n } else if (!abortSignal.aborted) {\n inputAbortSignal?.addEventListener(\"abort\", abortListener, { once: true });\n }\n\n try {\n if (!poller.isDone()) {\n await poller.poll({ abortSignal });\n while (!poller.isDone()) {\n const delay = sleep(currentPollIntervalInMs, abortSignal);\n cancelJob = () => abortController.abort();\n await delay;\n await poller.poll({ abortSignal });\n }\n }\n } finally {\n inputAbortSignal?.removeEventListener(\"abort\", abortListener);\n }\n switch (state.status) {\n case \"succeeded\":\n case \"failed\":\n case \"canceled\": {\n return poller.getResult() as LoadTestAdministrationGetTestFile200Response;\n }\n case \"notStarted\":\n case \"running\": {\n // Unreachable\n throw new Error(`polling completed without succeeding or failing`);\n }\n }\n })().finally(() => {\n resultPromise = undefined;\n }));\n },\n\n onProgress(\n callback: (state: OperationState<LoadTestAdministrationGetTestFile200Response>) => void,\n ): CancelOnProgress {\n const s = Symbol();\n progressCallbacks.set(s, callback);\n\n return () => progressCallbacks.delete(s);\n },\n\n isDone(): boolean {\n return [\"succeeded\", \"failed\", \"canceled\"].includes(state.status);\n },\n\n stopPolling(): void {\n abortController.abort();\n cancelJob?.();\n },\n\n isStopped(): boolean {\n return resultPromise === undefined;\n },\n\n getOperationState(): OperationState<LoadTestAdministrationGetTestFile200Response> {\n return state;\n },\n\n getResult(): LoadTestAdministrationGetTestFile200Response | undefined {\n return state.result;\n },\n\n toString() {\n return JSON.stringify({ state });\n },\n };\n\n return poller;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"getFileValidationPoller.js","sourceRoot":"","sources":["../../src/getFileValidationPoller.ts"],"names":[],"mappings":"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","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport { AbortError } from \"@azure/abort-controller\";\nimport type { CancelOnProgress, OperationState } from \"@azure/core-lro\";\nimport type { SimplePollerLike } from \"./pollingHelper.js\";\nimport type { FileUploadAndValidatePoller, PolledOperationOptions } from \"./models.js\";\nimport type { AzureLoadTestingClient } from \"./clientDefinitions.js\";\nimport type {\n LoadTestAdministrationGetTestFile200Response,\n LoadTestAdministrationUploadTestFile201Response,\n} from \"./responses.js\";\nimport { isUnexpected } from \"./isUnexpected.js\";\nimport { sleep } from \"./util/LROUtil.js\";\n\n/**\n * Uploads a file and creates a poller to poll for validation.\n * @param client - The Load Testing client.\n * @param options - The operation options.\n * @returns A poller which can be called to poll until completion of the job.\n */\nexport async function getFileValidationPoller(\n client: AzureLoadTestingClient,\n fileUploadResult: LoadTestAdministrationUploadTestFile201Response,\n polledOperationOptions: PolledOperationOptions = {},\n): Promise<FileUploadAndValidatePoller> {\n // get filename and testid from initial response\n const fileName = fileUploadResult.body.fileName;\n const requestUrl = fileUploadResult.request.url;\n const testId = requestUrl.substring(\n requestUrl.indexOf(\"tests/\") + 6,\n requestUrl.lastIndexOf(\"/files\"),\n );\n type Handler = (state: OperationState<LoadTestAdministrationGetTestFile200Response>) => void;\n\n const state: OperationState<LoadTestAdministrationGetTestFile200Response> = {\n status: \"notStarted\",\n };\n\n const progressCallbacks = new Map<symbol, Handler>();\n const processProgressCallbacks = async (): Promise<void> =>\n progressCallbacks.forEach((h) => h(state));\n let resultPromise: Promise<LoadTestAdministrationGetTestFile200Response> | undefined;\n let cancelJob: (() => void) | undefined;\n const abortController = new AbortController();\n const currentPollIntervalInMs = polledOperationOptions.updateIntervalInMs ?? 2000;\n\n const poller: SimplePollerLike<\n OperationState<LoadTestAdministrationGetTestFile200Response>,\n LoadTestAdministrationGetTestFile200Response\n > = {\n async poll(options?: {\n abortSignal?: AbortSignalLike;\n }): Promise<OperationState<LoadTestAdministrationGetTestFile200Response>> {\n if (options?.abortSignal?.aborted) {\n throw new AbortError(\"The polling was aborted.\");\n }\n\n if (fileName) {\n const fileValidationResponse = await client\n .path(\"/tests/{testId}/files/{fileName}\", testId, fileName)\n .get();\n if (isUnexpected(fileValidationResponse)) {\n state.status = \"failed\";\n state.error = new Error(fileValidationResponse.body.error.message);\n return state;\n }\n\n switch (fileValidationResponse.body.validationStatus) {\n case \"NOT_VALIDATED\": {\n state.status = \"succeeded\";\n break;\n }\n case \"VALIDATION_INITIATED\": {\n state.status = \"running\";\n break;\n }\n case \"VALIDATION_SUCCESS\":\n case \"VALIDATION_NOT_REQUIRED\": {\n state.status = \"succeeded\";\n break;\n }\n case \"VALIDATION_FAILURE\": {\n state.status = \"failed\";\n state.error = new Error(fileValidationResponse.body.validationFailureDetails);\n break;\n }\n }\n state.result = fileValidationResponse;\n\n await processProgressCallbacks();\n }\n return state;\n },\n\n pollUntilDone(pollOptions?: {\n abortSignal?: AbortSignalLike;\n }): Promise<LoadTestAdministrationGetTestFile200Response> {\n return (resultPromise ??= (async () => {\n const { abortSignal: inputAbortSignal } = pollOptions || {};\n // In the future we can use AbortSignal.any() instead\n function abortListener(): void {\n abortController.abort();\n }\n const abortSignal = abortController.signal;\n if (inputAbortSignal?.aborted) {\n abortController.abort();\n } else if (!abortSignal.aborted) {\n inputAbortSignal?.addEventListener(\"abort\", abortListener, { once: true });\n }\n\n try {\n if (!poller.isDone()) {\n await poller.poll({ abortSignal });\n while (!poller.isDone()) {\n const delay = sleep(currentPollIntervalInMs, abortSignal);\n cancelJob = () => abortController.abort();\n await delay;\n await poller.poll({ abortSignal });\n }\n }\n } finally {\n inputAbortSignal?.removeEventListener(\"abort\", abortListener);\n }\n switch (state.status) {\n case \"succeeded\":\n case \"failed\":\n case \"canceled\": {\n return poller.getResult() as LoadTestAdministrationGetTestFile200Response;\n }\n case \"notStarted\":\n case \"running\": {\n // Unreachable\n throw new Error(`polling completed without succeeding or failing`);\n }\n }\n })().finally(() => {\n resultPromise = undefined;\n }));\n },\n\n onProgress(\n callback: (state: OperationState<LoadTestAdministrationGetTestFile200Response>) => void,\n ): CancelOnProgress {\n const s = Symbol();\n progressCallbacks.set(s, callback);\n\n return () => progressCallbacks.delete(s);\n },\n\n isDone(): boolean {\n return [\"succeeded\", \"failed\", \"canceled\"].includes(state.status);\n },\n\n stopPolling(): void {\n abortController.abort();\n cancelJob?.();\n },\n\n isStopped(): boolean {\n return resultPromise === undefined;\n },\n\n getOperationState(): OperationState<LoadTestAdministrationGetTestFile200Response> {\n return state;\n },\n\n getResult(): LoadTestAdministrationGetTestFile200Response | undefined {\n return state.result;\n },\n\n toString() {\n return JSON.stringify({ state });\n },\n async serialize(): Promise<string> {\n return JSON.stringify({ state });\n },\n async submitted(): Promise<void> {\n // No-op: the file validation is a custom poller\n },\n };\n\n return poller;\n}\n"]}
|
|
@@ -10,7 +10,6 @@ import { sleep, isTestProfileRunInProgress } from "./util/LROUtil.js";
|
|
|
10
10
|
* @returns A poller which can be called to poll until completion of the job.
|
|
11
11
|
*/
|
|
12
12
|
export async function getTestProfileRunCompletionPoller(client, createTestProfileRunResponse, polledOperationOptions = {}) {
|
|
13
|
-
var _a;
|
|
14
13
|
const state = {
|
|
15
14
|
status: "notStarted",
|
|
16
15
|
};
|
|
@@ -19,12 +18,11 @@ export async function getTestProfileRunCompletionPoller(client, createTestProfil
|
|
|
19
18
|
let resultPromise;
|
|
20
19
|
let cancelJob;
|
|
21
20
|
const abortController = new AbortController();
|
|
22
|
-
const currentPollIntervalInMs =
|
|
21
|
+
const currentPollIntervalInMs = polledOperationOptions.updateIntervalInMs ?? 10000;
|
|
23
22
|
const testProfileRunId = createTestProfileRunResponse.body.testProfileRunId;
|
|
24
23
|
const poller = {
|
|
25
24
|
async poll(options) {
|
|
26
|
-
|
|
27
|
-
if ((_a = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) {
|
|
25
|
+
if (options?.abortSignal?.aborted) {
|
|
28
26
|
throw new AbortError("The polling was aborted.");
|
|
29
27
|
}
|
|
30
28
|
if (testProfileRunId) {
|
|
@@ -34,7 +32,7 @@ export async function getTestProfileRunCompletionPoller(client, createTestProfil
|
|
|
34
32
|
if (isUnexpected(getTestProfileRunResult)) {
|
|
35
33
|
state.status = "failed";
|
|
36
34
|
state.error = new Error(getTestProfileRunResult.body.error.message);
|
|
37
|
-
return;
|
|
35
|
+
return state;
|
|
38
36
|
}
|
|
39
37
|
if (getTestProfileRunResult.body.status === "FAILED") {
|
|
40
38
|
state.status = "failed";
|
|
@@ -52,20 +50,21 @@ export async function getTestProfileRunCompletionPoller(client, createTestProfil
|
|
|
52
50
|
state.result = getTestProfileRunResult;
|
|
53
51
|
await processProgressCallbacks();
|
|
54
52
|
}
|
|
53
|
+
return state;
|
|
55
54
|
},
|
|
56
55
|
pollUntilDone(pollOptions) {
|
|
57
|
-
return (resultPromise
|
|
56
|
+
return (resultPromise ??= (async () => {
|
|
58
57
|
const { abortSignal: inputAbortSignal } = pollOptions || {};
|
|
59
58
|
// In the future we can use AbortSignal.any() instead
|
|
60
59
|
function abortListener() {
|
|
61
60
|
abortController.abort();
|
|
62
61
|
}
|
|
63
62
|
const abortSignal = abortController.signal;
|
|
64
|
-
if (inputAbortSignal
|
|
63
|
+
if (inputAbortSignal?.aborted) {
|
|
65
64
|
abortController.abort();
|
|
66
65
|
}
|
|
67
66
|
else if (!abortSignal.aborted) {
|
|
68
|
-
inputAbortSignal
|
|
67
|
+
inputAbortSignal?.addEventListener("abort", abortListener, { once: true });
|
|
69
68
|
}
|
|
70
69
|
try {
|
|
71
70
|
if (!poller.isDone()) {
|
|
@@ -79,7 +78,7 @@ export async function getTestProfileRunCompletionPoller(client, createTestProfil
|
|
|
79
78
|
}
|
|
80
79
|
}
|
|
81
80
|
finally {
|
|
82
|
-
inputAbortSignal
|
|
81
|
+
inputAbortSignal?.removeEventListener("abort", abortListener);
|
|
83
82
|
}
|
|
84
83
|
switch (state.status) {
|
|
85
84
|
case "succeeded":
|
|
@@ -95,7 +94,7 @@ export async function getTestProfileRunCompletionPoller(client, createTestProfil
|
|
|
95
94
|
}
|
|
96
95
|
})().finally(() => {
|
|
97
96
|
resultPromise = undefined;
|
|
98
|
-
}))
|
|
97
|
+
}));
|
|
99
98
|
},
|
|
100
99
|
onProgress(callback) {
|
|
101
100
|
const s = Symbol();
|
|
@@ -107,7 +106,7 @@ export async function getTestProfileRunCompletionPoller(client, createTestProfil
|
|
|
107
106
|
},
|
|
108
107
|
stopPolling() {
|
|
109
108
|
abortController.abort();
|
|
110
|
-
cancelJob
|
|
109
|
+
cancelJob?.();
|
|
111
110
|
},
|
|
112
111
|
isStopped() {
|
|
113
112
|
return resultPromise === undefined;
|
|
@@ -121,6 +120,12 @@ export async function getTestProfileRunCompletionPoller(client, createTestProfil
|
|
|
121
120
|
toString() {
|
|
122
121
|
return JSON.stringify({ state });
|
|
123
122
|
},
|
|
123
|
+
async serialize() {
|
|
124
|
+
return JSON.stringify({ state });
|
|
125
|
+
},
|
|
126
|
+
async submitted() {
|
|
127
|
+
// No-op: the test profile run is a custom poller
|
|
128
|
+
},
|
|
124
129
|
};
|
|
125
130
|
return poller;
|
|
126
131
|
}
|