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