Skip to content

Commit d477e14

Browse files
committed
由春长发起的BATCHCOMPUTE SDK自动发布, BUILD_ID=304, 版本号:5.3.0
发布日志: 1, Fix SecurityToken supported, and upgrade version of aliyun-java-sdk-core to 3.5.1.
1 parent addd515 commit d477e14

File tree

56 files changed

+144
-80
lines changed

Some content is hidden

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

56 files changed

+144
-80
lines changed

aliyun-java-sdk-batchcompute/ChangeLog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2018-02-13 Version: 5.3.0
2+
1, Fix SecurityToken supported, and upgrade version of aliyun-java-sdk-core to 3.5.1.
3+
14
2017-12-12 Version: 5.1.0
25
1, VpcId is supported in Networks configuration when creating job and cluster
36

aliyun-java-sdk-batchcompute/Readme.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ Batchcompute SDK For Java
1313
<dependency>
1414
<groupId>com.aliyun</groupId>
1515
<artifactId>aliyun-java-sdk-core</artifactId>
16-
<version>3.2.3</version>
16+
<version>3.5.1</version>
1717
</dependency>
1818

1919

2020
<dependency>
2121
<groupId>com.aliyun</groupId>
2222
<artifactId>aliyun-java-sdk-batchcompute</artifactId>
23-
<version>5.1.0</version>
23+
<version>5.3.0</version>
2424
</dependency>
2525
```
2626

@@ -37,6 +37,8 @@ String accessKeySecret="${your_access_key_secret}";
3737

3838
/** 构造 BatchCompute 客户端 */
3939
BatchCompute client = new BatchComputeClient(regionId, accessKeyId, accessKeySecret);
40+
41+
//BatchCompute client = new BatchComputeClient(regionId, accessKeyId, accessKeySecret, securityToken);
4042
```
4143

4244
#### (3) 使用 client 对象的方法:
@@ -107,6 +109,19 @@ try {
107109

108110
### 5. release note
109111

112+
5.3.0
113+
114+
```
115+
1. 修复SecurityToken支持。升级依赖core版本到3.5.1.
116+
```
117+
118+
119+
5.2.0
120+
```
121+
1. 创建集群时增加ScheduleType支持。
122+
2. 查询集群状态增加ErrorCode字段。
123+
```
124+
110125
5.1.0
111126
```
112127
1. 支持VpcId

aliyun-java-sdk-batchcompute/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<groupId>com.aliyun</groupId>
44
<artifactId>aliyun-java-sdk-batchcompute</artifactId>
55
<packaging>jar</packaging>
6-
<version>5.1.0</version>
6+
<version>5.3.0</version>
77
<name>aliyun-java-sdk-batchcompute</name>
88
<url>http://www.aliyun.com</url>
99
<description>Aliyun Open API SDK for Java
@@ -49,7 +49,7 @@
4949
<groupId>com.aliyun</groupId>
5050
<artifactId>aliyun-java-sdk-core</artifactId>
5151
<optional>true</optional>
52-
<version>3.2.3</version>
52+
<version>3.5.1</version>
5353
</dependency>
5454
<dependency>
5555
<groupId>org.codehaus.jackson</groupId>

aliyun-java-sdk-batchcompute/src/main/java/com/aliyuncs/batchcompute/main/v20151111/BatchComputeClient.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ public BatchComputeClient(String regionId, String accessKeyId, String accessKeyS
6767
this.client = new DefaultAcsClient(DefaultProfile.getProfile(regionId, accessKeyId, accessKeySecret));
6868
}
6969

70+
public BatchComputeClient(String regionId, String accessKeyId, String accessKeySecret, String stsToken) {
71+
if(regionMap.get(regionId)==null){
72+
BatchComputeClient.addEndpoint(regionId, "batchcompute."+regionId+".aliyuncs.com");
73+
}
74+
this.client = new DefaultAcsClient(DefaultProfile.getProfile(regionId, accessKeyId, accessKeySecret, stsToken));
75+
}
76+
7077

7178
/**
7279
* add region domain mapping
@@ -131,7 +138,7 @@ private <T extends AcsResponse> T getAcsResponse(AcsRequest<T> request) throws C
131138
System.out.println("\t" + key + ":" + reqHeaders.get(key));
132139
}
133140

134-
byte[] bs = request.getContent();
141+
byte[] bs = request.getHttpContent();
135142
if (bs == null) bs = new byte[]{};
136143
System.out.println("--->Request.Action:"+request.getActionName());
137144
System.out.println("--->Request.Body:->" + new String(bs)+"<-");
@@ -152,7 +159,7 @@ private <T extends AcsResponse> T getAcsResponse(AcsRequest<T> request) throws C
152159
System.out.println("\t" + key + ":" + headers.get(key));
153160
}
154161

155-
System.out.println("--->Response.body:" + new String(baseResponse.getContent()));
162+
System.out.println("--->Response.body:" + new String(baseResponse.getHttpContent()));
156163
}
157164
return HackAcsClient.parseAcsResponse(request.getResponseClass(), baseResponse);
158165
}

aliyun-java-sdk-batchcompute/src/main/java/com/aliyuncs/batchcompute/main/v20151111/HackAcsClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
public class HackAcsClient {
3838

3939
protected static <T extends AcsResponse> T parseAcsResponse(Class<T> clasz, HttpResponse baseResponse) throws ServerException, ClientException {
40-
FormatType format = baseResponse.getContentType();
40+
FormatType format = baseResponse.getHttpContentType();
4141
if (baseResponse.isSuccess()) {
4242
return readResponse(clasz, baseResponse, format);
4343
} else {
@@ -87,7 +87,7 @@ private static String getResponseContent(HttpResponse httpResponse) throws Clien
8787
String stringContent = null;
8888

8989
try {
90-
stringContent = new String(httpResponse.getContent(), httpResponse.getEncoding());
90+
stringContent = new String(httpResponse.getHttpContent(), httpResponse.getEncoding());
9191
return stringContent;
9292
} catch (UnsupportedEncodingException var4) {
9393
throw new ClientException("SDK.UnsupportedEncoding", "Can not parse response due to un supported encoding.",

aliyun-java-sdk-batchcompute/src/main/java/com/aliyuncs/batchcompute/pojo/v20151111/Cluster.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,18 @@ public void setNotification(Notification notification) {
7474
@JsonProperty("State")
7575
private String state;
7676

77+
@JsonIgnore
78+
public String getErrorCode() {
79+
return this.errorCode;
80+
}
81+
@JsonIgnore
82+
public void setErrorCode(String errorCode) {
83+
this.errorCode = errorCode;
84+
}
85+
86+
@JsonProperty("ErrorCode")
87+
private String errorCode;
88+
7789
@JsonIgnore
7890
public String getInstanceType() {
7991
return instanceType;

aliyun-java-sdk-batchcompute/src/main/java/com/aliyuncs/batchcompute/pojo/v20151111/ClusterDescription.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,19 @@ public class ClusterDescription {
4545
@JsonProperty("InstanceType")
4646
private String instanceType;
4747

48+
@JsonIgnore
49+
public String getScheduleType() {
50+
return scheduleType;
51+
}
52+
53+
@JsonIgnore
54+
public void setScheduleType(String scheduleType) {
55+
this.scheduleType = scheduleType;
56+
}
57+
58+
@JsonProperty("ScheduleType")
59+
private String scheduleType;
60+
4861
@JsonProperty("Groups")
4962
private Map<String, GroupDescription> groups;
5063

aliyun-java-sdk-batchcompute/src/main/java/com/aliyuncs/batchcompute/transform/v20151111/ChangeClusterDesiredVMCountRequestMarshaller.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static ChangeClusterDesiredVMCountRequest marshall(ChangeClusterDesiredVM
2727
}
2828

2929

30-
req.setContent(contentString.getBytes(), req.getEncoding(), req.getAcceptFormat());
30+
req.setHttpContent(contentString.getBytes(), req.getEncoding(), req.getAcceptFormat());
3131

3232
return req;
3333
}

aliyun-java-sdk-batchcompute/src/main/java/com/aliyuncs/batchcompute/transform/v20151111/ChangeJobPriorityRequestMarshaller.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static ChangeJobPriorityRequest marshall(ChangeJobPriorityRequest req) {
3434
contentString = "{\"Priority\":\"" + req.getPriority() + "\"}";
3535
}
3636

37-
req.setContent(contentString.getBytes(), req.getEncoding(), req.getAcceptFormat());
37+
req.setHttpContent(contentString.getBytes(), req.getEncoding(), req.getAcceptFormat());
3838

3939
return req;
4040
}

aliyun-java-sdk-batchcompute/src/main/java/com/aliyuncs/batchcompute/transform/v20151111/CreateAppRequestMarshaller.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public static CreateAppRequest marshall(CreateAppRequest req) throws ClientExcep
4343
throw new ClientException("API.EncodeError", "encode request body error");
4444
}
4545

46-
req.setContent(contentString.getBytes(), req.getEncoding(), req.getAcceptFormat());
46+
req.setHttpContent(contentString.getBytes(), req.getEncoding(), req.getAcceptFormat());
4747

4848
return req;
4949
}

0 commit comments

Comments
 (0)