Skip to content

Commit 1aa30f0

Browse files
committed
Remove IdentityProxy from AutoScale responses.
Signed-off-by: Min Chen <min.chen@citrix.com>
1 parent a390b27 commit 1aa30f0

12 files changed

Lines changed: 148 additions & 114 deletions

File tree

api/src/com/cloud/network/as/AutoScaleVmProfile.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ public interface AutoScaleVmProfile extends ControlledEntity {
2929

3030
public long getId();
3131

32+
public String getUuid();
33+
3234
public Long getZoneId();
3335

3436
public Long getServiceOfferingId();

api/src/com/cloud/offering/DiskOffering.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
public interface DiskOffering {
2727
long getId();
2828

29+
String getUuid();
30+
2931
String getUniqueName();
3032

3133
boolean getUseLocalStorage();

api/src/com/cloud/offering/ServiceOffering.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ public enum StorageType {
3434

3535
long getId();
3636

37+
String getUuid();
38+
3739
String getDisplayText();
3840

3941
Date getCreated();

api/src/org/apache/cloudstack/api/response/AutoScaleVmGroupResponse.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ public class AutoScaleVmGroupResponse extends BaseResponse implements Controlled
2828

2929
@SerializedName(ApiConstants.ID)
3030
@Param(description = "the autoscale vm group ID")
31-
private IdentityProxy id = new IdentityProxy("autoscale_vmgroups");
31+
private String id;
3232

3333
@SerializedName(ApiConstants.LBID)
3434
@Param(description = "the load balancer rule ID")
35-
private IdentityProxy loadBalancerId = new IdentityProxy("firewall_rules");
35+
private String loadBalancerId;
3636

3737
@SerializedName(ApiConstants.VMPROFILE_ID)
3838
@Param(description = "the autoscale profile that contains information about the vms in the vm group.")
39-
private IdentityProxy profileId = new IdentityProxy("autoscale_vmprofiles");
39+
private String profileId;
4040

4141
@SerializedName(ApiConstants.MIN_MEMBERS)
4242
@Param(description = "the minimum number of members in the vmgroup, the number of instances in the vm group will be equal to or more than this number.")
@@ -81,16 +81,16 @@ public AutoScaleVmGroupResponse() {
8181

8282
}
8383

84-
public void setId(Long id) {
85-
this.id.setValue(id);
84+
public void setId(String id) {
85+
this.id = id;
8686
}
8787

88-
public void setLoadBalancerId(Long loadBalancerId) {
89-
this.loadBalancerId.setValue(loadBalancerId);
88+
public void setLoadBalancerId(String loadBalancerId) {
89+
this.loadBalancerId = loadBalancerId;
9090
}
9191

92-
public void setProfileId(Long profileId) {
93-
this.profileId.setValue(profileId);
92+
public void setProfileId(String profileId) {
93+
this.profileId = profileId;
9494
}
9595

9696
public void setMinMembers(int minMembers) {

api/src/org/apache/cloudstack/api/response/AutoScaleVmProfileResponse.java

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,27 @@
2525
import org.apache.cloudstack.api.BaseResponse;
2626
import org.apache.cloudstack.api.Parameter;
2727
import com.cloud.serializer.Param;
28-
import com.cloud.utils.IdentityProxy;
2928
import com.cloud.utils.Pair;
3029
import com.google.gson.annotations.SerializedName;
3130

3231
public class AutoScaleVmProfileResponse extends BaseResponse implements ControlledEntityResponse {
3332

3433
@SerializedName(ApiConstants.ID)
3534
@Param(description = "the autoscale vm profile ID")
36-
private IdentityProxy id = new IdentityProxy("autoscale_vmprofiles");
35+
private String id;
3736

3837
/* Parameters related to deploy virtual machine */
3938
@SerializedName(ApiConstants.ZONE_ID)
4039
@Param(description = "the availability zone to be used while deploying a virtual machine")
41-
private IdentityProxy zoneId = new IdentityProxy("data_center");
40+
private String zoneId;
4241

4342
@SerializedName(ApiConstants.SERVICE_OFFERING_ID)
4443
@Param(description = "the service offering to be used while deploying a virtual machine")
45-
private IdentityProxy serviceOfferingId = new IdentityProxy("disk_offering");
44+
private String serviceOfferingId;
4645

4746
@SerializedName(ApiConstants.TEMPLATE_ID)
4847
@Param(description = "the template to be used while deploying a virtual machine")
49-
private IdentityProxy templateId = new IdentityProxy("vm_template");
48+
private String templateId;
5049

5150
@SerializedName(ApiConstants.OTHER_DEPLOY_PARAMS)
5251
@Param(description = "parameters other than zoneId/serviceOfferringId/templateId to be used while deploying a virtual machine")
@@ -64,7 +63,7 @@ public class AutoScaleVmProfileResponse extends BaseResponse implements Controll
6463

6564
@SerializedName(ApiConstants.AUTOSCALE_USER_ID)
6665
@Param(description = "the ID of the user used to launch and destroy the VMs")
67-
private IdentityProxy autoscaleUserId = new IdentityProxy("user");
66+
private String autoscaleUserId;
6867

6968
@Parameter(name = ApiConstants.CS_URL, type = CommandType.STRING, description = "the API URL including port of the CloudStack Management Server example: http://server.cloud.com:8080/client/api?")
7069
private String csUrl;
@@ -93,20 +92,20 @@ public AutoScaleVmProfileResponse() {
9392

9493
}
9594

96-
public void setId(Long id) {
97-
this.id.setValue(id);
95+
public void setId(String id) {
96+
this.id = id;
9897
}
9998

100-
public void setZoneId(Long zoneId) {
101-
this.zoneId.setValue(zoneId);
99+
public void setZoneId(String zoneId) {
100+
this.zoneId = zoneId;
102101
}
103102

104-
public void setServiceOfferingId(Long serviceOfferingId) {
105-
this.serviceOfferingId.setValue(serviceOfferingId);
103+
public void setServiceOfferingId(String serviceOfferingId) {
104+
this.serviceOfferingId = serviceOfferingId;
106105
}
107106

108-
public void setTemplateId(Long templateId) {
109-
this.templateId.setValue(templateId);
107+
public void setTemplateId(String templateId) {
108+
this.templateId = templateId;
110109
}
111110

112111
public void setOtherDeployParams(String otherDeployParams) {
@@ -147,8 +146,8 @@ public void setProjectName(String projectName) {
147146
this.projectName = projectName;
148147
}
149148

150-
public void setAutoscaleUserId(Long autoscaleUserId) {
151-
this.autoscaleUserId.setValue(autoscaleUserId);
149+
public void setAutoscaleUserId(String autoscaleUserId) {
150+
this.autoscaleUserId = autoscaleUserId;
152151
}
153152

154153
public void setDestroyVmGraceperiod(Integer destroyVmGraceperiod) {

api/src/org/apache/cloudstack/api/response/CloudIdentifierResponse.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,27 @@
1717
package org.apache.cloudstack.api.response;
1818

1919
import org.apache.cloudstack.api.ApiConstants;
20-
import com.cloud.utils.IdentityProxy;
2120
import com.cloud.serializer.Param;
2221
import com.google.gson.annotations.SerializedName;
2322
import org.apache.cloudstack.api.BaseResponse;
2423

2524
public class CloudIdentifierResponse extends BaseResponse {
2625

2726
@SerializedName(ApiConstants.USER_ID) @Param(description="the user ID for the cloud identifier")
28-
private IdentityProxy userId = new IdentityProxy("user");
27+
private String userId;
2928

3029
@SerializedName("cloudidentifier") @Param(description="the cloud identifier")
3130
private String cloudIdentifier;
3231

3332
@SerializedName("signature") @Param(description="the signed response for the cloud identifier")
3433
private String signature;
3534

36-
public Long getUserId() {
37-
return userId.getValue();
35+
public String getUserId() {
36+
return userId;
3837
}
3938

40-
public void setUserId(Long userId) {
41-
this.userId.setValue(userId);
39+
public void setUserId(String userId) {
40+
this.userId = userId;
4241
}
4342

4443
public String getCloudIdentifier() {

api/src/org/apache/cloudstack/api/response/ConditionResponse.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,14 @@
2121

2222
import org.apache.cloudstack.api.ApiConstants;
2323
import com.cloud.serializer.Param;
24-
import com.cloud.utils.IdentityProxy;
2524
import com.google.gson.annotations.SerializedName;
2625
import org.apache.cloudstack.api.BaseResponse;
2726

2827
@SuppressWarnings("unused")
2928
public class ConditionResponse extends BaseResponse implements ControlledEntityResponse {
3029
@SerializedName("id")
3130
@Param(description = "the id of the Condition")
32-
private final IdentityProxy id = new IdentityProxy("conditions");
31+
private String id;
3332

3433
@SerializedName(value = ApiConstants.THRESHOLD)
3534
@Param(description = "Threshold Value for the counter.")
@@ -53,7 +52,7 @@ public class ConditionResponse extends BaseResponse implements ControlledEntityR
5352

5453
@SerializedName(ApiConstants.ZONE_ID)
5554
@Param(description = "zone id of counter")
56-
private final IdentityProxy zoneId = new IdentityProxy("data_center");
55+
private String zoneId;
5756

5857
@SerializedName(ApiConstants.PROJECT_ID)
5958
@Param(description = "the project id of the Condition.")
@@ -71,8 +70,8 @@ public class ConditionResponse extends BaseResponse implements ControlledEntityR
7170
// ///////////////// Setters ///////////////////////
7271
// ///////////////////////////////////////////////////
7372

74-
public void setId(Long id) {
75-
this.id.setValue(id);
73+
public void setId(String id) {
74+
this.id = id;
7675
}
7776

7877
public void setThreshold(long threshold) {
@@ -97,8 +96,8 @@ public void setProjectId(String projectId) {
9796
this.projectId = projectId;
9897
}
9998

100-
public void setZoneId(Long zoneId) {
101-
this.zoneId.setValue(zoneId);
99+
public void setZoneId(String zoneId) {
100+
this.zoneId = zoneId;
102101
}
103102

104103
@Override

api/src/org/apache/cloudstack/api/response/CounterResponse.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
import com.cloud.network.as.Counter;
2424
import com.cloud.serializer.Param;
25-
import com.cloud.utils.IdentityProxy;
2625
import com.google.gson.annotations.SerializedName;
2726
import org.apache.cloudstack.api.BaseResponse;
2827

@@ -31,7 +30,7 @@
3130
public class CounterResponse extends BaseResponse {
3231
@SerializedName("id")
3332
@Param(description = "the id of the Counter")
34-
private final IdentityProxy id = new IdentityProxy("counter");
33+
private String id;
3534

3635
@SerializedName(value = ApiConstants.NAME)
3736
@Param(description = "Name of the counter.")
@@ -47,10 +46,10 @@ public class CounterResponse extends BaseResponse {
4746

4847
@SerializedName(ApiConstants.ZONE_ID)
4948
@Param(description = "zone id of counter")
50-
private final IdentityProxy zoneId = new IdentityProxy("data_center");
49+
private String zoneId;
5150

52-
public void setId(Long id) {
53-
this.id.setValue(id);
51+
public void setId(String id) {
52+
this.id = id;
5453
}
5554

5655
public void setName(String name) {

0 commit comments

Comments
 (0)