Skip to content

Commit 2d6e3b2

Browse files
author
SDKAuto
committed
CodeGen from PR 15565 in Azure/azure-rest-api-specs
Merge 940f49e2ecc092a82bd1861f0a8a3918620f753e into f1f04833e9a39e462fe78e2edd958eccc9a2e7ca
1 parent 9b4468f commit 2d6e3b2

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

+1438
-502
lines changed

sdk/loganalytics/azure-resourcemanager-loganalytics/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.3 (Unreleased)
3+
## 1.0.0-beta.1 (2021-08-09)
44

5+
- Azure Resource Manager LogAnalytics client library for Java. This package contains Microsoft Azure SDK for LogAnalytics Management SDK. Operational Insights Client. Package tag package-2020-10. 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.2 (2021-03-30)
78

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Azure Resource Manager LogAnalytics client library for Java.
44

5-
This package contains Microsoft Azure SDK for LogAnalytics Management SDK. Operational Insights Client. Package tag package-2020-08. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
5+
This package contains Microsoft Azure SDK for LogAnalytics Management SDK. Operational Insights Client. Package tag package-2020-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
66

77
## We'd love to hear your feedback
88

@@ -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-loganalytics</artifactId>
35-
<version>1.0.0-beta.2</version>
35+
<version>1.0.0-beta.3</version>
3636
</dependency>
3737
```
3838
[//]: # ({x-version-update-end})
@@ -74,6 +74,8 @@ See [API design][design] for general introduction on design and key concepts on
7474

7575
## Examples
7676

77+
78+
7779
## Troubleshooting
7880

7981
## Next steps
Lines changed: 80 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,86 @@
11
<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">
2-
<modelVersion>4.0.0</modelVersion>
3-
<parent>
4-
<groupId>com.azure</groupId>
5-
<artifactId>azure-client-sdk-parent</artifactId>
6-
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} -->
7-
<relativePath>../../parents/azure-client-sdk-parent</relativePath>
8-
</parent>
2+
<modelVersion>4.0.0</modelVersion>
3+
<parent>
4+
<groupId>com.azure</groupId>
5+
<artifactId>azure-client-sdk-parent</artifactId>
6+
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} -->
7+
<relativePath>../../parents/azure-client-sdk-parent</relativePath>
8+
</parent>
99

10-
<groupId>com.azure.resourcemanager</groupId>
11-
<artifactId>azure-resourcemanager-loganalytics</artifactId>
12-
<version>1.0.0-beta.3</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-loganalytics;current} -->
13-
<packaging>jar</packaging>
10+
<groupId>com.azure.resourcemanager</groupId>
11+
<artifactId>azure-resourcemanager-loganalytics</artifactId>
12+
<version>1.0.0-beta.3</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-loganalytics;current} -->
13+
<packaging>jar</packaging>
1414

15-
<name>Microsoft Azure SDK for LogAnalytics Management</name>
16-
<description>This package contains Microsoft Azure SDK for LogAnalytics Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Operational Insights Client. Package tag package-2020-08.</description>
17-
<url>https://github.com/Azure/azure-sdk-for-java</url>
15+
<name>Microsoft Azure SDK for LogAnalytics Management</name>
16+
<description>This package contains Microsoft Azure SDK for LogAnalytics Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Operational Insights Client. Package tag package-2020-10.</description>
17+
<url>https://github.com/Azure/azure-sdk-for-java</url>
1818

19-
<licenses>
20-
<license>
21-
<name>The MIT License (MIT)</name>
22-
<url>http://opensource.org/licenses/MIT</url>
23-
<distribution>repo</distribution>
24-
</license>
25-
</licenses>
19+
<licenses>
20+
<license>
21+
<name>The MIT License (MIT)</name>
22+
<url>http://opensource.org/licenses/MIT</url>
23+
<distribution>repo</distribution>
24+
</license>
25+
</licenses>
2626

27-
<scm>
28-
<url>https://github.com/Azure/azure-sdk-for-java</url>
29-
<connection>scm:git:git@github.com:Azure/azure-sdk-for-java.git</connection>
30-
<developerConnection>scm:git:git@github.com:Azure/azure-sdk-for-java.git</developerConnection>
31-
<tag>HEAD</tag>
32-
</scm>
33-
<developers>
34-
<developer>
35-
<id>microsoft</id>
36-
<name>Microsoft</name>
37-
</developer>
38-
</developers>
39-
<properties>
40-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
41-
<legal><![CDATA[[INFO] Any downloads listed may be third party software. Microsoft grants you no rights for third party software.]]></legal>
42-
</properties>
43-
<dependencies>
44-
<dependency>
45-
<groupId>com.azure</groupId>
46-
<artifactId>azure-core</artifactId>
47-
<version>1.19.0</version> <!-- {x-version-update;com.azure:azure-core;dependency} -->
48-
</dependency>
49-
<dependency>
50-
<groupId>com.azure</groupId>
51-
<artifactId>azure-core-management</artifactId>
52-
<version>1.4.0</version> <!-- {x-version-update;com.azure:azure-core-management;dependency} -->
53-
</dependency>
54-
</dependencies>
55-
<build>
56-
<plugins>
57-
<plugin>
58-
<groupId>org.jacoco</groupId>
59-
<artifactId>jacoco-maven-plugin</artifactId>
60-
<version>0.8.5</version> <!-- {x-version-update;org.jacoco:jacoco-maven-plugin;external_dependency} -->
61-
<configuration>
62-
<skip>true</skip>
63-
</configuration>
64-
</plugin>
65-
</plugins>
66-
</build>
27+
<scm>
28+
<url>https://github.com/Azure/azure-sdk-for-java</url>
29+
<connection>scm:git:git@github.com:Azure/azure-sdk-for-java.git</connection>
30+
<developerConnection>scm:git:git@github.com:Azure/azure-sdk-for-java.git</developerConnection>
31+
<tag>HEAD</tag>
32+
</scm>
33+
<developers>
34+
<developer>
35+
<id>microsoft</id>
36+
<name>Microsoft</name>
37+
</developer>
38+
</developers>
39+
<properties>
40+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
41+
<legal><![CDATA[[INFO] Any downloads listed may be third party software. Microsoft grants you no rights for third party software.]]></legal>
42+
</properties>
43+
<dependencies>
44+
<dependency>
45+
<groupId>com.azure</groupId>
46+
<artifactId>azure-core</artifactId>
47+
<version>1.19.0</version> <!-- {x-version-update;com.azure:azure-core;dependency} -->
48+
</dependency>
49+
<dependency>
50+
<groupId>com.azure</groupId>
51+
<artifactId>azure-core-management</artifactId>
52+
<version>1.4.0</version> <!-- {x-version-update;com.azure:azure-core-management;dependency} -->
53+
</dependency>
54+
</dependencies>
55+
<build>
56+
<plugins>
57+
<plugin>
58+
<groupId>org.jacoco</groupId>
59+
<artifactId>jacoco-maven-plugin</artifactId>
60+
<version>0.8.5</version> <!-- {x-version-update;org.jacoco:jacoco-maven-plugin;external_dependency} -->
61+
<configuration>
62+
<skip>true</skip>
63+
</configuration>
64+
</plugin>
65+
<plugin>
66+
<groupId>org.revapi</groupId>
67+
<artifactId>revapi-maven-plugin</artifactId>
68+
<version>0.11.2</version> <!-- {x-version-update;org.revapi:revapi-maven-plugin;external_dependency} -->
69+
<configuration>
70+
<analysisConfiguration>
71+
<revapi.ignore>
72+
<item>
73+
<code>java.method.addedToInterface</code>
74+
</item>
75+
<item>
76+
<regex>true</regex>
77+
<code>.*</code>
78+
<package>com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)*</package>
79+
</item>
80+
</revapi.ignore>
81+
</analysisConfiguration>
82+
</configuration>
83+
</plugin>
84+
</plugins>
85+
</build>
6786
</project>

sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/LogAnalyticsManager.java

Lines changed: 59 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
import com.azure.core.http.HttpPipeline;
1010
import com.azure.core.http.HttpPipelineBuilder;
1111
import com.azure.core.http.policy.AddDatePolicy;
12-
import com.azure.core.http.policy.BearerTokenAuthenticationPolicy;
1312
import com.azure.core.http.policy.HttpLogOptions;
1413
import com.azure.core.http.policy.HttpLoggingPolicy;
1514
import com.azure.core.http.policy.HttpPipelinePolicy;
1615
import com.azure.core.http.policy.HttpPolicyProviders;
1716
import com.azure.core.http.policy.RequestIdPolicy;
1817
import com.azure.core.http.policy.RetryPolicy;
1918
import com.azure.core.http.policy.UserAgentPolicy;
19+
import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
2020
import com.azure.core.management.profile.AzureProfile;
2121
import com.azure.core.util.Configuration;
2222
import com.azure.core.util.logging.ClientLogger;
@@ -82,20 +82,12 @@ public final class LogAnalyticsManager {
8282

8383
private ManagementGroups managementGroups;
8484

85-
private Operations operations;
86-
8785
private OperationStatuses operationStatuses;
8886

8987
private SharedKeysOperations sharedKeysOperations;
9088

9189
private Usages usages;
9290

93-
private Workspaces workspaces;
94-
95-
private DeletedWorkspaces deletedWorkspaces;
96-
97-
private Clusters clusters;
98-
9991
private StorageInsightConfigs storageInsightConfigs;
10092

10193
private SavedSearches savedSearches;
@@ -110,6 +102,14 @@ public final class LogAnalyticsManager {
110102

111103
private Tables tables;
112104

105+
private Clusters clusters;
106+
107+
private Operations operations;
108+
109+
private Workspaces workspaces;
110+
111+
private DeletedWorkspaces deletedWorkspaces;
112+
113113
private final OperationalInsightsManagementClient clientObject;
114114

115115
private LogAnalyticsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) {
@@ -153,6 +153,7 @@ public static final class Configurable {
153153
private HttpClient httpClient;
154154
private HttpLogOptions httpLogOptions;
155155
private final List<HttpPipelinePolicy> policies = new ArrayList<>();
156+
private final List<String> scopes = new ArrayList<>();
156157
private RetryPolicy retryPolicy;
157158
private Duration defaultPollInterval;
158159

@@ -192,6 +193,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) {
192193
return this;
193194
}
194195

196+
/**
197+
* Adds the scope to permission sets.
198+
*
199+
* @param scope the scope.
200+
* @return the configurable object itself.
201+
*/
202+
public Configurable withScope(String scope) {
203+
this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null."));
204+
return this;
205+
}
206+
195207
/**
196208
* Sets the retry policy to the HTTP pipeline.
197209
*
@@ -234,7 +246,7 @@ public LogAnalyticsManager authenticate(TokenCredential credential, AzureProfile
234246
.append("-")
235247
.append("com.azure.resourcemanager.loganalytics")
236248
.append("/")
237-
.append("1.0.0-beta.2");
249+
.append("1.0.0-beta.1");
238250
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
239251
userAgentBuilder
240252
.append(" (")
@@ -248,6 +260,9 @@ public LogAnalyticsManager authenticate(TokenCredential credential, AzureProfile
248260
userAgentBuilder.append(" (auto-generated)");
249261
}
250262

263+
if (scopes.isEmpty()) {
264+
scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
265+
}
251266
if (retryPolicy == null) {
252267
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
253268
}
@@ -257,10 +272,8 @@ public LogAnalyticsManager authenticate(TokenCredential credential, AzureProfile
257272
HttpPolicyProviders.addBeforeRetryPolicies(policies);
258273
policies.add(retryPolicy);
259274
policies.add(new AddDatePolicy());
260-
policies
261-
.add(
262-
new BearerTokenAuthenticationPolicy(
263-
credential, profile.getEnvironment().getManagementEndpoint() + "/.default"));
275+
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
276+
policies.addAll(this.policies);
264277
HttpPolicyProviders.addAfterRetryPolicies(policies);
265278
policies.add(new HttpLoggingPolicy(httpLogOptions));
266279
HttpPipeline httpPipeline =
@@ -320,14 +333,6 @@ public ManagementGroups managementGroups() {
320333
return managementGroups;
321334
}
322335

323-
/** @return Resource collection API of Operations. */
324-
public Operations operations() {
325-
if (this.operations == null) {
326-
this.operations = new OperationsImpl(clientObject.getOperations(), this);
327-
}
328-
return operations;
329-
}
330-
331336
/** @return Resource collection API of OperationStatuses. */
332337
public OperationStatuses operationStatuses() {
333338
if (this.operationStatuses == null) {
@@ -352,30 +357,6 @@ public Usages usages() {
352357
return usages;
353358
}
354359

355-
/** @return Resource collection API of Workspaces. */
356-
public Workspaces workspaces() {
357-
if (this.workspaces == null) {
358-
this.workspaces = new WorkspacesImpl(clientObject.getWorkspaces(), this);
359-
}
360-
return workspaces;
361-
}
362-
363-
/** @return Resource collection API of DeletedWorkspaces. */
364-
public DeletedWorkspaces deletedWorkspaces() {
365-
if (this.deletedWorkspaces == null) {
366-
this.deletedWorkspaces = new DeletedWorkspacesImpl(clientObject.getDeletedWorkspaces(), this);
367-
}
368-
return deletedWorkspaces;
369-
}
370-
371-
/** @return Resource collection API of Clusters. */
372-
public Clusters clusters() {
373-
if (this.clusters == null) {
374-
this.clusters = new ClustersImpl(clientObject.getClusters(), this);
375-
}
376-
return clusters;
377-
}
378-
379360
/** @return Resource collection API of StorageInsightConfigs. */
380361
public StorageInsightConfigs storageInsightConfigs() {
381362
if (this.storageInsightConfigs == null) {
@@ -432,6 +413,38 @@ public Tables tables() {
432413
return tables;
433414
}
434415

416+
/** @return Resource collection API of Clusters. */
417+
public Clusters clusters() {
418+
if (this.clusters == null) {
419+
this.clusters = new ClustersImpl(clientObject.getClusters(), this);
420+
}
421+
return clusters;
422+
}
423+
424+
/** @return Resource collection API of Operations. */
425+
public Operations operations() {
426+
if (this.operations == null) {
427+
this.operations = new OperationsImpl(clientObject.getOperations(), this);
428+
}
429+
return operations;
430+
}
431+
432+
/** @return Resource collection API of Workspaces. */
433+
public Workspaces workspaces() {
434+
if (this.workspaces == null) {
435+
this.workspaces = new WorkspacesImpl(clientObject.getWorkspaces(), this);
436+
}
437+
return workspaces;
438+
}
439+
440+
/** @return Resource collection API of DeletedWorkspaces. */
441+
public DeletedWorkspaces deletedWorkspaces() {
442+
if (this.deletedWorkspaces == null) {
443+
this.deletedWorkspaces = new DeletedWorkspacesImpl(clientObject.getDeletedWorkspaces(), this);
444+
}
445+
return deletedWorkspaces;
446+
}
447+
435448
/**
436449
* @return Wrapped service client OperationalInsightsManagementClient providing direct access to the underlying
437450
* auto-generated API implementation, based on Azure REST API.

0 commit comments

Comments
 (0)