You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mt...@apache.org on 2015/07/28 22:14:47 UTC

[01/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Repository: cloudstack
Updated Branches:
  refs/heads/sf-plugins [created] bcf1c72c8


Add temp icon


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

Branch: refs/heads/sf-plugins
Commit: 6d4ea195c6900292c3482c831af33d105af3f22a
Parents: 0b09c53
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Mon Jul 6 19:34:18 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:40 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfSharedVolume/icon.png | Bin 0 -> 7943 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6d4ea195/ui/plugins/sfSharedVolume/icon.png
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/icon.png b/ui/plugins/sfSharedVolume/icon.png
new file mode 100644
index 0000000..a313d35
Binary files /dev/null and b/ui/plugins/sfSharedVolume/icon.png differ


[18/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Add VLAN combo box to Add Shared Volume window


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

Branch: refs/heads/sf-plugins
Commit: c386bbb61537d9132f769030740c3c32d0ec4b77
Parents: f1d3156
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Tue Jul 7 13:57:31 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:41 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfSharedVolume/sfSharedVolume.js | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c386bbb6/ui/plugins/sfSharedVolume/sfSharedVolume.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/sfSharedVolume.js b/ui/plugins/sfSharedVolume/sfSharedVolume.js
index cce02db..8896526 100644
--- a/ui/plugins/sfSharedVolume/sfSharedVolume.js
+++ b/ui/plugins/sfSharedVolume/sfSharedVolume.js
@@ -77,7 +77,6 @@
                 },
                 diskSize: {
 				  label: 'label.disk.size.gb',
-			      docID: 'Size of the volume in GB',
                   validation: {
                     required: true,
                     number: true
@@ -103,6 +102,27 @@
                     required: true,
                     number: true
                   }
+                },
+                vlan: {
+                  label: 'VLAN',
+                  validation: {
+                    required: true
+                  },
+                  select: function(args) {
+                    $.ajax({
+                      url: createURL("listSolidFireVirtualNetworks"),
+                      dataType: "json",
+                      async: true,
+                      success: function(json) {
+                        var virtualNetworkObjs = json.listvirtualnetworksresponse.virtualnetwork;
+
+                        args.response.success({
+                          descriptionField: 'name',
+                          data: virtualNetworkObjs
+                        });
+                      }
+                    });
+                  }
                 }
               }
             },


[30/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Corrected a property reference when attempting to delete a cluster

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

Branch: refs/heads/sf-plugins
Commit: 1db663b54f82d225e27b299e8201d8c33f4efd56
Parents: 65cdab5
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Wed Jul 15 20:00:44 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:43 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfAdministration/sfAdministration.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1db663b5/ui/plugins/sfAdministration/sfAdministration.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfAdministration/sfAdministration.js b/ui/plugins/sfAdministration/sfAdministration.js
index d2b568e..4c843ee 100644
--- a/ui/plugins/sfAdministration/sfAdministration.js
+++ b/ui/plugins/sfAdministration/sfAdministration.js
@@ -207,7 +207,7 @@
               },
               action: function(args) {
                 $.ajax({
-                  url: createURL('deleteReferenceToSolidFireCluster&name=' + args.context.sfSharedVolumes[0].name),
+                  url: createURL('deleteReferenceToSolidFireCluster&name=' + args.context.sfAdministration[0].name),
                   success: function(json) {
                     args.response.success();
                   },


[44/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Changed args.context.sfVirtualNetwork to args.context.sfVirtualNetworks in two places

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

Branch: refs/heads/sf-plugins
Commit: fde206799694342aea298814d346575cf84d9b1c
Parents: 222e181
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Tue Jul 21 18:15:22 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:44 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfAdministration/sfAdministration.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fde20679/ui/plugins/sfAdministration/sfAdministration.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfAdministration/sfAdministration.js b/ui/plugins/sfAdministration/sfAdministration.js
index 158b714..ff6bae5 100644
--- a/ui/plugins/sfAdministration/sfAdministration.js
+++ b/ui/plugins/sfAdministration/sfAdministration.js
@@ -545,7 +545,7 @@
                   },
                   action: function(args) {
                     $.ajax({
-                      url: createURL('deleteSolidFireVirtualNetwork&id=' + args.context.sfVirtualNetwork[0].id),
+                      url: createURL('deleteSolidFireVirtualNetwork&id=' + args.context.sfVirtualNetworks[0].id),
                       success: function(json) {
                         args.response.success();
                       },
@@ -610,7 +610,7 @@
                   ],
                   dataProvider: function(args) {
                     $.ajax({
-                      url: createURL("listSolidFireVirtualNetworks&id=" + args.context.sfVirtualNetwork[0].id),
+                      url: createURL("listSolidFireVirtualNetworks&id=" + args.context.sfVirtualNetworks[0].id),
                       dataType: "json",
                       async: true,
                       success: function(json) {


[31/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
"long" changed to "Long" so an un-supplied account ID comes in as null instead of as 0


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

Branch: refs/heads/sf-plugins
Commit: 03f60e6b270d6b8a33afea60ff39479d32146ffe
Parents: 32e0e2b
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Fri Jul 10 18:52:09 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:43 2015 -0600

----------------------------------------------------------------------
 .../command/user/solidfire/ListSolidFireVirtualNetworksCmd.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/03f60e6b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java
index 750f1c8..2ec91a1 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java
@@ -53,7 +53,7 @@ public class ListSolidFireVirtualNetworksCmd extends BaseListCmd {
     private Long _zoneId;
 
     @Parameter(name = ApiConstants.ACCOUNT_ID, type = CommandType.UUID, entityType = AccountResponse.class, description = ApiHelper.ACCOUNT_ID_DESC)
-    private long _accountId;
+    private Long _accountId;
 
     @Inject private ApiHelper _apiHelper;
 


[09/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
List SolidFire clusters


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

Branch: refs/heads/sf-plugins
Commit: e484b4780a5ace33a7c09d6eae9a5dde18a54852
Parents: a494084
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Mon Jul 6 15:26:58 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:40 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfSharedVolume/sfSharedVolume.js | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e484b478/ui/plugins/sfSharedVolume/sfSharedVolume.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/sfSharedVolume.js b/ui/plugins/sfSharedVolume/sfSharedVolume.js
index 2ac3f68..bfd1212 100644
--- a/ui/plugins/sfSharedVolume/sfSharedVolume.js
+++ b/ui/plugins/sfSharedVolume/sfSharedVolume.js
@@ -7,19 +7,19 @@
         return true;
       },
       listView: {
-        id: 'testPluginInstances',
+        id: 'sfClusters',
         fields: {
           name: { label: 'label.name' },
-          instancename: { label: 'label.internal.name' },
-          displayname: { label: 'label.display.name' },
+          mvip: { label: 'MVIP' },
+          username: { label: 'Username' },
           zonename: { label: 'label.zone.name' }
         },
         dataProvider: function(args) {
-          plugin.ui.apiCall('listVirtualMachines', {
+          plugin.ui.apiCall('listSolidFireClusters', {
             success: function(json) {
-              var vms = json.listvirtualmachinesresponse.virtualmachine;
+              var sfclusters = json.listsolidfireclustersresponse.sfcluster;
 
-              args.response.success({ data: vms });
+              args.response.success({ data: sfclusters });
             },
             error: function(errorMessage) {
               args.response.error(errorMessage)


[11/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Conditionally show the Account field in the Add Shared Volume window


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

Branch: refs/heads/sf-plugins
Commit: 74208d50d21ad09e1f900434018c193f11fb42bf
Parents: 8eea9c9
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Wed Jul 8 00:21:10 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:41 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfSharedVolume/sfSharedVolume.js | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/74208d50/ui/plugins/sfSharedVolume/sfSharedVolume.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/sfSharedVolume.js b/ui/plugins/sfSharedVolume/sfSharedVolume.js
index d935b04..90395cc 100644
--- a/ui/plugins/sfSharedVolume/sfSharedVolume.js
+++ b/ui/plugins/sfSharedVolume/sfSharedVolume.js
@@ -110,17 +110,15 @@
                   },
                   isHidden: true,
                   select: function(args) {
+                    if (isAdmin()) {
+                      args.$form.find('.form-item[rel=account]').show();
+                    }
+
                     $.ajax({
                       url: createURL("listAccounts"),
                       dataType: "json",
                       async: true,
                       success: function(json) {
-                        if (isAdmin()) {
-                          var $form = $(this).closest('form');
-
-                          $form.find('.form-item[rel=account]').show();
-                        }
-
                         var accountObjs = json.listaccountsresponse.account;
 
                         args.response.success({


[36/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Adding GUI plug-in for root admins to control infrastructure for shared volumes

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

Branch: refs/heads/sf-plugins
Commit: 237284a3bebfd84f57bd830ed3178828b55bbb17
Parents: 01ab5fc
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Wed Jul 15 18:20:37 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:43 2015 -0600

----------------------------------------------------------------------
 ui/plugins/plugins.js                           |   3 +-
 ui/plugins/sfAdministration/config.js           |   9 +
 ui/plugins/sfAdministration/icon.png            | Bin 0 -> 7943 bytes
 ui/plugins/sfAdministration/sfAdministration.js | 284 +++++++++++++++++++
 4 files changed, 295 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/237284a3/ui/plugins/plugins.js
----------------------------------------------------------------------
diff --git a/ui/plugins/plugins.js b/ui/plugins/plugins.js
index 6e5557f..d115eef 100644
--- a/ui/plugins/plugins.js
+++ b/ui/plugins/plugins.js
@@ -17,6 +17,7 @@
 (function($, cloudStack) {
   cloudStack.plugins = [
     // 'testPlugin',
-    // 'sfSharedVolume'
+    // 'sfSharedVolume',
+    // 'sfAdministration'
   ];
 }(jQuery, cloudStack));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/237284a3/ui/plugins/sfAdministration/config.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfAdministration/config.js b/ui/plugins/sfAdministration/config.js
new file mode 100644
index 0000000..7e8bb61
--- /dev/null
+++ b/ui/plugins/sfAdministration/config.js
@@ -0,0 +1,9 @@
+(function (cloudStack) {
+  cloudStack.plugins.sfSharedVolume.config = {
+    title: 'SolidFire Administration',
+    desc: 'SolidFire Administration',
+    externalLink: 'http://www.solidfire.com/',
+    authorName: 'Mike Tutkowski',
+    authorEmail: 'mike.tutkowski@solidfire.com'
+  };
+}(cloudStack));
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/237284a3/ui/plugins/sfAdministration/icon.png
----------------------------------------------------------------------
diff --git a/ui/plugins/sfAdministration/icon.png b/ui/plugins/sfAdministration/icon.png
new file mode 100644
index 0000000..a313d35
Binary files /dev/null and b/ui/plugins/sfAdministration/icon.png differ

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/237284a3/ui/plugins/sfAdministration/sfAdministration.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfAdministration/sfAdministration.js b/ui/plugins/sfAdministration/sfAdministration.js
new file mode 100644
index 0000000..c836576
--- /dev/null
+++ b/ui/plugins/sfAdministration/sfAdministration.js
@@ -0,0 +1,284 @@
+(function (cloudStack) {
+  cloudStack.plugins.sfAdministration = function(plugin) {
+    plugin.ui.addSection({
+      id: 'sfAdministration',
+      title: 'sfAdministration',
+      preFilter: function(args) {
+        return isAdmin();
+      },
+      listView: {
+        id: 'sfAdministration',
+        fields: {
+          name: { label: 'label.name' },
+          iqn: { label: 'MVIP' },
+          size: { label: 'Username' },
+          miniops: { label: 'label.zone' }
+        },
+        dataProvider: function(args) {
+          plugin.ui.apiCall('listSolidFireClusters', {
+            success: function(json) {
+              var sfclustersfiltered = [];
+              var sfclusters = json.listsolidfireclustersresponse.sfcluster;
+              var search = args.filterBy.search.value == null ? "" : args.filterBy.search.value.toLowerCase();
+
+              if (search == "") {
+                sfclustersfiltered = sfclusters;
+              }
+              else {
+                for (i = 0; i < sfclusters.length; i++) {
+                  sfcluster = sfclusters[i];
+
+                  if (sfcluster.name.toLowerCase().indexOf(search) > -1 ) {
+                    sfclustersfiltered.push(sfcluster);
+                  }
+                }
+              }
+
+              args.response.success({ data: sfclustersfiltered });
+            },
+            error: function(errorMessage) {
+              args.response.error(errorMessage);
+            }
+          });
+        },
+        actions: {
+          add: {
+            label: 'Add Reference to Cluster',
+            preFilter: function(args) {
+              return true;
+            },
+            messages: {
+              confirm: function(args) {
+                return 'Please fill in the following data to add a new reference to a cluster.';
+              },
+              notification: function(args) {
+                return 'Add Reference to Cluster';
+              }
+            },
+            createForm: {
+              title: 'Add Reference to Cluster',
+              desc: 'Please fill in the following data to add a new reference to a cluster.',
+              fields: {
+                mvip: {
+                  label: 'MVIP',
+                  validation: {
+                    required: true
+                  }
+                },
+                username: {
+                  label: 'label.username',
+                  docID: 'helpUserUsername',
+                  validation: {
+                    required: true
+                  }
+                },
+                password: {
+                  label: 'label.password',
+                  docID: 'helpUserPassword',
+                  isPassword: true,
+                  validation: {
+                    required: true
+                  }
+                },
+                totalCapacity: {
+                  label: 'Total Capacity',
+                  validation: {
+                    required: true,
+                    number: true
+                  }
+                },
+                totalMinIops: {
+                  label: 'Total Min IOPS',
+                  validation: {
+                    required: true,
+                    number: true
+                  }
+                },
+                totalMaxIops: {
+                  label: 'Total Max IOPS',
+                  validation: {
+                    required: true,
+                    number: true
+                  }
+                },
+                totalBurstIops: {
+                  label: 'Total Burst IOPS',
+                  validation: {
+                    required: true,
+                    number: true
+                  }
+                },
+                availabilityZone: {
+                  label: 'label.availability.zone',
+                  docID: 'helpVolumeAvailabilityZone',
+                  validation: {
+                    required: true
+                  },
+                  select: function(args) {
+                    $.ajax({
+                      url: createURL("listZones&available=true"),
+                      dataType: "json",
+                      async: true,
+                      success: function(json) {
+                        var zoneObjs = json.listzonesresponse.zone;
+
+                        args.response.success({
+                          descriptionField: 'name',
+                          data: zoneObjs
+                        });
+                      }
+                    });
+                  }
+                }
+              }
+            },
+            action: function(args) {
+              var data = {
+                mvip: args.data.mvip,
+                username: args.data.username,
+                password: args.data.password,
+                totalcapacity: args.data.totalcapacity,
+                totalminiops: args.data.totalminiops,
+                totalmaxiops: args.data.totalmaxiops,
+                totalburstiops: args.data.totalburstiops,
+                availabilityzone: args.data.availabilityzone
+              };
+
+              $.ajax({
+                url: createURL('createReferenceToSolidFireCluster'),
+                data: data,
+                success: function(json) {
+                  var sfclusterObj = json.createreferencetosolidfireclusterresponse.apicreatereferencetosolidfirecluster;
+
+                  args.response.success({
+                    data: sfclusterObj
+                  });
+                },
+                error: function(json) {
+                  args.response.error(parseXMLHttpResponse(json));
+                }
+              });
+            }
+          }
+        },
+        detailView: {
+          name: 'label.details',
+          actions: {
+            edit: {
+              label: 'label.edit',
+              messages: {
+                notification: function(args) {
+                  return 'Edit Cluster';
+                }
+              },
+              action: function (args) {
+                var params = [];
+
+                params.push("&name=" + args.context.sfClusters[0].name);
+                params.push("&totalcapacity=" + args.data.totalcapacity);
+                params.push("&totalminiops=" + args.data.totalminiops);
+                params.push("&totalmaxiops=" + args.data.totalmaxiops);
+                params.push("&totalburstiops=" + args.data.totalburstiops);
+
+                $.ajax({
+                  url: createURL('updateReferenceToSolidFireCluster' + params.join("")),
+                  success: function(json) {
+                    var sfclusterObj = json.updatereferencetosolidfireclusterresponse.apiupdatereferencetosolidfirecluster;
+
+                    args.response.success({
+                      data: sfclusterObj
+                    });
+                  },
+                  error: function(json) {
+                    args.response.error(parseXMLHttpResponse(json));
+                  }
+                });
+              }
+            },
+            remove: {
+              label: 'Delete Reference to Cluster',
+              messages: {
+                confirm: function(args) {
+                  return 'Are you sure you would like to delete this reference to a SolidFire cluster?';
+                },
+                notification: function(args) {
+                  return 'Delete Reference to Cluster';
+                }
+              },
+              action: function(args) {
+                $.ajax({
+                  url: createURL('deleteReferenceToSolidFireCluster&name=' + args.context.sfSharedVolumes[0].name),
+                  success: function(json) {
+                    args.response.success();
+                  },
+                  error: function(json) {
+                    args.response.error(parseXMLHttpResponse(json));
+                  }
+                });
+              }
+            }
+          },
+          tabs: {
+            details: {
+              title: 'label.details',
+              preFilter: function(args) {
+                return [];
+              },
+              fields: [
+                {
+                  name: {
+                    label: 'label.name'
+                  }
+                },
+                {
+                  uuid: {
+                    label: 'label.id'
+                  },
+                  mvip: {
+                    label: 'MVIP'
+                  },
+                  username: {
+                    label: 'Username'
+                  },
+                  totalcapacity: {
+                    label: 'Total Capacity',
+                    isEditable: true
+                  },
+                  miniops: {
+                    label: 'Total Min IOPS',
+                    isEditable: true
+                  },
+                  maxiops: {
+                    label: 'Total Max IOPS',
+                    isEditable: true
+                  },
+                  burstiops: {
+                    label: 'Total Burst IOPS',
+                    isEditable: true
+                  },
+                  zone: {
+                    label: 'Zone'
+                  }
+                }
+              ],
+              dataProvider: function(args) {
+                $.ajax({
+                  url: createURL("listSolidFireClusters&name=" + args.context.sfClusters[0].name),
+                  dataType: "json",
+                  async: true,
+                  success: function(json) {
+                    var jsonObj = json.listsolidfireclustersresponse.sfcluster[0];
+
+                    args.response.success({
+                      data: jsonObj
+                    });
+                  }
+                });
+              }
+            }
+          }
+        }
+      }
+    });
+  };
+}(cloudStack));
\ No newline at end of file


[21/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
If either (or both) combo boxes is null or undefined, return


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

Branch: refs/heads/sf-plugins
Commit: 19532fc772f5e783251981b29ab6efcb86ed326b
Parents: 9ca0308
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Wed Jul 8 20:25:47 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:42 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfSharedVolume/sfSharedVolume.js | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/19532fc7/ui/plugins/sfSharedVolume/sfSharedVolume.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/sfSharedVolume.js b/ui/plugins/sfSharedVolume/sfSharedVolume.js
index 2d904cd..5835edd 100644
--- a/ui/plugins/sfSharedVolume/sfSharedVolume.js
+++ b/ui/plugins/sfSharedVolume/sfSharedVolume.js
@@ -157,6 +157,10 @@
                   },
                   dependsOn: ['availabilityZone', 'account'],
                   select: function(args) {
+                    if (args.data.availabilityZone == null || args.data.account == null) {
+                      return;
+                    }
+
                     var params = [];
 
                     params.push("&zoneid=" + args.data.availabilityZone);


[47/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Return the account name and the zone name and make use of the account name

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

Branch: refs/heads/sf-plugins
Commit: 017ed7daf5ffd32cd96b556b132625857d930df0
Parents: cd4a863
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Mon Jul 20 23:12:02 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:44 2015 -0600

----------------------------------------------------------------------
 .../apache/cloudstack/api/helper/ApiHelper.java |  2 ++
 .../ApiSolidFireVirtualNetworkResponse.java     | 24 ++++++++++++++++++++
 ui/plugins/sfAdministration/sfAdministration.js |  2 +-
 3 files changed, 27 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/017ed7da/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 b042499..c93040e 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
@@ -127,6 +127,7 @@ public class ApiHelper {
         Account account = _accountDao.findById(sfVirtualNetwork.getAccountId());
 
         sfResponse.setAccountUuid(account.getUuid());
+        sfResponse.setAccountName(account.getAccountName());
 
         SfCluster sfCluster = _sfClusterDao.findById(sfVirtualNetwork.getSfClusterId());
 
@@ -135,6 +136,7 @@ public class ApiHelper {
         DataCenterVO dataCenterVO = _zoneDao.findById(sfCluster.getZoneId());
 
         sfResponse.setZoneUuid(dataCenterVO.getUuid());
+        sfResponse.setZoneName(dataCenterVO.getName());
 
         if (ResponseView.Full.equals(responseView)) {
             sfResponse.setTag(sfVirtualNetwork.getTag());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/017ed7da/plugins/api/solidfire/src/org/apache/cloudstack/api/response/ApiSolidFireVirtualNetworkResponse.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/response/ApiSolidFireVirtualNetworkResponse.java b/plugins/api/solidfire/src/org/apache/cloudstack/api/response/ApiSolidFireVirtualNetworkResponse.java
index 2764019..0001825 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/response/ApiSolidFireVirtualNetworkResponse.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/response/ApiSolidFireVirtualNetworkResponse.java
@@ -67,6 +67,10 @@ public class ApiSolidFireVirtualNetworkResponse extends BaseResponse {
     @Param(description = "UUID of the account the VLAN is associated with")
     private String _accountUuid;
 
+    @SerializedName("accountname")
+    @Param(description = "Name of the account the volume is associated with")
+    private String _accountName;
+
     @SerializedName("zoneid")
     @Param(description = "ID of the zone the VLAN is associated with")
     private long _zoneId;
@@ -75,6 +79,10 @@ public class ApiSolidFireVirtualNetworkResponse extends BaseResponse {
     @Param(description = "UUID of the zone the VLAN 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 VLAN belongs to")
     private String _clusterName;
@@ -159,6 +167,14 @@ public class ApiSolidFireVirtualNetworkResponse extends BaseResponse {
         return _accountUuid;
     }
 
+    public void setAccountName(String accountName) {
+        _accountName = accountName;
+    }
+
+    public String getAccountName() {
+        return _accountName;
+    }
+
     public void setZoneId(long zoneId) {
         _zoneId = zoneId;
     }
@@ -175,6 +191,14 @@ public class ApiSolidFireVirtualNetworkResponse extends BaseResponse {
         return _zoneUuid;
     }
 
+    public void setZoneName(String zoneName) {
+        _zoneName = zoneName;
+    }
+
+    public String getZoneName() {
+        return _zoneName;
+    }
+
     public void setClusterName(String clusterName) {
         _clusterName = clusterName;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/017ed7da/ui/plugins/sfAdministration/sfAdministration.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfAdministration/sfAdministration.js b/ui/plugins/sfAdministration/sfAdministration.js
index 46ac7f2..7afeeda 100644
--- a/ui/plugins/sfAdministration/sfAdministration.js
+++ b/ui/plugins/sfAdministration/sfAdministration.js
@@ -307,7 +307,7 @@
               name: { label: 'label.name' },
               tag: { label: 'Tag' },
               svip: { label: 'SVIP' },
-              account: { label: 'label.account' }
+              accountname: { label: 'label.account' }
             },
             dataProvider: function(args) {
               var clustername = args.context.sfAdministration[0].name;


[23/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Adding in additional checks on "availabilityZone" and "account"


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

Branch: refs/heads/sf-plugins
Commit: 6e9c1c626801dd1c58abc75ae60992a7baab00eb
Parents: 19532fc
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Wed Jul 8 22:46:41 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:42 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfSharedVolume/sfSharedVolume.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6e9c1c62/ui/plugins/sfSharedVolume/sfSharedVolume.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/sfSharedVolume.js b/ui/plugins/sfSharedVolume/sfSharedVolume.js
index 5835edd..a1a72fc 100644
--- a/ui/plugins/sfSharedVolume/sfSharedVolume.js
+++ b/ui/plugins/sfSharedVolume/sfSharedVolume.js
@@ -157,7 +157,8 @@
                   },
                   dependsOn: ['availabilityZone', 'account'],
                   select: function(args) {
-                    if (args.data.availabilityZone == null || args.data.account == null) {
+                    if (args.data.availabilityZone == null || args.data.availabilityZone == "" ||
+                        args.data.account == null || args.data.account == "") {
                       return;
                     }
 


[22/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Send selected zone and account to listSolidFireVirtualNetworks API command


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

Branch: refs/heads/sf-plugins
Commit: 9ca030841dd3ce5c79bbc666eea7ce515b510efe
Parents: 82567f7
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Wed Jul 8 19:45:54 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:42 2015 -0600

----------------------------------------------------------------------
 .../ListSolidFireVirtualNetworksCmd.java        |  8 +++++++-
 .../solidfire/ApiSolidFireService2.java         |  5 +++--
 .../solidfire/ApiSolidFireServiceImpl2.java     | 20 +++++++++++++++++---
 ui/plugins/sfSharedVolume/sfSharedVolume.js     | 10 ++++++++--
 4 files changed, 35 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ca03084/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java
index a8c0ccd..750f1c8 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java
@@ -31,6 +31,7 @@ import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.api.ResponseObject.ResponseView;
 import org.apache.cloudstack.api.helper.ApiHelper;
+import org.apache.cloudstack.api.response.AccountResponse;
 import org.apache.cloudstack.api.response.ApiSolidFireVirtualNetworkResponse;
 import org.apache.cloudstack.api.response.ListResponse;
 import org.apache.cloudstack.api.response.ZoneResponse;
@@ -51,6 +52,11 @@ public class ListSolidFireVirtualNetworksCmd extends BaseListCmd {
     @Parameter(name = ApiConstants.ZONE_ID, type = CommandType.UUID, entityType = ZoneResponse.class, description = ApiHelper.ZONE_ID_DESC)
     private Long _zoneId;
 
+    @Parameter(name = ApiConstants.ACCOUNT_ID, type = CommandType.UUID, entityType = AccountResponse.class, description = ApiHelper.ACCOUNT_ID_DESC)
+    private long _accountId;
+
+    @Inject private ApiHelper _apiHelper;
+
     /////////////////////////////////////////////////////
     /////////////// API Implementation///////////////////
     /////////////////////////////////////////////////////
@@ -77,7 +83,7 @@ public class ListSolidFireVirtualNetworksCmd extends BaseListCmd {
                 }
             }
             else {
-                sfVirtualNetworks = _apiSolidFireService2.listSolidFireVirtualNetworks(_zoneId);
+                sfVirtualNetworks = _apiSolidFireService2.listSolidFireVirtualNetworks(_zoneId, _accountId);
             }
 
             ResponseView responseView = ApiHelper.instance().isRootAdmin() ? ResponseView.Full : ResponseView.Restricted;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ca03084/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireService2.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireService2.java b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireService2.java
index 288b7f7..07f200a 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireService2.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireService2.java
@@ -44,8 +44,9 @@ public interface ApiSolidFireService2 extends PluggableService, Configurable {
 
     SfVirtualNetwork listSolidFireVirtualNetwork(long id);
 
-    // Long (instead of long) because it's optional and null is used to indicate that it's not present
-    List<SfVirtualNetwork> listSolidFireVirtualNetworks(Long zoneId);
+    // Long (instead of long) for both zoneId and accountId because they're optional and null is used to indicate that they're not present
+    // zoneId and accountId are not dependent upon one another (i.e. either one can be null, both can be null, or both can be not be null)
+    List<SfVirtualNetwork> listSolidFireVirtualNetworks(Long zoneId, Long accountId);
 
     SfVirtualNetwork createSolidFireVirtualNetwork(String clusterName, String name, String tag, String startIp, int size,
             String netmask, String svip, long accountId);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ca03084/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
index 9af4ac2..d91febc 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
@@ -254,20 +254,34 @@ public class ApiSolidFireServiceImpl2 extends AdapterBase implements APIChecker,
     }
 
     @Override
-    public List<SfVirtualNetwork> listSolidFireVirtualNetworks(Long zoneId) {
+    public List<SfVirtualNetwork> listSolidFireVirtualNetworks(Long zoneId, Long accountId) {
         s_logger.info("listSolidFireVirtualNetworks invoked");
 
         final List<SfVirtualNetworkVO> sfVirtualNetworkVOs;
 
         if (ApiHelper.instance().isRootAdmin()) {
             if (zoneId != null) {
-                sfVirtualNetworkVOs = filterVirtualNetworksByZone(_sfVirtualNetworkDao.listAll(), zoneId);
+                if (accountId != null) {
+                    sfVirtualNetworkVOs = filterVirtualNetworksByZone(_sfVirtualNetworkDao.findByAccountId(accountId), zoneId);
+                }
+                else {
+                    sfVirtualNetworkVOs = filterVirtualNetworksByZone(_sfVirtualNetworkDao.listAll(), zoneId);
+                }
             }
             else {
-                sfVirtualNetworkVOs = _sfVirtualNetworkDao.listAll();
+                if (accountId != null) {
+                    sfVirtualNetworkVOs = _sfVirtualNetworkDao.findByAccountId(accountId);
+                }
+                else {
+                    sfVirtualNetworkVOs = _sfVirtualNetworkDao.listAll();
+                }
             }
         }
         else {
+            if (accountId != null && accountId != _apiHelper.getCallingAccount().getId()) {
+                throw new CloudRuntimeException("Only a root admin can specify an account other than his own.");
+            }
+
             if (zoneId != null) {
                 sfVirtualNetworkVOs = filterVirtualNetworksByZone(_sfVirtualNetworkDao.findByAccountId(ApiHelper.instance().getCallingAccount().getId()), zoneId);
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ca03084/ui/plugins/sfSharedVolume/sfSharedVolume.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/sfSharedVolume.js b/ui/plugins/sfSharedVolume/sfSharedVolume.js
index 0f55a5d..2d904cd 100644
--- a/ui/plugins/sfSharedVolume/sfSharedVolume.js
+++ b/ui/plugins/sfSharedVolume/sfSharedVolume.js
@@ -131,7 +131,7 @@
                           filteredAccountObjs = accountObjs;
                         }
                         else {
-                          for (int i = 0; i < accountObjs.length; i++) {
+                          for (i = 0; i < accountObjs.length; i++) {
                             var accountObj = accountObjs[i];
 
                             if (accountObj.domainid == g_domainid) {
@@ -155,9 +155,15 @@
                   validation: {
                     required: true
                   },
+                  dependsOn: ['availabilityZone', 'account'],
                   select: function(args) {
+                    var params = [];
+
+                    params.push("&zoneid=" + args.data.availabilityZone);
+                    params.push("&accountid=" + args.data.account);
+
                     $.ajax({
-                      url: createURL("listSolidFireVirtualNetworks"),
+                      url: createURL("listSolidFireVirtualNetworks" + params.join("")),
                       dataType: "json",
                       async: true,
                       success: function(json) {


[03/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Testing functionality


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

Branch: refs/heads/sf-plugins
Commit: efb00e2de1837788162d8e2d191af6cf094a6f40
Parents: 192e035
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Mon Jul 6 14:43:07 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:40 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfSharedVolume/sfSharedVolume.js | 26 ++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/efb00e2d/ui/plugins/sfSharedVolume/sfSharedVolume.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/sfSharedVolume.js b/ui/plugins/sfSharedVolume/sfSharedVolume.js
index 4c8e317..2ac3f68 100644
--- a/ui/plugins/sfSharedVolume/sfSharedVolume.js
+++ b/ui/plugins/sfSharedVolume/sfSharedVolume.js
@@ -4,11 +4,29 @@
       id: 'sfSharedVolume',
       title: 'Shared Volume',
       preFilter: function(args) {
-        return isAdmin();
+        return true;
       },
-      show: function() {
-        return $('<div>').html('Content will go here');
+      listView: {
+        id: 'testPluginInstances',
+        fields: {
+          name: { label: 'label.name' },
+          instancename: { label: 'label.internal.name' },
+          displayname: { label: 'label.display.name' },
+          zonename: { label: 'label.zone.name' }
+        },
+        dataProvider: function(args) {
+          plugin.ui.apiCall('listVirtualMachines', {
+            success: function(json) {
+              var vms = json.listvirtualmachinesresponse.virtualmachine;
+
+              args.response.success({ data: vms });
+            },
+            error: function(errorMessage) {
+              args.response.error(errorMessage)
+            }
+          });
+        }
       }
     });
   };
-}(cloudStack));
+}(cloudStack));
\ No newline at end of file


[42/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
The "clustername" parameter should not be required.

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

Branch: refs/heads/sf-plugins
Commit: 222e181d1cd1c192b6c0569a8da5107b34fe0096
Parents: f1f80b2
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Tue Jul 21 18:14:37 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:44 2015 -0600

----------------------------------------------------------------------
 .../command/user/solidfire/ListSolidFireVirtualNetworksCmd.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/222e181d/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java
index 2f380e7..0dca421 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java
@@ -49,7 +49,7 @@ public class ListSolidFireVirtualNetworksCmd extends BaseListCmd {
     @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = ApiSolidFireVirtualNetworkResponse.class, description = ApiHelper.VIRTUAL_NETWORK_ID_DESC)
     private Long _id;
 
-    @Parameter(name = ApiHelper.CLUSTER_NAME, type = CommandType.STRING, description = ApiHelper.SOLIDFIRE_CLUSTER_NAME_DESC, required = true)
+    @Parameter(name = ApiHelper.CLUSTER_NAME, type = CommandType.STRING, description = ApiHelper.SOLIDFIRE_CLUSTER_NAME_DESC)
     private String _clusterName;
 
     @Parameter(name = ApiConstants.ZONE_ID, type = CommandType.UUID, entityType = ZoneResponse.class, description = ApiHelper.ZONE_ID_DESC)


[07/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Add an "actions" section to the rows in the table


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

Branch: refs/heads/sf-plugins
Commit: 0fc4b0c30c816eca2c8f2a419743c11b314f696b
Parents: 4d126d2
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Mon Jul 6 17:26:16 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:40 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfSharedVolume/sfSharedVolume.js | 30 +++++++++++++++++-------
 1 file changed, 22 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0fc4b0c3/ui/plugins/sfSharedVolume/sfSharedVolume.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/sfSharedVolume.js b/ui/plugins/sfSharedVolume/sfSharedVolume.js
index d5e13c0..baf8aea 100644
--- a/ui/plugins/sfSharedVolume/sfSharedVolume.js
+++ b/ui/plugins/sfSharedVolume/sfSharedVolume.js
@@ -7,24 +7,38 @@
         return true;
       },
       listView: {
-        id: 'sfClusters',
+        id: 'sfSharedVolumes',
         fields: {
           name: { label: 'label.name' },
-          mvip: { label: 'MVIP' },
-          username: { label: 'label.username' },
-          zonename: { label: 'label.zone.name' }
+          iqn: { label: 'IQN' },
+          size: { label: 'Size' },
+          miniops: { label: 'Min IOPS' },
+          maxiops: { label: 'Max IOPS' },
+          burstiops: { label: 'Burst IOPS' }
         },
         dataProvider: function(args) {
-          plugin.ui.apiCall('listSolidFireClusters', {
+          plugin.ui.apiCall('listSolidFireVolumes', {
             success: function(json) {
-              var sfclusters = json.listsolidfireclustersresponse.sfcluster;
+              var sfvolumes = json.listsolidfirevolumesresponse.sfvolume;
 
-              args.response.success({ data: sfclusters });
+              args.response.success({ data: sfvolumes });
             },
             error: function(errorMessage) {
-              args.response.error(errorMessage)
+              args.response.error(errorMessage);
             }
           });
+        },
+        actions: {
+          delete: {
+            label: "Delete Shared Volume",
+            messages: {
+              confirm: function() { return 'Are you sure you want to delete this shared volume?' },
+              notification: function() { return 'Deleted shared volume' }
+            },
+            action: function(args) {
+              var instance = args.context.sfSharedVolumes[0];
+            }
+          }
         }
       },
       actions: {


[19/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Add account combo box to Add Shared Volume window


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

Branch: refs/heads/sf-plugins
Commit: 78366e55835afade53d4cd791a878d4eecab66ce
Parents: ce6912c
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Tue Jul 7 17:38:26 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:41 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfSharedVolume/sfSharedVolume.js | 39 ++++++++++++++++++------
 1 file changed, 30 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/78366e55/ui/plugins/sfSharedVolume/sfSharedVolume.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/sfSharedVolume.js b/ui/plugins/sfSharedVolume/sfSharedVolume.js
index c6371ca..f8f3aaf 100644
--- a/ui/plugins/sfSharedVolume/sfSharedVolume.js
+++ b/ui/plugins/sfSharedVolume/sfSharedVolume.js
@@ -69,14 +69,14 @@
                   }
                 },
                 name: {
-				  label: 'label.name',
+                  label: 'label.name',
                   docID: 'helpVolumeName',
                   validation: {
                     required: true
                   }
                 },
                 diskSize: {
-				  label: 'label.disk.size.gb',
+                  label: 'label.disk.size.gb',
                   validation: {
                     required: true,
                     number: true
@@ -103,6 +103,27 @@
                     number: true
                   }
                 },
+                account: {
+                  label: 'Account',
+                  validation: {
+                    required: true
+                  },
+                  select: function(args) {
+                    $.ajax({
+                      url: createURL("listAccounts"),
+                      dataType: "json",
+                      async: true,
+                      success: function(json) {
+                        var accountObjs = json.listaccountsresponse.account;
+
+                        args.response.success({
+                          descriptionField: 'name',
+                          data: accountObjs
+                        });
+                      }
+                    });
+                  }
+                },
                 vlan: {
                   label: 'VLAN',
                   validation: {
@@ -126,22 +147,22 @@
                 }
               }
             },
-			action: function(args) {
+            action: function(args) {
               var data = {
                 name: args.data.name,
-				size: args.data.diskSize,
+                size: args.data.diskSize,
                 miniops: args.data.minIops,
                 maxiops: args.data.maxIops,
-				burstiops: args.data.burstIops,
-				sfvirtualnetworkid: args.data.vlan,
-				accountid: 2
+                burstiops: args.data.burstIops,
+                accountid: args.data.account,
+                sfvirtualnetworkid: args.data.vlan
               };
 
               $.ajax({
                 url: createURL('createSolidFireVolume'),
                 data: data,
                 success: function(json) {
-			      var sfvolumeObj = json.createsolidfirevolumeresponse.apicreatesolidfirevolume;
+                  var sfvolumeObj = json.createsolidfirevolumeresponse.apicreatesolidfirevolume;
 
                   args.response.success({
                     data: sfvolumeObj
@@ -151,7 +172,7 @@
                   args.response.error(parseXMLHttpResponse(json));
                 }
               });
-			}
+            }
           }
         },
         detailView: {


[35/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Return "false" instead of throwing an exception when the user doesn't have permission to execute an operation

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

Branch: refs/heads/sf-plugins
Commit: 01ab5fcb2684fc492036705a3d522d45efed3e7d
Parents: dce9f7c
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Tue Jul 14 20:36:53 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:43 2015 -0600

----------------------------------------------------------------------
 .../org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/01ab5fcb/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
index 58ebc4b..b626c67 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
@@ -494,7 +494,7 @@ public class ApiSolidFireServiceImpl2 extends AdapterBase implements APIChecker,
             return true;
         }
 
-        throw new PermissionDeniedException("Insufficient permissions to perform this action");
+        return false;
     }
 
     @Override


[04/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Initial 'Shared Volume' GUI plug-in


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

Branch: refs/heads/sf-plugins
Commit: 192e035ebc3e2cfce209758d3905e00b9ed9c126
Parents: 2b4c2b0
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Mon Jul 6 13:55:08 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:40 2015 -0600

----------------------------------------------------------------------
 ui/plugins/plugins.js                       |  3 ++-
 ui/plugins/sfSharedVolume/config.js         |  9 +++++++++
 ui/plugins/sfSharedVolume/sfSharedVolume.js | 14 ++++++++++++++
 3 files changed, 25 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/192e035e/ui/plugins/plugins.js
----------------------------------------------------------------------
diff --git a/ui/plugins/plugins.js b/ui/plugins/plugins.js
index 386ec06..6e5557f 100644
--- a/ui/plugins/plugins.js
+++ b/ui/plugins/plugins.js
@@ -16,6 +16,7 @@
 // under the License.
 (function($, cloudStack) {
   cloudStack.plugins = [
-    // 'testPlugin'
+    // 'testPlugin',
+    // 'sfSharedVolume'
   ];
 }(jQuery, cloudStack));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/192e035e/ui/plugins/sfSharedVolume/config.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/config.js b/ui/plugins/sfSharedVolume/config.js
new file mode 100644
index 0000000..3784be6
--- /dev/null
+++ b/ui/plugins/sfSharedVolume/config.js
@@ -0,0 +1,9 @@
+(function (cloudStack) {
+  cloudStack.plugins.sfSharedVolume.config = {
+    title: 'Shared Volume',
+    desc: 'Shared Volume',
+    externalLink: 'http://www.solidfire.com/',
+    authorName: 'Mike Tutkowski',
+    authorEmail: 'mike.tutkowski@solidfire.com'
+  };
+}(cloudStack));
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/192e035e/ui/plugins/sfSharedVolume/sfSharedVolume.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/sfSharedVolume.js b/ui/plugins/sfSharedVolume/sfSharedVolume.js
new file mode 100644
index 0000000..4c8e317
--- /dev/null
+++ b/ui/plugins/sfSharedVolume/sfSharedVolume.js
@@ -0,0 +1,14 @@
+(function (cloudStack) {
+  cloudStack.plugins.sfSharedVolume = function(plugin) {
+    plugin.ui.addSection({
+      id: 'sfSharedVolume',
+      title: 'Shared Volume',
+      preFilter: function(args) {
+        return isAdmin();
+      },
+      show: function() {
+        return $('<div>').html('Content will go here');
+      }
+    });
+  };
+}(cloudStack));


[49/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Modified an error message related to trying to delete a reference to a cluster that has one or more virtual networks

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

Branch: refs/heads/sf-plugins
Commit: f78f03cc0ea27f11ceb040d542c081fb43ef64d7
Parents: 2b787db
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Thu Jul 23 17:21:37 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:45 2015 -0600

----------------------------------------------------------------------
 .../org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f78f03cc/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
index 208e62a..ff11202 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
@@ -233,7 +233,7 @@ public class ApiSolidFireServiceImpl2 extends AdapterBase implements APIChecker,
         List<SfVirtualNetworkVO> sfVirtualNetworks = _sfVirtualNetworkDao.findByClusterId(sfCluster.getId());
 
         if (sfVirtualNetworks != null && sfVirtualNetworks.size() > 0) {
-            throw new CloudRuntimeException("Unable to delete a cluster that has one or more virtual networks");
+            throw new CloudRuntimeException("Unable to delete a reference to a cluster that has one or more virtual networks");
         }
 
         if (!_sfClusterDao.remove(sfCluster.getId())) {


[05/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Add editing ability


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

Branch: refs/heads/sf-plugins
Commit: 0b09c531464013fd4f734268f48e02de5dcd85b8
Parents: a3f4708
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Mon Jul 6 19:34:07 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:40 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfSharedVolume/sfSharedVolume.js | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0b09c531/ui/plugins/sfSharedVolume/sfSharedVolume.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/sfSharedVolume.js b/ui/plugins/sfSharedVolume/sfSharedVolume.js
index baf8aea..70e5208 100644
--- a/ui/plugins/sfSharedVolume/sfSharedVolume.js
+++ b/ui/plugins/sfSharedVolume/sfSharedVolume.js
@@ -11,7 +11,7 @@
         fields: {
           name: { label: 'label.name' },
           iqn: { label: 'IQN' },
-          size: { label: 'Size' },
+          size: { label: 'Size (GB)' },
           miniops: { label: 'Min IOPS' },
           maxiops: { label: 'Max IOPS' },
           burstiops: { label: 'Burst IOPS' }
@@ -28,15 +28,16 @@
             }
           });
         },
-        actions: {
-          delete: {
-            label: "Delete Shared Volume",
-            messages: {
-              confirm: function() { return 'Are you sure you want to delete this shared volume?' },
-              notification: function() { return 'Deleted shared volume' }
-            },
-            action: function(args) {
-              var instance = args.context.sfSharedVolumes[0];
+        detailView: {
+          name: 'Shared volume details',
+          isMaximized: true,
+          actions: {
+            edit: {
+              label: 'Edit shared volume',
+              compactLabel: 'label.edit',
+              action: function(args) {
+                var sharedVolumeObj = args.context;
+              }
             }
           }
         }


[20/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Start adding related code to delete a volume


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

Branch: refs/heads/sf-plugins
Commit: 7bb5442ae47173cd18617d7d3b0c5971b929aef0
Parents: 6e9c1c6
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Thu Jul 9 09:03:35 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:42 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfSharedVolume/sfSharedVolume.js | 25 ++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7bb5442a/ui/plugins/sfSharedVolume/sfSharedVolume.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/sfSharedVolume.js b/ui/plugins/sfSharedVolume/sfSharedVolume.js
index a1a72fc..6eb9cf1 100644
--- a/ui/plugins/sfSharedVolume/sfSharedVolume.js
+++ b/ui/plugins/sfSharedVolume/sfSharedVolume.js
@@ -157,8 +157,8 @@
                   },
                   dependsOn: ['availabilityZone', 'account'],
                   select: function(args) {
-                    if (args.data.availabilityZone == null || args.data.availabilityZone == "" ||
-                        args.data.account == null || args.data.account == "") {
+                    if (args.data.availabilityZone === null || args.data.availabilityZone === "" ||
+                        args.data.account === null || args.data.account === "") {
                       return;
                     }
 
@@ -213,14 +213,23 @@
           }
         },
         detailView: {
-          name: 'Shared volume details',
-          isMaximized: true,
+          name: 'label.volume.details',
+          viewAll: {
+            path: 'storage.snapshots',
+            label: 'label.snapshots'
+          },
           actions: {
-            edit: {
-              label: 'Edit shared volume',
-              compactLabel: 'label.edit',
+            deleteVolume: {
+              label: 'Delete Shared Volume',
+              messages: {
+                confirm: function(args) {
+                  return 'Are you sure you would like to delete this shared volume?';
+                },
+                notification: function(args) {
+                  return 'Shared volume deleted';
+                }
+              },
               action: function(args) {
-                var sharedVolumeObj = args.context;
               }
             }
           }


[15/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Allow user to create a volume


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

Branch: refs/heads/sf-plugins
Commit: ce6912cc78c9830d8d712bd90a92900baa9987b1
Parents: c386bbb
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Tue Jul 7 17:22:14 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:41 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfSharedVolume/sfSharedVolume.js | 27 +++++++++++++-----------
 1 file changed, 15 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ce6912cc/ui/plugins/sfSharedVolume/sfSharedVolume.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/sfSharedVolume.js b/ui/plugins/sfSharedVolume/sfSharedVolume.js
index 8896526..c6371ca 100644
--- a/ui/plugins/sfSharedVolume/sfSharedVolume.js
+++ b/ui/plugins/sfSharedVolume/sfSharedVolume.js
@@ -114,7 +114,7 @@
                       dataType: "json",
                       async: true,
                       success: function(json) {
-                        var virtualNetworkObjs = json.listvirtualnetworksresponse.virtualnetwork;
+                        var virtualNetworkObjs = json.listsolidfirevirtualnetworksresponse.sfvirtualnetwork;
 
                         args.response.success({
                           descriptionField: 'name',
@@ -127,21 +127,24 @@
               }
             },
 			action: function(args) {
+              var data = {
+                name: args.data.name,
+				size: args.data.diskSize,
+                miniops: args.data.minIops,
+                maxiops: args.data.maxIops,
+				burstiops: args.data.burstIops,
+				sfvirtualnetworkid: args.data.vlan,
+				accountid: 2
+              };
+
               $.ajax({
-                url: createURL('createVolume'),
+                url: createURL('createSolidFireVolume'),
                 data: data,
                 success: function(json) {
-                  var jid = json.createvolumeresponse.jobid;
+			      var sfvolumeObj = json.createsolidfirevolumeresponse.apicreatesolidfirevolume;
+
                   args.response.success({
-                    _custom: {
-                      jobId: jid,
-                      getUpdatedItem: function(json) {
-                        return json.queryasyncjobresultresponse.jobresult.volume;
-                      },
-                      getActionFilter: function() {
-                        return volumeActionfilter;
-                      }
-                    }
+                    data: sfvolumeObj
                   });
                 },
                 error: function(json) {


[24/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Display volume details


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

Branch: refs/heads/sf-plugins
Commit: 84a6642b2713cf5d7baab820c09cd900a8f0d1b7
Parents: 1eb3c68
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Thu Jul 9 17:02:01 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:42 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfSharedVolume/sfSharedVolume.js | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/84a6642b/ui/plugins/sfSharedVolume/sfSharedVolume.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/sfSharedVolume.js b/ui/plugins/sfSharedVolume/sfSharedVolume.js
index ab76ff3..c37d9c3 100644
--- a/ui/plugins/sfSharedVolume/sfSharedVolume.js
+++ b/ui/plugins/sfSharedVolume/sfSharedVolume.js
@@ -313,20 +313,15 @@
                   }
                 }
               ],
-              tags: cloudStack.api.tags({
-                resourceType: 'Volume',
-                contextId: 'volumes'
-              }),
               dataProvider: function(args) {
                 $.ajax({
-                  url: createURL("listSolidFireVolumes&id=" + args.context.volumes[0].id),
+                  url: createURL("listSolidFireVolumes&id=" + args.context.sfSharedVolumes[0].id),
                   dataType: "json",
                   async: true,
                   success: function(json) {
                     var jsonObj = json.listsolidfirevolumesresponse.sfvolume[0];
 
                     args.response.success({
-                      actionFilter: volumeActionfilter,
                       data: jsonObj
                     });
                   }


[39/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Modifications to fields for virtual-networking support

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

Branch: refs/heads/sf-plugins
Commit: 2b787db0d02af72074ed0bac20a10050b457c4ad
Parents: 7cf8a84
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Wed Jul 22 20:07:23 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:44 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfAdministration/sfAdministration.js | 88 +++-----------------
 1 file changed, 13 insertions(+), 75 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2b787db0/ui/plugins/sfAdministration/sfAdministration.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfAdministration/sfAdministration.js b/ui/plugins/sfAdministration/sfAdministration.js
index a18f81d..68a3197 100644
--- a/ui/plugins/sfAdministration/sfAdministration.js
+++ b/ui/plugins/sfAdministration/sfAdministration.js
@@ -383,66 +383,12 @@
                         required: true
                       }
                     },
-                    description: {
-                      label: 'Description',
-                      validation: {
-                        required: true
-                      }
-                    },
                     tag: {
                       label: 'Tag',
                       validation: {
                         required: true
                       }
                     },
-                    physicalnetwork: {
-                      label: 'Physical Network',
-                      validation: {
-                        required: true
-                      },
-                      select: function(args) {
-                        $.ajax({
-                          url: createURL("listAccounts&listAll=true"),
-                          dataType: "json",
-                          async: true,
-                          success: function(json) {
-                            var accountObjs = json.listaccountsresponse.account;
-
-                            args.response.success({
-                              descriptionField: 'name',
-                              data: accountObjs
-                            });
-                          }
-                        });
-                      }
-                    },
-                    networkoffering: {
-                      label: 'Network Offering',
-                      validation: {
-                        required: true
-                      },
-                      select: function(args) {
-                        $.ajax({
-                          url: createURL("listAccounts&listAll=true"),
-                          dataType: "json",
-                          async: true,
-                          success: function(json) {
-                            var accountObjs = json.listaccountsresponse.account;
-
-                            args.response.success({
-                              descriptionField: 'name',
-                              data: accountObjs
-                            });
-                          }
-                        });
-                      }
-                    },
-                    gateway: {
-                      label: 'Gateway',
-                      validation: {
-                        required: true
-                      }
-                    },
                     netmask: {
                       label: 'Netmask',
                       validation: {
@@ -455,10 +401,11 @@
                         required: true
                       }
                     },
-                    endip: {
-                      label: 'End IP',
+                    size: {
+                      label: 'Size',
                       validation: {
-                        required: true
+                        required: true,
+                        number: true
                       }
                     },
                     svip: {
@@ -472,13 +419,13 @@
                 action: function(args) {
                   var data = {
                     clustername: args.context.sfAdministration[0].name,
+                    accountid: args.data.account,
                     name: args.data.name,
                     tag: args.data.tag,
-                    startip: args.data.startip,
-                    size: 10, // Mike T. args.data.size,
                     netmask: args.data.netmask,
-                    svip: args.data.svip,
-                    accountid: args.data.account
+                    startip: args.data.startip,
+                    size: args.data.size,
+                    svip: args.data.svip
                   };
 
                   $.ajax({
@@ -514,9 +461,9 @@
                     params.push("&id=" + args.context.sfVirtualNetworks[0].id);
                     params.push("&name=" + args.data.name);
                     params.push("&tag=" + args.data.tag);
-                    params.push("&startip=" + args.data.startip);
-                    params.push("&size=" + "10"); // Mike T. args.data.size);
                     params.push("&netmask=" + args.data.netmask);
+                    params.push("&startip=" + args.data.startip);
+                    params.push("&size=" + args.data.size);
                     params.push("&svip=" + args.data.svip);
 
                     $.ajax({
@@ -581,16 +528,6 @@
                         label: 'Tag',
                         isEditable: true
                       },
-                      physicalnetwork: {
-                        label: 'Physical Network'
-                      },
-                      networkoffering: {
-                        label: 'Network Offering'
-                      },
-                      gateway: {
-                        label: 'Gateway',
-                        isEditable: true
-                      },
                       netmask: {
                         label: 'Netmask',
                         isEditable: true
@@ -599,8 +536,9 @@
                         label: 'Start IP',
                         isEditable: true
                       },
-                      endip: {
-                        label: 'End IP',
+                      size: {
+                        label: 'Size',
+                        number: true,
                         isEditable: true
                       },
                       svip: {


[41/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Changed the names of some properties that are sent to the CS MS

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

Branch: refs/heads/sf-plugins
Commit: 0d46b108e15a07c84b3d0d8be4402d76fb001b05
Parents: e02a9b2
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Wed Jul 15 22:19:29 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:44 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfAdministration/sfAdministration.js | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0d46b108/ui/plugins/sfAdministration/sfAdministration.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfAdministration/sfAdministration.js b/ui/plugins/sfAdministration/sfAdministration.js
index e16f0f5..bdb467b 100644
--- a/ui/plugins/sfAdministration/sfAdministration.js
+++ b/ui/plugins/sfAdministration/sfAdministration.js
@@ -134,14 +134,14 @@
             },
             action: function(args) {
               var data = {
-               availabilityzone: args.data.availabilityzone,
+                zoneid: args.data.availabilityZone,
                 mvip: args.data.mvip,
                 username: args.data.username,
                 password: args.data.password,
-                totalcapacity: args.data.totalcapacity,
-                totalminiops: args.data.totalminiops,
-                totalmaxiops: args.data.totalmaxiops,
-                totalburstiops: args.data.totalburstiops
+                totalcapacity: args.data.totalCapacity,
+                totalminiops: args.data.totalMinIops,
+                totalmaxiops: args.data.totalMaxIops,
+                totalburstiops: args.data.totalBurstIops
               };
 
               $.ajax({


[14/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Conditionally show the Account field in the Add Shared Volume window


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

Branch: refs/heads/sf-plugins
Commit: 8eea9c96d004ba9b050e03a50f16f58802f6d014
Parents: 78366e5
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Tue Jul 7 23:37:51 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:41 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfSharedVolume/sfSharedVolume.js | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8eea9c96/ui/plugins/sfSharedVolume/sfSharedVolume.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/sfSharedVolume.js b/ui/plugins/sfSharedVolume/sfSharedVolume.js
index f8f3aaf..d935b04 100644
--- a/ui/plugins/sfSharedVolume/sfSharedVolume.js
+++ b/ui/plugins/sfSharedVolume/sfSharedVolume.js
@@ -108,12 +108,19 @@
                   validation: {
                     required: true
                   },
+                  isHidden: true,
                   select: function(args) {
                     $.ajax({
                       url: createURL("listAccounts"),
                       dataType: "json",
                       async: true,
                       success: function(json) {
+                        if (isAdmin()) {
+                          var $form = $(this).closest('form');
+
+                          $form.find('.form-item[rel=account]').show();
+                        }
+
                         var accountObjs = json.listaccountsresponse.account;
 
                         args.response.success({


[26/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Adding the ability to edit certain properties of a volume


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

Branch: refs/heads/sf-plugins
Commit: 2ef0de9aeb27ad5a5c4a59140e13959ef0f9e5b0
Parents: 26bfa4f
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Fri Jul 10 10:21:16 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:42 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfSharedVolume/sfSharedVolume.js | 45 +++++++++++++++++++++---
 1 file changed, 40 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2ef0de9a/ui/plugins/sfSharedVolume/sfSharedVolume.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/sfSharedVolume.js b/ui/plugins/sfSharedVolume/sfSharedVolume.js
index b43b221..f2182f6 100644
--- a/ui/plugins/sfSharedVolume/sfSharedVolume.js
+++ b/ui/plugins/sfSharedVolume/sfSharedVolume.js
@@ -215,8 +215,39 @@
         detailView: {
           name: 'label.volume.details',
           actions: {
+            edit: {
+              label: 'label.edit',
+              messages: {
+                notification: function(args) {
+                  return 'Edit Shared Volume';
+                }
+              },
+              action: function (args) {
+                var params = [];
+
+                params.push("&id=" + args.context.sfSharedVolumes[0].id);
+                params.push("&size=" + args.data.size);
+                params.push("&miniops=" + args.data.miniops);
+                params.push("&maxiops=" + args.data.maxiops);
+                params.push("&burstiops=" + args.data.burstiops);
+
+                $.ajax({
+                  url: createURL('updateSolidFireVolume' + params.join("")),
+                  success: function(json) {
+                    var sfvolumeObj = json.updatesolidfirevolumeresponse.apiupdatesolidfirevolume;
+
+                    args.response.success({
+                      data: sfvolumeObj
+                    });
+                  },
+                  error: function(json) {
+                    args.response.error(parseXMLHttpResponse(json));
+                  }
+                });
+              }
+            },
             remove: {
-              label: 'Delete Shared Volume',
+              label: 'label.delete',
               messages: {
                 confirm: function(args) {
                   return 'Are you sure you would like to delete this shared volume?';
@@ -275,16 +306,20 @@
                     label: 'VLAN'
                   },
                   size: {
-                    label: 'label.disk.size.gb'
+                    label: 'label.disk.size.gb',
+                    isEditable: true
                   },
                   miniops: {
-                    label: 'label.disk.iops.min'
+                    label: 'label.disk.iops.min',
+                    isEditable: true
                   },
                   maxiops: {
-                    label: 'label.disk.iops.max'
+                    label: 'label.disk.iops.max',
+                    isEditable: true
                   },
                   burstiops: {
-                    label: 'Burst IOPS'
+                    label: 'Burst IOPS',
+                    isEditable: true
                   },
                   targetportal: {
                     label: 'Target Portal'


[08/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Add a button


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

Branch: refs/heads/sf-plugins
Commit: 4d126d2c0abd72a2e99d1f34c4a3d57970e81354
Parents: e484b47
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Mon Jul 6 16:12:12 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:40 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfSharedVolume/sfSharedVolume.js | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4d126d2c/ui/plugins/sfSharedVolume/sfSharedVolume.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/sfSharedVolume.js b/ui/plugins/sfSharedVolume/sfSharedVolume.js
index bfd1212..d5e13c0 100644
--- a/ui/plugins/sfSharedVolume/sfSharedVolume.js
+++ b/ui/plugins/sfSharedVolume/sfSharedVolume.js
@@ -11,7 +11,7 @@
         fields: {
           name: { label: 'label.name' },
           mvip: { label: 'MVIP' },
-          username: { label: 'Username' },
+          username: { label: 'label.username' },
           zonename: { label: 'label.zone.name' }
         },
         dataProvider: function(args) {
@@ -26,6 +26,19 @@
             }
           });
         }
+      },
+      actions: {
+        add: {
+          label: 'Add Shared Volume',
+          preFilter: function(args) {
+            return true;
+          },
+          messages: {
+            notification: function(args) {
+              return 'Add Shared Volume';
+            }
+          }
+        }
       }
     });
   };


[34/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Perform basic verification on the passed-in IOPS values


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

Branch: refs/heads/sf-plugins
Commit: 7871e772690f7cac74f23b039b8625d6ab219ea1
Parents: 03f60e6
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Sun Jul 12 22:35:33 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:43 2015 -0600

----------------------------------------------------------------------
 .../solidfire/ApiSolidFireServiceImpl2.java       | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7871e772/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
index d91febc..7c585a8 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
@@ -639,6 +639,8 @@ public class ApiSolidFireServiceImpl2 extends AdapterBase implements APIChecker,
     }
 
     private SfVolume createVolume(String name, long size, long minIops, long maxIops, long burstIops, long accountId, long sfVirtualNetworkId) {
+        verifyIops(minIops, maxIops, burstIops);
+
         Account account = _accountDao.findById(accountId);
 
         SfVirtualNetwork sfVirtualNetwork = getSfVirtualNetwork(sfVirtualNetworkId);
@@ -740,6 +742,8 @@ public class ApiSolidFireServiceImpl2 extends AdapterBase implements APIChecker,
     }
 
     private SfVolumeVO updateVolume(SfVolumeVO sfVolumeVO, long size, long minIops, long maxIops, long burstIops) {
+        verifyIops(minIops, maxIops, burstIops);
+
         SfVirtualNetwork sfVirtualNetwork = getSfVirtualNetwork(sfVolumeVO.getSfVirtualNetworkId());
 
         Account account = _accountDao.findById(sfVirtualNetwork.getAccountId());
@@ -989,4 +993,18 @@ public class ApiSolidFireServiceImpl2 extends AdapterBase implements APIChecker,
 
         return sfVirtualNetworkVOsToReturn;
     }
+
+    private static void verifyIops(long minIops, long maxIops, long burstIops) {
+        if (minIops <= 0 || maxIops <= 0 || burstIops <= 0) {
+            throw new IllegalArgumentException("The 'Min IOPS', 'Max IOPS', and 'Burst IOPS' values must be greater than 0.");
+        }
+
+        if (minIops > maxIops) {
+            throw new IllegalArgumentException("The 'Min IOPS' value cannot exceed the 'Max IOPS' value.");
+        }
+
+        if (maxIops > burstIops) {
+            throw new IllegalArgumentException("The 'Max IOPS' value cannot exceed the 'Burst IOPS' value.");
+        }
+    }
 }


[10/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
A root admin can see all accounts whereas others can only see the account they belong to


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

Branch: refs/heads/sf-plugins
Commit: 82567f78aba8d5bc15ad04f0224c8c565207f6f3
Parents: 74208d5
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Wed Jul 8 15:07:13 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:41 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfSharedVolume/sfSharedVolume.js | 25 ++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/82567f78/ui/plugins/sfSharedVolume/sfSharedVolume.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/sfSharedVolume.js b/ui/plugins/sfSharedVolume/sfSharedVolume.js
index 90395cc..0f55a5d 100644
--- a/ui/plugins/sfSharedVolume/sfSharedVolume.js
+++ b/ui/plugins/sfSharedVolume/sfSharedVolume.js
@@ -110,20 +110,41 @@
                   },
                   isHidden: true,
                   select: function(args) {
+                    var accountNameParam = "";
+
                     if (isAdmin()) {
                       args.$form.find('.form-item[rel=account]').show();
                     }
+                    else {
+                      accountNameParam = "&name=" + g_account;
+                    }
 
                     $.ajax({
-                      url: createURL("listAccounts"),
+                      url: createURL("listAccounts&listAll=true" + accountNameParam),
                       dataType: "json",
                       async: true,
                       success: function(json) {
                         var accountObjs = json.listaccountsresponse.account;
+                        var filteredAccountObjs = [];
+
+                        if (isAdmin()) {
+                          filteredAccountObjs = accountObjs;
+                        }
+                        else {
+                          for (int i = 0; i < accountObjs.length; i++) {
+                            var accountObj = accountObjs[i];
+
+                            if (accountObj.domainid == g_domainid) {
+                              filteredAccountObjs.push(accountObj);
+
+                              break; // there should only be one account with a particular name in a domain
+                            }
+                          }
+                        }
 
                         args.response.success({
                           descriptionField: 'name',
-                          data: accountObjs
+                          data: filteredAccountObjs
                         });
                       }
                     });


[40/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Extending functionality related to virtual networks

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

Branch: refs/heads/sf-plugins
Commit: f1f80b25b46ddb2fdac21fb058bd76848405857e
Parents: 3ed58d8
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Tue Jul 21 17:32:51 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:44 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfAdministration/sfAdministration.js | 154 +++++++++++++++++++
 1 file changed, 154 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f1f80b25/ui/plugins/sfAdministration/sfAdministration.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfAdministration/sfAdministration.js b/ui/plugins/sfAdministration/sfAdministration.js
index cbabf39..158b714 100644
--- a/ui/plugins/sfAdministration/sfAdministration.js
+++ b/ui/plugins/sfAdministration/sfAdministration.js
@@ -468,6 +468,160 @@
                       }
                     }
                   }
+                },
+                action: function(args) {
+                  var data = {
+                    clustername: args.context.sfAdministration[0].name,
+                    name: args.data.name,
+                    tag: args.data.tag,
+                    startip: args.data.startip,
+                    size: 10, // Mike T. args.data.size,
+                    netmask: args.data.netmask,
+                    svip: args.data.svip,
+                    accountid: args.data.account
+                  };
+
+                  $.ajax({
+                    url: createURL('createSolidFireVirtualNetwork'),
+                    data: data,
+                    success: function(json) {
+                      var sfVirtualNetworkObj = json.createsolidfirevirtualnetworkresponse.apicreatesolidfirevirtualnetwork;
+
+                      args.response.success({
+                        data: sfVirtualNetworkObj
+                      });
+                    },
+                    error: function(json) {
+                      args.response.error(parseXMLHttpResponse(json));
+                    }
+                  });
+                }
+              }
+            },
+            detailView: {
+              name: 'label.details',
+              actions: {
+                edit: {
+                  label: 'label.edit',
+                  messages: {
+                    notification: function(args) {
+                      return 'Edit Virtual Network';
+                    }
+                  },
+                  action: function (args) {
+                    var params = [];
+
+                    params.push("&name=" + args.context.name);
+                    params.push("&tag=" + args.data.tag);
+                    params.push("&startip=" + args.data.startip);
+                    params.push("&size=" + "10"); // Mike T. args.data.size);
+                    params.push("&netmask=" + args.data.netmask);
+                    params.push("&svip=" + args.data.svip);
+
+                    $.ajax({
+                      url: createURL('updateSolidFireVirtualNetwork' + params.join("")),
+                      success: function(json) {
+                        var sfVirtualNetworkObj = json.updatesolidfirevirtualnetworkresponse.apiupdatesolidfirevirtualnetwork;
+
+                        args.response.success({
+                          data: sfVirtualNetworkObj
+                        });
+                      },
+                      error: function(json) {
+                        args.response.error(parseXMLHttpResponse(json));
+                      }
+                    });
+                  }
+                },
+                remove: {
+                  label: 'Delete Virtual Network',
+                  messages: {
+                    confirm: function(args) {
+                      return 'Are you sure you would like to delete this virtual network?';
+                    },
+                    notification: function(args) {
+                      return 'Delete Virtual Network';
+                    }
+                  },
+                  action: function(args) {
+                    $.ajax({
+                      url: createURL('deleteSolidFireVirtualNetwork&id=' + args.context.sfVirtualNetwork[0].id),
+                      success: function(json) {
+                        args.response.success();
+                      },
+                      error: function(json) {
+                        args.response.error(parseXMLHttpResponse(json));
+                      }
+                    });
+                  }
+                }
+              },
+              tabs: {
+                details: {
+                  title: 'label.details',
+                  preFilter: function(args) {
+                    return [];
+                  },
+                  fields: [
+                    {
+                      name: {
+                        label: 'label.name',
+                        isEditable: true
+                      }
+                    },
+                    {
+                      uuid: {
+                        label: 'label.id'
+                      },
+                      accountname: {
+                        label: 'label.account'
+                      },
+                      tag: {
+                        label: 'Tag',
+                        isEditable: true
+                      },
+                      physicalnetwork: {
+                        label: 'Physical Network'
+                      },
+                      networkoffering: {
+                        label: 'Network Offering'
+                      },
+                      gateway: {
+                        label: 'Gateway',
+                        isEditable: true
+                      },
+                      netmask: {
+                        label: 'Netmask',
+                        isEditable: true
+                      },
+                      startip: {
+                        label: 'Start IP',
+                        isEditable: true
+                      },
+                      endip: {
+                        label: 'End IP',
+                        isEditable: true
+                      },
+                      svip: {
+                        label: 'SVIP',
+                        isEditable: true
+                      }
+                    }
+                  ],
+                  dataProvider: function(args) {
+                    $.ajax({
+                      url: createURL("listSolidFireVirtualNetworks&id=" + args.context.sfVirtualNetwork[0].id),
+                      dataType: "json",
+                      async: true,
+                      success: function(json) {
+                        var jsonObj = json.listsolidfirevirtualnetworksresponse.sfvirtualnetwork[0];
+
+                        args.response.success({
+                          data: jsonObj
+                        });
+                      }
+                    });
+                  }
                 }
               }
             }


[50/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Add " (in GB)" to the text of two fields

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

Branch: refs/heads/sf-plugins
Commit: bcf1c72c8d6bb3fface082d5e61b0c3463d015d6
Parents: f78f03c
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Thu Jul 23 17:22:32 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:45 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfAdministration/sfAdministration.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bcf1c72c/ui/plugins/sfAdministration/sfAdministration.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfAdministration/sfAdministration.js b/ui/plugins/sfAdministration/sfAdministration.js
index 68a3197..a5945a0 100644
--- a/ui/plugins/sfAdministration/sfAdministration.js
+++ b/ui/plugins/sfAdministration/sfAdministration.js
@@ -115,7 +115,7 @@
                       }
                     },
                     totalCapacity: {
-                      label: 'Total Capacity',
+                      label: 'Total Capacity (in GB)',
                       validation: {
                         required: true,
                         number: true
@@ -260,7 +260,7 @@
                         label: 'Username'
                       },
                       totalcapacity: {
-                        label: 'Total Capacity',
+                        label: 'Total Capacity (in GB)',
                         isEditable: true
                       },
                       totalminiops: {


[28/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Support filtering volumes by name (in a case-insensitive fashion)


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

Branch: refs/heads/sf-plugins
Commit: 32e0e2bd36659c0cf0224c69d1673a01994864de
Parents: 2ef0de9
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Fri Jul 10 13:49:02 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:42 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfSharedVolume/sfSharedVolume.js | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/32e0e2bd/ui/plugins/sfSharedVolume/sfSharedVolume.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/sfSharedVolume.js b/ui/plugins/sfSharedVolume/sfSharedVolume.js
index f2182f6..6d4c791 100644
--- a/ui/plugins/sfSharedVolume/sfSharedVolume.js
+++ b/ui/plugins/sfSharedVolume/sfSharedVolume.js
@@ -19,9 +19,24 @@
         dataProvider: function(args) {
           plugin.ui.apiCall('listSolidFireVolumes', {
             success: function(json) {
+              var sfvolumesfiltered = [];
               var sfvolumes = json.listsolidfirevolumesresponse.sfvolume;
+              var search = args.filterBy.search.value == null ? "" : args.filterBy.search.value.toLowerCase();
 
-              args.response.success({ data: sfvolumes });
+              if (search == "") {
+                sfvolumesfiltered = sfvolumes;
+              }
+              else {
+                for (i = 0; i < sfvolumes.length; i++) {
+                  sfvolume = sfvolumes[i];
+
+                  if (sfvolume.name.toLowerCase().indexOf(search) > -1 ) {
+                    sfvolumesfiltered.push(sfvolume);
+                  }
+                }
+              }
+
+              args.response.success({ data: sfvolumesfiltered });
             },
             error: function(errorMessage) {
               args.response.error(errorMessage);


[27/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Improvements to delete-volume logic


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

Branch: refs/heads/sf-plugins
Commit: 26bfa4f06da37fe87e1c28556aa9eef3866c2ea4
Parents: 84a6642
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Thu Jul 9 17:31:46 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:42 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfSharedVolume/sfSharedVolume.js | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26bfa4f0/ui/plugins/sfSharedVolume/sfSharedVolume.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/sfSharedVolume.js b/ui/plugins/sfSharedVolume/sfSharedVolume.js
index c37d9c3..b43b221 100644
--- a/ui/plugins/sfSharedVolume/sfSharedVolume.js
+++ b/ui/plugins/sfSharedVolume/sfSharedVolume.js
@@ -157,8 +157,8 @@
                   },
                   dependsOn: ['availabilityZone', 'account'],
                   select: function(args) {
-                    if (args.data.availabilityZone === null || args.data.availabilityZone === "" ||
-                        args.data.account === null || args.data.account === "") {
+                    if (args.data.availabilityZone == null || args.data.availabilityZone == "" ||
+                        args.data.account == null || args.data.account == "") {
                       return;
                     }
 
@@ -214,31 +214,22 @@
         },
         detailView: {
           name: 'label.volume.details',
-          viewAll: {
-            path: 'storage.snapshots',
-            label: 'label.snapshots'
-          },
           actions: {
-            deleteVolume: {
+            remove: {
               label: 'Delete Shared Volume',
               messages: {
                 confirm: function(args) {
                   return 'Are you sure you would like to delete this shared volume?';
                 },
                 notification: function(args) {
-                  return 'Shared volume deleted';
+                  return 'Delete Shared Volume';
                 }
               },
               action: function(args) {
                 $.ajax({
-                  url: createURL('deleteSolidFireVolume'),
-                  data: data,
+                  url: createURL('deleteSolidFireVolume&id=' + args.context.sfSharedVolumes[0].id),
                   success: function(json) {
-                    var sfvolumeObj = json.deletesolidfirevolumeresponse.apideletesolidfirevolume;
-
-                    args.response.success({
-                      data: sfvolumeObj
-                    });
+                    args.response.success();
                   },
                   error: function(json) {
                     args.response.error(parseXMLHttpResponse(json));


[38/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Updates to config and table names

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

Branch: refs/heads/sf-plugins
Commit: 373f74807d3a63edc7537307e29f30805591a212
Parents: 237284a
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Wed Jul 15 19:17:41 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:43 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfAdministration/config.js           | 2 +-
 ui/plugins/sfAdministration/sfAdministration.js | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/373f7480/ui/plugins/sfAdministration/config.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfAdministration/config.js b/ui/plugins/sfAdministration/config.js
index 7e8bb61..376ae56 100644
--- a/ui/plugins/sfAdministration/config.js
+++ b/ui/plugins/sfAdministration/config.js
@@ -1,5 +1,5 @@
 (function (cloudStack) {
-  cloudStack.plugins.sfSharedVolume.config = {
+  cloudStack.plugins.sfAdministration.config = {
     title: 'SolidFire Administration',
     desc: 'SolidFire Administration',
     externalLink: 'http://www.solidfire.com/',

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/373f7480/ui/plugins/sfAdministration/sfAdministration.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfAdministration/sfAdministration.js b/ui/plugins/sfAdministration/sfAdministration.js
index c836576..ddc0e33 100644
--- a/ui/plugins/sfAdministration/sfAdministration.js
+++ b/ui/plugins/sfAdministration/sfAdministration.js
@@ -10,9 +10,9 @@
         id: 'sfAdministration',
         fields: {
           name: { label: 'label.name' },
-          iqn: { label: 'MVIP' },
-          size: { label: 'Username' },
-          miniops: { label: 'label.zone' }
+          mvip: { label: 'MVIP' },
+          username: { label: 'Username' },
+          zonename: { label: 'label.zone' }
         },
         dataProvider: function(args) {
           plugin.ui.apiCall('listSolidFireClusters', {


[32/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Correcting a rebase issue concerning the ApiHelper class and its use


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

Branch: refs/heads/sf-plugins
Commit: dce9f7c8f08862e53dbacc108fea5f6e281cd429
Parents: 7871e77
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Tue Jul 14 18:36:56 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:43 2015 -0600

----------------------------------------------------------------------
 .../solidfire/spring-solidfire-context.xml         |  1 +
 .../CreateReferenceToSolidFireClusterCmd.java      |  3 ++-
 .../CreateSolidFireVirtualNetworkCmd.java          |  3 ++-
 .../DeleteReferenceToSolidFireClusterCmd.java      |  3 ++-
 .../DeleteSolidFireVirtualNetworkCmd.java          |  3 ++-
 .../admin/solidfire/ListSolidFireClustersCmd.java  |  3 ++-
 .../UpdateReferenceToSolidFireClusterCmd.java      |  3 ++-
 .../UpdateSolidFireVirtualNetworkCmd.java          |  3 ++-
 .../user/solidfire/CreateSolidFireVolumeCmd.java   |  5 +++--
 .../user/solidfire/DeleteSolidFireVolumeCmd.java   |  5 +++--
 .../solidfire/ListSolidFireVirtualNetworksCmd.java |  4 ++--
 .../user/solidfire/ListSolidFireVolumesCmd.java    |  5 +++--
 .../user/solidfire/UpdateSolidFireVolumeCmd.java   |  5 +++--
 .../apache/cloudstack/api/helper/ApiHelper.java    |  6 ------
 .../solidfire/ApiSolidFireServiceImpl2.java        | 17 +++++++++--------
 15 files changed, 38 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dce9f7c8/plugins/api/solidfire/resources/META-INF/cloudstack/solidfire/spring-solidfire-context.xml
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/resources/META-INF/cloudstack/solidfire/spring-solidfire-context.xml b/plugins/api/solidfire/resources/META-INF/cloudstack/solidfire/spring-solidfire-context.xml
index 334393d..d056571 100644
--- a/plugins/api/solidfire/resources/META-INF/cloudstack/solidfire/spring-solidfire-context.xml
+++ b/plugins/api/solidfire/resources/META-INF/cloudstack/solidfire/spring-solidfire-context.xml
@@ -27,6 +27,7 @@
                       http://www.springframework.org/schema/context/spring-context-3.0.xsd"
                       >
 
+      <bean id="apiHelper" class="org.apache.cloudstack.api.helper.ApiHelper" />
       <bean id="apiSolidFireServiceImpl2" class="org.apache.cloudstack.solidfire.ApiSolidFireServiceImpl2"/>
       <bean id="sfClusterDao" class="org.apache.cloudstack.solidfire.dataaccess.dao.SfClusterDaoImpl" />
       <bean id="sfVolumeDao" class="org.apache.cloudstack.solidfire.dataaccess.dao.SfVolumeDaoImpl" />

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dce9f7c8/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/CreateReferenceToSolidFireClusterCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/CreateReferenceToSolidFireClusterCmd.java b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/CreateReferenceToSolidFireClusterCmd.java
index ecc2b9d..65b82dd 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/CreateReferenceToSolidFireClusterCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/CreateReferenceToSolidFireClusterCmd.java
@@ -64,6 +64,7 @@ public class CreateReferenceToSolidFireClusterCmd extends BaseCmd {
     @Parameter(name = ApiConstants.ZONE_ID, type = CommandType.UUID, entityType = ZoneResponse.class, description = ApiHelper.ZONE_ID_DESC, required = true)
     private long _zoneId;
 
+    @Inject private ApiHelper _apiHelper;
     @Inject private ApiSolidFireService2 _apiSolidFireService2;
 
     /////////////////////////////////////////////////////
@@ -88,7 +89,7 @@ public class CreateReferenceToSolidFireClusterCmd extends BaseCmd {
             SfCluster sfCluster = _apiSolidFireService2.createReferenceToSolidFireCluster(_mvip, _username, _password, _totalCapacity,
                     _totalMinIops, _totalMaxIops, _totalBurstIops, _zoneId);
 
-            ApiSolidFireClusterResponse response = ApiHelper.instance().getApiSolidFireClusterResponse(sfCluster);
+            ApiSolidFireClusterResponse response = _apiHelper.getApiSolidFireClusterResponse(sfCluster);
 
             response.setResponseName(getCommandName());
             response.setObjectName("apicreatereferencetosolidfirecluster");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dce9f7c8/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/CreateSolidFireVirtualNetworkCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/CreateSolidFireVirtualNetworkCmd.java b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/CreateSolidFireVirtualNetworkCmd.java
index c91d4d3..3d428ea 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/CreateSolidFireVirtualNetworkCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/CreateSolidFireVirtualNetworkCmd.java
@@ -63,6 +63,7 @@ public class CreateSolidFireVirtualNetworkCmd extends BaseCmd {
     @Parameter(name = ApiConstants.ACCOUNT_ID, type = CommandType.UUID, entityType = AccountResponse.class, description = ApiHelper.ACCOUNT_ID_DESC, required = true)
     private long _accountId;
 
+    @Inject private ApiHelper _apiHelper;
     @Inject private ApiSolidFireService2 _apiSolidFireService2;
 
     /////////////////////////////////////////////////////
@@ -86,7 +87,7 @@ public class CreateSolidFireVirtualNetworkCmd extends BaseCmd {
 
             SfVirtualNetwork sfVirtualNetwork = _apiSolidFireService2.createSolidFireVirtualNetwork(_clusterName, _name, _tag, _startIp, _size, _netmask, _svip, _accountId);
 
-            ApiSolidFireVirtualNetworkResponse response = ApiHelper.instance().getApiSolidFireVirtualNetworkResponse(sfVirtualNetwork, ResponseView.Full);
+            ApiSolidFireVirtualNetworkResponse response = _apiHelper.getApiSolidFireVirtualNetworkResponse(sfVirtualNetwork, ResponseView.Full);
 
             response.setResponseName(getCommandName());
             response.setObjectName("apicreatesolidfirevirtualnetwork");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dce9f7c8/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/DeleteReferenceToSolidFireClusterCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/DeleteReferenceToSolidFireClusterCmd.java b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/DeleteReferenceToSolidFireClusterCmd.java
index 058df8d..77673fd 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/DeleteReferenceToSolidFireClusterCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/DeleteReferenceToSolidFireClusterCmd.java
@@ -41,6 +41,7 @@ public class DeleteReferenceToSolidFireClusterCmd extends BaseCmd {
     @Parameter(name = ApiHelper.NAME, type = CommandType.STRING, description = ApiHelper.SOLIDFIRE_CLUSTER_NAME_DESC, required = true)
     private String _name;
 
+    @Inject private ApiHelper _apiHelper;
     @Inject private ApiSolidFireService2 _apiSolidFireService2;
 
     /////////////////////////////////////////////////////
@@ -64,7 +65,7 @@ public class DeleteReferenceToSolidFireClusterCmd extends BaseCmd {
 
             SfCluster sfCluster = _apiSolidFireService2.deleteReferenceToSolidFireCluster(_name);
 
-            ApiSolidFireClusterResponse response = ApiHelper.instance().getApiSolidFireClusterResponse(sfCluster);
+            ApiSolidFireClusterResponse response = _apiHelper.getApiSolidFireClusterResponse(sfCluster);
 
             response.setResponseName(getCommandName());
             response.setObjectName("apideletereferencetosolidfirecluster");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dce9f7c8/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/DeleteSolidFireVirtualNetworkCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/DeleteSolidFireVirtualNetworkCmd.java b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/DeleteSolidFireVirtualNetworkCmd.java
index 8ea4a67..b21e6c6 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/DeleteSolidFireVirtualNetworkCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/DeleteSolidFireVirtualNetworkCmd.java
@@ -43,6 +43,7 @@ public class DeleteSolidFireVirtualNetworkCmd extends BaseCmd {
     @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = ApiSolidFireVirtualNetworkResponse.class, description = ApiHelper.VIRTUAL_NETWORK_ID_DESC, required = true)
     private long _id;
 
+    @Inject private ApiHelper _apiHelper;
     @Inject private ApiSolidFireService2 _apiSolidFireService2;
 
     /////////////////////////////////////////////////////
@@ -72,7 +73,7 @@ public class DeleteSolidFireVirtualNetworkCmd extends BaseCmd {
 
             SfVirtualNetwork sfVirtualNetwork = _apiSolidFireService2.deleteSolidFireVirtualNetwork(_id);
 
-            ApiSolidFireVirtualNetworkResponse response = ApiHelper.instance().getApiSolidFireVirtualNetworkResponse(sfVirtualNetwork, ResponseView.Full);
+            ApiSolidFireVirtualNetworkResponse response = _apiHelper.getApiSolidFireVirtualNetworkResponse(sfVirtualNetwork, ResponseView.Full);
 
             response.setResponseName(getCommandName());
             response.setObjectName("apideletesolidfirevirtualnetwork");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dce9f7c8/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/ListSolidFireClustersCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/ListSolidFireClustersCmd.java b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/ListSolidFireClustersCmd.java
index 3cdf73f..dea0a8e 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/ListSolidFireClustersCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/ListSolidFireClustersCmd.java
@@ -43,6 +43,7 @@ public class ListSolidFireClustersCmd extends BaseListCmd {
     @Parameter(name = ApiHelper.NAME, type = CommandType.STRING, description = ApiHelper.SOLIDFIRE_CLUSTER_NAME_DESC)
     private String _name;
 
+    @Inject private ApiHelper _apiHelper;
     @Inject private ApiSolidFireService2 _apiSolidFireService2;
 
     /////////////////////////////////////////////////////
@@ -74,7 +75,7 @@ public class ListSolidFireClustersCmd extends BaseListCmd {
                 sfClusters = _apiSolidFireService2.listSolidFireClusters();
             }
 
-            List<ApiSolidFireClusterResponse> responses = ApiHelper.instance().getApiSolidFireClusterResponse(sfClusters);
+            List<ApiSolidFireClusterResponse> responses = _apiHelper.getApiSolidFireClusterResponse(sfClusters);
 
             ListResponse<ApiSolidFireClusterResponse> listReponse = new ListResponse<>();
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dce9f7c8/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/UpdateReferenceToSolidFireClusterCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/UpdateReferenceToSolidFireClusterCmd.java b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/UpdateReferenceToSolidFireClusterCmd.java
index 2423f3b..0411205 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/UpdateReferenceToSolidFireClusterCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/UpdateReferenceToSolidFireClusterCmd.java
@@ -53,6 +53,7 @@ public class UpdateReferenceToSolidFireClusterCmd extends BaseCmd {
     @Parameter(name = ApiHelper.TOTAL_BURST_IOPS, type = CommandType.LONG, description = ApiHelper.TOTAL_BURST_IOPS_DESC, required = true)
     private long _totalBurstIops;
 
+    @Inject private ApiHelper _apiHelper;
     @Inject private ApiSolidFireService2 _apiSolidFireService2;
 
     /////////////////////////////////////////////////////
@@ -77,7 +78,7 @@ public class UpdateReferenceToSolidFireClusterCmd extends BaseCmd {
             SfCluster sfCluster = _apiSolidFireService2.updateReferenceToSolidFireCluster(_name, _totalCapacity,
                     _totalMinIops, _totalMaxIops, _totalBurstIops);
 
-            ApiSolidFireClusterResponse response = ApiHelper.instance().getApiSolidFireClusterResponse(sfCluster);
+            ApiSolidFireClusterResponse response = _apiHelper.getApiSolidFireClusterResponse(sfCluster);
 
             response.setResponseName(getCommandName());
             response.setObjectName("apiupdatereferencetosolidfirecluster");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dce9f7c8/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/UpdateSolidFireVirtualNetworkCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/UpdateSolidFireVirtualNetworkCmd.java b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/UpdateSolidFireVirtualNetworkCmd.java
index e52e056..210b640 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/UpdateSolidFireVirtualNetworkCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/admin/solidfire/UpdateSolidFireVirtualNetworkCmd.java
@@ -62,6 +62,7 @@ public class UpdateSolidFireVirtualNetworkCmd extends BaseCmd {
     @Parameter(name = ApiHelper.SVIP, type = CommandType.STRING, description = ApiHelper.SOLIDFIRE_SVIP_DESC, required = true)
     private String _svip;
 
+    @Inject private ApiHelper _apiHelper;
     @Inject private ApiSolidFireService2 _apiSolidFireService2;
 
     /////////////////////////////////////////////////////
@@ -91,7 +92,7 @@ public class UpdateSolidFireVirtualNetworkCmd extends BaseCmd {
 
             SfVirtualNetwork sfVirtualNetwork = _apiSolidFireService2.updateSolidFireVirtualNetwork(_id, _name, _tag, _startIp, _size, _netmask, _svip);
 
-            ApiSolidFireVirtualNetworkResponse response = ApiHelper.instance().getApiSolidFireVirtualNetworkResponse(sfVirtualNetwork, ResponseView.Full);
+            ApiSolidFireVirtualNetworkResponse response = _apiHelper.getApiSolidFireVirtualNetworkResponse(sfVirtualNetwork, ResponseView.Full);
 
             response.setResponseName(getCommandName());
             response.setObjectName("apiupdatesolidfirevirtualnetwork");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dce9f7c8/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/CreateSolidFireVolumeCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/CreateSolidFireVolumeCmd.java b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/CreateSolidFireVolumeCmd.java
index e189e12..1f68346 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/CreateSolidFireVolumeCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/CreateSolidFireVolumeCmd.java
@@ -62,6 +62,7 @@ public class CreateSolidFireVolumeCmd extends BaseCmd {
             description = ApiHelper.VIRTUAL_NETWORK_ID_DESC, required = true)
     private long _sfVirtualNetworkId;
 
+    @Inject private ApiHelper _apiHelper;
     @Inject private ApiSolidFireService2 _apiSolidFireService2;
 
     /////////////////////////////////////////////////////
@@ -85,9 +86,9 @@ public class CreateSolidFireVolumeCmd extends BaseCmd {
 
             SfVolume sfVolume = _apiSolidFireService2.createSolidFireVolume(_name, _size, _minIops, _maxIops, _burstIops, _accountId, _sfVirtualNetworkId);
 
-            ResponseView responseView = ApiHelper.instance().isRootAdmin() ? ResponseView.Full : ResponseView.Restricted;
+            ResponseView responseView = _apiHelper.isRootAdmin() ? ResponseView.Full : ResponseView.Restricted;
 
-            ApiSolidFireVolumeResponse response = ApiHelper.instance().getApiSolidFireVolumeResponse(sfVolume, responseView);
+            ApiSolidFireVolumeResponse response = _apiHelper.getApiSolidFireVolumeResponse(sfVolume, responseView);
 
             response.setResponseName(getCommandName());
             response.setObjectName("apicreatesolidfirevolume");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dce9f7c8/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/DeleteSolidFireVolumeCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/DeleteSolidFireVolumeCmd.java b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/DeleteSolidFireVolumeCmd.java
index a3f6bb9..772b75c 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/DeleteSolidFireVolumeCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/DeleteSolidFireVolumeCmd.java
@@ -44,6 +44,7 @@ public class DeleteSolidFireVolumeCmd extends BaseCmd {
     @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = ApiSolidFireVolumeResponse.class, description = ApiHelper.VOLUME_ID_DESC, required = true)
     private long _id;
 
+    @Inject private ApiHelper _apiHelper;
     @Inject private ApiSolidFireService2 _apiSolidFireService2;
 
     /////////////////////////////////////////////////////
@@ -77,9 +78,9 @@ public class DeleteSolidFireVolumeCmd extends BaseCmd {
 
             SfVolume sfVolume = _apiSolidFireService2.deleteSolidFireVolume(_id);
 
-            ResponseView responseView = ApiHelper.instance().isRootAdmin() ? ResponseView.Full : ResponseView.Restricted;
+            ResponseView responseView = _apiHelper.isRootAdmin() ? ResponseView.Full : ResponseView.Restricted;
 
-            ApiSolidFireVolumeResponse response = ApiHelper.instance().getApiSolidFireVolumeResponse(sfVolume, responseView);
+            ApiSolidFireVolumeResponse response = _apiHelper.getApiSolidFireVolumeResponse(sfVolume, responseView);
 
             response.setResponseName(getCommandName());
             response.setObjectName("apideletesolidfirevolume");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dce9f7c8/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java
index 2ec91a1..358dfe6 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java
@@ -86,9 +86,9 @@ public class ListSolidFireVirtualNetworksCmd extends BaseListCmd {
                 sfVirtualNetworks = _apiSolidFireService2.listSolidFireVirtualNetworks(_zoneId, _accountId);
             }
 
-            ResponseView responseView = ApiHelper.instance().isRootAdmin() ? ResponseView.Full : ResponseView.Restricted;
+            ResponseView responseView = _apiHelper.isRootAdmin() ? ResponseView.Full : ResponseView.Restricted;
 
-            List<ApiSolidFireVirtualNetworkResponse> responses = ApiHelper.instance().getApiSolidFireVirtualNetworkResponse(sfVirtualNetworks, responseView);
+            List<ApiSolidFireVirtualNetworkResponse> responses = _apiHelper.getApiSolidFireVirtualNetworkResponse(sfVirtualNetworks, responseView);
 
             ListResponse<ApiSolidFireVirtualNetworkResponse> listReponse = new ListResponse<>();
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dce9f7c8/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVolumesCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVolumesCmd.java b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVolumesCmd.java
index 2e8c56e..3890f11 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVolumesCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVolumesCmd.java
@@ -45,6 +45,7 @@ public class ListSolidFireVolumesCmd extends BaseListCmd {
     @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = ApiSolidFireVolumeResponse.class, description = ApiHelper.VOLUME_ID_DESC)
     private Long _id;
 
+    @Inject private ApiHelper _apiHelper;
     @Inject private ApiSolidFireService2 _apiSolidFireService2;
 
     /////////////////////////////////////////////////////
@@ -76,9 +77,9 @@ public class ListSolidFireVolumesCmd extends BaseListCmd {
                 sfVolumes = _apiSolidFireService2.listSolidFireVolumes();
             }
 
-            ResponseView responseView = ApiHelper.instance().isRootAdmin() ? ResponseView.Full : ResponseView.Restricted;
+            ResponseView responseView = _apiHelper.isRootAdmin() ? ResponseView.Full : ResponseView.Restricted;
 
-            List<ApiSolidFireVolumeResponse> responses = ApiHelper.instance().getApiSolidFireVolumeResponse(sfVolumes, responseView);
+            List<ApiSolidFireVolumeResponse> responses = _apiHelper.getApiSolidFireVolumeResponse(sfVolumes, responseView);
 
             ListResponse<ApiSolidFireVolumeResponse> listReponse = new ListResponse<>();
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dce9f7c8/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/UpdateSolidFireVolumeCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/UpdateSolidFireVolumeCmd.java b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/UpdateSolidFireVolumeCmd.java
index 0e494d9..3b1e6b7 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/UpdateSolidFireVolumeCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/UpdateSolidFireVolumeCmd.java
@@ -56,6 +56,7 @@ public class UpdateSolidFireVolumeCmd extends BaseCmd {
     @Parameter(name = ApiHelper.BURST_IOPS, type = CommandType.LONG, description = ApiHelper.BURST_IOPS_DESC, required = true)
     private long _burstIops;
 
+    @Inject private ApiHelper _apiHelper;
     @Inject private ApiSolidFireService2 _apiSolidFireService2;
 
     /////////////////////////////////////////////////////
@@ -88,9 +89,9 @@ public class UpdateSolidFireVolumeCmd extends BaseCmd {
 
             SfVolume sfVolume = _apiSolidFireService2.updateSolidFireVolume(_id, _size, _minIops, _maxIops, _burstIops);
 
-            ResponseView responseView = ApiHelper.instance().isRootAdmin() ? ResponseView.Full : ResponseView.Restricted;
+            ResponseView responseView = _apiHelper.isRootAdmin() ? ResponseView.Full : ResponseView.Restricted;
 
-            ApiSolidFireVolumeResponse response = ApiHelper.instance().getApiSolidFireVolumeResponse(sfVolume, responseView);
+            ApiSolidFireVolumeResponse response = _apiHelper.getApiSolidFireVolumeResponse(sfVolume, responseView);
 
             response.setResponseName(getCommandName());
             response.setObjectName("apiupdatesolidfirevolume");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dce9f7c8/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 89c48eb..b042499 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
@@ -27,8 +27,6 @@ import com.cloud.user.dao.AccountDao;
 import com.cloud.utils.exception.CloudRuntimeException;
 
 public class ApiHelper {
-    private static ApiHelper s_apiHelperInstance = new ApiHelper();
-
     public static final String MVIP = "mvip";
     public static final String SVIP = "svip";
     public static final String CLUSTER_NAME = "clustername";
@@ -80,10 +78,6 @@ public class ApiHelper {
     private ApiHelper() {
     }
 
-    public static ApiHelper instance() {
-        return s_apiHelperInstance;
-    }
-
     public ApiSolidFireClusterResponse getApiSolidFireClusterResponse(SfCluster sfCluster) {
         ApiSolidFireClusterResponse sfResponse = new ApiSolidFireClusterResponse();
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dce9f7c8/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
index 7c585a8..58ebc4b 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
@@ -109,6 +109,7 @@ public class ApiSolidFireServiceImpl2 extends AdapterBase implements APIChecker,
     @Inject private AccountDao _accountDao;
     @Inject private AccountDetailsDao _accountDetailsDao;
     @Inject private AccountManager _accountMgr;
+    @Inject private ApiHelper _apiHelper;
     @Inject private DataCenterDao _zoneDao;
     @Inject private SfClusterDao _sfClusterDao;
     @Inject private SfVirtualNetworkDao _sfVirtualNetworkDao;
@@ -259,7 +260,7 @@ public class ApiSolidFireServiceImpl2 extends AdapterBase implements APIChecker,
 
         final List<SfVirtualNetworkVO> sfVirtualNetworkVOs;
 
-        if (ApiHelper.instance().isRootAdmin()) {
+        if (_apiHelper.isRootAdmin()) {
             if (zoneId != null) {
                 if (accountId != null) {
                     sfVirtualNetworkVOs = filterVirtualNetworksByZone(_sfVirtualNetworkDao.findByAccountId(accountId), zoneId);
@@ -283,10 +284,10 @@ public class ApiSolidFireServiceImpl2 extends AdapterBase implements APIChecker,
             }
 
             if (zoneId != null) {
-                sfVirtualNetworkVOs = filterVirtualNetworksByZone(_sfVirtualNetworkDao.findByAccountId(ApiHelper.instance().getCallingAccount().getId()), zoneId);
+                sfVirtualNetworkVOs = filterVirtualNetworksByZone(_sfVirtualNetworkDao.findByAccountId(_apiHelper.getCallingAccount().getId()), zoneId);
             }
             else {
-                sfVirtualNetworkVOs = _sfVirtualNetworkDao.findByAccountId(ApiHelper.instance().getCallingAccount().getId());
+                sfVirtualNetworkVOs = _sfVirtualNetworkDao.findByAccountId(_apiHelper.getCallingAccount().getId());
             }
         }
 
@@ -396,13 +397,13 @@ public class ApiSolidFireServiceImpl2 extends AdapterBase implements APIChecker,
 
         final List<SfVolumeVO> sfVolumeVOs;
 
-        if (ApiHelper.instance().isRootAdmin()) {
+        if (_apiHelper.isRootAdmin()) {
             sfVolumeVOs = _sfVolumeDao.listAll();
         }
         else {
             sfVolumeVOs = new ArrayList<>();
 
-            List<SfVirtualNetworkVO> sfVirtualNetworkVOs = _sfVirtualNetworkDao.findByAccountId(ApiHelper.instance().getCallingAccount().getId());
+            List<SfVirtualNetworkVO> sfVirtualNetworkVOs = _sfVirtualNetworkDao.findByAccountId(_apiHelper.getCallingAccount().getId());
 
             if (sfVirtualNetworkVOs != null) {
                 for (SfVirtualNetwork sfVirtualNetwork : sfVirtualNetworkVOs) {
@@ -569,15 +570,15 @@ public class ApiSolidFireServiceImpl2 extends AdapterBase implements APIChecker,
     }
 
     private void verifyRootAdmin() {
-        if (!ApiHelper.instance().isRootAdmin()) {
+        if (!_apiHelper.isRootAdmin()) {
             throw new PermissionDeniedException("Only a root admin can perform this operation.");
         }
     }
 
     private void verifyPermissionsForAccount(long accountId) {
-        Account account = ApiHelper.instance().getCallingAccount();
+        Account account = _apiHelper.getCallingAccount();
 
-        if (ApiHelper.instance().isRootAdmin(account.getId())) {
+        if (_apiHelper.isRootAdmin(account.getId())) {
             return; // permissions OK
         }
 


[37/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Placed the Zone field at the top of the "create" window and "view" panel

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

Branch: refs/heads/sf-plugins
Commit: e02a9b2e453566ca5f8e9b71968d067b2abb1c70
Parents: 1db663b
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Wed Jul 15 21:53:43 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:43 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfAdministration/sfAdministration.js | 54 ++++++++++----------
 1 file changed, 27 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e02a9b2e/ui/plugins/sfAdministration/sfAdministration.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfAdministration/sfAdministration.js b/ui/plugins/sfAdministration/sfAdministration.js
index 4c843ee..e16f0f5 100644
--- a/ui/plugins/sfAdministration/sfAdministration.js
+++ b/ui/plugins/sfAdministration/sfAdministration.js
@@ -59,6 +59,28 @@
               title: 'Add Reference to Cluster',
               desc: 'Please fill in the following data to add a new reference to a cluster.',
               fields: {
+                availabilityZone: {
+                  label: 'label.availability.zone',
+                  docID: 'helpVolumeAvailabilityZone',
+                  validation: {
+                    required: true
+                  },
+                  select: function(args) {
+                    $.ajax({
+                      url: createURL("listZones&available=true"),
+                      dataType: "json",
+                      async: true,
+                      success: function(json) {
+                        var zoneObjs = json.listzonesresponse.zone;
+
+                        args.response.success({
+                          descriptionField: 'name',
+                          data: zoneObjs
+                        });
+                      }
+                    });
+                  }
+                },
                 mvip: {
                   label: 'MVIP',
                   validation: {
@@ -107,41 +129,19 @@
                     required: true,
                     number: true
                   }
-                },
-                availabilityZone: {
-                  label: 'label.availability.zone',
-                  docID: 'helpVolumeAvailabilityZone',
-                  validation: {
-                    required: true
-                  },
-                  select: function(args) {
-                    $.ajax({
-                      url: createURL("listZones&available=true"),
-                      dataType: "json",
-                      async: true,
-                      success: function(json) {
-                        var zoneObjs = json.listzonesresponse.zone;
-
-                        args.response.success({
-                          descriptionField: 'name',
-                          data: zoneObjs
-                        });
-                      }
-                    });
-                  }
                 }
               }
             },
             action: function(args) {
               var data = {
+               availabilityzone: args.data.availabilityzone,
                 mvip: args.data.mvip,
                 username: args.data.username,
                 password: args.data.password,
                 totalcapacity: args.data.totalcapacity,
                 totalminiops: args.data.totalminiops,
                 totalmaxiops: args.data.totalmaxiops,
-                totalburstiops: args.data.totalburstiops,
-                availabilityzone: args.data.availabilityzone
+                totalburstiops: args.data.totalburstiops
               };
 
               $.ajax({
@@ -234,6 +234,9 @@
                   uuid: {
                     label: 'label.id'
                   },
+                  zonename: {
+                    label: 'label.zone'
+                  },
                   mvip: {
                     label: 'MVIP'
                   },
@@ -255,9 +258,6 @@
                   totalburstiops: {
                     label: 'Total Burst IOPS',
                     isEditable: true
-                  },
-                  zonename: {
-                    label: 'label.zone'
                   }
                 }
               ],


[33/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Changed the title and the names of some properties

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

Branch: refs/heads/sf-plugins
Commit: 1f85a22a0d9df7bbd60f168c2331dd4aff39fb02
Parents: 373f748
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Wed Jul 15 19:41:13 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:43 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfAdministration/sfAdministration.js | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1f85a22a/ui/plugins/sfAdministration/sfAdministration.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfAdministration/sfAdministration.js b/ui/plugins/sfAdministration/sfAdministration.js
index ddc0e33..b44038f 100644
--- a/ui/plugins/sfAdministration/sfAdministration.js
+++ b/ui/plugins/sfAdministration/sfAdministration.js
@@ -2,7 +2,7 @@
   cloudStack.plugins.sfAdministration = function(plugin) {
     plugin.ui.addSection({
       id: 'sfAdministration',
-      title: 'sfAdministration',
+      title: 'SolidFire Administration',
       preFilter: function(args) {
         return isAdmin();
       },
@@ -244,26 +244,26 @@
                     label: 'Total Capacity',
                     isEditable: true
                   },
-                  miniops: {
+                  totalminiops: {
                     label: 'Total Min IOPS',
                     isEditable: true
                   },
-                  maxiops: {
+                  totalmaxiops: {
                     label: 'Total Max IOPS',
                     isEditable: true
                   },
-                  burstiops: {
+                  totalburstiops: {
                     label: 'Total Burst IOPS',
                     isEditable: true
                   },
-                  zone: {
-                    label: 'Zone'
+                  zonename: {
+                    label: 'label.zone'
                   }
                 }
               ],
               dataProvider: function(args) {
                 $.ajax({
-                  url: createURL("listSolidFireClusters&name=" + args.context.sfClusters[0].name),
+                  url: createURL("listSolidFireClusters&name=" + args.context.sfAdministration[0].name),
                   dataType: "json",
                   async: true,
                   success: function(json) {


[29/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Corrected a property reference when attempting to update a cluster

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

Branch: refs/heads/sf-plugins
Commit: 65cdab55ed4ae08c953247d7605fe76cb88e2e34
Parents: 1f85a22
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Wed Jul 15 19:58:14 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:43 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfAdministration/sfAdministration.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/65cdab55/ui/plugins/sfAdministration/sfAdministration.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfAdministration/sfAdministration.js b/ui/plugins/sfAdministration/sfAdministration.js
index b44038f..d2b568e 100644
--- a/ui/plugins/sfAdministration/sfAdministration.js
+++ b/ui/plugins/sfAdministration/sfAdministration.js
@@ -174,7 +174,7 @@
               action: function (args) {
                 var params = [];
 
-                params.push("&name=" + args.context.sfClusters[0].name);
+                params.push("&name=" + args.context.sfAdministration[0].name);
                 params.push("&totalcapacity=" + args.data.totalcapacity);
                 params.push("&totalminiops=" + args.data.totalminiops);
                 params.push("&totalmaxiops=" + args.data.totalmaxiops);


[46/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Adding in Virtual Networks panel


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

Branch: refs/heads/sf-plugins
Commit: 7f437bf54bf6284d2c498ff3a7a3b7604cd16a14
Parents: 0d46b10
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Sat Jul 18 23:33:57 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:44 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfAdministration/sfAdministration.js | 538 +++++++++++--------
 1 file changed, 300 insertions(+), 238 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7f437bf5/ui/plugins/sfAdministration/sfAdministration.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfAdministration/sfAdministration.js b/ui/plugins/sfAdministration/sfAdministration.js
index bdb467b..be1be98 100644
--- a/ui/plugins/sfAdministration/sfAdministration.js
+++ b/ui/plugins/sfAdministration/sfAdministration.js
@@ -3,278 +3,340 @@
     plugin.ui.addSection({
       id: 'sfAdministration',
       title: 'SolidFire Administration',
+      sectionSelect: {
+        label: 'label.select-view',
+        preFilter: function() {
+          return ['sfAdministration'];
+        }
+      },
       preFilter: function(args) {
         return isAdmin();
       },
-      listView: {
-        id: 'sfAdministration',
-        fields: {
-          name: { label: 'label.name' },
-          mvip: { label: 'MVIP' },
-          username: { label: 'Username' },
-          zonename: { label: 'label.zone' }
-        },
-        dataProvider: function(args) {
-          plugin.ui.apiCall('listSolidFireClusters', {
-            success: function(json) {
-              var sfclustersfiltered = [];
-              var sfclusters = json.listsolidfireclustersresponse.sfcluster;
-              var search = args.filterBy.search.value == null ? "" : args.filterBy.search.value.toLowerCase();
-
-              if (search == "") {
-                sfclustersfiltered = sfclusters;
-              }
-              else {
-                for (i = 0; i < sfclusters.length; i++) {
-                  sfcluster = sfclusters[i];
+      sections: {
+        sfAdministration: {
+          id: 'sfAdministration',
+          type: 'select',
+          title: 'SolidFire Clusters',
+          listView: {
+            section: 'sfAdministration',
+            id: 'sfAdministration',
+            fields: {
+              name: { label: 'label.name' },
+              mvip: { label: 'MVIP' },
+              username: { label: 'Username' },
+              zonename: { label: 'label.zone' }
+            },
+            dataProvider: function(args) {
+              plugin.ui.apiCall('listSolidFireClusters', {
+                success: function(json) {
+                  var sfclustersfiltered = [];
+                  var sfclusters = json.listsolidfireclustersresponse.sfcluster;
+                  var search = args.filterBy.search.value == null ? "" : args.filterBy.search.value.toLowerCase();
 
-                  if (sfcluster.name.toLowerCase().indexOf(search) > -1 ) {
-                    sfclustersfiltered.push(sfcluster);
+                  if (search == "") {
+                    sfclustersfiltered = sfclusters;
                   }
-                }
-              }
-
-              args.response.success({ data: sfclustersfiltered });
-            },
-            error: function(errorMessage) {
-              args.response.error(errorMessage);
-            }
-          });
-        },
-        actions: {
-          add: {
-            label: 'Add Reference to Cluster',
-            preFilter: function(args) {
-              return true;
-            },
-            messages: {
-              confirm: function(args) {
-                return 'Please fill in the following data to add a new reference to a cluster.';
-              },
-              notification: function(args) {
-                return 'Add Reference to Cluster';
-              }
-            },
-            createForm: {
-              title: 'Add Reference to Cluster',
-              desc: 'Please fill in the following data to add a new reference to a cluster.',
-              fields: {
-                availabilityZone: {
-                  label: 'label.availability.zone',
-                  docID: 'helpVolumeAvailabilityZone',
-                  validation: {
-                    required: true
-                  },
-                  select: function(args) {
-                    $.ajax({
-                      url: createURL("listZones&available=true"),
-                      dataType: "json",
-                      async: true,
-                      success: function(json) {
-                        var zoneObjs = json.listzonesresponse.zone;
+                  else {
+                    for (i = 0; i < sfclusters.length; i++) {
+                      sfcluster = sfclusters[i];
 
-                        args.response.success({
-                          descriptionField: 'name',
-                          data: zoneObjs
-                        });
+                      if (sfcluster.name.toLowerCase().indexOf(search) > -1 ) {
+                        sfclustersfiltered.push(sfcluster);
                       }
-                    });
-                  }
-                },
-                mvip: {
-                  label: 'MVIP',
-                  validation: {
-                    required: true
-                  }
-                },
-                username: {
-                  label: 'label.username',
-                  docID: 'helpUserUsername',
-                  validation: {
-                    required: true
-                  }
-                },
-                password: {
-                  label: 'label.password',
-                  docID: 'helpUserPassword',
-                  isPassword: true,
-                  validation: {
-                    required: true
+                    }
                   }
+
+                  args.response.success({ data: sfclustersfiltered });
                 },
-                totalCapacity: {
-                  label: 'Total Capacity',
-                  validation: {
-                    required: true,
-                    number: true
-                  }
+                error: function(errorMessage) {
+                  args.response.error(errorMessage);
+                }
+              });
+            },
+            actions: {
+              add: {
+                label: 'Add Reference to Cluster',
+                preFilter: function(args) {
+                  return true;
                 },
-                totalMinIops: {
-                  label: 'Total Min IOPS',
-                  validation: {
-                    required: true,
-                    number: true
+                messages: {
+                  confirm: function(args) {
+                    return 'Please fill in the following data to add a new reference to a cluster.';
+                  },
+                  notification: function(args) {
+                    return 'Add Reference to Cluster';
                   }
                 },
-                totalMaxIops: {
-                  label: 'Total Max IOPS',
-                  validation: {
-                    required: true,
-                    number: true
+                createForm: {
+                  title: 'Add Reference to Cluster',
+                  desc: 'Please fill in the following data to add a new reference to a cluster.',
+                  fields: {
+                    availabilityZone: {
+                      label: 'label.availability.zone',
+                      docID: 'helpVolumeAvailabilityZone',
+                      validation: {
+                        required: true
+                      },
+                      select: function(args) {
+                        $.ajax({
+                          url: createURL("listZones&available=true"),
+                          dataType: "json",
+                          async: true,
+                          success: function(json) {
+                            var zoneObjs = json.listzonesresponse.zone;
+
+                            args.response.success({
+                              descriptionField: 'name',
+                              data: zoneObjs
+                            });
+                          }
+                        });
+                      }
+                    },
+                    mvip: {
+                      label: 'MVIP',
+                      validation: {
+                        required: true
+                      }
+                    },
+                    username: {
+                      label: 'label.username',
+                      docID: 'helpUserUsername',
+                      validation: {
+                        required: true
+                      }
+                    },
+                    password: {
+                      label: 'label.password',
+                      docID: 'helpUserPassword',
+                      isPassword: true,
+                      validation: {
+                        required: true
+                      }
+                    },
+                    totalCapacity: {
+                      label: 'Total Capacity',
+                      validation: {
+                        required: true,
+                        number: true
+                      }
+                    },
+                    totalMinIops: {
+                      label: 'Total Min IOPS',
+                      validation: {
+                        required: true,
+                        number: true
+                      }
+                    },
+                    totalMaxIops: {
+                      label: 'Total Max IOPS',
+                      validation: {
+                        required: true,
+                        number: true
+                      }
+                    },
+                    totalBurstIops: {
+                      label: 'Total Burst IOPS',
+                      validation: {
+                        required: true,
+                        number: true
+                      }
+                    }
                   }
                 },
-                totalBurstIops: {
-                  label: 'Total Burst IOPS',
-                  validation: {
-                    required: true,
-                    number: true
-                  }
-                }
-              }
-            },
-            action: function(args) {
-              var data = {
-                zoneid: args.data.availabilityZone,
-                mvip: args.data.mvip,
-                username: args.data.username,
-                password: args.data.password,
-                totalcapacity: args.data.totalCapacity,
-                totalminiops: args.data.totalMinIops,
-                totalmaxiops: args.data.totalMaxIops,
-                totalburstiops: args.data.totalBurstIops
-              };
+                action: function(args) {
+                  var data = {
+                    zoneid: args.data.availabilityZone,
+                    mvip: args.data.mvip,
+                    username: args.data.username,
+                    password: args.data.password,
+                    totalcapacity: args.data.totalCapacity,
+                    totalminiops: args.data.totalMinIops,
+                    totalmaxiops: args.data.totalMaxIops,
+                    totalburstiops: args.data.totalBurstIops
+                  };
 
-              $.ajax({
-                url: createURL('createReferenceToSolidFireCluster'),
-                data: data,
-                success: function(json) {
-                  var sfclusterObj = json.createreferencetosolidfireclusterresponse.apicreatereferencetosolidfirecluster;
+                  $.ajax({
+                    url: createURL('createReferenceToSolidFireCluster'),
+                    data: data,
+                    success: function(json) {
+                      var sfclusterObj = json.createreferencetosolidfireclusterresponse.apicreatereferencetosolidfirecluster;
 
-                  args.response.success({
-                    data: sfclusterObj
+                      args.response.success({
+                        data: sfclusterObj
+                      });
+                    },
+                    error: function(json) {
+                      args.response.error(parseXMLHttpResponse(json));
+                    }
                   });
-                },
-                error: function(json) {
-                  args.response.error(parseXMLHttpResponse(json));
-                }
-              });
-            }
-          }
-        },
-        detailView: {
-          name: 'label.details',
-          actions: {
-            edit: {
-              label: 'label.edit',
-              messages: {
-                notification: function(args) {
-                  return 'Edit Cluster';
                 }
+              }
+            },
+            detailView: {
+              name: 'label.details',
+              viewAll: {
+                path: 'sfAdministration.sfVirtualNetworks',
+                label: 'Virtual Networks'
               },
-              action: function (args) {
-                var params = [];
+              actions: {
+                edit: {
+                  label: 'label.edit',
+                  messages: {
+                    notification: function(args) {
+                      return 'Edit Cluster';
+                    }
+                  },
+                  action: function (args) {
+                    var params = [];
 
-                params.push("&name=" + args.context.sfAdministration[0].name);
-                params.push("&totalcapacity=" + args.data.totalcapacity);
-                params.push("&totalminiops=" + args.data.totalminiops);
-                params.push("&totalmaxiops=" + args.data.totalmaxiops);
-                params.push("&totalburstiops=" + args.data.totalburstiops);
+                    params.push("&name=" + args.context.sfAdministration[0].name);
+                    params.push("&totalcapacity=" + args.data.totalcapacity);
+                    params.push("&totalminiops=" + args.data.totalminiops);
+                    params.push("&totalmaxiops=" + args.data.totalmaxiops);
+                    params.push("&totalburstiops=" + args.data.totalburstiops);
 
-                $.ajax({
-                  url: createURL('updateReferenceToSolidFireCluster' + params.join("")),
-                  success: function(json) {
-                    var sfclusterObj = json.updatereferencetosolidfireclusterresponse.apiupdatereferencetosolidfirecluster;
+                    $.ajax({
+                      url: createURL('updateReferenceToSolidFireCluster' + params.join("")),
+                      success: function(json) {
+                        var sfclusterObj = json.updatereferencetosolidfireclusterresponse.apiupdatereferencetosolidfirecluster;
 
-                    args.response.success({
-                      data: sfclusterObj
+                        args.response.success({
+                          data: sfclusterObj
+                        });
+                      },
+                      error: function(json) {
+                        args.response.error(parseXMLHttpResponse(json));
+                      }
                     });
-                  },
-                  error: function(json) {
-                    args.response.error(parseXMLHttpResponse(json));
                   }
-                });
-              }
-            },
-            remove: {
-              label: 'Delete Reference to Cluster',
-              messages: {
-                confirm: function(args) {
-                  return 'Are you sure you would like to delete this reference to a SolidFire cluster?';
                 },
-                notification: function(args) {
-                  return 'Delete Reference to Cluster';
+                remove: {
+                  label: 'Delete Reference to Cluster',
+                  messages: {
+                    confirm: function(args) {
+                      return 'Are you sure you would like to delete this reference to a SolidFire cluster?';
+                    },
+                    notification: function(args) {
+                      return 'Delete Reference to Cluster';
+                    }
+                  },
+                  action: function(args) {
+                    $.ajax({
+                      url: createURL('deleteReferenceToSolidFireCluster&name=' + args.context.sfAdministration[0].name),
+                      success: function(json) {
+                        args.response.success();
+                      },
+                      error: function(json) {
+                        args.response.error(parseXMLHttpResponse(json));
+                      }
+                    });
+                  }
                 }
               },
-              action: function(args) {
-                $.ajax({
-                  url: createURL('deleteReferenceToSolidFireCluster&name=' + args.context.sfAdministration[0].name),
-                  success: function(json) {
-                    args.response.success();
+              tabs: {
+                details: {
+                  title: 'label.details',
+                  preFilter: function(args) {
+                    return [];
                   },
-                  error: function(json) {
-                    args.response.error(parseXMLHttpResponse(json));
+                  fields: [
+                    {
+                      name: {
+                        label: 'label.name'
+                      }
+                    },
+                    {
+                      uuid: {
+                        label: 'label.id'
+                      },
+                      zonename: {
+                        label: 'label.zone'
+                      },
+                      mvip: {
+                        label: 'MVIP'
+                      },
+                      username: {
+                        label: 'Username'
+                      },
+                      totalcapacity: {
+                        label: 'Total Capacity',
+                        isEditable: true
+                      },
+                      totalminiops: {
+                        label: 'Total Min IOPS',
+                        isEditable: true
+                      },
+                      totalmaxiops: {
+                        label: 'Total Max IOPS',
+                        isEditable: true
+                      },
+                      totalburstiops: {
+                        label: 'Total Burst IOPS',
+                        isEditable: true
+                      }
+                    }
+                  ],
+                  dataProvider: function(args) {
+                    $.ajax({
+                      url: createURL("listSolidFireClusters&name=" + args.context.sfAdministration[0].name),
+                      dataType: "json",
+                      async: true,
+                      success: function(json) {
+                        var jsonObj = json.listsolidfireclustersresponse.sfcluster[0];
+
+                        args.response.success({
+                          data: jsonObj
+                        });
+                      }
+                    });
                   }
-                });
+                }
               }
             }
-          },
-          tabs: {
-            details: {
-              title: 'label.details',
-              preFilter: function(args) {
-                return [];
-              },
-              fields: [
-                {
-                  name: {
-                    label: 'label.name'
-                  }
-                },
-                {
-                  uuid: {
-                    label: 'label.id'
-                  },
-                  zonename: {
-                    label: 'label.zone'
-                  },
-                  mvip: {
-                    label: 'MVIP'
-                  },
-                  username: {
-                    label: 'Username'
-                  },
-                  totalcapacity: {
-                    label: 'Total Capacity',
-                    isEditable: true
-                  },
-                  totalminiops: {
-                    label: 'Total Min IOPS',
-                    isEditable: true
-                  },
-                  totalmaxiops: {
-                    label: 'Total Max IOPS',
-                    isEditable: true
-                  },
-                  totalburstiops: {
-                    label: 'Total Burst IOPS',
-                    isEditable: true
+          }
+        },
+        sfVirtualNetworks: {
+          id: 'sfVirtualNetworks',
+          type: 'select',
+          title: 'SolidFire Virtual Networks',
+          listView: {
+            section: 'sfVirtualNetworks',
+            id: 'sfVirtualNetworks',
+            fields: {
+              name: { label: 'label.name' },
+              tag: { label: 'Tag' },
+              svip: { label: 'SVIP' },
+              account: { label: 'label.account' }
+            },
+            dataProvider: function(args) {
+              var virtualnetworkid = args.context.virtualnetwork[0].id;
+
+              plugin.ui.apiCall('listSolidFireVirtualNetworks&' + virtualnetworkid, {
+                success: function(json) {
+                  var sfvirtualnetworksfiltered = [];
+                  var sfvirtualnetworks = json.listsolidfirevirtualnetworksresponse.sfvirtualnetwork;
+                  var search = args.filterBy.search.value == null ? "" : args.filterBy.search.value.toLowerCase();
+
+                  if (search == "") {
+                    sfvirtualnetworksfiltered = sfvirtualnetworks;
                   }
-                }
-              ],
-              dataProvider: function(args) {
-                $.ajax({
-                  url: createURL("listSolidFireClusters&name=" + args.context.sfAdministration[0].name),
-                  dataType: "json",
-                  async: true,
-                  success: function(json) {
-                    var jsonObj = json.listsolidfireclustersresponse.sfcluster[0];
+                  else {
+                    for (i = 0; i < sfvirtualnetworks.length; i++) {
+                      sfvirtualnetwork = sfvirtualnetworks[i];
 
-                    args.response.success({
-                      data: jsonObj
-                    });
+                      if (sfvirtualnetwork.name.toLowerCase().indexOf(search) > -1 ) {
+                        sfvirtualnetworksfiltered.push(sfvirtualnetwork);
+                      }
+                    }
                   }
-                });
-              }
+
+                  args.response.success({ data: sfvirtualnetworksfiltered });
+                },
+                error: function(errorMessage) {
+                  args.response.error(errorMessage);
+                }
+              });
             }
           }
         }


[45/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Adding the Add Virtual Network window

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

Branch: refs/heads/sf-plugins
Commit: 3ed58d8bb725c7990bfa11ce3001334ac6be4726
Parents: 017ed7d
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Tue Jul 21 12:50:50 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:44 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfAdministration/sfAdministration.js | 137 ++++++++++++++++++-
 1 file changed, 135 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3ed58d8b/ui/plugins/sfAdministration/sfAdministration.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfAdministration/sfAdministration.js b/ui/plugins/sfAdministration/sfAdministration.js
index 7afeeda..cbabf39 100644
--- a/ui/plugins/sfAdministration/sfAdministration.js
+++ b/ui/plugins/sfAdministration/sfAdministration.js
@@ -61,7 +61,7 @@
                 },
                 messages: {
                   confirm: function(args) {
-                    return 'Please fill in the following data to add a new reference to a cluster.';
+                    return 'Please fill in the following data to add a reference to a cluster.';
                   },
                   notification: function(args) {
                     return 'Add Reference to Cluster';
@@ -69,7 +69,7 @@
                 },
                 createForm: {
                   title: 'Add Reference to Cluster',
-                  desc: 'Please fill in the following data to add a new reference to a cluster.',
+                  desc: 'Please fill in the following data to add a reference to a cluster.',
                   fields: {
                     availabilityZone: {
                       label: 'label.availability.zone',
@@ -337,6 +337,139 @@
                   args.response.error(errorMessage);
                 }
               });
+            },
+            actions: {
+              add: {
+                label: 'Add Virtual Network',
+                preFilter: function(args) {
+                  return true;
+                },
+                messages: {
+                  confirm: function(args) {
+                    return 'Please fill in the following data to add a virtual network.';
+                  },
+                  notification: function(args) {
+                    return 'Add Virtual Network';
+                  }
+                },
+                createForm: {
+                  title: 'Add Virtual Network',
+                  desc: 'Please fill in the following data to add a virtual network.',
+                  fields: {
+                    account: {
+                      label: 'Account',
+                      validation: {
+                        required: true
+                      },
+                      select: function(args) {
+                        $.ajax({
+                          url: createURL("listAccounts&listAll=true"),
+                          dataType: "json",
+                          async: true,
+                          success: function(json) {
+                            var accountObjs = json.listaccountsresponse.account;
+
+                            args.response.success({
+                              descriptionField: 'name',
+                              data: accountObjs
+                            });
+                          }
+                        });
+                      }
+                    },
+                    name: {
+                      label: 'Name',
+                      validation: {
+                        required: true
+                      }
+                    },
+                    description: {
+                      label: 'Description',
+                      validation: {
+                        required: true
+                      }
+                    },
+                    tag: {
+                      label: 'Tag',
+                      validation: {
+                        required: true
+                      }
+                    },
+                    physicalnetwork: {
+                      label: 'Physical Network',
+                      validation: {
+                        required: true
+                      },
+                      select: function(args) {
+                        $.ajax({
+                          url: createURL("listAccounts&listAll=true"),
+                          dataType: "json",
+                          async: true,
+                          success: function(json) {
+                            var accountObjs = json.listaccountsresponse.account;
+
+                            args.response.success({
+                              descriptionField: 'name',
+                              data: accountObjs
+                            });
+                          }
+                        });
+                      }
+                    },
+                    networkoffering: {
+                      label: 'Network Offering',
+                      validation: {
+                        required: true
+                      },
+                      select: function(args) {
+                        $.ajax({
+                          url: createURL("listAccounts&listAll=true"),
+                          dataType: "json",
+                          async: true,
+                          success: function(json) {
+                            var accountObjs = json.listaccountsresponse.account;
+
+                            args.response.success({
+                              descriptionField: 'name',
+                              data: accountObjs
+                            });
+                          }
+                        });
+                      }
+                    },
+                    gateway: {
+                      label: 'Gateway',
+                      validation: {
+                        required: true
+                      }
+                    },
+                    netmask: {
+                      label: 'Netmask',
+                      validation: {
+                        required: true
+                      }
+                    },
+                    startip: {
+                      label: 'Start IP',
+                      validation: {
+                        required: true
+                      }
+                    },
+                    endip: {
+                      label: 'End IP',
+                      validation: {
+                        required: true
+                      }
+                    },
+                    svip: {
+                      label: 'SVIP',
+                      validation: {
+                        required: true
+                      }
+                    }
+                  }
+                }
+              }
             }
           }
         }


[13/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Extend plug-in functionality


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

Branch: refs/heads/sf-plugins
Commit: 7755061ed4d1f32e3e30479bf43dd3c1643347f5
Parents: 6d4ea19
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Mon Jul 6 20:22:36 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:41 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfSharedVolume/sfSharedVolume.js | 35 +++++++++++++++---------
 1 file changed, 22 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7755061e/ui/plugins/sfSharedVolume/sfSharedVolume.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/sfSharedVolume.js b/ui/plugins/sfSharedVolume/sfSharedVolume.js
index 70e5208..ff16c91 100644
--- a/ui/plugins/sfSharedVolume/sfSharedVolume.js
+++ b/ui/plugins/sfSharedVolume/sfSharedVolume.js
@@ -28,6 +28,28 @@
             }
           });
         },
+        actions: {
+          add: {
+            label: 'Add Shared Volume',
+            preFilter: function(args) {
+              return true;
+            },
+            messages: {
+              confirm: function(args) {
+                return 'Please fill in the following data to add a new shared volume.';
+              },
+              notification: function(args) {
+                return 'Add Shared Volume';
+              }
+            },
+            createForm: {
+              title: 'Add Shared Volume',
+              desc: 'Please fill in the following data to add a new shared volume.',
+              fields: {
+              }
+            }
+          }
+        },
         detailView: {
           name: 'Shared volume details',
           isMaximized: true,
@@ -41,19 +63,6 @@
             }
           }
         }
-      },
-      actions: {
-        add: {
-          label: 'Add Shared Volume',
-          preFilter: function(args) {
-            return true;
-          },
-          messages: {
-            notification: function(args) {
-              return 'Add Shared Volume';
-            }
-          }
-        }
       }
     });
   };


[17/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Add "action:" section


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

Branch: refs/heads/sf-plugins
Commit: c47fba4f699ed68bb2a4e9a870459a33ba042ff9
Parents: 81d58db
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Tue Jul 7 12:40:14 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:41 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfSharedVolume/sfSharedVolume.js | 25 +++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c47fba4f/ui/plugins/sfSharedVolume/sfSharedVolume.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/sfSharedVolume.js b/ui/plugins/sfSharedVolume/sfSharedVolume.js
index 99ad905..c0d9fbe 100644
--- a/ui/plugins/sfSharedVolume/sfSharedVolume.js
+++ b/ui/plugins/sfSharedVolume/sfSharedVolume.js
@@ -82,7 +82,30 @@
                   }
                 }
               }
-            }
+            },
+			action: function(args) {
+              $.ajax({
+                url: createURL('createVolume'),
+                data: data,
+                success: function(json) {
+                  var jid = json.createvolumeresponse.jobid;
+                  args.response.success({
+                    _custom: {
+                      jobId: jid,
+                      getUpdatedItem: function(json) {
+                        return json.queryasyncjobresultresponse.jobresult.volume;
+                      },
+                      getActionFilter: function() {
+                        return volumeActionfilter;
+                      }
+                    }
+                  });
+                },
+                error: function(json) {
+                  args.response.error(parseXMLHttpResponse(json));
+                }
+              });
+			}
           }
         },
         detailView: {


[25/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
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 <mi...@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
+                    });
+                  }
+                });
               }
             }
           }


[02/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Return the zone name


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

Branch: refs/heads/sf-plugins
Commit: a49408431b7c03f6a0a5bdb442b155079a87ed49
Parents: efb00e2
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Mon Jul 6 15:24:35 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:40 2015 -0600

----------------------------------------------------------------------
 .../src/org/apache/cloudstack/api/helper/ApiHelper.java |  4 ++++
 .../api/response/ApiSolidFireClusterResponse.java       | 12 ++++++++++++
 2 files changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4940843/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 1cdebfb..0e29e90 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
@@ -97,6 +97,10 @@ public class ApiHelper {
         sfResponse.setTotalBurstIops(sfCluster.getTotalBurstIops());
         sfResponse.setZoneId(sfCluster.getZoneId());
 
+        DataCenterVO dataCenterVO = _zoneDao.findById(sfCluster.getZoneId());
+
+        sfResponse.setZoneName(dataCenterVO.getName());
+
         sfResponse.setObjectName("sfcluster");
 
         return sfResponse;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4940843/plugins/api/solidfire/src/org/apache/cloudstack/api/response/ApiSolidFireClusterResponse.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/response/ApiSolidFireClusterResponse.java b/plugins/api/solidfire/src/org/apache/cloudstack/api/response/ApiSolidFireClusterResponse.java
index 08427fc..b959cc3 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/response/ApiSolidFireClusterResponse.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/response/ApiSolidFireClusterResponse.java
@@ -67,6 +67,10 @@ public class ApiSolidFireClusterResponse extends BaseResponse {
     @Param(description = "Zone ID that the SolidFire cluster is associated with")
     private long _zoneId;
 
+    @SerializedName("zonename")
+    @Param(description = "Zone name that the SolidFire cluster is associated with")
+    private String _zoneName;
+
     public void setId(long id) {
         _id = id;
     }
@@ -146,4 +150,12 @@ public class ApiSolidFireClusterResponse extends BaseResponse {
     public long getZoneId() {
         return _zoneId;
     }
+
+    public void setZoneName(String zoneName) {
+        _zoneName = zoneName;
+    }
+
+    public String getZoneName() {
+        return _zoneName;
+    }
 }


[16/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Add zone combo box to Add Shared Volume window


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

Branch: refs/heads/sf-plugins
Commit: f1d3156ffda300588e7324b53e2a787fbaf87ab8
Parents: c47fba4
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Tue Jul 7 13:07:58 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:41 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfSharedVolume/sfSharedVolume.js | 33 ++++++++++++++++++++----
 1 file changed, 28 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f1d3156f/ui/plugins/sfSharedVolume/sfSharedVolume.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/sfSharedVolume.js b/ui/plugins/sfSharedVolume/sfSharedVolume.js
index c0d9fbe..cce02db 100644
--- a/ui/plugins/sfSharedVolume/sfSharedVolume.js
+++ b/ui/plugins/sfSharedVolume/sfSharedVolume.js
@@ -46,15 +46,38 @@
               title: 'Add Shared Volume',
               desc: 'Please fill in the following data to add a new shared volume.',
               fields: {
+                availabilityZone: {
+                  label: 'label.availability.zone',
+                  docID: 'helpVolumeAvailabilityZone',
+                  validation: {
+                    required: true
+                  },
+                  select: function(args) {
+                    $.ajax({
+                      url: createURL("listZones&available=true"),
+                      dataType: "json",
+                      async: true,
+                      success: function(json) {
+                        var zoneObjs = json.listzonesresponse.zone;
+
+                        args.response.success({
+                          descriptionField: 'name',
+                          data: zoneObjs
+                        });
+                      }
+                    });
+                  }
+                },
                 name: {
+				  label: 'label.name',
                   docID: 'helpVolumeName',
-                  label: 'label.name',
                   validation: {
                     required: true
                   }
                 },
                 diskSize: {
-                  label: 'label.disk.size.gb',
+				  label: 'label.disk.size.gb',
+			      docID: 'Size of the volume in GB',
                   validation: {
                     required: true,
                     number: true
@@ -63,21 +86,21 @@
                 minIops: {
                   label: 'label.disk.iops.min',
                   validation: {
-                    required: false,
+                    required: true,
                     number: true
                   }
                 },
                 maxIops: {
                   label: 'label.disk.iops.max',
                   validation: {
-                    required: false,
+                    required: true,
                     number: true
                   }
                 },
                 burstIops: {
                   label: 'Burst IOPS',
                   validation: {
-                    required: false,
+                    required: true,
                     number: true
                   }
                 }


[48/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Pass in the ID of the virtual network


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

Branch: refs/heads/sf-plugins
Commit: 7cf8a8473962496d67a656f1d1b2531791276919
Parents: fde2067
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Tue Jul 21 19:00:11 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:44 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfAdministration/sfAdministration.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7cf8a847/ui/plugins/sfAdministration/sfAdministration.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfAdministration/sfAdministration.js b/ui/plugins/sfAdministration/sfAdministration.js
index ff6bae5..a18f81d 100644
--- a/ui/plugins/sfAdministration/sfAdministration.js
+++ b/ui/plugins/sfAdministration/sfAdministration.js
@@ -511,7 +511,8 @@
                   action: function (args) {
                     var params = [];
 
-                    params.push("&name=" + args.context.name);
+                    params.push("&id=" + args.context.sfVirtualNetworks[0].id);
+                    params.push("&name=" + args.data.name);
                     params.push("&tag=" + args.data.tag);
                     params.push("&startip=" + args.data.startip);
                     params.push("&size=" + "10"); // Mike T. args.data.size);


[06/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Get IQN from newly created volume, store in DB, and return from API call


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

Branch: refs/heads/sf-plugins
Commit: a3f470860feff370bc7faa0a621562ce5441d847
Parents: 0fc4b0c
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Mon Jul 6 18:06:58 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:40 2015 -0600

----------------------------------------------------------------------
 .../apache/cloudstack/api/helper/ApiHelper.java |   4 +-
 .../response/ApiSolidFireVolumeResponse.java    |  12 ++
 .../solidfire/ApiSolidFireServiceImpl2.java     |   4 +-
 .../solidfire/dataaccess/SfVolume.java          |   2 +
 .../solidfire/dataaccess/vo/SfVolumeVO.java     |  11 +-
 .../solidfire/util/SolidFireConnection.java     | 216 +++++++++++++++++--
 6 files changed, 233 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a3f47086/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 0e29e90..9a83404 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
@@ -54,6 +54,7 @@ public class ApiHelper {
     public static final String TOTAL_MIN_IOPS_DESC = "Total minimum IOPS";
     public static final String TOTAL_MAX_IOPS_DESC = "Total maximum IOPS";
     public static final String TOTAL_BURST_IOPS_DESC = "Total burst IOPS";
+    public static final String IQN_DESC = "Volume IQN";
     public static final String SIZE_DESC = "Size (in GBs)";
     public static final String MIN_IOPS_DESC = "Min IOPS";
     public static final String MAX_IOPS_DESC = "Max IOPS";
@@ -66,7 +67,7 @@ public class ApiHelper {
     public static final String ACCOUNT_ID_DESC = "Account ID";
     public static final String VIRTUAL_NETWORK_ID_DESC = "Virtual network ID";
     public static final String VOLUME_ID_DESC = "Volume ID";
-    public static final String VOLUME_NAME_DESC = "Name for volume";
+    public static final String VOLUME_NAME_DESC = "Volume name";
     public static final String ZONE_ID_DESC = "Zone ID";
 
     @Inject private AccountDao _accountDao;
@@ -174,6 +175,7 @@ public class ApiHelper {
         sfResponse.setId(sfVolume.getId());
         sfResponse.setUuid(sfVolume.getUuid());
         sfResponse.setName(sfVolume.getName());
+        sfResponse.setIqn(sfVolume.getIqn());
         sfResponse.setSize(sfVolume.getSize());
         sfResponse.setMinIops(sfVolume.getMinIops());
         sfResponse.setMaxIops(sfVolume.getMaxIops());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a3f47086/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 2da7dfb..e4f0e70 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
@@ -39,6 +39,10 @@ public class ApiSolidFireVolumeResponse extends BaseResponse {
     @Param(description = ApiHelper.VOLUME_NAME_DESC)
     private String _name;
 
+    @SerializedName("iqn")
+    @Param(description = ApiHelper.IQN_DESC)
+    private String _iqn;
+
     @SerializedName("size")
     @Param(description = ApiHelper.SIZE_DESC)
     private long _size;
@@ -127,6 +131,14 @@ public class ApiSolidFireVolumeResponse extends BaseResponse {
         return _name;
     }
 
+    public void setIqn(String iqn) {
+        _iqn = iqn;
+    }
+
+    public String getIqn() {
+        return _iqn;
+    }
+
     public void setSize(long size) {
         _size = size;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a3f47086/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
index 663123b..9af4ac2 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
@@ -702,7 +702,9 @@ public class ApiSolidFireServiceImpl2 extends AdapterBase implements APIChecker,
 
                     long sfVolumeId = sfConnection.createVolume(name, sfAccountId, size, minIops, maxIops, burstIops);
 
-                    SfVolumeVO sfVolumeVO = new SfVolumeVO(sfVolumeId, name, size, minIops, maxIops, burstIops, sfVirtualNetworkId);
+                    SolidFireConnection.SolidFireVolume sfVolume = sfConnection.getVolume(sfVolumeId);
+
+                    SfVolumeVO sfVolumeVO = new SfVolumeVO(sfVolumeId, name, sfVolume.getIqn(), size, minIops, maxIops, burstIops, sfVirtualNetworkId);
 
                     return _sfVolumeDao.persist(sfVolumeVO);
                 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a3f47086/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 481106c..d59395d 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
@@ -24,6 +24,8 @@ public interface SfVolume extends Identity, InternalIdentity {
 
     String getName();
 
+    String getIqn();
+
     long getSize();
 
     long getMinIops();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a3f47086/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 2710704..f1aede1 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
@@ -51,6 +51,9 @@ public class SfVolumeVO implements SfVolume {
     @Column(name = "name")
     private String name;
 
+    @Column(name = "iqn")
+    private String iqn;
+
     @Column(name = "size")
     private long size;
 
@@ -80,10 +83,11 @@ public class SfVolumeVO implements SfVolume {
         uuid = UUID.randomUUID().toString();
     }
 
-    public SfVolumeVO(long sfId, String name, long size, long minIops, long maxIops, long burstIops, long sfVirtualNetworkId) {
+    public SfVolumeVO(long sfId, String name, String iqn, long size, long minIops, long maxIops, long burstIops, long sfVirtualNetworkId) {
         this.uuid = UUID.randomUUID().toString();
         this.sfId = sfId;
         this.name = name;
+        this.iqn = iqn;
         this.size = size;
         this.minIops = minIops;
         this.maxIops = maxIops;
@@ -111,6 +115,11 @@ public class SfVolumeVO implements SfVolume {
         return name;
     }
 
+    @Override
+    public String getIqn() {
+        return iqn;
+    }
+
     public void setSize(long size) {
         this.size = size;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a3f47086/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/util/SolidFireConnection.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/util/SolidFireConnection.java b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/util/SolidFireConnection.java
index 1161b41..813f6e2 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/util/SolidFireConnection.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/util/SolidFireConnection.java
@@ -22,9 +22,7 @@ import com.google.gson.GsonBuilder;
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStreamReader;
-import java.io.UnsupportedEncodingException;
 import java.net.URI;
-import java.net.URISyntaxException;
 import java.security.KeyManagementException;
 import java.security.NoSuchAlgorithmException;
 import java.security.SecureRandom;
@@ -39,7 +37,6 @@ import org.apache.cloudstack.utils.security.SSLUtils;
 import org.apache.http.HttpResponse;
 import org.apache.http.auth.AuthScope;
 import org.apache.http.auth.UsernamePasswordCredentials;
-import org.apache.http.client.ClientProtocolException;
 import org.apache.http.client.methods.HttpPost;
 import org.apache.http.conn.scheme.Scheme;
 import org.apache.http.conn.scheme.SchemeRegistry;
@@ -47,11 +44,14 @@ import org.apache.http.conn.ssl.SSLSocketFactory;
 import org.apache.http.entity.StringEntity;
 import org.apache.http.impl.client.DefaultHttpClient;
 import org.apache.http.impl.conn.BasicClientConnectionManager;
+import org.apache.log4j.Logger;
 
 import com.cloud.utils.exception.CloudRuntimeException;
 
 @SuppressWarnings("deprecation")
 public class SolidFireConnection {
+    private static final Logger s_logger = Logger.getLogger(SolidFireConnection.class.getName());
+
     private final String _managementVip;
     private final int _managementPort = 443;
     private final String _clusterAdminUsername;
@@ -127,6 +127,28 @@ public class SolidFireConnection {
         }
     }
 
+    public SolidFireVolume getVolume(long lVolumeId) {
+        final Gson gson = new GsonBuilder().create();
+
+        VolumeToGet volumeToGet = new VolumeToGet(lVolumeId);
+
+        String strVolumeToGetJson = gson.toJson(volumeToGet);
+
+        String strVolumeGetResultJson = executeJsonRpc(strVolumeToGetJson);
+
+        VolumeGetResult volumeGetResult = gson.fromJson(strVolumeGetResultJson, VolumeGetResult.class);
+
+        verifyResult(volumeGetResult.result, strVolumeGetResultJson, gson);
+
+        String strVolumeName = getVolumeName(volumeGetResult, lVolumeId);
+        String strVolumeIqn = getVolumeIqn(volumeGetResult, lVolumeId);
+        long lAccountId = getVolumeAccountId(volumeGetResult, lVolumeId);
+        String strVolumeStatus = getVolumeStatus(volumeGetResult, lVolumeId);
+        long lTotalSize = getVolumeTotalSize(volumeGetResult, lVolumeId);
+
+        return new SolidFireVolume(lVolumeId, strVolumeName, strVolumeIqn, lAccountId, strVolumeStatus, lTotalSize);
+    }
+
     public long createVolume(String name, long accountId, long totalSizeInGBs, long minIops, long maxIops, long burstIops) {
         final Gson gson = new GsonBuilder().create();
 
@@ -283,14 +305,10 @@ public class SolidFireConnection {
             }catch (IOException ex) {
                 throw new CloudRuntimeException(ex.getMessage());
             }
-        } catch (UnsupportedEncodingException ex) {
-            throw new CloudRuntimeException(ex.getMessage());
-        } catch (ClientProtocolException ex) {
-            throw new CloudRuntimeException(ex.getMessage());
-        } catch (IOException ex) {
-            throw new CloudRuntimeException(ex.getMessage());
-        } catch (URISyntaxException ex) {
-            throw new CloudRuntimeException(ex.getMessage());
+        } catch (Throwable t) {
+            s_logger.error(t.getMessage());
+
+            throw new CloudRuntimeException(t.getMessage());
         } finally {
             if (httpClient != null) {
                 try {
@@ -308,6 +326,7 @@ public class SolidFireConnection {
 
         try {
             SSLContext sslContext = SSLUtils.getSSLContext();
+
             X509TrustManager tm = new X509TrustManager() {
                 @Override
                 public void checkClientTrusted(X509Certificate[] xcs, String string) throws CertificateException {
@@ -323,7 +342,7 @@ public class SolidFireConnection {
                 }
             };
 
-            sslContext.init(null, new TrustManager[] {tm}, new SecureRandom());
+            sslContext.init(null, new TrustManager[] { tm }, new SecureRandom());
 
             SSLSocketFactory socketFactory = new SSLSocketFactory(sslContext, SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
             SchemeRegistry registry = new SchemeRegistry();
@@ -335,13 +354,24 @@ public class SolidFireConnection {
 
             return new DefaultHttpClient(mgr, client.getParams());
         } catch (NoSuchAlgorithmException ex) {
+            s_logger.error(ex.getMessage());
+
             throw new CloudRuntimeException(ex.getMessage());
         } catch (KeyManagementException ex) {
+            s_logger.error(ex.getMessage());
+
             throw new CloudRuntimeException(ex.getMessage());
         }
         finally {
             if (client != null) {
-                client.close();
+                try {
+                    client.close();
+                }
+                catch (Throwable t) {
+                    s_logger.error(t.getMessage());
+
+                    throw t;
+                }
             }
         }
     }
@@ -453,6 +483,29 @@ public class SolidFireConnection {
     }
 
     @SuppressWarnings("unused")
+    private static final class VolumeToGet
+    {
+        private final String method = "ListActiveVolumes";
+        private final VolumeToGetParams params;
+
+        private VolumeToGet(final long lVolumeId)
+        {
+            params = new VolumeToGetParams(lVolumeId);
+        }
+
+        private static final class VolumeToGetParams
+        {
+            private final long startVolumeID;
+            private final long limit = 1;
+
+            private VolumeToGetParams(final long lVolumeId)
+            {
+                startVolumeID = lVolumeId;
+            }
+        }
+    }
+
+    @SuppressWarnings("unused")
     private static final class VolumeToCreate {
         private final String method = "CreateVolume";
         private final VolumeToCreateParams params;
@@ -642,6 +695,23 @@ public class SolidFireConnection {
         }
     }
 
+    private static final class VolumeGetResult {
+        private Result result;
+
+        private static final class Result {
+            private Volume[] volumes;
+
+            private static final class Volume {
+                private long volumeID;
+                private String name;
+                private String iqn;
+                private long accountID;
+                private String status;
+                private long totalSize;
+            }
+        }
+    }
+
     private static final class VolumeCreateResult {
         private Result result;
 
@@ -696,6 +766,83 @@ public class SolidFireConnection {
         throw new IllegalStateException("Problem with the following JSON: " + strJson);
     }
 
+    private static final String ACTIVE = "active";
+
+    public static class SolidFireVolume {
+        private final long _id;
+        private final String _name;
+        private final String _iqn;
+        private final long _accountId;
+        private final String _status;
+        private final long _totalSize;
+
+        public SolidFireVolume(long id, String name, String iqn,
+                long accountId, String status, long totalSize)
+        {
+            _id = id;
+            _name = name;
+            _iqn = iqn;
+            _accountId = accountId;
+            _status = status;
+            _totalSize = totalSize;
+        }
+
+        public long getId() {
+            return _id;
+        }
+
+        public String getName() {
+            return _name;
+        }
+
+        public String getIqn() {
+            return _iqn;
+        }
+
+        public long getAccountId() {
+            return _accountId;
+        }
+
+        public boolean isActive() {
+            return ACTIVE.equalsIgnoreCase(_status);
+        }
+
+        public long getTotalSize() {
+            return _totalSize;
+        }
+
+        @Override
+        public int hashCode() {
+            return _iqn.hashCode();
+        }
+
+        @Override
+        public String toString() {
+            return _name;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (obj == null) {
+                return false;
+            }
+
+            if (!obj.getClass().equals(SolidFireVolume.class)) {
+                return false;
+            }
+
+            SolidFireVolume sfv = (SolidFireVolume)obj;
+
+            if (_id == sfv._id && _name.equals(sfv._name) &&
+                _iqn.equals(sfv._iqn) && _accountId == sfv._accountId &&
+                isActive() == sfv.isActive() && getTotalSize() == sfv.getTotalSize()) {
+                return true;
+            }
+
+            return false;
+        }
+    }
+
     public static class SolidFireAccount
     {
         private final long _id;
@@ -761,4 +908,47 @@ public class SolidFireConnection {
     private static long convertGBsToBytes(long gbs) {
         return gbs * 1024 * 1024 * 1024;
     }
+
+    private static String getVolumeName(VolumeGetResult volumeGetResult, long lVolumeId) {
+        if (volumeGetResult.result.volumes != null && volumeGetResult.result.volumes.length == 1 && volumeGetResult.result.volumes[0].volumeID == lVolumeId) {
+            return volumeGetResult.result.volumes[0].name;
+        }
+
+        throw new CloudRuntimeException("Could not determine the name of the volume for volume ID of " + lVolumeId + ".");
+    }
+
+    private static String getVolumeIqn(VolumeGetResult volumeGetResult, long lVolumeId) {
+        if (volumeGetResult.result.volumes != null && volumeGetResult.result.volumes.length == 1 && volumeGetResult.result.volumes[0].volumeID == lVolumeId) {
+            return volumeGetResult.result.volumes[0].iqn;
+        }
+
+        throw new CloudRuntimeException("Could not determine the IQN of the volume for volume ID of " + lVolumeId + ".");
+    }
+
+    private static long getVolumeAccountId(VolumeGetResult volumeGetResult, long lVolumeId) {
+        if (volumeGetResult.result.volumes != null && volumeGetResult.result.volumes.length == 1 && volumeGetResult.result.volumes[0].volumeID == lVolumeId) {
+            return volumeGetResult.result.volumes[0].accountID;
+        }
+
+        throw new CloudRuntimeException("Could not determine the account ID of the volume for volume ID of " + lVolumeId + ".");
+    }
+
+    private static String getVolumeStatus(VolumeGetResult volumeGetResult, long lVolumeId) {
+        if (volumeGetResult.result.volumes != null && volumeGetResult.result.volumes.length == 1 && volumeGetResult.result.volumes[0].volumeID == lVolumeId) {
+            return volumeGetResult.result.volumes[0].status;
+        }
+
+        throw new CloudRuntimeException("Could not determine the status of the volume for volume ID of " + lVolumeId + ".");
+    }
+
+    private static long getVolumeTotalSize(VolumeGetResult volumeGetResult, long lVolumeId)
+    {
+        if (volumeGetResult.result.volumes != null && volumeGetResult.result.volumes.length == 1 &&
+            volumeGetResult.result.volumes[0].volumeID == lVolumeId)
+        {
+            return volumeGetResult.result.volumes[0].totalSize;
+        }
+
+        throw new CloudRuntimeException("Could not determine the total size of the volume for volume ID of " + lVolumeId + ".");
+    }
 }


[43/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Add and use an API to retrieve the virtual networks of a particular cluster

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

Branch: refs/heads/sf-plugins
Commit: cd4a863befd9b1e3810236c52bbb3d52e63080e1
Parents: 7f437bf5
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Mon Jul 20 15:39:58 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:44 2015 -0600

----------------------------------------------------------------------
 .../ListSolidFireVirtualNetworksCmd.java        |  8 ++++-
 .../solidfire/ApiSolidFireService2.java         |  4 ++-
 .../solidfire/ApiSolidFireServiceImpl2.java     | 31 ++++++++++++++++++--
 ui/plugins/sfAdministration/sfAdministration.js |  4 +--
 4 files changed, 41 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cd4a863b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java
index 358dfe6..2f380e7 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/api/command/user/solidfire/ListSolidFireVirtualNetworksCmd.java
@@ -49,6 +49,9 @@ public class ListSolidFireVirtualNetworksCmd extends BaseListCmd {
     @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = ApiSolidFireVirtualNetworkResponse.class, description = ApiHelper.VIRTUAL_NETWORK_ID_DESC)
     private Long _id;
 
+    @Parameter(name = ApiHelper.CLUSTER_NAME, type = CommandType.STRING, description = ApiHelper.SOLIDFIRE_CLUSTER_NAME_DESC, required = true)
+    private String _clusterName;
+
     @Parameter(name = ApiConstants.ZONE_ID, type = CommandType.UUID, entityType = ZoneResponse.class, description = ApiHelper.ZONE_ID_DESC)
     private Long _zoneId;
 
@@ -76,12 +79,15 @@ public class ListSolidFireVirtualNetworksCmd extends BaseListCmd {
             if (_id != null) {
                 sfVirtualNetworks = new ArrayList<>();
 
-                SfVirtualNetwork sfVirtualNetwork = _apiSolidFireService2.listSolidFireVirtualNetwork(_id);
+                SfVirtualNetwork sfVirtualNetwork = _apiSolidFireService2.listSolidFireVirtualNetworkById(_id);
 
                 if (sfVirtualNetwork != null) {
                     sfVirtualNetworks.add(sfVirtualNetwork);
                 }
             }
+            else if (_clusterName != null) {
+                sfVirtualNetworks = _apiSolidFireService2.listSolidFireVirtualNetworkByClusterName(_clusterName);
+            }
             else {
                 sfVirtualNetworks = _apiSolidFireService2.listSolidFireVirtualNetworks(_zoneId, _accountId);
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cd4a863b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireService2.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireService2.java b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireService2.java
index 07f200a..e6ed7d2 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireService2.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireService2.java
@@ -42,7 +42,9 @@ public interface ApiSolidFireService2 extends PluggableService, Configurable {
 
     // ********** VLAN-related commands **********
 
-    SfVirtualNetwork listSolidFireVirtualNetwork(long id);
+    SfVirtualNetwork listSolidFireVirtualNetworkById(long id);
+
+    List<SfVirtualNetwork> listSolidFireVirtualNetworkByClusterName(String clusterName);
 
     // Long (instead of long) for both zoneId and accountId because they're optional and null is used to indicate that they're not present
     // zoneId and accountId are not dependent upon one another (i.e. either one can be null, both can be null, or both can be not be null)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cd4a863b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
----------------------------------------------------------------------
diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
index b626c67..208e62a 100644
--- a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
+++ b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java
@@ -244,8 +244,8 @@ public class ApiSolidFireServiceImpl2 extends AdapterBase implements APIChecker,
     }
 
     @Override
-    public SfVirtualNetwork listSolidFireVirtualNetwork(long id) {
-        s_logger.info("listSolidFireVirtualNetwork invoked");
+    public SfVirtualNetwork listSolidFireVirtualNetworkById(long id) {
+        s_logger.info("listSolidFireVirtualNetworkById invoked");
 
         SfVirtualNetwork sfVirtualNetwork = getSfVirtualNetwork(id);
 
@@ -255,6 +255,17 @@ public class ApiSolidFireServiceImpl2 extends AdapterBase implements APIChecker,
     }
 
     @Override
+    public List<SfVirtualNetwork> listSolidFireVirtualNetworkByClusterName(String clusterName) {
+        s_logger.info("listSolidFireVirtualNetworkByClusterName invoked");
+
+        verifyRootAdmin();
+
+        SfCluster sfCluster = getSfCluster(clusterName);
+
+        return filterVirtualNetworksByCluster(_sfVirtualNetworkDao.listAll(), sfCluster.getId());
+    }
+
+    @Override
     public List<SfVirtualNetwork> listSolidFireVirtualNetworks(Long zoneId, Long accountId) {
         s_logger.info("listSolidFireVirtualNetworks invoked");
 
@@ -979,6 +990,22 @@ public class ApiSolidFireServiceImpl2 extends AdapterBase implements APIChecker,
         _accountDetailsDao.persist(accountDetail);
     }
 
+    private List<SfVirtualNetwork> filterVirtualNetworksByCluster(List<SfVirtualNetworkVO> sfVirtualNetworkVOs, long clusterId) {
+        List<SfVirtualNetwork> sfVirtualNetworkVOsToReturn = new ArrayList<>();
+
+        if (sfVirtualNetworkVOs != null) {
+            for (SfVirtualNetworkVO sfVirtualNetworkVO : sfVirtualNetworkVOs) {
+                long sfClusterId = sfVirtualNetworkVO.getSfClusterId();
+
+                if (sfClusterId == clusterId) {
+                    sfVirtualNetworkVOsToReturn.add(sfVirtualNetworkVO);
+                }
+            }
+        }
+
+        return sfVirtualNetworkVOsToReturn;
+    }
+
     private List<SfVirtualNetworkVO> filterVirtualNetworksByZone(List<SfVirtualNetworkVO> sfVirtualNetworkVOs, long zoneId) {
         List<SfVirtualNetworkVO> sfVirtualNetworkVOsToReturn = new ArrayList<>();
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cd4a863b/ui/plugins/sfAdministration/sfAdministration.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfAdministration/sfAdministration.js b/ui/plugins/sfAdministration/sfAdministration.js
index be1be98..46ac7f2 100644
--- a/ui/plugins/sfAdministration/sfAdministration.js
+++ b/ui/plugins/sfAdministration/sfAdministration.js
@@ -310,9 +310,9 @@
               account: { label: 'label.account' }
             },
             dataProvider: function(args) {
-              var virtualnetworkid = args.context.virtualnetwork[0].id;
+              var clustername = args.context.sfAdministration[0].name;
 
-              plugin.ui.apiCall('listSolidFireVirtualNetworks&' + virtualnetworkid, {
+              plugin.ui.apiCall('listSolidFireVirtualNetworks&clustername=' + clustername, {
                 success: function(json) {
                   var sfvirtualnetworksfiltered = [];
                   var sfvirtualnetworks = json.listsolidfirevirtualnetworksresponse.sfvirtualnetwork;


[12/50] git commit: updated refs/heads/sf-plugins to bcf1c72

Posted by mt...@apache.org.
Extend plug-in functionality


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

Branch: refs/heads/sf-plugins
Commit: 81d58dbabd3919b7c626e3754aeedcd6fbdd5120
Parents: 7755061
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Mon Jul 6 20:56:46 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:41 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfSharedVolume/sfSharedVolume.js | 35 ++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/81d58dba/ui/plugins/sfSharedVolume/sfSharedVolume.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/sfSharedVolume.js b/ui/plugins/sfSharedVolume/sfSharedVolume.js
index ff16c91..99ad905 100644
--- a/ui/plugins/sfSharedVolume/sfSharedVolume.js
+++ b/ui/plugins/sfSharedVolume/sfSharedVolume.js
@@ -46,6 +46,41 @@
               title: 'Add Shared Volume',
               desc: 'Please fill in the following data to add a new shared volume.',
               fields: {
+                name: {
+                  docID: 'helpVolumeName',
+                  label: 'label.name',
+                  validation: {
+                    required: true
+                  }
+                },
+                diskSize: {
+                  label: 'label.disk.size.gb',
+                  validation: {
+                    required: true,
+                    number: true
+                  }
+                },
+                minIops: {
+                  label: 'label.disk.iops.min',
+                  validation: {
+                    required: false,
+                    number: true
+                  }
+                },
+                maxIops: {
+                  label: 'label.disk.iops.max',
+                  validation: {
+                    required: false,
+                    number: true
+                  }
+                },
+                burstIops: {
+                  label: 'Burst IOPS',
+                  validation: {
+                    required: false,
+                    number: true
+                  }
+                }
               }
             }
           }