Skip to content

Commit d300647

Browse files
author
BitsAdmin
committed
Merge branch 'ecs-Java-2020-04-01-online-1330-2025_06_25_15_57_02' into 'integration_2025-06-26_968300483330'
feat: [development task] ecs-1330-Java (1390141) See merge request iaasng/volcengine-java-sdk!552
2 parents aff4c27 + f1a4bde commit d300647

14 files changed

+822
-14
lines changed

volcengine-java-sdk-ecs/src/main/java/com/volcengine/ecs/EcsApi.java

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@
209209
import com.volcengine.ecs.model.RenewDedicatedHostResponse;
210210
import com.volcengine.ecs.model.RenewInstanceRequest;
211211
import com.volcengine.ecs.model.RenewInstanceResponse;
212+
import com.volcengine.ecs.model.RepairImageRequest;
213+
import com.volcengine.ecs.model.RepairImageResponse;
212214
import com.volcengine.ecs.model.ReplaceSystemVolumeRequest;
213215
import com.volcengine.ecs.model.ReplaceSystemVolumeResponse;
214216
import com.volcengine.ecs.model.RunCommandRequest;
@@ -11545,6 +11547,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
1154511547
apiClient.executeAsync(call, localVarReturnType, callback);
1154611548
return call;
1154711549
}
11550+
/**
11551+
* Build call for repairImage
11552+
* @param body (required)
11553+
* @param progressListener Progress listener
11554+
* @param progressRequestListener Progress request listener
11555+
* @return Call to execute
11556+
* @throws ApiException If fail to serialize the request body object
11557+
*/
11558+
public com.squareup.okhttp.Call repairImageCall(RepairImageRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
11559+
Object localVarPostBody = body;
11560+
11561+
// create path and map variables
11562+
String localVarPath = "/RepairImage/2020-04-01/ecs/get/text_plain/";
11563+
11564+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
11565+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
11566+
11567+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
11568+
11569+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
11570+
11571+
final String[] localVarAccepts = {
11572+
"application/json"
11573+
};
11574+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
11575+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
11576+
11577+
final String[] localVarContentTypes = {
11578+
"text/plain"
11579+
};
11580+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
11581+
localVarHeaderParams.put("Content-Type", localVarContentType);
11582+
11583+
if(progressListener != null) {
11584+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
11585+
@Override
11586+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
11587+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
11588+
return originalResponse.newBuilder()
11589+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
11590+
.build();
11591+
}
11592+
});
11593+
}
11594+
11595+
String[] localVarAuthNames = new String[] { "volcengineSign" };
11596+
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
11597+
}
11598+
11599+
@SuppressWarnings("rawtypes")
11600+
private com.squareup.okhttp.Call repairImageValidateBeforeCall(RepairImageRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
11601+
// verify the required parameter 'body' is set
11602+
if (body == null) {
11603+
throw new ApiException("Missing the required parameter 'body' when calling repairImage(Async)");
11604+
}
11605+
11606+
com.squareup.okhttp.Call call = repairImageCall(body, progressListener, progressRequestListener);
11607+
return call;
11608+
11609+
11610+
11611+
11612+
11613+
}
11614+
11615+
/**
11616+
*
11617+
*
11618+
* @param body (required)
11619+
* @return RepairImageResponse
11620+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
11621+
*/
11622+
public RepairImageResponse repairImage(RepairImageRequest body) throws ApiException {
11623+
ApiResponse<RepairImageResponse> resp = repairImageWithHttpInfo(body);
11624+
return resp.getData();
11625+
}
11626+
11627+
/**
11628+
*
11629+
*
11630+
* @param body (required)
11631+
* @return ApiResponse&lt;RepairImageResponse&gt;
11632+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
11633+
*/
11634+
public ApiResponse<RepairImageResponse> repairImageWithHttpInfo( @NotNull RepairImageRequest body) throws ApiException {
11635+
com.squareup.okhttp.Call call = repairImageValidateBeforeCall(body, null, null);
11636+
Type localVarReturnType = new TypeToken<RepairImageResponse>(){}.getType();
11637+
return apiClient.execute(call, localVarReturnType);
11638+
}
11639+
11640+
/**
11641+
* (asynchronously)
11642+
*
11643+
* @param body (required)
11644+
* @param callback The callback to be executed when the API call finishes
11645+
* @return The request call
11646+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
11647+
*/
11648+
public com.squareup.okhttp.Call repairImageAsync(RepairImageRequest body, final ApiCallback<RepairImageResponse> callback) throws ApiException {
11649+
11650+
ProgressResponseBody.ProgressListener progressListener = null;
11651+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
11652+
11653+
if (callback != null) {
11654+
progressListener = new ProgressResponseBody.ProgressListener() {
11655+
@Override
11656+
public void update(long bytesRead, long contentLength, boolean done) {
11657+
callback.onDownloadProgress(bytesRead, contentLength, done);
11658+
}
11659+
};
11660+
11661+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
11662+
@Override
11663+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
11664+
callback.onUploadProgress(bytesWritten, contentLength, done);
11665+
}
11666+
};
11667+
}
11668+
11669+
com.squareup.okhttp.Call call = repairImageValidateBeforeCall(body, progressListener, progressRequestListener);
11670+
Type localVarReturnType = new TypeToken<RepairImageResponse>(){}.getType();
11671+
apiClient.executeAsync(call, localVarReturnType, callback);
11672+
return call;
11673+
}
1154811674
/**
1154911675
* Build call for replaceSystemVolume
1155011676
* @param body (required)

volcengine-java-sdk-ecs/src/main/java/com/volcengine/ecs/model/CreateScheduledInstancesRequest.java

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ public class CreateScheduledInstancesRequest {
4848
@SerializedName("CpuMaxFrequency")
4949
private Float cpuMaxFrequency = null;
5050

51+
@SerializedName("DeletionProtection")
52+
private Boolean deletionProtection = null;
53+
5154
@SerializedName("DeliveryType")
5255
private String deliveryType = null;
5356

@@ -204,6 +207,24 @@ public void setCpuMaxFrequency(Float cpuMaxFrequency) {
204207
this.cpuMaxFrequency = cpuMaxFrequency;
205208
}
206209

210+
public CreateScheduledInstancesRequest deletionProtection(Boolean deletionProtection) {
211+
this.deletionProtection = deletionProtection;
212+
return this;
213+
}
214+
215+
/**
216+
* Get deletionProtection
217+
* @return deletionProtection
218+
**/
219+
@Schema(description = "")
220+
public Boolean isDeletionProtection() {
221+
return deletionProtection;
222+
}
223+
224+
public void setDeletionProtection(Boolean deletionProtection) {
225+
this.deletionProtection = deletionProtection;
226+
}
227+
207228
public CreateScheduledInstancesRequest deliveryType(String deliveryType) {
208229
this.deliveryType = deliveryType;
209230
return this;
@@ -755,6 +776,7 @@ public boolean equals(java.lang.Object o) {
755776
Objects.equals(this.clientToken, createScheduledInstancesRequest.clientToken) &&
756777
Objects.equals(this.count, createScheduledInstancesRequest.count) &&
757778
Objects.equals(this.cpuMaxFrequency, createScheduledInstancesRequest.cpuMaxFrequency) &&
779+
Objects.equals(this.deletionProtection, createScheduledInstancesRequest.deletionProtection) &&
758780
Objects.equals(this.deliveryType, createScheduledInstancesRequest.deliveryType) &&
759781
Objects.equals(this.description, createScheduledInstancesRequest.description) &&
760782
Objects.equals(this.dryRun, createScheduledInstancesRequest.dryRun) &&
@@ -787,7 +809,7 @@ public boolean equals(java.lang.Object o) {
787809

788810
@Override
789811
public int hashCode() {
790-
return Objects.hash(autoReleaseAt, clientToken, count, cpuMaxFrequency, deliveryType, description, dryRun, eipAddress, elasticScheduledInstanceType, endDeliveryAt, hostname, hpcClusterId, imageId, installRunCommandAgent, instanceName, instanceTypeId, keepImageCredential, keyPairName, minCount, networkInterfaces, password, projectName, scheduledInstanceDescription, scheduledInstanceName, securityEnhancementStrategy, startDeliveryAt, suffixIndex, tags, uniqueSuffix, userData, volumes, zoneId);
812+
return Objects.hash(autoReleaseAt, clientToken, count, cpuMaxFrequency, deletionProtection, deliveryType, description, dryRun, eipAddress, elasticScheduledInstanceType, endDeliveryAt, hostname, hpcClusterId, imageId, installRunCommandAgent, instanceName, instanceTypeId, keepImageCredential, keyPairName, minCount, networkInterfaces, password, projectName, scheduledInstanceDescription, scheduledInstanceName, securityEnhancementStrategy, startDeliveryAt, suffixIndex, tags, uniqueSuffix, userData, volumes, zoneId);
791813
}
792814

793815

@@ -800,6 +822,7 @@ public String toString() {
800822
sb.append(" clientToken: ").append(toIndentedString(clientToken)).append("\n");
801823
sb.append(" count: ").append(toIndentedString(count)).append("\n");
802824
sb.append(" cpuMaxFrequency: ").append(toIndentedString(cpuMaxFrequency)).append("\n");
825+
sb.append(" deletionProtection: ").append(toIndentedString(deletionProtection)).append("\n");
803826
sb.append(" deliveryType: ").append(toIndentedString(deliveryType)).append("\n");
804827
sb.append(" description: ").append(toIndentedString(description)).append("\n");
805828
sb.append(" dryRun: ").append(toIndentedString(dryRun)).append("\n");

volcengine-java-sdk-ecs/src/main/java/com/volcengine/ecs/model/DescribeInstancesRequest.java

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333

3434

3535
public class DescribeInstancesRequest {
36+
@SerializedName("AffinityGroupIds")
37+
private List<String> affinityGroupIds = null;
38+
3639
@SerializedName("DedicatedHostClusterId")
3740
private String dedicatedHostClusterId = null;
3841

@@ -102,6 +105,32 @@ public class DescribeInstancesRequest {
102105
@SerializedName("ZoneId")
103106
private String zoneId = null;
104107

108+
public DescribeInstancesRequest affinityGroupIds(List<String> affinityGroupIds) {
109+
this.affinityGroupIds = affinityGroupIds;
110+
return this;
111+
}
112+
113+
public DescribeInstancesRequest addAffinityGroupIdsItem(String affinityGroupIdsItem) {
114+
if (this.affinityGroupIds == null) {
115+
this.affinityGroupIds = new ArrayList<String>();
116+
}
117+
this.affinityGroupIds.add(affinityGroupIdsItem);
118+
return this;
119+
}
120+
121+
/**
122+
* Get affinityGroupIds
123+
* @return affinityGroupIds
124+
**/
125+
@Schema(description = "")
126+
public List<String> getAffinityGroupIds() {
127+
return affinityGroupIds;
128+
}
129+
130+
public void setAffinityGroupIds(List<String> affinityGroupIds) {
131+
this.affinityGroupIds = affinityGroupIds;
132+
}
133+
105134
public DescribeInstancesRequest dedicatedHostClusterId(String dedicatedHostClusterId) {
106135
this.dedicatedHostClusterId = dedicatedHostClusterId;
107136
return this;
@@ -599,7 +628,8 @@ public boolean equals(java.lang.Object o) {
599628
return false;
600629
}
601630
DescribeInstancesRequest describeInstancesRequest = (DescribeInstancesRequest) o;
602-
return Objects.equals(this.dedicatedHostClusterId, describeInstancesRequest.dedicatedHostClusterId) &&
631+
return Objects.equals(this.affinityGroupIds, describeInstancesRequest.affinityGroupIds) &&
632+
Objects.equals(this.dedicatedHostClusterId, describeInstancesRequest.dedicatedHostClusterId) &&
603633
Objects.equals(this.dedicatedHostId, describeInstancesRequest.dedicatedHostId) &&
604634
Objects.equals(this.deploymentSetGroupNumbers, describeInstancesRequest.deploymentSetGroupNumbers) &&
605635
Objects.equals(this.deploymentSetIds, describeInstancesRequest.deploymentSetIds) &&
@@ -626,7 +656,7 @@ public boolean equals(java.lang.Object o) {
626656

627657
@Override
628658
public int hashCode() {
629-
return Objects.hash(dedicatedHostClusterId, dedicatedHostId, deploymentSetGroupNumbers, deploymentSetIds, eipAddresses, hpcClusterId, instanceChargeType, instanceIds, instanceName, instanceTypeFamilies, instanceTypeIds, instanceTypes, ipv6Addresses, keyPairName, maxResults, nextToken, primaryIpAddress, projectName, scheduledInstanceId, status, tagFilters, vpcId, zoneId);
659+
return Objects.hash(affinityGroupIds, dedicatedHostClusterId, dedicatedHostId, deploymentSetGroupNumbers, deploymentSetIds, eipAddresses, hpcClusterId, instanceChargeType, instanceIds, instanceName, instanceTypeFamilies, instanceTypeIds, instanceTypes, ipv6Addresses, keyPairName, maxResults, nextToken, primaryIpAddress, projectName, scheduledInstanceId, status, tagFilters, vpcId, zoneId);
630660
}
631661

632662

@@ -635,6 +665,7 @@ public String toString() {
635665
StringBuilder sb = new StringBuilder();
636666
sb.append("class DescribeInstancesRequest {\n");
637667

668+
sb.append(" affinityGroupIds: ").append(toIndentedString(affinityGroupIds)).append("\n");
638669
sb.append(" dedicatedHostClusterId: ").append(toIndentedString(dedicatedHostClusterId)).append("\n");
639670
sb.append(" dedicatedHostId: ").append(toIndentedString(dedicatedHostId)).append("\n");
640671
sb.append(" deploymentSetGroupNumbers: ").append(toIndentedString(deploymentSetGroupNumbers)).append("\n");
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/*
2+
* ecs
3+
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
4+
*
5+
* OpenAPI spec version: common-version
6+
*
7+
*
8+
* NOTE: This class is auto generated by the swagger code generator program.
9+
* https://github.com/swagger-api/swagger-codegen.git
10+
* Do not edit the class manually.
11+
*/
12+
13+
package com.volcengine.ecs.model;
14+
15+
import java.util.Objects;
16+
import java.util.Arrays;
17+
import com.google.gson.TypeAdapter;
18+
import com.google.gson.annotations.JsonAdapter;
19+
import com.google.gson.annotations.SerializedName;
20+
import com.google.gson.stream.JsonReader;
21+
import com.google.gson.stream.JsonWriter;
22+
import io.swagger.v3.oas.annotations.media.Schema;
23+
import java.io.IOException;
24+
import javax.validation.constraints.*;
25+
import javax.validation.Valid;
26+
/**
27+
* ImportDataVolumeForImportImageInput
28+
*/
29+
30+
31+
32+
public class ImportDataVolumeForImportImageInput {
33+
@SerializedName("DataVolumeUrl")
34+
private String dataVolumeUrl = null;
35+
36+
public ImportDataVolumeForImportImageInput dataVolumeUrl(String dataVolumeUrl) {
37+
this.dataVolumeUrl = dataVolumeUrl;
38+
return this;
39+
}
40+
41+
/**
42+
* Get dataVolumeUrl
43+
* @return dataVolumeUrl
44+
**/
45+
@Schema(description = "")
46+
public String getDataVolumeUrl() {
47+
return dataVolumeUrl;
48+
}
49+
50+
public void setDataVolumeUrl(String dataVolumeUrl) {
51+
this.dataVolumeUrl = dataVolumeUrl;
52+
}
53+
54+
55+
@Override
56+
public boolean equals(java.lang.Object o) {
57+
if (this == o) {
58+
return true;
59+
}
60+
if (o == null || getClass() != o.getClass()) {
61+
return false;
62+
}
63+
ImportDataVolumeForImportImageInput importDataVolumeForImportImageInput = (ImportDataVolumeForImportImageInput) o;
64+
return Objects.equals(this.dataVolumeUrl, importDataVolumeForImportImageInput.dataVolumeUrl);
65+
}
66+
67+
@Override
68+
public int hashCode() {
69+
return Objects.hash(dataVolumeUrl);
70+
}
71+
72+
73+
@Override
74+
public String toString() {
75+
StringBuilder sb = new StringBuilder();
76+
sb.append("class ImportDataVolumeForImportImageInput {\n");
77+
78+
sb.append(" dataVolumeUrl: ").append(toIndentedString(dataVolumeUrl)).append("\n");
79+
sb.append("}");
80+
return sb.toString();
81+
}
82+
83+
/**
84+
* Convert the given object to string with each line indented by 4 spaces
85+
* (except the first line).
86+
*/
87+
private String toIndentedString(java.lang.Object o) {
88+
if (o == null) {
89+
return "null";
90+
}
91+
return o.toString().replace("\n", "\n ");
92+
}
93+
94+
}

0 commit comments

Comments
 (0)