Skip to content

Commit bd75be4

Browse files
author
SDKAuto
committed
CodeGen from PR 14749 in Azure/azure-rest-api-specs
Merge 6a5f970e9f7e2ed91bf0c11289daa8743f28e131 into 682c9680fd6ac7746d701bcf0c69948a3199671a
1 parent c859ce8 commit bd75be4

File tree

96 files changed

+12882
-245
lines changed

Some content is hidden

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

96 files changed

+12882
-245
lines changed

sdk/servicefabric/azure-resourcemanager-servicefabric/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 (2021-07-30)
44

5+
- Azure Resource Manager ServiceFabric client library for Java. This package contains Microsoft Azure SDK for ServiceFabric Management SDK. Service Fabric Management Client. Package tag package-2020-03. 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-16)
78

sdk/servicefabric/azure-resourcemanager-servicefabric/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 ServiceFabric client library for Java.
44

5-
This package contains Microsoft Azure SDK for ServiceFabric Management SDK. Service Fabric Management Client. Package tag package-2019-03. 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 ServiceFabric Management SDK. Service Fabric Management Client. Package tag package-2020-03. 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-servicefabric</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})
@@ -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-servicefabric</artifactId>
12-
<version>1.0.0-beta.2</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-servicefabric;current} -->
13-
<packaging>jar</packaging>
10+
<groupId>com.azure.resourcemanager</groupId>
11+
<artifactId>azure-resourcemanager-servicefabric</artifactId>
12+
<version>1.0.0-beta.2</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-servicefabric;current} -->
13+
<packaging>jar</packaging>
1414

15-
<name>Microsoft Azure SDK for ServiceFabric Management</name>
16-
<description>This package contains Microsoft Azure SDK for ServiceFabric Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Service Fabric Management Client. Package tag package-2019-03.</description>
17-
<url>https://github.com/Azure/azure-sdk-for-java</url>
15+
<name>Microsoft Azure SDK for ServiceFabric Management</name>
16+
<description>This package contains Microsoft Azure SDK for ServiceFabric Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Service Fabric Management Client. Package tag package-2020-03.</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.18.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.3.1</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.18.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.3.1</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/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/ServiceFabricManager.java

Lines changed: 54 additions & 5 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;
@@ -26,6 +26,9 @@
2626
import com.azure.resourcemanager.servicefabric.implementation.ApplicationsImpl;
2727
import com.azure.resourcemanager.servicefabric.implementation.ClusterVersionsImpl;
2828
import com.azure.resourcemanager.servicefabric.implementation.ClustersImpl;
29+
import com.azure.resourcemanager.servicefabric.implementation.ManagedClusterVersionsImpl;
30+
import com.azure.resourcemanager.servicefabric.implementation.ManagedClustersImpl;
31+
import com.azure.resourcemanager.servicefabric.implementation.NodeTypesImpl;
2932
import com.azure.resourcemanager.servicefabric.implementation.OperationsImpl;
3033
import com.azure.resourcemanager.servicefabric.implementation.ServiceFabricManagementClientBuilder;
3134
import com.azure.resourcemanager.servicefabric.implementation.ServicesImpl;
@@ -34,6 +37,9 @@
3437
import com.azure.resourcemanager.servicefabric.models.Applications;
3538
import com.azure.resourcemanager.servicefabric.models.ClusterVersions;
3639
import com.azure.resourcemanager.servicefabric.models.Clusters;
40+
import com.azure.resourcemanager.servicefabric.models.ManagedClusterVersions;
41+
import com.azure.resourcemanager.servicefabric.models.ManagedClusters;
42+
import com.azure.resourcemanager.servicefabric.models.NodeTypes;
3743
import com.azure.resourcemanager.servicefabric.models.Operations;
3844
import com.azure.resourcemanager.servicefabric.models.Services;
3945
import java.time.Duration;
@@ -58,6 +64,12 @@ public final class ServiceFabricManager {
5864

5965
private Services services;
6066

67+
private ManagedClusters managedClusters;
68+
69+
private ManagedClusterVersions managedClusterVersions;
70+
71+
private NodeTypes nodeTypes;
72+
6173
private final ServiceFabricManagementClient clientObject;
6274

6375
private ServiceFabricManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) {
@@ -101,6 +113,7 @@ public static final class Configurable {
101113
private HttpClient httpClient;
102114
private HttpLogOptions httpLogOptions;
103115
private final List<HttpPipelinePolicy> policies = new ArrayList<>();
116+
private final List<String> scopes = new ArrayList<>();
104117
private RetryPolicy retryPolicy;
105118
private Duration defaultPollInterval;
106119

@@ -140,6 +153,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) {
140153
return this;
141154
}
142155

156+
/**
157+
* Adds the scope to permission sets.
158+
*
159+
* @param scope the scope.
160+
* @return the configurable object itself.
161+
*/
162+
public Configurable withScope(String scope) {
163+
this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null."));
164+
return this;
165+
}
166+
143167
/**
144168
* Sets the retry policy to the HTTP pipeline.
145169
*
@@ -196,6 +220,9 @@ public ServiceFabricManager authenticate(TokenCredential credential, AzureProfil
196220
userAgentBuilder.append(" (auto-generated)");
197221
}
198222

223+
if (scopes.isEmpty()) {
224+
scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
225+
}
199226
if (retryPolicy == null) {
200227
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
201228
}
@@ -205,10 +232,7 @@ public ServiceFabricManager authenticate(TokenCredential credential, AzureProfil
205232
HttpPolicyProviders.addBeforeRetryPolicies(policies);
206233
policies.add(retryPolicy);
207234
policies.add(new AddDatePolicy());
208-
policies
209-
.add(
210-
new BearerTokenAuthenticationPolicy(
211-
credential, profile.getEnvironment().getManagementEndpoint() + "/.default"));
235+
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
212236
policies.addAll(this.policies);
213237
HttpPolicyProviders.addAfterRetryPolicies(policies);
214238
policies.add(new HttpLoggingPolicy(httpLogOptions));
@@ -278,6 +302,31 @@ public Services services() {
278302
return services;
279303
}
280304

305+
/** @return Resource collection API of ManagedClusters. */
306+
public ManagedClusters managedClusters() {
307+
if (this.managedClusters == null) {
308+
this.managedClusters = new ManagedClustersImpl(clientObject.getManagedClusters(), this);
309+
}
310+
return managedClusters;
311+
}
312+
313+
/** @return Resource collection API of ManagedClusterVersions. */
314+
public ManagedClusterVersions managedClusterVersions() {
315+
if (this.managedClusterVersions == null) {
316+
this.managedClusterVersions =
317+
new ManagedClusterVersionsImpl(clientObject.getManagedClusterVersions(), this);
318+
}
319+
return managedClusterVersions;
320+
}
321+
322+
/** @return Resource collection API of NodeTypes. */
323+
public NodeTypes nodeTypes() {
324+
if (this.nodeTypes == null) {
325+
this.nodeTypes = new NodeTypesImpl(clientObject.getNodeTypes(), this);
326+
}
327+
return nodeTypes;
328+
}
329+
281330
/**
282331
* @return Wrapped service client ServiceFabricManagementClient providing direct access to the underlying
283332
* auto-generated API implementation, based on Azure REST API.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) AutoRest Code Generator.
4+
5+
package com.azure.resourcemanager.servicefabric.fluent;
6+
7+
import com.azure.core.annotation.ReturnType;
8+
import com.azure.core.annotation.ServiceMethod;
9+
import com.azure.core.http.rest.Response;
10+
import com.azure.core.util.Context;
11+
import com.azure.resourcemanager.servicefabric.fluent.models.ManagedClusterVersionDetailsInner;
12+
import com.azure.resourcemanager.servicefabric.models.ManagedClusterVersionsOsType;
13+
import java.util.List;
14+
15+
/** An instance of this class provides access to all the operations defined in ManagedClusterVersionsClient. */
16+
public interface ManagedClusterVersionsClient {
17+
/**
18+
* Gets all available code versions for Service Fabric cluster resources by OS type.
19+
*
20+
* @param location The location for the cluster code versions. This is different from cluster location.
21+
* @param osType The operating system of the cluster.
22+
* @throws IllegalArgumentException thrown if parameters fail the validation.
23+
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
24+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
25+
* @return all available code versions for Service Fabric cluster resources by OS type.
26+
*/
27+
@ServiceMethod(returns = ReturnType.SINGLE)
28+
List<ManagedClusterVersionDetailsInner> listByOS(String location, ManagedClusterVersionsOsType osType);
29+
30+
/**
31+
* Gets all available code versions for Service Fabric cluster resources by OS type.
32+
*
33+
* @param location The location for the cluster code versions. This is different from cluster location.
34+
* @param osType The operating system of the cluster.
35+
* @param context The context to associate with this operation.
36+
* @throws IllegalArgumentException thrown if parameters fail the validation.
37+
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
38+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
39+
* @return all available code versions for Service Fabric cluster resources by OS type.
40+
*/
41+
@ServiceMethod(returns = ReturnType.SINGLE)
42+
Response<List<ManagedClusterVersionDetailsInner>> listByOSWithResponse(
43+
String location, ManagedClusterVersionsOsType osType, Context context);
44+
}

0 commit comments

Comments
 (0)