
    h_p                     @    d dl mZmZ  G d de      Z G d de      Zy)   )Model
Collectionc                   2    e Zd ZdZdZed        Zd ZddZy)NodezA node in a swarm.IDc                 V    | j                   j                  d      j                  d      S )z
        The version number of the service. If this is not the same as the
        server, the :py:meth:`update` function will not work and you will
        need to call :py:meth:`reload` before calling it again.
        VersionIndex)attrsget)selfs    5/usr/lib/python3/dist-packages/docker/models/nodes.pyversionzNode.version   s"     zz~~i(,,W55    c                 x    | j                   j                  j                  | j                  | j                  |      S )a  
        Update the node's configuration.

        Args:
            node_spec (dict): Configuration settings to update. Any values
                not provided will be removed. Default: ``None``

        Returns:
            `True` if the request went through.

        Raises:
            :py:class:`docker.errors.APIError`
                If the server returns an error.

        Example:

            >>> node_spec = {'Availability': 'active',
                             'Name': 'node-name',
                             'Role': 'manager',
                             'Labels': {'foo': 'bar'}
                            }
            >>> node.update(node_spec)

        )clientapiupdate_nodeidr   )r   	node_specs     r   updatezNode.update   s)    2 {{**477DLL)LLr   c                 d    | j                   j                  j                  | j                  |      S )a  
        Remove this node from the swarm.

        Args:
            force (bool): Force remove an active node. Default: `False`

        Returns:
            `True` if the request was successful.

        Raises:
            :py:class:`docker.errors.NotFound`
                If the node doesn't exist in the swarm.

            :py:class:`docker.errors.APIError`
                If the server returns an error.
        )force)r   r   remove_noder   )r   r   s     r   removezNode.remove,   s&    " {{**477%*@@r   N)F)	__name__
__module____qualname____doc__id_attributepropertyr   r   r    r   r   r   r      s(    L6 6M6Ar   r   c                        e Zd ZdZeZd Zd Zy)NodeCollectionzNodes on the Docker server.c                 j    | j                  | j                  j                  j                  |            S )a  
        Get a node.

        Args:
            node_id (string): ID of the node to be inspected.

        Returns:
            A :py:class:`Node` object.

        Raises:
            :py:class:`docker.errors.APIError`
                If the server returns an error.
        )prepare_modelr   r   inspect_node)r   node_ids     r   r   zNodeCollection.getD   s(     !!$++//">">w"GHHr   c                      | j                   j                  j                  |i |D cg c]  }| j                  |       c}S c c}w )a  
        List swarm nodes.

        Args:
            filters (dict): Filters to process on the nodes list. Valid
                filters: ``id``, ``name``, ``membership`` and ``role``.
                Default: ``None``

        Returns:
            A list of :py:class:`Node` objects.

        Raises:
            :py:class:`docker.errors.APIError`
                If the server returns an error.

        Example:

            >>> client.nodes.list(filters={'role': 'manager'})
        )r   r   nodesr&   )r   argskwargsns       r   listzNodeCollection.listT   sI    , +T[[__**D;F;
 q!
 	
 
s   AN)r   r   r   r   r   modelr   r.   r"   r   r   r$   r$   @   s    %EI 
r   r$   N)resourcer   r   r   r$   r"   r   r   <module>r1      s#    '9A5 9Ax+
Z +
r   