Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/module_utils/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/module_utils/oneandone.pyo

�
�Udac@s�ddlZddd��YZd�Zed�Zed�Zed�Zed�Zed	�Zed
�Z	ed�Z
ed�Zed
�Zed�Z
ed�Zed�Zd�Zd�ZdS(i����NtOneAndOneResourcescBs>eZdZdZdZdZdZdZdZdZ	dZ
RS(	tfirewall_policyt
load_balancertmonitoring_policytprivate_networkt	public_iptroletservertusertvpn(t__name__t
__module__RRRRRRRRR	(((sB/usr/lib/python2.7/site-packages/ansible/module_utils/oneandone.pyRscCsvi	|jd6|jd6|jd6|jd6|jd6|jd6|jd6|jd6|jd	6}|j	|d�|�S(
NRRRRRRRRR	(tget_firewalltget_load_balancertget_monitoring_policytget_private_networkt
get_public_iptget_rolet
get_servertget_usertget_vpntgettNone(toneandone_connt
resource_typetresource_idtswitcher((sB/usr/lib/python2.7/site-packages/ansible/module_utils/oneandone.pytget_resource)s








cCsGx@|j�D]2}||d|dfkr
|r7|S|dSq
WdS(s_
    Validates the datacenter exists by ID or country code.
    Returns the datacenter ID.
    tidtcountry_codeN(tlist_datacenters(Rt
datacentertfull_objectt_datacenter((sB/usr/lib/python2.7/site-packages/ansible/module_utils/oneandone.pytget_datacenter9s
cCsGx@|j�D]2}||d|dfkr
|r7|S|dSq
WdS(sb
    Validates the fixed instance size exists by ID or name.
    Return the instance size ID.
    RtnameN(tfixed_server_flavors(Rtfixed_instance_sizeR t_fixed_instance_size((sB/usr/lib/python2.7/site-packages/ansible/module_utils/oneandone.pytget_fixed_instance_sizeEs
cCsMxF|jdd�D]2}||d|dfkr|r=|S|dSqWdS(sT
    Validates the appliance exists by ID or name.
    Return the appliance ID.
    tqtIMAGERR#N(tlist_appliances(Rt	applianceR t
_appliance((sB/usr/lib/python2.7/site-packages/ansible/module_utils/oneandone.pyt
get_applianceRs
cCsGx@|j�D]2}||d|dfkr
|r7|S|dSq
WdS(s`
    Validates the private network exists by ID or name.
    Return the private network ID.
    R#RN(tlist_private_networks(RRR t_private_network((sB/usr/lib/python2.7/site-packages/ansible/module_utils/oneandone.pyR^s
cCsGx@|j�D]2}||d|dfkr
|r7|S|dSq
WdS(sd
    Validates the monitoring policy exists by ID or name.
    Return the monitoring policy ID.
    R#RN(tlist_monitoring_policies(RRR t_monitoring_policy((sB/usr/lib/python2.7/site-packages/ansible/module_utils/oneandone.pyRks
cCsGx@|j�D]2}||d|dfkr
|r7|S|dSq
WdS(s`
    Validates the firewall policy exists by ID or name.
    Return the firewall policy ID.
    R#RN(tlist_firewall_policies(RRR t_firewall_policy((sB/usr/lib/python2.7/site-packages/ansible/module_utils/oneandone.pytget_firewall_policyxs
cCsGx@|j�D]2}||d|dfkr
|r7|S|dSq
WdS(s\
    Validates the load balancer exists by ID or name.
    Return the load balancer ID.
    R#RN(tlist_load_balancers(RRR t_load_balancer((sB/usr/lib/python2.7/site-packages/ansible/module_utils/oneandone.pyR
�s
cCsMxF|jdd�D]2}||d|dfkr|r=|S|dSqWdS(sj
    Validates that the server exists whether by ID or name.
    Returns the server if one was found.
    tper_pagei�RR#N(tlist_servers(RtinstanceR R((sB/usr/lib/python2.7/site-packages/ansible/module_utils/oneandone.pyR�s
cCsMxF|jdd�D]2}||d|dfkr|r=|S|dSqWdS(s`
    Validates that the user exists by ID or a name.
    Returns the user if one was found.
    R7i�RR#N(t
list_users(RRR t_user((sB/usr/lib/python2.7/site-packages/ansible/module_utils/oneandone.pyR�s
cCsMxF|jdd�D]2}||d|dfkr|r=|S|dSqWdS(s�
    Given a name, validates that the role exists
    whether it is a proper ID or a name.
    Returns the role if one was found, else None.
    R7i�RR#N(t
list_roles(RRR t_role((sB/usr/lib/python2.7/site-packages/ansible/module_utils/oneandone.pyR�s
cCsMxF|jdd�D]2}||d|dfkr|r=|S|dSqWdS(s^
    Validates that the vpn exists by ID or a name.
    Returns the vpn if one was found.
    R7i�RR#N(t	list_vpns(RR	R t_vpn((sB/usr/lib/python2.7/site-packages/ansible/module_utils/oneandone.pyR�s
cCsMxF|jdd�D]2}||d|dfkr|r=|S|dSqWdS(sj
    Validates that the public ip exists by ID or a name.
    Returns the public ip if one was found.
    R7i�RtipN(tlist_public_ips(RRR t
_public_ip((sB/usr/lib/python2.7/site-packages/ansible/module_utils/oneandone.pyR�s
cCs+tj�|}x�|tj�krtj|�t|||�}|tjkrd|dd}n
|d}|tjkr�|j�dks�|tjkr�|j�dkr�dS|j�dkr�td||f��q|j�d
kr�qqtd||f��qWtd||f��dS(sZ
    Waits for the resource create operation to complete based on the timeout period.
    tstatuststatet
powered_ontactiveNtfaileds%s creation failed for %stenabledt	deployingtconfiguringsUnknown %s state %ss*Timed out waiting for %s completion for %s(RFRHRIRJ(ttimetsleepRRRtlowert	Exception(RRRtwait_timeoutt
wait_intervaltresourcetresource_state((sB/usr/lib/python2.7/site-packages/ansible/module_utils/oneandone.pyt%wait_for_resource_creation_completion�s*

!!		cCstj�|}x�|tj�kr�tj|�|jdddddd�}|tjkrhd}n(|tjkr�d}ntd	|��xZ|D]R}|d
d|kr�|ddkr�|d
|kr�|dddkr�dSq�WqWtd||f��dS(sZ
    Waits for the resource delete operation to complete based on the timeout period.
    R(tDELETEtperiodt	LAST_HOURtsorts-start_datetVMtPRIVATENETWORKs5Unsupported wait_for delete operation for %s resourceRQRtactionttypeRCRDtOKNs(Timed out waiting for %s deletion for %s(RKRLt	list_logsRRRRN(RRRRORPtlogst_typetlog((sB/usr/lib/python2.7/site-packages/ansible/module_utils/oneandone.pyt%wait_for_resource_deletion_completion�s(
			

((RKRRtFalseR"R'R-RRR4R
RRRRRRSRa(((sB/usr/lib/python2.7/site-packages/ansible/module_utils/oneandone.pyt<module>s 	





	&

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]