Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6548bed

Browse files
author
归邪
committed
sdk-batchcompute 3.2.0
1 parent 602d72a commit 6548bed

File tree

16 files changed

+307
-28
lines changed

16 files changed

+307
-28
lines changed

aliyun-java-sdk-batchcompute/Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Batchcompute SDK For Java
2020
<dependency>
2121
<groupId>com.aliyun</groupId>
2222
<artifactId>aliyun-java-sdk-batchcompute</artifactId>
23-
<version>3.1.1</version>
23+
<version>3.2.0</version>
2424
</dependency>
2525
```
2626

aliyun-java-sdk-batchcompute/pom.xml

Lines changed: 1 addition & 1 deletion
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>3.1.1</version>
6+
<version>3.2.0</version>
77
<name>aliyun-java-sdk-batchcompute</name>
88
<url>http://www.aliyun.com</url>
99
<description>Aliyun Open API SDK for Java

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
@@ -54,6 +54,18 @@ public class Cluster {
5454
@JsonProperty("Configs")
5555
private Configs configs;
5656

57+
@JsonIgnore
58+
public Notification getNotification() {
59+
return notification;
60+
}
61+
@JsonIgnore
62+
public void setNotification(Notification notification) {
63+
this.notification = notification;
64+
}
65+
66+
@JsonProperty("Notification")
67+
private Notification notification;
68+
5769

5870

5971
@JsonProperty("CreationTime")

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@ public class ClusterDescription {
5151
@JsonProperty("UserData")
5252
private Map<String, String> userData;
5353

54+
@JsonIgnore
55+
public Notification getNotification() {
56+
return notification;
57+
}
58+
@JsonIgnore
59+
public void setNotification(Notification notification) {
60+
this.notification = notification;
61+
}
62+
63+
@JsonProperty("Notification")
64+
private Notification notification;
65+
5466

5567
@JsonIgnore
5668
public Configs getConfigs() {

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,22 @@ public void setAutoRelease(boolean autoRelease) {
6161
private boolean autoRelease;
6262

6363

64-
6564
@JsonProperty("Type")
6665
private String type;
6766

67+
@JsonProperty("Notification")
68+
private Notification notification;
69+
70+
71+
@JsonIgnore
72+
public Notification getNotification() {
73+
return notification;
74+
}
75+
@JsonIgnore
76+
public void setNotification(Notification notification) {
77+
this.notification = notification;
78+
}
79+
6880

6981
@JsonIgnore
7082
public String getName() {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.aliyuncs.batchcompute.pojo.v20151111;
2+
3+
import org.codehaus.jackson.annotate.JsonIgnore;
4+
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
5+
import org.codehaus.jackson.annotate.JsonProperty;
6+
7+
/**
8+
* Created by guangchun.luo on 16/12/1.
9+
*/
10+
@JsonIgnoreProperties(ignoreUnknown = true)
11+
public class Notification {
12+
13+
@JsonIgnore
14+
public Topic getTopic() {
15+
return topic;
16+
}
17+
18+
@JsonIgnore
19+
public void setTopic(Topic topic) {
20+
this.topic = topic;
21+
}
22+
23+
@JsonProperty("Topic")
24+
private Topic topic;
25+
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class TaskDescription {
5252

5353

5454
@JsonProperty("Timeout")
55-
private int timeout;
55+
private long timeout;
5656

5757
@JsonProperty("InstanceCount")
5858
private int instanceCount;
@@ -166,11 +166,11 @@ public void setLogMapping(Map<String, String> logMapping) {
166166
this.logMapping = logMapping;
167167
}
168168
@JsonIgnore
169-
public int getTimeout() {
169+
public long getTimeout() {
170170
return this.timeout;
171171
}
172172
@JsonIgnore
173-
public void setTimeout(int timeout) {
173+
public void setTimeout(long timeout) {
174174
this.timeout = timeout;
175175
}
176176
@JsonIgnore
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
package com.aliyuncs.batchcompute.pojo.v20151111;
2+
3+
import org.codehaus.jackson.annotate.JsonIgnore;
4+
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
5+
import org.codehaus.jackson.annotate.JsonProperty;
6+
7+
import java.util.ArrayList;
8+
import java.util.List;
9+
10+
/**
11+
* Created by guangchun.luo on 16/12/1.
12+
*/
13+
@JsonIgnoreProperties(ignoreUnknown = true)
14+
public class Topic {
15+
16+
//cluster相关事件
17+
public final static String ON_CLUSTER_DELETED = "OnClusterDeleted";
18+
public final static String ON_CLUSTER_INSTANCE_CREATED = "OnInstanceCreated";
19+
public final static String ON_CLUSTER_INSTANCE_ACTIVE = "OnInstanceActive";
20+
21+
//job相关事件
22+
public final static String ON_JOB_WAITING = "OnJobWaiting";
23+
public final static String ON_JOB_RUNNING = "OnJobRunning";
24+
public final static String ON_JOB_STOPPED = "OnJobStopped";
25+
public final static String ON_JOB_FINISHED = "OnJobFinished";
26+
public final static String ON_JOB_FAILED = "OnJobFailed";
27+
28+
public final static String ON_TASK_WAITING = "OnTaskWaiting";
29+
public final static String ON_TASK_RUNNING = "OnTaskRunning";
30+
public final static String ON_TASK_STOPPED = "OnTaskStopped";
31+
public final static String ON_TASK_FINISHED = "OnTaskFinished";
32+
public final static String ON_TASK_FAILED = "OnTaskFailed";
33+
34+
public final static String ON_INSTANCE_WAITING = "OnInstanceWaiting";
35+
public final static String ON_INSTANCE_RUNNING = "OnInstanceRunning";
36+
public final static String ON_INSTANCE_STOPPED = "OnInstanceStopped";
37+
public final static String ON_INSTANCE_FINISHED = "OnInstanceFinished";
38+
public final static String ON_INSTANCE_FAILED = "OnInstanceFailed";
39+
40+
public final static String ON_PRIORITY_CHANGE = "OnPriorityChange";
41+
42+
43+
@JsonProperty("Name")
44+
private String name;
45+
46+
@JsonProperty("Endpoint")
47+
private String endpoint;
48+
49+
@JsonProperty("Events")
50+
private List<String> events;
51+
52+
53+
@JsonIgnore
54+
public String getName() {
55+
return name;
56+
}
57+
58+
@JsonIgnore
59+
public void setName(String name) {
60+
this.name = name;
61+
}
62+
63+
@JsonIgnore
64+
public String getEndpoint() {
65+
return endpoint;
66+
}
67+
68+
@JsonIgnore
69+
public void setEndpoint(String endpoint) {
70+
this.endpoint = endpoint;
71+
}
72+
73+
@JsonIgnore
74+
public List<String> getEvents() {
75+
return events;
76+
}
77+
78+
@JsonIgnore
79+
public void setEvents(List<String> events) {
80+
this.events = events;
81+
}
82+
83+
public void addEvent(String event) {
84+
if(this.events==null){
85+
this.events = new ArrayList<String>();
86+
}
87+
this.events.add(event);
88+
}
89+
90+
91+
92+
}

aliyun-java-sdk-batchcompute/src/test/java/com/aliyuncs/batchcompute/functiontest/v20151111/ClusterInstanceTest.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class ClusterInstanceTest extends TestCase {
3838

3939
private static BatchCompute client;
4040

41-
private String gImageId;
41+
private String gImageId = "ubuntu";
4242

4343
private String gClusterId;
4444

@@ -53,9 +53,6 @@ public void setUp() throws Exception {
5353
BatchComputeClient.addRequestHeader("x-acs-source-ip", "127.0.0.1");
5454
BatchComputeClient.addRequestHeader("x-acs-secure-transport", "true");
5555

56-
gImageId = cfg.getEcsImageId();
57-
System.out.println("=========="+gImageId);
58-
5956
client = new BatchComputeClient(cfg.getRegionId(), cfg.getAccessId(), cfg.getAccessKey());
6057
}
6158

aliyun-java-sdk-batchcompute/src/test/java/com/aliyuncs/batchcompute/functiontest/v20151111/ClusterTest.java

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class ClusterTest extends TestCase {
3838

3939
private static BatchCompute client;
4040

41-
private String gImageId;
41+
private String gImageId = "ubuntu";
4242

4343
private String gClusterId;
4444

@@ -51,9 +51,6 @@ public void setUp() throws Exception {
5151
BatchComputeClient.addRequestHeader("x-acs-source-ip", "127.0.0.1");
5252
BatchComputeClient.addRequestHeader("x-acs-secure-transport", "true");
5353

54-
gImageId = cfg.getEcsImageId();
55-
System.out.println("=========="+gImageId);
56-
5754
client = new BatchComputeClient(cfg.getRegionId(), cfg.getAccessId(), cfg.getAccessKey());
5855
}
5956

@@ -101,6 +98,11 @@ public void testCluster() throws ClientException {
10198
SystemDisk systemDisk = disks.getSystemDisk();
10299
assertEquals(80, systemDisk.getSize());
103100

101+
Topic topic = cluster.getNotification().getTopic();
102+
assertEquals("tp_n2", topic.getName());
103+
assertEquals("xxxx", topic.getEndpoint());
104+
assertEquals(2, topic.getEvents().size());
105+
104106

105107
//3. list cluster
106108
ListClustersResponse listClustersResponse = client.listClusters();
@@ -165,6 +167,15 @@ private ClusterDescription getClusterDesc(){
165167

166168
desc.addUserData("a","bb");
167169

170+
Notification noti = new Notification();
171+
Topic topic = new Topic();
172+
topic.addEvent(Topic.ON_CLUSTER_DELETED);
173+
topic.addEvent(Topic.ON_CLUSTER_INSTANCE_ACTIVE);
174+
noti.setTopic(topic);
175+
topic.setName("tp_n2");
176+
topic.setEndpoint("xxxx");
177+
desc.setNotification(noti);
178+
168179
return desc;
169180
}
170181

0 commit comments

Comments
 (0)