Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Provisioned IOPS for EBS Volumes support

  • Loading branch information...
commit 96623c6d195d9864ebb7ff961e5f5cc96d154b40 1 parent d39feff
Eugene Kato authored
4 ec2ui/content/ec2ui/controller.js
@@ -85,11 +85,13 @@ var ec2ui_controller = {
85 85 objResponse.callback();
86 86 },
87 87
88   - createVolume : function (size, snapshotId, zone, callback) {
  88 + createVolume : function (size, snapshotId, zone, volumeType, iops, callback) {
89 89 var params = []
90 90 if (size != null) params.push(["Size", size]);
91 91 if (snapshotId != null) params.push(["SnapshotId", snapshotId]);
92 92 if (zone != null) params.push(["AvailabilityZone", zone]);
  93 + if (volumeType != null) params.push(["VolumeType", volumeType]);
  94 + if (iops != null) params.push(["Iops", iops]);
93 95 ec2_httpclient.queryEC2("CreateVolume", params, this, true, "onCompleteCreateVolume", callback);
94 96 },
95 97
8 ec2ui/content/ec2ui/dialog_new_volume.xul
@@ -30,6 +30,14 @@
30 30 <menulist id="ec2ui.newvolume.availabilityzonelist" />
31 31 </row>
32 32 <row>
  33 + <label control="ec2ui.newvolume.volumetypelist" value="&ec2ui.volumes.volumeType.label;" />
  34 + <menulist id="ec2ui.newvolume.volumetypelist" />
  35 + </row>
  36 + <row>
  37 + <label control="ec2ui.newvolume.iops" value="&ec2ui.volumes.iops.label;" />
  38 + <textbox id="ec2ui.newvolume.iops" size="40" />
  39 + </row>
  40 + <row>
33 41 <label control="ec2ui.newvolume.tag" value="Tag" />
34 42 <textbox id="ec2ui.newvolume.tag" size="40" />
35 43 </row>
26 ec2ui/content/ec2ui/newvolumedialog.js
@@ -14,7 +14,13 @@ var ec2_VolumeCreator = {
14 14
15 15 this.retVal.zone = document.getElementById("ec2ui.newvolume.availabilityzonelist").value;
16 16
  17 + this.retVal.volumeType = document.getElementById("ec2ui.newvolume.volumetypelist").value;
  18 +
  19 + this.retVal.iops = document.getElementById("ec2ui.newvolume.iops").value.trim();
  20 + if (this.retVal.iops.length == 0) this.retVal.iops = null;
  21 +
17 22 if (!this.validateSize()) return false;
  23 + if (!this.validateIops()) return false;
18 24
19 25 this.retVal.tag = document.getElementById("ec2ui.newvolume.tag").value.trim();
20 26 this.retVal.ok = true;
@@ -34,6 +40,19 @@ var ec2_VolumeCreator = {
34 40 return true;
35 41 },
36 42
  43 + validateIops : function() {
  44 + var val = (this.retVal.size != null) ? this.retVal.size : "";
  45 + val = parseInt(val);
  46 + var textbox = document.getElementById("ec2ui.newvolume.iops");
  47 + if (!isNaN(val) && val < 1) {
  48 + alert("IOPS must be >= 1 if a snapshot is not selected");
  49 + textbox.select();
  50 + return false;
  51 + }
  52 +
  53 + return true;
  54 + },
  55 +
37 56 init : function() {
38 57 var srcSnap = window.arguments[0];
39 58 this.ec2ui_session = window.arguments[1];
@@ -62,6 +81,13 @@ var ec2_VolumeCreator = {
62 81 }
63 82 //}
64 83 }
  84 +
  85 + // volume types
  86 + var volTypeMenu = document.getElementById("ec2ui.newvolume.volumetypelist");
  87 + volTypeMenu.appendItem("standard", "standard");
  88 + volTypeMenu.appendItem("io1", "io1");
  89 + volTypeMenu.selectedIndex = 0;
  90 +
65 91 // To accommodate the <NONE> element added at the head of the list
66 92 snapshotIdMenu.selectedIndex += 1;
67 93
2  ec2ui/content/ec2ui/volumesview.js
@@ -149,6 +149,8 @@ var ec2ui_VolumeTreeView = {
149 149 ec2ui_session.controller.createVolume(retVal.size,
150 150 retVal.snapshotId,
151 151 retVal.zone,
  152 + retVal.volumeType,
  153 + retVal.iops,
152 154 wrap);
153 155
154 156 // Let's tag this volume
2  ec2ui/locale/ec2ui/en-US/ec2ui.dtd
@@ -101,6 +101,8 @@
101 101 <!ENTITY ec2ui.volumes.size.label "Size (GB)">
102 102 <!ENTITY ec2ui.volumes.status.label "Status">
103 103 <!ENTITY ec2ui.volumes.createTime.label "Local Creation Date">
  104 +<!ENTITY ec2ui.volumes.volumeType.label "Volume Type">
  105 +<!ENTITY ec2ui.volumes.iops.label "IOPS">
104 106 <!ENTITY ec2ui.volumes.attachment.device.label "Device">
105 107 <!ENTITY ec2ui.volumes.attachment.status.label "Attachment Status">
106 108 <!ENTITY ec2ui.volumes.attachment.attachTime.label "Attach Time">

0 comments on commit 96623c6

Please sign in to comment.
Something went wrong with that request. Please try again.