Mercurial > repos > guerler > springsuite
comparison planemo/lib/python3.7/site-packages/boto/rds2/layer1.py @ 0:d30785e31577 draft
"planemo upload commit 6eee67778febed82ddd413c3ca40b3183a3898f1"
| author | guerler | 
|---|---|
| date | Fri, 31 Jul 2020 00:18:57 -0400 | 
| parents | |
| children | 
   comparison
  equal
  deleted
  inserted
  replaced
| -1:000000000000 | 0:d30785e31577 | 
|---|---|
| 1 # Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved | |
| 2 # | |
| 3 # Permission is hereby granted, free of charge, to any person obtaining a | |
| 4 # copy of this software and associated documentation files (the | |
| 5 # "Software"), to deal in the Software without restriction, including | |
| 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 | |
| 8 # persons to whom the Software is furnished to do so, subject to the fol- | |
| 9 # lowing conditions: | |
| 10 # | |
| 11 # The above copyright notice and this permission notice shall be included | |
| 12 # in all copies or substantial portions of the Software. | |
| 13 # | |
| 14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | |
| 15 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- | |
| 16 # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT | |
| 17 # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | |
| 18 # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
| 19 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
| 20 # IN THE SOFTWARE. | |
| 21 # | |
| 22 | |
| 23 import boto | |
| 24 from boto.connection import AWSQueryConnection | |
| 25 from boto.regioninfo import RegionInfo | |
| 26 from boto.exception import JSONResponseError | |
| 27 from boto.rds2 import exceptions | |
| 28 from boto.compat import json | |
| 29 | |
| 30 | |
| 31 class RDSConnection(AWSQueryConnection): | |
| 32 """ | |
| 33 Amazon Relational Database Service | |
| 34 Amazon Relational Database Service (Amazon RDS) is a web service | |
| 35 that makes it easier to set up, operate, and scale a relational | |
| 36 database in the cloud. It provides cost-efficient, resizable | |
| 37 capacity for an industry-standard relational database and manages | |
| 38 common database administration tasks, freeing up developers to | |
| 39 focus on what makes their applications and businesses unique. | |
| 40 | |
| 41 Amazon RDS gives you access to the capabilities of a familiar | |
| 42 MySQL or Oracle database server. This means the code, | |
| 43 applications, and tools you already use today with your existing | |
| 44 MySQL or Oracle databases work with Amazon RDS without | |
| 45 modification. Amazon RDS automatically backs up your database and | |
| 46 maintains the database software that powers your DB instance. | |
| 47 Amazon RDS is flexible: you can scale your database instance's | |
| 48 compute resources and storage capacity to meet your application's | |
| 49 demand. As with all Amazon Web Services, there are no up-front | |
| 50 investments, and you pay only for the resources you use. | |
| 51 | |
| 52 This is the Amazon RDS API Reference . It contains a comprehensive | |
| 53 description of all Amazon RDS Query APIs and data types. Note that | |
| 54 this API is asynchronous and some actions may require polling to | |
| 55 determine when an action has been applied. See the parameter | |
| 56 description to determine if a change is applied immediately or on | |
| 57 the next instance reboot or during the maintenance window. For | |
| 58 more information on Amazon RDS concepts and usage scenarios, go to | |
| 59 the `Amazon RDS User Guide`_. | |
| 60 """ | |
| 61 APIVersion = "2013-09-09" | |
| 62 DefaultRegionName = "us-east-1" | |
| 63 DefaultRegionEndpoint = "rds.us-east-1.amazonaws.com" | |
| 64 ResponseError = JSONResponseError | |
| 65 | |
| 66 _faults = { | |
| 67 "InvalidSubnet": exceptions.InvalidSubnet, | |
| 68 "DBParameterGroupQuotaExceeded": exceptions.DBParameterGroupQuotaExceeded, | |
| 69 "DBSubnetGroupAlreadyExists": exceptions.DBSubnetGroupAlreadyExists, | |
| 70 "DBSubnetGroupQuotaExceeded": exceptions.DBSubnetGroupQuotaExceeded, | |
| 71 "InstanceQuotaExceeded": exceptions.InstanceQuotaExceeded, | |
| 72 "InvalidRestore": exceptions.InvalidRestore, | |
| 73 "InvalidDBParameterGroupState": exceptions.InvalidDBParameterGroupState, | |
| 74 "AuthorizationQuotaExceeded": exceptions.AuthorizationQuotaExceeded, | |
| 75 "DBSecurityGroupAlreadyExists": exceptions.DBSecurityGroupAlreadyExists, | |
| 76 "InsufficientDBInstanceCapacity": exceptions.InsufficientDBInstanceCapacity, | |
| 77 "ReservedDBInstanceQuotaExceeded": exceptions.ReservedDBInstanceQuotaExceeded, | |
| 78 "DBSecurityGroupNotFound": exceptions.DBSecurityGroupNotFound, | |
| 79 "DBInstanceAlreadyExists": exceptions.DBInstanceAlreadyExists, | |
| 80 "ReservedDBInstanceNotFound": exceptions.ReservedDBInstanceNotFound, | |
| 81 "DBSubnetGroupDoesNotCoverEnoughAZs": exceptions.DBSubnetGroupDoesNotCoverEnoughAZs, | |
| 82 "InvalidDBSecurityGroupState": exceptions.InvalidDBSecurityGroupState, | |
| 83 "InvalidVPCNetworkState": exceptions.InvalidVPCNetworkState, | |
| 84 "ReservedDBInstancesOfferingNotFound": exceptions.ReservedDBInstancesOfferingNotFound, | |
| 85 "SNSTopicArnNotFound": exceptions.SNSTopicArnNotFound, | |
| 86 "SNSNoAuthorization": exceptions.SNSNoAuthorization, | |
| 87 "SnapshotQuotaExceeded": exceptions.SnapshotQuotaExceeded, | |
| 88 "OptionGroupQuotaExceeded": exceptions.OptionGroupQuotaExceeded, | |
| 89 "DBParameterGroupNotFound": exceptions.DBParameterGroupNotFound, | |
| 90 "SNSInvalidTopic": exceptions.SNSInvalidTopic, | |
| 91 "InvalidDBSubnetGroupState": exceptions.InvalidDBSubnetGroupState, | |
| 92 "DBSubnetGroupNotFound": exceptions.DBSubnetGroupNotFound, | |
| 93 "InvalidOptionGroupState": exceptions.InvalidOptionGroupState, | |
| 94 "SourceNotFound": exceptions.SourceNotFound, | |
| 95 "SubscriptionCategoryNotFound": exceptions.SubscriptionCategoryNotFound, | |
| 96 "EventSubscriptionQuotaExceeded": exceptions.EventSubscriptionQuotaExceeded, | |
| 97 "DBSecurityGroupNotSupported": exceptions.DBSecurityGroupNotSupported, | |
| 98 "InvalidEventSubscriptionState": exceptions.InvalidEventSubscriptionState, | |
| 99 "InvalidDBSubnetState": exceptions.InvalidDBSubnetState, | |
| 100 "InvalidDBSnapshotState": exceptions.InvalidDBSnapshotState, | |
| 101 "SubscriptionAlreadyExist": exceptions.SubscriptionAlreadyExist, | |
| 102 "DBSecurityGroupQuotaExceeded": exceptions.DBSecurityGroupQuotaExceeded, | |
| 103 "ProvisionedIopsNotAvailableInAZ": exceptions.ProvisionedIopsNotAvailableInAZ, | |
| 104 "AuthorizationNotFound": exceptions.AuthorizationNotFound, | |
| 105 "OptionGroupAlreadyExists": exceptions.OptionGroupAlreadyExists, | |
| 106 "SubscriptionNotFound": exceptions.SubscriptionNotFound, | |
| 107 "DBUpgradeDependencyFailure": exceptions.DBUpgradeDependencyFailure, | |
| 108 "PointInTimeRestoreNotEnabled": exceptions.PointInTimeRestoreNotEnabled, | |
| 109 "AuthorizationAlreadyExists": exceptions.AuthorizationAlreadyExists, | |
| 110 "DBSubnetQuotaExceeded": exceptions.DBSubnetQuotaExceeded, | |
| 111 "OptionGroupNotFound": exceptions.OptionGroupNotFound, | |
| 112 "DBParameterGroupAlreadyExists": exceptions.DBParameterGroupAlreadyExists, | |
| 113 "DBInstanceNotFound": exceptions.DBInstanceNotFound, | |
| 114 "ReservedDBInstanceAlreadyExists": exceptions.ReservedDBInstanceAlreadyExists, | |
| 115 "InvalidDBInstanceState": exceptions.InvalidDBInstanceState, | |
| 116 "DBSnapshotNotFound": exceptions.DBSnapshotNotFound, | |
| 117 "DBSnapshotAlreadyExists": exceptions.DBSnapshotAlreadyExists, | |
| 118 "StorageQuotaExceeded": exceptions.StorageQuotaExceeded, | |
| 119 "SubnetAlreadyInUse": exceptions.SubnetAlreadyInUse, | |
| 120 } | |
| 121 | |
| 122 | |
| 123 def __init__(self, **kwargs): | |
| 124 region = kwargs.pop('region', None) | |
| 125 if not region: | |
| 126 region = RegionInfo(self, self.DefaultRegionName, | |
| 127 self.DefaultRegionEndpoint) | |
| 128 | |
| 129 if 'host' not in kwargs: | |
| 130 kwargs['host'] = region.endpoint | |
| 131 | |
| 132 super(RDSConnection, self).__init__(**kwargs) | |
| 133 self.region = region | |
| 134 | |
| 135 def _required_auth_capability(self): | |
| 136 return ['hmac-v4'] | |
| 137 | |
| 138 def add_source_identifier_to_subscription(self, subscription_name, | |
| 139 source_identifier): | |
| 140 """ | |
| 141 Adds a source identifier to an existing RDS event notification | |
| 142 subscription. | |
| 143 | |
| 144 :type subscription_name: string | |
| 145 :param subscription_name: The name of the RDS event notification | |
| 146 subscription you want to add a source identifier to. | |
| 147 | |
| 148 :type source_identifier: string | |
| 149 :param source_identifier: | |
| 150 The identifier of the event source to be added. An identifier must | |
| 151 begin with a letter and must contain only ASCII letters, digits, | |
| 152 and hyphens; it cannot end with a hyphen or contain two consecutive | |
| 153 hyphens. | |
| 154 | |
| 155 Constraints: | |
| 156 | |
| 157 | |
| 158 + If the source type is a DB instance, then a `DBInstanceIdentifier` | |
| 159 must be supplied. | |
| 160 + If the source type is a DB security group, a `DBSecurityGroupName` | |
| 161 must be supplied. | |
| 162 + If the source type is a DB parameter group, a `DBParameterGroupName` | |
| 163 must be supplied. | |
| 164 + If the source type is a DB snapshot, a `DBSnapshotIdentifier` must be | |
| 165 supplied. | |
| 166 | |
| 167 """ | |
| 168 params = { | |
| 169 'SubscriptionName': subscription_name, | |
| 170 'SourceIdentifier': source_identifier, | |
| 171 } | |
| 172 return self._make_request( | |
| 173 action='AddSourceIdentifierToSubscription', | |
| 174 verb='POST', | |
| 175 path='/', params=params) | |
| 176 | |
| 177 def add_tags_to_resource(self, resource_name, tags): | |
| 178 """ | |
| 179 Adds metadata tags to an Amazon RDS resource. These tags can | |
| 180 also be used with cost allocation reporting to track cost | |
| 181 associated with Amazon RDS resources, or used in Condition | |
| 182 statement in IAM policy for Amazon RDS. | |
| 183 | |
| 184 For an overview on tagging Amazon RDS resources, see `Tagging | |
| 185 Amazon RDS Resources`_. | |
| 186 | |
| 187 :type resource_name: string | |
| 188 :param resource_name: The Amazon RDS resource the tags will be added | |
| 189 to. This value is an Amazon Resource Name (ARN). For information | |
| 190 about creating an ARN, see ` Constructing an RDS Amazon Resource | |
| 191 Name (ARN)`_. | |
| 192 | |
| 193 :type tags: list | |
| 194 :param tags: The tags to be assigned to the Amazon RDS resource. | |
| 195 Tags must be passed as tuples in the form | |
| 196 [('key1', 'valueForKey1'), ('key2', 'valueForKey2')] | |
| 197 | |
| 198 """ | |
| 199 params = {'ResourceName': resource_name, } | |
| 200 self.build_complex_list_params( | |
| 201 params, tags, | |
| 202 'Tags.member', | |
| 203 ('Key', 'Value')) | |
| 204 return self._make_request( | |
| 205 action='AddTagsToResource', | |
| 206 verb='POST', | |
| 207 path='/', params=params) | |
| 208 | |
| 209 def authorize_db_security_group_ingress(self, db_security_group_name, | |
| 210 cidrip=None, | |
| 211 ec2_security_group_name=None, | |
| 212 ec2_security_group_id=None, | |
| 213 ec2_security_group_owner_id=None): | |
| 214 """ | |
| 215 Enables ingress to a DBSecurityGroup using one of two forms of | |
| 216 authorization. First, EC2 or VPC security groups can be added | |
| 217 to the DBSecurityGroup if the application using the database | |
| 218 is running on EC2 or VPC instances. Second, IP ranges are | |
| 219 available if the application accessing your database is | |
| 220 running on the Internet. Required parameters for this API are | |
| 221 one of CIDR range, EC2SecurityGroupId for VPC, or | |
| 222 (EC2SecurityGroupOwnerId and either EC2SecurityGroupName or | |
| 223 EC2SecurityGroupId for non-VPC). | |
| 224 You cannot authorize ingress from an EC2 security group in one | |
| 225 Region to an Amazon RDS DB instance in another. You cannot | |
| 226 authorize ingress from a VPC security group in one VPC to an | |
| 227 Amazon RDS DB instance in another. | |
| 228 For an overview of CIDR ranges, go to the `Wikipedia | |
| 229 Tutorial`_. | |
| 230 | |
| 231 :type db_security_group_name: string | |
| 232 :param db_security_group_name: The name of the DB security group to add | |
| 233 authorization to. | |
| 234 | |
| 235 :type cidrip: string | |
| 236 :param cidrip: The IP range to authorize. | |
| 237 | |
| 238 :type ec2_security_group_name: string | |
| 239 :param ec2_security_group_name: Name of the EC2 security group to | |
| 240 authorize. For VPC DB security groups, `EC2SecurityGroupId` must be | |
| 241 provided. Otherwise, EC2SecurityGroupOwnerId and either | |
| 242 `EC2SecurityGroupName` or `EC2SecurityGroupId` must be provided. | |
| 243 | |
| 244 :type ec2_security_group_id: string | |
| 245 :param ec2_security_group_id: Id of the EC2 security group to | |
| 246 authorize. For VPC DB security groups, `EC2SecurityGroupId` must be | |
| 247 provided. Otherwise, EC2SecurityGroupOwnerId and either | |
| 248 `EC2SecurityGroupName` or `EC2SecurityGroupId` must be provided. | |
| 249 | |
| 250 :type ec2_security_group_owner_id: string | |
| 251 :param ec2_security_group_owner_id: AWS Account Number of the owner of | |
| 252 the EC2 security group specified in the EC2SecurityGroupName | |
| 253 parameter. The AWS Access Key ID is not an acceptable value. For | |
| 254 VPC DB security groups, `EC2SecurityGroupId` must be provided. | |
| 255 Otherwise, EC2SecurityGroupOwnerId and either | |
| 256 `EC2SecurityGroupName` or `EC2SecurityGroupId` must be provided. | |
| 257 | |
| 258 """ | |
| 259 params = {'DBSecurityGroupName': db_security_group_name, } | |
| 260 if cidrip is not None: | |
| 261 params['CIDRIP'] = cidrip | |
| 262 if ec2_security_group_name is not None: | |
| 263 params['EC2SecurityGroupName'] = ec2_security_group_name | |
| 264 if ec2_security_group_id is not None: | |
| 265 params['EC2SecurityGroupId'] = ec2_security_group_id | |
| 266 if ec2_security_group_owner_id is not None: | |
| 267 params['EC2SecurityGroupOwnerId'] = ec2_security_group_owner_id | |
| 268 return self._make_request( | |
| 269 action='AuthorizeDBSecurityGroupIngress', | |
| 270 verb='POST', | |
| 271 path='/', params=params) | |
| 272 | |
| 273 def copy_db_snapshot(self, source_db_snapshot_identifier, | |
| 274 target_db_snapshot_identifier, tags=None): | |
| 275 """ | |
| 276 Copies the specified DBSnapshot. The source DBSnapshot must be | |
| 277 in the "available" state. | |
| 278 | |
| 279 :type source_db_snapshot_identifier: string | |
| 280 :param source_db_snapshot_identifier: The identifier for the source DB | |
| 281 snapshot. | |
| 282 Constraints: | |
| 283 | |
| 284 | |
| 285 + Must be the identifier for a valid system snapshot in the "available" | |
| 286 state. | |
| 287 | |
| 288 | |
| 289 Example: `rds:mydb-2012-04-02-00-01` | |
| 290 | |
| 291 :type target_db_snapshot_identifier: string | |
| 292 :param target_db_snapshot_identifier: The identifier for the copied | |
| 293 snapshot. | |
| 294 Constraints: | |
| 295 | |
| 296 | |
| 297 + Cannot be null, empty, or blank | |
| 298 + Must contain from 1 to 255 alphanumeric characters or hyphens | |
| 299 + First character must be a letter | |
| 300 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 301 | |
| 302 | |
| 303 Example: `my-db-snapshot` | |
| 304 | |
| 305 :type tags: list | |
| 306 :param tags: A list of tags. Tags must be passed as tuples in the form | |
| 307 [('key1', 'valueForKey1'), ('key2', 'valueForKey2')] | |
| 308 """ | |
| 309 params = { | |
| 310 'SourceDBSnapshotIdentifier': source_db_snapshot_identifier, | |
| 311 'TargetDBSnapshotIdentifier': target_db_snapshot_identifier, | |
| 312 } | |
| 313 if tags is not None: | |
| 314 self.build_complex_list_params( | |
| 315 params, tags, | |
| 316 'Tags.member', | |
| 317 ('Key', 'Value')) | |
| 318 return self._make_request( | |
| 319 action='CopyDBSnapshot', | |
| 320 verb='POST', | |
| 321 path='/', params=params) | |
| 322 | |
| 323 def create_db_instance(self, db_instance_identifier, allocated_storage, | |
| 324 db_instance_class, engine, master_username, | |
| 325 master_user_password, db_name=None, | |
| 326 db_security_groups=None, | |
| 327 vpc_security_group_ids=None, | |
| 328 availability_zone=None, db_subnet_group_name=None, | |
| 329 preferred_maintenance_window=None, | |
| 330 db_parameter_group_name=None, | |
| 331 backup_retention_period=None, | |
| 332 preferred_backup_window=None, port=None, | |
| 333 multi_az=None, engine_version=None, | |
| 334 auto_minor_version_upgrade=None, | |
| 335 license_model=None, iops=None, | |
| 336 option_group_name=None, character_set_name=None, | |
| 337 publicly_accessible=None, tags=None): | |
| 338 """ | |
| 339 Creates a new DB instance. | |
| 340 | |
| 341 :type db_name: string | |
| 342 :param db_name: The meaning of this parameter differs according to the | |
| 343 database engine you use. | |
| 344 **MySQL** | |
| 345 | |
| 346 The name of the database to create when the DB instance is created. If | |
| 347 this parameter is not specified, no database is created in the DB | |
| 348 instance. | |
| 349 | |
| 350 Constraints: | |
| 351 | |
| 352 | |
| 353 + Must contain 1 to 64 alphanumeric characters | |
| 354 + Cannot be a word reserved by the specified database engine | |
| 355 | |
| 356 | |
| 357 Type: String | |
| 358 | |
| 359 **Oracle** | |
| 360 | |
| 361 The Oracle System ID (SID) of the created DB instance. | |
| 362 | |
| 363 Default: `ORCL` | |
| 364 | |
| 365 Constraints: | |
| 366 | |
| 367 | |
| 368 + Cannot be longer than 8 characters | |
| 369 | |
| 370 | |
| 371 **SQL Server** | |
| 372 | |
| 373 Not applicable. Must be null. | |
| 374 | |
| 375 :type db_instance_identifier: string | |
| 376 :param db_instance_identifier: The DB instance identifier. This | |
| 377 parameter is stored as a lowercase string. | |
| 378 Constraints: | |
| 379 | |
| 380 | |
| 381 + Must contain from 1 to 63 alphanumeric characters or hyphens (1 to 15 | |
| 382 for SQL Server). | |
| 383 + First character must be a letter. | |
| 384 + Cannot end with a hyphen or contain two consecutive hyphens. | |
| 385 | |
| 386 | |
| 387 Example: `mydbinstance` | |
| 388 | |
| 389 :type allocated_storage: integer | |
| 390 :param allocated_storage: The amount of storage (in gigabytes) to be | |
| 391 initially allocated for the database instance. | |
| 392 **MySQL** | |
| 393 | |
| 394 Constraints: Must be an integer from 5 to 1024. | |
| 395 | |
| 396 Type: Integer | |
| 397 | |
| 398 **Oracle** | |
| 399 | |
| 400 Constraints: Must be an integer from 10 to 1024. | |
| 401 | |
| 402 **SQL Server** | |
| 403 | |
| 404 Constraints: Must be an integer from 200 to 1024 (Standard Edition and | |
| 405 Enterprise Edition) or from 30 to 1024 (Express Edition and Web | |
| 406 Edition) | |
| 407 | |
| 408 :type db_instance_class: string | |
| 409 :param db_instance_class: The compute and memory capacity of the DB | |
| 410 instance. | |
| 411 Valid Values: `db.t1.micro | db.m1.small | db.m1.medium | db.m1.large | | |
| 412 db.m1.xlarge | db.m2.xlarge |db.m2.2xlarge | db.m2.4xlarge` | |
| 413 | |
| 414 :type engine: string | |
| 415 :param engine: The name of the database engine to be used for this | |
| 416 instance. | |
| 417 Valid Values: `MySQL` | `oracle-se1` | `oracle-se` | `oracle-ee` | | |
| 418 `sqlserver-ee` | `sqlserver-se` | `sqlserver-ex` | `sqlserver-web` | |
| 419 | |
| 420 :type master_username: string | |
| 421 :param master_username: | |
| 422 The name of master user for the client DB instance. | |
| 423 | |
| 424 **MySQL** | |
| 425 | |
| 426 Constraints: | |
| 427 | |
| 428 | |
| 429 + Must be 1 to 16 alphanumeric characters. | |
| 430 + First character must be a letter. | |
| 431 + Cannot be a reserved word for the chosen database engine. | |
| 432 | |
| 433 | |
| 434 Type: String | |
| 435 | |
| 436 **Oracle** | |
| 437 | |
| 438 Constraints: | |
| 439 | |
| 440 | |
| 441 + Must be 1 to 30 alphanumeric characters. | |
| 442 + First character must be a letter. | |
| 443 + Cannot be a reserved word for the chosen database engine. | |
| 444 | |
| 445 | |
| 446 **SQL Server** | |
| 447 | |
| 448 Constraints: | |
| 449 | |
| 450 | |
| 451 + Must be 1 to 128 alphanumeric characters. | |
| 452 + First character must be a letter. | |
| 453 + Cannot be a reserved word for the chosen database engine. | |
| 454 | |
| 455 :type master_user_password: string | |
| 456 :param master_user_password: The password for the master database user. | |
| 457 Can be any printable ASCII character except "/", '"', or "@". | |
| 458 Type: String | |
| 459 | |
| 460 **MySQL** | |
| 461 | |
| 462 Constraints: Must contain from 8 to 41 characters. | |
| 463 | |
| 464 **Oracle** | |
| 465 | |
| 466 Constraints: Must contain from 8 to 30 characters. | |
| 467 | |
| 468 **SQL Server** | |
| 469 | |
| 470 Constraints: Must contain from 8 to 128 characters. | |
| 471 | |
| 472 :type db_security_groups: list | |
| 473 :param db_security_groups: A list of DB security groups to associate | |
| 474 with this DB instance. | |
| 475 Default: The default DB security group for the database engine. | |
| 476 | |
| 477 :type vpc_security_group_ids: list | |
| 478 :param vpc_security_group_ids: A list of EC2 VPC security groups to | |
| 479 associate with this DB instance. | |
| 480 Default: The default EC2 VPC security group for the DB subnet group's | |
| 481 VPC. | |
| 482 | |
| 483 :type availability_zone: string | |
| 484 :param availability_zone: The EC2 Availability Zone that the database | |
| 485 instance will be created in. | |
| 486 Default: A random, system-chosen Availability Zone in the endpoint's | |
| 487 region. | |
| 488 | |
| 489 Example: `us-east-1d` | |
| 490 | |
| 491 Constraint: The AvailabilityZone parameter cannot be specified if the | |
| 492 MultiAZ parameter is set to `True`. The specified Availability Zone | |
| 493 must be in the same region as the current endpoint. | |
| 494 | |
| 495 :type db_subnet_group_name: string | |
| 496 :param db_subnet_group_name: A DB subnet group to associate with this | |
| 497 DB instance. | |
| 498 If there is no DB subnet group, then it is a non-VPC DB instance. | |
| 499 | |
| 500 :type preferred_maintenance_window: string | |
| 501 :param preferred_maintenance_window: The weekly time range (in UTC) | |
| 502 during which system maintenance can occur. | |
| 503 Format: `ddd:hh24:mi-ddd:hh24:mi` | |
| 504 | |
| 505 Default: A 30-minute window selected at random from an 8-hour block of | |
| 506 time per region, occurring on a random day of the week. To see the | |
| 507 time blocks available, see ` Adjusting the Preferred Maintenance | |
| 508 Window`_ in the Amazon RDS User Guide. | |
| 509 | |
| 510 Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun | |
| 511 | |
| 512 Constraints: Minimum 30-minute window. | |
| 513 | |
| 514 :type db_parameter_group_name: string | |
| 515 :param db_parameter_group_name: | |
| 516 The name of the DB parameter group to associate with this DB instance. | |
| 517 If this argument is omitted, the default DBParameterGroup for the | |
| 518 specified engine will be used. | |
| 519 | |
| 520 Constraints: | |
| 521 | |
| 522 | |
| 523 + Must be 1 to 255 alphanumeric characters | |
| 524 + First character must be a letter | |
| 525 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 526 | |
| 527 :type backup_retention_period: integer | |
| 528 :param backup_retention_period: | |
| 529 The number of days for which automated backups are retained. Setting | |
| 530 this parameter to a positive number enables backups. Setting this | |
| 531 parameter to 0 disables automated backups. | |
| 532 | |
| 533 Default: 1 | |
| 534 | |
| 535 Constraints: | |
| 536 | |
| 537 | |
| 538 + Must be a value from 0 to 8 | |
| 539 + Cannot be set to 0 if the DB instance is a master instance with read | |
| 540 replicas | |
| 541 | |
| 542 :type preferred_backup_window: string | |
| 543 :param preferred_backup_window: The daily time range during which | |
| 544 automated backups are created if automated backups are enabled, | |
| 545 using the `BackupRetentionPeriod` parameter. | |
| 546 Default: A 30-minute window selected at random from an 8-hour block of | |
| 547 time per region. See the Amazon RDS User Guide for the time blocks | |
| 548 for each region from which the default backup windows are assigned. | |
| 549 | |
| 550 Constraints: Must be in the format `hh24:mi-hh24:mi`. Times should be | |
| 551 Universal Time Coordinated (UTC). Must not conflict with the | |
| 552 preferred maintenance window. Must be at least 30 minutes. | |
| 553 | |
| 554 :type port: integer | |
| 555 :param port: The port number on which the database accepts connections. | |
| 556 **MySQL** | |
| 557 | |
| 558 Default: `3306` | |
| 559 | |
| 560 Valid Values: `1150-65535` | |
| 561 | |
| 562 Type: Integer | |
| 563 | |
| 564 **Oracle** | |
| 565 | |
| 566 Default: `1521` | |
| 567 | |
| 568 Valid Values: `1150-65535` | |
| 569 | |
| 570 **SQL Server** | |
| 571 | |
| 572 Default: `1433` | |
| 573 | |
| 574 Valid Values: `1150-65535` except for `1434` and `3389`. | |
| 575 | |
| 576 :type multi_az: boolean | |
| 577 :param multi_az: Specifies if the DB instance is a Multi-AZ deployment. | |
| 578 You cannot set the AvailabilityZone parameter if the MultiAZ | |
| 579 parameter is set to true. | |
| 580 | |
| 581 :type engine_version: string | |
| 582 :param engine_version: The version number of the database engine to | |
| 583 use. | |
| 584 **MySQL** | |
| 585 | |
| 586 Example: `5.1.42` | |
| 587 | |
| 588 Type: String | |
| 589 | |
| 590 **Oracle** | |
| 591 | |
| 592 Example: `11.2.0.2.v2` | |
| 593 | |
| 594 Type: String | |
| 595 | |
| 596 **SQL Server** | |
| 597 | |
| 598 Example: `10.50.2789.0.v1` | |
| 599 | |
| 600 :type auto_minor_version_upgrade: boolean | |
| 601 :param auto_minor_version_upgrade: Indicates that minor engine upgrades | |
| 602 will be applied automatically to the DB instance during the | |
| 603 maintenance window. | |
| 604 Default: `True` | |
| 605 | |
| 606 :type license_model: string | |
| 607 :param license_model: License model information for this DB instance. | |
| 608 Valid values: `license-included` | `bring-your-own-license` | `general- | |
| 609 public-license` | |
| 610 | |
| 611 :type iops: integer | |
| 612 :param iops: The amount of Provisioned IOPS (input/output operations | |
| 613 per second) to be initially allocated for the DB instance. | |
| 614 Constraints: Must be an integer greater than 1000. | |
| 615 | |
| 616 :type option_group_name: string | |
| 617 :param option_group_name: Indicates that the DB instance should be | |
| 618 associated with the specified option group. | |
| 619 Permanent options, such as the TDE option for Oracle Advanced Security | |
| 620 TDE, cannot be removed from an option group, and that option group | |
| 621 cannot be removed from a DB instance once it is associated with a | |
| 622 DB instance | |
| 623 | |
| 624 :type character_set_name: string | |
| 625 :param character_set_name: For supported engines, indicates that the DB | |
| 626 instance should be associated with the specified CharacterSet. | |
| 627 | |
| 628 :type publicly_accessible: boolean | |
| 629 :param publicly_accessible: Specifies the accessibility options for the | |
| 630 DB instance. A value of true specifies an Internet-facing instance | |
| 631 with a publicly resolvable DNS name, which resolves to a public IP | |
| 632 address. A value of false specifies an internal instance with a DNS | |
| 633 name that resolves to a private IP address. | |
| 634 Default: The default behavior varies depending on whether a VPC has | |
| 635 been requested or not. The following list shows the default | |
| 636 behavior in each case. | |
| 637 | |
| 638 | |
| 639 + **Default VPC:**true | |
| 640 + **VPC:**false | |
| 641 | |
| 642 | |
| 643 If no DB subnet group has been specified as part of the request and the | |
| 644 PubliclyAccessible value has not been set, the DB instance will be | |
| 645 publicly accessible. If a specific DB subnet group has been | |
| 646 specified as part of the request and the PubliclyAccessible value | |
| 647 has not been set, the DB instance will be private. | |
| 648 | |
| 649 :type tags: list | |
| 650 :param tags: A list of tags. Tags must be passed as tuples in the form | |
| 651 [('key1', 'valueForKey1'), ('key2', 'valueForKey2')] | |
| 652 | |
| 653 """ | |
| 654 params = { | |
| 655 'DBInstanceIdentifier': db_instance_identifier, | |
| 656 'AllocatedStorage': allocated_storage, | |
| 657 'DBInstanceClass': db_instance_class, | |
| 658 'Engine': engine, | |
| 659 'MasterUsername': master_username, | |
| 660 'MasterUserPassword': master_user_password, | |
| 661 } | |
| 662 if db_name is not None: | |
| 663 params['DBName'] = db_name | |
| 664 if db_security_groups is not None: | |
| 665 self.build_list_params(params, | |
| 666 db_security_groups, | |
| 667 'DBSecurityGroups.member') | |
| 668 if vpc_security_group_ids is not None: | |
| 669 self.build_list_params(params, | |
| 670 vpc_security_group_ids, | |
| 671 'VpcSecurityGroupIds.member') | |
| 672 if availability_zone is not None: | |
| 673 params['AvailabilityZone'] = availability_zone | |
| 674 if db_subnet_group_name is not None: | |
| 675 params['DBSubnetGroupName'] = db_subnet_group_name | |
| 676 if preferred_maintenance_window is not None: | |
| 677 params['PreferredMaintenanceWindow'] = preferred_maintenance_window | |
| 678 if db_parameter_group_name is not None: | |
| 679 params['DBParameterGroupName'] = db_parameter_group_name | |
| 680 if backup_retention_period is not None: | |
| 681 params['BackupRetentionPeriod'] = backup_retention_period | |
| 682 if preferred_backup_window is not None: | |
| 683 params['PreferredBackupWindow'] = preferred_backup_window | |
| 684 if port is not None: | |
| 685 params['Port'] = port | |
| 686 if multi_az is not None: | |
| 687 params['MultiAZ'] = str( | |
| 688 multi_az).lower() | |
| 689 if engine_version is not None: | |
| 690 params['EngineVersion'] = engine_version | |
| 691 if auto_minor_version_upgrade is not None: | |
| 692 params['AutoMinorVersionUpgrade'] = str( | |
| 693 auto_minor_version_upgrade).lower() | |
| 694 if license_model is not None: | |
| 695 params['LicenseModel'] = license_model | |
| 696 if iops is not None: | |
| 697 params['Iops'] = iops | |
| 698 if option_group_name is not None: | |
| 699 params['OptionGroupName'] = option_group_name | |
| 700 if character_set_name is not None: | |
| 701 params['CharacterSetName'] = character_set_name | |
| 702 if publicly_accessible is not None: | |
| 703 params['PubliclyAccessible'] = str( | |
| 704 publicly_accessible).lower() | |
| 705 if tags is not None: | |
| 706 self.build_complex_list_params( | |
| 707 params, tags, | |
| 708 'Tags.member', | |
| 709 ('Key', 'Value')) | |
| 710 return self._make_request( | |
| 711 action='CreateDBInstance', | |
| 712 verb='POST', | |
| 713 path='/', params=params) | |
| 714 | |
| 715 def create_db_instance_read_replica(self, db_instance_identifier, | |
| 716 source_db_instance_identifier, | |
| 717 db_instance_class=None, | |
| 718 availability_zone=None, port=None, | |
| 719 auto_minor_version_upgrade=None, | |
| 720 iops=None, option_group_name=None, | |
| 721 publicly_accessible=None, tags=None): | |
| 722 """ | |
| 723 Creates a DB instance that acts as a read replica of a source | |
| 724 DB instance. | |
| 725 | |
| 726 All read replica DB instances are created as Single-AZ | |
| 727 deployments with backups disabled. All other DB instance | |
| 728 attributes (including DB security groups and DB parameter | |
| 729 groups) are inherited from the source DB instance, except as | |
| 730 specified below. | |
| 731 | |
| 732 The source DB instance must have backup retention enabled. | |
| 733 | |
| 734 :type db_instance_identifier: string | |
| 735 :param db_instance_identifier: The DB instance identifier of the read | |
| 736 replica. This is the unique key that identifies a DB instance. This | |
| 737 parameter is stored as a lowercase string. | |
| 738 | |
| 739 :type source_db_instance_identifier: string | |
| 740 :param source_db_instance_identifier: The identifier of the DB instance | |
| 741 that will act as the source for the read replica. Each DB instance | |
| 742 can have up to five read replicas. | |
| 743 Constraints: Must be the identifier of an existing DB instance that is | |
| 744 not already a read replica DB instance. | |
| 745 | |
| 746 :type db_instance_class: string | |
| 747 :param db_instance_class: The compute and memory capacity of the read | |
| 748 replica. | |
| 749 Valid Values: `db.m1.small | db.m1.medium | db.m1.large | db.m1.xlarge | |
| 750 | db.m2.xlarge |db.m2.2xlarge | db.m2.4xlarge` | |
| 751 | |
| 752 Default: Inherits from the source DB instance. | |
| 753 | |
| 754 :type availability_zone: string | |
| 755 :param availability_zone: The Amazon EC2 Availability Zone that the | |
| 756 read replica will be created in. | |
| 757 Default: A random, system-chosen Availability Zone in the endpoint's | |
| 758 region. | |
| 759 | |
| 760 Example: `us-east-1d` | |
| 761 | |
| 762 :type port: integer | |
| 763 :param port: The port number that the DB instance uses for connections. | |
| 764 Default: Inherits from the source DB instance | |
| 765 | |
| 766 Valid Values: `1150-65535` | |
| 767 | |
| 768 :type auto_minor_version_upgrade: boolean | |
| 769 :param auto_minor_version_upgrade: Indicates that minor engine upgrades | |
| 770 will be applied automatically to the read replica during the | |
| 771 maintenance window. | |
| 772 Default: Inherits from the source DB instance | |
| 773 | |
| 774 :type iops: integer | |
| 775 :param iops: The amount of Provisioned IOPS (input/output operations | |
| 776 per second) to be initially allocated for the DB instance. | |
| 777 | |
| 778 :type option_group_name: string | |
| 779 :param option_group_name: The option group the DB instance will be | |
| 780 associated with. If omitted, the default option group for the | |
| 781 engine specified will be used. | |
| 782 | |
| 783 :type publicly_accessible: boolean | |
| 784 :param publicly_accessible: Specifies the accessibility options for the | |
| 785 DB instance. A value of true specifies an Internet-facing instance | |
| 786 with a publicly resolvable DNS name, which resolves to a public IP | |
| 787 address. A value of false specifies an internal instance with a DNS | |
| 788 name that resolves to a private IP address. | |
| 789 Default: The default behavior varies depending on whether a VPC has | |
| 790 been requested or not. The following list shows the default | |
| 791 behavior in each case. | |
| 792 | |
| 793 | |
| 794 + **Default VPC:**true | |
| 795 + **VPC:**false | |
| 796 | |
| 797 | |
| 798 If no DB subnet group has been specified as part of the request and the | |
| 799 PubliclyAccessible value has not been set, the DB instance will be | |
| 800 publicly accessible. If a specific DB subnet group has been | |
| 801 specified as part of the request and the PubliclyAccessible value | |
| 802 has not been set, the DB instance will be private. | |
| 803 | |
| 804 :type tags: list | |
| 805 :param tags: A list of tags. Tags must be passed as tuples in the form | |
| 806 [('key1', 'valueForKey1'), ('key2', 'valueForKey2')] | |
| 807 | |
| 808 """ | |
| 809 params = { | |
| 810 'DBInstanceIdentifier': db_instance_identifier, | |
| 811 'SourceDBInstanceIdentifier': source_db_instance_identifier, | |
| 812 } | |
| 813 if db_instance_class is not None: | |
| 814 params['DBInstanceClass'] = db_instance_class | |
| 815 if availability_zone is not None: | |
| 816 params['AvailabilityZone'] = availability_zone | |
| 817 if port is not None: | |
| 818 params['Port'] = port | |
| 819 if auto_minor_version_upgrade is not None: | |
| 820 params['AutoMinorVersionUpgrade'] = str( | |
| 821 auto_minor_version_upgrade).lower() | |
| 822 if iops is not None: | |
| 823 params['Iops'] = iops | |
| 824 if option_group_name is not None: | |
| 825 params['OptionGroupName'] = option_group_name | |
| 826 if publicly_accessible is not None: | |
| 827 params['PubliclyAccessible'] = str( | |
| 828 publicly_accessible).lower() | |
| 829 if tags is not None: | |
| 830 self.build_complex_list_params( | |
| 831 params, tags, | |
| 832 'Tags.member', | |
| 833 ('Key', 'Value')) | |
| 834 return self._make_request( | |
| 835 action='CreateDBInstanceReadReplica', | |
| 836 verb='POST', | |
| 837 path='/', params=params) | |
| 838 | |
| 839 def create_db_parameter_group(self, db_parameter_group_name, | |
| 840 db_parameter_group_family, description, | |
| 841 tags=None): | |
| 842 """ | |
| 843 Creates a new DB parameter group. | |
| 844 | |
| 845 A DB parameter group is initially created with the default | |
| 846 parameters for the database engine used by the DB instance. To | |
| 847 provide custom values for any of the parameters, you must | |
| 848 modify the group after creating it using | |
| 849 ModifyDBParameterGroup . Once you've created a DB parameter | |
| 850 group, you need to associate it with your DB instance using | |
| 851 ModifyDBInstance . When you associate a new DB parameter group | |
| 852 with a running DB instance, you need to reboot the DB Instance | |
| 853 for the new DB parameter group and associated settings to take | |
| 854 effect. | |
| 855 | |
| 856 :type db_parameter_group_name: string | |
| 857 :param db_parameter_group_name: | |
| 858 The name of the DB parameter group. | |
| 859 | |
| 860 Constraints: | |
| 861 | |
| 862 | |
| 863 + Must be 1 to 255 alphanumeric characters | |
| 864 + First character must be a letter | |
| 865 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 866 | |
| 867 | |
| 868 This value is stored as a lower-case string. | |
| 869 | |
| 870 :type db_parameter_group_family: string | |
| 871 :param db_parameter_group_family: The DB parameter group family name. A | |
| 872 DB parameter group can be associated with one and only one DB | |
| 873 parameter group family, and can be applied only to a DB instance | |
| 874 running a database engine and engine version compatible with that | |
| 875 DB parameter group family. | |
| 876 | |
| 877 :type description: string | |
| 878 :param description: The description for the DB parameter group. | |
| 879 | |
| 880 :type tags: list | |
| 881 :param tags: A list of tags. Tags must be passed as tuples in the form | |
| 882 [('key1', 'valueForKey1'), ('key2', 'valueForKey2')] | |
| 883 | |
| 884 """ | |
| 885 params = { | |
| 886 'DBParameterGroupName': db_parameter_group_name, | |
| 887 'DBParameterGroupFamily': db_parameter_group_family, | |
| 888 'Description': description, | |
| 889 } | |
| 890 if tags is not None: | |
| 891 self.build_complex_list_params( | |
| 892 params, tags, | |
| 893 'Tags.member', | |
| 894 ('Key', 'Value')) | |
| 895 return self._make_request( | |
| 896 action='CreateDBParameterGroup', | |
| 897 verb='POST', | |
| 898 path='/', params=params) | |
| 899 | |
| 900 def create_db_security_group(self, db_security_group_name, | |
| 901 db_security_group_description, tags=None): | |
| 902 """ | |
| 903 Creates a new DB security group. DB security groups control | |
| 904 access to a DB instance. | |
| 905 | |
| 906 :type db_security_group_name: string | |
| 907 :param db_security_group_name: The name for the DB security group. This | |
| 908 value is stored as a lowercase string. | |
| 909 Constraints: | |
| 910 | |
| 911 | |
| 912 + Must be 1 to 255 alphanumeric characters | |
| 913 + First character must be a letter | |
| 914 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 915 + Must not be "Default" | |
| 916 + May not contain spaces | |
| 917 | |
| 918 | |
| 919 Example: `mysecuritygroup` | |
| 920 | |
| 921 :type db_security_group_description: string | |
| 922 :param db_security_group_description: The description for the DB | |
| 923 security group. | |
| 924 | |
| 925 :type tags: list | |
| 926 :param tags: A list of tags. Tags must be passed as tuples in the form | |
| 927 [('key1', 'valueForKey1'), ('key2', 'valueForKey2')] | |
| 928 | |
| 929 """ | |
| 930 params = { | |
| 931 'DBSecurityGroupName': db_security_group_name, | |
| 932 'DBSecurityGroupDescription': db_security_group_description, | |
| 933 } | |
| 934 if tags is not None: | |
| 935 self.build_complex_list_params( | |
| 936 params, tags, | |
| 937 'Tags.member', | |
| 938 ('Key', 'Value')) | |
| 939 return self._make_request( | |
| 940 action='CreateDBSecurityGroup', | |
| 941 verb='POST', | |
| 942 path='/', params=params) | |
| 943 | |
| 944 def create_db_snapshot(self, db_snapshot_identifier, | |
| 945 db_instance_identifier, tags=None): | |
| 946 """ | |
| 947 Creates a DBSnapshot. The source DBInstance must be in | |
| 948 "available" state. | |
| 949 | |
| 950 :type db_snapshot_identifier: string | |
| 951 :param db_snapshot_identifier: The identifier for the DB snapshot. | |
| 952 Constraints: | |
| 953 | |
| 954 | |
| 955 + Cannot be null, empty, or blank | |
| 956 + Must contain from 1 to 255 alphanumeric characters or hyphens | |
| 957 + First character must be a letter | |
| 958 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 959 | |
| 960 | |
| 961 Example: `my-snapshot-id` | |
| 962 | |
| 963 :type db_instance_identifier: string | |
| 964 :param db_instance_identifier: | |
| 965 The DB instance identifier. This is the unique key that identifies a DB | |
| 966 instance. This parameter isn't case sensitive. | |
| 967 | |
| 968 Constraints: | |
| 969 | |
| 970 | |
| 971 + Must contain from 1 to 63 alphanumeric characters or hyphens | |
| 972 + First character must be a letter | |
| 973 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 974 | |
| 975 :type tags: list | |
| 976 :param tags: A list of tags. Tags must be passed as tuples in the form | |
| 977 [('key1', 'valueForKey1'), ('key2', 'valueForKey2')] | |
| 978 | |
| 979 """ | |
| 980 params = { | |
| 981 'DBSnapshotIdentifier': db_snapshot_identifier, | |
| 982 'DBInstanceIdentifier': db_instance_identifier, | |
| 983 } | |
| 984 if tags is not None: | |
| 985 self.build_complex_list_params( | |
| 986 params, tags, | |
| 987 'Tags.member', | |
| 988 ('Key', 'Value')) | |
| 989 return self._make_request( | |
| 990 action='CreateDBSnapshot', | |
| 991 verb='POST', | |
| 992 path='/', params=params) | |
| 993 | |
| 994 def create_db_subnet_group(self, db_subnet_group_name, | |
| 995 db_subnet_group_description, subnet_ids, | |
| 996 tags=None): | |
| 997 """ | |
| 998 Creates a new DB subnet group. DB subnet groups must contain | |
| 999 at least one subnet in at least two AZs in the region. | |
| 1000 | |
| 1001 :type db_subnet_group_name: string | |
| 1002 :param db_subnet_group_name: The name for the DB subnet group. This | |
| 1003 value is stored as a lowercase string. | |
| 1004 Constraints: Must contain no more than 255 alphanumeric characters or | |
| 1005 hyphens. Must not be "Default". | |
| 1006 | |
| 1007 Example: `mySubnetgroup` | |
| 1008 | |
| 1009 :type db_subnet_group_description: string | |
| 1010 :param db_subnet_group_description: The description for the DB subnet | |
| 1011 group. | |
| 1012 | |
| 1013 :type subnet_ids: list | |
| 1014 :param subnet_ids: The EC2 Subnet IDs for the DB subnet group. | |
| 1015 | |
| 1016 :type tags: list | |
| 1017 :param tags: A list of tags. Tags must be passed as tuples in the form | |
| 1018 [('key1', 'valueForKey1'), ('key2', 'valueForKey2')] | |
| 1019 | |
| 1020 """ | |
| 1021 params = { | |
| 1022 'DBSubnetGroupName': db_subnet_group_name, | |
| 1023 'DBSubnetGroupDescription': db_subnet_group_description, | |
| 1024 } | |
| 1025 self.build_list_params(params, | |
| 1026 subnet_ids, | |
| 1027 'SubnetIds.member') | |
| 1028 if tags is not None: | |
| 1029 self.build_complex_list_params( | |
| 1030 params, tags, | |
| 1031 'Tags.member', | |
| 1032 ('Key', 'Value')) | |
| 1033 return self._make_request( | |
| 1034 action='CreateDBSubnetGroup', | |
| 1035 verb='POST', | |
| 1036 path='/', params=params) | |
| 1037 | |
| 1038 def create_event_subscription(self, subscription_name, sns_topic_arn, | |
| 1039 source_type=None, event_categories=None, | |
| 1040 source_ids=None, enabled=None, tags=None): | |
| 1041 """ | |
| 1042 Creates an RDS event notification subscription. This action | |
| 1043 requires a topic ARN (Amazon Resource Name) created by either | |
| 1044 the RDS console, the SNS console, or the SNS API. To obtain an | |
| 1045 ARN with SNS, you must create a topic in Amazon SNS and | |
| 1046 subscribe to the topic. The ARN is displayed in the SNS | |
| 1047 console. | |
| 1048 | |
| 1049 You can specify the type of source (SourceType) you want to be | |
| 1050 notified of, provide a list of RDS sources (SourceIds) that | |
| 1051 triggers the events, and provide a list of event categories | |
| 1052 (EventCategories) for events you want to be notified of. For | |
| 1053 example, you can specify SourceType = db-instance, SourceIds = | |
| 1054 mydbinstance1, mydbinstance2 and EventCategories = | |
| 1055 Availability, Backup. | |
| 1056 | |
| 1057 If you specify both the SourceType and SourceIds, such as | |
| 1058 SourceType = db-instance and SourceIdentifier = myDBInstance1, | |
| 1059 you will be notified of all the db-instance events for the | |
| 1060 specified source. If you specify a SourceType but do not | |
| 1061 specify a SourceIdentifier, you will receive notice of the | |
| 1062 events for that source type for all your RDS sources. If you | |
| 1063 do not specify either the SourceType nor the SourceIdentifier, | |
| 1064 you will be notified of events generated from all RDS sources | |
| 1065 belonging to your customer account. | |
| 1066 | |
| 1067 :type subscription_name: string | |
| 1068 :param subscription_name: The name of the subscription. | |
| 1069 Constraints: The name must be less than 255 characters. | |
| 1070 | |
| 1071 :type sns_topic_arn: string | |
| 1072 :param sns_topic_arn: The Amazon Resource Name (ARN) of the SNS topic | |
| 1073 created for event notification. The ARN is created by Amazon SNS | |
| 1074 when you create a topic and subscribe to it. | |
| 1075 | |
| 1076 :type source_type: string | |
| 1077 :param source_type: The type of source that will be generating the | |
| 1078 events. For example, if you want to be notified of events generated | |
| 1079 by a DB instance, you would set this parameter to db-instance. if | |
| 1080 this value is not specified, all events are returned. | |
| 1081 Valid values: db-instance | db-parameter-group | db-security-group | | |
| 1082 db-snapshot | |
| 1083 | |
| 1084 :type event_categories: list | |
| 1085 :param event_categories: A list of event categories for a SourceType | |
| 1086 that you want to subscribe to. You can see a list of the categories | |
| 1087 for a given SourceType in the `Events`_ topic in the Amazon RDS | |
| 1088 User Guide or by using the **DescribeEventCategories** action. | |
| 1089 | |
| 1090 :type source_ids: list | |
| 1091 :param source_ids: | |
| 1092 The list of identifiers of the event sources for which events will be | |
| 1093 returned. If not specified, then all sources are included in the | |
| 1094 response. An identifier must begin with a letter and must contain | |
| 1095 only ASCII letters, digits, and hyphens; it cannot end with a | |
| 1096 hyphen or contain two consecutive hyphens. | |
| 1097 | |
| 1098 Constraints: | |
| 1099 | |
| 1100 | |
| 1101 + If SourceIds are supplied, SourceType must also be provided. | |
| 1102 + If the source type is a DB instance, then a `DBInstanceIdentifier` | |
| 1103 must be supplied. | |
| 1104 + If the source type is a DB security group, a `DBSecurityGroupName` | |
| 1105 must be supplied. | |
| 1106 + If the source type is a DB parameter group, a `DBParameterGroupName` | |
| 1107 must be supplied. | |
| 1108 + If the source type is a DB snapshot, a `DBSnapshotIdentifier` must be | |
| 1109 supplied. | |
| 1110 | |
| 1111 :type enabled: boolean | |
| 1112 :param enabled: A Boolean value; set to **true** to activate the | |
| 1113 subscription, set to **false** to create the subscription but not | |
| 1114 active it. | |
| 1115 | |
| 1116 :type tags: list | |
| 1117 :param tags: A list of tags. Tags must be passed as tuples in the form | |
| 1118 [('key1', 'valueForKey1'), ('key2', 'valueForKey2')] | |
| 1119 | |
| 1120 """ | |
| 1121 params = { | |
| 1122 'SubscriptionName': subscription_name, | |
| 1123 'SnsTopicArn': sns_topic_arn, | |
| 1124 } | |
| 1125 if source_type is not None: | |
| 1126 params['SourceType'] = source_type | |
| 1127 if event_categories is not None: | |
| 1128 self.build_list_params(params, | |
| 1129 event_categories, | |
| 1130 'EventCategories.member') | |
| 1131 if source_ids is not None: | |
| 1132 self.build_list_params(params, | |
| 1133 source_ids, | |
| 1134 'SourceIds.member') | |
| 1135 if enabled is not None: | |
| 1136 params['Enabled'] = str( | |
| 1137 enabled).lower() | |
| 1138 if tags is not None: | |
| 1139 self.build_complex_list_params( | |
| 1140 params, tags, | |
| 1141 'Tags.member', | |
| 1142 ('Key', 'Value')) | |
| 1143 return self._make_request( | |
| 1144 action='CreateEventSubscription', | |
| 1145 verb='POST', | |
| 1146 path='/', params=params) | |
| 1147 | |
| 1148 def create_option_group(self, option_group_name, engine_name, | |
| 1149 major_engine_version, option_group_description, | |
| 1150 tags=None): | |
| 1151 """ | |
| 1152 Creates a new option group. You can create up to 20 option | |
| 1153 groups. | |
| 1154 | |
| 1155 :type option_group_name: string | |
| 1156 :param option_group_name: Specifies the name of the option group to be | |
| 1157 created. | |
| 1158 Constraints: | |
| 1159 | |
| 1160 | |
| 1161 + Must be 1 to 255 alphanumeric characters or hyphens | |
| 1162 + First character must be a letter | |
| 1163 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 1164 | |
| 1165 | |
| 1166 Example: `myoptiongroup` | |
| 1167 | |
| 1168 :type engine_name: string | |
| 1169 :param engine_name: Specifies the name of the engine that this option | |
| 1170 group should be associated with. | |
| 1171 | |
| 1172 :type major_engine_version: string | |
| 1173 :param major_engine_version: Specifies the major version of the engine | |
| 1174 that this option group should be associated with. | |
| 1175 | |
| 1176 :type option_group_description: string | |
| 1177 :param option_group_description: The description of the option group. | |
| 1178 | |
| 1179 :type tags: list | |
| 1180 :param tags: A list of tags. Tags must be passed as tuples in the form | |
| 1181 [('key1', 'valueForKey1'), ('key2', 'valueForKey2')] | |
| 1182 | |
| 1183 """ | |
| 1184 params = { | |
| 1185 'OptionGroupName': option_group_name, | |
| 1186 'EngineName': engine_name, | |
| 1187 'MajorEngineVersion': major_engine_version, | |
| 1188 'OptionGroupDescription': option_group_description, | |
| 1189 } | |
| 1190 if tags is not None: | |
| 1191 self.build_complex_list_params( | |
| 1192 params, tags, | |
| 1193 'Tags.member', | |
| 1194 ('Key', 'Value')) | |
| 1195 return self._make_request( | |
| 1196 action='CreateOptionGroup', | |
| 1197 verb='POST', | |
| 1198 path='/', params=params) | |
| 1199 | |
| 1200 def delete_db_instance(self, db_instance_identifier, | |
| 1201 skip_final_snapshot=None, | |
| 1202 final_db_snapshot_identifier=None): | |
| 1203 """ | |
| 1204 The DeleteDBInstance action deletes a previously provisioned | |
| 1205 DB instance. A successful response from the web service | |
| 1206 indicates the request was received correctly. When you delete | |
| 1207 a DB instance, all automated backups for that instance are | |
| 1208 deleted and cannot be recovered. Manual DB snapshots of the DB | |
| 1209 instance to be deleted are not deleted. | |
| 1210 | |
| 1211 If a final DB snapshot is requested the status of the RDS | |
| 1212 instance will be "deleting" until the DB snapshot is created. | |
| 1213 The API action `DescribeDBInstance` is used to monitor the | |
| 1214 status of this operation. The action cannot be canceled or | |
| 1215 reverted once submitted. | |
| 1216 | |
| 1217 :type db_instance_identifier: string | |
| 1218 :param db_instance_identifier: | |
| 1219 The DB instance identifier for the DB instance to be deleted. This | |
| 1220 parameter isn't case sensitive. | |
| 1221 | |
| 1222 Constraints: | |
| 1223 | |
| 1224 | |
| 1225 + Must contain from 1 to 63 alphanumeric characters or hyphens | |
| 1226 + First character must be a letter | |
| 1227 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 1228 | |
| 1229 :type skip_final_snapshot: boolean | |
| 1230 :param skip_final_snapshot: Determines whether a final DB snapshot is | |
| 1231 created before the DB instance is deleted. If `True` is specified, | |
| 1232 no DBSnapshot is created. If false is specified, a DB snapshot is | |
| 1233 created before the DB instance is deleted. | |
| 1234 The FinalDBSnapshotIdentifier parameter must be specified if | |
| 1235 SkipFinalSnapshot is `False`. | |
| 1236 | |
| 1237 Default: `False` | |
| 1238 | |
| 1239 :type final_db_snapshot_identifier: string | |
| 1240 :param final_db_snapshot_identifier: | |
| 1241 The DBSnapshotIdentifier of the new DBSnapshot created when | |
| 1242 SkipFinalSnapshot is set to `False`. | |
| 1243 | |
| 1244 Specifying this parameter and also setting the SkipFinalShapshot | |
| 1245 parameter to true results in an error. | |
| 1246 | |
| 1247 Constraints: | |
| 1248 | |
| 1249 | |
| 1250 + Must be 1 to 255 alphanumeric characters | |
| 1251 + First character must be a letter | |
| 1252 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 1253 | |
| 1254 """ | |
| 1255 params = {'DBInstanceIdentifier': db_instance_identifier, } | |
| 1256 if skip_final_snapshot is not None: | |
| 1257 params['SkipFinalSnapshot'] = str( | |
| 1258 skip_final_snapshot).lower() | |
| 1259 if final_db_snapshot_identifier is not None: | |
| 1260 params['FinalDBSnapshotIdentifier'] = final_db_snapshot_identifier | |
| 1261 return self._make_request( | |
| 1262 action='DeleteDBInstance', | |
| 1263 verb='POST', | |
| 1264 path='/', params=params) | |
| 1265 | |
| 1266 def delete_db_parameter_group(self, db_parameter_group_name): | |
| 1267 """ | |
| 1268 Deletes a specified DBParameterGroup. The DBParameterGroup | |
| 1269 cannot be associated with any RDS instances to be deleted. | |
| 1270 The specified DB parameter group cannot be associated with any | |
| 1271 DB instances. | |
| 1272 | |
| 1273 :type db_parameter_group_name: string | |
| 1274 :param db_parameter_group_name: | |
| 1275 The name of the DB parameter group. | |
| 1276 | |
| 1277 Constraints: | |
| 1278 | |
| 1279 | |
| 1280 + Must be the name of an existing DB parameter group | |
| 1281 + You cannot delete a default DB parameter group | |
| 1282 + Cannot be associated with any DB instances | |
| 1283 | |
| 1284 """ | |
| 1285 params = {'DBParameterGroupName': db_parameter_group_name, } | |
| 1286 return self._make_request( | |
| 1287 action='DeleteDBParameterGroup', | |
| 1288 verb='POST', | |
| 1289 path='/', params=params) | |
| 1290 | |
| 1291 def delete_db_security_group(self, db_security_group_name): | |
| 1292 """ | |
| 1293 Deletes a DB security group. | |
| 1294 The specified DB security group must not be associated with | |
| 1295 any DB instances. | |
| 1296 | |
| 1297 :type db_security_group_name: string | |
| 1298 :param db_security_group_name: | |
| 1299 The name of the DB security group to delete. | |
| 1300 | |
| 1301 You cannot delete the default DB security group. | |
| 1302 | |
| 1303 Constraints: | |
| 1304 | |
| 1305 | |
| 1306 + Must be 1 to 255 alphanumeric characters | |
| 1307 + First character must be a letter | |
| 1308 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 1309 + Must not be "Default" | |
| 1310 + May not contain spaces | |
| 1311 | |
| 1312 """ | |
| 1313 params = {'DBSecurityGroupName': db_security_group_name, } | |
| 1314 return self._make_request( | |
| 1315 action='DeleteDBSecurityGroup', | |
| 1316 verb='POST', | |
| 1317 path='/', params=params) | |
| 1318 | |
| 1319 def delete_db_snapshot(self, db_snapshot_identifier): | |
| 1320 """ | |
| 1321 Deletes a DBSnapshot. | |
| 1322 The DBSnapshot must be in the `available` state to be deleted. | |
| 1323 | |
| 1324 :type db_snapshot_identifier: string | |
| 1325 :param db_snapshot_identifier: The DBSnapshot identifier. | |
| 1326 Constraints: Must be the name of an existing DB snapshot in the | |
| 1327 `available` state. | |
| 1328 | |
| 1329 """ | |
| 1330 params = {'DBSnapshotIdentifier': db_snapshot_identifier, } | |
| 1331 return self._make_request( | |
| 1332 action='DeleteDBSnapshot', | |
| 1333 verb='POST', | |
| 1334 path='/', params=params) | |
| 1335 | |
| 1336 def delete_db_subnet_group(self, db_subnet_group_name): | |
| 1337 """ | |
| 1338 Deletes a DB subnet group. | |
| 1339 The specified database subnet group must not be associated | |
| 1340 with any DB instances. | |
| 1341 | |
| 1342 :type db_subnet_group_name: string | |
| 1343 :param db_subnet_group_name: | |
| 1344 The name of the database subnet group to delete. | |
| 1345 | |
| 1346 You cannot delete the default subnet group. | |
| 1347 | |
| 1348 Constraints: | |
| 1349 | |
| 1350 | |
| 1351 + Must be 1 to 255 alphanumeric characters | |
| 1352 + First character must be a letter | |
| 1353 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 1354 | |
| 1355 """ | |
| 1356 params = {'DBSubnetGroupName': db_subnet_group_name, } | |
| 1357 return self._make_request( | |
| 1358 action='DeleteDBSubnetGroup', | |
| 1359 verb='POST', | |
| 1360 path='/', params=params) | |
| 1361 | |
| 1362 def delete_event_subscription(self, subscription_name): | |
| 1363 """ | |
| 1364 Deletes an RDS event notification subscription. | |
| 1365 | |
| 1366 :type subscription_name: string | |
| 1367 :param subscription_name: The name of the RDS event notification | |
| 1368 subscription you want to delete. | |
| 1369 | |
| 1370 """ | |
| 1371 params = {'SubscriptionName': subscription_name, } | |
| 1372 return self._make_request( | |
| 1373 action='DeleteEventSubscription', | |
| 1374 verb='POST', | |
| 1375 path='/', params=params) | |
| 1376 | |
| 1377 def delete_option_group(self, option_group_name): | |
| 1378 """ | |
| 1379 Deletes an existing option group. | |
| 1380 | |
| 1381 :type option_group_name: string | |
| 1382 :param option_group_name: | |
| 1383 The name of the option group to be deleted. | |
| 1384 | |
| 1385 You cannot delete default option groups. | |
| 1386 | |
| 1387 """ | |
| 1388 params = {'OptionGroupName': option_group_name, } | |
| 1389 return self._make_request( | |
| 1390 action='DeleteOptionGroup', | |
| 1391 verb='POST', | |
| 1392 path='/', params=params) | |
| 1393 | |
| 1394 def describe_db_engine_versions(self, engine=None, engine_version=None, | |
| 1395 db_parameter_group_family=None, | |
| 1396 max_records=None, marker=None, | |
| 1397 default_only=None, | |
| 1398 list_supported_character_sets=None): | |
| 1399 """ | |
| 1400 Returns a list of the available DB engines. | |
| 1401 | |
| 1402 :type engine: string | |
| 1403 :param engine: The database engine to return. | |
| 1404 | |
| 1405 :type engine_version: string | |
| 1406 :param engine_version: The database engine version to return. | |
| 1407 Example: `5.1.49` | |
| 1408 | |
| 1409 :type db_parameter_group_family: string | |
| 1410 :param db_parameter_group_family: | |
| 1411 The name of a specific DB parameter group family to return details for. | |
| 1412 | |
| 1413 Constraints: | |
| 1414 | |
| 1415 | |
| 1416 + Must be 1 to 255 alphanumeric characters | |
| 1417 + First character must be a letter | |
| 1418 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 1419 | |
| 1420 :type max_records: integer | |
| 1421 :param max_records: The maximum number of records to include in the | |
| 1422 response. If more than the `MaxRecords` value is available, a | |
| 1423 pagination token called a marker is included in the response so | |
| 1424 that the following results can be retrieved. | |
| 1425 Default: 100 | |
| 1426 | |
| 1427 Constraints: minimum 20, maximum 100 | |
| 1428 | |
| 1429 :type marker: string | |
| 1430 :param marker: An optional pagination token provided by a previous | |
| 1431 request. If this parameter is specified, the response includes only | |
| 1432 records beyond the marker, up to the value specified by | |
| 1433 `MaxRecords`. | |
| 1434 | |
| 1435 :type default_only: boolean | |
| 1436 :param default_only: Indicates that only the default version of the | |
| 1437 specified engine or engine and major version combination is | |
| 1438 returned. | |
| 1439 | |
| 1440 :type list_supported_character_sets: boolean | |
| 1441 :param list_supported_character_sets: If this parameter is specified, | |
| 1442 and if the requested engine supports the CharacterSetName parameter | |
| 1443 for CreateDBInstance, the response includes a list of supported | |
| 1444 character sets for each engine version. | |
| 1445 | |
| 1446 """ | |
| 1447 params = {} | |
| 1448 if engine is not None: | |
| 1449 params['Engine'] = engine | |
| 1450 if engine_version is not None: | |
| 1451 params['EngineVersion'] = engine_version | |
| 1452 if db_parameter_group_family is not None: | |
| 1453 params['DBParameterGroupFamily'] = db_parameter_group_family | |
| 1454 if max_records is not None: | |
| 1455 params['MaxRecords'] = max_records | |
| 1456 if marker is not None: | |
| 1457 params['Marker'] = marker | |
| 1458 if default_only is not None: | |
| 1459 params['DefaultOnly'] = str( | |
| 1460 default_only).lower() | |
| 1461 if list_supported_character_sets is not None: | |
| 1462 params['ListSupportedCharacterSets'] = str( | |
| 1463 list_supported_character_sets).lower() | |
| 1464 return self._make_request( | |
| 1465 action='DescribeDBEngineVersions', | |
| 1466 verb='POST', | |
| 1467 path='/', params=params) | |
| 1468 | |
| 1469 def describe_db_instances(self, db_instance_identifier=None, | |
| 1470 filters=None, max_records=None, marker=None): | |
| 1471 """ | |
| 1472 Returns information about provisioned RDS instances. This API | |
| 1473 supports pagination. | |
| 1474 | |
| 1475 :type db_instance_identifier: string | |
| 1476 :param db_instance_identifier: | |
| 1477 The user-supplied instance identifier. If this parameter is specified, | |
| 1478 information from only the specific DB instance is returned. This | |
| 1479 parameter isn't case sensitive. | |
| 1480 | |
| 1481 Constraints: | |
| 1482 | |
| 1483 | |
| 1484 + Must contain from 1 to 63 alphanumeric characters or hyphens | |
| 1485 + First character must be a letter | |
| 1486 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 1487 | |
| 1488 :type filters: list | |
| 1489 :param filters: | |
| 1490 | |
| 1491 :type max_records: integer | |
| 1492 :param max_records: The maximum number of records to include in the | |
| 1493 response. If more records exist than the specified `MaxRecords` | |
| 1494 value, a pagination token called a marker is included in the | |
| 1495 response so that the remaining results may be retrieved. | |
| 1496 Default: 100 | |
| 1497 | |
| 1498 Constraints: minimum 20, maximum 100 | |
| 1499 | |
| 1500 :type marker: string | |
| 1501 :param marker: An optional pagination token provided by a previous | |
| 1502 DescribeDBInstances request. If this parameter is specified, the | |
| 1503 response includes only records beyond the marker, up to the value | |
| 1504 specified by `MaxRecords` . | |
| 1505 | |
| 1506 """ | |
| 1507 params = {} | |
| 1508 if db_instance_identifier is not None: | |
| 1509 params['DBInstanceIdentifier'] = db_instance_identifier | |
| 1510 if filters is not None: | |
| 1511 self.build_complex_list_params( | |
| 1512 params, filters, | |
| 1513 'Filters.member', | |
| 1514 ('FilterName', 'FilterValue')) | |
| 1515 if max_records is not None: | |
| 1516 params['MaxRecords'] = max_records | |
| 1517 if marker is not None: | |
| 1518 params['Marker'] = marker | |
| 1519 return self._make_request( | |
| 1520 action='DescribeDBInstances', | |
| 1521 verb='POST', | |
| 1522 path='/', params=params) | |
| 1523 | |
| 1524 def describe_db_log_files(self, db_instance_identifier, | |
| 1525 filename_contains=None, file_last_written=None, | |
| 1526 file_size=None, max_records=None, marker=None): | |
| 1527 """ | |
| 1528 Returns a list of DB log files for the DB instance. | |
| 1529 | |
| 1530 :type db_instance_identifier: string | |
| 1531 :param db_instance_identifier: | |
| 1532 The customer-assigned name of the DB instance that contains the log | |
| 1533 files you want to list. | |
| 1534 | |
| 1535 Constraints: | |
| 1536 | |
| 1537 | |
| 1538 + Must contain from 1 to 63 alphanumeric characters or hyphens | |
| 1539 + First character must be a letter | |
| 1540 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 1541 | |
| 1542 :type filename_contains: string | |
| 1543 :param filename_contains: Filters the available log files for log file | |
| 1544 names that contain the specified string. | |
| 1545 | |
| 1546 :type file_last_written: long | |
| 1547 :param file_last_written: Filters the available log files for files | |
| 1548 written since the specified date, in POSIX timestamp format. | |
| 1549 | |
| 1550 :type file_size: long | |
| 1551 :param file_size: Filters the available log files for files larger than | |
| 1552 the specified size. | |
| 1553 | |
| 1554 :type max_records: integer | |
| 1555 :param max_records: The maximum number of records to include in the | |
| 1556 response. If more records exist than the specified MaxRecords | |
| 1557 value, a pagination token called a marker is included in the | |
| 1558 response so that the remaining results can be retrieved. | |
| 1559 | |
| 1560 :type marker: string | |
| 1561 :param marker: The pagination token provided in the previous request. | |
| 1562 If this parameter is specified the response includes only records | |
| 1563 beyond the marker, up to MaxRecords. | |
| 1564 | |
| 1565 """ | |
| 1566 params = {'DBInstanceIdentifier': db_instance_identifier, } | |
| 1567 if filename_contains is not None: | |
| 1568 params['FilenameContains'] = filename_contains | |
| 1569 if file_last_written is not None: | |
| 1570 params['FileLastWritten'] = file_last_written | |
| 1571 if file_size is not None: | |
| 1572 params['FileSize'] = file_size | |
| 1573 if max_records is not None: | |
| 1574 params['MaxRecords'] = max_records | |
| 1575 if marker is not None: | |
| 1576 params['Marker'] = marker | |
| 1577 return self._make_request( | |
| 1578 action='DescribeDBLogFiles', | |
| 1579 verb='POST', | |
| 1580 path='/', params=params) | |
| 1581 | |
| 1582 def describe_db_parameter_groups(self, db_parameter_group_name=None, | |
| 1583 filters=None, max_records=None, | |
| 1584 marker=None): | |
| 1585 """ | |
| 1586 Returns a list of `DBParameterGroup` descriptions. If a | |
| 1587 `DBParameterGroupName` is specified, the list will contain | |
| 1588 only the description of the specified DB parameter group. | |
| 1589 | |
| 1590 :type db_parameter_group_name: string | |
| 1591 :param db_parameter_group_name: | |
| 1592 The name of a specific DB parameter group to return details for. | |
| 1593 | |
| 1594 Constraints: | |
| 1595 | |
| 1596 | |
| 1597 + Must be 1 to 255 alphanumeric characters | |
| 1598 + First character must be a letter | |
| 1599 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 1600 | |
| 1601 :type filters: list | |
| 1602 :param filters: | |
| 1603 | |
| 1604 :type max_records: integer | |
| 1605 :param max_records: The maximum number of records to include in the | |
| 1606 response. If more records exist than the specified `MaxRecords` | |
| 1607 value, a pagination token called a marker is included in the | |
| 1608 response so that the remaining results may be retrieved. | |
| 1609 Default: 100 | |
| 1610 | |
| 1611 Constraints: minimum 20, maximum 100 | |
| 1612 | |
| 1613 :type marker: string | |
| 1614 :param marker: An optional pagination token provided by a previous | |
| 1615 `DescribeDBParameterGroups` request. If this parameter is | |
| 1616 specified, the response includes only records beyond the marker, up | |
| 1617 to the value specified by `MaxRecords`. | |
| 1618 | |
| 1619 """ | |
| 1620 params = {} | |
| 1621 if db_parameter_group_name is not None: | |
| 1622 params['DBParameterGroupName'] = db_parameter_group_name | |
| 1623 if filters is not None: | |
| 1624 self.build_complex_list_params( | |
| 1625 params, filters, | |
| 1626 'Filters.member', | |
| 1627 ('FilterName', 'FilterValue')) | |
| 1628 if max_records is not None: | |
| 1629 params['MaxRecords'] = max_records | |
| 1630 if marker is not None: | |
| 1631 params['Marker'] = marker | |
| 1632 return self._make_request( | |
| 1633 action='DescribeDBParameterGroups', | |
| 1634 verb='POST', | |
| 1635 path='/', params=params) | |
| 1636 | |
| 1637 def describe_db_parameters(self, db_parameter_group_name, source=None, | |
| 1638 max_records=None, marker=None): | |
| 1639 """ | |
| 1640 Returns the detailed parameter list for a particular DB | |
| 1641 parameter group. | |
| 1642 | |
| 1643 :type db_parameter_group_name: string | |
| 1644 :param db_parameter_group_name: | |
| 1645 The name of a specific DB parameter group to return details for. | |
| 1646 | |
| 1647 Constraints: | |
| 1648 | |
| 1649 | |
| 1650 + Must be 1 to 255 alphanumeric characters | |
| 1651 + First character must be a letter | |
| 1652 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 1653 | |
| 1654 :type source: string | |
| 1655 :param source: The parameter types to return. | |
| 1656 Default: All parameter types returned | |
| 1657 | |
| 1658 Valid Values: `user | system | engine-default` | |
| 1659 | |
| 1660 :type max_records: integer | |
| 1661 :param max_records: The maximum number of records to include in the | |
| 1662 response. If more records exist than the specified `MaxRecords` | |
| 1663 value, a pagination token called a marker is included in the | |
| 1664 response so that the remaining results may be retrieved. | |
| 1665 Default: 100 | |
| 1666 | |
| 1667 Constraints: minimum 20, maximum 100 | |
| 1668 | |
| 1669 :type marker: string | |
| 1670 :param marker: An optional pagination token provided by a previous | |
| 1671 `DescribeDBParameters` request. If this parameter is specified, the | |
| 1672 response includes only records beyond the marker, up to the value | |
| 1673 specified by `MaxRecords`. | |
| 1674 | |
| 1675 """ | |
| 1676 params = {'DBParameterGroupName': db_parameter_group_name, } | |
| 1677 if source is not None: | |
| 1678 params['Source'] = source | |
| 1679 if max_records is not None: | |
| 1680 params['MaxRecords'] = max_records | |
| 1681 if marker is not None: | |
| 1682 params['Marker'] = marker | |
| 1683 return self._make_request( | |
| 1684 action='DescribeDBParameters', | |
| 1685 verb='POST', | |
| 1686 path='/', params=params) | |
| 1687 | |
| 1688 def describe_db_security_groups(self, db_security_group_name=None, | |
| 1689 filters=None, max_records=None, | |
| 1690 marker=None): | |
| 1691 """ | |
| 1692 Returns a list of `DBSecurityGroup` descriptions. If a | |
| 1693 `DBSecurityGroupName` is specified, the list will contain only | |
| 1694 the descriptions of the specified DB security group. | |
| 1695 | |
| 1696 :type db_security_group_name: string | |
| 1697 :param db_security_group_name: The name of the DB security group to | |
| 1698 return details for. | |
| 1699 | |
| 1700 :type filters: list | |
| 1701 :param filters: | |
| 1702 | |
| 1703 :type max_records: integer | |
| 1704 :param max_records: The maximum number of records to include in the | |
| 1705 response. If more records exist than the specified `MaxRecords` | |
| 1706 value, a pagination token called a marker is included in the | |
| 1707 response so that the remaining results may be retrieved. | |
| 1708 Default: 100 | |
| 1709 | |
| 1710 Constraints: minimum 20, maximum 100 | |
| 1711 | |
| 1712 :type marker: string | |
| 1713 :param marker: An optional pagination token provided by a previous | |
| 1714 DescribeDBSecurityGroups request. If this parameter is specified, | |
| 1715 the response includes only records beyond the marker, up to the | |
| 1716 value specified by `MaxRecords`. | |
| 1717 | |
| 1718 """ | |
| 1719 params = {} | |
| 1720 if db_security_group_name is not None: | |
| 1721 params['DBSecurityGroupName'] = db_security_group_name | |
| 1722 if filters is not None: | |
| 1723 self.build_complex_list_params( | |
| 1724 params, filters, | |
| 1725 'Filters.member', | |
| 1726 ('FilterName', 'FilterValue')) | |
| 1727 if max_records is not None: | |
| 1728 params['MaxRecords'] = max_records | |
| 1729 if marker is not None: | |
| 1730 params['Marker'] = marker | |
| 1731 return self._make_request( | |
| 1732 action='DescribeDBSecurityGroups', | |
| 1733 verb='POST', | |
| 1734 path='/', params=params) | |
| 1735 | |
| 1736 def describe_db_snapshots(self, db_instance_identifier=None, | |
| 1737 db_snapshot_identifier=None, | |
| 1738 snapshot_type=None, filters=None, | |
| 1739 max_records=None, marker=None): | |
| 1740 """ | |
| 1741 Returns information about DB snapshots. This API supports | |
| 1742 pagination. | |
| 1743 | |
| 1744 :type db_instance_identifier: string | |
| 1745 :param db_instance_identifier: | |
| 1746 A DB instance identifier to retrieve the list of DB snapshots for. | |
| 1747 Cannot be used in conjunction with `DBSnapshotIdentifier`. This | |
| 1748 parameter is not case sensitive. | |
| 1749 | |
| 1750 Constraints: | |
| 1751 | |
| 1752 | |
| 1753 + Must contain from 1 to 63 alphanumeric characters or hyphens | |
| 1754 + First character must be a letter | |
| 1755 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 1756 | |
| 1757 :type db_snapshot_identifier: string | |
| 1758 :param db_snapshot_identifier: | |
| 1759 A specific DB snapshot identifier to describe. Cannot be used in | |
| 1760 conjunction with `DBInstanceIdentifier`. This value is stored as a | |
| 1761 lowercase string. | |
| 1762 | |
| 1763 Constraints: | |
| 1764 | |
| 1765 | |
| 1766 + Must be 1 to 255 alphanumeric characters | |
| 1767 + First character must be a letter | |
| 1768 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 1769 + If this is the identifier of an automated snapshot, the | |
| 1770 `SnapshotType` parameter must also be specified. | |
| 1771 | |
| 1772 :type snapshot_type: string | |
| 1773 :param snapshot_type: The type of snapshots that will be returned. | |
| 1774 Values can be "automated" or "manual." If not specified, the | |
| 1775 returned results will include all snapshots types. | |
| 1776 | |
| 1777 :type filters: list | |
| 1778 :param filters: | |
| 1779 | |
| 1780 :type max_records: integer | |
| 1781 :param max_records: The maximum number of records to include in the | |
| 1782 response. If more records exist than the specified `MaxRecords` | |
| 1783 value, a pagination token called a marker is included in the | |
| 1784 response so that the remaining results may be retrieved. | |
| 1785 Default: 100 | |
| 1786 | |
| 1787 Constraints: minimum 20, maximum 100 | |
| 1788 | |
| 1789 :type marker: string | |
| 1790 :param marker: An optional pagination token provided by a previous | |
| 1791 `DescribeDBSnapshots` request. If this parameter is specified, the | |
| 1792 response includes only records beyond the marker, up to the value | |
| 1793 specified by `MaxRecords`. | |
| 1794 | |
| 1795 """ | |
| 1796 params = {} | |
| 1797 if db_instance_identifier is not None: | |
| 1798 params['DBInstanceIdentifier'] = db_instance_identifier | |
| 1799 if db_snapshot_identifier is not None: | |
| 1800 params['DBSnapshotIdentifier'] = db_snapshot_identifier | |
| 1801 if snapshot_type is not None: | |
| 1802 params['SnapshotType'] = snapshot_type | |
| 1803 if filters is not None: | |
| 1804 self.build_complex_list_params( | |
| 1805 params, filters, | |
| 1806 'Filters.member', | |
| 1807 ('FilterName', 'FilterValue')) | |
| 1808 if max_records is not None: | |
| 1809 params['MaxRecords'] = max_records | |
| 1810 if marker is not None: | |
| 1811 params['Marker'] = marker | |
| 1812 return self._make_request( | |
| 1813 action='DescribeDBSnapshots', | |
| 1814 verb='POST', | |
| 1815 path='/', params=params) | |
| 1816 | |
| 1817 def describe_db_subnet_groups(self, db_subnet_group_name=None, | |
| 1818 filters=None, max_records=None, | |
| 1819 marker=None): | |
| 1820 """ | |
| 1821 Returns a list of DBSubnetGroup descriptions. If a | |
| 1822 DBSubnetGroupName is specified, the list will contain only the | |
| 1823 descriptions of the specified DBSubnetGroup. | |
| 1824 | |
| 1825 For an overview of CIDR ranges, go to the `Wikipedia | |
| 1826 Tutorial`_. | |
| 1827 | |
| 1828 :type db_subnet_group_name: string | |
| 1829 :param db_subnet_group_name: The name of the DB subnet group to return | |
| 1830 details for. | |
| 1831 | |
| 1832 :type filters: list | |
| 1833 :param filters: | |
| 1834 | |
| 1835 :type max_records: integer | |
| 1836 :param max_records: The maximum number of records to include in the | |
| 1837 response. If more records exist than the specified `MaxRecords` | |
| 1838 value, a pagination token called a marker is included in the | |
| 1839 response so that the remaining results may be retrieved. | |
| 1840 Default: 100 | |
| 1841 | |
| 1842 Constraints: minimum 20, maximum 100 | |
| 1843 | |
| 1844 :type marker: string | |
| 1845 :param marker: An optional pagination token provided by a previous | |
| 1846 DescribeDBSubnetGroups request. If this parameter is specified, the | |
| 1847 response includes only records beyond the marker, up to the value | |
| 1848 specified by `MaxRecords`. | |
| 1849 | |
| 1850 """ | |
| 1851 params = {} | |
| 1852 if db_subnet_group_name is not None: | |
| 1853 params['DBSubnetGroupName'] = db_subnet_group_name | |
| 1854 if filters is not None: | |
| 1855 self.build_complex_list_params( | |
| 1856 params, filters, | |
| 1857 'Filters.member', | |
| 1858 ('FilterName', 'FilterValue')) | |
| 1859 if max_records is not None: | |
| 1860 params['MaxRecords'] = max_records | |
| 1861 if marker is not None: | |
| 1862 params['Marker'] = marker | |
| 1863 return self._make_request( | |
| 1864 action='DescribeDBSubnetGroups', | |
| 1865 verb='POST', | |
| 1866 path='/', params=params) | |
| 1867 | |
| 1868 def describe_engine_default_parameters(self, db_parameter_group_family, | |
| 1869 max_records=None, marker=None): | |
| 1870 """ | |
| 1871 Returns the default engine and system parameter information | |
| 1872 for the specified database engine. | |
| 1873 | |
| 1874 :type db_parameter_group_family: string | |
| 1875 :param db_parameter_group_family: The name of the DB parameter group | |
| 1876 family. | |
| 1877 | |
| 1878 :type max_records: integer | |
| 1879 :param max_records: The maximum number of records to include in the | |
| 1880 response. If more records exist than the specified `MaxRecords` | |
| 1881 value, a pagination token called a marker is included in the | |
| 1882 response so that the remaining results may be retrieved. | |
| 1883 Default: 100 | |
| 1884 | |
| 1885 Constraints: minimum 20, maximum 100 | |
| 1886 | |
| 1887 :type marker: string | |
| 1888 :param marker: An optional pagination token provided by a previous | |
| 1889 `DescribeEngineDefaultParameters` request. If this parameter is | |
| 1890 specified, the response includes only records beyond the marker, up | |
| 1891 to the value specified by `MaxRecords`. | |
| 1892 | |
| 1893 """ | |
| 1894 params = { | |
| 1895 'DBParameterGroupFamily': db_parameter_group_family, | |
| 1896 } | |
| 1897 if max_records is not None: | |
| 1898 params['MaxRecords'] = max_records | |
| 1899 if marker is not None: | |
| 1900 params['Marker'] = marker | |
| 1901 return self._make_request( | |
| 1902 action='DescribeEngineDefaultParameters', | |
| 1903 verb='POST', | |
| 1904 path='/', params=params) | |
| 1905 | |
| 1906 def describe_event_categories(self, source_type=None): | |
| 1907 """ | |
| 1908 Displays a list of categories for all event source types, or, | |
| 1909 if specified, for a specified source type. You can see a list | |
| 1910 of the event categories and source types in the ` Events`_ | |
| 1911 topic in the Amazon RDS User Guide. | |
| 1912 | |
| 1913 :type source_type: string | |
| 1914 :param source_type: The type of source that will be generating the | |
| 1915 events. | |
| 1916 Valid values: db-instance | db-parameter-group | db-security-group | | |
| 1917 db-snapshot | |
| 1918 | |
| 1919 """ | |
| 1920 params = {} | |
| 1921 if source_type is not None: | |
| 1922 params['SourceType'] = source_type | |
| 1923 return self._make_request( | |
| 1924 action='DescribeEventCategories', | |
| 1925 verb='POST', | |
| 1926 path='/', params=params) | |
| 1927 | |
| 1928 def describe_event_subscriptions(self, subscription_name=None, | |
| 1929 filters=None, max_records=None, | |
| 1930 marker=None): | |
| 1931 """ | |
| 1932 Lists all the subscription descriptions for a customer | |
| 1933 account. The description for a subscription includes | |
| 1934 SubscriptionName, SNSTopicARN, CustomerID, SourceType, | |
| 1935 SourceID, CreationTime, and Status. | |
| 1936 | |
| 1937 If you specify a SubscriptionName, lists the description for | |
| 1938 that subscription. | |
| 1939 | |
| 1940 :type subscription_name: string | |
| 1941 :param subscription_name: The name of the RDS event notification | |
| 1942 subscription you want to describe. | |
| 1943 | |
| 1944 :type filters: list | |
| 1945 :param filters: | |
| 1946 | |
| 1947 :type max_records: integer | |
| 1948 :param max_records: The maximum number of records to include in the | |
| 1949 response. If more records exist than the specified `MaxRecords` | |
| 1950 value, a pagination token called a marker is included in the | |
| 1951 response so that the remaining results can be retrieved. | |
| 1952 Default: 100 | |
| 1953 | |
| 1954 Constraints: minimum 20, maximum 100 | |
| 1955 | |
| 1956 :type marker: string | |
| 1957 :param marker: An optional pagination token provided by a previous | |
| 1958 DescribeOrderableDBInstanceOptions request. If this parameter is | |
| 1959 specified, the response includes only records beyond the marker, up | |
| 1960 to the value specified by `MaxRecords` . | |
| 1961 | |
| 1962 """ | |
| 1963 params = {} | |
| 1964 if subscription_name is not None: | |
| 1965 params['SubscriptionName'] = subscription_name | |
| 1966 if filters is not None: | |
| 1967 self.build_complex_list_params( | |
| 1968 params, filters, | |
| 1969 'Filters.member', | |
| 1970 ('FilterName', 'FilterValue')) | |
| 1971 if max_records is not None: | |
| 1972 params['MaxRecords'] = max_records | |
| 1973 if marker is not None: | |
| 1974 params['Marker'] = marker | |
| 1975 return self._make_request( | |
| 1976 action='DescribeEventSubscriptions', | |
| 1977 verb='POST', | |
| 1978 path='/', params=params) | |
| 1979 | |
| 1980 def describe_events(self, source_identifier=None, source_type=None, | |
| 1981 start_time=None, end_time=None, duration=None, | |
| 1982 event_categories=None, max_records=None, marker=None): | |
| 1983 """ | |
| 1984 Returns events related to DB instances, DB security groups, DB | |
| 1985 snapshots, and DB parameter groups for the past 14 days. | |
| 1986 Events specific to a particular DB instance, DB security | |
| 1987 group, database snapshot, or DB parameter group can be | |
| 1988 obtained by providing the name as a parameter. By default, the | |
| 1989 past hour of events are returned. | |
| 1990 | |
| 1991 :type source_identifier: string | |
| 1992 :param source_identifier: | |
| 1993 The identifier of the event source for which events will be returned. | |
| 1994 If not specified, then all sources are included in the response. | |
| 1995 | |
| 1996 Constraints: | |
| 1997 | |
| 1998 | |
| 1999 + If SourceIdentifier is supplied, SourceType must also be provided. | |
| 2000 + If the source type is `DBInstance`, then a `DBInstanceIdentifier` | |
| 2001 must be supplied. | |
| 2002 + If the source type is `DBSecurityGroup`, a `DBSecurityGroupName` must | |
| 2003 be supplied. | |
| 2004 + If the source type is `DBParameterGroup`, a `DBParameterGroupName` | |
| 2005 must be supplied. | |
| 2006 + If the source type is `DBSnapshot`, a `DBSnapshotIdentifier` must be | |
| 2007 supplied. | |
| 2008 + Cannot end with a hyphen or contain two consecutive hyphens. | |
| 2009 | |
| 2010 :type source_type: string | |
| 2011 :param source_type: The event source to retrieve events for. If no | |
| 2012 value is specified, all events are returned. | |
| 2013 | |
| 2014 :type start_time: timestamp | |
| 2015 :param start_time: The beginning of the time interval to retrieve | |
| 2016 events for, specified in ISO 8601 format. For more information | |
| 2017 about ISO 8601, go to the `ISO8601 Wikipedia page.`_ | |
| 2018 Example: 2009-07-08T18:00Z | |
| 2019 | |
| 2020 :type end_time: timestamp | |
| 2021 :param end_time: The end of the time interval for which to retrieve | |
| 2022 events, specified in ISO 8601 format. For more information about | |
| 2023 ISO 8601, go to the `ISO8601 Wikipedia page.`_ | |
| 2024 Example: 2009-07-08T18:00Z | |
| 2025 | |
| 2026 :type duration: integer | |
| 2027 :param duration: The number of minutes to retrieve events for. | |
| 2028 Default: 60 | |
| 2029 | |
| 2030 :type event_categories: list | |
| 2031 :param event_categories: A list of event categories that trigger | |
| 2032 notifications for a event notification subscription. | |
| 2033 | |
| 2034 :type max_records: integer | |
| 2035 :param max_records: The maximum number of records to include in the | |
| 2036 response. If more records exist than the specified `MaxRecords` | |
| 2037 value, a pagination token called a marker is included in the | |
| 2038 response so that the remaining results may be retrieved. | |
| 2039 Default: 100 | |
| 2040 | |
| 2041 Constraints: minimum 20, maximum 100 | |
| 2042 | |
| 2043 :type marker: string | |
| 2044 :param marker: An optional pagination token provided by a previous | |
| 2045 DescribeEvents request. If this parameter is specified, the | |
| 2046 response includes only records beyond the marker, up to the value | |
| 2047 specified by `MaxRecords`. | |
| 2048 | |
| 2049 """ | |
| 2050 params = {} | |
| 2051 if source_identifier is not None: | |
| 2052 params['SourceIdentifier'] = source_identifier | |
| 2053 if source_type is not None: | |
| 2054 params['SourceType'] = source_type | |
| 2055 if start_time is not None: | |
| 2056 params['StartTime'] = start_time | |
| 2057 if end_time is not None: | |
| 2058 params['EndTime'] = end_time | |
| 2059 if duration is not None: | |
| 2060 params['Duration'] = duration | |
| 2061 if event_categories is not None: | |
| 2062 self.build_list_params(params, | |
| 2063 event_categories, | |
| 2064 'EventCategories.member') | |
| 2065 if max_records is not None: | |
| 2066 params['MaxRecords'] = max_records | |
| 2067 if marker is not None: | |
| 2068 params['Marker'] = marker | |
| 2069 return self._make_request( | |
| 2070 action='DescribeEvents', | |
| 2071 verb='POST', | |
| 2072 path='/', params=params) | |
| 2073 | |
| 2074 def describe_option_group_options(self, engine_name, | |
| 2075 major_engine_version=None, | |
| 2076 max_records=None, marker=None): | |
| 2077 """ | |
| 2078 Describes all available options. | |
| 2079 | |
| 2080 :type engine_name: string | |
| 2081 :param engine_name: A required parameter. Options available for the | |
| 2082 given Engine name will be described. | |
| 2083 | |
| 2084 :type major_engine_version: string | |
| 2085 :param major_engine_version: If specified, filters the results to | |
| 2086 include only options for the specified major engine version. | |
| 2087 | |
| 2088 :type max_records: integer | |
| 2089 :param max_records: The maximum number of records to include in the | |
| 2090 response. If more records exist than the specified `MaxRecords` | |
| 2091 value, a pagination token called a marker is included in the | |
| 2092 response so that the remaining results can be retrieved. | |
| 2093 Default: 100 | |
| 2094 | |
| 2095 Constraints: minimum 20, maximum 100 | |
| 2096 | |
| 2097 :type marker: string | |
| 2098 :param marker: An optional pagination token provided by a previous | |
| 2099 request. If this parameter is specified, the response includes only | |
| 2100 records beyond the marker, up to the value specified by | |
| 2101 `MaxRecords`. | |
| 2102 | |
| 2103 """ | |
| 2104 params = {'EngineName': engine_name, } | |
| 2105 if major_engine_version is not None: | |
| 2106 params['MajorEngineVersion'] = major_engine_version | |
| 2107 if max_records is not None: | |
| 2108 params['MaxRecords'] = max_records | |
| 2109 if marker is not None: | |
| 2110 params['Marker'] = marker | |
| 2111 return self._make_request( | |
| 2112 action='DescribeOptionGroupOptions', | |
| 2113 verb='POST', | |
| 2114 path='/', params=params) | |
| 2115 | |
| 2116 def describe_option_groups(self, option_group_name=None, filters=None, | |
| 2117 marker=None, max_records=None, | |
| 2118 engine_name=None, major_engine_version=None): | |
| 2119 """ | |
| 2120 Describes the available option groups. | |
| 2121 | |
| 2122 :type option_group_name: string | |
| 2123 :param option_group_name: The name of the option group to describe. | |
| 2124 Cannot be supplied together with EngineName or MajorEngineVersion. | |
| 2125 | |
| 2126 :type filters: list | |
| 2127 :param filters: | |
| 2128 | |
| 2129 :type marker: string | |
| 2130 :param marker: An optional pagination token provided by a previous | |
| 2131 DescribeOptionGroups request. If this parameter is specified, the | |
| 2132 response includes only records beyond the marker, up to the value | |
| 2133 specified by `MaxRecords`. | |
| 2134 | |
| 2135 :type max_records: integer | |
| 2136 :param max_records: The maximum number of records to include in the | |
| 2137 response. If more records exist than the specified `MaxRecords` | |
| 2138 value, a pagination token called a marker is included in the | |
| 2139 response so that the remaining results can be retrieved. | |
| 2140 Default: 100 | |
| 2141 | |
| 2142 Constraints: minimum 20, maximum 100 | |
| 2143 | |
| 2144 :type engine_name: string | |
| 2145 :param engine_name: Filters the list of option groups to only include | |
| 2146 groups associated with a specific database engine. | |
| 2147 | |
| 2148 :type major_engine_version: string | |
| 2149 :param major_engine_version: Filters the list of option groups to only | |
| 2150 include groups associated with a specific database engine version. | |
| 2151 If specified, then EngineName must also be specified. | |
| 2152 | |
| 2153 """ | |
| 2154 params = {} | |
| 2155 if option_group_name is not None: | |
| 2156 params['OptionGroupName'] = option_group_name | |
| 2157 if filters is not None: | |
| 2158 self.build_complex_list_params( | |
| 2159 params, filters, | |
| 2160 'Filters.member', | |
| 2161 ('FilterName', 'FilterValue')) | |
| 2162 if marker is not None: | |
| 2163 params['Marker'] = marker | |
| 2164 if max_records is not None: | |
| 2165 params['MaxRecords'] = max_records | |
| 2166 if engine_name is not None: | |
| 2167 params['EngineName'] = engine_name | |
| 2168 if major_engine_version is not None: | |
| 2169 params['MajorEngineVersion'] = major_engine_version | |
| 2170 return self._make_request( | |
| 2171 action='DescribeOptionGroups', | |
| 2172 verb='POST', | |
| 2173 path='/', params=params) | |
| 2174 | |
| 2175 def describe_orderable_db_instance_options(self, engine, | |
| 2176 engine_version=None, | |
| 2177 db_instance_class=None, | |
| 2178 license_model=None, vpc=None, | |
| 2179 max_records=None, marker=None): | |
| 2180 """ | |
| 2181 Returns a list of orderable DB instance options for the | |
| 2182 specified engine. | |
| 2183 | |
| 2184 :type engine: string | |
| 2185 :param engine: The name of the engine to retrieve DB instance options | |
| 2186 for. | |
| 2187 | |
| 2188 :type engine_version: string | |
| 2189 :param engine_version: The engine version filter value. Specify this | |
| 2190 parameter to show only the available offerings matching the | |
| 2191 specified engine version. | |
| 2192 | |
| 2193 :type db_instance_class: string | |
| 2194 :param db_instance_class: The DB instance class filter value. Specify | |
| 2195 this parameter to show only the available offerings matching the | |
| 2196 specified DB instance class. | |
| 2197 | |
| 2198 :type license_model: string | |
| 2199 :param license_model: The license model filter value. Specify this | |
| 2200 parameter to show only the available offerings matching the | |
| 2201 specified license model. | |
| 2202 | |
| 2203 :type vpc: boolean | |
| 2204 :param vpc: The VPC filter value. Specify this parameter to show only | |
| 2205 the available VPC or non-VPC offerings. | |
| 2206 | |
| 2207 :type max_records: integer | |
| 2208 :param max_records: The maximum number of records to include in the | |
| 2209 response. If more records exist than the specified `MaxRecords` | |
| 2210 value, a pagination token called a marker is included in the | |
| 2211 response so that the remaining results can be retrieved. | |
| 2212 Default: 100 | |
| 2213 | |
| 2214 Constraints: minimum 20, maximum 100 | |
| 2215 | |
| 2216 :type marker: string | |
| 2217 :param marker: An optional pagination token provided by a previous | |
| 2218 DescribeOrderableDBInstanceOptions request. If this parameter is | |
| 2219 specified, the response includes only records beyond the marker, up | |
| 2220 to the value specified by `MaxRecords` . | |
| 2221 | |
| 2222 """ | |
| 2223 params = {'Engine': engine, } | |
| 2224 if engine_version is not None: | |
| 2225 params['EngineVersion'] = engine_version | |
| 2226 if db_instance_class is not None: | |
| 2227 params['DBInstanceClass'] = db_instance_class | |
| 2228 if license_model is not None: | |
| 2229 params['LicenseModel'] = license_model | |
| 2230 if vpc is not None: | |
| 2231 params['Vpc'] = str( | |
| 2232 vpc).lower() | |
| 2233 if max_records is not None: | |
| 2234 params['MaxRecords'] = max_records | |
| 2235 if marker is not None: | |
| 2236 params['Marker'] = marker | |
| 2237 return self._make_request( | |
| 2238 action='DescribeOrderableDBInstanceOptions', | |
| 2239 verb='POST', | |
| 2240 path='/', params=params) | |
| 2241 | |
| 2242 def describe_reserved_db_instances(self, reserved_db_instance_id=None, | |
| 2243 reserved_db_instances_offering_id=None, | |
| 2244 db_instance_class=None, duration=None, | |
| 2245 product_description=None, | |
| 2246 offering_type=None, multi_az=None, | |
| 2247 filters=None, max_records=None, | |
| 2248 marker=None): | |
| 2249 """ | |
| 2250 Returns information about reserved DB instances for this | |
| 2251 account, or about a specified reserved DB instance. | |
| 2252 | |
| 2253 :type reserved_db_instance_id: string | |
| 2254 :param reserved_db_instance_id: The reserved DB instance identifier | |
| 2255 filter value. Specify this parameter to show only the reservation | |
| 2256 that matches the specified reservation ID. | |
| 2257 | |
| 2258 :type reserved_db_instances_offering_id: string | |
| 2259 :param reserved_db_instances_offering_id: The offering identifier | |
| 2260 filter value. Specify this parameter to show only purchased | |
| 2261 reservations matching the specified offering identifier. | |
| 2262 | |
| 2263 :type db_instance_class: string | |
| 2264 :param db_instance_class: The DB instance class filter value. Specify | |
| 2265 this parameter to show only those reservations matching the | |
| 2266 specified DB instances class. | |
| 2267 | |
| 2268 :type duration: string | |
| 2269 :param duration: The duration filter value, specified in years or | |
| 2270 seconds. Specify this parameter to show only reservations for this | |
| 2271 duration. | |
| 2272 Valid Values: `1 | 3 | 31536000 | 94608000` | |
| 2273 | |
| 2274 :type product_description: string | |
| 2275 :param product_description: The product description filter value. | |
| 2276 Specify this parameter to show only those reservations matching the | |
| 2277 specified product description. | |
| 2278 | |
| 2279 :type offering_type: string | |
| 2280 :param offering_type: The offering type filter value. Specify this | |
| 2281 parameter to show only the available offerings matching the | |
| 2282 specified offering type. | |
| 2283 Valid Values: `"Light Utilization" | "Medium Utilization" | "Heavy | |
| 2284 Utilization" ` | |
| 2285 | |
| 2286 :type multi_az: boolean | |
| 2287 :param multi_az: The Multi-AZ filter value. Specify this parameter to | |
| 2288 show only those reservations matching the specified Multi-AZ | |
| 2289 parameter. | |
| 2290 | |
| 2291 :type filters: list | |
| 2292 :param filters: | |
| 2293 | |
| 2294 :type max_records: integer | |
| 2295 :param max_records: The maximum number of records to include in the | |
| 2296 response. If more than the `MaxRecords` value is available, a | |
| 2297 pagination token called a marker is included in the response so | |
| 2298 that the following results can be retrieved. | |
| 2299 Default: 100 | |
| 2300 | |
| 2301 Constraints: minimum 20, maximum 100 | |
| 2302 | |
| 2303 :type marker: string | |
| 2304 :param marker: An optional pagination token provided by a previous | |
| 2305 request. If this parameter is specified, the response includes only | |
| 2306 records beyond the marker, up to the value specified by | |
| 2307 `MaxRecords`. | |
| 2308 | |
| 2309 """ | |
| 2310 params = {} | |
| 2311 if reserved_db_instance_id is not None: | |
| 2312 params['ReservedDBInstanceId'] = reserved_db_instance_id | |
| 2313 if reserved_db_instances_offering_id is not None: | |
| 2314 params['ReservedDBInstancesOfferingId'] = reserved_db_instances_offering_id | |
| 2315 if db_instance_class is not None: | |
| 2316 params['DBInstanceClass'] = db_instance_class | |
| 2317 if duration is not None: | |
| 2318 params['Duration'] = duration | |
| 2319 if product_description is not None: | |
| 2320 params['ProductDescription'] = product_description | |
| 2321 if offering_type is not None: | |
| 2322 params['OfferingType'] = offering_type | |
| 2323 if multi_az is not None: | |
| 2324 params['MultiAZ'] = str( | |
| 2325 multi_az).lower() | |
| 2326 if filters is not None: | |
| 2327 self.build_complex_list_params( | |
| 2328 params, filters, | |
| 2329 'Filters.member', | |
| 2330 ('FilterName', 'FilterValue')) | |
| 2331 if max_records is not None: | |
| 2332 params['MaxRecords'] = max_records | |
| 2333 if marker is not None: | |
| 2334 params['Marker'] = marker | |
| 2335 return self._make_request( | |
| 2336 action='DescribeReservedDBInstances', | |
| 2337 verb='POST', | |
| 2338 path='/', params=params) | |
| 2339 | |
| 2340 def describe_reserved_db_instances_offerings(self, | |
| 2341 reserved_db_instances_offering_id=None, | |
| 2342 db_instance_class=None, | |
| 2343 duration=None, | |
| 2344 product_description=None, | |
| 2345 offering_type=None, | |
| 2346 multi_az=None, | |
| 2347 max_records=None, | |
| 2348 marker=None): | |
| 2349 """ | |
| 2350 Lists available reserved DB instance offerings. | |
| 2351 | |
| 2352 :type reserved_db_instances_offering_id: string | |
| 2353 :param reserved_db_instances_offering_id: The offering identifier | |
| 2354 filter value. Specify this parameter to show only the available | |
| 2355 offering that matches the specified reservation identifier. | |
| 2356 Example: `438012d3-4052-4cc7-b2e3-8d3372e0e706` | |
| 2357 | |
| 2358 :type db_instance_class: string | |
| 2359 :param db_instance_class: The DB instance class filter value. Specify | |
| 2360 this parameter to show only the available offerings matching the | |
| 2361 specified DB instance class. | |
| 2362 | |
| 2363 :type duration: string | |
| 2364 :param duration: Duration filter value, specified in years or seconds. | |
| 2365 Specify this parameter to show only reservations for this duration. | |
| 2366 Valid Values: `1 | 3 | 31536000 | 94608000` | |
| 2367 | |
| 2368 :type product_description: string | |
| 2369 :param product_description: Product description filter value. Specify | |
| 2370 this parameter to show only the available offerings matching the | |
| 2371 specified product description. | |
| 2372 | |
| 2373 :type offering_type: string | |
| 2374 :param offering_type: The offering type filter value. Specify this | |
| 2375 parameter to show only the available offerings matching the | |
| 2376 specified offering type. | |
| 2377 Valid Values: `"Light Utilization" | "Medium Utilization" | "Heavy | |
| 2378 Utilization" ` | |
| 2379 | |
| 2380 :type multi_az: boolean | |
| 2381 :param multi_az: The Multi-AZ filter value. Specify this parameter to | |
| 2382 show only the available offerings matching the specified Multi-AZ | |
| 2383 parameter. | |
| 2384 | |
| 2385 :type max_records: integer | |
| 2386 :param max_records: The maximum number of records to include in the | |
| 2387 response. If more than the `MaxRecords` value is available, a | |
| 2388 pagination token called a marker is included in the response so | |
| 2389 that the following results can be retrieved. | |
| 2390 Default: 100 | |
| 2391 | |
| 2392 Constraints: minimum 20, maximum 100 | |
| 2393 | |
| 2394 :type marker: string | |
| 2395 :param marker: An optional pagination token provided by a previous | |
| 2396 request. If this parameter is specified, the response includes only | |
| 2397 records beyond the marker, up to the value specified by | |
| 2398 `MaxRecords`. | |
| 2399 | |
| 2400 """ | |
| 2401 params = {} | |
| 2402 if reserved_db_instances_offering_id is not None: | |
| 2403 params['ReservedDBInstancesOfferingId'] = reserved_db_instances_offering_id | |
| 2404 if db_instance_class is not None: | |
| 2405 params['DBInstanceClass'] = db_instance_class | |
| 2406 if duration is not None: | |
| 2407 params['Duration'] = duration | |
| 2408 if product_description is not None: | |
| 2409 params['ProductDescription'] = product_description | |
| 2410 if offering_type is not None: | |
| 2411 params['OfferingType'] = offering_type | |
| 2412 if multi_az is not None: | |
| 2413 params['MultiAZ'] = str( | |
| 2414 multi_az).lower() | |
| 2415 if max_records is not None: | |
| 2416 params['MaxRecords'] = max_records | |
| 2417 if marker is not None: | |
| 2418 params['Marker'] = marker | |
| 2419 return self._make_request( | |
| 2420 action='DescribeReservedDBInstancesOfferings', | |
| 2421 verb='POST', | |
| 2422 path='/', params=params) | |
| 2423 | |
| 2424 def download_db_log_file_portion(self, db_instance_identifier, | |
| 2425 log_file_name, marker=None, | |
| 2426 number_of_lines=None): | |
| 2427 """ | |
| 2428 Downloads the last line of the specified log file. | |
| 2429 | |
| 2430 :type db_instance_identifier: string | |
| 2431 :param db_instance_identifier: | |
| 2432 The customer-assigned name of the DB instance that contains the log | |
| 2433 files you want to list. | |
| 2434 | |
| 2435 Constraints: | |
| 2436 | |
| 2437 | |
| 2438 + Must contain from 1 to 63 alphanumeric characters or hyphens | |
| 2439 + First character must be a letter | |
| 2440 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 2441 | |
| 2442 :type log_file_name: string | |
| 2443 :param log_file_name: The name of the log file to be downloaded. | |
| 2444 | |
| 2445 :type marker: string | |
| 2446 :param marker: The pagination token provided in the previous request. | |
| 2447 If this parameter is specified the response includes only records | |
| 2448 beyond the marker, up to MaxRecords. | |
| 2449 | |
| 2450 :type number_of_lines: integer | |
| 2451 :param number_of_lines: The number of lines remaining to be downloaded. | |
| 2452 | |
| 2453 """ | |
| 2454 params = { | |
| 2455 'DBInstanceIdentifier': db_instance_identifier, | |
| 2456 'LogFileName': log_file_name, | |
| 2457 } | |
| 2458 if marker is not None: | |
| 2459 params['Marker'] = marker | |
| 2460 if number_of_lines is not None: | |
| 2461 params['NumberOfLines'] = number_of_lines | |
| 2462 return self._make_request( | |
| 2463 action='DownloadDBLogFilePortion', | |
| 2464 verb='POST', | |
| 2465 path='/', params=params) | |
| 2466 | |
| 2467 def list_tags_for_resource(self, resource_name): | |
| 2468 """ | |
| 2469 Lists all tags on an Amazon RDS resource. | |
| 2470 | |
| 2471 For an overview on tagging an Amazon RDS resource, see | |
| 2472 `Tagging Amazon RDS Resources`_. | |
| 2473 | |
| 2474 :type resource_name: string | |
| 2475 :param resource_name: The Amazon RDS resource with tags to be listed. | |
| 2476 This value is an Amazon Resource Name (ARN). For information about | |
| 2477 creating an ARN, see ` Constructing an RDS Amazon Resource Name | |
| 2478 (ARN)`_. | |
| 2479 | |
| 2480 """ | |
| 2481 params = {'ResourceName': resource_name, } | |
| 2482 return self._make_request( | |
| 2483 action='ListTagsForResource', | |
| 2484 verb='POST', | |
| 2485 path='/', params=params) | |
| 2486 | |
| 2487 def modify_db_instance(self, db_instance_identifier, | |
| 2488 allocated_storage=None, db_instance_class=None, | |
| 2489 db_security_groups=None, | |
| 2490 vpc_security_group_ids=None, | |
| 2491 apply_immediately=None, master_user_password=None, | |
| 2492 db_parameter_group_name=None, | |
| 2493 backup_retention_period=None, | |
| 2494 preferred_backup_window=None, | |
| 2495 preferred_maintenance_window=None, multi_az=None, | |
| 2496 engine_version=None, | |
| 2497 allow_major_version_upgrade=None, | |
| 2498 auto_minor_version_upgrade=None, iops=None, | |
| 2499 option_group_name=None, | |
| 2500 new_db_instance_identifier=None): | |
| 2501 """ | |
| 2502 Modify settings for a DB instance. You can change one or more | |
| 2503 database configuration parameters by specifying these | |
| 2504 parameters and the new values in the request. | |
| 2505 | |
| 2506 :type db_instance_identifier: string | |
| 2507 :param db_instance_identifier: | |
| 2508 The DB instance identifier. This value is stored as a lowercase string. | |
| 2509 | |
| 2510 Constraints: | |
| 2511 | |
| 2512 | |
| 2513 + Must be the identifier for an existing DB instance | |
| 2514 + Must contain from 1 to 63 alphanumeric characters or hyphens | |
| 2515 + First character must be a letter | |
| 2516 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 2517 | |
| 2518 :type allocated_storage: integer | |
| 2519 :param allocated_storage: The new storage capacity of the RDS instance. | |
| 2520 Changing this parameter does not result in an outage and the change | |
| 2521 is applied during the next maintenance window unless the | |
| 2522 `ApplyImmediately` parameter is set to `True` for this request. | |
| 2523 **MySQL** | |
| 2524 | |
| 2525 Default: Uses existing setting | |
| 2526 | |
| 2527 Valid Values: 5-1024 | |
| 2528 | |
| 2529 Constraints: Value supplied must be at least 10% greater than the | |
| 2530 current value. Values that are not at least 10% greater than the | |
| 2531 existing value are rounded up so that they are 10% greater than the | |
| 2532 current value. | |
| 2533 | |
| 2534 Type: Integer | |
| 2535 | |
| 2536 **Oracle** | |
| 2537 | |
| 2538 Default: Uses existing setting | |
| 2539 | |
| 2540 Valid Values: 10-1024 | |
| 2541 | |
| 2542 Constraints: Value supplied must be at least 10% greater than the | |
| 2543 current value. Values that are not at least 10% greater than the | |
| 2544 existing value are rounded up so that they are 10% greater than the | |
| 2545 current value. | |
| 2546 | |
| 2547 **SQL Server** | |
| 2548 | |
| 2549 Cannot be modified. | |
| 2550 | |
| 2551 If you choose to migrate your DB instance from using standard storage | |
| 2552 to using Provisioned IOPS, or from using Provisioned IOPS to using | |
| 2553 standard storage, the process can take time. The duration of the | |
| 2554 migration depends on several factors such as database load, storage | |
| 2555 size, storage type (standard or Provisioned IOPS), amount of IOPS | |
| 2556 provisioned (if any), and the number of prior scale storage | |
| 2557 operations. Typical migration times are under 24 hours, but the | |
| 2558 process can take up to several days in some cases. During the | |
| 2559 migration, the DB instance will be available for use, but may | |
| 2560 experience performance degradation. While the migration takes | |
| 2561 place, nightly backups for the instance will be suspended. No other | |
| 2562 Amazon RDS operations can take place for the instance, including | |
| 2563 modifying the instance, rebooting the instance, deleting the | |
| 2564 instance, creating a read replica for the instance, and creating a | |
| 2565 DB snapshot of the instance. | |
| 2566 | |
| 2567 :type db_instance_class: string | |
| 2568 :param db_instance_class: The new compute and memory capacity of the DB | |
| 2569 instance. To determine the instance classes that are available for | |
| 2570 a particular DB engine, use the DescribeOrderableDBInstanceOptions | |
| 2571 action. | |
| 2572 Passing a value for this parameter causes an outage during the change | |
| 2573 and is applied during the next maintenance window, unless the | |
| 2574 `ApplyImmediately` parameter is specified as `True` for this | |
| 2575 request. | |
| 2576 | |
| 2577 Default: Uses existing setting | |
| 2578 | |
| 2579 Valid Values: `db.t1.micro | db.m1.small | db.m1.medium | db.m1.large | | |
| 2580 db.m1.xlarge | db.m2.xlarge | db.m2.2xlarge | db.m2.4xlarge` | |
| 2581 | |
| 2582 :type db_security_groups: list | |
| 2583 :param db_security_groups: | |
| 2584 A list of DB security groups to authorize on this DB instance. Changing | |
| 2585 this parameter does not result in an outage and the change is | |
| 2586 asynchronously applied as soon as possible. | |
| 2587 | |
| 2588 Constraints: | |
| 2589 | |
| 2590 | |
| 2591 + Must be 1 to 255 alphanumeric characters | |
| 2592 + First character must be a letter | |
| 2593 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 2594 | |
| 2595 :type vpc_security_group_ids: list | |
| 2596 :param vpc_security_group_ids: | |
| 2597 A list of EC2 VPC security groups to authorize on this DB instance. | |
| 2598 This change is asynchronously applied as soon as possible. | |
| 2599 | |
| 2600 Constraints: | |
| 2601 | |
| 2602 | |
| 2603 + Must be 1 to 255 alphanumeric characters | |
| 2604 + First character must be a letter | |
| 2605 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 2606 | |
| 2607 :type apply_immediately: boolean | |
| 2608 :param apply_immediately: Specifies whether or not the modifications in | |
| 2609 this request and any pending modifications are asynchronously | |
| 2610 applied as soon as possible, regardless of the | |
| 2611 `PreferredMaintenanceWindow` setting for the DB instance. | |
| 2612 If this parameter is passed as `False`, changes to the DB instance are | |
| 2613 applied on the next call to RebootDBInstance, the next maintenance | |
| 2614 reboot, or the next failure reboot, whichever occurs first. See | |
| 2615 each parameter to determine when a change is applied. | |
| 2616 | |
| 2617 Default: `False` | |
| 2618 | |
| 2619 :type master_user_password: string | |
| 2620 :param master_user_password: | |
| 2621 The new password for the DB instance master user. Can be any printable | |
| 2622 ASCII character except "/", '"', or "@". | |
| 2623 | |
| 2624 Changing this parameter does not result in an outage and the change is | |
| 2625 asynchronously applied as soon as possible. Between the time of the | |
| 2626 request and the completion of the request, the `MasterUserPassword` | |
| 2627 element exists in the `PendingModifiedValues` element of the | |
| 2628 operation response. | |
| 2629 | |
| 2630 Default: Uses existing setting | |
| 2631 | |
| 2632 Constraints: Must be 8 to 41 alphanumeric characters (MySQL), 8 to 30 | |
| 2633 alphanumeric characters (Oracle), or 8 to 128 alphanumeric | |
| 2634 characters (SQL Server). | |
| 2635 | |
| 2636 Amazon RDS API actions never return the password, so this action | |
| 2637 provides a way to regain access to a master instance user if the | |
| 2638 password is lost. | |
| 2639 | |
| 2640 :type db_parameter_group_name: string | |
| 2641 :param db_parameter_group_name: The name of the DB parameter group to | |
| 2642 apply to this DB instance. Changing this parameter does not result | |
| 2643 in an outage and the change is applied during the next maintenance | |
| 2644 window unless the `ApplyImmediately` parameter is set to `True` for | |
| 2645 this request. | |
| 2646 Default: Uses existing setting | |
| 2647 | |
| 2648 Constraints: The DB parameter group must be in the same DB parameter | |
| 2649 group family as this DB instance. | |
| 2650 | |
| 2651 :type backup_retention_period: integer | |
| 2652 :param backup_retention_period: | |
| 2653 The number of days to retain automated backups. Setting this parameter | |
| 2654 to a positive number enables backups. Setting this parameter to 0 | |
| 2655 disables automated backups. | |
| 2656 | |
| 2657 Changing this parameter can result in an outage if you change from 0 to | |
| 2658 a non-zero value or from a non-zero value to 0. These changes are | |
| 2659 applied during the next maintenance window unless the | |
| 2660 `ApplyImmediately` parameter is set to `True` for this request. If | |
| 2661 you change the parameter from one non-zero value to another non- | |
| 2662 zero value, the change is asynchronously applied as soon as | |
| 2663 possible. | |
| 2664 | |
| 2665 Default: Uses existing setting | |
| 2666 | |
| 2667 Constraints: | |
| 2668 | |
| 2669 | |
| 2670 + Must be a value from 0 to 8 | |
| 2671 + Cannot be set to 0 if the DB instance is a master instance with read | |
| 2672 replicas or if the DB instance is a read replica | |
| 2673 | |
| 2674 :type preferred_backup_window: string | |
| 2675 :param preferred_backup_window: | |
| 2676 The daily time range during which automated backups are created if | |
| 2677 automated backups are enabled, as determined by the | |
| 2678 `BackupRetentionPeriod`. Changing this parameter does not result in | |
| 2679 an outage and the change is asynchronously applied as soon as | |
| 2680 possible. | |
| 2681 | |
| 2682 Constraints: | |
| 2683 | |
| 2684 | |
| 2685 + Must be in the format hh24:mi-hh24:mi | |
| 2686 + Times should be Universal Time Coordinated (UTC) | |
| 2687 + Must not conflict with the preferred maintenance window | |
| 2688 + Must be at least 30 minutes | |
| 2689 | |
| 2690 :type preferred_maintenance_window: string | |
| 2691 :param preferred_maintenance_window: The weekly time range (in UTC) | |
| 2692 during which system maintenance can occur, which may result in an | |
| 2693 outage. Changing this parameter does not result in an outage, | |
| 2694 except in the following situation, and the change is asynchronously | |
| 2695 applied as soon as possible. If there are pending actions that | |
| 2696 cause a reboot, and the maintenance window is changed to include | |
| 2697 the current time, then changing this parameter will cause a reboot | |
| 2698 of the DB instance. If moving this window to the current time, | |
| 2699 there must be at least 30 minutes between the current time and end | |
| 2700 of the window to ensure pending changes are applied. | |
| 2701 Default: Uses existing setting | |
| 2702 | |
| 2703 Format: ddd:hh24:mi-ddd:hh24:mi | |
| 2704 | |
| 2705 Valid Days: Mon | Tue | Wed | Thu | Fri | Sat | Sun | |
| 2706 | |
| 2707 Constraints: Must be at least 30 minutes | |
| 2708 | |
| 2709 :type multi_az: boolean | |
| 2710 :param multi_az: Specifies if the DB instance is a Multi-AZ deployment. | |
| 2711 Changing this parameter does not result in an outage and the change | |
| 2712 is applied during the next maintenance window unless the | |
| 2713 `ApplyImmediately` parameter is set to `True` for this request. | |
| 2714 Constraints: Cannot be specified if the DB instance is a read replica. | |
| 2715 | |
| 2716 :type engine_version: string | |
| 2717 :param engine_version: The version number of the database engine to | |
| 2718 upgrade to. Changing this parameter results in an outage and the | |
| 2719 change is applied during the next maintenance window unless the | |
| 2720 `ApplyImmediately` parameter is set to `True` for this request. | |
| 2721 For major version upgrades, if a non-default DB parameter group is | |
| 2722 currently in use, a new DB parameter group in the DB parameter | |
| 2723 group family for the new engine version must be specified. The new | |
| 2724 DB parameter group can be the default for that DB parameter group | |
| 2725 family. | |
| 2726 | |
| 2727 Example: `5.1.42` | |
| 2728 | |
| 2729 :type allow_major_version_upgrade: boolean | |
| 2730 :param allow_major_version_upgrade: Indicates that major version | |
| 2731 upgrades are allowed. Changing this parameter does not result in an | |
| 2732 outage and the change is asynchronously applied as soon as | |
| 2733 possible. | |
| 2734 Constraints: This parameter must be set to true when specifying a value | |
| 2735 for the EngineVersion parameter that is a different major version | |
| 2736 than the DB instance's current version. | |
| 2737 | |
| 2738 :type auto_minor_version_upgrade: boolean | |
| 2739 :param auto_minor_version_upgrade: Indicates that minor version | |
| 2740 upgrades will be applied automatically to the DB instance during | |
| 2741 the maintenance window. Changing this parameter does not result in | |
| 2742 an outage except in the following case and the change is | |
| 2743 asynchronously applied as soon as possible. An outage will result | |
| 2744 if this parameter is set to `True` during the maintenance window, | |
| 2745 and a newer minor version is available, and RDS has enabled auto | |
| 2746 patching for that engine version. | |
| 2747 | |
| 2748 :type iops: integer | |
| 2749 :param iops: The new Provisioned IOPS (I/O operations per second) value | |
| 2750 for the RDS instance. Changing this parameter does not result in an | |
| 2751 outage and the change is applied during the next maintenance window | |
| 2752 unless the `ApplyImmediately` parameter is set to `True` for this | |
| 2753 request. | |
| 2754 Default: Uses existing setting | |
| 2755 | |
| 2756 Constraints: Value supplied must be at least 10% greater than the | |
| 2757 current value. Values that are not at least 10% greater than the | |
| 2758 existing value are rounded up so that they are 10% greater than the | |
| 2759 current value. | |
| 2760 | |
| 2761 Type: Integer | |
| 2762 | |
| 2763 If you choose to migrate your DB instance from using standard storage | |
| 2764 to using Provisioned IOPS, or from using Provisioned IOPS to using | |
| 2765 standard storage, the process can take time. The duration of the | |
| 2766 migration depends on several factors such as database load, storage | |
| 2767 size, storage type (standard or Provisioned IOPS), amount of IOPS | |
| 2768 provisioned (if any), and the number of prior scale storage | |
| 2769 operations. Typical migration times are under 24 hours, but the | |
| 2770 process can take up to several days in some cases. During the | |
| 2771 migration, the DB instance will be available for use, but may | |
| 2772 experience performance degradation. While the migration takes | |
| 2773 place, nightly backups for the instance will be suspended. No other | |
| 2774 Amazon RDS operations can take place for the instance, including | |
| 2775 modifying the instance, rebooting the instance, deleting the | |
| 2776 instance, creating a read replica for the instance, and creating a | |
| 2777 DB snapshot of the instance. | |
| 2778 | |
| 2779 :type option_group_name: string | |
| 2780 :param option_group_name: Indicates that the DB instance should be | |
| 2781 associated with the specified option group. Changing this parameter | |
| 2782 does not result in an outage except in the following case and the | |
| 2783 change is applied during the next maintenance window unless the | |
| 2784 `ApplyImmediately` parameter is set to `True` for this request. If | |
| 2785 the parameter change results in an option group that enables OEM, | |
| 2786 this change can cause a brief (sub-second) period during which new | |
| 2787 connections are rejected but existing connections are not | |
| 2788 interrupted. | |
| 2789 Permanent options, such as the TDE option for Oracle Advanced Security | |
| 2790 TDE, cannot be removed from an option group, and that option group | |
| 2791 cannot be removed from a DB instance once it is associated with a | |
| 2792 DB instance | |
| 2793 | |
| 2794 :type new_db_instance_identifier: string | |
| 2795 :param new_db_instance_identifier: | |
| 2796 The new DB instance identifier for the DB instance when renaming a DB | |
| 2797 Instance. This value is stored as a lowercase string. | |
| 2798 | |
| 2799 Constraints: | |
| 2800 | |
| 2801 | |
| 2802 + Must contain from 1 to 63 alphanumeric characters or hyphens | |
| 2803 + First character must be a letter | |
| 2804 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 2805 | |
| 2806 """ | |
| 2807 params = {'DBInstanceIdentifier': db_instance_identifier, } | |
| 2808 if allocated_storage is not None: | |
| 2809 params['AllocatedStorage'] = allocated_storage | |
| 2810 if db_instance_class is not None: | |
| 2811 params['DBInstanceClass'] = db_instance_class | |
| 2812 if db_security_groups is not None: | |
| 2813 self.build_list_params(params, | |
| 2814 db_security_groups, | |
| 2815 'DBSecurityGroups.member') | |
| 2816 if vpc_security_group_ids is not None: | |
| 2817 self.build_list_params(params, | |
| 2818 vpc_security_group_ids, | |
| 2819 'VpcSecurityGroupIds.member') | |
| 2820 if apply_immediately is not None: | |
| 2821 params['ApplyImmediately'] = str( | |
| 2822 apply_immediately).lower() | |
| 2823 if master_user_password is not None: | |
| 2824 params['MasterUserPassword'] = master_user_password | |
| 2825 if db_parameter_group_name is not None: | |
| 2826 params['DBParameterGroupName'] = db_parameter_group_name | |
| 2827 if backup_retention_period is not None: | |
| 2828 params['BackupRetentionPeriod'] = backup_retention_period | |
| 2829 if preferred_backup_window is not None: | |
| 2830 params['PreferredBackupWindow'] = preferred_backup_window | |
| 2831 if preferred_maintenance_window is not None: | |
| 2832 params['PreferredMaintenanceWindow'] = preferred_maintenance_window | |
| 2833 if multi_az is not None: | |
| 2834 params['MultiAZ'] = str( | |
| 2835 multi_az).lower() | |
| 2836 if engine_version is not None: | |
| 2837 params['EngineVersion'] = engine_version | |
| 2838 if allow_major_version_upgrade is not None: | |
| 2839 params['AllowMajorVersionUpgrade'] = str( | |
| 2840 allow_major_version_upgrade).lower() | |
| 2841 if auto_minor_version_upgrade is not None: | |
| 2842 params['AutoMinorVersionUpgrade'] = str( | |
| 2843 auto_minor_version_upgrade).lower() | |
| 2844 if iops is not None: | |
| 2845 params['Iops'] = iops | |
| 2846 if option_group_name is not None: | |
| 2847 params['OptionGroupName'] = option_group_name | |
| 2848 if new_db_instance_identifier is not None: | |
| 2849 params['NewDBInstanceIdentifier'] = new_db_instance_identifier | |
| 2850 return self._make_request( | |
| 2851 action='ModifyDBInstance', | |
| 2852 verb='POST', | |
| 2853 path='/', params=params) | |
| 2854 | |
| 2855 def modify_db_parameter_group(self, db_parameter_group_name, parameters): | |
| 2856 """ | |
| 2857 Modifies the parameters of a DB parameter group. To modify | |
| 2858 more than one parameter, submit a list of the following: | |
| 2859 `ParameterName`, `ParameterValue`, and `ApplyMethod`. A | |
| 2860 maximum of 20 parameters can be modified in a single request. | |
| 2861 | |
| 2862 The `apply-immediate` method can be used only for dynamic | |
| 2863 parameters; the `pending-reboot` method can be used with MySQL | |
| 2864 and Oracle DB instances for either dynamic or static | |
| 2865 parameters. For Microsoft SQL Server DB instances, the | |
| 2866 `pending-reboot` method can be used only for static | |
| 2867 parameters. | |
| 2868 | |
| 2869 :type db_parameter_group_name: string | |
| 2870 :param db_parameter_group_name: | |
| 2871 The name of the DB parameter group. | |
| 2872 | |
| 2873 Constraints: | |
| 2874 | |
| 2875 | |
| 2876 + Must be the name of an existing DB parameter group | |
| 2877 + Must be 1 to 255 alphanumeric characters | |
| 2878 + First character must be a letter | |
| 2879 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 2880 | |
| 2881 :type parameters: list | |
| 2882 :param parameters: | |
| 2883 An array of parameter names, values, and the apply method for the | |
| 2884 parameter update. At least one parameter name, value, and apply | |
| 2885 method must be supplied; subsequent arguments are optional. A | |
| 2886 maximum of 20 parameters may be modified in a single request. | |
| 2887 | |
| 2888 Valid Values (for the application method): `immediate | pending-reboot` | |
| 2889 | |
| 2890 You can use the immediate value with dynamic parameters only. You can | |
| 2891 use the pending-reboot value for both dynamic and static | |
| 2892 parameters, and changes are applied when DB instance reboots. | |
| 2893 | |
| 2894 """ | |
| 2895 params = {'DBParameterGroupName': db_parameter_group_name, } | |
| 2896 self.build_complex_list_params( | |
| 2897 params, parameters, | |
| 2898 'Parameters.member', | |
| 2899 ('ParameterName', 'ParameterValue', 'Description', 'Source', 'ApplyType', 'DataType', 'AllowedValues', 'IsModifiable', 'MinimumEngineVersion', 'ApplyMethod')) | |
| 2900 return self._make_request( | |
| 2901 action='ModifyDBParameterGroup', | |
| 2902 verb='POST', | |
| 2903 path='/', params=params) | |
| 2904 | |
| 2905 def modify_db_subnet_group(self, db_subnet_group_name, subnet_ids, | |
| 2906 db_subnet_group_description=None): | |
| 2907 """ | |
| 2908 Modifies an existing DB subnet group. DB subnet groups must | |
| 2909 contain at least one subnet in at least two AZs in the region. | |
| 2910 | |
| 2911 :type db_subnet_group_name: string | |
| 2912 :param db_subnet_group_name: The name for the DB subnet group. This | |
| 2913 value is stored as a lowercase string. | |
| 2914 Constraints: Must contain no more than 255 alphanumeric characters or | |
| 2915 hyphens. Must not be "Default". | |
| 2916 | |
| 2917 Example: `mySubnetgroup` | |
| 2918 | |
| 2919 :type db_subnet_group_description: string | |
| 2920 :param db_subnet_group_description: The description for the DB subnet | |
| 2921 group. | |
| 2922 | |
| 2923 :type subnet_ids: list | |
| 2924 :param subnet_ids: The EC2 subnet IDs for the DB subnet group. | |
| 2925 | |
| 2926 """ | |
| 2927 params = {'DBSubnetGroupName': db_subnet_group_name, } | |
| 2928 self.build_list_params(params, | |
| 2929 subnet_ids, | |
| 2930 'SubnetIds.member') | |
| 2931 if db_subnet_group_description is not None: | |
| 2932 params['DBSubnetGroupDescription'] = db_subnet_group_description | |
| 2933 return self._make_request( | |
| 2934 action='ModifyDBSubnetGroup', | |
| 2935 verb='POST', | |
| 2936 path='/', params=params) | |
| 2937 | |
| 2938 def modify_event_subscription(self, subscription_name, | |
| 2939 sns_topic_arn=None, source_type=None, | |
| 2940 event_categories=None, enabled=None): | |
| 2941 """ | |
| 2942 Modifies an existing RDS event notification subscription. Note | |
| 2943 that you cannot modify the source identifiers using this call; | |
| 2944 to change source identifiers for a subscription, use the | |
| 2945 AddSourceIdentifierToSubscription and | |
| 2946 RemoveSourceIdentifierFromSubscription calls. | |
| 2947 | |
| 2948 You can see a list of the event categories for a given | |
| 2949 SourceType in the `Events`_ topic in the Amazon RDS User Guide | |
| 2950 or by using the **DescribeEventCategories** action. | |
| 2951 | |
| 2952 :type subscription_name: string | |
| 2953 :param subscription_name: The name of the RDS event notification | |
| 2954 subscription. | |
| 2955 | |
| 2956 :type sns_topic_arn: string | |
| 2957 :param sns_topic_arn: The Amazon Resource Name (ARN) of the SNS topic | |
| 2958 created for event notification. The ARN is created by Amazon SNS | |
| 2959 when you create a topic and subscribe to it. | |
| 2960 | |
| 2961 :type source_type: string | |
| 2962 :param source_type: The type of source that will be generating the | |
| 2963 events. For example, if you want to be notified of events generated | |
| 2964 by a DB instance, you would set this parameter to db-instance. if | |
| 2965 this value is not specified, all events are returned. | |
| 2966 Valid values: db-instance | db-parameter-group | db-security-group | | |
| 2967 db-snapshot | |
| 2968 | |
| 2969 :type event_categories: list | |
| 2970 :param event_categories: A list of event categories for a SourceType | |
| 2971 that you want to subscribe to. You can see a list of the categories | |
| 2972 for a given SourceType in the `Events`_ topic in the Amazon RDS | |
| 2973 User Guide or by using the **DescribeEventCategories** action. | |
| 2974 | |
| 2975 :type enabled: boolean | |
| 2976 :param enabled: A Boolean value; set to **true** to activate the | |
| 2977 subscription. | |
| 2978 | |
| 2979 """ | |
| 2980 params = {'SubscriptionName': subscription_name, } | |
| 2981 if sns_topic_arn is not None: | |
| 2982 params['SnsTopicArn'] = sns_topic_arn | |
| 2983 if source_type is not None: | |
| 2984 params['SourceType'] = source_type | |
| 2985 if event_categories is not None: | |
| 2986 self.build_list_params(params, | |
| 2987 event_categories, | |
| 2988 'EventCategories.member') | |
| 2989 if enabled is not None: | |
| 2990 params['Enabled'] = str( | |
| 2991 enabled).lower() | |
| 2992 return self._make_request( | |
| 2993 action='ModifyEventSubscription', | |
| 2994 verb='POST', | |
| 2995 path='/', params=params) | |
| 2996 | |
| 2997 def modify_option_group(self, option_group_name, options_to_include=None, | |
| 2998 options_to_remove=None, apply_immediately=None): | |
| 2999 """ | |
| 3000 Modifies an existing option group. | |
| 3001 | |
| 3002 :type option_group_name: string | |
| 3003 :param option_group_name: The name of the option group to be modified. | |
| 3004 Permanent options, such as the TDE option for Oracle Advanced Security | |
| 3005 TDE, cannot be removed from an option group, and that option group | |
| 3006 cannot be removed from a DB instance once it is associated with a | |
| 3007 DB instance | |
| 3008 | |
| 3009 :type options_to_include: list | |
| 3010 :param options_to_include: Options in this list are added to the option | |
| 3011 group or, if already present, the specified configuration is used | |
| 3012 to update the existing configuration. | |
| 3013 | |
| 3014 :type options_to_remove: list | |
| 3015 :param options_to_remove: Options in this list are removed from the | |
| 3016 option group. | |
| 3017 | |
| 3018 :type apply_immediately: boolean | |
| 3019 :param apply_immediately: Indicates whether the changes should be | |
| 3020 applied immediately, or during the next maintenance window for each | |
| 3021 instance associated with the option group. | |
| 3022 | |
| 3023 """ | |
| 3024 params = {'OptionGroupName': option_group_name, } | |
| 3025 if options_to_include is not None: | |
| 3026 self.build_complex_list_params( | |
| 3027 params, options_to_include, | |
| 3028 'OptionsToInclude.member', | |
| 3029 ('OptionName', 'Port', 'DBSecurityGroupMemberships', 'VpcSecurityGroupMemberships', 'OptionSettings')) | |
| 3030 if options_to_remove is not None: | |
| 3031 self.build_list_params(params, | |
| 3032 options_to_remove, | |
| 3033 'OptionsToRemove.member') | |
| 3034 if apply_immediately is not None: | |
| 3035 params['ApplyImmediately'] = str( | |
| 3036 apply_immediately).lower() | |
| 3037 return self._make_request( | |
| 3038 action='ModifyOptionGroup', | |
| 3039 verb='POST', | |
| 3040 path='/', params=params) | |
| 3041 | |
| 3042 def promote_read_replica(self, db_instance_identifier, | |
| 3043 backup_retention_period=None, | |
| 3044 preferred_backup_window=None): | |
| 3045 """ | |
| 3046 Promotes a read replica DB instance to a standalone DB | |
| 3047 instance. | |
| 3048 | |
| 3049 :type db_instance_identifier: string | |
| 3050 :param db_instance_identifier: The DB instance identifier. This value | |
| 3051 is stored as a lowercase string. | |
| 3052 Constraints: | |
| 3053 | |
| 3054 | |
| 3055 + Must be the identifier for an existing read replica DB instance | |
| 3056 + Must contain from 1 to 63 alphanumeric characters or hyphens | |
| 3057 + First character must be a letter | |
| 3058 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 3059 | |
| 3060 | |
| 3061 Example: mydbinstance | |
| 3062 | |
| 3063 :type backup_retention_period: integer | |
| 3064 :param backup_retention_period: | |
| 3065 The number of days to retain automated backups. Setting this parameter | |
| 3066 to a positive number enables backups. Setting this parameter to 0 | |
| 3067 disables automated backups. | |
| 3068 | |
| 3069 Default: 1 | |
| 3070 | |
| 3071 Constraints: | |
| 3072 | |
| 3073 | |
| 3074 + Must be a value from 0 to 8 | |
| 3075 | |
| 3076 :type preferred_backup_window: string | |
| 3077 :param preferred_backup_window: The daily time range during which | |
| 3078 automated backups are created if automated backups are enabled, | |
| 3079 using the `BackupRetentionPeriod` parameter. | |
| 3080 Default: A 30-minute window selected at random from an 8-hour block of | |
| 3081 time per region. See the Amazon RDS User Guide for the time blocks | |
| 3082 for each region from which the default backup windows are assigned. | |
| 3083 | |
| 3084 Constraints: Must be in the format `hh24:mi-hh24:mi`. Times should be | |
| 3085 Universal Time Coordinated (UTC). Must not conflict with the | |
| 3086 preferred maintenance window. Must be at least 30 minutes. | |
| 3087 | |
| 3088 """ | |
| 3089 params = {'DBInstanceIdentifier': db_instance_identifier, } | |
| 3090 if backup_retention_period is not None: | |
| 3091 params['BackupRetentionPeriod'] = backup_retention_period | |
| 3092 if preferred_backup_window is not None: | |
| 3093 params['PreferredBackupWindow'] = preferred_backup_window | |
| 3094 return self._make_request( | |
| 3095 action='PromoteReadReplica', | |
| 3096 verb='POST', | |
| 3097 path='/', params=params) | |
| 3098 | |
| 3099 def purchase_reserved_db_instances_offering(self, | |
| 3100 reserved_db_instances_offering_id, | |
| 3101 reserved_db_instance_id=None, | |
| 3102 db_instance_count=None, | |
| 3103 tags=None): | |
| 3104 """ | |
| 3105 Purchases a reserved DB instance offering. | |
| 3106 | |
| 3107 :type reserved_db_instances_offering_id: string | |
| 3108 :param reserved_db_instances_offering_id: The ID of the Reserved DB | |
| 3109 instance offering to purchase. | |
| 3110 Example: 438012d3-4052-4cc7-b2e3-8d3372e0e706 | |
| 3111 | |
| 3112 :type reserved_db_instance_id: string | |
| 3113 :param reserved_db_instance_id: Customer-specified identifier to track | |
| 3114 this reservation. | |
| 3115 Example: myreservationID | |
| 3116 | |
| 3117 :type db_instance_count: integer | |
| 3118 :param db_instance_count: The number of instances to reserve. | |
| 3119 Default: `1` | |
| 3120 | |
| 3121 :type tags: list | |
| 3122 :param tags: A list of tags. Tags must be passed as tuples in the form | |
| 3123 [('key1', 'valueForKey1'), ('key2', 'valueForKey2')] | |
| 3124 | |
| 3125 """ | |
| 3126 params = { | |
| 3127 'ReservedDBInstancesOfferingId': reserved_db_instances_offering_id, | |
| 3128 } | |
| 3129 if reserved_db_instance_id is not None: | |
| 3130 params['ReservedDBInstanceId'] = reserved_db_instance_id | |
| 3131 if db_instance_count is not None: | |
| 3132 params['DBInstanceCount'] = db_instance_count | |
| 3133 if tags is not None: | |
| 3134 self.build_complex_list_params( | |
| 3135 params, tags, | |
| 3136 'Tags.member', | |
| 3137 ('Key', 'Value')) | |
| 3138 return self._make_request( | |
| 3139 action='PurchaseReservedDBInstancesOffering', | |
| 3140 verb='POST', | |
| 3141 path='/', params=params) | |
| 3142 | |
| 3143 def reboot_db_instance(self, db_instance_identifier, force_failover=None): | |
| 3144 """ | |
| 3145 Rebooting a DB instance restarts the database engine service. | |
| 3146 A reboot also applies to the DB instance any modifications to | |
| 3147 the associated DB parameter group that were pending. Rebooting | |
| 3148 a DB instance results in a momentary outage of the instance, | |
| 3149 during which the DB instance status is set to rebooting. If | |
| 3150 the RDS instance is configured for MultiAZ, it is possible | |
| 3151 that the reboot will be conducted through a failover. An | |
| 3152 Amazon RDS event is created when the reboot is completed. | |
| 3153 | |
| 3154 If your DB instance is deployed in multiple Availability | |
| 3155 Zones, you can force a failover from one AZ to the other | |
| 3156 during the reboot. You might force a failover to test the | |
| 3157 availability of your DB instance deployment or to restore | |
| 3158 operations to the original AZ after a failover occurs. | |
| 3159 | |
| 3160 The time required to reboot is a function of the specific | |
| 3161 database engine's crash recovery process. To improve the | |
| 3162 reboot time, we recommend that you reduce database activities | |
| 3163 as much as possible during the reboot process to reduce | |
| 3164 rollback activity for in-transit transactions. | |
| 3165 | |
| 3166 :type db_instance_identifier: string | |
| 3167 :param db_instance_identifier: | |
| 3168 The DB instance identifier. This parameter is stored as a lowercase | |
| 3169 string. | |
| 3170 | |
| 3171 Constraints: | |
| 3172 | |
| 3173 | |
| 3174 + Must contain from 1 to 63 alphanumeric characters or hyphens | |
| 3175 + First character must be a letter | |
| 3176 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 3177 | |
| 3178 :type force_failover: boolean | |
| 3179 :param force_failover: When `True`, the reboot will be conducted | |
| 3180 through a MultiAZ failover. | |
| 3181 Constraint: You cannot specify `True` if the instance is not configured | |
| 3182 for MultiAZ. | |
| 3183 | |
| 3184 """ | |
| 3185 params = {'DBInstanceIdentifier': db_instance_identifier, } | |
| 3186 if force_failover is not None: | |
| 3187 params['ForceFailover'] = str( | |
| 3188 force_failover).lower() | |
| 3189 return self._make_request( | |
| 3190 action='RebootDBInstance', | |
| 3191 verb='POST', | |
| 3192 path='/', params=params) | |
| 3193 | |
| 3194 def remove_source_identifier_from_subscription(self, subscription_name, | |
| 3195 source_identifier): | |
| 3196 """ | |
| 3197 Removes a source identifier from an existing RDS event | |
| 3198 notification subscription. | |
| 3199 | |
| 3200 :type subscription_name: string | |
| 3201 :param subscription_name: The name of the RDS event notification | |
| 3202 subscription you want to remove a source identifier from. | |
| 3203 | |
| 3204 :type source_identifier: string | |
| 3205 :param source_identifier: The source identifier to be removed from the | |
| 3206 subscription, such as the **DB instance identifier** for a DB | |
| 3207 instance or the name of a security group. | |
| 3208 | |
| 3209 """ | |
| 3210 params = { | |
| 3211 'SubscriptionName': subscription_name, | |
| 3212 'SourceIdentifier': source_identifier, | |
| 3213 } | |
| 3214 return self._make_request( | |
| 3215 action='RemoveSourceIdentifierFromSubscription', | |
| 3216 verb='POST', | |
| 3217 path='/', params=params) | |
| 3218 | |
| 3219 def remove_tags_from_resource(self, resource_name, tag_keys): | |
| 3220 """ | |
| 3221 Removes metadata tags from an Amazon RDS resource. | |
| 3222 | |
| 3223 For an overview on tagging an Amazon RDS resource, see | |
| 3224 `Tagging Amazon RDS Resources`_. | |
| 3225 | |
| 3226 :type resource_name: string | |
| 3227 :param resource_name: The Amazon RDS resource the tags will be removed | |
| 3228 from. This value is an Amazon Resource Name (ARN). For information | |
| 3229 about creating an ARN, see ` Constructing an RDS Amazon Resource | |
| 3230 Name (ARN)`_. | |
| 3231 | |
| 3232 :type tag_keys: list | |
| 3233 :param tag_keys: The tag key (name) of the tag to be removed. | |
| 3234 | |
| 3235 """ | |
| 3236 params = {'ResourceName': resource_name, } | |
| 3237 self.build_list_params(params, | |
| 3238 tag_keys, | |
| 3239 'TagKeys.member') | |
| 3240 return self._make_request( | |
| 3241 action='RemoveTagsFromResource', | |
| 3242 verb='POST', | |
| 3243 path='/', params=params) | |
| 3244 | |
| 3245 def reset_db_parameter_group(self, db_parameter_group_name, | |
| 3246 reset_all_parameters=None, parameters=None): | |
| 3247 """ | |
| 3248 Modifies the parameters of a DB parameter group to the | |
| 3249 engine/system default value. To reset specific parameters | |
| 3250 submit a list of the following: `ParameterName` and | |
| 3251 `ApplyMethod`. To reset the entire DB parameter group, specify | |
| 3252 the `DBParameterGroup` name and `ResetAllParameters` | |
| 3253 parameters. When resetting the entire group, dynamic | |
| 3254 parameters are updated immediately and static parameters are | |
| 3255 set to `pending-reboot` to take effect on the next DB instance | |
| 3256 restart or `RebootDBInstance` request. | |
| 3257 | |
| 3258 :type db_parameter_group_name: string | |
| 3259 :param db_parameter_group_name: | |
| 3260 The name of the DB parameter group. | |
| 3261 | |
| 3262 Constraints: | |
| 3263 | |
| 3264 | |
| 3265 + Must be 1 to 255 alphanumeric characters | |
| 3266 + First character must be a letter | |
| 3267 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 3268 | |
| 3269 :type reset_all_parameters: boolean | |
| 3270 :param reset_all_parameters: Specifies whether ( `True`) or not ( | |
| 3271 `False`) to reset all parameters in the DB parameter group to | |
| 3272 default values. | |
| 3273 Default: `True` | |
| 3274 | |
| 3275 :type parameters: list | |
| 3276 :param parameters: An array of parameter names, values, and the apply | |
| 3277 method for the parameter update. At least one parameter name, | |
| 3278 value, and apply method must be supplied; subsequent arguments are | |
| 3279 optional. A maximum of 20 parameters may be modified in a single | |
| 3280 request. | |
| 3281 **MySQL** | |
| 3282 | |
| 3283 Valid Values (for Apply method): `immediate` | `pending-reboot` | |
| 3284 | |
| 3285 You can use the immediate value with dynamic parameters only. You can | |
| 3286 use the `pending-reboot` value for both dynamic and static | |
| 3287 parameters, and changes are applied when DB instance reboots. | |
| 3288 | |
| 3289 **Oracle** | |
| 3290 | |
| 3291 Valid Values (for Apply method): `pending-reboot` | |
| 3292 | |
| 3293 """ | |
| 3294 params = {'DBParameterGroupName': db_parameter_group_name, } | |
| 3295 if reset_all_parameters is not None: | |
| 3296 params['ResetAllParameters'] = str( | |
| 3297 reset_all_parameters).lower() | |
| 3298 if parameters is not None: | |
| 3299 self.build_complex_list_params( | |
| 3300 params, parameters, | |
| 3301 'Parameters.member', | |
| 3302 ('ParameterName', 'ParameterValue', 'Description', 'Source', 'ApplyType', 'DataType', 'AllowedValues', 'IsModifiable', 'MinimumEngineVersion', 'ApplyMethod')) | |
| 3303 return self._make_request( | |
| 3304 action='ResetDBParameterGroup', | |
| 3305 verb='POST', | |
| 3306 path='/', params=params) | |
| 3307 | |
| 3308 def restore_db_instance_from_db_snapshot(self, db_instance_identifier, | |
| 3309 db_snapshot_identifier, | |
| 3310 db_instance_class=None, | |
| 3311 port=None, | |
| 3312 availability_zone=None, | |
| 3313 db_subnet_group_name=None, | |
| 3314 multi_az=None, | |
| 3315 publicly_accessible=None, | |
| 3316 auto_minor_version_upgrade=None, | |
| 3317 license_model=None, | |
| 3318 db_name=None, engine=None, | |
| 3319 iops=None, | |
| 3320 option_group_name=None, | |
| 3321 tags=None): | |
| 3322 """ | |
| 3323 Creates a new DB instance from a DB snapshot. The target | |
| 3324 database is created from the source database restore point | |
| 3325 with the same configuration as the original source database, | |
| 3326 except that the new RDS instance is created with the default | |
| 3327 security group. | |
| 3328 | |
| 3329 :type db_instance_identifier: string | |
| 3330 :param db_instance_identifier: | |
| 3331 The identifier for the DB snapshot to restore from. | |
| 3332 | |
| 3333 Constraints: | |
| 3334 | |
| 3335 | |
| 3336 + Must contain from 1 to 63 alphanumeric characters or hyphens | |
| 3337 + First character must be a letter | |
| 3338 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 3339 | |
| 3340 :type db_snapshot_identifier: string | |
| 3341 :param db_snapshot_identifier: Name of the DB instance to create from | |
| 3342 the DB snapshot. This parameter isn't case sensitive. | |
| 3343 Constraints: | |
| 3344 | |
| 3345 | |
| 3346 + Must contain from 1 to 255 alphanumeric characters or hyphens | |
| 3347 + First character must be a letter | |
| 3348 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 3349 | |
| 3350 | |
| 3351 Example: `my-snapshot-id` | |
| 3352 | |
| 3353 :type db_instance_class: string | |
| 3354 :param db_instance_class: The compute and memory capacity of the Amazon | |
| 3355 RDS DB instance. | |
| 3356 Valid Values: `db.t1.micro | db.m1.small | db.m1.medium | db.m1.large | | |
| 3357 db.m1.xlarge | db.m2.2xlarge | db.m2.4xlarge` | |
| 3358 | |
| 3359 :type port: integer | |
| 3360 :param port: The port number on which the database accepts connections. | |
| 3361 Default: The same port as the original DB instance | |
| 3362 | |
| 3363 Constraints: Value must be `1150-65535` | |
| 3364 | |
| 3365 :type availability_zone: string | |
| 3366 :param availability_zone: The EC2 Availability Zone that the database | |
| 3367 instance will be created in. | |
| 3368 Default: A random, system-chosen Availability Zone. | |
| 3369 | |
| 3370 Constraint: You cannot specify the AvailabilityZone parameter if the | |
| 3371 MultiAZ parameter is set to `True`. | |
| 3372 | |
| 3373 Example: `us-east-1a` | |
| 3374 | |
| 3375 :type db_subnet_group_name: string | |
| 3376 :param db_subnet_group_name: The DB subnet group name to use for the | |
| 3377 new instance. | |
| 3378 | |
| 3379 :type multi_az: boolean | |
| 3380 :param multi_az: Specifies if the DB instance is a Multi-AZ deployment. | |
| 3381 Constraint: You cannot specify the AvailabilityZone parameter if the | |
| 3382 MultiAZ parameter is set to `True`. | |
| 3383 | |
| 3384 :type publicly_accessible: boolean | |
| 3385 :param publicly_accessible: Specifies the accessibility options for the | |
| 3386 DB instance. A value of true specifies an Internet-facing instance | |
| 3387 with a publicly resolvable DNS name, which resolves to a public IP | |
| 3388 address. A value of false specifies an internal instance with a DNS | |
| 3389 name that resolves to a private IP address. | |
| 3390 Default: The default behavior varies depending on whether a VPC has | |
| 3391 been requested or not. The following list shows the default | |
| 3392 behavior in each case. | |
| 3393 | |
| 3394 | |
| 3395 + **Default VPC:**true | |
| 3396 + **VPC:**false | |
| 3397 | |
| 3398 | |
| 3399 If no DB subnet group has been specified as part of the request and the | |
| 3400 PubliclyAccessible value has not been set, the DB instance will be | |
| 3401 publicly accessible. If a specific DB subnet group has been | |
| 3402 specified as part of the request and the PubliclyAccessible value | |
| 3403 has not been set, the DB instance will be private. | |
| 3404 | |
| 3405 :type auto_minor_version_upgrade: boolean | |
| 3406 :param auto_minor_version_upgrade: Indicates that minor version | |
| 3407 upgrades will be applied automatically to the DB instance during | |
| 3408 the maintenance window. | |
| 3409 | |
| 3410 :type license_model: string | |
| 3411 :param license_model: License model information for the restored DB | |
| 3412 instance. | |
| 3413 Default: Same as source. | |
| 3414 | |
| 3415 Valid values: `license-included` | `bring-your-own-license` | `general- | |
| 3416 public-license` | |
| 3417 | |
| 3418 :type db_name: string | |
| 3419 :param db_name: | |
| 3420 The database name for the restored DB instance. | |
| 3421 | |
| 3422 | |
| 3423 This parameter doesn't apply to the MySQL engine. | |
| 3424 | |
| 3425 :type engine: string | |
| 3426 :param engine: The database engine to use for the new instance. | |
| 3427 Default: The same as source | |
| 3428 | |
| 3429 Constraint: Must be compatible with the engine of the source | |
| 3430 | |
| 3431 Example: `oracle-ee` | |
| 3432 | |
| 3433 :type iops: integer | |
| 3434 :param iops: Specifies the amount of provisioned IOPS for the DB | |
| 3435 instance, expressed in I/O operations per second. If this parameter | |
| 3436 is not specified, the IOPS value will be taken from the backup. If | |
| 3437 this parameter is set to 0, the new instance will be converted to a | |
| 3438 non-PIOPS instance, which will take additional time, though your DB | |
| 3439 instance will be available for connections before the conversion | |
| 3440 starts. | |
| 3441 Constraints: Must be an integer greater than 1000. | |
| 3442 | |
| 3443 :type option_group_name: string | |
| 3444 :param option_group_name: The name of the option group to be used for | |
| 3445 the restored DB instance. | |
| 3446 Permanent options, such as the TDE option for Oracle Advanced Security | |
| 3447 TDE, cannot be removed from an option group, and that option group | |
| 3448 cannot be removed from a DB instance once it is associated with a | |
| 3449 DB instance | |
| 3450 | |
| 3451 :type tags: list | |
| 3452 :param tags: A list of tags. Tags must be passed as tuples in the form | |
| 3453 [('key1', 'valueForKey1'), ('key2', 'valueForKey2')] | |
| 3454 | |
| 3455 """ | |
| 3456 params = { | |
| 3457 'DBInstanceIdentifier': db_instance_identifier, | |
| 3458 'DBSnapshotIdentifier': db_snapshot_identifier, | |
| 3459 } | |
| 3460 if db_instance_class is not None: | |
| 3461 params['DBInstanceClass'] = db_instance_class | |
| 3462 if port is not None: | |
| 3463 params['Port'] = port | |
| 3464 if availability_zone is not None: | |
| 3465 params['AvailabilityZone'] = availability_zone | |
| 3466 if db_subnet_group_name is not None: | |
| 3467 params['DBSubnetGroupName'] = db_subnet_group_name | |
| 3468 if multi_az is not None: | |
| 3469 params['MultiAZ'] = str( | |
| 3470 multi_az).lower() | |
| 3471 if publicly_accessible is not None: | |
| 3472 params['PubliclyAccessible'] = str( | |
| 3473 publicly_accessible).lower() | |
| 3474 if auto_minor_version_upgrade is not None: | |
| 3475 params['AutoMinorVersionUpgrade'] = str( | |
| 3476 auto_minor_version_upgrade).lower() | |
| 3477 if license_model is not None: | |
| 3478 params['LicenseModel'] = license_model | |
| 3479 if db_name is not None: | |
| 3480 params['DBName'] = db_name | |
| 3481 if engine is not None: | |
| 3482 params['Engine'] = engine | |
| 3483 if iops is not None: | |
| 3484 params['Iops'] = iops | |
| 3485 if option_group_name is not None: | |
| 3486 params['OptionGroupName'] = option_group_name | |
| 3487 if tags is not None: | |
| 3488 self.build_complex_list_params( | |
| 3489 params, tags, | |
| 3490 'Tags.member', | |
| 3491 ('Key', 'Value')) | |
| 3492 return self._make_request( | |
| 3493 action='RestoreDBInstanceFromDBSnapshot', | |
| 3494 verb='POST', | |
| 3495 path='/', params=params) | |
| 3496 | |
| 3497 def restore_db_instance_to_point_in_time(self, | |
| 3498 source_db_instance_identifier, | |
| 3499 target_db_instance_identifier, | |
| 3500 restore_time=None, | |
| 3501 use_latest_restorable_time=None, | |
| 3502 db_instance_class=None, | |
| 3503 port=None, | |
| 3504 availability_zone=None, | |
| 3505 db_subnet_group_name=None, | |
| 3506 multi_az=None, | |
| 3507 publicly_accessible=None, | |
| 3508 auto_minor_version_upgrade=None, | |
| 3509 license_model=None, | |
| 3510 db_name=None, engine=None, | |
| 3511 iops=None, | |
| 3512 option_group_name=None, | |
| 3513 tags=None): | |
| 3514 """ | |
| 3515 Restores a DB instance to an arbitrary point-in-time. Users | |
| 3516 can restore to any point in time before the | |
| 3517 latestRestorableTime for up to backupRetentionPeriod days. The | |
| 3518 target database is created from the source database with the | |
| 3519 same configuration as the original database except that the DB | |
| 3520 instance is created with the default DB security group. | |
| 3521 | |
| 3522 :type source_db_instance_identifier: string | |
| 3523 :param source_db_instance_identifier: | |
| 3524 The identifier of the source DB instance from which to restore. | |
| 3525 | |
| 3526 Constraints: | |
| 3527 | |
| 3528 | |
| 3529 + Must be the identifier of an existing database instance | |
| 3530 + Must contain from 1 to 63 alphanumeric characters or hyphens | |
| 3531 + First character must be a letter | |
| 3532 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 3533 | |
| 3534 :type target_db_instance_identifier: string | |
| 3535 :param target_db_instance_identifier: | |
| 3536 The name of the new database instance to be created. | |
| 3537 | |
| 3538 Constraints: | |
| 3539 | |
| 3540 | |
| 3541 + Must contain from 1 to 63 alphanumeric characters or hyphens | |
| 3542 + First character must be a letter | |
| 3543 + Cannot end with a hyphen or contain two consecutive hyphens | |
| 3544 | |
| 3545 :type restore_time: timestamp | |
| 3546 :param restore_time: The date and time to restore from. | |
| 3547 Valid Values: Value must be a UTC time | |
| 3548 | |
| 3549 Constraints: | |
| 3550 | |
| 3551 | |
| 3552 + Must be before the latest restorable time for the DB instance | |
| 3553 + Cannot be specified if UseLatestRestorableTime parameter is true | |
| 3554 | |
| 3555 | |
| 3556 Example: `2009-09-07T23:45:00Z` | |
| 3557 | |
| 3558 :type use_latest_restorable_time: boolean | |
| 3559 :param use_latest_restorable_time: Specifies whether ( `True`) or not ( | |
| 3560 `False`) the DB instance is restored from the latest backup time. | |
| 3561 Default: `False` | |
| 3562 | |
| 3563 Constraints: Cannot be specified if RestoreTime parameter is provided. | |
| 3564 | |
| 3565 :type db_instance_class: string | |
| 3566 :param db_instance_class: The compute and memory capacity of the Amazon | |
| 3567 RDS DB instance. | |
| 3568 Valid Values: `db.t1.micro | db.m1.small | db.m1.medium | db.m1.large | | |
| 3569 db.m1.xlarge | db.m2.2xlarge | db.m2.4xlarge` | |
| 3570 | |
| 3571 Default: The same DBInstanceClass as the original DB instance. | |
| 3572 | |
| 3573 :type port: integer | |
| 3574 :param port: The port number on which the database accepts connections. | |
| 3575 Constraints: Value must be `1150-65535` | |
| 3576 | |
| 3577 Default: The same port as the original DB instance. | |
| 3578 | |
| 3579 :type availability_zone: string | |
| 3580 :param availability_zone: The EC2 Availability Zone that the database | |
| 3581 instance will be created in. | |
| 3582 Default: A random, system-chosen Availability Zone. | |
| 3583 | |
| 3584 Constraint: You cannot specify the AvailabilityZone parameter if the | |
| 3585 MultiAZ parameter is set to true. | |
| 3586 | |
| 3587 Example: `us-east-1a` | |
| 3588 | |
| 3589 :type db_subnet_group_name: string | |
| 3590 :param db_subnet_group_name: The DB subnet group name to use for the | |
| 3591 new instance. | |
| 3592 | |
| 3593 :type multi_az: boolean | |
| 3594 :param multi_az: Specifies if the DB instance is a Multi-AZ deployment. | |
| 3595 Constraint: You cannot specify the AvailabilityZone parameter if the | |
| 3596 MultiAZ parameter is set to `True`. | |
| 3597 | |
| 3598 :type publicly_accessible: boolean | |
| 3599 :param publicly_accessible: Specifies the accessibility options for the | |
| 3600 DB instance. A value of true specifies an Internet-facing instance | |
| 3601 with a publicly resolvable DNS name, which resolves to a public IP | |
| 3602 address. A value of false specifies an internal instance with a DNS | |
| 3603 name that resolves to a private IP address. | |
| 3604 Default: The default behavior varies depending on whether a VPC has | |
| 3605 been requested or not. The following list shows the default | |
| 3606 behavior in each case. | |
| 3607 | |
| 3608 | |
| 3609 + **Default VPC:**true | |
| 3610 + **VPC:**false | |
| 3611 | |
| 3612 | |
| 3613 If no DB subnet group has been specified as part of the request and the | |
| 3614 PubliclyAccessible value has not been set, the DB instance will be | |
| 3615 publicly accessible. If a specific DB subnet group has been | |
| 3616 specified as part of the request and the PubliclyAccessible value | |
| 3617 has not been set, the DB instance will be private. | |
| 3618 | |
| 3619 :type auto_minor_version_upgrade: boolean | |
| 3620 :param auto_minor_version_upgrade: Indicates that minor version | |
| 3621 upgrades will be applied automatically to the DB instance during | |
| 3622 the maintenance window. | |
| 3623 | |
| 3624 :type license_model: string | |
| 3625 :param license_model: License model information for the restored DB | |
| 3626 instance. | |
| 3627 Default: Same as source. | |
| 3628 | |
| 3629 Valid values: `license-included` | `bring-your-own-license` | `general- | |
| 3630 public-license` | |
| 3631 | |
| 3632 :type db_name: string | |
| 3633 :param db_name: | |
| 3634 The database name for the restored DB instance. | |
| 3635 | |
| 3636 | |
| 3637 This parameter is not used for the MySQL engine. | |
| 3638 | |
| 3639 :type engine: string | |
| 3640 :param engine: The database engine to use for the new instance. | |
| 3641 Default: The same as source | |
| 3642 | |
| 3643 Constraint: Must be compatible with the engine of the source | |
| 3644 | |
| 3645 Example: `oracle-ee` | |
| 3646 | |
| 3647 :type iops: integer | |
| 3648 :param iops: The amount of Provisioned IOPS (input/output operations | |
| 3649 per second) to be initially allocated for the DB instance. | |
| 3650 Constraints: Must be an integer greater than 1000. | |
| 3651 | |
| 3652 :type option_group_name: string | |
| 3653 :param option_group_name: The name of the option group to be used for | |
| 3654 the restored DB instance. | |
| 3655 Permanent options, such as the TDE option for Oracle Advanced Security | |
| 3656 TDE, cannot be removed from an option group, and that option group | |
| 3657 cannot be removed from a DB instance once it is associated with a | |
| 3658 DB instance | |
| 3659 | |
| 3660 :type tags: list | |
| 3661 :param tags: A list of tags. Tags must be passed as tuples in the form | |
| 3662 [('key1', 'valueForKey1'), ('key2', 'valueForKey2')] | |
| 3663 | |
| 3664 """ | |
| 3665 params = { | |
| 3666 'SourceDBInstanceIdentifier': source_db_instance_identifier, | |
| 3667 'TargetDBInstanceIdentifier': target_db_instance_identifier, | |
| 3668 } | |
| 3669 if restore_time is not None: | |
| 3670 params['RestoreTime'] = restore_time | |
| 3671 if use_latest_restorable_time is not None: | |
| 3672 params['UseLatestRestorableTime'] = str( | |
| 3673 use_latest_restorable_time).lower() | |
| 3674 if db_instance_class is not None: | |
| 3675 params['DBInstanceClass'] = db_instance_class | |
| 3676 if port is not None: | |
| 3677 params['Port'] = port | |
| 3678 if availability_zone is not None: | |
| 3679 params['AvailabilityZone'] = availability_zone | |
| 3680 if db_subnet_group_name is not None: | |
| 3681 params['DBSubnetGroupName'] = db_subnet_group_name | |
| 3682 if multi_az is not None: | |
| 3683 params['MultiAZ'] = str( | |
| 3684 multi_az).lower() | |
| 3685 if publicly_accessible is not None: | |
| 3686 params['PubliclyAccessible'] = str( | |
| 3687 publicly_accessible).lower() | |
| 3688 if auto_minor_version_upgrade is not None: | |
| 3689 params['AutoMinorVersionUpgrade'] = str( | |
| 3690 auto_minor_version_upgrade).lower() | |
| 3691 if license_model is not None: | |
| 3692 params['LicenseModel'] = license_model | |
| 3693 if db_name is not None: | |
| 3694 params['DBName'] = db_name | |
| 3695 if engine is not None: | |
| 3696 params['Engine'] = engine | |
| 3697 if iops is not None: | |
| 3698 params['Iops'] = iops | |
| 3699 if option_group_name is not None: | |
| 3700 params['OptionGroupName'] = option_group_name | |
| 3701 if tags is not None: | |
| 3702 self.build_complex_list_params( | |
| 3703 params, tags, | |
| 3704 'Tags.member', | |
| 3705 ('Key', 'Value')) | |
| 3706 return self._make_request( | |
| 3707 action='RestoreDBInstanceToPointInTime', | |
| 3708 verb='POST', | |
| 3709 path='/', params=params) | |
| 3710 | |
| 3711 def revoke_db_security_group_ingress(self, db_security_group_name, | |
| 3712 cidrip=None, | |
| 3713 ec2_security_group_name=None, | |
| 3714 ec2_security_group_id=None, | |
| 3715 ec2_security_group_owner_id=None): | |
| 3716 """ | |
| 3717 Revokes ingress from a DBSecurityGroup for previously | |
| 3718 authorized IP ranges or EC2 or VPC Security Groups. Required | |
| 3719 parameters for this API are one of CIDRIP, EC2SecurityGroupId | |
| 3720 for VPC, or (EC2SecurityGroupOwnerId and either | |
| 3721 EC2SecurityGroupName or EC2SecurityGroupId). | |
| 3722 | |
| 3723 :type db_security_group_name: string | |
| 3724 :param db_security_group_name: The name of the DB security group to | |
| 3725 revoke ingress from. | |
| 3726 | |
| 3727 :type cidrip: string | |
| 3728 :param cidrip: The IP range to revoke access from. Must be a valid CIDR | |
| 3729 range. If `CIDRIP` is specified, `EC2SecurityGroupName`, | |
| 3730 `EC2SecurityGroupId` and `EC2SecurityGroupOwnerId` cannot be | |
| 3731 provided. | |
| 3732 | |
| 3733 :type ec2_security_group_name: string | |
| 3734 :param ec2_security_group_name: The name of the EC2 security group to | |
| 3735 revoke access from. For VPC DB security groups, | |
| 3736 `EC2SecurityGroupId` must be provided. Otherwise, | |
| 3737 EC2SecurityGroupOwnerId and either `EC2SecurityGroupName` or | |
| 3738 `EC2SecurityGroupId` must be provided. | |
| 3739 | |
| 3740 :type ec2_security_group_id: string | |
| 3741 :param ec2_security_group_id: The id of the EC2 security group to | |
| 3742 revoke access from. For VPC DB security groups, | |
| 3743 `EC2SecurityGroupId` must be provided. Otherwise, | |
| 3744 EC2SecurityGroupOwnerId and either `EC2SecurityGroupName` or | |
| 3745 `EC2SecurityGroupId` must be provided. | |
| 3746 | |
| 3747 :type ec2_security_group_owner_id: string | |
| 3748 :param ec2_security_group_owner_id: The AWS Account Number of the owner | |
| 3749 of the EC2 security group specified in the `EC2SecurityGroupName` | |
| 3750 parameter. The AWS Access Key ID is not an acceptable value. For | |
| 3751 VPC DB security groups, `EC2SecurityGroupId` must be provided. | |
| 3752 Otherwise, EC2SecurityGroupOwnerId and either | |
| 3753 `EC2SecurityGroupName` or `EC2SecurityGroupId` must be provided. | |
| 3754 | |
| 3755 """ | |
| 3756 params = {'DBSecurityGroupName': db_security_group_name, } | |
| 3757 if cidrip is not None: | |
| 3758 params['CIDRIP'] = cidrip | |
| 3759 if ec2_security_group_name is not None: | |
| 3760 params['EC2SecurityGroupName'] = ec2_security_group_name | |
| 3761 if ec2_security_group_id is not None: | |
| 3762 params['EC2SecurityGroupId'] = ec2_security_group_id | |
| 3763 if ec2_security_group_owner_id is not None: | |
| 3764 params['EC2SecurityGroupOwnerId'] = ec2_security_group_owner_id | |
| 3765 return self._make_request( | |
| 3766 action='RevokeDBSecurityGroupIngress', | |
| 3767 verb='POST', | |
| 3768 path='/', params=params) | |
| 3769 | |
| 3770 def _make_request(self, action, verb, path, params): | |
| 3771 params['ContentType'] = 'JSON' | |
| 3772 response = self.make_request(action=action, verb='POST', | |
| 3773 path='/', params=params) | |
| 3774 body = response.read() | |
| 3775 boto.log.debug(body) | |
| 3776 if response.status == 200: | |
| 3777 return json.loads(body) | |
| 3778 else: | |
| 3779 json_body = json.loads(body) | |
| 3780 fault_name = json_body.get('Error', {}).get('Code', None) | |
| 3781 exception_class = self._faults.get(fault_name, self.ResponseError) | |
| 3782 raise exception_class(response.status, response.reason, | |
| 3783 body=json_body) | 
