Skip to content

[AutoPR @azure/arm-loadtesting] [DNM] Validate typespec-azure#2607 #15680

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

78 changes: 70 additions & 8 deletions sdk/loadtesting/arm-loadtesting/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,77 @@
# Release History

## 1.0.1 (Unreleased)


## 2.0.0-beta.1 (2025-05-13)
Compared with version 1.0.0

### Features Added

### Breaking Changes
- Added Interface CheckAvailabilityQuotaOptionalParams
- Added Interface CheckQuotaAvailabilityResponseProperties
- Added Interface CreateOrUpdateLoadtestOptionalParams
- Added Interface DeleteLoadtestOptionalParams
- Added Interface GetLoadtestOptionalParams
- Added Interface GetQuotaOptionalParams
- Added Interface ListByResourceGroupOptionalParams
- Added Interface ListBySubscriptionOptionalParams
- Added Interface ListQuotaOptionalParams
- Added Interface LoadTestMgmtClientOptionalParams
- Added Interface LoadTestProperties
- Added Interface LoadTestResourceUpdate
- Added Interface LoadTestResourceUpdateProperties
- Added Interface OutboundNetworkDependenciesEndpointsOptionalParams
- Added Interface PagedAsyncIterableIterator
- Added Interface PageSettings
- Added Interface ProxyResource
- Added Interface QuotaBucketRequestProperties
- Added Interface QuotaResourceProperties
- Added Interface RestorePollerOptions
- Added Interface UpdateLoadtestOptionalParams
- Added Class LoadTestMgmtClient
- Added Type Alias ContinuablePage
- Interface CheckQuotaAvailabilityResponse has a new optional parameter name
- Interface CheckQuotaAvailabilityResponse has a new optional parameter properties
- Interface CheckQuotaAvailabilityResponse has a new optional parameter systemData
- Interface LoadTestResource has a new optional parameter properties
- Interface QuotaBucketRequest has a new optional parameter properties
- Interface QuotaResource has a new optional parameter properties
- Type of parameter resourceId of interface EncryptionPropertiesIdentity is changed from string to string | null
- Added Enum KnownAPIVersions
- Added function restorePoller

### Bugs Fixed

### Other Changes
### Breaking Changes

- Removed operation group LoadTests
- Removed operation group Operations
- Removed operation group Quotas
- Deleted Class LoadTestClient
- Interface CheckQuotaAvailabilityResponse no longer has parameter availabilityStatus
- Interface CheckQuotaAvailabilityResponse no longer has parameter isAvailable
- Interface LoadTestResource no longer has parameter dataPlaneURI
- Interface LoadTestResource no longer has parameter description
- Interface LoadTestResource no longer has parameter encryption
- Interface LoadTestResource no longer has parameter provisioningState
- Interface QuotaBucketRequest no longer has parameter currentQuota
- Interface QuotaBucketRequest no longer has parameter currentUsage
- Interface QuotaBucketRequest no longer has parameter dimensions
- Interface QuotaBucketRequest no longer has parameter newQuota
- Interface QuotaResource no longer has parameter limit
- Interface QuotaResource no longer has parameter provisioningState
- Interface QuotaResource no longer has parameter usage
- Interface CheckQuotaAvailabilityResponse has a new required parameter id
- Interface CheckQuotaAvailabilityResponse has a new required parameter type
- Parameter domainName of interface EndpointDependency is now required
- Type of parameter info of interface ErrorAdditionalInfo is changed from Record<string, unknown> to Record<string, any>
- Type of parameter userAssignedIdentities of interface ManagedServiceIdentity is changed from {
[propertyName: string]: UserAssignedIdentity | null;
} to Record<string, UserAssignedIdentity | null>
- Type of parameter tags of interface TrackedResource is changed from {
[propertyName: string]: string;
} to Record<string, string>
- Removed Enum KnownActionType
- Removed Enum KnownOrigin
- Removed function getContinuationToken


## 1.0.0 (2023-01-28)

The package of @azure/arm-loadtesting is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ).
The package of @azure/arm-loadtesting is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart).
2 changes: 1 addition & 1 deletion sdk/loadtesting/arm-loadtesting/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
159 changes: 16 additions & 143 deletions sdk/loadtesting/arm-loadtesting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ 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.

[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) |
[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-loadtesting) |
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)
Key links:

- [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)
- [API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-loadtesting?view=azure-node-preview)
- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/loadtesting/arm-loadtesting/samples)

## Getting started

Expand All @@ -30,7 +32,7 @@ Install the Azure LoadTest client library for JavaScript with `npm`:
npm install @azure/arm-loadtesting
```

### Create and authenticate a `LoadTestClient`
### Create and authenticate a `LoadTestServiceClient`

To create a client object to access the Azure LoadTest API, you will need the `endpoint` of your Azure LoadTest resource and a `credential`. The Azure LoadTest client can use Azure Active Directory credentials to authenticate.
You can find the endpoint for your Azure LoadTest resource in the [Azure Portal][azure_portal].
Expand All @@ -44,168 +46,41 @@ npm install @azure/identity
```

You will also need to **register a new AAD application and grant access to Azure LoadTest** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.

For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).

Using Node.js and Node-like environments, you can use the `DefaultAzureCredential` class to authenticate the client.

```ts snippet:ReadmeSampleCreateClient_Node
import { LoadTestClient } from "@azure/arm-loadtesting";
import { LoadTestServiceClient } from "@azure/arm-loadtesting";
import { DefaultAzureCredential } from "@azure/identity";

const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new LoadTestClient(new DefaultAzureCredential(), subscriptionId);
const client = new LoadTestServiceClient(new DefaultAzureCredential(), subscriptionId);
```

For browser environments, use the `InteractiveBrowserCredential` from the `@azure/identity` package to authenticate.

```ts snippet:ReadmeSampleCreateClient_Browser
import { InteractiveBrowserCredential } from "@azure/identity";
import { LoadTestClient } from "@azure/arm-loadtesting";
import { LoadTestServiceClient } from "@azure/arm-loadtesting";

const subscriptionId = "00000000-0000-0000-0000-000000000000";
const credential = new InteractiveBrowserCredential({
tenantId: "<YOUR_TENANT_ID>",
clientId: "<YOUR_CLIENT_ID>",
});
const client = new LoadTestClient(credential, subscriptionId);
```

### Create an Azure Load Testing resource

Create a new Azure Load Testing resource.

```ts snippet:ReadmeSampleCreateLoadTestResource
import { LoadTestClient } from "@azure/arm-loadtesting";
import { DefaultAzureCredential } from "@azure/identity";

const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new LoadTestClient(new DefaultAzureCredential(), subscriptionId);

const loadTestResourceCreatePayload = {
location: "westus2",
};

const resource = await client.loadTests.beginCreateOrUpdateAndWait(
"sample-rg",
"sample-loadtesting-resource",
loadTestResourceCreatePayload,
);
```

Create a new Azure Load Testing resource with managed identity and customer managed key encryption.

```ts snippet:ReadmeSampleCreateLoadTestResourceWithManagedIdentityAndCMKEncryption
import { LoadTestClient } from "@azure/arm-loadtesting";
import { DefaultAzureCredential } from "@azure/identity";

const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new LoadTestClient(new DefaultAzureCredential(), subscriptionId);

const loadTestResourceCreatePayload = {
location: "westus2",
tags: { team: "testing" },
identity: {
type: "SystemAssigned, UserAssigned",
userAssignedIdentities: {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sample-rg/providers/microsoft.managedidentity/userassignedidentities/identity1":
{},
},
},
encryption: {
identity: {
type: "UserAssigned",
resourceId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sample-rg/providers/microsoft.managedidentity/userassignedidentities/identity1",
},
keyUrl: "https://sample-kv.vault.azure.net/keys/cmkkey/2d1ccd5c50234ea2a0858fe148b69cde",
},
};

const resource = await client.loadTests.beginCreateOrUpdateAndWait(
"sample-rg",
"sample-loadtesting-resource",
loadTestResourceCreatePayload,
);
```

### Get an Azure Load Testing resource

```ts snippet:ReadmeSampleGetLoadTestResource
import { LoadTestClient } from "@azure/arm-loadtesting";
import { DefaultAzureCredential } from "@azure/identity";

const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new LoadTestClient(new DefaultAzureCredential(), subscriptionId);

const resourceName = "sample-loadtesting-resource";
const resourceGroupName = "sample-rg";

const resource = await client.loadTests.get(resourceGroupName, resourceName);
```

### Update an Azure Load Testing resource

```ts snippet:ReadmeSampleUpdateLoadTestResource
import { LoadTestClient } from "@azure/arm-loadtesting";
import { DefaultAzureCredential } from "@azure/identity";

const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new LoadTestClient(new DefaultAzureCredential(), subscriptionId);

const loadTestResourcePatchPayload = {
tags: { team: "testing-dev" },
identity: {
type: "SystemAssigned, UserAssigned",
userAssignedIdentities: {
// removing a user-assigned managed identity by assigning the value in the payload as null
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sample-rg/providers/microsoft.managedidentity/userassignedidentities/identity1":
null,
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sample-rg/providers/microsoft.managedidentity/userassignedidentities/identity2":
{},
},
},
encryption: {
// use system-assigned managed identity for CMK encryption
identity: {
type: "SystemAssigned",
resourceId: null,
},
keyUrl: "https://sample-kv.vault.azure.net/keys/cmkkey/2d1ccd5c50234ea2a0858fe148b69cde",
},
};
const resource = await client.loadTests.beginUpdateAndWait(
"sample-rg",
"sample-loadtesting-resource",
loadTestResourcePatchPayload,
);
clientId: "<YOUR_CLIENT_ID>"
});
const client = new LoadTestServiceClient(credential, subscriptionId);
```

### Delete an Azure Load Testing resource

```ts snippet:ReadmeSampleDeleteLoadTestResource
import { LoadTestClient } from "@azure/arm-loadtesting";
import { DefaultAzureCredential } from "@azure/identity";

const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new LoadTestClient(new DefaultAzureCredential(), subscriptionId);

const resourceName = "sample-loadtesting-resource";
const resourceGroupName = "sample-rg";

const result = await client.loadTests.beginDeleteAndWait(resourceGroupName, resourceName);
```

### JavaScript Bundle

To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling).

## Key concepts

### LoadTestClient
### LoadTestServiceClient

`LoadTestClient` is the primary interface for developers using the Azure LoadTest client library. Explore the methods on this client object to understand the different features of the Azure LoadTest service that you can access.
`LoadTestServiceClient` is the primary interface for developers using the Azure LoadTest client library. Explore the methods on this client object to understand the different features of the Azure LoadTest service that you can access.

## Troubleshooting

Expand All @@ -223,7 +98,7 @@ For more detailed instructions on how to enable logs, you can look at the [@azur

## Next steps

Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library.
Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/loadtesting/arm-loadtesting/samples) directory for detailed examples on how to use this library.

## Contributing

Expand All @@ -233,8 +108,6 @@ If you'd like to contribute to this library, please read the [contributing guide

- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js)

[azure_cli]: https://learn.microsoft.com/cli/azure
[azure_sub]: https://azure.microsoft.com/free/
[azure_sub]: https://azure.microsoft.com/free/
[azure_portal]: https://portal.azure.com
[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity
Expand Down
8 changes: 0 additions & 8 deletions sdk/loadtesting/arm-loadtesting/_meta.json

This file was deleted.

6 changes: 0 additions & 6 deletions sdk/loadtesting/arm-loadtesting/assets.json

This file was deleted.

14 changes: 14 additions & 0 deletions sdk/loadtesting/arm-loadtesting/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import azsdkEslint from "@azure/eslint-plugin-azure-sdk";

export default azsdkEslint.config([
{
rules: {
"@azure/azure-sdk/ts-modules-only-named": "warn",
"@azure/azure-sdk/ts-package-json-types": "warn",
"@azure/azure-sdk/ts-package-json-engine-is-present": "warn",
"@azure/azure-sdk/ts-package-json-files-required": "off",
"@azure/azure-sdk/ts-package-json-main-is-cjs": "off",
"tsdoc/syntax": "warn",
},
},
]);
Loading