HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/CyberCP/lib/python3.10/site-packages/docker/models/__pycache__/plugins.cpython-310.pyc
o

�hS�@s@ddlmZddlmZmZGdd�de�ZGdd�de�ZdS)	�)�errors�)�
Collection�Modelc@steZdZdZdd�Zedd��Zedd��Zedd	��Zd
d�Z	dd
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
�H/usr/local/CyberCP/lib/python3.10/site-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.configureFcCr)z�
            Disable the plugin.

            Args:
                force (bool): Force disable. Default: False

            Raises:
                :py:class:`docker.errors.APIError`
                    If the server returns an error.
        N)rr�disable_pluginr
r�r�forcer
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�pushLszPlugin.pushcCs|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.
        )r$)rr�
remove_pluginr
r#r
r
r�removeYs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�upgradegs��
�zPlugin.upgrade�F)r&�N)r	�
__module__�__qualname__�__doc__r�propertyr
rrr r%r)r+r-r3r
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�create�s
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_namer2�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.listr4r5)	r	r6r7r�modelr>rrFrLr
r
r
rr:�s

r:N)�r�resourcerrrr:r
r
r
r�<module>s~