Skip to content

Commit 4da9dfb

Browse files
committed
Adding since for params
1 parent 0048d1e commit 4da9dfb

8 files changed

Lines changed: 25 additions & 13 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public class DomainRouterResponse extends BaseResponse implements ControlledView
7878
private String podId;
7979

8080
@SerializedName(ApiConstants.POD_NAME)
81-
@Param(description = "the Pod name for the router")
81+
@Param(description = "the Pod name for the router", since = "4.13.2")
8282
private String podName;
8383

8484
@SerializedName(ApiConstants.HOST_ID)
@@ -150,7 +150,7 @@ public class DomainRouterResponse extends BaseResponse implements ControlledView
150150
private String templateId;
151151

152152
@SerializedName(ApiConstants.TEMPLATE_NAME)
153-
@Param(description = "the template name for the router")
153+
@Param(description = "the template name for the router", since = "4.13.2")
154154
private String templateName;
155155

156156
@SerializedName(ApiConstants.CREATED)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public class IPAddressResponse extends BaseResponse implements ControlledEntityR
140140
private String vpcId;
141141

142142
@SerializedName(ApiConstants.VPC_NAME)
143-
@Param(description = "VPC name the ip belongs to")
143+
@Param(description = "VPC name the ip belongs to", since = "4.13.2")
144144
private String vpcName;
145145

146146
@SerializedName(ApiConstants.TAGS)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public class PrivateGatewayResponse extends BaseResponse implements ControlledEn
6262
private String vpcId;
6363

6464
@SerializedName(ApiConstants.VPC_NAME)
65-
@Param(description = "VPC name the private gateway belongs to")
65+
@Param(description = "VPC name the private gateway belongs to", since = "4.13.2")
6666
private String vpcName;
6767

6868
@SerializedName(ApiConstants.PHYSICAL_NETWORK_ID)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class Site2SiteVpnGatewayResponse extends BaseResponse implements Control
4343
private String vpcId;
4444

4545
@SerializedName(ApiConstants.VPC_NAME)
46-
@Param(description = "the vpc name of this gateway")
46+
@Param(description = "the vpc name of this gateway", since = "4.13.2")
4747
private String vpcName;
4848

4949
@SerializedName(ApiConstants.ACCOUNT)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public class SystemVmResponse extends BaseResponse {
7979
private String podId;
8080

8181
@SerializedName("podname")
82-
@Param(description = "the Pod name for the system VM")
82+
@Param(description = "the Pod name for the system VM", since = "4.13.2")
8383
private String podName;
8484

8585
@SerializedName("hostid")
@@ -135,7 +135,7 @@ public class SystemVmResponse extends BaseResponse {
135135
private String templateId;
136136

137137
@SerializedName("templatename")
138-
@Param(description = "the template name for the system VM")
138+
@Param(description = "the template name for the system VM", since = "4.13.2")
139139
private String templateName;
140140

141141
@SerializedName("created")

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public class VpcResponse extends BaseResponse implements ControlledEntityRespons
6868
private String vpcOfferingId;
6969

7070
@SerializedName(ApiConstants.VPC_OFF_NAME)
71-
@Param(description = "vpc offering name the VPC is created from")
71+
@Param(description = "vpc offering name the VPC is created from", since = "4.13.2")
7272
private String vpcOfferingName;
7373

7474
@SerializedName(ApiConstants.CREATED)

server/src/main/java/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@
3333
import com.cloud.api.ApiDBUtils;
3434
import com.cloud.api.ApiResponseHelper;
3535
import com.cloud.api.query.vo.DomainRouterJoinVO;
36+
import com.cloud.dc.HostPodVO;
3637
import com.cloud.network.Networks.TrafficType;
3738
import com.cloud.network.router.VirtualRouter;
3839
import com.cloud.network.router.VirtualRouter.Role;
40+
import com.cloud.storage.VMTemplateVO;
3941
import com.cloud.user.Account;
4042
import com.cloud.user.AccountManager;
4143
import com.cloud.utils.db.GenericDaoBase;
@@ -47,7 +49,7 @@ public class DomainRouterJoinDaoImpl extends GenericDaoBase<DomainRouterJoinVO,
4749
public static final Logger s_logger = Logger.getLogger(DomainRouterJoinDaoImpl.class);
4850

4951
@Inject
50-
private ConfigurationDao _configDao;
52+
private ConfigurationDao _configDao;
5153
@Inject
5254
public AccountManager _accountMgr;
5355

@@ -75,7 +77,10 @@ public DomainRouterResponse newDomainRouterResponse(DomainRouterJoinVO router, A
7577
routerResponse.setZoneId(router.getDataCenterUuid());
7678
routerResponse.setName(router.getName());
7779
routerResponse.setTemplateId(router.getTemplateUuid());
78-
routerResponse.setTemplateName(ApiDBUtils.findTemplateById(router.getTemplateId()).getName());
80+
VMTemplateVO template = ApiDBUtils.findTemplateById(router.getTemplateId());
81+
if (template != null) {
82+
routerResponse.setTemplateName(template.getName());
83+
}
7984
routerResponse.setCreated(router.getCreated());
8085
routerResponse.setState(router.getState());
8186
routerResponse.setIsRedundantRouter(router.isRedundantRouter());
@@ -100,7 +105,10 @@ public DomainRouterResponse newDomainRouterResponse(DomainRouterJoinVO router, A
100105
routerResponse.setHypervisor(router.getHypervisorType().toString());
101106
}
102107
routerResponse.setPodId(router.getPodUuid());
103-
routerResponse.setPodName(ApiDBUtils.findPodById(router.getPodId()).getName());
108+
HostPodVO pod = ApiDBUtils.findPodById(router.getPodId());
109+
if (pod != null) {
110+
routerResponse.setPodName(pod.getName());
111+
}
104112
long nic_id = router.getNicId();
105113
if (nic_id > 0) {
106114
TrafficType ty = router.getTrafficType();

server/src/main/java/com/cloud/api/query/dao/UserVmJoinDaoImpl.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
import com.cloud.api.query.vo.UserVmJoinVO;
4949
import com.cloud.gpu.GPU;
5050
import com.cloud.service.ServiceOfferingDetailsVO;
51+
import com.cloud.storage.GuestOS;
5152
import com.cloud.user.Account;
5253
import com.cloud.user.AccountManager;
5354
import com.cloud.user.User;
@@ -68,7 +69,7 @@ public class UserVmJoinDaoImpl extends GenericDaoBaseWithTagInformation<UserVmJo
6869
public static final Logger s_logger = Logger.getLogger(UserVmJoinDaoImpl.class);
6970

7071
@Inject
71-
private ConfigurationDao _configDao;
72+
private ConfigurationDao _configDao;
7273
@Inject
7374
public AccountManager _accountMgr;
7475
@Inject
@@ -201,7 +202,10 @@ public UserVmResponse newUserVmResponse(ResponseView view, String objectName, Us
201202
userVmResponse.setPublicIp(userVm.getPublicIpAddress());
202203
userVmResponse.setKeyPairName(userVm.getKeypairName());
203204
userVmResponse.setOsTypeId(userVm.getGuestOsUuid());
204-
userVmResponse.setOsDisplayName(ApiDBUtils.findGuestOSById(userVm.getGuestOsId()).getDisplayName());
205+
GuestOS guestOS = ApiDBUtils.findGuestOSById(userVm.getGuestOsId());
206+
if (guestOS != null) {
207+
userVmResponse.setOsDisplayName(guestOS.getDisplayName());
208+
}
205209

206210
if (details.contains(VMDetails.all) || details.contains(VMDetails.stats)) {
207211
// stats calculation

0 commit comments

Comments
 (0)