New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for provisioned IOPS for RDS #1028

Closed
wants to merge 3 commits into
base: develop
from
Jump to file or symbol
Failed to load files and symbols.
+49 −2
Diff settings

Always

Just for now

Next

Added support for provisioned IOPS in RDS

  • Loading branch information...
marknca committed Sep 29, 2012
commit 2fc732fdc80bd06094e022a59807db374290b0de
Copy path View file
@@ -161,8 +161,9 @@ def create_dbinstance(self,
db_subnet_group_name = None,
license_model = None,
option_group_name = None,
iops=None,
):
# API version: 2012-04-23
# API version: 2012-09-17
# Parameter notes:
# =================
# id should be db_instance_identifier according to API docs but has been left
@@ -348,6 +349,17 @@ def create_dbinstance(self,
:param option_group_name: Indicates that the DB Instance should be associated
with the specified option group.
:type iops: int
:param iops: The amount of IOPS (input/output operations per second) to Provisioned
for the DB Instance. Can be modified at a later date.
Must scale linearly. For every 1000 IOPS provision, you must allocated
100 GB of storage space. This scales up to 1 TB / 10 000 IOPS for MySQL
and Oracle. MSSQL is limited to 700 GB / 7 000 IOPS.
If you specify a value, it must be at least 1000 IOPS and you must
allocate 100 GB of storage.
:rtype: :class:`boto.rds.dbinstance.DBInstance`
:return: The new db instance.
"""
@@ -388,6 +400,7 @@ def create_dbinstance(self,
'DBSubnetGroupName': db_subnet_group_name,
'Engine': engine,
'EngineVersion': engine_version,
'Iops': iops,
'LicenseModel': license_model,
'MasterUsername': master_username,
'MasterUserPassword': master_password,
@@ -488,7 +501,8 @@ def modify_dbinstance(self, id, param_group=None, security_groups=None,
backup_retention_period=None,
preferred_backup_window=None,
multi_az=False,
apply_immediately=False):
apply_immediately=False,
iops=None):
"""
Modify an existing DBInstance.
@@ -548,6 +562,17 @@ def modify_dbinstance(self, id, param_group=None, security_groups=None,
:param multi_az: If True, specifies the DB Instance will be
deployed in multiple availability zones.
:type iops: int
:param iops: The amount of IOPS (input/output operations per second) to Provisioned
for the DB Instance. Can be modified at a later date.
Must scale linearly. For every 1000 IOPS provision, you must allocated
100 GB of storage space. This scales up to 1 TB / 10 000 IOPS for MySQL
and Oracle. MSSQL is limited to 700 GB / 7 000 IOPS.
If you specify a value, it must be at least 1000 IOPS and you must
allocate 100 GB of storage.
:rtype: :class:`boto.rds.dbinstance.DBInstance`
:return: The modified db instance.
"""
@@ -578,6 +603,8 @@ def modify_dbinstance(self, id, param_group=None, security_groups=None,
params['MultiAZ'] = 'true'
if apply_immediately:
params['ApplyImmediately'] = 'true'
if iops:
params['Iops'] = iops
return self.get_object('ModifyDBInstance', params, DBInstance)
Copy path View file
@@ -61,6 +61,7 @@ class DBInstance(object):
a database can be restored with point-in-time restore. TODO: type?
:ivar multi_az: Boolean that specifies if the DB Instance is a
Multi-AZ deployment.
:ivar iops: The current number of provisioned IOPS for the DB Instance. Can be None if this is a standard instance
:ivar pending_modified_values: Specifies that changes to the
DB Instance are pending. This element is only included when changes
are pending. Specific changes are identified by subelements.
@@ -84,6 +85,7 @@ def __init__(self, connection=None, id=None):
self.preferred_maintenance_window = None
self.latest_restorable_time = None
self.multi_az = False
self.iops = None
self.pending_modified_values = None
self._in_endpoint = False
self._port = None
@@ -145,6 +147,11 @@ def endElement(self, name, value, connection):
elif name == 'MultiAZ':
if value.lower() == 'true':
self.multi_az = True
elif name == 'Iops':
try:
self.iops = int(value)
except Exception, err:
self.iops = None
else:
setattr(self, name, value)
@@ -217,6 +224,7 @@ def modify(self, param_group=None, security_groups=None,
backup_retention_period=None,
preferred_backup_window=None,
multi_az=False,
iops=None,
apply_immediately=False):
"""
Modify this DBInstance.
@@ -271,6 +279,17 @@ def modify(self, param_group=None, security_groups=None,
:param multi_az: If True, specifies the DB Instance will be
deployed in multiple availability zones.
:type iops: int
:param iops: The amount of IOPS (input/output operations per second) to Provisioned
for the DB Instance. Can be modified at a later date.
Must scale linearly. For every 1000 IOPS provision, you must allocated
100 GB of storage space. This scales up to 1 TB / 10 000 IOPS for MySQL
and Oracle. MSSQL is limited to 700 GB / 7 000 IOPS.
If you specify a value, it must be at least 1000 IOPS and you must
allocate 100 GB of storage.
:rtype: :class:`boto.rds.dbinstance.DBInstance`
:return: The modified db instance.
"""
@@ -284,6 +303,7 @@ def modify(self, param_group=None, security_groups=None,
backup_retention_period,
preferred_backup_window,
multi_az,
iops,
apply_immediately)
ProTip! Use n and p to navigate between commits in a pull request.