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: //lib/python3/dist-packages/docker/api/__pycache__/config.cpython-310.pyc
o

q_a�
�@s&ddlZddlmZGdd�d�ZdS)�N�)�utilsc@sleZdZe�d�ddd��Ze�d�e�d�dd���Ze�d�e�d�dd	���Ze�d�d
d
d��Z	dS)�ConfigApiMixinz1.30NcCsVt|t�s
|�d�}t�|�}|�d�}||||d�}|�d�}|�|j||d�d�S)a
            Create a config

            Args:
                name (string): Name of the config
                data (bytes): Config data to be stored
                labels (dict): A mapping of labels to assign to the config
                templating (dict): dictionary containing the name of the
                                   templating driver to be used expressed as
                                   { name: <templating_driver_name>}

            Returns (dict): ID of the newly created config
        zutf-8�ascii)�Data�Name�Labels�
Templatingz/configs/create)�dataT)	�
isinstance�bytes�encode�base64�	b64encode�decode�_url�_result�
_post_json)�self�namer
�labels�
templating�body�url�r�3/usr/lib/python3/dist-packages/docker/api/config.py�
create_configs



�
�zConfigApiMixin.create_config�idcCs|�d|�}|�|�|�d�S)a2
            Retrieve config metadata

            Args:
                id (string): Full ID of the config to inspect

            Returns (dict): A dictionary of metadata

            Raises:
                :py:class:`docker.errors.NotFound`
                    if no config with that ID exists
        �/configs/{0}T)rr�_get)rrrrrr�inspect_config'szConfigApiMixin.inspect_configcCs$|�d|�}|�|�}|�|�dS)a%
            Remove a config

            Args:
                id (string): Full ID of the config to remove

            Returns (boolean): True if successful

            Raises:
                :py:class:`docker.errors.NotFound`
                    if no config with that ID exists
        rT)r�_delete�_raise_for_status)rrr�resrrr�
remove_config9s

zConfigApiMixin.remove_configcCs6|�d�}i}|rt�|�|d<|�|j||d�d�S)z�
            List configs

            Args:
                filters (dict): A map of filters to process on the configs
                list. Available filters: ``names``

            Returns (list): A list of configs
        z/configs�filters)�paramsT)rr�convert_filtersrr)rr%rr&rrr�configsMs

zConfigApiMixin.configs)NN)N)
�__name__�
__module__�__qualname__r�minimum_versionr�check_resourcer r$r(rrrrrsr)r�rrrrrr�<module>s