fix issue and change catalog from loadtestservice to loadtesting (#24858)
issue:https://github.com/Azure/azure-sdk-for-js/issues/24041
This commit is contained in:
Родитель
1492237359
Коммит
b2e7b22a7a
|
@ -833,8 +833,8 @@
|
||||||
/sdk/portal/ci.mgmt.yml @qiaozha @dw511214992 @MaryGao
|
/sdk/portal/ci.mgmt.yml @qiaozha @dw511214992 @MaryGao
|
||||||
|
|
||||||
# PRLabel: %Mgmt
|
# PRLabel: %Mgmt
|
||||||
/sdk/loadtestservice/arm-loadtestservice/ @qiaozha @dw511214992 @MaryGao
|
/sdk/loadtesting/arm-loadtestservice/ @qiaozha @dw511214992 @MaryGao
|
||||||
/sdk/loadtestservice/ci.mgmt.yml @qiaozha @dw511214992 @MaryGao
|
/sdk/loadtesting/ci.mgmt.yml @qiaozha @dw511214992 @MaryGao
|
||||||
|
|
||||||
# PRLabel: %Mgmt
|
# PRLabel: %Mgmt
|
||||||
/sdk/purview/arm-purview/ @qiaozha @dw511214992 @MaryGao
|
/sdk/purview/arm-purview/ @qiaozha @dw511214992 @MaryGao
|
||||||
|
|
|
@ -1860,7 +1860,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"packageName": "@azure-rest/load-testing",
|
"packageName": "@azure-rest/load-testing",
|
||||||
"projectFolder": "sdk/loadtestservice/load-testing-rest",
|
"projectFolder": "sdk/loadtesting/load-testing-rest",
|
||||||
"versionPolicyName": "client"
|
"versionPolicyName": "client"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1885,7 +1885,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"packageName": "@azure/arm-loadtesting",
|
"packageName": "@azure/arm-loadtesting",
|
||||||
"projectFolder": "sdk/loadtestservice/arm-loadtesting",
|
"projectFolder": "sdk/loadtesting/arm-loadtesting",
|
||||||
"versionPolicyName": "management"
|
"versionPolicyName": "management"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,7 +4,7 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) f
|
||||||
|
|
||||||
LoadTest client provides access to LoadTest Resource and it's status operations.
|
LoadTest client provides access to LoadTest Resource and it's status operations.
|
||||||
|
|
||||||
[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/loadtestservice/arm-loadtesting) |
|
[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/loadtesting/arm-loadtesting) |
|
||||||
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-loadtesting) |
|
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-loadtesting) |
|
||||||
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-loadtesting) |
|
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-loadtesting) |
|
||||||
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)
|
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)
|
|
@ -111,7 +111,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"autoPublish": true,
|
"autoPublish": true,
|
||||||
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/loadtestservice/arm-loadtesting",
|
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/loadtesting/arm-loadtesting",
|
||||||
"//sampleConfiguration": {
|
"//sampleConfiguration": {
|
||||||
"productName": "",
|
"productName": "",
|
||||||
"productSlugs": [
|
"productSlugs": [
|
|
@ -54,17 +54,17 @@ npx cross-env LOADTESTSERVICE_SUBSCRIPTION_ID="<loadtestservice subscription id>
|
||||||
|
|
||||||
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
|
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
|
||||||
|
|
||||||
[loadtestscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtestservice/arm-loadtesting/samples/v1/javascript/loadTestsCreateOrUpdateSample.js
|
[loadtestscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtesting/arm-loadtesting/samples/v1/javascript/loadTestsCreateOrUpdateSample.js
|
||||||
[loadtestsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtestservice/arm-loadtesting/samples/v1/javascript/loadTestsDeleteSample.js
|
[loadtestsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtesting/arm-loadtesting/samples/v1/javascript/loadTestsDeleteSample.js
|
||||||
[loadtestsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtestservice/arm-loadtesting/samples/v1/javascript/loadTestsGetSample.js
|
[loadtestsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtesting/arm-loadtesting/samples/v1/javascript/loadTestsGetSample.js
|
||||||
[loadtestslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtestservice/arm-loadtesting/samples/v1/javascript/loadTestsListByResourceGroupSample.js
|
[loadtestslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtesting/arm-loadtesting/samples/v1/javascript/loadTestsListByResourceGroupSample.js
|
||||||
[loadtestslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtestservice/arm-loadtesting/samples/v1/javascript/loadTestsListBySubscriptionSample.js
|
[loadtestslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtesting/arm-loadtesting/samples/v1/javascript/loadTestsListBySubscriptionSample.js
|
||||||
[loadtestslistoutboundnetworkdependenciesendpointssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtestservice/arm-loadtesting/samples/v1/javascript/loadTestsListOutboundNetworkDependenciesEndpointsSample.js
|
[loadtestslistoutboundnetworkdependenciesendpointssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtesting/arm-loadtesting/samples/v1/javascript/loadTestsListOutboundNetworkDependenciesEndpointsSample.js
|
||||||
[loadtestsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtestservice/arm-loadtesting/samples/v1/javascript/loadTestsUpdateSample.js
|
[loadtestsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtesting/arm-loadtesting/samples/v1/javascript/loadTestsUpdateSample.js
|
||||||
[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtestservice/arm-loadtesting/samples/v1/javascript/operationsListSample.js
|
[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtesting/arm-loadtesting/samples/v1/javascript/operationsListSample.js
|
||||||
[quotascheckavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtestservice/arm-loadtesting/samples/v1/javascript/quotasCheckAvailabilitySample.js
|
[quotascheckavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtesting/arm-loadtesting/samples/v1/javascript/quotasCheckAvailabilitySample.js
|
||||||
[quotasgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtestservice/arm-loadtesting/samples/v1/javascript/quotasGetSample.js
|
[quotasgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtesting/arm-loadtesting/samples/v1/javascript/quotasGetSample.js
|
||||||
[quotaslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtestservice/arm-loadtesting/samples/v1/javascript/quotasListSample.js
|
[quotaslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtesting/arm-loadtesting/samples/v1/javascript/quotasListSample.js
|
||||||
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-loadtesting?view=azure-node-preview
|
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-loadtesting?view=azure-node-preview
|
||||||
[freesub]: https://azure.microsoft.com/free/
|
[freesub]: https://azure.microsoft.com/free/
|
||||||
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/loadtestservice/arm-loadtesting/README.md
|
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/loadtesting/arm-loadtesting/README.md
|
|
@ -9,7 +9,7 @@
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
|
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
|
||||||
"directory": "sdk/loadtestservice/arm-loadtesting"
|
"directory": "sdk/loadtesting/arm-loadtesting"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"node",
|
"node",
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
|
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/loadtestservice/arm-loadtesting",
|
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/loadtesting/arm-loadtesting",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@azure/arm-loadtesting": "latest",
|
"@azure/arm-loadtesting": "latest",
|
||||||
"dotenv": "latest",
|
"dotenv": "latest",
|
|
@ -66,18 +66,18 @@ npx cross-env LOADTESTSERVICE_SUBSCRIPTION_ID="<loadtestservice subscription id>
|
||||||
|
|
||||||
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
|
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
|
||||||
|
|
||||||
[loadtestscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtestservice/arm-loadtesting/samples/v1/typescript/src/loadTestsCreateOrUpdateSample.ts
|
[loadtestscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtesting/arm-loadtesting/samples/v1/typescript/src/loadTestsCreateOrUpdateSample.ts
|
||||||
[loadtestsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtestservice/arm-loadtesting/samples/v1/typescript/src/loadTestsDeleteSample.ts
|
[loadtestsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtesting/arm-loadtesting/samples/v1/typescript/src/loadTestsDeleteSample.ts
|
||||||
[loadtestsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtestservice/arm-loadtesting/samples/v1/typescript/src/loadTestsGetSample.ts
|
[loadtestsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtesting/arm-loadtesting/samples/v1/typescript/src/loadTestsGetSample.ts
|
||||||
[loadtestslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtestservice/arm-loadtesting/samples/v1/typescript/src/loadTestsListByResourceGroupSample.ts
|
[loadtestslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtesting/arm-loadtesting/samples/v1/typescript/src/loadTestsListByResourceGroupSample.ts
|
||||||
[loadtestslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtestservice/arm-loadtesting/samples/v1/typescript/src/loadTestsListBySubscriptionSample.ts
|
[loadtestslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtesting/arm-loadtesting/samples/v1/typescript/src/loadTestsListBySubscriptionSample.ts
|
||||||
[loadtestslistoutboundnetworkdependenciesendpointssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtestservice/arm-loadtesting/samples/v1/typescript/src/loadTestsListOutboundNetworkDependenciesEndpointsSample.ts
|
[loadtestslistoutboundnetworkdependenciesendpointssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtesting/arm-loadtesting/samples/v1/typescript/src/loadTestsListOutboundNetworkDependenciesEndpointsSample.ts
|
||||||
[loadtestsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtestservice/arm-loadtesting/samples/v1/typescript/src/loadTestsUpdateSample.ts
|
[loadtestsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtesting/arm-loadtesting/samples/v1/typescript/src/loadTestsUpdateSample.ts
|
||||||
[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtestservice/arm-loadtesting/samples/v1/typescript/src/operationsListSample.ts
|
[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtesting/arm-loadtesting/samples/v1/typescript/src/operationsListSample.ts
|
||||||
[quotascheckavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtestservice/arm-loadtesting/samples/v1/typescript/src/quotasCheckAvailabilitySample.ts
|
[quotascheckavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtesting/arm-loadtesting/samples/v1/typescript/src/quotasCheckAvailabilitySample.ts
|
||||||
[quotasgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtestservice/arm-loadtesting/samples/v1/typescript/src/quotasGetSample.ts
|
[quotasgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtesting/arm-loadtesting/samples/v1/typescript/src/quotasGetSample.ts
|
||||||
[quotaslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtestservice/arm-loadtesting/samples/v1/typescript/src/quotasListSample.ts
|
[quotaslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtesting/arm-loadtesting/samples/v1/typescript/src/quotasListSample.ts
|
||||||
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-loadtesting?view=azure-node-preview
|
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-loadtesting?view=azure-node-preview
|
||||||
[freesub]: https://azure.microsoft.com/free/
|
[freesub]: https://azure.microsoft.com/free/
|
||||||
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/loadtestservice/arm-loadtesting/README.md
|
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/loadtesting/arm-loadtesting/README.md
|
||||||
[typescript]: https://www.typescriptlang.org/docs/home.html
|
[typescript]: https://www.typescriptlang.org/docs/home.html
|
|
@ -13,7 +13,7 @@
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
|
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
|
||||||
"directory": "sdk/loadtestservice/arm-loadtesting"
|
"directory": "sdk/loadtesting/arm-loadtesting"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"node",
|
"node",
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
|
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/loadtestservice/arm-loadtesting",
|
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/loadtesting/arm-loadtesting",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@azure/arm-loadtesting": "latest",
|
"@azure/arm-loadtesting": "latest",
|
||||||
"dotenv": "latest",
|
"dotenv": "latest",
|
|
@ -8,8 +8,8 @@ trigger:
|
||||||
- hotfix/*
|
- hotfix/*
|
||||||
paths:
|
paths:
|
||||||
include:
|
include:
|
||||||
- sdk/loadtestservice/ci.mgmt.yml
|
- sdk/loadtesting/ci.mgmt.yml
|
||||||
- sdk/loadtestservice/arm-loadtesting
|
- sdk/loadtesting/arm-loadtesting
|
||||||
pr:
|
pr:
|
||||||
branches:
|
branches:
|
||||||
include:
|
include:
|
||||||
|
@ -21,12 +21,12 @@ pr:
|
||||||
- feature/v4
|
- feature/v4
|
||||||
paths:
|
paths:
|
||||||
include:
|
include:
|
||||||
- sdk/loadtestservice/ci.mgmt.yml
|
- sdk/loadtesting/ci.mgmt.yml
|
||||||
- sdk/loadtestservice/arm-loadtesting
|
- sdk/loadtesting/arm-loadtesting
|
||||||
extends:
|
extends:
|
||||||
template: /eng/pipelines/templates/stages/archetype-sdk-client.yml
|
template: /eng/pipelines/templates/stages/archetype-sdk-client.yml
|
||||||
parameters:
|
parameters:
|
||||||
ServiceDirectory: loadtestservice
|
ServiceDirectory: loadtesting
|
||||||
Artifacts:
|
Artifacts:
|
||||||
- name: azure-arm-loadtesting
|
- name: azure-arm-loadtesting
|
||||||
safeName: azurearmloadtesting
|
safeName: azurearmloadtesting
|
|
@ -8,10 +8,10 @@ trigger:
|
||||||
- hotfix/*
|
- hotfix/*
|
||||||
paths:
|
paths:
|
||||||
include:
|
include:
|
||||||
- sdk/loadtestservice/
|
- sdk/loadtesting/
|
||||||
exclude:
|
exclude:
|
||||||
- sdk/loadtestservice/ci.mgmt.yml
|
- sdk/loadtesting/ci.mgmt.yml
|
||||||
- sdk/loadtestservice/arm-loadtesting
|
- sdk/loadtesting/arm-loadtesting
|
||||||
pr:
|
pr:
|
||||||
branches:
|
branches:
|
||||||
include:
|
include:
|
||||||
|
@ -21,14 +21,14 @@ pr:
|
||||||
- hotfix/*
|
- hotfix/*
|
||||||
paths:
|
paths:
|
||||||
include:
|
include:
|
||||||
- sdk/loadtestservice/
|
- sdk/loadtesting/
|
||||||
exclude:
|
exclude:
|
||||||
- sdk/loadtestservice/ci.mgmt.yml
|
- sdk/loadtesting/ci.mgmt.yml
|
||||||
- sdk/loadtestservice/arm-loadtesting
|
- sdk/loadtesting/arm-loadtesting
|
||||||
extends:
|
extends:
|
||||||
template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml
|
template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml
|
||||||
parameters:
|
parameters:
|
||||||
ServiceDirectory: loadtestservice
|
ServiceDirectory: loadtesting
|
||||||
Artifacts:
|
Artifacts:
|
||||||
- name: azure-rest-load-testing
|
- name: azure-rest-load-testing
|
||||||
safeName: azurerestloadtesting
|
safeName: azurerestloadtesting
|
|
@ -100,12 +100,13 @@ In the above example, `eus` represents the Azure region `East US`.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import { AzureLoadTestingClient } from "@azure-rest/load-testing";
|
import { AzureLoadTestingClient } from "@azure-rest/load-testing";
|
||||||
|
import AzureLoadTesting from "@azure-rest/load-testing";
|
||||||
import { DefaultAzureCredential } from "@azure/identity";
|
import { DefaultAzureCredential } from "@azure/identity";
|
||||||
|
|
||||||
var TEST_ID = "some-test-id";
|
var TEST_ID = "some-test-id";
|
||||||
var DISPLAY_NAME = "my-load-test";
|
var DISPLAY_NAME = "my-load-test";
|
||||||
|
|
||||||
const client: AzureLoadTestingClient = AzureLoadTesting(Endpoint, new DefaultAzureCredential());
|
const client: AzureLoadTestingClient = AzureLoadTesting("<Endpoint>", new DefaultAzureCredential());
|
||||||
|
|
||||||
await client.path("/tests/{testId}", TEST_ID).patch({
|
await client.path("/tests/{testId}", TEST_ID).patch({
|
||||||
contentType: "application/merge-patch+json",
|
contentType: "application/merge-patch+json",
|
||||||
|
@ -126,11 +127,13 @@ await client.path("/tests/{testId}", TEST_ID).patch({
|
||||||
### Uploading .jmx file to a Test
|
### Uploading .jmx file to a Test
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import { AzureLoadTestingClient, getLongRunningPoller } from "@azure-rest/load-testing";
|
import { AzureLoadTestingClient, getLongRunningPoller, isUnexpected } from "@azure-rest/load-testing";
|
||||||
|
import AzureLoadTesting from "@azure-rest/load-testing";
|
||||||
|
import { AbortController } from "@azure/abort-controller";
|
||||||
import { DefaultAzureCredential } from "@azure/identity";
|
import { DefaultAzureCredential } from "@azure/identity";
|
||||||
import { createReadStream } from "fs";
|
import { createReadStream } from "fs";
|
||||||
|
|
||||||
const client: AzureLoadTestingClient = AzureLoadTesting(Endpoint, new DefaultAzureCredential());
|
const client: AzureLoadTestingClient = AzureLoadTesting("<Endpoint>", new DefaultAzureCredential());
|
||||||
|
|
||||||
var TEST_ID = "some-test-id";
|
var TEST_ID = "some-test-id";
|
||||||
const readStream = createReadStream("./sample.jmx");
|
const readStream = createReadStream("./sample.jmx");
|
||||||
|
@ -155,7 +158,7 @@ fileValidateResult = await fileValidatePoller.pollUntilDone({
|
||||||
new Error("Error in polling file Validation" + ex.message); //polling timed out
|
new Error("Error in polling file Validation" + ex.message); //polling timed out
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fileUploadPoller.getOperationState().status != "succeeded" && fileValidateResult)
|
if (fileValidatePoller.getOperationState().status != "succeeded" && fileValidateResult)
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"There is some issue in validation, please make sure uploaded file is a valid JMX." +
|
"There is some issue in validation, please make sure uploaded file is a valid JMX." +
|
||||||
fileValidateResult.body.validationFailureDetails
|
fileValidateResult.body.validationFailureDetails
|
||||||
|
@ -165,10 +168,12 @@ if (fileUploadPoller.getOperationState().status != "succeeded" && fileValidateRe
|
||||||
### Running a Test and fetching Metrics
|
### Running a Test and fetching Metrics
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import { AzureLoadTestingClient, getLongRunningPoller } from "@azure-rest/load-testing";
|
import { AzureLoadTestingClient, getLongRunningPoller, isUnexpected } from "@azure-rest/load-testing";
|
||||||
|
import AzureLoadTesting from "@azure-rest/load-testing";
|
||||||
import { DefaultAzureCredential } from "@azure/identity";
|
import { DefaultAzureCredential } from "@azure/identity";
|
||||||
|
import { AbortController } from "@azure/abort-controller";
|
||||||
|
|
||||||
const client: AzureLoadTestingClient = AzureLoadTesting(Endpoint, new DefaultAzureCredential());
|
const client: AzureLoadTestingClient = AzureLoadTesting("<Endpoint>", new DefaultAzureCredential());
|
||||||
|
|
||||||
var TEST_ID = "some-test-id";
|
var TEST_ID = "some-test-id";
|
||||||
var DISPLAY_NAME = "my-load-test";
|
var DISPLAY_NAME = "my-load-test";
|
||||||
|
@ -210,7 +215,7 @@ const testRunPoller = await getLongRunningPoller(client, testRunCreationResult);
|
||||||
|
|
||||||
// get list of all metric namespaces and pick the first one
|
// get list of all metric namespaces and pick the first one
|
||||||
const metricNamespaces = await client
|
const metricNamespaces = await client
|
||||||
.path("/test-runs/{testRunId}/metric-namespaces", testRunId)
|
.path("/test-runs/{testRunId}/metric-namespaces", TEST_RUN_ID)
|
||||||
.get();
|
.get();
|
||||||
|
|
||||||
if (isUnexpected(metricNamespaces)) {
|
if (isUnexpected(metricNamespaces)) {
|
||||||
|
@ -225,7 +230,7 @@ const testRunPoller = await getLongRunningPoller(client, testRunCreationResult);
|
||||||
|
|
||||||
// get list of all metric definitions and pick the first one
|
// get list of all metric definitions and pick the first one
|
||||||
const metricDefinitions = await client
|
const metricDefinitions = await client
|
||||||
.path("/test-runs/{testRunId}/metric-definitions", testRunId)
|
.path("/test-runs/{testRunId}/metric-definitions", TEST_RUN_ID)
|
||||||
.get({
|
.get({
|
||||||
queryParameters: {
|
queryParameters: {
|
||||||
metricNamespace: metricNamespace.name,
|
metricNamespace: metricNamespace.name,
|
||||||
|
@ -243,7 +248,7 @@ const testRunPoller = await getLongRunningPoller(client, testRunCreationResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
// fetch client metrics using metric namespace and metric name
|
// fetch client metrics using metric namespace and metric name
|
||||||
const metricsResult = await client.path("/test-runs/{testRunId}/metrics", testRunId).post({
|
const metricsResult = await client.path("/test-runs/{testRunId}/metrics", TEST_RUN_ID).post({
|
||||||
queryParameters: {
|
queryParameters: {
|
||||||
metricname: metricDefinition.name,
|
metricname: metricDefinition.name,
|
||||||
metricNamespace: metricNamespace.name,
|
metricNamespace: metricNamespace.name,
|
||||||
|
@ -288,8 +293,8 @@ For details on contributing to this repository, see the [contributing guide](htt
|
||||||
|
|
||||||
<!-- LINKS -->
|
<!-- LINKS -->
|
||||||
|
|
||||||
[source_code]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/loadtestservice/load-testing-rest/src
|
[source_code]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/loadtesting/load-testing-rest/src
|
||||||
[sample_code]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/loadtestservice/load-testing-rest/samples/v1-beta
|
[sample_code]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/loadtesting/load-testing-rest/samples/v1-beta
|
||||||
[api_reference_doc]: https://docs.microsoft.com/rest/api/loadtesting/
|
[api_reference_doc]: https://docs.microsoft.com/rest/api/loadtesting/
|
||||||
[product_documentation]: https://azure.microsoft.com/services/load-testing/
|
[product_documentation]: https://azure.microsoft.com/services/load-testing/
|
||||||
[azure_subscription]: https://azure.microsoft.com/free/
|
[azure_subscription]: https://azure.microsoft.com/free/
|
|
@ -118,7 +118,7 @@
|
||||||
"uuid": "^9.0.0",
|
"uuid": "^9.0.0",
|
||||||
"typescript": "~4.8.0"
|
"typescript": "~4.8.0"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/loadtestservice/load-testing-rest/README.md",
|
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/loadtesting/load-testing-rest/README.md",
|
||||||
"//metadata": {
|
"//metadata": {
|
||||||
"constantPaths": [
|
"constantPaths": [
|
||||||
{
|
{
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче