Skip to content

Commit 7e32582

Browse files
author
SDKAuto
committed
CodeGen from PR 22204 in Azure/azure-rest-api-specs
Merge 71cdfe58074f657cb9cc677d782da78d80247b70 into c2a1aaa0440d1aec45830646c4dfc27552b0b1e3
1 parent d50e964 commit 7e32582

File tree

47 files changed

+1588
-622
lines changed

Some content is hidden

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

47 files changed

+1588
-622
lines changed

sdk/devspaces/azure-resourcemanager-devspaces/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Release History
22

3-
## 1.0.0-beta.2 (Unreleased)
3+
## 1.0.0-beta.1 (2023-01-16)
44

5+
- Azure Resource Manager DevSpaces client library for Java. This package contains Microsoft Azure SDK for DevSpaces Management SDK. Dev Spaces Client. Package tag package-2019-04-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
56

67
## 1.0.0-beta.1 (2021-04-15)
78

sdk/devspaces/azure-resourcemanager-devspaces/README.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Various documentation is available to help you get started
3232
<dependency>
3333
<groupId>com.azure.resourcemanager</groupId>
3434
<artifactId>azure-resourcemanager-devspaces</artifactId>
35-
<version>1.0.0-beta.1</version>
35+
<version>1.0.0-beta.2</version>
3636
</dependency>
3737
```
3838
[//]: # ({x-version-update-end})
@@ -41,19 +41,19 @@ Various documentation is available to help you get started
4141

4242
Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client.
4343

44-
[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation.
44+
[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation.
4545

4646
### Authentication
4747

48-
By default, Azure Active Directory token authentication depends on correct configure of following environment variables.
48+
By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables.
4949

5050
- `AZURE_CLIENT_ID` for Azure client ID.
5151
- `AZURE_TENANT_ID` for Azure tenant ID.
5252
- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate.
5353

54-
In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`.
54+
In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable.
5555

56-
With above configuration, `azure` client can be authenticated by following code:
56+
With above configuration, `azure` client can be authenticated using the following code:
5757

5858
```java
5959
AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
@@ -74,19 +74,22 @@ See [API design][design] for general introduction on design and key concepts on
7474

7575
## Examples
7676

77+
[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/devspaces/azure-resourcemanager-devspaces/SAMPLE.md)
78+
79+
7780
## Troubleshooting
7881

7982
## Next steps
8083

8184
## Contributing
8285

83-
For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md).
86+
For details on contributing to this repository, see the [contributing guide][cg].
87+
88+
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit <https://cla.microsoft.com>.
89+
90+
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA.
8491

85-
1. Fork it
86-
1. Create your feature branch (`git checkout -b my-new-feature`)
87-
1. Commit your changes (`git commit -am 'Add some feature'`)
88-
1. Push to the branch (`git push origin my-new-feature`)
89-
1. Create new Pull Request
92+
This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact <opencode@microsoft.com> with any additional questions or comments.
9093

9194
<!-- LINKS -->
9295
[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS
@@ -97,3 +100,6 @@ For details on contributing to this repository, see the [contributing guide](htt
97100
[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty
98101
[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md
99102
[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md
103+
[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md
104+
[coc]: https://opensource.microsoft.com/codeofconduct/
105+
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
Lines changed: 244 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,244 @@
1+
# Code snippets and samples
2+
3+
4+
## ContainerHostMappings
5+
6+
- [GetContainerHostMapping](#containerhostmappings_getcontainerhostmapping)
7+
8+
## Controllers
9+
10+
- [Create](#controllers_create)
11+
- [Delete](#controllers_delete)
12+
- [GetByResourceGroup](#controllers_getbyresourcegroup)
13+
- [List](#controllers_list)
14+
- [ListByResourceGroup](#controllers_listbyresourcegroup)
15+
- [ListConnectionDetails](#controllers_listconnectiondetails)
16+
- [Update](#controllers_update)
17+
### ContainerHostMappings_GetContainerHostMapping
18+
19+
```java
20+
import com.azure.resourcemanager.devspaces.fluent.models.ContainerHostMappingInner;
21+
22+
/** Samples for ContainerHostMappings GetContainerHostMapping. */
23+
public final class ContainerHostMappingsGetContainerHostMappingSamples {
24+
/*
25+
* x-ms-original-file: specification/devspaces/resource-manager/Microsoft.DevSpaces/stable/2019-04-01/examples/ContainerHostMappingsGetContainerHostMapping_example.json
26+
*/
27+
/**
28+
* Sample code: ContainerHostMappingsGetContainerHostMapping.
29+
*
30+
* @param manager Entry point to DevSpacesManager.
31+
*/
32+
public static void containerHostMappingsGetContainerHostMapping(
33+
com.azure.resourcemanager.devspaces.DevSpacesManager manager) {
34+
manager
35+
.containerHostMappings()
36+
.getContainerHostMappingWithResponse(
37+
"myResourceGroup",
38+
"eastus",
39+
new ContainerHostMappingInner()
40+
.withContainerHostResourceId(
41+
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerService/managedClusters/myCluster"),
42+
com.azure.core.util.Context.NONE);
43+
}
44+
}
45+
```
46+
47+
### Controllers_Create
48+
49+
```java
50+
import com.azure.resourcemanager.devspaces.models.Sku;
51+
import com.azure.resourcemanager.devspaces.models.SkuName;
52+
import com.azure.resourcemanager.devspaces.models.SkuTier;
53+
import java.util.HashMap;
54+
import java.util.Map;
55+
56+
/** Samples for Controllers Create. */
57+
public final class ControllersCreateSamples {
58+
/*
59+
* x-ms-original-file: specification/devspaces/resource-manager/Microsoft.DevSpaces/stable/2019-04-01/examples/ControllersCreate_example.json
60+
*/
61+
/**
62+
* Sample code: ControllersCreate.
63+
*
64+
* @param manager Entry point to DevSpacesManager.
65+
*/
66+
public static void controllersCreate(com.azure.resourcemanager.devspaces.DevSpacesManager manager) {
67+
manager
68+
.controllers()
69+
.define("myControllerResource")
70+
.withRegion("eastus")
71+
.withExistingResourceGroup("myResourceGroup")
72+
.withSku(new Sku().withName(SkuName.S1).withTier(SkuTier.STANDARD))
73+
.withTargetContainerHostResourceId(
74+
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerService/managedClusters/myCluster")
75+
.withTargetContainerHostCredentialsBase64("QmFzZTY0IEVuY29kZWQgVmFsdWUK")
76+
.withTags(mapOf())
77+
.create();
78+
}
79+
80+
@SuppressWarnings("unchecked")
81+
private static <T> Map<String, T> mapOf(Object... inputs) {
82+
Map<String, T> map = new HashMap<>();
83+
for (int i = 0; i < inputs.length; i += 2) {
84+
String key = (String) inputs[i];
85+
T value = (T) inputs[i + 1];
86+
map.put(key, value);
87+
}
88+
return map;
89+
}
90+
}
91+
```
92+
93+
### Controllers_Delete
94+
95+
```java
96+
/** Samples for Controllers Delete. */
97+
public final class ControllersDeleteSamples {
98+
/*
99+
* x-ms-original-file: specification/devspaces/resource-manager/Microsoft.DevSpaces/stable/2019-04-01/examples/ControllersDelete_example.json
100+
*/
101+
/**
102+
* Sample code: ControllersDelete.
103+
*
104+
* @param manager Entry point to DevSpacesManager.
105+
*/
106+
public static void controllersDelete(com.azure.resourcemanager.devspaces.DevSpacesManager manager) {
107+
manager.controllers().delete("myResourceGroup", "myControllerResource", com.azure.core.util.Context.NONE);
108+
}
109+
}
110+
```
111+
112+
### Controllers_GetByResourceGroup
113+
114+
```java
115+
/** Samples for Controllers GetByResourceGroup. */
116+
public final class ControllersGetByResourceGroupSamples {
117+
/*
118+
* x-ms-original-file: specification/devspaces/resource-manager/Microsoft.DevSpaces/stable/2019-04-01/examples/ControllersGet_example.json
119+
*/
120+
/**
121+
* Sample code: ControllersGet.
122+
*
123+
* @param manager Entry point to DevSpacesManager.
124+
*/
125+
public static void controllersGet(com.azure.resourcemanager.devspaces.DevSpacesManager manager) {
126+
manager
127+
.controllers()
128+
.getByResourceGroupWithResponse(
129+
"myResourceGroup", "myControllerResource", com.azure.core.util.Context.NONE);
130+
}
131+
}
132+
```
133+
134+
### Controllers_List
135+
136+
```java
137+
/** Samples for Controllers List. */
138+
public final class ControllersListSamples {
139+
/*
140+
* x-ms-original-file: specification/devspaces/resource-manager/Microsoft.DevSpaces/stable/2019-04-01/examples/ControllersList_example.json
141+
*/
142+
/**
143+
* Sample code: ControllersList.
144+
*
145+
* @param manager Entry point to DevSpacesManager.
146+
*/
147+
public static void controllersList(com.azure.resourcemanager.devspaces.DevSpacesManager manager) {
148+
manager.controllers().list(com.azure.core.util.Context.NONE);
149+
}
150+
}
151+
```
152+
153+
### Controllers_ListByResourceGroup
154+
155+
```java
156+
/** Samples for Controllers ListByResourceGroup. */
157+
public final class ControllersListByResourceGroupSamples {
158+
/*
159+
* x-ms-original-file: specification/devspaces/resource-manager/Microsoft.DevSpaces/stable/2019-04-01/examples/ControllersListByResourceGroup_example.json
160+
*/
161+
/**
162+
* Sample code: ControllersListByResourceGroup.
163+
*
164+
* @param manager Entry point to DevSpacesManager.
165+
*/
166+
public static void controllersListByResourceGroup(com.azure.resourcemanager.devspaces.DevSpacesManager manager) {
167+
manager.controllers().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE);
168+
}
169+
}
170+
```
171+
172+
### Controllers_ListConnectionDetails
173+
174+
```java
175+
import com.azure.resourcemanager.devspaces.models.ListConnectionDetailsParameters;
176+
177+
/** Samples for Controllers ListConnectionDetails. */
178+
public final class ControllersListConnectionDetailsSamples {
179+
/*
180+
* x-ms-original-file: specification/devspaces/resource-manager/Microsoft.DevSpaces/stable/2019-04-01/examples/ControllersListConnectionDetails_example.json
181+
*/
182+
/**
183+
* Sample code: ControllersListConnectionDetails.
184+
*
185+
* @param manager Entry point to DevSpacesManager.
186+
*/
187+
public static void controllersListConnectionDetails(com.azure.resourcemanager.devspaces.DevSpacesManager manager) {
188+
manager
189+
.controllers()
190+
.listConnectionDetailsWithResponse(
191+
"myResourceGroup",
192+
"myControllerResource",
193+
new ListConnectionDetailsParameters()
194+
.withTargetContainerHostResourceId(
195+
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerService/managedClusters/myCluster"),
196+
com.azure.core.util.Context.NONE);
197+
}
198+
}
199+
```
200+
201+
### Controllers_Update
202+
203+
```java
204+
import com.azure.resourcemanager.devspaces.models.Controller;
205+
import java.util.HashMap;
206+
import java.util.Map;
207+
208+
/** Samples for Controllers Update. */
209+
public final class ControllersUpdateSamples {
210+
/*
211+
* x-ms-original-file: specification/devspaces/resource-manager/Microsoft.DevSpaces/stable/2019-04-01/examples/ControllersUpdate_example.json
212+
*/
213+
/**
214+
* Sample code: ControllersUpdate.
215+
*
216+
* @param manager Entry point to DevSpacesManager.
217+
*/
218+
public static void controllersUpdate(com.azure.resourcemanager.devspaces.DevSpacesManager manager) {
219+
Controller resource =
220+
manager
221+
.controllers()
222+
.getByResourceGroupWithResponse(
223+
"myResourceGroup", "myControllerResource", com.azure.core.util.Context.NONE)
224+
.getValue();
225+
resource
226+
.update()
227+
.withTags(mapOf("key", "value"))
228+
.withTargetContainerHostCredentialsBase64("QmFzZTY0IEVuY29kZWQgVmFsdWUK")
229+
.apply();
230+
}
231+
232+
@SuppressWarnings("unchecked")
233+
private static <T> Map<String, T> mapOf(Object... inputs) {
234+
Map<String, T> map = new HashMap<>();
235+
for (int i = 0; i < inputs.length; i += 2) {
236+
String key = (String) inputs[i];
237+
T value = (T) inputs[i + 1];
238+
map.put(key, value);
239+
}
240+
return map;
241+
}
242+
}
243+
```
244+

0 commit comments

Comments
 (0)