github.com/vieux/docker@v0.6.3-0.20161004191708-e097c2a938c7/docs/reference/commandline/service_ps.md (about)

     1  <!--[metadata]>
     2  +++
     3  title = "service ps"
     4  description = "The service ps command description and usage"
     5  keywords = ["service, tasks", "ps"]
     6  aliases = ["/engine/reference/commandline/service_tasks/"]
     7  [menu.main]
     8  parent = "smn_cli"
     9  +++
    10  <![end-metadata]-->
    11  
    12  # service ps
    13  
    14  ```Markdown
    15  Usage:	docker service ps [OPTIONS] SERVICE
    16  
    17  List the tasks of a service
    18  
    19  Options:
    20    -a, --all            Display all tasks
    21    -f, --filter value   Filter output based on conditions provided
    22        --help           Print usage
    23        --no-resolve     Do not map IDs to Names
    24        --no-trunc       Do not truncate output
    25  ```
    26  
    27  Lists the tasks that are running as part of the specified service. This command
    28  has to be run targeting a manager node.
    29  
    30  
    31  ## Examples
    32  
    33  ### Listing the tasks that are part of a service
    34  
    35  The following command shows all the tasks that are part of the `redis` service:
    36  
    37  ```bash
    38  $ docker service ps redis
    39  NAME                                IMAGE        NODE      DESIRED STATE  CURRENT STATE
    40  redis.1.0qihejybwf1x5vqi8lgzlgnpq   redis:3.0.6  manager1  Running        Running 8 seconds
    41  redis.2.bk658fpbex0d57cqcwoe3jthu   redis:3.0.6  worker2   Running        Running 9 seconds
    42  redis.3.5ls5s5fldaqg37s9pwayjecrf   redis:3.0.6  worker1   Running        Running 9 seconds
    43  redis.4.8ryt076polmclyihzx67zsssj   redis:3.0.6  worker1   Running        Running 9 seconds
    44  redis.5.1x0v8yomsncd6sbvfn0ph6ogc   redis:3.0.6  manager1  Running        Running 8 seconds
    45  redis.6.71v7je3el7rrw0osfywzs0lko   redis:3.0.6  worker2   Running        Running 9 seconds
    46  redis.7.4l3zm9b7tfr7cedaik8roxq6r   redis:3.0.6  worker2   Running        Running 9 seconds
    47  redis.8.9tfpyixiy2i74ad9uqmzp1q6o   redis:3.0.6  worker1   Running        Running 9 seconds
    48  redis.9.3w1wu13yuplna8ri3fx47iwad   redis:3.0.6  manager1  Running        Running 8 seconds
    49  redis.10.8eaxrb2fqpbnv9x30vr06i6vt  redis:3.0.6  manager1  Running        Running 8 seconds
    50  ```
    51  
    52  
    53  ## Filtering
    54  
    55  The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there
    56  is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`).
    57  Multiple filter flags are combined as an `OR` filter. For example,
    58  `-f name=redis.1 -f name=redis.7` returns both `redis.1` and `redis.7` tasks.
    59  
    60  The currently supported filters are:
    61  
    62  * [id](#id)
    63  * [name](#name)
    64  * [node](#node)
    65  * [desired-state](#desired-state)
    66  
    67  
    68  #### ID
    69  
    70  The `id` filter matches on all or a prefix of a task's ID.
    71  
    72  ```bash
    73  $ docker service ps -f "id=8" redis
    74  NAME                                IMAGE        NODE      DESIRED STATE  CURRENT STATE
    75  redis.4.8ryt076polmclyihzx67zsssj   redis:3.0.6  worker1   Running        Running 9 seconds
    76  redis.10.8eaxrb2fqpbnv9x30vr06i6vt  redis:3.0.6  manager1  Running        Running 8 seconds
    77  ```
    78  
    79  #### Name
    80  
    81  The `name` filter matches on task names.
    82  
    83  ```bash
    84  $ docker service ps -f "name=redis.1" redis
    85  NAME                                IMAGE        NODE      DESIRED STATE  CURRENT STATE
    86  redis.1.0qihejybwf1x5vqi8lgzlgnpq   redis:3.0.6  manager1  Running        Running 8 seconds
    87  ```
    88  
    89  
    90  #### Node
    91  
    92  The `node` filter matches on a node name or a node ID.
    93  
    94  ```bash
    95  $ docker service ps -f "node=manager1" redis
    96  NAME                                IMAGE        NODE      DESIRED STATE  CURRENT STATE
    97  redis.1.0qihejybwf1x5vqi8lgzlgnpq   redis:3.0.6  manager1  Running        Running 8 seconds
    98  redis.5.1x0v8yomsncd6sbvfn0ph6ogc   redis:3.0.6  manager1  Running        Running 8 seconds
    99  redis.9.3w1wu13yuplna8ri3fx47iwad   redis:3.0.6  manager1  Running        Running 8 seconds
   100  redis.10.8eaxrb2fqpbnv9x30vr06i6vt  redis:3.0.6  manager1  Running        Running 8 seconds
   101  ```
   102  
   103  
   104  #### desired-state
   105  
   106  The `desired-state` filter can take the values `running`, `shutdown`, and `accepted`.
   107  
   108  
   109  ## Related information
   110  
   111  * [service create](service_create.md)
   112  * [service inspect](service_inspect.md)
   113  * [service ls](service_ls.md)
   114  * [service rm](service_rm.md)
   115  * [service scale](service_scale.md)
   116  * [service update](service_update.md)