Skip to content
Closed
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.1.0-beta.1 (Unreleased)
## 1.0.0-beta.1 (2023-02-14)

- Azure Resource Manager LoadTest client library for Java. This package contains Microsoft Azure SDK for LoadTest Management SDK. LoadTest client provides access to LoadTest Resource and it's status operations. Package tag package-2022-12-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

### Features Added

Expand Down
161 changes: 2 additions & 159 deletions sdk/loadtesting/azure-resourcemanager-loadtesting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-loadtesting</artifactId>
<version>1.0.0</version>
<version>1.1.0-beta.1</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand All @@ -55,7 +55,7 @@ In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID`

With above configuration, `azure` client can be authenticated using the following code:

```java readme-sample-authn
```java
AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
TokenCredential credential = new DefaultAzureCredentialBuilder()
.authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
Expand All @@ -74,163 +74,6 @@ See [API design][design] for general introduction on design and key concepts on

## Examples

### Create a new Azure Load Testing resource

Create an Azure Load Testing resource.

```java readme-sample-createloadtestresource-basic
LoadTestResource resource = manager
.loadTests()
.define("sample-loadtesting-resource")
.withRegion(Region.US_WEST2)
.withExistingResourceGroup("sample-rg")
.create();
```

Create an Azure Load Testing resource configured with CMK encryption.

```java readme-sample-createloadtestresource-encryption
// map of user-assigned managed identities to be assigned to the loadtest resource
Map<String, UserAssignedIdentity> map = new HashMap<String, UserAssignedIdentity>();
map.put("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sample-rg/providers/microsoft.managedidentity/userassignedidentities/identity1", new UserAssignedIdentity());

// encryption identity must be assigned to the load test resource, before using it
LoadTestResource resource = manager
.loadTests()
.define("sample-loadtesting-resource")
.withRegion(Region.US_WEST2)
.withExistingResourceGroup("sample-rg")
.withIdentity(
new ManagedServiceIdentity()
.withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)
.withUserAssignedIdentities(map)
)
.withEncryption(
new EncryptionProperties()
.withIdentity(
new EncryptionPropertiesIdentity()
.withResourceId("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sample-rg/providers/microsoft.managedidentity/userassignedidentities/identity1")
.withType(Type.USER_ASSIGNED)
)
.withKeyUrl("https://sample-kv.vault.azure.net/keys/cmkkey/2d1ccd5c50234ea2a0858fe148b69cde")
)
.create();
```

### Get details of an Azure Load Testing resource

```java readme-sample-getloadtestresource
LoadTestResource resource = manager
.loadTests()
.getByResourceGroup("sample-rg", "sample-loadtesting-resource");
```

### Update an Azure Load Testing resource

Update an Azure Load Testing resource to configure CMK encryption using system-assigned managed identity.

```java readme-sample-updateloadtestresource-encryption
LoadTestResource resource = manager
.loadTests()
.getByResourceGroup("sample-rg", "sample-loadtesting-resource");

LoadTestResource resourcePostUpdate = resource
.update()
.withIdentity(
new ManagedServiceIdentity()
.withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)
)
.withEncryption(
new EncryptionProperties()
.withIdentity(
new EncryptionPropertiesIdentity()
.withResourceId(null)
.withType(Type.SYSTEM_ASSIGNED)
// make sure that system-assigned managed identity is enabled on the resource and the identity has been granted required permissions to access the key.
)
.withKeyUrl("https://sample-kv.vault.azure.net/keys/cmkkey/2d1ccd5c50234ea2a0858fe148b69cde")
)
.apply();
```

Update an Azure Load Testing resource to update user-assigned managed identities.

```java readme-sample-updateloadtestresource-mi
Map<String, UserAssignedIdentity> map = new HashMap<String, UserAssignedIdentity>();
// Note: the value of <identity1> set to null, removes the previously assigned managed identity from the load test resource
map.put("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sample-rg/providers/microsoft.managedidentity/userassignedidentities/identity1", null);
map.put("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sample-rg/providers/microsoft.managedidentity/userassignedidentities/identity2", new UserAssignedIdentity());

LoadTestResource resource = manager
.loadTests()
.getByResourceGroup("sample-rg", "sample-loadtesting-resource");

LoadTestResource resourcePostUpdate = resource
.update()
.withIdentity(
new ManagedServiceIdentity()
.withType(ManagedServiceIdentityType.USER_ASSIGNED)
.withUserAssignedIdentities(map)
)
.apply();
```

### Delete an Azure Load Testing resource

```java readme-sample-deleteloadtestresource
manager
.loadTests()
.deleteByResourceGroup("sample-rg", "sample-loadtesting-resource");
```

### Quota Operations

Get quota values for all quota buckets.

```java readme-sample-list-all-quota-buckets
PagedIterable<QuotaResource> resource = manager
.quotas()
.list("westus2");

for (QuotaResource quotaResource : resource) {
// use the quotaResource
System.out.println(quotaResource.limit());
}
```

Get quota values for a particular quota bucket.

```java readme-sample-get-quota-bucket
QuotaResource resource = manager
.quotas()
.get("westus2", "maxConcurrentTestRuns");
System.out.println(resource.limit());
```

Check quota availability.

```java readme-sample-check-quota-availability
QuotaResource resource = manager
.quotas()
.get("westus2", "maxConcurrentTestRuns");

QuotaBucketRequestPropertiesDimensions dimensions = new QuotaBucketRequestPropertiesDimensions()
.withLocation("westus2")
.withSubscriptionId(manager.serviceClient().getSubscriptionId());

QuotaBucketRequest request = new QuotaBucketRequest()
.withCurrentQuota(resource.limit())
.withCurrentUsage(resource.usage())
.withNewQuota(resource.limit())
.withDimensions(dimensions);

CheckQuotaAvailabilityResponse availability = manager
.quotas()
.checkAvailability("westus2", "maxConcurrentTestRuns", request);

System.out.println(availability.isAvailable());
```

[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/loadtesting/azure-resourcemanager-loadtesting/SAMPLE.md)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public LoadTestManager authenticate(TokenCredential credential, AzureProfile pro
.append("-")
.append("com.azure.resourcemanager.loadtesting")
.append("/")
.append("1.0.0");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading