github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/website/content/docs/commands/recommendation/apply.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: 'Commands: recommendation apply'
     4  description: |
     5    The recommendation apply command is used to apply recommendations.
     6  ---
     7  
     8  # Command: recommendation apply
     9  
    10  The `recommendation apply` command is used to apply recommendations.
    11  
    12  ~> Recommendation commands are new in Nomad 1.0 and are only available with
    13  Nomad Enterprise.
    14  
    15  ## Usage
    16  
    17  ```plaintext
    18  nomad recommendation apply [options] <recommendation_ids>
    19  ```
    20  
    21  The `recommendation apply` command requires at least one recommendation ID to
    22  be passed to it. Multiple IDs can be passed, with each recommendation ID
    23  separated from the next by a space.
    24  
    25  When ACLs are enabled, this command requires a token with the `submit-job`,
    26  `read-job`, and `submit-recommendation` capabilities for the recommendation's
    27  namespace.
    28  
    29  ## General Options
    30  
    31  @include 'general_options.mdx'
    32  
    33  ## Apply Options
    34  
    35  - `-detach`: Return immediately instead of entering monitor mode. After applying
    36    a recommendation, the evaluation ID will be printed to the screen, which can
    37    be used to examine the evaluation using the [`eval status`][/docs/commands/eval-status] command. If applying
    38    recommendations for multiple jobs, this value will always be true.
    39  
    40  - `-policy-override`: If set, any soft mandatory Sentinel policies will be
    41    overridden. This allows a recommendation to be applied when it would be denied
    42    by a policy.
    43  
    44  - `-verbose`: Display full information.
    45  
    46  ## Examples
    47  
    48  Apply a single recommendation and enter monitor mode:
    49  
    50  ```shell-session
    51  $ nomad recommendation apply a9c041c5-3c04-aa24-bd55-0a80cded4f10
    52  ==> Monitoring evaluation "529cc88e"
    53      Evaluation triggered by job "job1"
    54      Evaluation within deployment: "28a3378f"
    55      Allocation "2a4df8ca" created: node "2f0a2f93", group "group1"
    56      Evaluation status changed: "pending" -> "complete"
    57  ==> Evaluation "529cc88e" finished with status "complete"
    58  ```
    59  
    60  Apply multiple recommendations for different jobs:
    61  
    62  ```shell-session
    63  $ nomad recommendation apply a9c041c5-3c04-aa24-bd55-0a80cded4f10 811900b6-da11-ef08-f515-f5e6684007a8
    64  Errors
    65  None
    66  
    67  Results
    68  IDs                                   Namespace  Job ID   Eval ID                               Warnings
    69  a9c041c5-3c04-aa24-bd55-0a80cded4f10  default    example  7c39ad13-0246-ab8e-6c50-9f3ee500bf5f  <none>
    70  811900b6-da11-ef08-f515-f5e6684007a8  default    demoapp  68236421-c90f-efa6-fc02-37ae2d59bf03  <none>
    71  ```