Skip to content

Commit f4f56be

Browse files
committed
ecs sdk 增加sshkey相关api
1 parent f1c71c0 commit f4f56be

24 files changed

+1480
-46
lines changed

aliyun-java-sdk-ecs/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-ecs</artifactId>
55
<packaging>jar</packaging>
6-
<version>3.0.0</version>
6+
<version>3.1.0</version>
77
<name>aliyun-java-sdk-ecs</name>
88
<url>http://www.aliyun.com</url>
99
<description>Aliyun Open API SDK for Java
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package com.aliyuncs.ecs.model.v20140526;
20+
21+
import com.aliyuncs.RpcAcsRequest;
22+
23+
/**
24+
* @author auto create
25+
* @version
26+
*/
27+
public class AttachKeyPairRequest extends RpcAcsRequest<AttachKeyPairResponse> {
28+
29+
public AttachKeyPairRequest() {
30+
super("Ecs", "2014-05-26", "AttachKeyPair", "ecs");
31+
}
32+
33+
private Long ownerId;
34+
35+
private String resourceOwnerAccount;
36+
37+
private Long resourceOwnerId;
38+
39+
private String keyPairName;
40+
41+
private String instanceIds;
42+
43+
public Long getOwnerId() {
44+
return this.ownerId;
45+
}
46+
47+
public void setOwnerId(Long ownerId) {
48+
this.ownerId = ownerId;
49+
putQueryParameter("OwnerId", ownerId);
50+
}
51+
52+
public String getResourceOwnerAccount() {
53+
return this.resourceOwnerAccount;
54+
}
55+
56+
public void setResourceOwnerAccount(String resourceOwnerAccount) {
57+
this.resourceOwnerAccount = resourceOwnerAccount;
58+
putQueryParameter("ResourceOwnerAccount", resourceOwnerAccount);
59+
}
60+
61+
public Long getResourceOwnerId() {
62+
return this.resourceOwnerId;
63+
}
64+
65+
public void setResourceOwnerId(Long resourceOwnerId) {
66+
this.resourceOwnerId = resourceOwnerId;
67+
putQueryParameter("ResourceOwnerId", resourceOwnerId);
68+
}
69+
70+
public String getKeyPairName() {
71+
return this.keyPairName;
72+
}
73+
74+
public void setKeyPairName(String keyPairName) {
75+
this.keyPairName = keyPairName;
76+
putQueryParameter("KeyPairName", keyPairName);
77+
}
78+
79+
public String getInstanceIds() {
80+
return this.instanceIds;
81+
}
82+
83+
public void setInstanceIds(String instanceIds) {
84+
this.instanceIds = instanceIds;
85+
putQueryParameter("InstanceIds", instanceIds);
86+
}
87+
88+
@Override
89+
public Class<AttachKeyPairResponse> getResponseClass() {
90+
return AttachKeyPairResponse.class;
91+
}
92+
93+
}
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package com.aliyuncs.ecs.model.v20140526;
20+
21+
import java.util.List;
22+
import com.aliyuncs.AcsResponse;
23+
import com.aliyuncs.ecs.transform.v20140526.AttachKeyPairResponseUnmarshaller;
24+
import com.aliyuncs.transform.UnmarshallerContext;
25+
26+
/**
27+
* @author auto create
28+
* @version
29+
*/
30+
public class AttachKeyPairResponse extends AcsResponse {
31+
32+
private String requestId;
33+
34+
private String totalCount;
35+
36+
private String failCount;
37+
38+
private String keyPairName;
39+
40+
private List<Result> results;
41+
42+
public String getRequestId() {
43+
return this.requestId;
44+
}
45+
46+
public void setRequestId(String requestId) {
47+
this.requestId = requestId;
48+
}
49+
50+
public String getTotalCount() {
51+
return this.totalCount;
52+
}
53+
54+
public void setTotalCount(String totalCount) {
55+
this.totalCount = totalCount;
56+
}
57+
58+
public String getFailCount() {
59+
return this.failCount;
60+
}
61+
62+
public void setFailCount(String failCount) {
63+
this.failCount = failCount;
64+
}
65+
66+
public String getKeyPairName() {
67+
return this.keyPairName;
68+
}
69+
70+
public void setKeyPairName(String keyPairName) {
71+
this.keyPairName = keyPairName;
72+
}
73+
74+
public List<Result> getResults() {
75+
return this.results;
76+
}
77+
78+
public void setResults(List<Result> results) {
79+
this.results = results;
80+
}
81+
82+
public static class Result {
83+
84+
private String instanceId;
85+
86+
private String success;
87+
88+
private String code;
89+
90+
private String message;
91+
92+
public String getInstanceId() {
93+
return this.instanceId;
94+
}
95+
96+
public void setInstanceId(String instanceId) {
97+
this.instanceId = instanceId;
98+
}
99+
100+
public String getSuccess() {
101+
return this.success;
102+
}
103+
104+
public void setSuccess(String success) {
105+
this.success = success;
106+
}
107+
108+
public String getCode() {
109+
return this.code;
110+
}
111+
112+
public void setCode(String code) {
113+
this.code = code;
114+
}
115+
116+
public String getMessage() {
117+
return this.message;
118+
}
119+
120+
public void setMessage(String message) {
121+
this.message = message;
122+
}
123+
}
124+
125+
@Override
126+
public AttachKeyPairResponse getInstance(UnmarshallerContext context) {
127+
return AttachKeyPairResponseUnmarshaller.unmarshall(this, context);
128+
}
129+
}

aliyun-java-sdk-ecs/src/main/java/com/aliyuncs/ecs/model/v20140526/CreateInstanceRequest.java

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

2323
/**
2424
* @author auto create
25-
* @version
25+
* @version
2626
*/
2727
public class CreateInstanceRequest extends RpcAcsRequest<CreateInstanceResponse> {
28-
28+
2929
public CreateInstanceRequest() {
3030
super("Ecs", "2014-05-26", "CreateInstance", "ecs");
3131
}
@@ -58,6 +58,8 @@ public CreateInstanceRequest() {
5858

5959
private String password;
6060

61+
private String deploymentSetId;
62+
6163
private String zoneId;
6264

6365
private String clusterId;
@@ -174,6 +176,8 @@ public CreateInstanceRequest() {
174176

175177
private String spotStrategy;
176178

179+
private String keyPairName;
180+
177181
public Long getOwnerId() {
178182
return this.ownerId;
179183
}
@@ -300,6 +304,15 @@ public void setPassword(String password) {
300304
putQueryParameter("Password", password);
301305
}
302306

307+
public String getDeploymentSetId() {
308+
return this.deploymentSetId;
309+
}
310+
311+
public void setDeploymentSetId(String deploymentSetId) {
312+
this.deploymentSetId = deploymentSetId;
313+
putQueryParameter("DeploymentSetId", deploymentSetId);
314+
}
315+
303316
public String getZoneId() {
304317
return this.zoneId;
305318
}
@@ -822,6 +835,15 @@ public void setSpotStrategy(String spotStrategy) {
822835
putQueryParameter("SpotStrategy", spotStrategy);
823836
}
824837

838+
public String getKeyPairName() {
839+
return this.keyPairName;
840+
}
841+
842+
public void setKeyPairName(String keyPairName) {
843+
this.keyPairName = keyPairName;
844+
putQueryParameter("KeyPairName", keyPairName);
845+
}
846+
825847
@Override
826848
public Class<CreateInstanceResponse> getResponseClass() {
827849
return CreateInstanceResponse.class;
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package com.aliyuncs.ecs.model.v20140526;
20+
21+
import com.aliyuncs.RpcAcsRequest;
22+
23+
/**
24+
* @author auto create
25+
* @version
26+
*/
27+
public class CreateKeyPairRequest extends RpcAcsRequest<CreateKeyPairResponse> {
28+
29+
public CreateKeyPairRequest() {
30+
super("Ecs", "2014-05-26", "CreateKeyPair", "ecs");
31+
}
32+
33+
private Long ownerId;
34+
35+
private String resourceOwnerAccount;
36+
37+
private Long resourceOwnerId;
38+
39+
private String keyPairName;
40+
41+
public Long getOwnerId() {
42+
return this.ownerId;
43+
}
44+
45+
public void setOwnerId(Long ownerId) {
46+
this.ownerId = ownerId;
47+
putQueryParameter("OwnerId", ownerId);
48+
}
49+
50+
public String getResourceOwnerAccount() {
51+
return this.resourceOwnerAccount;
52+
}
53+
54+
public void setResourceOwnerAccount(String resourceOwnerAccount) {
55+
this.resourceOwnerAccount = resourceOwnerAccount;
56+
putQueryParameter("ResourceOwnerAccount", resourceOwnerAccount);
57+
}
58+
59+
public Long getResourceOwnerId() {
60+
return this.resourceOwnerId;
61+
}
62+
63+
public void setResourceOwnerId(Long resourceOwnerId) {
64+
this.resourceOwnerId = resourceOwnerId;
65+
putQueryParameter("ResourceOwnerId", resourceOwnerId);
66+
}
67+
68+
public String getKeyPairName() {
69+
return this.keyPairName;
70+
}
71+
72+
public void setKeyPairName(String keyPairName) {
73+
this.keyPairName = keyPairName;
74+
putQueryParameter("KeyPairName", keyPairName);
75+
}
76+
77+
@Override
78+
public Class<CreateKeyPairResponse> getResponseClass() {
79+
return CreateKeyPairResponse.class;
80+
}
81+
82+
}

0 commit comments

Comments
 (0)