cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject [6/9] git commit: updated refs/heads/internallb to def0861
Date Thu, 09 May 2013 18:00:44 GMT
CLOUDSTACK-2408: Object name is Null with list VNMC/List ASA API response

Setting object name correctly in response


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/bde9ad3c
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/bde9ad3c
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/bde9ad3c

Branch: refs/heads/internallb
Commit: bde9ad3c13397758cce0b69414c0a70904947d11
Parents: 2e21060
Author: Koushik Das <koushik.das@citrix.com>
Authored: Thu May 9 15:49:36 2013 +0530
Committer: Koushik Das <koushik.das@citrix.com>
Committed: Thu May 9 15:49:36 2013 +0530

----------------------------------------------------------------------
 .../commands/ListCiscoAsa1000vResourcesCmd.java    |    1 +
 .../api/commands/ListCiscoVnmcResourcesCmd.java    |   15 +++--
 .../response/CiscoAsa1000vResourceResponse.java    |   45 +++++++++------
 .../api/response/CiscoVnmcResourceResponse.java    |   42 ++++++++-----
 4 files changed, 62 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bde9ad3c/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/ListCiscoAsa1000vResourcesCmd.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/ListCiscoAsa1000vResourcesCmd.java
b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/ListCiscoAsa1000vResourcesCmd.java
index 509d39f..7a4db69 100755
--- a/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/ListCiscoAsa1000vResourcesCmd.java
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/ListCiscoAsa1000vResourcesCmd.java
@@ -89,6 +89,7 @@ public class ListCiscoAsa1000vResourcesCmd extends BaseListCmd {
             if (ciscoAsa1000vDevices != null && !ciscoAsa1000vDevices.isEmpty())
{
                 for (CiscoAsa1000vDevice ciscoAsa1000vDeviceVO : ciscoAsa1000vDevices) {
                     CiscoAsa1000vResourceResponse ciscoAsa1000vResourceResponse = _ciscoAsa1000vService.createCiscoAsa1000vResourceResponse(ciscoAsa1000vDeviceVO);
+                    ciscoAsa1000vResourceResponse.setObjectName("asa1000v");
                     ciscoAsa1000vResourcesResponse.add(ciscoAsa1000vResourceResponse);
                 }
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bde9ad3c/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/ListCiscoVnmcResourcesCmd.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/ListCiscoVnmcResourcesCmd.java
b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/ListCiscoVnmcResourcesCmd.java
index ab553ee..b15c4e1 100644
--- a/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/ListCiscoVnmcResourcesCmd.java
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/ListCiscoVnmcResourcesCmd.java
@@ -77,18 +77,19 @@ public class ListCiscoVnmcResourcesCmd extends BaseListCmd {
     @Override
     public void execute() throws ResourceUnavailableException, InsufficientCapacityException,
ServerApiException, ConcurrentOperationException, ResourceAllocationException {
         try {
-            List<CiscoVnmcControllerVO> CiscoVnmcResources = _ciscoVnmcElementService.listCiscoVnmcResources(this);
+            List<CiscoVnmcControllerVO> ciscoVnmcResources = _ciscoVnmcElementService.listCiscoVnmcResources(this);
             ListResponse<CiscoVnmcResourceResponse> response = new ListResponse<CiscoVnmcResourceResponse>();
-            List<CiscoVnmcResourceResponse> CiscoVnmcResourcesResponse = new ArrayList<CiscoVnmcResourceResponse>();
+            List<CiscoVnmcResourceResponse> ciscoVnmcResourcesResponse = new ArrayList<CiscoVnmcResourceResponse>();
 
-            if (CiscoVnmcResources != null && !CiscoVnmcResources.isEmpty()) {
-                for (CiscoVnmcController CiscoVnmcResourceVO : CiscoVnmcResources) {
-                    CiscoVnmcResourceResponse CiscoVnmcResourceResponse = _ciscoVnmcElementService.createCiscoVnmcResourceResponse(CiscoVnmcResourceVO);
-                    CiscoVnmcResourcesResponse.add(CiscoVnmcResourceResponse);
+            if (ciscoVnmcResources != null && !ciscoVnmcResources.isEmpty()) {
+                for (CiscoVnmcController ciscoVnmcResourceVO : ciscoVnmcResources) {
+                    CiscoVnmcResourceResponse ciscoVnmcResourceResponse = _ciscoVnmcElementService.createCiscoVnmcResourceResponse(ciscoVnmcResourceVO);
+                    ciscoVnmcResourceResponse.setObjectName("vnmc");
+                    ciscoVnmcResourcesResponse.add(ciscoVnmcResourceResponse);
                 }
             }
 
-            response.setResponses(CiscoVnmcResourcesResponse);
+            response.setResponses(ciscoVnmcResourcesResponse);
             response.setResponseName(getCommandName());
             this.setResponseObject(response);
         }  catch (InvalidParameterValueException invalidParamExcp) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bde9ad3c/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoAsa1000vResourceResponse.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoAsa1000vResourceResponse.java
b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoAsa1000vResourceResponse.java
index 9cd87da..f857b35 100755
--- a/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoAsa1000vResourceResponse.java
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoAsa1000vResourceResponse.java
@@ -29,60 +29,69 @@ import com.google.gson.annotations.SerializedName;
 
 @EntityReference(value = CiscoAsa1000vDevice.class)
 public class CiscoAsa1000vResourceResponse extends BaseResponse {
-    public static final String RESOURCE_NAME = "resourcename";
 
-    @SerializedName(ApiConstants.RESOURCE_ID) @Parameter(description="resource id of the
Cisco ASA 1000v appliance")
+    @SerializedName(ApiConstants.RESOURCE_ID)
+    @Parameter(description="resource id of the Cisco ASA 1000v appliance")
     private String id;
 
     @SerializedName(ApiConstants.PHYSICAL_NETWORK_ID) 
     @Parameter(description="the physical network to which this ASA 1000v belongs to", entityType
= PhysicalNetworkResponse.class)
-    private Long physicalNetworkId ;
-
-    public Long getPhysicalNetworkId() {
-        return physicalNetworkId;
-    }
+    private Long physicalNetworkId;
 
     @SerializedName(ApiConstants.HOST_NAME)
     @Parameter(description="management ip address of ASA 1000v")
     private String managementIp;
 
-    public String getManagementIp() {
-        return managementIp;
-    }
-
     @SerializedName(ApiConstants.ASA_INSIDE_PORT_PROFILE)
-    @Parameter(description="management ip address of ASA 1000v")
+    @Parameter(description="port profile associated with inside interface of ASA 1000v")
     private String inPortProfile;
 
-    public String getInPortProfile() {
-        return inPortProfile;
-    }
-
     @SerializedName(ApiConstants.NETWORK_ID)
     @Parameter(description="the guest network to which ASA 1000v is associated", entityType
= NetworkResponse.class)
     private Long guestNetworkId;
 
-    public Long getGuestNetworkId() {
-        return guestNetworkId;
+    public String getId() {
+        return id;
     }
 
     public void setId(String ciscoAsa1000vResourceId) {
         this.id = ciscoAsa1000vResourceId;
     }
 
+    public Long getPhysicalNetworkId() {
+        return physicalNetworkId;
+    }
+
     public void setPhysicalNetworkId(Long physicalNetworkId) {
         this.physicalNetworkId = physicalNetworkId;
     }
 
+    public String getManagementIp() {
+        return managementIp;
+    }
+
     public void setManagementIp(String managementIp) {
         this.managementIp = managementIp;
     }
 
+    public String getInPortProfile() {
+        return inPortProfile;
+    }
+
     public void setInPortProfile(String inPortProfile) {
         this.inPortProfile = inPortProfile;
     }     
 
+    public Long getGuestNetworkId() {
+        return guestNetworkId;
+    }
+
     public void setGuestNetworkId(Long guestNetworkId) {
         this.guestNetworkId = guestNetworkId;
     }
+
+    @Override
+    public String getObjectId() {
+        return this.getId();
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bde9ad3c/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoVnmcResourceResponse.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoVnmcResourceResponse.java
b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoVnmcResourceResponse.java
index f5c9b72..92a766d 100644
--- a/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoVnmcResourceResponse.java
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoVnmcResourceResponse.java
@@ -25,6 +25,7 @@ import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
 
 import com.cloud.network.cisco.CiscoVnmcController;
 import com.google.gson.annotations.SerializedName;
+
 @EntityReference(value = CiscoVnmcController.class)
 public class CiscoVnmcResourceResponse extends BaseResponse {
     public static final String RESOURCE_NAME = "resourcename";
@@ -33,43 +34,52 @@ public class CiscoVnmcResourceResponse extends BaseResponse {
     @Parameter(description="resource id of the Cisco VNMC controller")
     private String id;
 
-    @SerializedName(ApiConstants.PHYSICAL_NETWORK_ID) 
+    @SerializedName(ApiConstants.PHYSICAL_NETWORK_ID)
     @Parameter(description="the physical network to which this VNMC belongs to", entityType
= PhysicalNetworkResponse.class)
     private Long physicalNetworkId;
 
-    public Long getPhysicalNetworkId() {
-        return physicalNetworkId;
-    }
-
-    public String getProviderName() {
-        return providerName;
-    }
-
-    public String getResourceName() {
-        return resourceName;
-    }
-
-    @SerializedName(ApiConstants.PROVIDER) @Parameter(description="name of the provider")
+    @SerializedName(ApiConstants.PROVIDER)
+    @Parameter(description="name of the provider")
     private String providerName;
 
-    @SerializedName(RESOURCE_NAME) 
+    @SerializedName(RESOURCE_NAME)
     @Parameter(description="Cisco VNMC resource name")
     private String resourceName;
 
+    public String getId() {
+        return id;
+    }
+
     public void setId(String ciscoVnmcResourceId) {
         this.id = ciscoVnmcResourceId;
     }
 
+    public Long getPhysicalNetworkId() {
+        return physicalNetworkId;
+    }
+
     public void setPhysicalNetworkId(Long physicalNetworkId) {
         this.physicalNetworkId = physicalNetworkId;
     }
 
+    public String getProviderName() {
+        return providerName;
+    }
+
     public void setProviderName(String providerName) {
         this.providerName = providerName;
     }
 
+    public String getResourceName() {
+        return resourceName;
+    }
+
     public void setResourceName(String resourceName) {
         this.resourceName = resourceName;
-    }     
+    }
 
+    @Override
+    public String getObjectId() {
+        return this.getId();
+    }
 }


Mime
View raw message