o ckF[@sDdZddlmZGdddeZGdddeZGdddeZd S) z Represents an DBSecurityGroup ) SecurityGroupc@sReZdZdZ  dddZddZddZd d Zd d Zdd dZ dddZ dS)DBSecurityGroupa Represents an RDS database security group Properties reference available from the AWS documentation at http://docs.amazonwebservices.com/AmazonRDS/latest/APIReference/API_DeleteDBSecurityGroup.html :ivar Status: The current status of the security group. Possible values are [ active, ? ]. Reference documentation lacks specifics of possibilities :ivar connection: :py:class:`boto.rds.RDSConnection` associated with the current object :ivar description: The description of the security group :ivar ec2_groups: List of :py:class:`EC2 Security Group ` objects that this security group PERMITS :ivar ip_ranges: List of :py:class:`boto.rds.dbsecuritygroup.IPRange` objects (containing CIDR addresses) that this security group PERMITS :ivar name: Name of the security group :ivar owner_id: ID of the owner of the security group. Can be 'None' NcCs(||_||_||_||_g|_g|_dSN) connectionowner_idname description ec2_groups ip_ranges)selfrrrrr :/usr/lib/python3/dist-packages/boto/rds/dbsecuritygroup.py__init__.s  zDBSecurityGroup.__init__cC d|jS)NzDBSecurityGroup:%srr r r r __repr__7 zDBSecurityGroup.__repr__cCsD|dkrt|}|j||S|dkr t|}|j||SdS)NIPRangeEC2SecurityGroup)rr appendrr )r rattrsrcidrec2_grpr r r startElement:s  zDBSecurityGroup.startElementcCsR|dkr ||_dS|dkr||_dS|dkr||_dS|dkr!dSt|||dS)NOwnerIdDBSecurityGroupNameDBSecurityGroupDescriptionIPRanges)rrrsetattrr rvaluerr r r endElementFs   zDBSecurityGroup.endElementcCs|j|jSr)rdelete_dbsecurity_grouprrr r r deleteRszDBSecurityGroup.deletecCs4t|tr |j}|j}nd}d}|j|j|||S)a Add a new rule to this DBSecurity group. You need to pass in either a CIDR block to authorize or and EC2 SecurityGroup. :type cidr_ip: string :param cidr_ip: A valid CIDR IP range to authorize :type ec2_group: :class:`boto.ec2.securitygroup.SecurityGroup` :param ec2_group: An EC2 security group to authorize :rtype: bool :return: True if successful. N) isinstancerrrrauthorize_dbsecurity_groupr cidr_ip ec2_group group_namegroup_owner_idr r r authorizeUs  zDBSecurityGroup.authorizecCs<t|tr|j}|j}|jj|j||dS|jj|j|dS)a Revoke access to a CIDR range or EC2 SecurityGroup. You need to pass in either a CIDR block or an EC2 SecurityGroup from which to revoke access. :type cidr_ip: string :param cidr_ip: A valid CIDR IP range to revoke :type ec2_group: :class:`boto.ec2.securitygroup.SecurityGroup` :param ec2_group: An EC2 security group to revoke :rtype: bool :return: True if successful. )ec2_security_group_nameec2_security_group_owner_idr()r%rrrrrevoke_dbsecurity_groupr'r r r revokeos zDBSecurityGroup.revoke)NNNN)NN) __name__ __module__ __qualname____doc__rrrr"r$r,r1r r r r rs    rc@2eZdZdZd ddZddZddZd d ZdS) rzj Describes a CIDR address range for use in a DBSecurityGroup :ivar cidr_ip: IP Address range NcC||_d|_d|_dSr)parentr(statusr r8r r r r zIPRange.__init__cCr)Nz IPRange:%sr/rr r r rrzIPRange.__repr__cCdSrr r rrrr r r rzIPRange.startElementcC4|dkr ||_dS|dkr||_dSt|||dS)NCIDRIPStatus)r(r9rr r r r r"   zIPRange.endElementrr2r3r4r5rrrr"r r r r rs   rc@r6) rzF Describes an EC2 security group for use in a DBSecurityGroup NcCr7r)r8rrr:r r r rr;zEC2SecurityGroup.__init__cCr)NzEC2SecurityGroup:%srrr r r rrzEC2SecurityGroup.__repr__cCr<rr r=r r r rr>zEC2SecurityGroup.startElementcCr?)NEC2SecurityGroupNameEC2SecurityGroupOwnerId)rrrr r r r r"rBzEC2SecurityGroup.endElementrrCr r r r rs   rN)r5boto.ec2.securitygrouprobjectrrrr r r r s  o