|
16 | 16 | // under the License. |
17 | 17 | package org.apache.cloudstack.api.command.user.vpn; |
18 | 18 |
|
19 | | -import org.apache.log4j.Logger; |
20 | | - |
| 19 | +import org.apache.cloudstack.acl.RoleType; |
21 | 20 | import org.apache.cloudstack.api.APICommand; |
22 | 21 | import org.apache.cloudstack.api.ApiConstants; |
23 | 22 | import org.apache.cloudstack.api.ApiErrorCode; |
|
28 | 27 | import org.apache.cloudstack.api.response.DomainResponse; |
29 | 28 | import org.apache.cloudstack.api.response.IPAddressResponse; |
30 | 29 | import org.apache.cloudstack.api.response.RemoteAccessVpnResponse; |
| 30 | +import org.apache.log4j.Logger; |
31 | 31 |
|
32 | 32 | import com.cloud.event.EventTypes; |
33 | 33 | import com.cloud.exception.InvalidParameterValueException; |
@@ -74,10 +74,14 @@ public class CreateRemoteAccessVpnCmd extends BaseAsyncCreateCmd { |
74 | 74 | description = "if true, firewall rule for source/end pubic port is automatically created; if false - firewall rule has to be created explicitely. Has value true by default") |
75 | 75 | private Boolean openFirewall; |
76 | 76 |
|
| 77 | + @Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description = "an optional field, whether to the display the vpn to the end user or not", since = "4.4", authorized = {RoleType.Admin}) |
| 78 | + private Boolean display; |
| 79 | + |
77 | 80 | ///////////////////////////////////////////////////// |
78 | 81 | /////////////////// Accessors /////////////////////// |
79 | 82 | ///////////////////////////////////////////////////// |
80 | 83 |
|
| 84 | + |
81 | 85 | public Long getPublicIpId() { |
82 | 86 | return publicIpId; |
83 | 87 | } |
@@ -139,7 +143,7 @@ public String getEventType() { |
139 | 143 | @Override |
140 | 144 | public void create() { |
141 | 145 | try { |
142 | | - RemoteAccessVpn vpn = _ravService.createRemoteAccessVpn(publicIpId, ipRange, getOpenFirewall()); |
| 146 | + RemoteAccessVpn vpn = _ravService.createRemoteAccessVpn(publicIpId, ipRange, getOpenFirewall(), getDisplay()); |
143 | 147 | if (vpn != null) { |
144 | 148 | this.setEntityId(vpn.getServerAddressId()); |
145 | 149 | // find uuid for server ip address |
@@ -191,4 +195,8 @@ private IpAddress getIp() { |
191 | 195 | } |
192 | 196 | return ip; |
193 | 197 | } |
| 198 | + |
| 199 | + public Boolean getDisplay() { |
| 200 | + return display; |
| 201 | + } |
194 | 202 | } |
0 commit comments