
    
                     ,    S SK r SSKJr   " S S5      rg)    N   )utilsc                   0   \ rS rSr\R
                  " S5      S
S j5       r\R
                  " S5      \R                  " S5      S 5       5       r\R
                  " S5      \R                  " S5      S 5       5       r	\R
                  " S5      SS j5       r
S	rg)ConfigApiMixin   z1.30Nc                 
   [        U[        5      (       d  UR                  S5      n[        R                  " U5      nUR                  S5      nUUUUS.nU R                  S5      nU R                  U R                  XeS9S5      $ )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
zutf-8ascii)DataNameLabels
Templatingz/configs/create)dataT)	
isinstancebytesencodebase64	b64encodedecode_url_result
_post_json)selfnamer   labels
templatingbodyurls          $lib/third_party/docker/api/config.pycreate_configConfigApiMixin.create_config   s     $&&;;w'D%{{7#$	
 ii)*||OOCO+T
 	
    idc                 h    U R                  SU5      nU R                  U R                  U5      S5      $ )z
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)r   r   _get)r   r"   r   s      r   inspect_configConfigApiMixin.inspect_config'   s-     ii+||DIIcND11r!   c                 l    U R                  SU5      nU R                  U5      nU R                  U5        g)z
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
r$   T)r   _delete_raise_for_status)r   r"   r   ress       r   remove_configConfigApiMixin.remove_config9   s3     ii+ll3s#r!   c                     U R                  S5      n0 nU(       a  [        R                  " U5      US'   U R                  U R	                  X#S9S5      $ )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)r   r   convert_filtersr   r%   )r   r/   r   r0   s       r   configsConfigApiMixin.configsM   sK     ii
# % 5 5g >F9||DIIcI94@@r!    )NN)N)__name__
__module____qualname____firstlineno__r   minimum_versionr   check_resourcer&   r,   r2   __static_attributes__r4   r!   r   r   r      s    
6"
 #
> 6"
$2   #2  6"
$   #$ 6"A #Ar!   r   )r    r   r   r4   r!   r   <module>r=      s     VA VAr!   