Skip to content

Commit 1ce80d2

Browse files
mgmt, handle the split of deployments in specs (#45614)
1 parent abb3459 commit 1ce80d2

File tree

51 files changed

+482
-828
lines changed

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

+482
-828
lines changed

sdk/resourcemanager/api-specs.json

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,6 @@
8484
"package": "com.azure.resourcemanager.cosmos",
8585
"args": "--tag=package-2025-04-15 --modelerfour.lenient-model-deduplication --rename-model=DataTransferServiceResourceCreateUpdateProperties:DataTransferServiceResourceCreateUpdateParameters,GraphApiComputeServiceResourceCreateUpdateProperties:GraphApiComputeServiceResourceCreateUpdateParameters,MaterializedViewsBuilderServiceResourceCreateUpdateProperties:MaterializedViewsBuilderServiceResourceCreateUpdateParameters,SqlDedicatedGatewayServiceResourceCreateUpdateProperties:SqlDedicatedGatewayServiceResourceCreateUpdateParameters --enable-sync-stack=false"
8686
},
87-
"deploymentstacks": {
88-
"dir": "azure-resourcemanager-resources",
89-
"source": "specification/resources/resource-manager/readme.md",
90-
"package": "com.azure.resourcemanager.resources",
91-
"args": "--tag=package-deploymentstacks-2024-03 --graalvm-config-suffix=deploymentstacks --enable-sync-stack=false"
92-
},
9387
"dns": {
9488
"dir": "azure-resourcemanager-dns",
9589
"source": "specification/dns/resource-manager/readme.md",
@@ -226,9 +220,21 @@
226220
"dir": "azure-resourcemanager-resources",
227221
"source": "specification/resources/resource-manager/readme.md",
228222
"package": "com.azure.resourcemanager.resources",
229-
"args": "--tag=package-resources-2025-04 --add-inner=Deployment --enable-sync-stack=false",
223+
"args": "--tag=package-resources-2025-04 --enable-sync-stack=false",
230224
"note": "Remove `final` from `ResourceReference`, as it is used as superclass in deploymentstacks."
231225
},
226+
"deployments": {
227+
"dir": "azure-resourcemanager-resources",
228+
"source": "specification/resources/resource-manager/Microsoft.Resources/deployments/readme.md",
229+
"package": "com.azure.resourcemanager.resources",
230+
"args": "--tag=package-2025-04 --title=DeploymentsManagementClient --add-inner=Deployment,Provider --graalvm-config-suffix=deployments --enable-sync-stack=false"
231+
},
232+
"deploymentstacks": {
233+
"dir": "azure-resourcemanager-resources",
234+
"source": "specification/resources/resource-manager/Microsoft.Resources/deploymentStacks/readme.md",
235+
"package": "com.azure.resourcemanager.resources",
236+
"args": "--tag=package-2024-03 --graalvm-config-suffix=deploymentstacks --enable-sync-stack=false"
237+
},
232238
"resources-hybrid": {
233239
"dir": "../resourcemanagerhybrid/azure-resourcemanager-resources",
234240
"source": "specification/resources/resource-manager/readme.md",

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22

33
## 2.52.0-beta.1 (Unreleased)
44

5-
### Features Added
6-
75
### Breaking Changes
86

9-
### Bugs Fixed
7+
- `DeploymentsClient` and `DeploymentOperationsClient` is now accessed via `ResourceManager::deploymentClient()`.
108

119
### Other Changes
1210

1311
- Updated `api-version` of resources to `2025-04-01`.
12+
- `deploymentStackClient()` in `ResourceManager` class is now deprecated. The functionality is moved to "azure-resourcemanager-resources-deploymentstacks" package.
1413

1514
## 2.51.0 (2025-05-26)
1615

sdk/resourcemanager/azure-resourcemanager-resources/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "java",
44
"TagPrefix": "java/resourcemanager/azure-resourcemanager-resources",
5-
"Tag": "java/resourcemanager/azure-resourcemanager-resources_6bcfccb64d"
5+
"Tag": "java/resourcemanager/azure-resourcemanager-resources_649d716991"
66
}

sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/ResourceManager.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
import com.azure.resourcemanager.resources.fluent.ChangesManagementClient;
99
import com.azure.resourcemanager.resources.fluent.DataBoundariesManagementClient;
1010
import com.azure.resourcemanager.resources.fluent.DeploymentStacksManagementClient;
11+
import com.azure.resourcemanager.resources.fluent.DeploymentsManagementClient;
1112
import com.azure.resourcemanager.resources.fluent.FeatureClient;
1213
import com.azure.resourcemanager.resources.fluent.ManagementLockClient;
1314
import com.azure.resourcemanager.resources.fluentcore.arm.implementation.AzureConfigurableImpl;
1415
import com.azure.resourcemanager.resources.fluentcore.policy.ProviderRegistrationPolicy;
1516
import com.azure.resourcemanager.resources.implementation.ChangesManagementClientBuilder;
1617
import com.azure.resourcemanager.resources.implementation.DataBoundariesManagementClientBuilder;
1718
import com.azure.resourcemanager.resources.implementation.DeploymentStacksManagementClientBuilder;
19+
import com.azure.resourcemanager.resources.implementation.DeploymentsManagementClientBuilder;
1820
import com.azure.resourcemanager.resources.implementation.FeatureClientBuilder;
1921
import com.azure.resourcemanager.resources.fluent.PolicyClient;
2022
import com.azure.resourcemanager.resources.implementation.ManagementLockClientBuilder;
@@ -65,6 +67,7 @@ public final class ResourceManager extends Manager<ResourceManagementClient> {
6567
private final ChangesManagementClient resourceChangeClient;
6668
private final DeploymentStacksManagementClient deploymentStackClient;
6769
private final DataBoundariesManagementClient dataBoundaryClient;
70+
private final DeploymentsManagementClient deploymentClient;
6871
// The collections
6972
private ResourceGroups resourceGroups;
7073
private GenericResources genericResources;
@@ -265,6 +268,11 @@ private ResourceManager(HttpPipeline httpPipeline, AzureProfile profile) {
265268
.endpoint(profile.getEnvironment().getResourceManagerEndpoint())
266269
.buildClient();
267270

271+
this.deploymentClient = new DeploymentsManagementClientBuilder().pipeline(httpPipeline)
272+
.endpoint(profile.getEnvironment().getResourceManagerEndpoint())
273+
.subscriptionId(profile.getSubscriptionId())
274+
.buildClient();
275+
268276
for (int i = 0; i < httpPipeline.getPolicyCount(); ++i) {
269277
if (httpPipeline.getPolicy(i) instanceof ProviderRegistrationPolicy) {
270278
ProviderRegistrationPolicy policy = (ProviderRegistrationPolicy) httpPipeline.getPolicy(i);
@@ -330,7 +338,10 @@ public ChangesManagementClient resourceChangeClient() {
330338
* based on Azure REST API.
331339
*
332340
* @return wrapped inner deployment stack client.
341+
*
342+
* @deprecated Use the azure-resourcemanager-resources-deploymentstacks package.
333343
*/
344+
@Deprecated
334345
public DeploymentStacksManagementClient deploymentStackClient() {
335346
return deploymentStackClient;
336347
}
@@ -345,6 +356,16 @@ public DataBoundariesManagementClient dataBoundaryClient() {
345356
return dataBoundaryClient;
346357
}
347358

359+
/**
360+
* Wrapped inner deployment client providing direct access to auto-generated API implementation,
361+
* based on Azure REST API.
362+
*
363+
* @return wrapped inner deployment client.
364+
*/
365+
public DeploymentsManagementClient deploymentClient() {
366+
return deploymentClient;
367+
}
368+
348369
/**
349370
* Gets the resource group management API entry point.
350371
*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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.resources.fluent;
6+
7+
import com.azure.core.http.HttpPipeline;
8+
import java.time.Duration;
9+
10+
/**
11+
* The interface for DeploymentsManagementClient class.
12+
*/
13+
public interface DeploymentsManagementClient {
14+
/**
15+
* Gets The Microsoft Azure subscription ID.
16+
*
17+
* @return the subscriptionId value.
18+
*/
19+
String getSubscriptionId();
20+
21+
/**
22+
* Gets server parameter.
23+
*
24+
* @return the endpoint value.
25+
*/
26+
String getEndpoint();
27+
28+
/**
29+
* Gets Api Version.
30+
*
31+
* @return the apiVersion value.
32+
*/
33+
String getApiVersion();
34+
35+
/**
36+
* Gets The HTTP pipeline to send requests through.
37+
*
38+
* @return the httpPipeline value.
39+
*/
40+
HttpPipeline getHttpPipeline();
41+
42+
/**
43+
* Gets The default poll interval for long-running operation.
44+
*
45+
* @return the defaultPollInterval value.
46+
*/
47+
Duration getDefaultPollInterval();
48+
49+
/**
50+
* Gets the DeploymentsClient object to access its operations.
51+
*
52+
* @return the DeploymentsClient object.
53+
*/
54+
DeploymentsClient getDeployments();
55+
56+
/**
57+
* Gets the DeploymentOperationsClient object to access its operations.
58+
*
59+
* @return the DeploymentOperationsClient object.
60+
*/
61+
DeploymentOperationsClient getDeploymentOperations();
62+
}

sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourceManagementClient.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,6 @@ public interface ResourceManagementClient {
5353
*/
5454
OperationsClient getOperations();
5555

56-
/**
57-
* Gets the DeploymentsClient object to access its operations.
58-
*
59-
* @return the DeploymentsClient object.
60-
*/
61-
DeploymentsClient getDeployments();
62-
6356
/**
6457
* Gets the ProvidersClient object to access its operations.
6558
*
@@ -94,11 +87,4 @@ public interface ResourceManagementClient {
9487
* @return the TagOperationsClient object.
9588
*/
9689
TagOperationsClient getTagOperations();
97-
98-
/**
99-
* Gets the DeploymentOperationsClient object to access its operations.
100-
*
101-
* @return the DeploymentOperationsClient object.
102-
*/
103-
DeploymentOperationsClient getDeploymentOperations();
10490
}

sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentImpl.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ public List<ResourceReference> outputResources() {
197197

198198
@Override
199199
public DeploymentOperations deploymentOperations() {
200-
return new DeploymentOperationsImpl(this.manager().serviceClient().getDeploymentOperations(), this);
200+
return new DeploymentOperationsImpl(this.manager().deploymentClient().getDeploymentOperations(), this);
201201
}
202202

203203
@Override
@@ -207,7 +207,7 @@ public void cancel() {
207207

208208
@Override
209209
public Mono<Void> cancelAsync() {
210-
return this.manager().serviceClient().getDeployments().cancelAsync(resourceGroupName, name());
210+
return this.manager().deploymentClient().getDeployments().cancelAsync(resourceGroupName, name());
211211
}
212212

213213
@Override
@@ -218,7 +218,7 @@ public DeploymentExportResult exportTemplate() {
218218
@Override
219219
public Mono<DeploymentExportResult> exportTemplateAsync() {
220220
return this.manager()
221-
.serviceClient()
221+
.deploymentClient()
222222
.getDeployments()
223223
.exportTemplateAsync(resourceGroupName(), name())
224224
.map(DeploymentExportResultImpl::new);
@@ -340,7 +340,7 @@ public Accepted<Deployment> beginCreate(Context context) {
340340
return AcceptedImpl.newAccepted(logger, this.manager().serviceClient().getHttpPipeline(),
341341
this.manager().serviceClient().getDefaultPollInterval(),
342342
() -> this.manager()
343-
.serviceClient()
343+
.deploymentClient()
344344
.getDeployments()
345345
.createOrUpdateWithResponseAsync(resourceGroupName(), name(), deploymentCreateUpdateParameters)
346346
.contextWrite(c -> c.putAll(FluxUtil.toReactorContext(context).readOnly()))
@@ -364,7 +364,7 @@ public Mono<Deployment> beginCreateAsync() {
364364
return Mono.just((Indexable) DeploymentImpl.this);
365365
}
366366
})
367-
.flatMap(indexable -> manager().serviceClient()
367+
.flatMap(indexable -> manager().deploymentClient()
368368
.getDeployments()
369369
.createOrUpdateWithResponseAsync(resourceGroupName(), name(), deploymentCreateUpdateParameters))
370370
.flatMap(activationResponse -> FluxUtil.collectBytesInByteBufferStream(activationResponse.getValue()))
@@ -388,7 +388,7 @@ public Mono<Deployment> beginCreateAsync() {
388388
@Override
389389
public Mono<Deployment> createResourceAsync() {
390390
return this.manager()
391-
.serviceClient()
391+
.deploymentClient()
392392
.getDeployments()
393393
.createOrUpdateAsync(resourceGroupName(), name(), deploymentCreateUpdateParameters)
394394
.map(deploymentExtendedInner -> {
@@ -430,7 +430,7 @@ public Mono<Deployment> applyAsync() {
430430
@Override
431431
protected Mono<DeploymentExtendedInner> getInnerAsync() {
432432
return this.manager()
433-
.serviceClient()
433+
.deploymentClient()
434434
.getDeployments()
435435
.getAtManagementGroupScopeAsync(resourceGroupName(), name());
436436
}
@@ -589,7 +589,7 @@ public WhatIfOperationResult whatIf() {
589589
@Override
590590
public Mono<WhatIfOperationResult> whatIfAsync() {
591591
return this.manager()
592-
.serviceClient()
592+
.deploymentClient()
593593
.getDeployments()
594594
.whatIfAsync(resourceGroupName(), name(), deploymentWhatIf)
595595
.map(WhatIfOperationResultImpl::new);
@@ -603,7 +603,7 @@ public WhatIfOperationResult whatIfAtSubscriptionScope() {
603603
@Override
604604
public Mono<WhatIfOperationResult> whatIfAtSubscriptionScopeAsync() {
605605
return this.manager()
606-
.serviceClient()
606+
.deploymentClient()
607607
.getDeployments()
608608
.whatIfAtSubscriptionScopeAsync(name(), deploymentWhatIf)
609609
.map(WhatIfOperationResultImpl::new);

sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentOperationsClientImpl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,25 @@ public final class DeploymentOperationsClientImpl implements DeploymentOperation
4242
/**
4343
* The service client containing this operation class.
4444
*/
45-
private final ResourceManagementClientImpl client;
45+
private final DeploymentsManagementClientImpl client;
4646

4747
/**
4848
* Initializes an instance of DeploymentOperationsClientImpl.
4949
*
5050
* @param client the instance of the service client containing this operation class.
5151
*/
52-
DeploymentOperationsClientImpl(ResourceManagementClientImpl client) {
52+
DeploymentOperationsClientImpl(DeploymentsManagementClientImpl client) {
5353
this.service = RestProxy.create(DeploymentOperationsService.class, client.getHttpPipeline(),
5454
client.getSerializerAdapter());
5555
this.client = client;
5656
}
5757

5858
/**
59-
* The interface defining all the services for ResourceManagementClientDeploymentOperations to be used by the proxy
60-
* service to perform REST calls.
59+
* The interface defining all the services for DeploymentsManagementClientDeploymentOperations to be used by the
60+
* proxy service to perform REST calls.
6161
*/
6262
@Host("{$host}")
63-
@ServiceInterface(name = "ResourceManagementCl")
63+
@ServiceInterface(name = "DeploymentsManagemen")
6464
public interface DeploymentOperationsService {
6565
@Headers({ "Content-Type: application/json" })
6666
@Get("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}")

sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentsClientImpl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,25 +64,25 @@ public final class DeploymentsClientImpl implements InnerSupportsGet<DeploymentE
6464
/**
6565
* The service client containing this operation class.
6666
*/
67-
private final ResourceManagementClientImpl client;
67+
private final DeploymentsManagementClientImpl client;
6868

6969
/**
7070
* Initializes an instance of DeploymentsClientImpl.
7171
*
7272
* @param client the instance of the service client containing this operation class.
7373
*/
74-
DeploymentsClientImpl(ResourceManagementClientImpl client) {
74+
DeploymentsClientImpl(DeploymentsManagementClientImpl client) {
7575
this.service
7676
= RestProxy.create(DeploymentsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
7777
this.client = client;
7878
}
7979

8080
/**
81-
* The interface defining all the services for ResourceManagementClientDeployments to be used by the proxy service
82-
* to perform REST calls.
81+
* The interface defining all the services for DeploymentsManagementClientDeployments to be used by the proxy
82+
* service to perform REST calls.
8383
*/
8484
@Host("{$host}")
85-
@ServiceInterface(name = "ResourceManagementCl")
85+
@ServiceInterface(name = "DeploymentsManagemen")
8686
public interface DeploymentsService {
8787
@Headers({ "Content-Type: application/json" })
8888
@Delete("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}")

0 commit comments

Comments
 (0)