Skip to content

Commit 6a83e15

Browse files
jeongda-youngdhslove
authored andcommitted
가상머신 탭에서 할당된 호스트 디바이스 정보 조회
1 parent 8de6fed commit 6a83e15

19 files changed

Lines changed: 960 additions & 628 deletions

File tree

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
package org.apache.cloudstack.api.command.admin.outofbandmanagement;
18+
19+
import org.apache.cloudstack.acl.RoleType;
20+
import org.apache.cloudstack.api.APICommand;
21+
import org.apache.cloudstack.api.ApiArgValidator;
22+
import org.apache.cloudstack.api.ApiConstants;
23+
import org.apache.cloudstack.api.BaseCmd;
24+
import org.apache.cloudstack.api.BaseListCmd;
25+
import org.apache.cloudstack.api.Parameter;
26+
import org.apache.cloudstack.api.response.ListHostLunDevicesResponse;
27+
import org.apache.cloudstack.context.CallContext;
28+
// import org.apache.cloudstack.api.response.ListResponse;
29+
30+
31+
32+
@APICommand(name = "listHostLunDevices", description = "list Host LUN Devices'.", since = "4.20.0.0", responseObject = ListHostLunDevicesResponse.class, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false, authorized = { RoleType.Admin })
33+
public class ListHostLunDevicesCmd extends BaseListCmd {
34+
35+
private static final String LISTHOSTLUNDEVICES = "listhostusbdevices";
36+
37+
/////////////////////////////////////////////////////
38+
//////////////// API parameters /////////////////////
39+
/////////////////////////////////////////////////////
40+
41+
@Parameter(name = ApiConstants.ID, type = BaseCmd.CommandType.UUID, entityType = ListHostLunDevicesResponse.class, description = "host ID", required = true, validations = {
42+
ApiArgValidator.PositiveNumber })
43+
private Long id;
44+
45+
/////////////////////////////////////////////////////
46+
/////////////////// Accessors ///////////////////////a
47+
/////////////////////////////////////////////////////
48+
49+
public Long getId() {
50+
return id;
51+
}
52+
53+
/////////////////////////////////////////////////////
54+
/////////////// API Implementation///////////////////
55+
/////////////////////////////////////////////////////
56+
57+
public static String getResultObjectName() {
58+
return "listhostusbdevices";
59+
}
60+
61+
@Override
62+
public long getEntityOwnerId() {
63+
return CallContext.current().getCallingAccountId();
64+
}
65+
66+
@Override
67+
public void execute() {
68+
// ListResponse<ListHostLunDevicesResponse> response = _mgr.listHostLunDevices(this);
69+
// response.setResponseName(getCommandName());
70+
// response.setObjectName(getCommandName());
71+
// this.setResponseObject(response);
72+
}
73+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
package org.apache.cloudstack.api.command.admin.outofbandmanagement;
18+
19+
import org.apache.cloudstack.acl.RoleType;
20+
import org.apache.cloudstack.api.APICommand;
21+
import org.apache.cloudstack.api.ApiArgValidator;
22+
import org.apache.cloudstack.api.ApiConstants;
23+
import org.apache.cloudstack.api.BaseCmd;
24+
import org.apache.cloudstack.api.BaseListCmd;
25+
import org.apache.cloudstack.api.Parameter;
26+
import org.apache.cloudstack.api.response.ListHostUsbDevicesResponse;
27+
import org.apache.cloudstack.context.CallContext;
28+
// import org.apache.cloudstack.api.response.ListResponse;
29+
30+
31+
32+
@APICommand(name = "listHostUsbDevices", description = "list Host USB Devices'.", since = "4.20.0.0", responseObject = ListHostUsbDevicesResponse.class, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false, authorized = { RoleType.Admin })
33+
public class ListHostUsbDevicesCmd extends BaseListCmd {
34+
35+
private static final String LISTHOSTUSBDEVICES = "listhostusbdevices";
36+
37+
/////////////////////////////////////////////////////
38+
//////////////// API parameters /////////////////////
39+
/////////////////////////////////////////////////////
40+
41+
@Parameter(name = ApiConstants.ID, type = BaseCmd.CommandType.UUID, entityType = ListHostUsbDevicesResponse.class, description = "host ID", required = true, validations = {
42+
ApiArgValidator.PositiveNumber })
43+
private Long id;
44+
45+
/////////////////////////////////////////////////////
46+
/////////////////// Accessors ///////////////////////
47+
/////////////////////////////////////////////////////
48+
49+
public Long getId() {
50+
return id;
51+
}
52+
53+
/////////////////////////////////////////////////////
54+
/////////////// API Implementation///////////////////
55+
/////////////////////////////////////////////////////
56+
57+
public static String getResultObjectName() {
58+
return "listhostusbdevices";
59+
}
60+
61+
@Override
62+
public long getEntityOwnerId() {
63+
return CallContext.current().getCallingAccountId();
64+
}
65+
66+
@Override
67+
public void execute() {
68+
// ListResponse<ListHostUsbDevicesResponse> response = _mgr.listHostUsbDevices(this);
69+
// response.setResponseName(getCommandName());
70+
// response.setObjectName(getCommandName());
71+
// this.setResponseObject(response);
72+
}
73+
}
Lines changed: 113 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,114 @@
1-
// // Licensed to the Apache Software Foundation (ASF) under one
2-
// // or more contributor license agreements. See the NOTICE file
3-
// // distributed with this work for additional information
4-
// // regarding copyright ownership. The ASF licenses this file
5-
// // to you under the Apache License, Version 2.0 (the
6-
// // "License"); you may not use this file except in compliance
7-
// // with the License. You may obtain a copy of the License at
8-
// //
9-
// // http://www.apache.org/licenses/LICENSE-2.0
10-
// //
11-
// // Unless required by applicable law or agreed to in writing,
12-
// // software distributed under the License is distributed on an
13-
// // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14-
// // KIND, either express or implied. See the License for the
15-
// // specific language governing permissions and limitations
16-
// // under the License.
17-
// package org.apache.cloudstack.api.command.admin.outofbandmanagement;
18-
19-
// import org.apache.cloudstack.acl.RoleType;
20-
// import org.apache.cloudstack.api.APICommand;
21-
// import org.apache.cloudstack.api.ApiArgValidator;
22-
// import org.apache.cloudstack.api.ApiConstants;
23-
// import org.apache.cloudstack.api.BaseCmd;
24-
// import org.apache.cloudstack.api.BaseListCmd;
25-
// import org.apache.cloudstack.api.Parameter;
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
package org.apache.cloudstack.api.command.admin.outofbandmanagement;
18+
19+
import org.apache.cloudstack.acl.RoleType;
20+
import org.apache.cloudstack.api.APICommand;
21+
import org.apache.cloudstack.api.ApiArgValidator;
22+
import org.apache.cloudstack.api.ApiConstants;
23+
import org.apache.cloudstack.api.BaseCmd;
24+
import org.apache.cloudstack.api.BaseListCmd;
25+
import org.apache.cloudstack.api.Parameter;
26+
import org.apache.cloudstack.api.response.UpdateHostLunDevicesResponse;
27+
import org.apache.cloudstack.context.CallContext;
2628
// import org.apache.cloudstack.api.response.ListResponse;
27-
// import org.apache.cloudstack.api.response.UpdateHostLunDevicesResponse;
28-
// import org.apache.cloudstack.context.CallContext;
29-
// // import org.apache.cloudstack.api.response.HostResponse;
30-
31-
// @APICommand(name = "updateHostLunDevices", description = "list Host Lun Devices'.", since = "4.20.0.0", responseObject = UpdateHostLunDevicesResponse.class, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false, authorized = {
32-
// RoleType.Admin })
33-
// public class UpdateHostLunDevicesCmd extends BaseListCmd {
34-
35-
// private static final String UPDATEHOSTDEVICES = "updatehostdevices";
36-
37-
// /////////////////////////////////////////////////////
38-
// //////////////// API parameters /////////////////////
39-
// /////////////////////////////////////////////////////
40-
41-
// @Parameter(name = ApiConstants.HOST_ID, type = BaseCmd.CommandType.UUID, entityType = UpdateHostLunDevicesResponse.class, description = "host ID", required = true, validations = {
42-
// ApiArgValidator.PositiveNumber })
43-
// private Long hostId;
44-
45-
// @Parameter(name = ApiConstants.HOSTDEVICES_NAME, type = CommandType.STRING, required = true,
46-
// description = "Device name to allocate")
47-
// private String hostDeviceName;
48-
49-
// @Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID, type = CommandType.UUID,
50-
// entityType = UpdateHostLunDevicesResponse.class,
51-
// required = false, description = "VM ID to allocate the device to")
52-
// private Long vmId;
53-
54-
// @Parameter(name = ApiConstants.XML_CONFIG, type = CommandType.STRING, required = false,
55-
// description = "XML configuration for device attachment")
56-
// private String xmlConfig;
57-
58-
// @Parameter(name = ApiConstants.CURRENT_VM_ID, type = CommandType.STRING, required = false,
59-
// description = "Current VM ID")
60-
// private String currentVmId;
61-
62-
// /////////////////////////////////////////////////////
63-
// /////////////////// Accessors ///////////////////////
64-
// /////////////////////////////////////////////////////
65-
66-
// public Long getHostId() {
67-
// return hostId;
68-
// }
69-
70-
// public String getHostDeviceName() {
71-
// return hostDeviceName;
72-
// }
73-
74-
// public Long getVirtualMachineId() {
75-
// return vmId;
76-
// }
77-
78-
// public String getXmlConfig() {
79-
// return xmlConfig;
80-
// }
81-
82-
// public void setXmlConfig(String xmlConfig) {
83-
// this.xmlConfig = xmlConfig;
84-
// }
85-
86-
// public String getCurrentVmId() {
87-
// return currentVmId;
88-
// }
89-
90-
// public void setCurrentVmId(String currentVmId) {
91-
// this.currentVmId = currentVmId;
92-
// }
93-
94-
// /////////////////////////////////////////////////////
95-
// /////////////// API Implementation///////////////////
96-
// /////////////////////////////////////////////////////
97-
98-
// public static String getResultObjectName() {
99-
// return "updatehostdevices";
100-
// }
101-
102-
// @Override
103-
// public long getEntityOwnerId() {
104-
// return CallContext.current().getCallingAccountId();
105-
// }
106-
107-
// @Override
108-
// public void execute() {
109-
// ListResponse<UpdateHostLunDevicesResponse> response = _mgr.updateHostLunDevices(this);
110-
// response.setResponseName(getCommandName());
111-
// response.setObjectName(getCommandName());
112-
// this.setResponseObject(response);
113-
// }
114-
// }
29+
// import org.apache.cloudstack.api.response.HostResponse;
30+
31+
@APICommand(name = "updateHostLunDevices", description = "list Host Lun Devices'.", since = "4.20.0.0", responseObject = UpdateHostLunDevicesResponse.class, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false, authorized = {
32+
RoleType.Admin })
33+
public class UpdateHostLunDevicesCmd extends BaseListCmd {
34+
35+
private static final String UPDATEHOSTDEVICES = "updatehostdevices";
36+
37+
/////////////////////////////////////////////////////
38+
//////////////// API parameters /////////////////////
39+
/////////////////////////////////////////////////////
40+
41+
@Parameter(name = ApiConstants.HOST_ID, type = BaseCmd.CommandType.UUID, entityType = UpdateHostLunDevicesResponse.class, description = "host ID", required = true, validations = {
42+
ApiArgValidator.PositiveNumber })
43+
private Long hostId;
44+
45+
@Parameter(name = ApiConstants.HOSTDEVICES_NAME, type = CommandType.STRING, required = true,
46+
description = "Device name to allocate")
47+
private String hostDeviceName;
48+
49+
@Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID, type = CommandType.UUID,
50+
entityType = UpdateHostLunDevicesResponse.class,
51+
required = false, description = "VM ID to allocate the device to")
52+
private Long vmId;
53+
54+
@Parameter(name = ApiConstants.XML_CONFIG, type = CommandType.STRING, required = false,
55+
description = "XML configuration for device attachment")
56+
private String xmlConfig;
57+
58+
@Parameter(name = ApiConstants.CURRENT_VM_ID, type = CommandType.STRING, required = false,
59+
description = "Current VM ID")
60+
private String currentVmId;
61+
62+
/////////////////////////////////////////////////////
63+
/////////////////// Accessors ///////////////////////
64+
/////////////////////////////////////////////////////
65+
66+
public Long getHostId() {
67+
return hostId;
68+
}
69+
70+
public String getHostDeviceName() {
71+
return hostDeviceName;
72+
}
73+
74+
public Long getVirtualMachineId() {
75+
return vmId;
76+
}
77+
78+
public String getXmlConfig() {
79+
return xmlConfig;
80+
}
81+
82+
public void setXmlConfig(String xmlConfig) {
83+
this.xmlConfig = xmlConfig;
84+
}
85+
86+
public String getCurrentVmId() {
87+
return currentVmId;
88+
}
89+
90+
public void setCurrentVmId(String currentVmId) {
91+
this.currentVmId = currentVmId;
92+
}
93+
94+
/////////////////////////////////////////////////////
95+
/////////////// API Implementation///////////////////
96+
/////////////////////////////////////////////////////
97+
98+
public static String getResultObjectName() {
99+
return "updatehostdevices";
100+
}
101+
102+
@Override
103+
public long getEntityOwnerId() {
104+
return CallContext.current().getCallingAccountId();
105+
}
106+
107+
@Override
108+
public void execute() {
109+
// ListResponse<UpdateHostLunDevicesResponse> response = _mgr.updateHostLunDevices(this);
110+
// response.setResponseName(getCommandName());
111+
// response.setObjectName(getCommandName());
112+
// this.setResponseObject(response);
113+
}
114+
}

0 commit comments

Comments
 (0)