Skip to content

Commit 29bbaf6

Browse files
authored
[Automation] Generate Fluent Lite from help#package-2023-01-01-preview (Azure#34913)
* [Automation] External Change * [Automation] Generate Fluent Lite from help#package-2023-01-01-preview
1 parent c6525b9 commit 29bbaf6

File tree

80 files changed

+6816
-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.

80 files changed

+6816
-0
lines changed

eng/mgmt/automation/api-specs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ eventhub:
4949
suffix: generated
5050
graphservicesprod:
5151
service: graphservices
52+
help:
53+
service: selfhelp
5254
hybridaks:
5355
service: hybridcontainerservice
5456
keyvault:

eng/versioning/version_client.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ com.azure.resourcemanager:azure-resourcemanager-graphservices;1.0.0-beta.1;1.0.0
410410
com.azure.resourcemanager:azure-resourcemanager-paloaltonetworks-ngfw;1.0.0-beta.1;1.0.0-beta.2
411411
com.azure.resourcemanager:azure-resourcemanager-newrelicobservability;1.0.0-beta.2;1.0.0-beta.3
412412
com.azure.resourcemanager:azure-resourcemanager-qumulo;1.0.0-beta.1;1.0.0-beta.2
413+
com.azure.resourcemanager:azure-resourcemanager-selfhelp;1.0.0-beta.1;1.0.0-beta.1
413414
com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1
414415
com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2
415416

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@
159159
<module>sdk/security</module>
160160
<module>sdk/securitydevops</module>
161161
<module>sdk/securityinsights</module>
162+
<module>sdk/selfhelp</module>
162163
<module>sdk/servicebus</module>
163164
<module>sdk/servicefabric</module>
164165
<module>sdk/servicelinker</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 (2023-05-12)
4+
5+
- Azure Resource Manager Self Help client library for Java. This package contains Microsoft Azure SDK for Self Help Management SDK. Help RP provider. Package tag package-2023-01-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: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Azure Resource Manager Self Help client library for Java
2+
3+
Azure Resource Manager Self Help client library for Java.
4+
5+
This package contains Microsoft Azure SDK for Self Help Management SDK. Help RP provider. Package tag package-2023-01-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-selfhelp;current})
31+
```xml
32+
<dependency>
33+
<groupId>com.azure.resourcemanager</groupId>
34+
<artifactId>azure-resourcemanager-selfhelp</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] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation.
45+
46+
### Authentication
47+
48+
By default, Azure Active Directory token authentication depends on correct configuration of the 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 `AZURE_SUBSCRIPTION_ID` environment variable.
55+
56+
With above configuration, `azure` client can be authenticated using the 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+
SelfHelpManager manager = SelfHelpManager
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/selfhelp/azure-resourcemanager-selfhelp/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][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.
91+
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.
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
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: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# Code snippets and samples
2+
3+
4+
## Diagnostics
5+
6+
- [CheckNameAvailability](#diagnostics_checknameavailability)
7+
- [Create](#diagnostics_create)
8+
- [Get](#diagnostics_get)
9+
10+
## DiscoverySolution
11+
12+
- [List](#discoverysolution_list)
13+
14+
## Operations
15+
16+
- [List](#operations_list)
17+
### Diagnostics_CheckNameAvailability
18+
19+
```java
20+
import com.azure.resourcemanager.selfhelp.models.CheckNameAvailabilityRequest;
21+
22+
/** Samples for Diagnostics CheckNameAvailability. */
23+
public final class DiagnosticsCheckNameAvailabilitySamples {
24+
/*
25+
* x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/CheckNameAvailabilityForDiagnosticWhenNameIsNotAvailable.json
26+
*/
27+
/**
28+
* Sample code: Example when name is not available for a Diagnostic resource.
29+
*
30+
* @param manager Entry point to SelfHelpManager.
31+
*/
32+
public static void exampleWhenNameIsNotAvailableForADiagnosticResource(
33+
com.azure.resourcemanager.selfhelp.SelfHelpManager manager) {
34+
manager
35+
.diagnostics()
36+
.checkNameAvailabilityWithResponse(
37+
"subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6",
38+
new CheckNameAvailabilityRequest().withName("sampleName").withType("Microsoft.Help/diagnostics"),
39+
com.azure.core.util.Context.NONE);
40+
}
41+
42+
/*
43+
* x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/CheckNameAvailabilityForDiagnosticWhenNameIsAvailable.json
44+
*/
45+
/**
46+
* Sample code: Example when name is available for a Diagnostic resource.
47+
*
48+
* @param manager Entry point to SelfHelpManager.
49+
*/
50+
public static void exampleWhenNameIsAvailableForADiagnosticResource(
51+
com.azure.resourcemanager.selfhelp.SelfHelpManager manager) {
52+
manager
53+
.diagnostics()
54+
.checkNameAvailabilityWithResponse(
55+
"subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6",
56+
new CheckNameAvailabilityRequest().withName("sampleName").withType("Microsoft.Help/diagnostics"),
57+
com.azure.core.util.Context.NONE);
58+
}
59+
}
60+
```
61+
62+
### Diagnostics_Create
63+
64+
```java
65+
/** Samples for Diagnostics Create. */
66+
public final class DiagnosticsCreateSamples {
67+
/*
68+
* x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/CreateDiagnosticForKeyVaultResource.json
69+
*/
70+
/**
71+
* Sample code: Creates a Diagnostic for a KeyVault resource.
72+
*
73+
* @param manager Entry point to SelfHelpManager.
74+
*/
75+
public static void createsADiagnosticForAKeyVaultResource(
76+
com.azure.resourcemanager.selfhelp.SelfHelpManager manager) {
77+
manager
78+
.diagnostics()
79+
.define("VMNotWorkingInsight")
80+
.withExistingScope(
81+
"subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read")
82+
.create();
83+
}
84+
}
85+
```
86+
87+
### Diagnostics_Get
88+
89+
```java
90+
/** Samples for Diagnostics Get. */
91+
public final class DiagnosticsGetSamples {
92+
/*
93+
* x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/GetDiagnosticForKeyVaultResource.json
94+
*/
95+
/**
96+
* Sample code: Gets a Diagnostic for a KeyVault resource.
97+
*
98+
* @param manager Entry point to SelfHelpManager.
99+
*/
100+
public static void getsADiagnosticForAKeyVaultResource(com.azure.resourcemanager.selfhelp.SelfHelpManager manager) {
101+
manager
102+
.diagnostics()
103+
.getWithResponse(
104+
"subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read",
105+
"VMNotWorkingInsight",
106+
com.azure.core.util.Context.NONE);
107+
}
108+
}
109+
```
110+
111+
### DiscoverySolution_List
112+
113+
```java
114+
/** Samples for DiscoverySolution List. */
115+
public final class DiscoverySolutionListSamples {
116+
/*
117+
* x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/ListDiscoverySolutionsForKeyVaultResource.json
118+
*/
119+
/**
120+
* Sample code: List DiscoverySolutions for a KeyVault resource.
121+
*
122+
* @param manager Entry point to SelfHelpManager.
123+
*/
124+
public static void listDiscoverySolutionsForAKeyVaultResource(
125+
com.azure.resourcemanager.selfhelp.SelfHelpManager manager) {
126+
manager
127+
.discoverySolutions()
128+
.list(
129+
"subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read",
130+
null,
131+
null,
132+
com.azure.core.util.Context.NONE);
133+
}
134+
}
135+
```
136+
137+
### Operations_List
138+
139+
```java
140+
/** Samples for Operations List. */
141+
public final class OperationsListSamples {
142+
/*
143+
* x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/ListOperations.json
144+
*/
145+
/**
146+
* Sample code: List All Operations.
147+
*
148+
* @param manager Entry point to SelfHelpManager.
149+
*/
150+
public static void listAllOperations(com.azure.resourcemanager.selfhelp.SelfHelpManager manager) {
151+
manager.operations().list(com.azure.core.util.Context.NONE);
152+
}
153+
}
154+
```
155+
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<!--
2+
~ Copyright (c) Microsoft Corporation. All rights reserved.
3+
~ Licensed under the MIT License.
4+
~ Code generated by Microsoft (R) AutoRest Code Generator.
5+
-->
6+
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
7+
<modelVersion>4.0.0</modelVersion>
8+
<parent>
9+
<groupId>com.azure</groupId>
10+
<artifactId>azure-client-sdk-parent</artifactId>
11+
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} -->
12+
<relativePath>../../parents/azure-client-sdk-parent</relativePath>
13+
</parent>
14+
15+
<groupId>com.azure.resourcemanager</groupId>
16+
<artifactId>azure-resourcemanager-selfhelp</artifactId>
17+
<version>1.0.0-beta.1</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-selfhelp;current} -->
18+
<packaging>jar</packaging>
19+
20+
<name>Microsoft Azure SDK for Self Help Management</name>
21+
<description>This package contains Microsoft Azure SDK for Self Help Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Help RP provider. Package tag package-2023-01-01-preview.</description>
22+
<url>https://github.com/Azure/azure-sdk-for-java</url>
23+
24+
<licenses>
25+
<license>
26+
<name>The MIT License (MIT)</name>
27+
<url>http://opensource.org/licenses/MIT</url>
28+
<distribution>repo</distribution>
29+
</license>
30+
</licenses>
31+
32+
<scm>
33+
<url>https://github.com/Azure/azure-sdk-for-java</url>
34+
<connection>scm:git:git@github.com:Azure/azure-sdk-for-java.git</connection>
35+
<developerConnection>scm:git:git@github.com:Azure/azure-sdk-for-java.git</developerConnection>
36+
<tag>HEAD</tag>
37+
</scm>
38+
<developers>
39+
<developer>
40+
<id>microsoft</id>
41+
<name>Microsoft</name>
42+
</developer>
43+
</developers>
44+
<properties>
45+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
46+
<jacoco.min.linecoverage>0</jacoco.min.linecoverage>
47+
<jacoco.min.branchcoverage>0</jacoco.min.branchcoverage>
48+
</properties>
49+
<dependencies>
50+
<dependency>
51+
<groupId>com.azure</groupId>
52+
<artifactId>azure-core</artifactId>
53+
<version>1.39.0</version> <!-- {x-version-update;com.azure:azure-core;dependency} -->
54+
</dependency>
55+
<dependency>
56+
<groupId>com.azure</groupId>
57+
<artifactId>azure-core-management</artifactId>
58+
<version>1.11.1</version> <!-- {x-version-update;com.azure:azure-core-management;dependency} -->
59+
</dependency>
60+
<dependency>
61+
<groupId>com.azure</groupId>
62+
<artifactId>azure-core-test</artifactId>
63+
<version>1.17.0</version> <!-- {x-version-update;com.azure:azure-core-test;dependency} -->
64+
<scope>test</scope>
65+
</dependency>
66+
<dependency>
67+
<groupId>com.azure</groupId>
68+
<artifactId>azure-identity</artifactId>
69+
<version>1.9.0</version> <!-- {x-version-update;com.azure:azure-identity;dependency} -->
70+
<scope>test</scope>
71+
</dependency>
72+
<dependency>
73+
<groupId>org.junit.jupiter</groupId>
74+
<artifactId>junit-jupiter-api</artifactId>
75+
<version>5.9.1</version> <!-- {x-version-update;org.junit.jupiter:junit-jupiter-api;external_dependency} -->
76+
<scope>test</scope>
77+
</dependency>
78+
<dependency>
79+
<groupId>org.junit.jupiter</groupId>
80+
<artifactId>junit-jupiter-engine</artifactId>
81+
<version>5.9.1</version> <!-- {x-version-update;org.junit.jupiter:junit-jupiter-engine;external_dependency} -->
82+
<scope>test</scope>
83+
</dependency>
84+
<dependency>
85+
<groupId>org.mockito</groupId>
86+
<artifactId>mockito-core</artifactId>
87+
<version>4.11.0</version> <!-- {x-version-update;org.mockito:mockito-core;external_dependency} -->
88+
<scope>test</scope>
89+
</dependency>
90+
<dependency>
91+
<groupId>org.slf4j</groupId>
92+
<artifactId>slf4j-simple</artifactId>
93+
<version>1.7.36</version> <!-- {x-version-update;org.slf4j:slf4j-simple;external_dependency} -->
94+
<scope>test</scope>
95+
</dependency>
96+
</dependencies>
97+
</project>

0 commit comments

Comments
 (0)