github.com/KyaXTeam/consul@v1.4.5/website/source/docs/commands/acl/acl-translate-rules.html.md.erb (about)

     1  ---
     2  layout: "docs"
     3  page_title: "Commands: ACL Translate Rules"
     4  sidebar_current: "docs-commands-acl-translate-rules"
     5  ---
     6  
     7  -> **Deprecated:** This command exists only as a convenience to make legacy ACL migration easier.
     8  It will be removed in a future major release when support for the legacy ACL system is removed.
     9  
    10  # Consul ACL Translate Rules
    11  
    12  Command: `consul acl translate-rules`
    13  
    14  This command translates the legacy ACL rule syntax into the new syntax.
    15  
    16  ### Usage
    17  
    18  Usage: `consul acl translate rules [options] TRANSLATE`
    19  
    20  
    21  #### API Options
    22  
    23  <%= partial "docs/commands/http_api_options_client" %>
    24  <%= partial "docs/commands/http_api_options_server" %>
    25  
    26  #### Command Options
    27  
    28  * `TRANSLATE` - The rules to translate. If `-` is used, then
    29     the rules will be read from stdin. If `@` is prefixed to
    30     the value then the value is considered to be a file and
    31     the rules will be read from that file.
    32  
    33  * `-token-secret` - Specifies that what the `TRANSLATE` argument
    34     holds is not a rule set but rather the token secret ID of a
    35     legacy ACL token that holds the rule set.
    36  
    37  * `-token-accessor` - Specifies that what the `TRANSLATE` argument
    38     holds is not a rule set but rather the token accessor ID of a
    39     legacy ACL token that holds the rule set.
    40  
    41  ### Examples
    42  Translate rules within a file:
    43  
    44  ```sh
    45  $ consul acl translate-rules @rules.hcl
    46  ```
    47  
    48  Translate rules from stdin:
    49  
    50  ```sh
    51  $ consul acl translate-rules -
    52  ```
    53  
    54  Translate rules from a string argument:
    55  
    56  ```sh
    57  $ consul acl translate-rules 'key "" { policy = "write"}'
    58  ```
    59  
    60  Translate rules for a legacy ACL token using its SecretID passed from stdin:
    61  
    62  ```sh
    63  $ consul acl translate-rules --token-secret -
    64  ```
    65  
    66  Translate rules for a legacy ACL token using its AccessorID:
    67  
    68  ```sh
    69  $ consul acl translate-rules 429cd746-03d5-4bbb-a83a-18b164171c89
    70  ```