github.com/ferranbt/nomad@v0.9.3-0.20190607002617-85c449b7667c/website/source/docs/commands/job/revert.html.md.erb (about)

     1  ---
     2  layout: "docs"
     3  page_title: "Commands: job revert"
     4  sidebar_current: "docs-commands-job-revert"
     5  description: >
     6    The revert command is used to revert to a prior version of the job.
     7  ---
     8  
     9  # Command: job revert
    10  
    11  The `job revert` command is used to revert a job to a prior version of the
    12  job. The available versions to revert to can be found using [`job
    13  history`](/docs/commands/job/history.html) command.
    14  
    15  The revert command will use a Vault token with the following preference:
    16  first the `-vault-token` flag, then the `$VAULT_TOKEN` environment variable.
    17  Because the vault token used to [run](/docs/commands/job/run.html) the targeted
    18  job version was not persisted, it must be provided to revert if the targeted
    19  job version includes Vault policies and the Nomad servers were
    20  [configured](/docs/configuration/vault.html#allow_unauthenticated)
    21  to require authentication.
    22  
    23  ## Usage
    24  
    25  ```
    26  nomad job revert [options] <job> <version>
    27  ```
    28  
    29  The `job revert` command requires two inputs, the job ID and the version of that job
    30  to revert to.
    31  
    32  ## General Options
    33  
    34  <%= partial "docs/commands/_general_options" %>
    35  
    36  ## Revert Options
    37  
    38  * `-detach`: Return immediately instead of monitoring. A new evaluation ID
    39    will be output, which can be used to examine the evaluation using the
    40    [eval status](/docs/commands/eval-status.html) command
    41  
    42  * `-vault-token`: If set, the passed Vault token is sent along with the revert request
    43    to the Nomad servers. This overrides the token found in the $VAULT_TOKEN environment
    44    variable.
    45  
    46  * `-verbose`: Show full information.
    47  
    48  ## Examples
    49  
    50  Revert to an older version of a job:
    51  
    52  ```
    53  $ nomad job history -p example
    54  Version     = 1
    55  Stable      = false
    56  Submit Date = 07/25/17 21:27:30 UTC
    57  Diff        =
    58  +/- Job: "example"
    59  +/- Task Group: "cache"
    60    +/- Task: "redis"
    61      +/- Config {
    62        +/- image:           "redis:3.2" => "redis:4.0"
    63            port_map[0][db]: "6379"
    64          }
    65  
    66  Version     = 0
    67  Stable      = false
    68  Submit Date = 07/25/17 21:27:18 UTC
    69  
    70  $ nomad job revert example 0
    71  ==> Monitoring evaluation "faff5c30"
    72      Evaluation triggered by job "example"
    73      Evaluation within deployment: "e17c8592"
    74      Allocation "4ed0ca3b" modified: node "e8a2243d", group "cache"
    75      Evaluation status changed: "pending" -> "complete"
    76  ==> Evaluation "faff5c30" finished with status "complete"
    77  
    78  $ nomad job history -p example
    79  Version     = 2
    80  Stable      = true
    81  Submit Date = 07/25/17 21:27:43 UTC
    82  Diff        =
    83  +/- Job: "example"
    84  +/- Task Group: "cache"
    85    +/- Task: "redis"
    86      +/- Config {
    87        +/- image:           "redis:4.0" => "redis:3.2"
    88            port_map[0][db]: "6379"
    89          }
    90  
    91  Version     = 1
    92  Stable      = false
    93  Submit Date = 07/25/17 21:27:30 UTC
    94  Diff        =
    95  +/- Job: "example"
    96  +/- Task Group: "cache"
    97    +/- Task: "redis"
    98      +/- Config {
    99        +/- image:           "redis:3.2" => "redis:4.0"
   100            port_map[0][db]: "6379"
   101          }
   102  
   103  Version     = 0
   104  Stable      = false
   105  Submit Date = 07/25/17 21:27:18 UTC
   106  ```