Skip to content

Commit 00db29e

Browse files
[Automation] Generate Fluent Lite from batch#package-2024-02 (#39424)
* [Automation] Generate Fluent Lite from batch#package-2024-02 * fix mgmt live test * imports --------- Co-authored-by: XiaofeiCao <[email protected]>
1 parent e6e6f21 commit 00db29e

File tree

127 files changed

+2009
-567
lines changed

Some content is hidden

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

127 files changed

+2009
-567
lines changed

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

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,34 @@
11
# Release History
22

3-
## 1.1.0-beta.4 (Unreleased)
3+
## 1.1.0-beta.4 (2024-03-27)
4+
5+
- Azure Resource Manager Batch client library for Java. This package contains Microsoft Azure SDK for Batch Management SDK. Batch Client. Package tag package-2024-02. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
46

57
### Features Added
68

7-
### Breaking Changes
9+
* `models.UpgradePolicy` was added
10+
11+
* `models.RollingUpgradePolicy` was added
12+
13+
* `models.UpgradeMode` was added
14+
15+
* `models.AutomaticOSUpgradePolicy` was added
16+
17+
#### `models.SupportedSku` was modified
18+
19+
* `batchSupportEndOfLife()` was added
820

9-
### Bugs Fixed
21+
#### `models.Pool$Definition` was modified
22+
23+
* `withUpgradePolicy(models.UpgradePolicy)` was added
24+
25+
#### `models.Pool` was modified
26+
27+
* `upgradePolicy()` was added
28+
29+
#### `models.Pool$Update` was modified
1030

11-
### Other Changes
31+
* `withUpgradePolicy(models.UpgradePolicy)` was added
1232

1333
## 1.1.0-beta.3 (2023-12-22)
1434

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

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

33
Azure Resource Manager Batch client library for Java.
44

5-
This package contains Microsoft Azure SDK for Batch Management SDK. Batch Client. Package tag package-2023-11. 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 Batch Management SDK. Batch Client. Package tag package-2024-02. 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-batch</artifactId>
35-
<version>1.1.0-beta.3</version>
35+
<version>1.1.0-beta.4</version>
3636
</dependency>
3737
```
3838
[//]: # ({x-version-update-end})

sdk/batch/azure-resourcemanager-batch/SAMPLE.md

Lines changed: 652 additions & 177 deletions
Large diffs are not rendered by default.

sdk/batch/azure-resourcemanager-batch/pom.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<packaging>jar</packaging>
1919

2020
<name>Microsoft Azure SDK for Batch Management</name>
21-
<description>This package contains Microsoft Azure SDK for Batch Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Batch Client. Package tag package-2023-11.</description>
21+
<description>This package contains Microsoft Azure SDK for Batch Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Batch Client. Package tag package-2024-02.</description>
2222
<url>https://github.com/Azure/azure-sdk-for-java</url>
2323

2424
<licenses>
@@ -88,8 +88,6 @@
8888
<version>4.11.0</version> <!-- {x-version-update;org.mockito:mockito-core;external_dependency} -->
8989
<scope>test</scope>
9090
</dependency>
91-
<!-- bytebuddy dependencies are required for mockito 4.11.0 to work with Java 21. Mockito 4.11.0 is the last release -->
92-
<!-- of Mockito supporting Java 8 as a baseline. -->
9391
<dependency>
9492
<groupId>net.bytebuddy</groupId>
9593
<artifactId>byte-buddy</artifactId>

sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/BatchManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ public BatchManager authenticate(TokenCredential credential, AzureProfile profil
232232

233233
StringBuilder userAgentBuilder = new StringBuilder();
234234
userAgentBuilder.append("azsdk-java").append("-").append("com.azure.resourcemanager.batch").append("/")
235-
.append("1.1.0-beta.3");
235+
.append("1.1.0-beta.4");
236236
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
237237
userAgentBuilder.append(" (").append(Configuration.getGlobalConfiguration().get("java.version"))
238238
.append("; ").append(Configuration.getGlobalConfiguration().get("os.name")).append("; ")

sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/fluent/models/PoolInner.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import com.azure.resourcemanager.batch.models.ScaleSettings;
2323
import com.azure.resourcemanager.batch.models.StartTask;
2424
import com.azure.resourcemanager.batch.models.TaskSchedulingPolicy;
25+
import com.azure.resourcemanager.batch.models.UpgradePolicy;
2526
import com.azure.resourcemanager.batch.models.UserAccount;
2627
import com.fasterxml.jackson.annotation.JsonProperty;
2728
import java.time.OffsetDateTime;
@@ -684,6 +685,29 @@ public NodeCommunicationMode currentNodeCommunicationMode() {
684685
return this.innerProperties() == null ? null : this.innerProperties().currentNodeCommunicationMode();
685686
}
686687

688+
/**
689+
* Get the upgradePolicy property: Describes an upgrade policy - automatic, manual, or rolling.
690+
*
691+
* @return the upgradePolicy value.
692+
*/
693+
public UpgradePolicy upgradePolicy() {
694+
return this.innerProperties() == null ? null : this.innerProperties().upgradePolicy();
695+
}
696+
697+
/**
698+
* Set the upgradePolicy property: Describes an upgrade policy - automatic, manual, or rolling.
699+
*
700+
* @param upgradePolicy the upgradePolicy value to set.
701+
* @return the PoolInner object itself.
702+
*/
703+
public PoolInner withUpgradePolicy(UpgradePolicy upgradePolicy) {
704+
if (this.innerProperties() == null) {
705+
this.innerProperties = new PoolProperties();
706+
}
707+
this.innerProperties().withUpgradePolicy(upgradePolicy);
708+
return this;
709+
}
710+
687711
/**
688712
* Get the resourceTags property: The user-defined tags to be associated with the Azure Batch Pool. When specified,
689713
* these tags are propagated to the backing Azure resources associated with the pool. This property can only be

sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/fluent/models/PoolProperties.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.azure.resourcemanager.batch.models.ScaleSettings;
2121
import com.azure.resourcemanager.batch.models.StartTask;
2222
import com.azure.resourcemanager.batch.models.TaskSchedulingPolicy;
23+
import com.azure.resourcemanager.batch.models.UpgradePolicy;
2324
import com.azure.resourcemanager.batch.models.UserAccount;
2425
import com.fasterxml.jackson.annotation.JsonInclude;
2526
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -256,6 +257,12 @@ public final class PoolProperties {
256257
@JsonProperty(value = "currentNodeCommunicationMode", access = JsonProperty.Access.WRITE_ONLY)
257258
private NodeCommunicationMode currentNodeCommunicationMode;
258259

260+
/*
261+
* Describes an upgrade policy - automatic, manual, or rolling.
262+
*/
263+
@JsonProperty(value = "upgradePolicy")
264+
private UpgradePolicy upgradePolicy;
265+
259266
/*
260267
* The user-defined tags to be associated with the Azure Batch Pool. When specified, these tags are propagated to
261268
* the backing Azure resources associated with the pool. This property can only be specified when the Batch account
@@ -812,6 +819,26 @@ public NodeCommunicationMode currentNodeCommunicationMode() {
812819
return this.currentNodeCommunicationMode;
813820
}
814821

822+
/**
823+
* Get the upgradePolicy property: Describes an upgrade policy - automatic, manual, or rolling.
824+
*
825+
* @return the upgradePolicy value.
826+
*/
827+
public UpgradePolicy upgradePolicy() {
828+
return this.upgradePolicy;
829+
}
830+
831+
/**
832+
* Set the upgradePolicy property: Describes an upgrade policy - automatic, manual, or rolling.
833+
*
834+
* @param upgradePolicy the upgradePolicy value to set.
835+
* @return the PoolProperties object itself.
836+
*/
837+
public PoolProperties withUpgradePolicy(UpgradePolicy upgradePolicy) {
838+
this.upgradePolicy = upgradePolicy;
839+
return this;
840+
}
841+
815842
/**
816843
* Get the resourceTags property: The user-defined tags to be associated with the Azure Batch Pool. When specified,
817844
* these tags are propagated to the backing Azure resources associated with the pool. This property can only be
@@ -878,5 +905,8 @@ public void validate() {
878905
if (mountConfiguration() != null) {
879906
mountConfiguration().forEach(e -> e.validate());
880907
}
908+
if (upgradePolicy() != null) {
909+
upgradePolicy().validate();
910+
}
881911
}
882912
}

sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/fluent/models/SupportedSkuInner.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.azure.core.annotation.Immutable;
88
import com.azure.resourcemanager.batch.models.SkuCapability;
99
import com.fasterxml.jackson.annotation.JsonProperty;
10+
import java.time.OffsetDateTime;
1011
import java.util.List;
1112

1213
/**
@@ -32,6 +33,12 @@ public final class SupportedSkuInner {
3233
@JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY)
3334
private List<SkuCapability> capabilities;
3435

36+
/*
37+
* The time when Azure Batch service will retire this SKU.
38+
*/
39+
@JsonProperty(value = "batchSupportEndOfLife", access = JsonProperty.Access.WRITE_ONLY)
40+
private OffsetDateTime batchSupportEndOfLife;
41+
3542
/**
3643
* Creates an instance of SupportedSkuInner class.
3744
*/
@@ -65,6 +72,15 @@ public List<SkuCapability> capabilities() {
6572
return this.capabilities;
6673
}
6774

75+
/**
76+
* Get the batchSupportEndOfLife property: The time when Azure Batch service will retire this SKU.
77+
*
78+
* @return the batchSupportEndOfLife value.
79+
*/
80+
public OffsetDateTime batchSupportEndOfLife() {
81+
return this.batchSupportEndOfLife;
82+
}
83+
6884
/**
6985
* Validates the instance.
7086
*

sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/ApplicationImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ public Application apply(Context context) {
104104
ApplicationImpl(ApplicationInner innerObject, com.azure.resourcemanager.batch.BatchManager serviceManager) {
105105
this.innerObject = innerObject;
106106
this.serviceManager = serviceManager;
107-
this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
108-
this.accountName = Utils.getValueFromIdByName(innerObject.id(), "batchAccounts");
109-
this.applicationName = Utils.getValueFromIdByName(innerObject.id(), "applications");
107+
this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups");
108+
this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "batchAccounts");
109+
this.applicationName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "applications");
110110
}
111111

112112
public Application refresh() {

sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/ApplicationPackagesImpl.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -88,33 +88,33 @@ public PagedIterable<ApplicationPackage> list(String resourceGroupName, String a
8888
String applicationName) {
8989
PagedIterable<ApplicationPackageInner> inner
9090
= this.serviceClient().list(resourceGroupName, accountName, applicationName);
91-
return Utils.mapPage(inner, inner1 -> new ApplicationPackageImpl(inner1, this.manager()));
91+
return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationPackageImpl(inner1, this.manager()));
9292
}
9393

9494
public PagedIterable<ApplicationPackage> list(String resourceGroupName, String accountName, String applicationName,
9595
Integer maxresults, Context context) {
9696
PagedIterable<ApplicationPackageInner> inner
9797
= this.serviceClient().list(resourceGroupName, accountName, applicationName, maxresults, context);
98-
return Utils.mapPage(inner, inner1 -> new ApplicationPackageImpl(inner1, this.manager()));
98+
return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationPackageImpl(inner1, this.manager()));
9999
}
100100

101101
public ApplicationPackage getById(String id) {
102-
String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
102+
String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
103103
if (resourceGroupName == null) {
104104
throw LOGGER.logExceptionAsError(new IllegalArgumentException(
105105
String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
106106
}
107-
String accountName = Utils.getValueFromIdByName(id, "batchAccounts");
107+
String accountName = ResourceManagerUtils.getValueFromIdByName(id, "batchAccounts");
108108
if (accountName == null) {
109109
throw LOGGER.logExceptionAsError(new IllegalArgumentException(
110110
String.format("The resource ID '%s' is not valid. Missing path segment 'batchAccounts'.", id)));
111111
}
112-
String applicationName = Utils.getValueFromIdByName(id, "applications");
112+
String applicationName = ResourceManagerUtils.getValueFromIdByName(id, "applications");
113113
if (applicationName == null) {
114114
throw LOGGER.logExceptionAsError(new IllegalArgumentException(
115115
String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id)));
116116
}
117-
String versionName = Utils.getValueFromIdByName(id, "versions");
117+
String versionName = ResourceManagerUtils.getValueFromIdByName(id, "versions");
118118
if (versionName == null) {
119119
throw LOGGER.logExceptionAsError(new IllegalArgumentException(
120120
String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id)));
@@ -124,22 +124,22 @@ public ApplicationPackage getById(String id) {
124124
}
125125

126126
public Response<ApplicationPackage> getByIdWithResponse(String id, Context context) {
127-
String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
127+
String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
128128
if (resourceGroupName == null) {
129129
throw LOGGER.logExceptionAsError(new IllegalArgumentException(
130130
String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
131131
}
132-
String accountName = Utils.getValueFromIdByName(id, "batchAccounts");
132+
String accountName = ResourceManagerUtils.getValueFromIdByName(id, "batchAccounts");
133133
if (accountName == null) {
134134
throw LOGGER.logExceptionAsError(new IllegalArgumentException(
135135
String.format("The resource ID '%s' is not valid. Missing path segment 'batchAccounts'.", id)));
136136
}
137-
String applicationName = Utils.getValueFromIdByName(id, "applications");
137+
String applicationName = ResourceManagerUtils.getValueFromIdByName(id, "applications");
138138
if (applicationName == null) {
139139
throw LOGGER.logExceptionAsError(new IllegalArgumentException(
140140
String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id)));
141141
}
142-
String versionName = Utils.getValueFromIdByName(id, "versions");
142+
String versionName = ResourceManagerUtils.getValueFromIdByName(id, "versions");
143143
if (versionName == null) {
144144
throw LOGGER.logExceptionAsError(new IllegalArgumentException(
145145
String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id)));
@@ -148,22 +148,22 @@ public Response<ApplicationPackage> getByIdWithResponse(String id, Context conte
148148
}
149149

150150
public void deleteById(String id) {
151-
String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
151+
String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
152152
if (resourceGroupName == null) {
153153
throw LOGGER.logExceptionAsError(new IllegalArgumentException(
154154
String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
155155
}
156-
String accountName = Utils.getValueFromIdByName(id, "batchAccounts");
156+
String accountName = ResourceManagerUtils.getValueFromIdByName(id, "batchAccounts");
157157
if (accountName == null) {
158158
throw LOGGER.logExceptionAsError(new IllegalArgumentException(
159159
String.format("The resource ID '%s' is not valid. Missing path segment 'batchAccounts'.", id)));
160160
}
161-
String applicationName = Utils.getValueFromIdByName(id, "applications");
161+
String applicationName = ResourceManagerUtils.getValueFromIdByName(id, "applications");
162162
if (applicationName == null) {
163163
throw LOGGER.logExceptionAsError(new IllegalArgumentException(
164164
String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id)));
165165
}
166-
String versionName = Utils.getValueFromIdByName(id, "versions");
166+
String versionName = ResourceManagerUtils.getValueFromIdByName(id, "versions");
167167
if (versionName == null) {
168168
throw LOGGER.logExceptionAsError(new IllegalArgumentException(
169169
String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id)));
@@ -172,22 +172,22 @@ public void deleteById(String id) {
172172
}
173173

174174
public Response<Void> deleteByIdWithResponse(String id, Context context) {
175-
String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
175+
String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
176176
if (resourceGroupName == null) {
177177
throw LOGGER.logExceptionAsError(new IllegalArgumentException(
178178
String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
179179
}
180-
String accountName = Utils.getValueFromIdByName(id, "batchAccounts");
180+
String accountName = ResourceManagerUtils.getValueFromIdByName(id, "batchAccounts");
181181
if (accountName == null) {
182182
throw LOGGER.logExceptionAsError(new IllegalArgumentException(
183183
String.format("The resource ID '%s' is not valid. Missing path segment 'batchAccounts'.", id)));
184184
}
185-
String applicationName = Utils.getValueFromIdByName(id, "applications");
185+
String applicationName = ResourceManagerUtils.getValueFromIdByName(id, "applications");
186186
if (applicationName == null) {
187187
throw LOGGER.logExceptionAsError(new IllegalArgumentException(
188188
String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id)));
189189
}
190-
String versionName = Utils.getValueFromIdByName(id, "versions");
190+
String versionName = ResourceManagerUtils.getValueFromIdByName(id, "versions");
191191
if (versionName == null) {
192192
throw LOGGER.logExceptionAsError(new IllegalArgumentException(
193193
String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id)));

0 commit comments

Comments
 (0)