Skip to content

Commit e01da24

Browse files
author
SDKAuto
committed
CodeGen from PR 16831 in Azure/azure-rest-api-specs
Merge 9f2cecaee84483ce0c76394f496f4ee0cbb8cc33 into b6b834584cb58a3c2cbe887570fa0942b397dfc7
1 parent 1f36a79 commit e01da24

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+5531
-0
lines changed

eng/versioning/version_client.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ com.azure.resourcemanager:azure-resourcemanager-logz;1.0.0-beta.1;1.0.0-beta.2
323323
com.azure.resourcemanager:azure-resourcemanager-storagepool;1.0.0-beta.1;1.0.0-beta.2
324324
com.azure.resourcemanager:azure-resourcemanager-dataprotection;1.0.0-beta.1;1.0.0-beta.2
325325
com.azure.resourcemanager:azure-resourcemanager-desktopvirtualization;1.0.0-beta.1;1.0.0-beta.2
326+
com.azure.resourcemanager:azure-resourcemanager-loadtestservice;1.0.0-beta.1;1.0.0-beta.1
326327
com.azure.tools:azure-sdk-archetype;1.0.0;1.0.0
327328

328329
# Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,7 @@
781781
<module>sdk/kubernetesconfiguration</module>
782782
<module>sdk/kusto</module>
783783
<module>sdk/labservices</module>
784+
<module>sdk/loadtestservice</module>
784785
<module>sdk/loganalytics</module>
785786
<module>sdk/logic</module>
786787
<module>sdk/logz</module>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Release History
2+
3+
## 1.0.0-beta.1 (2021-11-25)
4+
5+
- 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-2021-12-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Azure Resource Manager LoadTest client library for Java
2+
3+
Azure Resource Manager LoadTest client library for Java.
4+
5+
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-2021-12-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
6+
7+
## We'd love to hear your feedback
8+
9+
We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better.
10+
11+
If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together.
12+
13+
Thank you in advance for your collaboration. We really appreciate your time!
14+
15+
## Documentation
16+
17+
Various documentation is available to help you get started
18+
19+
- [API reference documentation][docs]
20+
21+
## Getting started
22+
23+
### Prerequisites
24+
25+
- [Java Development Kit (JDK)][jdk] with version 8 or above
26+
- [Azure Subscription][azure_subscription]
27+
28+
### Adding the package to your product
29+
30+
[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-loadtestservice;current})
31+
```xml
32+
<dependency>
33+
<groupId>com.azure.resourcemanager</groupId>
34+
<artifactId>azure-resourcemanager-loadtestservice</artifactId>
35+
<version>1.0.0-beta.1</version>
36+
</dependency>
37+
```
38+
[//]: # ({x-version-update-end})
39+
40+
### Include the recommended packages
41+
42+
Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client.
43+
44+
[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation.
45+
46+
### Authentication
47+
48+
By default, Azure Active Directory token authentication depends on correct configure of following environment variables.
49+
50+
- `AZURE_CLIENT_ID` for Azure client ID.
51+
- `AZURE_TENANT_ID` for Azure tenant ID.
52+
- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate.
53+
54+
In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`.
55+
56+
With above configuration, `azure` client can be authenticated by following code:
57+
58+
```java
59+
AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
60+
TokenCredential credential = new DefaultAzureCredentialBuilder()
61+
.authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
62+
.build();
63+
LoadTestManager manager = LoadTestManager
64+
.authenticate(credential, profile);
65+
```
66+
67+
The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise.
68+
69+
See [Authentication][authenticate] for more options.
70+
71+
## Key concepts
72+
73+
See [API design][design] for general introduction on design and key concepts on Azure Management Libraries.
74+
75+
## Examples
76+
77+
[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/loadtestservice/azure-resourcemanager-loadtestservice/SAMPLE.md)
78+
79+
80+
## Troubleshooting
81+
82+
## Next steps
83+
84+
## Contributing
85+
86+
For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md).
87+
88+
1. Fork it
89+
1. Create your feature branch (`git checkout -b my-new-feature`)
90+
1. Commit your changes (`git commit -am 'Add some feature'`)
91+
1. Push to the branch (`git push origin my-new-feature`)
92+
1. Create new Pull Request
93+
94+
<!-- LINKS -->
95+
[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS
96+
[docs]: https://azure.github.io/azure-sdk-for-java/
97+
[jdk]: https://docs.microsoft.com/java/azure/jdk/
98+
[azure_subscription]: https://azure.microsoft.com/free/
99+
[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity
100+
[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty
101+
[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md
102+
[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md
Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
# Code snippets and samples
2+
3+
4+
## LoadTests
5+
6+
- [CreateOrUpdate](#loadtests_createorupdate)
7+
- [Delete](#loadtests_delete)
8+
- [GetByResourceGroup](#loadtests_getbyresourcegroup)
9+
- [List](#loadtests_list)
10+
- [ListByResourceGroup](#loadtests_listbyresourcegroup)
11+
- [Update](#loadtests_update)
12+
13+
## Operations
14+
15+
- [List](#operations_list)
16+
### LoadTests_CreateOrUpdate
17+
18+
```java
19+
import java.util.HashMap;
20+
import java.util.Map;
21+
22+
/** Samples for LoadTests CreateOrUpdate. */
23+
public final class LoadTestsCreateOrUpdateSamples {
24+
/*
25+
* x-ms-original-file: specification/loadtestservice/resource-manager/Microsoft.LoadTestService/preview/2021-12-01-preview/examples/LoadTests_CreateOrUpdate.json
26+
*/
27+
/**
28+
* Sample code: LoadTests_CreateOrUpdate.
29+
*
30+
* @param manager Entry point to LoadTestManager.
31+
*/
32+
public static void loadTestsCreateOrUpdate(com.azure.resourcemanager.loadtestservice.LoadTestManager manager) {
33+
manager
34+
.loadTests()
35+
.define("myLoadTest")
36+
.withRegion("westus")
37+
.withExistingResourceGroup("dummyrg")
38+
.withTags(mapOf("Team", "Dev Exp"))
39+
.withDescription("This is new load test resource")
40+
.create();
41+
}
42+
43+
@SuppressWarnings("unchecked")
44+
private static <T> Map<String, T> mapOf(Object... inputs) {
45+
Map<String, T> map = new HashMap<>();
46+
for (int i = 0; i < inputs.length; i += 2) {
47+
String key = (String) inputs[i];
48+
T value = (T) inputs[i + 1];
49+
map.put(key, value);
50+
}
51+
return map;
52+
}
53+
}
54+
```
55+
56+
### LoadTests_Delete
57+
58+
```java
59+
import com.azure.core.util.Context;
60+
61+
/** Samples for LoadTests Delete. */
62+
public final class LoadTestsDeleteSamples {
63+
/*
64+
* x-ms-original-file: specification/loadtestservice/resource-manager/Microsoft.LoadTestService/preview/2021-12-01-preview/examples/LoadTests_Delete.json
65+
*/
66+
/**
67+
* Sample code: LoadTests_Delete.
68+
*
69+
* @param manager Entry point to LoadTestManager.
70+
*/
71+
public static void loadTestsDelete(com.azure.resourcemanager.loadtestservice.LoadTestManager manager) {
72+
manager.loadTests().delete("dummyrg", "myLoadTest", Context.NONE);
73+
}
74+
}
75+
```
76+
77+
### LoadTests_GetByResourceGroup
78+
79+
```java
80+
import com.azure.core.util.Context;
81+
82+
/** Samples for LoadTests GetByResourceGroup. */
83+
public final class LoadTestsGetByResourceGroupSamples {
84+
/*
85+
* x-ms-original-file: specification/loadtestservice/resource-manager/Microsoft.LoadTestService/preview/2021-12-01-preview/examples/LoadTests_Get.json
86+
*/
87+
/**
88+
* Sample code: LoadTests_Get.
89+
*
90+
* @param manager Entry point to LoadTestManager.
91+
*/
92+
public static void loadTestsGet(com.azure.resourcemanager.loadtestservice.LoadTestManager manager) {
93+
manager.loadTests().getByResourceGroupWithResponse("dummyrg", "myLoadTest", Context.NONE);
94+
}
95+
}
96+
```
97+
98+
### LoadTests_List
99+
100+
```java
101+
import com.azure.core.util.Context;
102+
103+
/** Samples for LoadTests List. */
104+
public final class LoadTestsListSamples {
105+
/*
106+
* x-ms-original-file: specification/loadtestservice/resource-manager/Microsoft.LoadTestService/preview/2021-12-01-preview/examples/LoadTests_ListBySubscription.json
107+
*/
108+
/**
109+
* Sample code: LoadTests_ListBySubscription.
110+
*
111+
* @param manager Entry point to LoadTestManager.
112+
*/
113+
public static void loadTestsListBySubscription(com.azure.resourcemanager.loadtestservice.LoadTestManager manager) {
114+
manager.loadTests().list(Context.NONE);
115+
}
116+
}
117+
```
118+
119+
### LoadTests_ListByResourceGroup
120+
121+
```java
122+
import com.azure.core.util.Context;
123+
124+
/** Samples for LoadTests ListByResourceGroup. */
125+
public final class LoadTestsListByResourceGroupSamples {
126+
/*
127+
* x-ms-original-file: specification/loadtestservice/resource-manager/Microsoft.LoadTestService/preview/2021-12-01-preview/examples/LoadTests_ListByResourceGroup.json
128+
*/
129+
/**
130+
* Sample code: LoadTests_ListByResourceGroup.
131+
*
132+
* @param manager Entry point to LoadTestManager.
133+
*/
134+
public static void loadTestsListByResourceGroup(com.azure.resourcemanager.loadtestservice.LoadTestManager manager) {
135+
manager.loadTests().listByResourceGroup("dummyrg", Context.NONE);
136+
}
137+
}
138+
```
139+
140+
### LoadTests_Update
141+
142+
```java
143+
import com.azure.core.management.serializer.SerializerFactory;
144+
import com.azure.core.util.Context;
145+
import com.azure.core.util.serializer.SerializerEncoding;
146+
import com.azure.resourcemanager.loadtestservice.models.LoadTestResource;
147+
import com.azure.resourcemanager.loadtestservice.models.LoadTestResourcePatchRequestBodyProperties;
148+
import java.io.IOException;
149+
150+
/** Samples for LoadTests Update. */
151+
public final class LoadTestsUpdateSamples {
152+
/*
153+
* x-ms-original-file: specification/loadtestservice/resource-manager/Microsoft.LoadTestService/preview/2021-12-01-preview/examples/LoadTests_Update.json
154+
*/
155+
/**
156+
* Sample code: LoadTests_Update.
157+
*
158+
* @param manager Entry point to LoadTestManager.
159+
*/
160+
public static void loadTestsUpdate(com.azure.resourcemanager.loadtestservice.LoadTestManager manager)
161+
throws IOException {
162+
LoadTestResource resource =
163+
manager.loadTests().getByResourceGroupWithResponse("dummyrg", "myLoadTest", Context.NONE).getValue();
164+
resource
165+
.update()
166+
.withTags(
167+
SerializerFactory
168+
.createDefaultManagementSerializerAdapter()
169+
.deserialize("{\"Division\":\"LT\",\"Team\":\"Dev Exp\"}", Object.class, SerializerEncoding.JSON))
170+
.withProperties(
171+
new LoadTestResourcePatchRequestBodyProperties().withDescription("This is new load test resource"))
172+
.apply();
173+
}
174+
}
175+
```
176+
177+
### Operations_List
178+
179+
```java
180+
import com.azure.core.util.Context;
181+
182+
/** Samples for Operations List. */
183+
public final class OperationsListSamples {
184+
/*
185+
* x-ms-original-file: specification/loadtestservice/resource-manager/Microsoft.LoadTestService/preview/2021-12-01-preview/examples/Operations_List.json
186+
*/
187+
/**
188+
* Sample code: Operations_List.
189+
*
190+
* @param manager Entry point to LoadTestManager.
191+
*/
192+
public static void operationsList(com.azure.resourcemanager.loadtestservice.LoadTestManager manager) {
193+
manager.operations().list(Context.NONE);
194+
}
195+
}
196+
```
197+

0 commit comments

Comments
 (0)