cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mtutkow...@apache.org
Subject [25/50] git commit: updated refs/heads/sf-plugins to bcf1c72
Date Tue, 28 Jul 2015 20:15:11 GMT
Return additional volume-related data

Add additional volume-delete logic


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

Branch: refs/heads/sf-plugins
Commit: 1eb3c687500c640183ef807d087331a70f8644f4
Parents: 7bb5442
Author: Mike Tutkowski <mike.tutkowski@solidfire.com>
Authored: Thu Jul 9 14:29:01 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:42 2015 -0600

----------------------------------------------------------------------
 .../apache/cloudstack/api/helper/ApiHelper.java |   4 +
 .../response/ApiSolidFireVolumeResponse.java    |  51 ++++++++++
 .../solidfire/dataaccess/SfVolume.java          |   4 +
 .../solidfire/dataaccess/vo/SfVolumeVO.java     |   5 +
 ui/plugins/sfSharedVolume/sfSharedVolume.js     | 101 +++++++++++++++++++
 5 files changed, 165 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1eb3c687/plugins/api/solidfire/src/org/apache/cloudstack/api/helper/ApiHelper.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/helper/ApiHelper.java b/plugins/api/solidfire/src/org/apache/cloudstack/api/helper/ApiHelper.java
index 9a83404..89c48eb 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/helper/ApiHelper.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/helper/ApiHelper.java
@@ -180,6 +180,7 @@ public class ApiHelper {
         sfResponse.setMinIops(sfVolume.getMinIops());
         sfResponse.setMaxIops(sfVolume.getMaxIops());
         sfResponse.setBurstIops(sfVolume.getBurstIops());
+        sfResponse.setCreated(sfVolume.getCreated());
 
         SfVirtualNetwork sfVirtualNetwork = _sfVirtualNetworkDao.findById(sfVolume.getSfVirtualNetworkId());
 
@@ -188,6 +189,7 @@ public class ApiHelper {
         Account account = _accountDao.findById(sfVirtualNetwork.getAccountId());
 
         sfResponse.setAccountUuid(account.getUuid());
+        sfResponse.setAccountName(account.getAccountName());
 
         SfCluster sfCluster = _sfClusterDao.findById(sfVirtualNetwork.getSfClusterId());
 
@@ -196,6 +198,7 @@ public class ApiHelper {
         DataCenterVO dataCenterVO = _zoneDao.findById(sfCluster.getZoneId());
 
         sfResponse.setZoneUuid(dataCenterVO.getUuid());
+        sfResponse.setZoneName(dataCenterVO.getName());
 
         if (ResponseView.Full.equals(responseView)) {
             sfResponse.setClusterName(sfCluster.getName());
@@ -204,6 +207,7 @@ public class ApiHelper {
         sfResponse.setTargetPortal(sfVirtualNetwork.getSvip());
         sfResponse.setVlanId(sfVirtualNetwork.getId());
         sfResponse.setVlanUuid(sfVirtualNetwork.getUuid());
+        sfResponse.setVlanName(sfVirtualNetwork.getName());
 
         AccountDetailVO accountDetail = _accountDetailsDao.findDetail(sfVirtualNetwork.getAccountId(),
SolidFireUtil.CHAP_INITIATOR_USERNAME);
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1eb3c687/plugins/api/solidfire/src/org/apache/cloudstack/api/response/ApiSolidFireVolumeResponse.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/response/ApiSolidFireVolumeResponse.java
b/plugins/api/solidfire/src/org/apache/cloudstack/api/response/ApiSolidFireVolumeResponse.java
index e4f0e70..97ab909 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/response/ApiSolidFireVolumeResponse.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/response/ApiSolidFireVolumeResponse.java
@@ -16,10 +16,13 @@
 // under the License.
 package org.apache.cloudstack.api.response;
 
+import java.util.Date;
+
 import com.cloud.serializer.Param;
 
 import com.google.gson.annotations.SerializedName;
 
+import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseResponse;
 import org.apache.cloudstack.api.EntityReference;
 import org.apache.cloudstack.api.helper.ApiHelper;
@@ -67,6 +70,10 @@ public class ApiSolidFireVolumeResponse extends BaseResponse {
     @Param(description = "UUID of the account the volume is associated with")
     private String _accountUuid;
 
+    @SerializedName("accountname")
+    @Param(description = "Name of the account the volume is associated with")
+    private String _accountName;
+
     @SerializedName("vlanid")
     @Param(description = "ID of the VLAN the volume is associated with")
     private long _vlanId;
@@ -75,6 +82,10 @@ public class ApiSolidFireVolumeResponse extends BaseResponse {
     @Param(description = "UUID of the VLAN the volume is associated with")
     private String _vlanUuid;
 
+    @SerializedName("vlanname")
+    @Param(description = "Name of the VLAN the volume is associated with")
+    private String _vlanName;
+
     @SerializedName("zoneid")
     @Param(description = "ID of the zone the volume is associated with")
     private long _zoneId;
@@ -83,6 +94,10 @@ public class ApiSolidFireVolumeResponse extends BaseResponse {
     @Param(description = "UUID of the zone the volume is associated with")
     private String _zoneUuid;
 
+    @SerializedName("zonename")
+    @Param(description = "Name of the zone the volume is associated with")
+    private String _zoneName;
+
     @SerializedName("clustername")
     @Param(description = "Name of cluster the volume belongs to")
     private String _clusterName;
@@ -107,6 +122,10 @@ public class ApiSolidFireVolumeResponse extends BaseResponse {
     @Param(description = "CHAP target secret")
     private String _chapTargetSecret;
 
+    @SerializedName(ApiConstants.CREATED)
+    @Param(description = "Date volume was created")
+    private Date _created;
+
     public void setId(long id) {
         _id = id;
     }
@@ -187,6 +206,14 @@ public class ApiSolidFireVolumeResponse extends BaseResponse {
         return _accountUuid;
     }
 
+    public void setAccountName(String accountName) {
+        _accountName = accountName;
+    }
+
+    public String getAccountName() {
+        return _accountName;
+    }
+
     public void setVlanId(long vlanId) {
         _vlanId = vlanId;
     }
@@ -203,6 +230,14 @@ public class ApiSolidFireVolumeResponse extends BaseResponse {
         return _vlanUuid;
     }
 
+    public void setVlanName(String vlanName) {
+        _vlanName = vlanName;
+    }
+
+    public String getVlanName() {
+        return _vlanName;
+    }
+
     public void setZoneId(long zoneId) {
         _zoneId = zoneId;
     }
@@ -219,6 +254,14 @@ public class ApiSolidFireVolumeResponse extends BaseResponse {
         return _zoneUuid;
     }
 
+    public void setZoneName(String zoneName) {
+        _zoneName = zoneName;
+    }
+
+    public String getZoneName() {
+        return _zoneName;
+    }
+
     public void setClusterName(String clusterName) {
         _clusterName = clusterName;
     }
@@ -266,4 +309,12 @@ public class ApiSolidFireVolumeResponse extends BaseResponse {
     public String getTargetInitiatorSecret() {
         return _chapTargetSecret;
     }
+
+    public void setCreated(Date created) {
+        _created = created;
+    }
+
+    public Date getCreated() {
+        return _created;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1eb3c687/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/dataaccess/SfVolume.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/dataaccess/SfVolume.java
b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/dataaccess/SfVolume.java
index d59395d..dd5e11d 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/dataaccess/SfVolume.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/dataaccess/SfVolume.java
@@ -16,6 +16,8 @@
 // under the License.
 package org.apache.cloudstack.solidfire.dataaccess;
 
+import java.util.Date;
+
 import org.apache.cloudstack.api.Identity;
 import org.apache.cloudstack.api.InternalIdentity;
 
@@ -35,4 +37,6 @@ public interface SfVolume extends Identity, InternalIdentity {
     long getBurstIops();
 
     long getSfVirtualNetworkId();
+
+    Date getCreated();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1eb3c687/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/dataaccess/vo/SfVolumeVO.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/dataaccess/vo/SfVolumeVO.java
b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/dataaccess/vo/SfVolumeVO.java
index f1aede1..9334b51 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/dataaccess/vo/SfVolumeVO.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/dataaccess/vo/SfVolumeVO.java
@@ -160,4 +160,9 @@ public class SfVolumeVO implements SfVolume {
     public long getSfVirtualNetworkId() {
         return sfVirtualNetworkId;
     }
+
+    @Override
+    public Date getCreated() {
+        return created;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1eb3c687/ui/plugins/sfSharedVolume/sfSharedVolume.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/sfSharedVolume.js b/ui/plugins/sfSharedVolume/sfSharedVolume.js
index 6eb9cf1..ab76ff3 100644
--- a/ui/plugins/sfSharedVolume/sfSharedVolume.js
+++ b/ui/plugins/sfSharedVolume/sfSharedVolume.js
@@ -230,6 +230,107 @@
                 }
               },
               action: function(args) {
+                $.ajax({
+                  url: createURL('deleteSolidFireVolume'),
+                  data: data,
+                  success: function(json) {
+                    var sfvolumeObj = json.deletesolidfirevolumeresponse.apideletesolidfirevolume;
+
+                    args.response.success({
+                      data: sfvolumeObj
+                    });
+                  },
+                  error: function(json) {
+                    args.response.error(parseXMLHttpResponse(json));
+                  }
+                });
+              }
+            }
+          },
+          tabs: {
+            details: {
+              title: 'label.details',
+              preFilter: function(args) {
+                var hiddenFields;
+
+                if (isAdmin()) {
+                  hiddenFields = [];
+                } else {
+                  hiddenFields = ['clustername', 'accountname'];
+                }
+
+                return hiddenFields;
+              },
+              fields: [
+                {
+                  name: {
+                    label: 'label.name'
+                  }
+                },
+                {
+                  uuid: {
+                    label: 'label.id'
+                  },
+                  clustername: {
+                    label: 'Cluster'
+                  },
+                  zonename: {
+                    label: 'label.zone'
+                  },
+                  accountname: {
+                    label: 'label.account'
+                  },
+                  vlanname: {
+                    label: 'VLAN'
+                  },
+                  size: {
+                    label: 'label.disk.size.gb'
+                  },
+                  miniops: {
+                    label: 'label.disk.iops.min'
+                  },
+                  maxiops: {
+                    label: 'label.disk.iops.max'
+                  },
+                  burstiops: {
+                    label: 'Burst IOPS'
+                  },
+                  targetportal: {
+                    label: 'Target Portal'
+                  },
+                  iqn: {
+                    label: 'IQN'
+                  },
+                  chapinitiatorusername: {
+                    label: 'Initiator Username'
+                  },
+                  chapinitiatorsecret: {
+                    label: 'Initiator Secret'
+                  },
+                  created: {
+                    label: 'label.created',
+                    converter: cloudStack.converters.toLocalDate
+                  }
+                }
+              ],
+              tags: cloudStack.api.tags({
+                resourceType: 'Volume',
+                contextId: 'volumes'
+              }),
+              dataProvider: function(args) {
+                $.ajax({
+                  url: createURL("listSolidFireVolumes&id=" + args.context.volumes[0].id),
+                  dataType: "json",
+                  async: true,
+                  success: function(json) {
+                    var jsonObj = json.listsolidfirevolumesresponse.sfvolume[0];
+
+                    args.response.success({
+                      actionFilter: volumeActionfilter,
+                      data: jsonObj
+                    });
+                  }
+                });
               }
             }
           }


Mime
View raw message