§
    ÎÑßj6  ã                   ó¾   — d dl mZmZ d dlmZmZ d dlmZ g d¢Z G d„ d¦  «        Z	 G d„ d¦  «        Z
 G d	„ d
¦  «        Z G d„ d¦  «        Z G d„ de¦  «        ZdS )é    )ÚListÚOptional)Ú
BaseDriverÚConnectionUserAndKey)ÚContainerState)Ú	ContainerÚContainerImageÚContainerClusterÚClusterLocationÚContainerDriverc                   ó<   — e Zd ZdZ	 	 d	d„Zd„ Zd„ Zd„ Zd„ Zd„ Z	dS )
r   z
    Container.
    Nc	                 óœ   — |rt          |¦  «        nd| _        || _        || _        || _        || _        || _        |pi | _        || _        dS )aË  
        :param id: Container id.
        :type id: ``str``

        :param name: The name of the container.
        :type  name: ``str``

        :param image: The image this container was deployed using.
        :type  image: :class:`.ContainerImage`

        :param state: The state of the container, e.g. running
        :type  state: :class:`libcloud.container.types.ContainerState`

        :param ip_addresses: A list of IP addresses for this container
        :type  ip_addresses: ``list`` of ``str``

        :param driver: ContainerDriver instance.
        :type driver: :class:`.ContainerDriver`

        :param extra: (optional) Extra attributes (driver specific).
        :type extra: ``dict``
        N)	ÚstrÚidÚnameÚimageÚstateÚip_addressesÚdriverÚextraÚ
created_at)	Úselfr   r   r   r   r   r   r   r   s	            úK/opt/saltstack/salt/lib/python3.11/site-packages/libcloud/container/base.pyÚ__init__zContainer.__init__$   sU   € ðB  Ð)•#�b‘'”'�' TˆŒØˆŒ	ØˆŒ
ØˆŒ
Ø(ˆÔØˆŒØ�[˜bˆŒ
Ø$ˆŒˆˆó    c                 ó8   — | j                              | ¬¦  «        S ©N)Ú	container)r   Ústart_container©r   s    r   ÚstartzContainer.startN   s   € àŒ{×*Ò*°TÐ*Ñ:Ô:Ð:r   c                 ó8   — | j                              | ¬¦  «        S r   )r   Ústop_containerr    s    r   ÚstopzContainer.stopR   s   € àŒ{×)Ò)°DÐ)Ñ9Ô9Ð9r   c                 ó8   — | j                              | ¬¦  «        S r   )r   Úrestart_containerr    s    r   ÚrestartzContainer.restartV   ó   € àŒ{×,Ò,°tÐ,Ñ<Ô<Ð<r   c                 ó8   — | j                              | ¬¦  «        S r   )r   Údestroy_containerr    s    r   ÚdestroyzContainer.destroyZ   r(   r   c           	      óR   — d| j         ›d| j        ›d| j        ›d| j        j        ›d�	S )Nz<Container: id=ú, name=z,state=z, provider=z ...>)r   r   r   r   r    s    r   Ú__repr__zContainer.__repr__^   s7   € € àŒGˆGˆGØŒIˆIˆIØŒJˆJˆJØŒKÔÐÐð	
ð 	
r   ©NN)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r!   r$   r'   r+   r.   © r   r   r   r      s†   € € € € € ðð ð Øð(%ð (%ð (%ð (%ðT;ð ;ð ;ð:ð :ð :ð=ð =ð =ð=ð =ð =ð
ð 
ð 
ð 
ð 
r   r   c                   ó*   — e Zd ZdZ	 dd„Zdd„Zd„ ZdS )	r	   z
    Container Image.
    Nc                 ó€   — |rt          |¦  «        nd| _        || _        || _        || _        || _        |pi | _        dS )aõ  
        :param id: Container Image id.
        :type id: ``str``

        :param name: The name of the image.
        :type  name: ``str``

        :param path: The path to the image
        :type  path: ``str``

        :param version: The version of the image
        :type  version: ``str``

        :param driver: ContainerDriver instance.
        :type driver: :class:`.ContainerDriver`

        :param extra: (optional) Extra attributes (driver specific).
        :type extra: ``dict``
        N)r   r   r   ÚpathÚversionr   r   )r   r   r   r7   r8   r   r   s          r   r   zContainerImage.__init__l   sE   € ð8  Ð)•#�b‘'”'�' TˆŒØˆŒ	ØˆŒ	ØˆŒØˆŒØ�[˜bˆŒ
ˆ
ˆ
r   Tc                 ó@   — | j                              || |||¬¦  «        S )N)r   r   Ú
parametersÚclusterr!   )r   Údeploy_container)r   r   r:   r;   r!   s        r   ÚdeployzContainerImage.deploy�   s-   € àŒ{×+Ò+Ø˜T¨jÀ'ÐQVð ,ñ 
ô 
ð 	
r   c                 óN   — d                      | j        | j        | j        ¦  «        S )Nz-<ContainerImage: id={}, name={}, path={} ...>)Úformatr   r   r7   r    s    r   r.   zContainerImage.__repr__•   s)   € Ø>×EÒEØŒGØŒIØŒIñ
ô 
ð 	
r   ©N)NT)r0   r1   r2   r3   r   r=   r.   r4   r   r   r	   r	   g   s[   € € € € € ðð ð ð!!ð !!ð !!ð !!ðF
ð 
ð 
ð 
ð
ð 
ð 
ð 
ð 
r   r	   c                   ó.   — e Zd ZdZ	 dd„Zd„ Zd„ Zd„ ZdS )r
   z(
    A cluster group for containers
    Nc                 ód   — |rt          |¦  «        nd| _        || _        || _        |pi | _        dS )aZ  
        :param id: Container Image id.
        :type id: ``str``

        :param name: The name of the image.
        :type  name: ``str``

        :param driver: ContainerDriver instance.
        :type driver: :class:`.ContainerDriver`

        :param extra: (optional) Extra attributes (driver specific).
        :type extra: ``dict``
        N)r   r   r   r   r   )r   r   r   r   r   s        r   r   zContainerCluster.__init__¢   s7   € ð(  Ð)•#�b‘'”'�' TˆŒØˆŒ	ØˆŒØ�[˜bˆŒ
ˆ
ˆ
r   c                 ó8   — | j                              | ¬¦  «        S ©N)r;   )r   Úlist_containersr    s    r   rE   z ContainerCluster.list_containers»   ó   € àŒ{×*Ò*°4Ð*Ñ8Ô8Ð8r   c                 ó8   — | j                              | ¬¦  «        S rD   )r   Údestroy_clusterr    s    r   r+   zContainerCluster.destroy¿   rF   r   c                 óX   — d                      | j        | j        | j        j        ¦  «        S )Nz3<ContainerCluster: id={}, name={}, provider={} ...>)r?   r   r   r   r    s    r   r.   zContainerCluster.__repr__Ã   s,   € ØD×KÒKØŒGØŒIØŒKÔñ
ô 
ð 	
r   r@   )r0   r1   r2   r3   r   rE   r+   r.   r4   r   r   r
   r
   �   sd   € € € € € ðð ð ð!ð !ð !ð !ð29ð 9ð 9ð9ð 9ð 9ð
ð 
ð 
ð 
ð 
r   r
   c                   ó   — e Zd ZdZd„ Zd„ ZdS )r   zø
    A physical location where clusters can be.

    >>> from libcloud.container.drivers.dummy import DummyContainerDriver
    >>> driver = DummyContainerDriver(0)
    >>> location = driver.list_locations()[0]
    >>> location.country
    'US'
    c                 óX   — t          |¦  «        | _        || _        || _        || _        dS )a7  
        :param id: Location ID.
        :type id: ``str``

        :param name: Location name.
        :type name: ``str``

        :param country: Location country.
        :type country: ``str``

        :param driver: Driver this location belongs to.
        :type driver: :class:`.ContainerDriver`
        N)r   r   r   Úcountryr   )r   r   r   rL   r   s        r   r   zClusterLocation.__init__Ö   s*   € õ( �b‘'”'ˆŒØˆŒ	ØˆŒØˆŒˆˆr   c           	      óR   — d| j         ›d| j        ›d| j        ›d| j        j        ›d�	S )Nz<ClusterLocation: id=r-   z
, country=z	, driver=ú>)r   r   rL   r   r    s    r   r.   zClusterLocation.__repr__ï   s7   € € àŒGˆGˆGØŒIˆIˆIØŒLˆLˆLØŒKÔÐÐð	
ð 	
r   N)r0   r1   r2   r3   r   r.   r4   r   r   r   r   Ë   s<   € € € € € ðð ðð ð ð2
ð 
ð 
ð 
ð 
r   r   c                   óœ   ‡ — e Zd ZdZeZdZdZdZ	 dˆ fd„	Z	d„ Z
d„ Z	 	 dd„Z	 	 	 dd	„Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zdd„Zd„ Zdd„Zd„ Zˆ xZS )r   zp
    A base ContainerDriver class to derive from

    This class is always subclassed by a specific driver.
    NFTc           	      óF   •—  t          ¦   «         j        d|||||dœ|¤Ž dS )aP  
        :param    key: API key or username to used (required)
        :type     key: ``str``

        :param    secret: Secret password to be used (required)
        :type     secret: ``str``

        :param    secure: Whether to use HTTPS or HTTP. Note: Some providers
                only support HTTPS, and it is on by default.
        :type     secure: ``bool``

        :param    host: Override hostname used for connections.
        :type     host: ``str``

        :param    port: Override port used for connections.
        :type     port: ``int``

        :return: ``None``
        )ÚkeyÚsecretÚsecureÚhostÚportNr4   )Úsuperr   )r   rQ   rR   rS   rT   rU   ÚkwargsÚ	__class__s          €r   r   zContainerDriver.__init__  s7   ø€ ð( 	�‰ŒÔÐ_˜S¨¸ÀTÐPTÐ_Ð_ÐX^Ð_Ð_Ð_Ð_Ð_r   c                 ó    — t          d¦  «        ‚)z¸
        Install a container image from a remote path.

        :param path: Path to the container image
        :type  path: ``str``

        :rtype: :class:`.ContainerImage`
        z-install_image not implemented for this driver©ÚNotImplementedError)r   r7   s     r   Úinstall_imagezContainerDriver.install_image  ó   € õ "Ð"QÑRÔRÐRr   c                 ó    — t          d¦  «        ‚)zk
        List the installed container images

        :rtype: ``list`` of :class:`.ContainerImage`
        z+list_images not implemented for this driverrZ   r    s    r   Úlist_imageszContainerDriver.list_images)  s   € õ "Ð"OÑPÔPÐPr   c                 ó    — t          d¦  «        ‚)aC  
        List the deployed container images

        :param image: Filter to containers with a certain image
        :type  image: :class:`.ContainerImage`

        :param cluster: Filter to containers in a cluster
        :type  cluster: :class:`.ContainerCluster`

        :rtype: ``list`` of :class:`.Container`
        z/list_containers not implemented for this driverrZ   )r   r   r;   s      r   rE   zContainerDriver.list_containers2  s   € õ" "Ð"SÑTÔTÐTr   c                 ó    — t          d¦  «        ‚)a7  
        Deploy an installed container image

        :param name: The name of the new container
        :type  name: ``str``

        :param image: The container image to deploy
        :type  image: :class:`.ContainerImage`

        :param cluster: The cluster to deploy to, None is default
        :type  cluster: :class:`.ContainerCluster`

        :param parameters: Container Image parameters
        :type  parameters: ``str``

        :param start: Start the container on deployment
        :type  start: ``bool``

        :rtype: :class:`.Container`
        z0deploy_container not implemented for this driverrZ   )r   r   r   r;   r:   r!   s         r   r<   z ContainerDriver.deploy_containerE  s   € õ: "Ð"TÑUÔUÐUr   c                 ó    — t          d¦  «        ‚)zš
        Get a container by ID

        :param id: The ID of the container to get
        :type  id: ``str``

        :rtype: :class:`.Container`
        z-get_container not implemented for this driverrZ   ©r   r   s     r   Úget_containerzContainerDriver.get_containerd  r]   r   c                 ó    — t          d¦  «        ‚)z±
        Start a deployed container

        :param container: The container to start
        :type  container: :class:`.Container`

        :rtype: :class:`.Container`
        z/start_container not implemented for this driverrZ   ©r   r   s     r   r   zContainerDriver.start_containerp  s   € õ "Ð"SÑTÔTÐTr   c                 ó    — t          d¦  «        ‚)z¯
        Stop a deployed container

        :param container: The container to stop
        :type  container: :class:`.Container`

        :rtype: :class:`.Container`
        z.stop_container not implemented for this driverrZ   rf   s     r   r#   zContainerDriver.stop_container|  s   € õ "Ð"RÑSÔSÐSr   c                 ó    — t          d¦  «        ‚)zµ
        Restart a deployed container

        :param container: The container to restart
        :type  container: :class:`.Container`

        :rtype: :class:`.Container`
        z1restart_container not implemented for this driverrZ   rf   s     r   r&   z!ContainerDriver.restart_containerˆ  ó   € õ "Ð"UÑVÔVÐVr   c                 ó    — t          d¦  «        ‚)zª
        Destroy a deployed container

        :param container: The container to destroy
        :type  container: :class:`.Container`

        :rtype: ``bool``
        z1destroy_container not implemented for this driverrZ   rf   s     r   r*   z!ContainerDriver.destroy_container”  ri   r   c                 ó    — t          d¦  «        ‚)z‚
        Get a list of potential locations to deploy clusters into

        :rtype: ``list`` of :class:`.ClusterLocation`
        z.list_locations not implemented for this driverrZ   r    s    r   Úlist_locationszContainerDriver.list_locations   s   € õ "Ð"RÑSÔSÐSr   c                 ó    — t          d¦  «        ‚)a  
        Create a container cluster

        :param  name: The name of the cluster
        :type   name: ``str``

        :param  location: The location to create the cluster in
        :type   location: :class:`.ClusterLocation`

        :rtype: :class:`.ContainerCluster`
        z.create_cluster not implemented for this driverrZ   )r   r   Úlocations      r   Úcreate_clusterzContainerDriver.create_cluster©  s   € õ "Ð"RÑSÔSÐSr   c                 ó    — t          d¦  «        ‚)zŠ
        Delete a cluster

        :return: ``True`` if the destroy was successful, otherwise ``False``.
        :rtype: ``bool``
        z/destroy_cluster not implemented for this driverrZ   )r   r;   s     r   rH   zContainerDriver.destroy_cluster¸  s   € õ "Ð"SÑTÔTÐTr   c                 ó    — t          d¦  «        ‚)zì
        Get a list of potential locations to deploy clusters into

        :param  location: The location to search in
        :type   location: :class:`.ClusterLocation`

        :rtype: ``list`` of :class:`.ContainerCluster`
        ú-list_clusters not implemented for this driverrZ   )r   rn   s     r   Úlist_clusterszContainerDriver.list_clustersÂ  r]   r   c                 ó    — t          d¦  «        ‚)z�
        Get a cluster by ID

        :param id: The ID of the cluster to get
        :type  id: ``str``

        :rtype: :class:`.ContainerCluster`
        rr   rZ   rc   s     r   Úget_clusterzContainerDriver.get_clusterÎ  r]   r   )NTNNr/   )NNTr@   )r0   r1   r2   r3   r   ÚconnectionClsr   ÚwebsiteÚsupports_clustersr   r\   r_   rE   r<   rd   r   r#   r&   r*   rl   ro   rH   rs   ru   Ú__classcell__)rX   s   @r   r   r   ø   s”  ø€ € € € € ðð ð )€MØ€DØ€GØÐðð`ð `ð `ð `ð `ð `ð,
Sð 
Sð 
SðQð Qð Qð ØðUð Uð Uð Uð. ØØðVð Vð Vð Vð>
Sð 
Sð 
Sð
Uð 
Uð 
Uð
Tð 
Tð 
Tð
Wð 
Wð 
Wð
Wð 
Wð 
WðTð Tð TðTð Tð Tð TðUð Uð Uð
Sð 
Sð 
Sð 
Sð
Sð 
Sð 
Sð 
Sð 
Sð 
Sð 
Sr   r   N)Útypingr   r   Úlibcloud.common.baser   r   Úlibcloud.container.typesr   Ú__all__r   r	   r
   r   r   r4   r   r   ú<module>r~      sN  ðð" "Ð !Ð !Ð !Ð !Ð !Ð !Ð !à AÐ AÐ AÐ AÐ AÐ AÐ AÐ AØ 3Ð 3Ð 3Ð 3Ð 3Ð 3ðð ð €ðE
ð E
ð E
ð E
ð E
ñ E
ô E
ð E
ðP3
ð 3
ð 3
ð 3
ð 3
ñ 3
ô 3
ð 3
ðl+
ð +
ð +
ð +
ð +
ñ +
ô +
ð +
ð\*
ð *
ð *
ð *
ð *
ñ *
ô *
ð *
ðZ`Sð `Sð `Sð `Sð `S�jñ `Sô `Sð `Sð `Sð `Sr   