github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/website/content/docs/commands/sentinel/apply.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: 'Commands: sentinel apply'
     4  sidebar_title: apply
     5  description: >
     6    The sentinel apply command is used to write a new, or update an existing,
     7    Sentinel policy.
     8  ---
     9  
    10  # Command: sentinel apply
    11  
    12  The `sentinel apply` command is used to write a new, or update an existing,
    13  Sentinel policy.
    14  
    15  ~> Sentinel commands are new in Nomad 0.7 and are only available with Nomad
    16  Enterprise.
    17  
    18  ## Usage
    19  
    20  ```plaintext
    21  nomad sentinel apply [options] <Policy Name> <Policy File>
    22  ```
    23  
    24  The `sentinel apply` command requires two arguments, the policy name and the
    25  policy file. The policy file can be read from stdin by specifying "-" as the
    26  file name.
    27  
    28  Sentinel commands are only available when ACLs are enabled. This command
    29  requires a management token.
    30  
    31  ## General Options
    32  
    33  @include 'general_options_no_namespace.mdx'
    34  
    35  ## Apply Options
    36  
    37  - `-description` : Sets a human readable description for the policy
    38  
    39  - `-scope` : (default: submit-job) Sets the scope of the policy and when it
    40    should be enforced.
    41  
    42  - `-level` : (default: advisory) Sets the enforcement level of the policy. Must
    43    be one of advisory, soft-mandatory, hard-mandatory.
    44  
    45  ## Examples
    46  
    47  Write a policy:
    48  
    49  ```shell-session
    50  $ nomad sentinel write -description "My test policy" foo test.sentinel
    51  Successfully wrote "foo" Sentinel policy!
    52  ```