github.com/adityamillind98/nomad@v0.11.8/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-session
    42  $ nomad job history -p e
    43  Version     = 2
    44  Stable      = false
    45  Submit Date = 07/25/17 20:35:43 UTC
    46  Diff        =
    47  +/- Job: "example"
    48  +/- Task Group: "cache"
    49    +/- Task: "redis"
    50      +/- Resources {
    51            CPU:      "500"
    52            DiskMB:   "0"
    53        +/- MemoryMB: "256" => "512"
    54          }
    55  
    56  Version     = 1
    57  Stable      = false
    58  Submit Date = 07/25/17 20:35:31 UTC
    59  Diff        =
    60  +/- Job: "example"
    61  +/- Task Group: "cache"
    62    +/- Count: "1" => "3"
    63        Task: "redis"
    64  
    65  Version     = 0
    66  Stable      = false
    67  Submit Date = 07/25/17 20:35:28 UTC
    68  ```
    69  
    70  Display the memory ask across submitted job versions:
    71  
    72  ```shell-session
    73  $ nomad job history -t "{{range .}}\
    74  v{{.Version}}: {{with index .TaskGroups 0}}{{with index .Tasks 0}}{{.Resources.MemoryMB}}{{end}}{{end}}\
    75  
    76  {{end}}" example
    77  v2: 512
    78  v1: 256
    79  v0: 256
    80  ```