FRTc@sddlZddlmZddlmZddlmZddlmZm Z ddl m Z ddl m Z ddlmZdd lmZdd lmZdd lmZdd lmZdd lmZmZdZdZdefdYZdS(iN(tAWSQueryConnection(t DBInstance(tDBSecurityGroup(t OptionGrouptOptionGroupOption(tParameterGroup(t DBSnapshot(tEvent(t RDSRegionInfo(t DBSubnetGroup(tVPCSecurityGroupMembership(t get_regions(tLogFilet LogFileObjectcCstddtdtS(s Get all available regions for the RDS service. :rtype: list :return: A list of :class:`boto.rds.regioninfo.RDSRegionInfo` trdst region_clstconnection_cls(R Rt RDSConnection(((s>/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytregions&scKs4x-tD]"}|j|kr |j|Sq WdS(s Given a valid region name, return a :class:`boto.rds.RDSConnection`. Any additional parameters after the region_name are passed on to the connect method of the region object. :type: str :param region_name: The name of the region to connect to. :rtype: :class:`boto.rds.RDSConnection` or ``None`` :return: A connection to the given region, or None if an invalid region name is given N(RtnametconnecttNone(t region_namet kw_paramstregion((s>/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytconnect_to_region4sRcBseZdZdZdZeeeeeeeedeedeeedZdZeeedZ dd eeeeeeee eeeeeeeed Z edeed Z eed Z eeeeeeeee e eeed Ze ddZdZeeedZeeedZd ddZedZe edZdZeeedZedZdZeeedZeeedZeZeeeedZeeeeedZeeedZdZ d Z!d!Z"eeeeed"Z#e eeeeed#Z$eeeeeed$Z%d%Z&d&Z'eeed'Z(eed(Z)ed)Z*d*Z+eeed+ed,Z,eed+ed-Z-RS(.s us-east-1srds.amazonaws.coms 2013-05-15it/cCsz| s!t||j|j} n| |_tt|j|||||||||jj| | | | d|d| dS(Ntvalidate_certst profile_name(RtDefaultRegionNametDefaultRegionEndpointRtsuperRt__init__tendpoint(tselftaws_access_key_idtaws_secret_access_keyt is_securetporttproxyt proxy_portt proxy_usert proxy_passtdebugthttps_connection_factoryRtpathtsecurity_tokenRR((s>/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pyR Ps    cCsdgS(Nshmac-v4((R"((s>/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pyt_required_auth_capabilitydscCs[i}|r||d/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytget_all_dbinstancesis    i sMySQL5.1cCsi|d6|r"t|jntd6| d6| d6|d6|d6|d6|d6t| trk| jn| d 6|d 6|d 6|d 6|d 6|d6|d6|d6|rt|jntd6|d6|d6|d6| d6}| rCg}x=| D]5}t|tr|j|jn |j|qW|j||dn|rg}x=|D]5}t|t r~|j|j n |j|qVW|j||dnx0|j D]"\}}|tkr||=nqW|j d|t S(s#% Create a new DBInstance. :type id: str :param id: Unique identifier for the new instance. Must contain 1-63 alphanumeric characters. First character must be a letter. May not end with a hyphen or contain two consecutive hyphens :type allocated_storage: int :param allocated_storage: Initially allocated storage size, in GBs. Valid values are depending on the engine value. * MySQL = 5--3072 * oracle-se1 = 10--3072 * oracle-se = 10--3072 * oracle-ee = 10--3072 * sqlserver-ee = 200--1024 * sqlserver-se = 200--1024 * sqlserver-ex = 30--1024 * sqlserver-web = 30--1024 * postgres = 5--3072 :type instance_class: str :param instance_class: The compute and memory capacity of the DBInstance. Valid values are: * db.t1.micro * db.m1.small * db.m1.medium * db.m1.large * db.m1.xlarge * db.m2.xlarge * db.m2.2xlarge * db.m2.4xlarge :type engine: str :param engine: Name of database engine. Defaults to MySQL but can be; * MySQL * oracle-se1 * oracle-se * oracle-ee * sqlserver-ee * sqlserver-se * sqlserver-ex * sqlserver-web * postgres :type master_username: str :param master_username: Name of master user for the DBInstance. * MySQL must be; - 1--16 alphanumeric characters - first character must be a letter - cannot be a reserved MySQL word * Oracle must be: - 1--30 alphanumeric characters - first character must be a letter - cannot be a reserved Oracle word * SQL Server must be: - 1--128 alphanumeric characters - first character must be a letter - cannot be a reserver SQL Server word :type master_password: str :param master_password: Password of master user for the DBInstance. * MySQL must be 8--41 alphanumeric characters * Oracle must be 8--30 alphanumeric characters * SQL Server must be 8--128 alphanumeric characters. :type port: int :param port: Port number on which database accepts connections. Valid values [1115-65535]. * MySQL defaults to 3306 * Oracle defaults to 1521 * SQL Server defaults to 1433 and _cannot_ be 1434, 3389, 47001, 49152, and 49152 through 49156. * PostgreSQL defaults to 5432 :type db_name: str :param db_name: * MySQL: Name of a database to create when the DBInstance is created. Default is to create no databases. Must contain 1--64 alphanumeric characters and cannot be a reserved MySQL word. * Oracle: The Oracle System ID (SID) of the created DB instances. Default is ORCL. Cannot be longer than 8 characters. * SQL Server: Not applicable and must be None. * PostgreSQL: Name of a database to create when the DBInstance is created. Default is to create no databases. Must contain 1--63 alphanumeric characters. Must begin with a letter or an underscore. Subsequent characters can be letters, underscores, or digits (0-9) and cannot be a reserved PostgreSQL word. :type param_group: str or ParameterGroup object :param param_group: Name of DBParameterGroup or ParameterGroup instance to associate with this DBInstance. If no groups are specified no parameter groups will be used. :type security_groups: list of str or list of DBSecurityGroup objects :param security_groups: List of names of DBSecurityGroup to authorize on this DBInstance. :type availability_zone: str :param availability_zone: Name of the availability zone to place DBInstance into. :type preferred_maintenance_window: str :param preferred_maintenance_window: The weekly time range (in UTC) during which maintenance can occur. Default is Sun:05:00-Sun:09:00 :type backup_retention_period: int :param backup_retention_period: The number of days for which automated backups are retained. Setting this to zero disables automated backups. :type preferred_backup_window: str :param preferred_backup_window: The daily time range during which automated backups are created (if enabled). Must be in h24:mi-hh24:mi format (UTC). :type multi_az: bool :param multi_az: If True, specifies the DB Instance will be deployed in multiple availability zones. For Microsoft SQL Server, must be set to false. You cannot set the AvailabilityZone parameter if the MultiAZ parameter is set to true. :type engine_version: str :param engine_version: The version number of the database engine to use. * MySQL format example: 5.1.42 * Oracle format example: 11.2.0.2.v2 * SQL Server format example: 10.50.2789.0.v1 * PostgreSQL format example: 9.3 :type auto_minor_version_upgrade: bool :param auto_minor_version_upgrade: Indicates that minor engine upgrades will be applied automatically to the Read Replica during the maintenance window. Default is True. :type character_set_name: str :param character_set_name: For supported engines, indicates that the DB Instance should be associated with the specified CharacterSet. :type db_subnet_group_name: str :param db_subnet_group_name: A DB Subnet Group to associate with this DB Instance. If there is no DB Subnet Group, then it is a non-VPC DB instance. :type license_model: str :param license_model: License model information for this DB Instance. Valid values are; - license-included - bring-your-own-license - general-public-license All license types are not supported on all engines. :type option_group_name: str :param option_group_name: Indicates that the DB Instance should be associated with the specified option group. :type iops: int :param iops: The amount of IOPS (input/output operations per second) to Provisioned for the DB Instance. Can be modified at a later date. Must scale linearly. For every 1000 IOPS provision, you must allocated 100 GB of storage space. This scales up to 1 TB / 10 000 IOPS for MySQL and Oracle. MSSQL is limited to 700 GB / 7 000 IOPS. If you specify a value, it must be at least 1000 IOPS and you must allocate 100 GB of storage. :type vpc_security_groups: list of str or a VPCSecurityGroupMembership object :param vpc_security_groups: List of VPC security group ids or a list of VPCSecurityGroupMembership objects this DBInstance should be a member of :rtype: :class:`boto.rds.dbinstance.DBInstance` :return: The new db instance. tAllocatedStoragetAutoMinorVersionUpgradetAvailabilityZonetBackupRetentionPeriodtCharacterSetNametDBInstanceClassR0tDBNametDBParameterGroupNametDBSubnetGroupNametEnginet EngineVersiontIopst LicenseModeltMasterUsernametMasterUserPasswordtMultiAZtOptionGroupNametPorttPreferredBackupWindowtPreferredMaintenanceWindowsDBSecurityGroups.membersVpcSecurityGroupIds.membertCreateDBInstance(tstrtlowerRt isinstanceRRRtappendtbuild_list_paramsR t vpc_grouptitemst get_objectR(R"tidtallocated_storagetinstance_classtmaster_usernametmaster_passwordR&tenginetdb_namet param_grouptsecurity_groupstavailability_zonetpreferred_maintenance_windowtbackup_retention_periodtpreferred_backup_windowtmulti_aztengine_versiontauto_minor_version_upgradetcharacter_set_nametdb_subnet_group_namet license_modeltoption_group_nametiopstvpc_security_groupsR8tltgrouptvpc_grptktv((s>/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytcreate_dbinstancesT    cCsi|d6|d6}|r'||d/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytcreate_dbinstance_read_replicas4          cCsLi|d6}|dk r&||d/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytpromote_read_replicas     cCsi|d6}|r8t|tr+|jn||d/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytmodify_dbinstance4sNa               tcCsGi|d6}|r d|d/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytdelete_dbinstances     cCs i|d6}|jd|tS(s Reboot DBInstance. :type id: str :param id: Unique identifier of the instance. :rtype: :class:`boto.rds.dbinstance.DBInstance` :return: The rebooting db instance. R0tRebootDBInstance(RVR(R"RWR8((s>/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytreboot_dbinstances cCs[i}|r||d/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytget_all_dbparameter_groupss    cCshi|d6}|r ||d/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytget_all_dbparameters s     cCs.i|d6|d6|d6}|jd|tS(s Create a new dbparameter group for your account. :type name: string :param name: The name of the new dbparameter group :type engine: str :param engine: Name of database engine. :type description: string :param description: The description of the new dbparameter group :rtype: :class:`boto.rds.parametergroup.ParameterGroup` :return: The newly created ParameterGroup RAtDBParameterGroupFamilyt DescriptiontCreateDBParameterGroup(RVR(R"RR\t descriptionR8((s>/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytcreate_parameter_group1s  cCsdi|d6}x;tdt|D]$}||}|j||dq#W|jd|tddS(s~ Modify a ParameterGroup for your account. :type name: string :param name: The name of the new ParameterGroup :type parameters: list of :class:`boto.rds.parametergroup.Parameter` :param parameters: The new parameters :rtype: :class:`boto.rds.parametergroup.ParameterGroup` :return: The newly created ParameterGroup RAiitModifyDBParameterGrouptverbtPOST(trangetlentmergeR4R(R"Rt parametersR8tit parameter((s>/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytmodify_parameter_groupFs   cCsxi|d6}|r d|d/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytreset_parameter_groupZs    cCsi|d6}|jd|S(s Delete a ParameterGroup from your account. :type key_name: string :param key_name: The name of the ParameterGroup to delete RAtDeleteDBParameterGroup(R(R"RR8((s>/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytdelete_parameter_groupqs cCs[i}|r||d/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytget_all_dbsecurity_groups}s    cCsKi|d6}|r ||d/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytcreate_dbsecurity_groups      cCsi|d6}|jd|S(s Delete a DBSecurityGroup from your account. :type key_name: string :param key_name: The name of the DBSecurityGroup to delete RtDeleteDBSecurityGroup(R(R"RR8((s>/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytdelete_dbsecurity_groups cCsbi|d6}|r ||d/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytauthorize_dbsecurity_groups    cCsYi|d6}|r ||d/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytrevoke_dbsecurity_groups     cCsni}|r||d/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytget_all_dbsnapshotss     cCsi|d6}|r ||d/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pyt get_all_logs7s       cCsi|d6|d6}|r'||d/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pyt get_log_fileds      cCs'i|d6|d6}|jd|tS(s Create a new DB snapshot. :type snapshot_id: string :param snapshot_id: The identifier for the DBSnapshot :type dbinstance_id: string :param dbinstance_id: The source identifier for the RDS instance from which the snapshot is created. :rtype: :class:`boto.rds.dbsnapshot.DBSnapshot` :return: The newly created DBSnapshot RR0tCreateDBSnapshot(RVR(R"RRR8((s>/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytcreate_dbsnapshots  cCs'i|d6|d6}|jd|tS(s Copies the specified DBSnapshot. :type source_snapshot_id: string :param source_snapshot_id: The identifier for the source DB snapshot. :type target_snapshot_id: string :param target_snapshot_id: The identifier for the copied snapshot. :rtype: :class:`boto.rds.dbsnapshot.DBSnapshot` :return: The newly created DBSnapshot. tSourceDBSnapshotIdentifiertTargetDBSnapshotIdentifiertCopyDBSnapshot(RVR(R"tsource_snapshot_idttarget_snapshot_idR8((s>/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytcopy_dbsnapshots  cCs i|d6}|jd|tS(s Delete a DBSnapshot :type identifier: string :param identifier: The identifier of the DBSnapshot to delete RtDeleteDBSnapshot(RVR(R"t identifierR8((s>/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytdelete_dbsnapshots c Csi|d6|d6|d6} |r.|| d/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pyt"restore_dbinstance_from_dbsnapshots2         c Csi|d6|d6} |r'd| d/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pyt%restore_dbinstance_from_point_in_times 0         cCsi}|r)|r)||d<||d/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytget_all_events>s+     cCs:i|d6|d6}|j||d|jd|tS(s Create a new Database Subnet Group. :type name: string :param name: The identifier for the db_subnet_group :type desc: string :param desc: A description of the db_subnet_group :type subnet_ids: list :param subnets: A list of the subnet identifiers to include in the db_subnet_group :rtype: :class:`boto.rds.dbsubnetgroup.DBSubnetGroup :return: the created db_subnet_group RBtDBSubnetGroupDescriptionsSubnetIds.membertCreateDBSubnetGroup(RSRVR (R"Rtdesct subnet_idsR8((s>/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytcreate_db_subnet_groupws  cCs i|d6}|jd|tS(s Delete a Database Subnet Group. :type name: string :param name: The identifier of the db_subnet_group to delete :rtype: :class:`boto.rds.dbsubnetgroup.DBSubnetGroup` :return: The deleted db_subnet_group. RBtDeleteDBSubnetGroup(RVR (R"RR8((s>/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytdelete_db_subnet_groups cCspt}|dk r"||d/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytget_all_db_subnet_groupss       cCs[i|d6}|dk r&||d/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytmodify_db_subnet_groups    cCs_i|d6|d6|d6|d6}|jd|t}||_||_||_||_|S(si Create a new option group for your account. This will create the option group within the region you are currently connected to. :type name: string :param name: The name of the new option group :type engine_name: string :param engine_name: Specifies the name of the engine that this option group should be associated with. :type major_engine_version: string :param major_engine_version: Specifies the major version of the engine that this option group should be associated with. :type description: string :param description: The description of the new option group :rtype: :class:`boto.rds.optiongroup.OptionGroup` :return: The newly created OptionGroup RJt EngineNametMajorEngineVersiontOptionGroupDescriptiontCreateOptionGroup(RVRRt engine_nametmajor_engine_versionR(R"RRRRR8Rn((s>/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytcreate_option_groups     cCsi|d6}|jd|S(s Delete an OptionGroup from your account. :type key_name: string :param key_name: The name of the OptionGroup to delete RJtDeleteOptionGroup(R(R"RR8((s>/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytdelete_option_groups idcCsi}|r||d/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytdescribe_option_groupss       cCsqi}|r)|r)||d<||d/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pytdescribe_option_group_options1s     (.t__name__t __module__RRt APIVersionRRwR R/R9tFalseRrRyR{RRRRRRRRRRRRRRtrevoke_security_groupRRRRRRRRRRRRRR R RR(((s>/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pyRJs      & , C !    #       $&&-(    ? <7   %  ,(Rtboto.connectionRtboto.rds.dbinstanceRtboto.rds.dbsecuritygroupRtboto.rds.optiongroupRRtboto.rds.parametergroupRtboto.rds.dbsnapshotRtboto.rds.eventRtboto.rds.regioninfoRtboto.rds.dbsubnetgroupR t#boto.rds.vpcsecuritygroupmembershipR tboto.regioninfoR tboto.rds.logfileR R RRR(((s>/opt/freeware/lib/python2.7/site-packages/boto/rds/__init__.pyts