Skip to content

Commit

Permalink
[Automation] Generate Fluent Lite from Swagger loadtestservice#packag…
Browse files Browse the repository at this point in the history
…e-2022-12-01 (Azure#43355)
  • Loading branch information
azure-sdk authored Dec 12, 2024
1 parent b040918 commit 55c1313
Show file tree
Hide file tree
Showing 108 changed files with 3,454 additions and 2,460 deletions.
2 changes: 1 addition & 1 deletion eng/versioning/version_client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ com.azure.resourcemanager:azure-resourcemanager-logz;1.0.0-beta.3;1.0.0-beta.4
com.azure.resourcemanager:azure-resourcemanager-storagepool;1.0.0-beta.3;1.0.0-beta.4
com.azure.resourcemanager:azure-resourcemanager-dataprotection;1.3.0;1.4.0-beta.1
com.azure.resourcemanager:azure-resourcemanager-desktopvirtualization;1.2.0;1.3.0-beta.1
com.azure.resourcemanager:azure-resourcemanager-loadtesting;1.0.0;1.1.0-beta.1
com.azure.resourcemanager:azure-resourcemanager-loadtesting;1.0.0;1.1.0
com.azure.resourcemanager:azure-resourcemanager-automanage;1.0.0-beta.2;1.0.0-beta.3
com.azure.resourcemanager:azure-resourcemanager-edgeorder;1.0.0-beta.2;1.0.0-beta.3
com.azure.resourcemanager:azure-resourcemanager-securityinsights;1.0.0-beta.5;1.0.0-beta.6
Expand Down
29 changes: 25 additions & 4 deletions sdk/loadtesting/azure-resourcemanager-loadtesting/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
# Release History

## 1.1.0-beta.1 (Unreleased)
## 1.1.0 (2024-12-12)

### Features Added
- 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).

### Breaking Changes

### Bugs Fixed
#### Serialization/Deserialization change

- `Jackson` is removed from dependency and no longer supported.

##### Migration Guide

If you are using `Jackson`/`ObjectMapper` for manual serialization/deserialization, configure your `ObjectMapper` for backward compatibility:
```java
objectMapper.registerModule(com.azure.core.serializer.json.jackson.JacksonJsonProvider.getJsonSerializableDatabindModule());
```

#### `models.OutboundEnvironmentEndpointCollection` was removed

#### `models.QuotaResourceList` was removed

#### `models.LoadTestResourcePageList` was removed

### Features Added

* `models.LoadTestResourceListResult` was added

* `models.QuotaResourceListResult` was added

### Other Changes
* `models.PagedOutboundEnvironmentEndpoint` was added

## 1.0.0 (2023-02-01)

Expand Down
176 changes: 9 additions & 167 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</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand All @@ -45,17 +45,13 @@ Azure Management Libraries require a `TokenCredential` implementation for authen

### Authentication

By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables.
Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package.

- `AZURE_CLIENT_ID` for Azure client ID.
- `AZURE_TENANT_ID` for Azure tenant ID.
- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate.
Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable.

In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable.
Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code:

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 +70,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 All @@ -251,12 +90,15 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
<!-- LINKS -->
[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS
[docs]: https://azure.github.io/azure-sdk-for-java/
[jdk]: https://docs.microsoft.com/java/azure/jdk/
[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/
[azure_subscription]: https://azure.microsoft.com/free/
[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity
[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials
[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty
[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md
[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md
[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md
[coc]: https://opensource.microsoft.com/codeofconduct/
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Floadtesting%2Fazure-resourcemanager-loadtesting%2FREADME.png)
Loading

0 comments on commit 55c1313

Please sign in to comment.