Skip to content

Commit 3f7f1c6

Browse files
author
SDKAuto
committed
CodeGen from PR 16973 in Azure/azure-rest-api-specs
Merge 1ce8948d9a38b427668a1a82031d35b5ae2aca8c into d90729bbada2b4f784f2737ab4b4e39693a7aab8
1 parent db3d239 commit 3f7f1c6

File tree

63 files changed

+6904
-0
lines changed

Some content is hidden

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

63 files changed

+6904
-0
lines changed

eng/versioning/version_client.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ com.azure.resourcemanager:azure-resourcemanager-storagepool;1.0.0-beta.1;1.0.0-b
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
326326
com.azure.resourcemanager:azure-resourcemanager-loadtestservice;1.0.0-beta.1;1.0.0-beta.2
327+
com.azure.resourcemanager:azure-resourcemanager-servicelinker;1.0.0-beta.1;1.0.0-beta.1
327328
com.azure.tools:azure-sdk-archetype;1.0.0;1.0.0
328329

329330
# 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
@@ -822,6 +822,7 @@
822822
<module>sdk/security</module>
823823
<module>sdk/servicebus</module>
824824
<module>sdk/servicefabric</module>
825+
<module>sdk/servicelinker</module>
825826
<module>sdk/signalr</module>
826827
<module>sdk/spring</module>
827828
<module>sdk/sqlvirtualmachine</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-12-08)
4+
5+
- Azure Resource Manager servicelinker client library for Java. This package contains Microsoft Azure SDK for servicelinker Management SDK. Microsoft.ServiceLinker provider. Package tag package-2021-11-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 servicelinker client library for Java
2+
3+
Azure Resource Manager servicelinker client library for Java.
4+
5+
This package contains Microsoft Azure SDK for servicelinker Management SDK. Microsoft.ServiceLinker provider. Package tag package-2021-11-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-servicelinker;current})
31+
```xml
32+
<dependency>
33+
<groupId>com.azure.resourcemanager</groupId>
34+
<artifactId>azure-resourcemanager-servicelinker</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+
ServicelinkerManager manager = ServicelinkerManager
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/servicelinker/azure-resourcemanager-servicelinker/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: 224 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
1+
# Code snippets and samples
2+
3+
4+
## Linker
5+
6+
- [CreateOrUpdate](#linker_createorupdate)
7+
- [Delete](#linker_delete)
8+
- [Get](#linker_get)
9+
- [List](#linker_list)
10+
- [ListConfigurations](#linker_listconfigurations)
11+
- [Update](#linker_update)
12+
- [Validate](#linker_validate)
13+
### Linker_CreateOrUpdate
14+
15+
```java
16+
import com.azure.resourcemanager.servicelinker.models.SecretAuthInfo;
17+
18+
/** Samples for Linker CreateOrUpdate. */
19+
public final class LinkerCreateOrUpdateSamples {
20+
/*
21+
* x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2021-11-01-preview/examples/PutLink.json
22+
*/
23+
/**
24+
* Sample code: PutLink.
25+
*
26+
* @param manager Entry point to ServicelinkerManager.
27+
*/
28+
public static void putLink(com.azure.resourcemanager.servicelinker.ServicelinkerManager manager) {
29+
manager
30+
.linkers()
31+
.define("linkName")
32+
.withExistingResourceUri(
33+
"subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app")
34+
.withTargetId(
35+
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db")
36+
.withAuthInfo(new SecretAuthInfo().withName("name").withSecret("secret"))
37+
.create();
38+
}
39+
}
40+
```
41+
42+
### Linker_Delete
43+
44+
```java
45+
import com.azure.core.util.Context;
46+
47+
/** Samples for Linker Delete. */
48+
public final class LinkerDeleteSamples {
49+
/*
50+
* x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2021-11-01-preview/examples/DeleteLink.json
51+
*/
52+
/**
53+
* Sample code: DeleteLink.
54+
*
55+
* @param manager Entry point to ServicelinkerManager.
56+
*/
57+
public static void deleteLink(com.azure.resourcemanager.servicelinker.ServicelinkerManager manager) {
58+
manager
59+
.linkers()
60+
.delete(
61+
"subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app",
62+
"linkName",
63+
Context.NONE);
64+
}
65+
}
66+
```
67+
68+
### Linker_Get
69+
70+
```java
71+
import com.azure.core.util.Context;
72+
73+
/** Samples for Linker Get. */
74+
public final class LinkerGetSamples {
75+
/*
76+
* x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2021-11-01-preview/examples/Link.json
77+
*/
78+
/**
79+
* Sample code: Link.
80+
*
81+
* @param manager Entry point to ServicelinkerManager.
82+
*/
83+
public static void link(com.azure.resourcemanager.servicelinker.ServicelinkerManager manager) {
84+
manager
85+
.linkers()
86+
.getWithResponse(
87+
"subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app",
88+
"linkName",
89+
Context.NONE);
90+
}
91+
}
92+
```
93+
94+
### Linker_List
95+
96+
```java
97+
import com.azure.core.util.Context;
98+
99+
/** Samples for Linker List. */
100+
public final class LinkerListSamples {
101+
/*
102+
* x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2021-11-01-preview/examples/LinkList.json
103+
*/
104+
/**
105+
* Sample code: LinkList.
106+
*
107+
* @param manager Entry point to ServicelinkerManager.
108+
*/
109+
public static void linkList(com.azure.resourcemanager.servicelinker.ServicelinkerManager manager) {
110+
manager
111+
.linkers()
112+
.list(
113+
"subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app",
114+
Context.NONE);
115+
}
116+
}
117+
```
118+
119+
### Linker_ListConfigurations
120+
121+
```java
122+
import com.azure.core.util.Context;
123+
124+
/** Samples for Linker ListConfigurations. */
125+
public final class LinkerListConfigurationsSamples {
126+
/*
127+
* x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2021-11-01-preview/examples/GetConfigurations.json
128+
*/
129+
/**
130+
* Sample code: GetConfiguration.
131+
*
132+
* @param manager Entry point to ServicelinkerManager.
133+
*/
134+
public static void getConfiguration(com.azure.resourcemanager.servicelinker.ServicelinkerManager manager) {
135+
manager
136+
.linkers()
137+
.listConfigurationsWithResponse(
138+
"subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app",
139+
"linkName",
140+
Context.NONE);
141+
}
142+
}
143+
```
144+
145+
### Linker_Update
146+
147+
```java
148+
import com.azure.core.util.Context;
149+
import com.azure.resourcemanager.servicelinker.models.LinkerResource;
150+
import com.azure.resourcemanager.servicelinker.models.ServicePrincipalSecretAuthInfo;
151+
152+
/** Samples for Linker Update. */
153+
public final class LinkerUpdateSamples {
154+
/*
155+
* x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2021-11-01-preview/examples/PatchLink.json
156+
*/
157+
/**
158+
* Sample code: PatchLink.
159+
*
160+
* @param manager Entry point to ServicelinkerManager.
161+
*/
162+
public static void patchLink(com.azure.resourcemanager.servicelinker.ServicelinkerManager manager) {
163+
LinkerResource resource =
164+
manager
165+
.linkers()
166+
.getWithResponse(
167+
"subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app",
168+
"linkName",
169+
Context.NONE)
170+
.getValue();
171+
resource
172+
.update()
173+
.withTargetId(
174+
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db")
175+
.withAuthInfo(
176+
new ServicePrincipalSecretAuthInfo().withClientId("name").withPrincipalId("id").withSecret("secret"))
177+
.apply();
178+
}
179+
}
180+
```
181+
182+
### Linker_Validate
183+
184+
```java
185+
import com.azure.core.util.Context;
186+
187+
/** Samples for Linker Validate. */
188+
public final class LinkerValidateSamples {
189+
/*
190+
* x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2021-11-01-preview/examples/ValidateLinkFailure.json
191+
*/
192+
/**
193+
* Sample code: ValidateLinkFailure.
194+
*
195+
* @param manager Entry point to ServicelinkerManager.
196+
*/
197+
public static void validateLinkFailure(com.azure.resourcemanager.servicelinker.ServicelinkerManager manager) {
198+
manager
199+
.linkers()
200+
.validate(
201+
"subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app",
202+
"linkName",
203+
Context.NONE);
204+
}
205+
206+
/*
207+
* x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2021-11-01-preview/examples/ValidateLinkSuccess.json
208+
*/
209+
/**
210+
* Sample code: ValidateLinkSuccess.
211+
*
212+
* @param manager Entry point to ServicelinkerManager.
213+
*/
214+
public static void validateLinkSuccess(com.azure.resourcemanager.servicelinker.ServicelinkerManager manager) {
215+
manager
216+
.linkers()
217+
.validate(
218+
"subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app",
219+
"linkName",
220+
Context.NONE);
221+
}
222+
}
223+
```
224+

0 commit comments

Comments
 (0)