dhconfig properties

The properties (or property or props) configuration data type of the dhconfig tool works with properties files stored in the system. properties also handles other types of configuration files, such as status-dashboard-defaults.json.

As with other dhconfig configuration data types, the --help argument provides detailed information on the available actions and arguments, as well as usage examples. Use --help whenever you need more information about the available options. For example, if you want information about the import action, you can run:

Which prints the following:

A description of all the subcommand's options and some usage examples follows.

Due to the number of available options and combinations, and the robust in-tool documentation via --help, an exhaustive list of all possible commands is not provided here. Instead, we will elaborate on some of the more complex arguments below, and then give some usage examples. We recommend that you use the --help argument as needed for more information.

Arguments

ArgumentDescription
-r,--rename <arg>When importing from a single file, assign a new name when stored in the system.
-u,--update-on-sameWhen importing a file, update the system even if the file contents are unchanged.
-force,--forceWhen a properties file is imported, dhconfig also validates the file like the validate action. The --force option can be used to import a file that has apparent errors. Use with care because this can cause problems later.

Examples

export

Export all properties files to /tmp:

Export all properties files to /tmp, bypassing configuration service:

Note

Bypassing configuration server: When you use the --etcd option, dhconfig connects directly to the etcd database, skipping the Configuration Server. This should only be done by administrators with the necessary permissions and is typically used for troubleshooting or recovery when the Configuration Server is unavailable.

Print iris-environment.prop:

Export iris-environment.prop to local file:

Export iris-environment.prop and iris-endpoints.prop to /tmp:

import

Note

Unless you use --etcd, import actions require authentication, with sudo, --key, or --user.

Import my_properties.prop as iris-environment.prop:

Import several properties files from /tmp:

Import iris-environment.prop from /tmp:

or:

edit

Note

Unless you use --etcd, edit actions require authentication, with sudo, --key, or --user.

Open a single properties file in an editor. After you save and exit, dhconfig asks whether to import the changed file, then validates it as import does. If validation fails, you can edit again, show the full exception, or abort. The retry-while-ignoring choice does not bypass properties validation; to import a file that has apparent errors, use import --force. See Editing configuration for more information.

Edit iris-environment.prop:

Edit iris-environment.prop with a specific editor:

ArgumentDescription
-f,--file <arg>The properties file to edit. Exactly one file is required; a trailing argument is treated as the file.
-e,--editor <arg>The editor to use. Optional; defaults to the EDITOR environment variable, or vi if it is not set.

list

List all properties files in the system:

validate

Use validate to check a properties file for errors without importing. The validate action cannot be combined with --etcd. This process parses the file to expose syntax errors and checks for common user errors, such as smart quotes and non-breaking spaces that can be inserted via cut-and-paste from formatted sources.

Validate a file without importing it:

delete

Note

Unless you use --etcd, delete actions require authentication, with sudo, --key, or --user.

Delete a properties file: