File: //usr/lib/python3/dist-packages/boto/rds/__pycache__/dbsecuritygroup.cpython-310.pyc
o
ckF[� � @ sD d Z ddlmZ G dd� de�ZG dd� de�ZG dd� de�Zd S )
z
Represents an DBSecurityGroup
� )�
SecurityGroupc @ sR e Zd ZdZ ddd�Zdd� Zdd� Zd d
� Zdd� Zdd
d�Z ddd�Z
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
<boto.ec2.securitygroup.SecurityGroup>` 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'
Nc C s( || _ || _|| _|| _g | _g | _d S �N)�
connection�owner_id�name�description�
ec2_groups� ip_ranges)�selfr r r r � r �:/usr/lib/python3/dist-packages/boto/rds/dbsecuritygroup.py�__init__. s
zDBSecurityGroup.__init__c C �
d| j S )NzDBSecurityGroup:%s�r �r r r r
�__repr__7 �
zDBSecurityGroup.__repr__c C sD |dkrt | �}| j�|� |S |dkr t| �}| j�|� |S d S )N�IPRange�EC2SecurityGroup)r r
�appendr r )r r �attrsr �cidr�ec2_grpr r r
�startElement: s zDBSecurityGroup.startElementc C sR |dkr || _ d S |dkr|| _d S |dkr|| _d S |dkr!d S t| ||� d S )N�OwnerId�DBSecurityGroupName�DBSecurityGroupDescription�IPRanges)r r r �setattr�r r �valuer r r r
�
endElementF s
zDBSecurityGroup.endElementc C s | j �| j�S r )r �delete_dbsecurity_groupr r r r r
�deleteR s zDBSecurityGroup.deletec C s4 t |t�r|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)�
isinstancer r r r �authorize_dbsecurity_group�r �cidr_ip� ec2_group�
group_name�group_owner_idr r r
� authorizeU s
�zDBSecurityGroup.authorizec C s<