github.com/brahmaroutu/docker@v1.2.1-0.20160809185609-eb28dde01f16/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  ```
    25  
    26  Lists the tasks that are running as part of the specified service. This command
    27  has to be run targeting a manager node.
    28  
    29  
    30  ## Examples
    31  
    32  ### Listing the tasks that are part of a service
    33  
    34  The following command shows all the tasks that are part of the `redis` service:
    35  
    36  ```bash
    37  $ docker service ps redis
    38  ID                         NAME      SERVICE IMAGE        LAST STATE          DESIRED STATE  NODE
    39  0qihejybwf1x5vqi8lgzlgnpq  redis.1   redis   redis:3.0.6  Running 8 seconds   Running        manager1
    40  bk658fpbex0d57cqcwoe3jthu  redis.2   redis   redis:3.0.6  Running 9 seconds   Running        worker2
    41  5ls5s5fldaqg37s9pwayjecrf  redis.3   redis   redis:3.0.6  Running 9 seconds   Running        worker1
    42  8ryt076polmclyihzx67zsssj  redis.4   redis   redis:3.0.6  Running 9 seconds   Running        worker1
    43  1x0v8yomsncd6sbvfn0ph6ogc  redis.5   redis   redis:3.0.6  Running 8 seconds   Running        manager1
    44  71v7je3el7rrw0osfywzs0lko  redis.6   redis   redis:3.0.6  Running 9 seconds   Running        worker2
    45  4l3zm9b7tfr7cedaik8roxq6r  redis.7   redis   redis:3.0.6  Running 9 seconds   Running        worker2
    46  9tfpyixiy2i74ad9uqmzp1q6o  redis.8   redis   redis:3.0.6  Running 9 seconds   Running        worker1
    47  3w1wu13yuplna8ri3fx47iwad  redis.9   redis   redis:3.0.6  Running 8 seconds   Running        manager1
    48  8eaxrb2fqpbnv9x30vr06i6vt  redis.10  redis   redis:3.0.6  Running 8 seconds   Running        manager1
    49  ```
    50  
    51  
    52  ## Filtering
    53  
    54  The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there
    55  is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`).
    56  Multiple filter flags are combined as an `OR` filter. For example,
    57  `-f name=redis.1 -f name=redis.7` returns both `redis.1` and `redis.7` tasks.
    58  
    59  The currently supported filters are:
    60  
    61  * [id](#id)
    62  * [name](#name)
    63  * [desired-state](#desired-state)
    64  
    65  
    66  #### ID
    67  
    68  The `id` filter matches on all or a prefix of a task's ID.
    69  
    70  ```bash
    71  $ docker service ps -f "id=8" redis
    72  ID                         NAME      SERVICE  IMAGE        LAST STATE         DESIRED STATE  NODE
    73  8ryt076polmclyihzx67zsssj  redis.4   redis    redis:3.0.6  Running 4 minutes  Running        worker1
    74  8eaxrb2fqpbnv9x30vr06i6vt  redis.10  redis    redis:3.0.6  Running 4 minutes  Running        manager1
    75  ```
    76  
    77  #### Name
    78  
    79  The `name` filter matches on task names.
    80  
    81  ```bash
    82  $ docker service ps -f "name=redis.1" redis
    83  ID                         NAME      SERVICE  IMAGE        DESIRED STATE  LAST STATE         NODE
    84  0qihejybwf1x5vqi8lgzlgnpq  redis.1   redis    redis:3.0.6  Running        Running 8 seconds  manager1
    85  ```
    86  
    87  
    88  #### desired-state
    89  
    90  The `desired-state` filter can take the values `running`, `shutdown`, and `accepted`.
    91  
    92  
    93  ## Related information
    94  
    95  * [service create](service_create.md)
    96  * [service inspect](service_inspect.md)
    97  * [service ls](service_ls.md)
    98  * [service rm](service_rm.md)
    99  * [service scale](service_scale.md)
   100  * [service update](service_update.md)