| OLD | NEW |
| 1 # Copyright (c) 2009 Mitch Garnaat http://garnaat.org/ | 1 # Copyright (c) 2009 Mitch Garnaat http://garnaat.org/ |
| 2 # | 2 # |
| 3 # Permission is hereby granted, free of charge, to any person obtaining a | 3 # Permission is hereby granted, free of charge, to any person obtaining a |
| 4 # copy of this software and associated documentation files (the | 4 # copy of this software and associated documentation files (the |
| 5 # "Software"), to deal in the Software without restriction, including | 5 # "Software"), to deal in the Software without restriction, including |
| 6 # without limitation the rights to use, copy, modify, merge, publish, dis- | 6 # without limitation the rights to use, copy, modify, merge, publish, dis- |
| 7 # tribute, sublicense, and/or sell copies of the Software, and to permit | 7 # tribute, sublicense, and/or sell copies of the Software, and to permit |
| 8 # persons to whom the Software is furnished to do so, subject to the fol- | 8 # persons to whom the Software is furnished to do so, subject to the fol- |
| 9 # lowing conditions: | 9 # lowing conditions: |
| 10 # | 10 # |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 from boto.rds.regioninfo import RDSRegionInfo | 31 from boto.rds.regioninfo import RDSRegionInfo |
| 32 | 32 |
| 33 def regions(): | 33 def regions(): |
| 34 """ | 34 """ |
| 35 Get all available regions for the RDS service. | 35 Get all available regions for the RDS service. |
| 36 | 36 |
| 37 :rtype: list | 37 :rtype: list |
| 38 :return: A list of :class:`boto.rds.regioninfo.RDSRegionInfo` | 38 :return: A list of :class:`boto.rds.regioninfo.RDSRegionInfo` |
| 39 """ | 39 """ |
| 40 return [RDSRegionInfo(name='us-east-1', | 40 return [RDSRegionInfo(name='us-east-1', |
| 41 endpoint='rds.amazonaws.com'), | 41 endpoint='rds.us-east-1.amazonaws.com'), |
| 42 RDSRegionInfo(name='eu-west-1', | 42 RDSRegionInfo(name='eu-west-1', |
| 43 endpoint='eu-west-1.rds.amazonaws.com'), | 43 endpoint='rds.eu-west-1.amazonaws.com'), |
| 44 RDSRegionInfo(name='us-west-1', | 44 RDSRegionInfo(name='us-west-1', |
| 45 endpoint='us-west-1.rds.amazonaws.com'), | 45 endpoint='rds.us-west-1.amazonaws.com'), |
| 46 RDSRegionInfo(name='ap-northeast-1', |
| 47 endpoint='rds.ap-northeast-1.amazonaws.com'), |
| 46 RDSRegionInfo(name='ap-southeast-1', | 48 RDSRegionInfo(name='ap-southeast-1', |
| 47 endpoint='ap-southeast-1.rds.amazonaws.com') | 49 endpoint='rds.ap-southeast-1.amazonaws.com') |
| 48 ] | 50 ] |
| 49 | 51 |
| 50 def connect_to_region(region_name): | 52 def connect_to_region(region_name, **kw_params): |
| 53 """ |
| 54 Given a valid region name, return a |
| 55 :class:`boto.ec2.connection.EC2Connection`. |
| 56 Any additional parameters after the region_name are passed on to |
| 57 the connect method of the region object. |
| 58 |
| 59 :type: str |
| 60 :param region_name: The name of the region to connect to. |
| 61 |
| 62 :rtype: :class:`boto.ec2.connection.EC2Connection` or ``None`` |
| 63 :return: A connection to the given region, or None if an invalid region |
| 64 name is given |
| 65 """ |
| 51 for region in regions(): | 66 for region in regions(): |
| 52 if region.name == region_name: | 67 if region.name == region_name: |
| 53 return region.connect() | 68 return region.connect(**kw_params) |
| 54 return None | 69 return None |
| 55 | 70 |
| 56 #boto.set_stream_logger('rds') | 71 #boto.set_stream_logger('rds') |
| 57 | 72 |
| 58 class RDSConnection(AWSQueryConnection): | 73 class RDSConnection(AWSQueryConnection): |
| 59 | 74 |
| 60 DefaultRegionName = 'us-east-1' | 75 DefaultRegionName = 'us-east-1' |
| 61 DefaultRegionEndpoint = 'rds.amazonaws.com' | 76 DefaultRegionEndpoint = 'rds.amazonaws.com' |
| 62 APIVersion = '2009-10-16' | 77 APIVersion = '2011-04-01' |
| 63 | 78 |
| 64 def __init__(self, aws_access_key_id=None, aws_secret_access_key=None, | 79 def __init__(self, aws_access_key_id=None, aws_secret_access_key=None, |
| 65 is_secure=True, port=None, proxy=None, proxy_port=None, | 80 is_secure=True, port=None, proxy=None, proxy_port=None, |
| 66 proxy_user=None, proxy_pass=None, debug=0, | 81 proxy_user=None, proxy_pass=None, debug=0, |
| 67 https_connection_factory=None, region=None, path='/'): | 82 https_connection_factory=None, region=None, path='/'): |
| 68 if not region: | 83 if not region: |
| 69 region = RDSRegionInfo(self, self.DefaultRegionName, | 84 region = RDSRegionInfo(self, self.DefaultRegionName, |
| 70 self.DefaultRegionEndpoint) | 85 self.DefaultRegionEndpoint) |
| 71 self.region = region | 86 self.region = region |
| 72 AWSQueryConnection.__init__(self, aws_access_key_id, aws_secret_access_k
ey, | 87 AWSQueryConnection.__init__(self, aws_access_key_id, |
| 73 is_secure, port, proxy, proxy_port, proxy_us
er, | 88 aws_secret_access_key, |
| 74 proxy_pass, self.region.endpoint, debug, | 89 is_secure, port, proxy, proxy_port, |
| 90 proxy_user, proxy_pass, |
| 91 self.region.endpoint, debug, |
| 75 https_connection_factory, path) | 92 https_connection_factory, path) |
| 76 | 93 |
| 77 def _required_auth_capability(self): | 94 def _required_auth_capability(self): |
| 78 return ['rds'] | 95 return ['rds'] |
| 79 | 96 |
| 80 # DB Instance methods | 97 # DB Instance methods |
| 81 | 98 |
| 82 def get_all_dbinstances(self, instance_id=None, max_records=None, | 99 def get_all_dbinstances(self, instance_id=None, max_records=None, |
| 83 marker=None): | 100 marker=None): |
| 84 """ | 101 """ |
| 85 Retrieve all the DBInstances in your account. | 102 Retrieve all the DBInstances in your account. |
| 86 | 103 |
| 87 :type instance_id: str | 104 :type instance_id: str |
| 88 :param instance_id: DB Instance identifier. If supplied, only informati
on | 105 :param instance_id: DB Instance identifier. If supplied, only |
| 89 this instance will be returned. Otherwise, info | 106 information this instance will be returned. |
| 90 about all DB Instances will be returned. | 107 Otherwise, info about all DB Instances will |
| 108 be returned. |
| 91 | 109 |
| 92 :type max_records: int | 110 :type max_records: int |
| 93 :param max_records: The maximum number of records to be returned. | 111 :param max_records: The maximum number of records to be returned. |
| 94 If more results are available, a MoreToken will | 112 If more results are available, a MoreToken will |
| 95 be returned in the response that can be used to | 113 be returned in the response that can be used to |
| 96 retrieve additional records. Default is 100. | 114 retrieve additional records. Default is 100. |
| 97 | 115 |
| 98 :type marker: str | 116 :type marker: str |
| 99 :param marker: The marker provided by a previous request. | 117 :param marker: The marker provided by a previous request. |
| 100 | 118 |
| 101 :rtype: list | 119 :rtype: list |
| 102 :return: A list of :class:`boto.rds.dbinstance.DBInstance` | 120 :return: A list of :class:`boto.rds.dbinstance.DBInstance` |
| 103 """ | 121 """ |
| 104 params = {} | 122 params = {} |
| 105 if instance_id: | 123 if instance_id: |
| 106 params['DBInstanceIdentifier'] = instance_id | 124 params['DBInstanceIdentifier'] = instance_id |
| 107 if max_records: | 125 if max_records: |
| 108 params['MaxRecords'] = max_records | 126 params['MaxRecords'] = max_records |
| 109 if marker: | 127 if marker: |
| 110 params['Marker'] = marker | 128 params['Marker'] = marker |
| 111 return self.get_list('DescribeDBInstances', params, [('DBInstance', DBIn
stance)]) | 129 return self.get_list('DescribeDBInstances', params, |
| 130 [('DBInstance', DBInstance)]) |
| 112 | 131 |
| 113 def create_dbinstance(self, id, allocated_storage, instance_class, | 132 def create_dbinstance(self, id, allocated_storage, instance_class, |
| 114 master_username, master_password, port=3306, | 133 master_username, master_password, port=3306, |
| 115 engine='MySQL5.1', db_name=None, param_group=None, | 134 engine='MySQL5.1', db_name=None, param_group=None, |
| 116 security_groups=None, availability_zone=None, | 135 security_groups=None, availability_zone=None, |
| 117 preferred_maintenance_window=None, | 136 preferred_maintenance_window=None, |
| 118 backup_retention_period=None, | 137 backup_retention_period=None, |
| 119 preferred_backup_window=None, | 138 preferred_backup_window=None, |
| 120 multi_az=False, | 139 multi_az=False, |
| 121 engine_version=None, | 140 engine_version=None, |
| 122 auto_minor_version_upgrade=True): | 141 auto_minor_version_upgrade=True): |
| 123 """ | 142 """ |
| 124 Create a new DBInstance. | 143 Create a new DBInstance. |
| 125 | 144 |
| 126 :type id: str | 145 :type id: str |
| 127 :param id: Unique identifier for the new instance. | 146 :param id: Unique identifier for the new instance. |
| 128 Must contain 1-63 alphanumeric characters. | 147 Must contain 1-63 alphanumeric characters. |
| 129 First character must be a letter. | 148 First character must be a letter. |
| 130 May not end with a hyphen or contain two consecutive hyphens | 149 May not end with a hyphen or contain two consecutive hyphens |
| 131 | 150 |
| 132 :type allocated_storage: int | 151 :type allocated_storage: int |
| 133 :param allocated_storage: Initially allocated storage size, in GBs. | 152 :param allocated_storage: Initially allocated storage size, in GBs. |
| 134 Valid values are [5-1024] | 153 Valid values are [5-1024] |
| 135 | 154 |
| 136 :type instance_class: str | 155 :type instance_class: str |
| 137 :param instance_class: The compute and memory capacity of the DBInstance
. | 156 :param instance_class: The compute and memory capacity of |
| 138 | 157 the DBInstance. Valid values are: |
| 139 Valid values are: | |
| 140 | 158 |
| 141 * db.m1.small | 159 * db.m1.small |
| 142 * db.m1.large | 160 * db.m1.large |
| 143 * db.m1.xlarge | 161 * db.m1.xlarge |
| 144 * db.m2.xlarge | 162 * db.m2.xlarge |
| 145 * db.m2.2xlarge | 163 * db.m2.2xlarge |
| 146 * db.m2.4xlarge | 164 * db.m2.4xlarge |
| 147 | 165 |
| 148 :type engine: str | 166 :type engine: str |
| 149 :param engine: Name of database engine. Must be MySQL5.1 for now. | 167 :param engine: Name of database engine. Must be MySQL5.1 for now. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 for group in security_groups: | 246 for group in security_groups: |
| 229 if isinstance(group, DBSecurityGroup): | 247 if isinstance(group, DBSecurityGroup): |
| 230 l.append(group.name) | 248 l.append(group.name) |
| 231 else: | 249 else: |
| 232 l.append(group) | 250 l.append(group) |
| 233 self.build_list_params(params, l, 'DBSecurityGroups.member') | 251 self.build_list_params(params, l, 'DBSecurityGroups.member') |
| 234 if availability_zone: | 252 if availability_zone: |
| 235 params['AvailabilityZone'] = availability_zone | 253 params['AvailabilityZone'] = availability_zone |
| 236 if preferred_maintenance_window: | 254 if preferred_maintenance_window: |
| 237 params['PreferredMaintenanceWindow'] = preferred_maintenance_window | 255 params['PreferredMaintenanceWindow'] = preferred_maintenance_window |
| 238 if backup_retention_period: | 256 if backup_retention_period is not None: |
| 239 params['BackupRetentionPeriod'] = backup_retention_period | 257 params['BackupRetentionPeriod'] = backup_retention_period |
| 240 if preferred_backup_window: | 258 if preferred_backup_window: |
| 241 params['PreferredBackupWindow'] = preferred_backup_window | 259 params['PreferredBackupWindow'] = preferred_backup_window |
| 242 if multi_az: | 260 if multi_az: |
| 243 params['MultiAZ'] = 'true' | 261 params['MultiAZ'] = 'true' |
| 244 if engine_version: | 262 if engine_version: |
| 245 params['EngineVersion'] = engine_version | 263 params['EngineVersion'] = engine_version |
| 246 if auto_minor_version_upgrade is False: | 264 if auto_minor_version_upgrade is False: |
| 247 params['AutoMinorVersionUpgrade'] = 'false' | 265 params['AutoMinorVersionUpgrade'] = 'false' |
| 248 | 266 |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 l.append(group) | 417 l.append(group) |
| 400 self.build_list_params(params, l, 'DBSecurityGroups.member') | 418 self.build_list_params(params, l, 'DBSecurityGroups.member') |
| 401 if preferred_maintenance_window: | 419 if preferred_maintenance_window: |
| 402 params['PreferredMaintenanceWindow'] = preferred_maintenance_window | 420 params['PreferredMaintenanceWindow'] = preferred_maintenance_window |
| 403 if master_password: | 421 if master_password: |
| 404 params['MasterUserPassword'] = master_password | 422 params['MasterUserPassword'] = master_password |
| 405 if allocated_storage: | 423 if allocated_storage: |
| 406 params['AllocatedStorage'] = allocated_storage | 424 params['AllocatedStorage'] = allocated_storage |
| 407 if instance_class: | 425 if instance_class: |
| 408 params['DBInstanceClass'] = instance_class | 426 params['DBInstanceClass'] = instance_class |
| 409 if backup_retention_period: | 427 if backup_retention_period is not None: |
| 410 params['BackupRetentionPeriod'] = backup_retention_period | 428 params['BackupRetentionPeriod'] = backup_retention_period |
| 411 if preferred_backup_window: | 429 if preferred_backup_window: |
| 412 params['PreferredBackupWindow'] = preferred_backup_window | 430 params['PreferredBackupWindow'] = preferred_backup_window |
| 413 if multi_az: | 431 if multi_az: |
| 414 params['MultiAZ'] = 'true' | 432 params['MultiAZ'] = 'true' |
| 415 if apply_immediately: | 433 if apply_immediately: |
| 416 params['ApplyImmediately'] = 'true' | 434 params['ApplyImmediately'] = 'true' |
| 417 | 435 |
| 418 return self.get_object('ModifyDBInstance', params, DBInstance) | 436 return self.get_object('ModifyDBInstance', params, DBInstance) |
| 419 | 437 |
| 420 def delete_dbinstance(self, id, skip_final_snapshot=False, | 438 def delete_dbinstance(self, id, skip_final_snapshot=False, |
| 421 final_snapshot_id=''): | 439 final_snapshot_id=''): |
| 422 """ | 440 """ |
| 423 Delete an existing DBInstance. | 441 Delete an existing DBInstance. |
| 424 | 442 |
| 425 :type id: str | 443 :type id: str |
| 426 :param id: Unique identifier for the new instance. | 444 :param id: Unique identifier for the new instance. |
| 427 | 445 |
| 428 :type skip_final_snapshot: bool | 446 :type skip_final_snapshot: bool |
| 429 :param skip_final_snapshot: This parameter determines whether a final | 447 :param skip_final_snapshot: This parameter determines whether a final |
| 430 db snapshot is created before the instance | 448 db snapshot is created before the instance |
| 431 is deleted. If True, no snapshot is created
. | 449 is deleted. If True, no snapshot |
| 432 If False, a snapshot is created before | 450 is created. If False, a snapshot |
| 433 deleting the instance. | 451 is created before deleting the instance. |
| 434 | 452 |
| 435 :type final_snapshot_id: str | 453 :type final_snapshot_id: str |
| 436 :param final_snapshot_id: If a final snapshot is requested, this | 454 :param final_snapshot_id: If a final snapshot is requested, this |
| 437 is the identifier used for that snapshot. | 455 is the identifier used for that snapshot. |
| 438 | 456 |
| 439 :rtype: :class:`boto.rds.dbinstance.DBInstance` | 457 :rtype: :class:`boto.rds.dbinstance.DBInstance` |
| 440 :return: The deleted db instance. | 458 :return: The deleted db instance. |
| 441 """ | 459 """ |
| 442 params = {'DBInstanceIdentifier' : id} | 460 params = {'DBInstanceIdentifier' : id} |
| 443 if skip_final_snapshot: | 461 if skip_final_snapshot: |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 :type parameters: list of :class:`boto.rds.parametergroup.Parameter` | 579 :type parameters: list of :class:`boto.rds.parametergroup.Parameter` |
| 562 :param parameters: The new parameters | 580 :param parameters: The new parameters |
| 563 | 581 |
| 564 :rtype: :class:`boto.rds.parametergroup.ParameterGroup` | 582 :rtype: :class:`boto.rds.parametergroup.ParameterGroup` |
| 565 :return: The newly created ParameterGroup | 583 :return: The newly created ParameterGroup |
| 566 """ | 584 """ |
| 567 params = {'DBParameterGroupName': name} | 585 params = {'DBParameterGroupName': name} |
| 568 for i in range(0, len(parameters)): | 586 for i in range(0, len(parameters)): |
| 569 parameter = parameters[i] | 587 parameter = parameters[i] |
| 570 parameter.merge(params, i+1) | 588 parameter.merge(params, i+1) |
| 571 return self.get_list('ModifyDBParameterGroup', params, ParameterGroup) | 589 return self.get_list('ModifyDBParameterGroup', params, |
| 590 ParameterGroup, verb='POST') |
| 572 | 591 |
| 573 def reset_parameter_group(self, name, reset_all_params=False, parameters=Non
e): | 592 def reset_parameter_group(self, name, reset_all_params=False, |
| 593 parameters=None): |
| 574 """ | 594 """ |
| 575 Resets some or all of the parameters of a ParameterGroup to the | 595 Resets some or all of the parameters of a ParameterGroup to the |
| 576 default value | 596 default value |
| 577 | 597 |
| 578 :type key_name: string | 598 :type key_name: string |
| 579 :param key_name: The name of the ParameterGroup to reset | 599 :param key_name: The name of the ParameterGroup to reset |
| 580 | 600 |
| 581 :type parameters: list of :class:`boto.rds.parametergroup.Parameter` | 601 :type parameters: list of :class:`boto.rds.parametergroup.Parameter` |
| 582 :param parameters: The parameters to reset. If not supplied, all parame
ters | 602 :param parameters: The parameters to reset. If not supplied, |
| 583 will be reset. | 603 all parameters will be reset. |
| 584 """ | 604 """ |
| 585 params = {'DBParameterGroupName':name} | 605 params = {'DBParameterGroupName':name} |
| 586 if reset_all_params: | 606 if reset_all_params: |
| 587 params['ResetAllParameters'] = 'true' | 607 params['ResetAllParameters'] = 'true' |
| 588 else: | 608 else: |
| 589 params['ResetAllParameters'] = 'false' | 609 params['ResetAllParameters'] = 'false' |
| 590 for i in range(0, len(parameters)): | 610 for i in range(0, len(parameters)): |
| 591 parameter = parameters[i] | 611 parameter = parameters[i] |
| 592 parameter.merge(params, i+1) | 612 parameter.merge(params, i+1) |
| 593 return self.get_status('ResetDBParameterGroup', params) | 613 return self.get_status('ResetDBParameterGroup', params) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 604 | 624 |
| 605 # DBSecurityGroup methods | 625 # DBSecurityGroup methods |
| 606 | 626 |
| 607 def get_all_dbsecurity_groups(self, groupname=None, max_records=None, | 627 def get_all_dbsecurity_groups(self, groupname=None, max_records=None, |
| 608 marker=None): | 628 marker=None): |
| 609 """ | 629 """ |
| 610 Get all security groups associated with your account in a region. | 630 Get all security groups associated with your account in a region. |
| 611 | 631 |
| 612 :type groupnames: list | 632 :type groupnames: list |
| 613 :param groupnames: A list of the names of security groups to retrieve. | 633 :param groupnames: A list of the names of security groups to retrieve. |
| 614 If not provided, all security groups will be returned
. | 634 If not provided, all security groups will |
| 635 be returned. |
| 615 | 636 |
| 616 :type max_records: int | 637 :type max_records: int |
| 617 :param max_records: The maximum number of records to be returned. | 638 :param max_records: The maximum number of records to be returned. |
| 618 If more results are available, a MoreToken will | 639 If more results are available, a MoreToken will |
| 619 be returned in the response that can be used to | 640 be returned in the response that can be used to |
| 620 retrieve additional records. Default is 100. | 641 retrieve additional records. Default is 100. |
| 621 | 642 |
| 622 :type marker: str | 643 :type marker: str |
| 623 :param marker: The marker provided by a previous request. | 644 :param marker: The marker provided by a previous request. |
| 624 | 645 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 646 | 667 |
| 647 :type description: string | 668 :type description: string |
| 648 :param description: The description of the new security group | 669 :param description: The description of the new security group |
| 649 | 670 |
| 650 :rtype: :class:`boto.rds.dbsecuritygroup.DBSecurityGroup` | 671 :rtype: :class:`boto.rds.dbsecuritygroup.DBSecurityGroup` |
| 651 :return: The newly created DBSecurityGroup | 672 :return: The newly created DBSecurityGroup |
| 652 """ | 673 """ |
| 653 params = {'DBSecurityGroupName':name} | 674 params = {'DBSecurityGroupName':name} |
| 654 if description: | 675 if description: |
| 655 params['DBSecurityGroupDescription'] = description | 676 params['DBSecurityGroupDescription'] = description |
| 656 group = self.get_object('CreateDBSecurityGroup', params, DBSecurityGroup
) | 677 group = self.get_object('CreateDBSecurityGroup', params, |
| 678 DBSecurityGroup) |
| 657 group.name = name | 679 group.name = name |
| 658 group.description = description | 680 group.description = description |
| 659 return group | 681 return group |
| 660 | 682 |
| 661 def delete_dbsecurity_group(self, name): | 683 def delete_dbsecurity_group(self, name): |
| 662 """ | 684 """ |
| 663 Delete a DBSecurityGroup from your account. | 685 Delete a DBSecurityGroup from your account. |
| 664 | 686 |
| 665 :type key_name: string | 687 :type key_name: string |
| 666 :param key_name: The name of the DBSecurityGroup to delete | 688 :param key_name: The name of the DBSecurityGroup to delete |
| 667 """ | 689 """ |
| 668 params = {'DBSecurityGroupName':name} | 690 params = {'DBSecurityGroupName':name} |
| 669 return self.get_status('DeleteDBSecurityGroup', params) | 691 return self.get_status('DeleteDBSecurityGroup', params) |
| 670 | 692 |
| 671 def authorize_dbsecurity_group(self, group_name, cidr_ip=None, | 693 def authorize_dbsecurity_group(self, group_name, cidr_ip=None, |
| 672 ec2_security_group_name=None, | 694 ec2_security_group_name=None, |
| 673 ec2_security_group_owner_id=None): | 695 ec2_security_group_owner_id=None): |
| 674 """ | 696 """ |
| 675 Add a new rule to an existing security group. | 697 Add a new rule to an existing security group. |
| 676 You need to pass in either src_security_group_name and | 698 You need to pass in either src_security_group_name and |
| 677 src_security_group_owner_id OR a CIDR block but not both. | 699 src_security_group_owner_id OR a CIDR block but not both. |
| 678 | 700 |
| 679 :type group_name: string | 701 :type group_name: string |
| 680 :param group_name: The name of the security group you are adding | 702 :param group_name: The name of the security group you are adding |
| 681 the rule to. | 703 the rule to. |
| 682 | 704 |
| 683 :type ec2_security_group_name: string | 705 :type ec2_security_group_name: string |
| 684 :param ec2_security_group_name: The name of the EC2 security group you a
re | 706 :param ec2_security_group_name: The name of the EC2 security group |
| 685 granting access to. | 707 you are granting access to. |
| 686 | 708 |
| 687 :type ec2_security_group_owner_id: string | 709 :type ec2_security_group_owner_id: string |
| 688 :param ec2_security_group_owner_id: The ID of the owner of the EC2 secur
ity | 710 :param ec2_security_group_owner_id: The ID of the owner of the EC2 |
| 689 group you are granting access to. | 711 security group you are granting |
| 712 access to. |
| 690 | 713 |
| 691 :type cidr_ip: string | 714 :type cidr_ip: string |
| 692 :param cidr_ip: The CIDR block you are providing access to. | 715 :param cidr_ip: The CIDR block you are providing access to. |
| 693 See http://en.wikipedia.org/wiki/Classless_Inter-Domain_
Routing | 716 See http://en.wikipedia.org/wiki/Classless_Inter-Domain_
Routing |
| 694 | 717 |
| 695 :rtype: bool | 718 :rtype: bool |
| 696 :return: True if successful. | 719 :return: True if successful. |
| 697 """ | 720 """ |
| 698 params = {'DBSecurityGroupName':group_name} | 721 params = {'DBSecurityGroupName':group_name} |
| 699 if ec2_security_group_name: | 722 if ec2_security_group_name: |
| 700 params['EC2SecurityGroupName'] = ec2_security_group_name | 723 params['EC2SecurityGroupName'] = ec2_security_group_name |
| 701 if ec2_security_group_owner_id: | 724 if ec2_security_group_owner_id: |
| 702 params['EC2SecurityGroupOwnerId'] = ec2_security_group_owner_id | 725 params['EC2SecurityGroupOwnerId'] = ec2_security_group_owner_id |
| 703 if cidr_ip: | 726 if cidr_ip: |
| 704 params['CIDRIP'] = urllib.quote(cidr_ip) | 727 params['CIDRIP'] = urllib.quote(cidr_ip) |
| 705 return self.get_object('AuthorizeDBSecurityGroupIngress', params, DBSecu
rityGroup) | 728 return self.get_object('AuthorizeDBSecurityGroupIngress', params, |
| 729 DBSecurityGroup) |
| 706 | 730 |
| 707 def revoke_dbsecurity_group(self, group_name, ec2_security_group_name=None, | 731 def revoke_dbsecurity_group(self, group_name, ec2_security_group_name=None, |
| 708 ec2_security_group_owner_id=None, cidr_ip=None): | 732 ec2_security_group_owner_id=None, cidr_ip=None): |
| 709 """ | 733 """ |
| 710 Remove an existing rule from an existing security group. | 734 Remove an existing rule from an existing security group. |
| 711 You need to pass in either ec2_security_group_name and | 735 You need to pass in either ec2_security_group_name and |
| 712 ec2_security_group_owner_id OR a CIDR block. | 736 ec2_security_group_owner_id OR a CIDR block. |
| 713 | 737 |
| 714 :type group_name: string | 738 :type group_name: string |
| 715 :param group_name: The name of the security group you are removing | 739 :param group_name: The name of the security group you are removing |
| 716 the rule from. | 740 the rule from. |
| 717 | 741 |
| 718 :type ec2_security_group_name: string | 742 :type ec2_security_group_name: string |
| 719 :param ec2_security_group_name: The name of the EC2 security group from
which | 743 :param ec2_security_group_name: The name of the EC2 security group |
| 720 you are removing access. | 744 from which you are removing access. |
| 721 | 745 |
| 722 :type ec2_security_group_owner_id: string | 746 :type ec2_security_group_owner_id: string |
| 723 :param ec2_security_group_owner_id: The ID of the owner of the EC2 secur
ity | 747 :param ec2_security_group_owner_id: The ID of the owner of the EC2 |
| 724 from which you are removing access. | 748 security from which you are |
| 749 removing access. |
| 725 | 750 |
| 726 :type cidr_ip: string | 751 :type cidr_ip: string |
| 727 :param cidr_ip: The CIDR block from which you are removing access. | 752 :param cidr_ip: The CIDR block from which you are removing access. |
| 728 See http://en.wikipedia.org/wiki/Classless_Inter-Domain_
Routing | 753 See http://en.wikipedia.org/wiki/Classless_Inter-Domain_
Routing |
| 729 | 754 |
| 730 :rtype: bool | 755 :rtype: bool |
| 731 :return: True if successful. | 756 :return: True if successful. |
| 732 """ | 757 """ |
| 733 params = {'DBSecurityGroupName':group_name} | 758 params = {'DBSecurityGroupName':group_name} |
| 734 if ec2_security_group_name: | 759 if ec2_security_group_name: |
| 735 params['EC2SecurityGroupName'] = ec2_security_group_name | 760 params['EC2SecurityGroupName'] = ec2_security_group_name |
| 736 if ec2_security_group_owner_id: | 761 if ec2_security_group_owner_id: |
| 737 params['EC2SecurityGroupOwnerId'] = ec2_security_group_owner_id | 762 params['EC2SecurityGroupOwnerId'] = ec2_security_group_owner_id |
| 738 if cidr_ip: | 763 if cidr_ip: |
| 739 params['CIDRIP'] = cidr_ip | 764 params['CIDRIP'] = cidr_ip |
| 740 return self.get_object('RevokeDBSecurityGroupIngress', params, DBSecurit
yGroup) | 765 return self.get_object('RevokeDBSecurityGroupIngress', params, |
| 766 DBSecurityGroup) |
| 741 | 767 |
| 742 # For backwards compatibility. This method was improperly named | 768 # For backwards compatibility. This method was improperly named |
| 743 # in previous versions. I have renamed it to match the others. | 769 # in previous versions. I have renamed it to match the others. |
| 744 revoke_security_group = revoke_dbsecurity_group | 770 revoke_security_group = revoke_dbsecurity_group |
| 745 | 771 |
| 746 # DBSnapshot methods | 772 # DBSnapshot methods |
| 747 | 773 |
| 748 def get_all_dbsnapshots(self, snapshot_id=None, instance_id=None, | 774 def get_all_dbsnapshots(self, snapshot_id=None, instance_id=None, |
| 749 max_records=None, marker=None): | 775 max_records=None, marker=None): |
| 750 """ | 776 """ |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 Create a new DBInstance from a DB snapshot. | 846 Create a new DBInstance from a DB snapshot. |
| 821 | 847 |
| 822 :type identifier: string | 848 :type identifier: string |
| 823 :param identifier: The identifier for the DBSnapshot | 849 :param identifier: The identifier for the DBSnapshot |
| 824 | 850 |
| 825 :type instance_id: string | 851 :type instance_id: string |
| 826 :param instance_id: The source identifier for the RDS instance from | 852 :param instance_id: The source identifier for the RDS instance from |
| 827 which the snapshot is created. | 853 which the snapshot is created. |
| 828 | 854 |
| 829 :type instance_class: str | 855 :type instance_class: str |
| 830 :param instance_class: The compute and memory capacity of the DBInstance
. | 856 :param instance_class: The compute and memory capacity of the |
| 831 Valid values are: | 857 DBInstance. Valid values are: |
| 832 db.m1.small | db.m1.large | db.m1.xlarge | | 858 db.m1.small | db.m1.large | db.m1.xlarge | |
| 833 db.m2.2xlarge | db.m2.4xlarge | 859 db.m2.2xlarge | db.m2.4xlarge |
| 834 | 860 |
| 835 :type port: int | 861 :type port: int |
| 836 :param port: Port number on which database accepts connections. | 862 :param port: Port number on which database accepts connections. |
| 837 Valid values [1115-65535]. Defaults to 3306. | 863 Valid values [1115-65535]. Defaults to 3306. |
| 838 | 864 |
| 839 :type availability_zone: str | 865 :type availability_zone: str |
| 840 :param availability_zone: Name of the availability zone to place | 866 :param availability_zone: Name of the availability zone to place |
| 841 DBInstance into. | 867 DBInstance into. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 872 | 898 |
| 873 :type use_latest: bool | 899 :type use_latest: bool |
| 874 :param use_latest: If True, the latest snapshot availabile will | 900 :param use_latest: If True, the latest snapshot availabile will |
| 875 be used. | 901 be used. |
| 876 | 902 |
| 877 :type restore_time: datetime | 903 :type restore_time: datetime |
| 878 :param restore_time: The date and time to restore from. Only | 904 :param restore_time: The date and time to restore from. Only |
| 879 used if use_latest is False. | 905 used if use_latest is False. |
| 880 | 906 |
| 881 :type instance_class: str | 907 :type instance_class: str |
| 882 :param instance_class: The compute and memory capacity of the DBInstance
. | 908 :param instance_class: The compute and memory capacity of the |
| 883 Valid values are: | 909 DBInstance. Valid values are: |
| 884 db.m1.small | db.m1.large | db.m1.xlarge | | 910 db.m1.small | db.m1.large | db.m1.xlarge | |
| 885 db.m2.2xlarge | db.m2.4xlarge | 911 db.m2.2xlarge | db.m2.4xlarge |
| 886 | 912 |
| 887 :type port: int | 913 :type port: int |
| 888 :param port: Port number on which database accepts connections. | 914 :param port: Port number on which database accepts connections. |
| 889 Valid values [1115-65535]. Defaults to 3306. | 915 Valid values [1115-65535]. Defaults to 3306. |
| 890 | 916 |
| 891 :type availability_zone: str | 917 :type availability_zone: str |
| 892 :param availability_zone: Name of the availability zone to place | 918 :param availability_zone: Name of the availability zone to place |
| 893 DBInstance into. | 919 DBInstance into. |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 963 params['StartTime'] = start_time.isoformat() | 989 params['StartTime'] = start_time.isoformat() |
| 964 if end_time: | 990 if end_time: |
| 965 params['EndTime'] = end_time.isoformat() | 991 params['EndTime'] = end_time.isoformat() |
| 966 if max_records: | 992 if max_records: |
| 967 params['MaxRecords'] = max_records | 993 params['MaxRecords'] = max_records |
| 968 if marker: | 994 if marker: |
| 969 params['Marker'] = marker | 995 params['Marker'] = marker |
| 970 return self.get_list('DescribeEvents', params, [('Event', Event)]) | 996 return self.get_list('DescribeEvents', params, [('Event', Event)]) |
| 971 | 997 |
| 972 | 998 |
| OLD | NEW |