HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/docker/models/__pycache__/plugins.cpython-310.pyc
o

�2.a��@s@ddlmZddlmZmZGdd�de�ZGdd�de�ZdS)	�)�errors�)�
Collection�Modelc@sreZdZdZdd�Zedd��Zedd��Zedd	��Zd
d�Z	dd
�Z
ddd�Zdd�Zddd�Z
ddd�ZdS)�Pluginz!
    A plugin on the server.
    cCsd|jj�d|j�d�S)N�<z: 'z'>)�	__class__�__name__�name��self�r
�7/usr/lib/python3/dist-packages/docker/models/plugins.py�__repr__	szPlugin.__repr__cC�|j�d�S)z$
        The plugin's name.
        �Name��attrs�getrr
r
rr
�zPlugin.namecCr)z0
        Whether the plugin is enabled.
        �Enabledrrr
r
r�enabledrzPlugin.enabledcCr)zG
        A dictionary representing the plugin's configuration.
        �Settingsrrr
r
r�settingsrzPlugin.settingscC�|jj�|j|�|��dS)a
            Update the plugin's settings.

            Args:
                options (dict): A key-value mapping of options.

            Raises:
                :py:class:`docker.errors.APIError`
                    If the server returns an error.
        N)�client�api�configure_pluginr
�reload)r�optionsr
r
r�	configure!�zPlugin.configurecCs|jj�|j�|��dS)z�
            Disable the plugin.

            Raises:
                :py:class:`docker.errors.APIError`
                    If the server returns an error.
        N)rr�disable_pluginr
rrr
r
r�disable/s	zPlugin.disable�cCr)z�
            Enable the plugin.

            Args:
                timeout (int): Timeout in seconds. Default: 0

            Raises:
                :py:class:`docker.errors.APIError`
                    If the server returns an error.
        N)rr�
enable_pluginr
r)r�timeoutr
r
r�enable;r!z
Plugin.enablecCs|jj�|j�S)a
            Push the plugin to a remote registry.

            Returns:
                A dict iterator streaming the status of the upload.

            Raises:
                :py:class:`docker.errors.APIError`
                    If the server returns an error.
        )rr�push_pluginr
rr
r
r�pushIszPlugin.pushFcCs|jjj|j|d�S)a.
            Remove the plugin from the server.

            Args:
                force (bool): Remove even if the plugin is enabled.
                    Default: False

            Raises:
                :py:class:`docker.errors.APIError`
                    If the server returns an error.
        )�force)rr�
remove_pluginr
)rr*r
r
r�removeVsz
Plugin.removeNccsT�|jr	t�d��|dur|j}|jj�|�}|jj�|j||�EdH|��dS)aR
            Upgrade the plugin.

            Args:
                remote (string): Remote reference to upgrade to. The
                    ``:latest`` tag is optional and is the default if omitted.
                    Default: this plugin's name.

            Returns:
                A generator streaming the decoded API logs
        z)Plugin must be disabled before upgrading.N)	rr�DockerErrorr
rr�plugin_privileges�upgrade_pluginr)r�remote�
privilegesr
r
r�upgradeds��zPlugin.upgrade)r$�F�N)r	�
__module__�__qualname__�__doc__r�propertyr
rrr r#r'r)r,r2r
r
r
rrs





rc@s4eZdZeZddd�Zdd�Zddd�Zd	d
�ZdS)
�PluginCollectionFcCs|jj�|||�|�|�S)aC
            Create a new plugin.

            Args:
                name (string): The name of the plugin. The ``:latest`` tag is
                    optional, and is the default if omitted.
                plugin_data_dir (string): Path to the plugin data directory.
                    Plugin data directory must contain the ``config.json``
                    manifest file and the ``rootfs`` directory.
                gzip (bool): Compress the context using gzip. Default: False

            Returns:
                (:py:class:`Plugin`): The newly created plugin.
        )rr�
create_pluginr)rr
�plugin_data_dir�gzipr
r
r�creates
zPluginCollection.createcCs|�|jj�|��S)ah
        Gets a plugin.

        Args:
            name (str): The name of the plugin.

        Returns:
            (:py:class:`Plugin`): The plugin.

        Raises:
            :py:class:`docker.errors.NotFound` If the plugin does not
            exist.
            :py:class:`docker.errors.APIError`
                If the server returns an error.
        )�
prepare_modelrr�inspect_plugin)rr
r
r
rr�szPluginCollection.getNcCs8|jj�|�}|jj�|||�}|D]}q|�|p|�S)a�
            Pull and install a plugin.

            Args:
                remote_name (string): Remote reference for the plugin to
                    install. The ``:latest`` tag is optional, and is the
                    default if omitted.
                local_name (string): Local name for the pulled plugin.
                    The ``:latest`` tag is optional, and is the default if
                    omitted. Optional.

            Returns:
                (:py:class:`Plugin`): The installed plugin
            Raises:
                :py:class:`docker.errors.APIError`
                    If the server returns an error.
        )rrr.�pull_pluginr)r�remote_name�
local_namer1�it�datar
r
r�install�s
zPluginCollection.installcs�jj��}�fdd�|D�S)z�
        List plugins installed on the server.

        Returns:
            (list of :py:class:`Plugin`): The plugins.

        Raises:
            :py:class:`docker.errors.APIError`
                If the server returns an error.
        csg|]}��|��qSr
)r>)�.0�rrr
r�
<listcomp>�sz)PluginCollection.list.<locals>.<listcomp>)rr�plugins)r�respr
rr�list�szPluginCollection.listr3r4)	r	r5r6r�modelr=rrErKr
r
r
rr9|s

r9N)�r�resourcerrrr9r
r
r
r�<module>sw