
    p                     @    S SK JrJr   " S S\5      r " S S\5      rg)   )Model
Collectionc                   <    \ rS rSrSrSr\S 5       rS rS	S jr	Sr
g)
Node   zA node in a swarm.IDc                 V    U R                   R                  S5      R                  S5      $ )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    &lib/third_party/docker/models/nodes.pyversionNode.version   s"     zz~~i(,,W55    c                 x    U R                   R                  R                  U R                  U R                  U5      $ )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   updateNode.update   s)    2 {{**477DLL)LLr   c                 ^    U R                   R                  R                  U R                  US9$ )aM  
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   removeNode.remove,   s&    " {{**477%*@@r    N)F)__name__
__module____qualname____firstlineno____doc__id_attributepropertyr   r   r   __static_attributes__r    r   r   r   r      s(    L6 6M6Ar   r   c                   (    \ rS rSrSr\rS rS rSr	g)NodeCollection@   zNodes on the Docker server.c                 j    U R                  U R                  R                  R                  U5      5      $ )z
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   NodeCollection.getD   s(     !!$++//">">w"GHHr   c                     U R                   R                  R                  " U0 UD6 Vs/ s H  nU R                  U5      PM     sn$ s  snf )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   listNodeCollection.listT   sL    , [[__**D;F;
; q!;
 	
 
s   Ar    N)
r!   r"   r#   r$   r%   r   modelr   r6   r(   r    r   r   r*   r*   @   s    %EI 
r   r*   N)resourcer   r   r   r*   r    r   r   <module>r:      s#    '9A5 9Ax+
Z +
r   