Skip to content

Commit 7243946

Browse files
authored
server: Initial new vpnuser state (#8268)
1 parent 7d6dc41 commit 7243946

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

api/src/main/java/org/apache/cloudstack/api/command/user/vpn/AddVpnUserCmd.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ public void execute() {
125125
vpnResponse.setId(vpnUser.getUuid());
126126
vpnResponse.setUserName(vpnUser.getUsername());
127127
vpnResponse.setAccountName(account.getAccountName());
128+
// re-retrieve the vpnuser, as the call to `applyVpnUsers` might have changed the state
129+
vpnUser = _entityMgr.findById(VpnUser.class, getEntityId());
130+
vpnResponse.setState(vpnUser.getState().toString());
128131

129132
Domain domain = _entityMgr.findById(Domain.class, account.getDomainId());
130133
if (domain != null) {

api/src/main/java/org/apache/cloudstack/api/response/VpnUsersResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public class VpnUsersResponse extends BaseResponse implements ControlledEntityRe
5757
private String projectName;
5858

5959
@SerializedName(ApiConstants.STATE)
60-
@Param(description = "the state of the Vpn User")
60+
@Param(description = "the state of the Vpn User, can be 'Add', 'Revoke' or 'Active'.")
6161
private String state;
6262

6363
public void setId(String id) {

0 commit comments

Comments
 (0)