Skip to content

Commit b54a0f8

Browse files
committed
Support command audit for ecs.
1 parent 0d855d5 commit b54a0f8

File tree

5 files changed

+259
-1
lines changed

5 files changed

+259
-1
lines changed

aliyun-java-sdk-ecs-workbench/ChangeLog.txt

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2024-09-27 Version: 1.0.9
2+
- Support command audit for ecs.
3+
14
2024-08-21 Version: 1.0.8
25
- Support record for ecs.
36

aliyun-java-sdk-ecs-workbench/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>com.aliyun</groupId>
55
<artifactId>aliyun-java-sdk-ecs-workbench</artifactId>
66
<packaging>jar</packaging>
7-
<version>1.0.8</version>
7+
<version>1.0.9</version>
88
<name>aliyun-java-sdk-ecs-workbench</name>
99
<url>http://www.aliyun.com</url>
1010
<description>Aliyun Open API SDK for Java
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/*
2+
* Licensed under the Apache License, Version 2.0 (the "License");
3+
* you may not use this file except in compliance with the License.
4+
* You may obtain a copy of the License at
5+
*
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
*
8+
* Unless required by applicable law or agreed to in writing, software
9+
* distributed under the License is distributed on an "AS IS" BASIS,
10+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
* See the License for the specific language governing permissions and
12+
* limitations under the License.
13+
*/
14+
15+
package com.aliyuncs.ecs_workbench.model.v20220220;
16+
17+
import com.aliyuncs.RpcAcsRequest;
18+
import com.aliyuncs.http.ProtocolType;
19+
import com.aliyuncs.http.MethodType;
20+
21+
/**
22+
* @author auto create
23+
* @version
24+
*/
25+
public class ListTerminalCommandsRequest extends RpcAcsRequest<ListTerminalCommandsResponse> {
26+
27+
28+
private Integer pageNumber;
29+
30+
private Integer pageSize;
31+
32+
private String terminalSessionToken;
33+
public ListTerminalCommandsRequest() {
34+
super("ecs-workbench", "2022-02-20", "ListTerminalCommands", "ecs-workbench");
35+
setProtocol(ProtocolType.HTTPS);
36+
setMethod(MethodType.POST);
37+
}
38+
39+
public Integer getPageNumber() {
40+
return this.pageNumber;
41+
}
42+
43+
public void setPageNumber(Integer pageNumber) {
44+
this.pageNumber = pageNumber;
45+
if(pageNumber != null){
46+
putBodyParameter("PageNumber", pageNumber.toString());
47+
}
48+
}
49+
50+
public Integer getPageSize() {
51+
return this.pageSize;
52+
}
53+
54+
public void setPageSize(Integer pageSize) {
55+
this.pageSize = pageSize;
56+
if(pageSize != null){
57+
putBodyParameter("PageSize", pageSize.toString());
58+
}
59+
}
60+
61+
public String getTerminalSessionToken() {
62+
return this.terminalSessionToken;
63+
}
64+
65+
public void setTerminalSessionToken(String terminalSessionToken) {
66+
this.terminalSessionToken = terminalSessionToken;
67+
if(terminalSessionToken != null){
68+
putBodyParameter("TerminalSessionToken", terminalSessionToken);
69+
}
70+
}
71+
72+
@Override
73+
public Class<ListTerminalCommandsResponse> getResponseClass() {
74+
return ListTerminalCommandsResponse.class;
75+
}
76+
77+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
/*
2+
* Licensed under the Apache License, Version 2.0 (the "License");
3+
* you may not use this file except in compliance with the License.
4+
* You may obtain a copy of the License at
5+
*
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
*
8+
* Unless required by applicable law or agreed to in writing, software
9+
* distributed under the License is distributed on an "AS IS" BASIS,
10+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
* See the License for the specific language governing permissions and
12+
* limitations under the License.
13+
*/
14+
15+
package com.aliyuncs.ecs_workbench.model.v20220220;
16+
17+
import java.util.List;
18+
import com.aliyuncs.AcsResponse;
19+
import com.aliyuncs.ecs_workbench.transform.v20220220.ListTerminalCommandsResponseUnmarshaller;
20+
import com.aliyuncs.transform.UnmarshallerContext;
21+
22+
/**
23+
* @author auto create
24+
* @version
25+
*/
26+
public class ListTerminalCommandsResponse extends AcsResponse {
27+
28+
private Integer totalCount;
29+
30+
private Integer pageSize;
31+
32+
private Integer pageNumber;
33+
34+
private String requestId;
35+
36+
private List<TerminalCommandListItem> terminalCommandList;
37+
38+
public Integer getTotalCount() {
39+
return this.totalCount;
40+
}
41+
42+
public void setTotalCount(Integer totalCount) {
43+
this.totalCount = totalCount;
44+
}
45+
46+
public Integer getPageSize() {
47+
return this.pageSize;
48+
}
49+
50+
public void setPageSize(Integer pageSize) {
51+
this.pageSize = pageSize;
52+
}
53+
54+
public Integer getPageNumber() {
55+
return this.pageNumber;
56+
}
57+
58+
public void setPageNumber(Integer pageNumber) {
59+
this.pageNumber = pageNumber;
60+
}
61+
62+
public String getRequestId() {
63+
return this.requestId;
64+
}
65+
66+
public void setRequestId(String requestId) {
67+
this.requestId = requestId;
68+
}
69+
70+
public List<TerminalCommandListItem> getTerminalCommandList() {
71+
return this.terminalCommandList;
72+
}
73+
74+
public void setTerminalCommandList(List<TerminalCommandListItem> terminalCommandList) {
75+
this.terminalCommandList = terminalCommandList;
76+
}
77+
78+
public static class TerminalCommandListItem {
79+
80+
private String createTime;
81+
82+
private String commandLine;
83+
84+
private String loginUser;
85+
86+
private String executePath;
87+
88+
public String getCreateTime() {
89+
return this.createTime;
90+
}
91+
92+
public void setCreateTime(String createTime) {
93+
this.createTime = createTime;
94+
}
95+
96+
public String getCommandLine() {
97+
return this.commandLine;
98+
}
99+
100+
public void setCommandLine(String commandLine) {
101+
this.commandLine = commandLine;
102+
}
103+
104+
public String getLoginUser() {
105+
return this.loginUser;
106+
}
107+
108+
public void setLoginUser(String loginUser) {
109+
this.loginUser = loginUser;
110+
}
111+
112+
public String getExecutePath() {
113+
return this.executePath;
114+
}
115+
116+
public void setExecutePath(String executePath) {
117+
this.executePath = executePath;
118+
}
119+
}
120+
121+
@Override
122+
public ListTerminalCommandsResponse getInstance(UnmarshallerContext context) {
123+
return ListTerminalCommandsResponseUnmarshaller.unmarshall(this, context);
124+
}
125+
126+
@Override
127+
public boolean checkShowJsonItemName() {
128+
return false;
129+
}
130+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* Licensed under the Apache License, Version 2.0 (the "License");
3+
* you may not use this file except in compliance with the License.
4+
* You may obtain a copy of the License at
5+
*
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
*
8+
* Unless required by applicable law or agreed to in writing, software
9+
* distributed under the License is distributed on an "AS IS" BASIS,
10+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
* See the License for the specific language governing permissions and
12+
* limitations under the License.
13+
*/
14+
15+
package com.aliyuncs.ecs_workbench.transform.v20220220;
16+
17+
import java.util.ArrayList;
18+
import java.util.List;
19+
20+
import com.aliyuncs.ecs_workbench.model.v20220220.ListTerminalCommandsResponse;
21+
import com.aliyuncs.ecs_workbench.model.v20220220.ListTerminalCommandsResponse.TerminalCommandListItem;
22+
import com.aliyuncs.transform.UnmarshallerContext;
23+
24+
25+
public class ListTerminalCommandsResponseUnmarshaller {
26+
27+
public static ListTerminalCommandsResponse unmarshall(ListTerminalCommandsResponse listTerminalCommandsResponse, UnmarshallerContext _ctx) {
28+
29+
listTerminalCommandsResponse.setRequestId(_ctx.stringValue("ListTerminalCommandsResponse.RequestId"));
30+
listTerminalCommandsResponse.setTotalCount(_ctx.integerValue("ListTerminalCommandsResponse.TotalCount"));
31+
listTerminalCommandsResponse.setPageSize(_ctx.integerValue("ListTerminalCommandsResponse.PageSize"));
32+
listTerminalCommandsResponse.setPageNumber(_ctx.integerValue("ListTerminalCommandsResponse.PageNumber"));
33+
34+
List<TerminalCommandListItem> terminalCommandList = new ArrayList<TerminalCommandListItem>();
35+
for (int i = 0; i < _ctx.lengthValue("ListTerminalCommandsResponse.TerminalCommandList.Length"); i++) {
36+
TerminalCommandListItem terminalCommandListItem = new TerminalCommandListItem();
37+
terminalCommandListItem.setCreateTime(_ctx.stringValue("ListTerminalCommandsResponse.TerminalCommandList["+ i +"].CreateTime"));
38+
terminalCommandListItem.setCommandLine(_ctx.stringValue("ListTerminalCommandsResponse.TerminalCommandList["+ i +"].CommandLine"));
39+
terminalCommandListItem.setLoginUser(_ctx.stringValue("ListTerminalCommandsResponse.TerminalCommandList["+ i +"].LoginUser"));
40+
terminalCommandListItem.setExecutePath(_ctx.stringValue("ListTerminalCommandsResponse.TerminalCommandList["+ i +"].ExecutePath"));
41+
42+
terminalCommandList.add(terminalCommandListItem);
43+
}
44+
listTerminalCommandsResponse.setTerminalCommandList(terminalCommandList);
45+
46+
return listTerminalCommandsResponse;
47+
}
48+
}

0 commit comments

Comments
 (0)