github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/website/pages/docs/commands/job/history.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: 'Commands: job history'
     4  sidebar_title: history
     5  description: |
     6    The history command is used to display all tracked versions of a job.
     7  ---
     8  
     9  # Command: job history
    10  
    11  The `job history` command is used to display the known versions of a particular
    12  job. The command can display the diff between job versions and can be useful for
    13  understanding the changes that occurred to the job as well as deciding job
    14  versions to revert to.
    15  
    16  ## Usage
    17  
    18  ```plaintext
    19  nomad job history [options] <job>
    20  ```
    21  
    22  The `job history` command requires a single argument, the job ID or an ID prefix
    23  of a job to display the history for.
    24  
    25  ## General Options
    26  
    27  @include 'general_options.mdx'
    28  
    29  ## History Options
    30  
    31  - `-p`: Display the differences between each job and its predecessor.
    32  - `-full`: Display the full job definition for each version.
    33  - `-version`: Display only the history for the given version.
    34  - `-json` : Output the job versions in its JSON format.
    35  - `-t` : Format and display the job versions using a Go template.
    36  
    37  ## Examples
    38  
    39  Display the history showing differences between versions:
    40  
    41  ```shell-sessionnomad job history -p e
    42  Version     = 2
    43  Stable      = false
    44  Submit Date = 07/25/17 20:35:43 UTC
    45  Diff        =
    46  +/- Job: "example"
    47  +/- Task Group: "cache"
    48    +/- Task: "redis"
    49      +/- Resources {
    50            CPU:      "500"
    51            DiskMB:   "0"
    52        +/- MemoryMB: "256" => "512"
    53          }
    54  
    55  Version     = 1
    56  Stable      = false
    57  Submit Date = 07/25/17 20:35:31 UTC
    58  Diff        =
    59  +/- Job: "example"
    60  +/- Task Group: "cache"
    61    +/- Count: "1" => "3"
    62        Task: "redis"
    63  
    64  Version     = 0
    65  Stable      = false
    66  Submit Date = 07/25/17 20:35:28 UTC
    67  ```
    68  
    69  Display the memory ask across submitted job versions:
    70  
    71  ```shell-sessionnomad job history -t "{{range .}}\
    72  v{{.Version}}: {{with index .TaskGroups 0}}{{with index .Tasks 0}}{{.Resources.MemoryMB}}{{end}}{{end}}\
    73  
    74  {{end}}" example
    75  v2: 512
    76  v1: 256
    77  v0: 256
    78  ```