CLI Properties

Properties are typed name/value pairs that are associated with a context. Properties for a given context can be ascertained by running the help properties command. Following is an example of retrieving the properties associated with a user's preferences:

hostname:configuration preferences> help properties
Properties that are valid in this context:

locale             => Locality

login_screen       => Initial login screen

session_timeout    => Session timeout

session_annotation => Current session annotation

advanced_analytics => Make available advanced analytics statistics

The properties of a given context can be retrieved with the get command. Following is an example of using the get command to retrieve a user's preferences:

hostname:configuration preferences> get
                       locale = C
                 login_screen = status/dashboard
              session_timeout = 15
           session_annotation = 
           advanced_analytics = false

The get command will return any properties provided to it as arguments. For example, to get the value of the login_screen property:

hostname:configuration preferences> get login_screen
                 login_screen = status/dashboard

The get command will tab complete with the names of the available properties. For example, to see a list of available properties for the iSCSI service:

hostname:> configuration services iscsi get tab
         
<status>            isns_server         radius_secret       target_chap_name
isns_access         radius_access       radius_server       target_chap_secret

The select command, or a command surrounded by double quotes, will select a dynamic node by property. For example, to select key-000 by user:

hostname:configuration services sftp keys> show
Keys:

NAME    MODIFIED            CIPHER   USER    COMMENT
key-000 2022-6-5 19:48:23   RSA      u1      1

hostname:configuration services sftp keys> "user=u1"
hostname:configuration services sftp key-000>

The set command will set a property to a specified value, with the property name and its value separated by an equals sign. For example, to set the login_screen property to be "shares":

hostname:configuration preferences> set login_screen=shares
                 login_screen = shares (uncommitted)

Note that in the case of properties that constitute state on the appliance, setting the property does not change the value, but rather records the set value and indicates that the value of the property is uncommitted.

To force set property values to take effect, they must be explicitly committed, allowing multiple values to be changed as a single, coherent change. To commit any uncommitted property values, use the commit command:

hostname:configuration preferences> get login_screen
                 login_screen = shares (uncommitted)
hostname:configuration preferences> commit
hostname:configuration preferences> get login_screen
                 login_screen = shares

If you attempt to leave a context that contains uncommitted properties, you will be warned that leaving will abandon the set property values, and you will be prompted to confirm that you want to leave. For example:

hostname:configuration preferences> set login_screen=maintenance/hardware
                 login_screen = maintenance/hardware (uncommitted)
hostname:configuration preferences> done
You have uncommitted changes that will be discarded. Are you sure? (Y/N) 

If a property in a context is set from a different context—that is, if the set command has been appended to a command that changes context—the commit is implied, and happens before control is returned to the originating context. For example:

hostname:> configuration preferences set login_screen=analytics/worksheets
                 login_screen = analytics/worksheets
hostname:>

Some properties take a list of values. For these properties, the list elements should be separated by a comma. For example, the NTP servers property may be set to a list of NTP servers:

hostname:configuration services ntp> set servers=0.pool.ntp.org,1.pool.ntp.org
                      servers = 0.pool.ntp.org,1.pool.ntp.org (uncommitted)
hostname:configuration services ntp> commit

If a property value contains a comma, an equals sign, a quote or a space, the entire value must be double quoted. For example, the sharenfs shares property for the default project may be set to read-only, but provide read/write access to host kiowa. For more information, see Shares and Projects.

hostname:> shares select default
hostname:shares default> set sharenfs="ro,rw=kiowa"
                     sharenfs = ro,rw=kiowa (uncommitted)
hostname:shares default> commit

Some properties are immutable; you can get their values, but you cannot set them. Attempts to set an immutable property results in an error. For example, attempting to set the immutable space_available property of the default project. For more information, see Shares and Projects.

hostname:> shares select default
hostname:shares default> get space_available 
              space_available = 1.15T
hostname:shares default> set space_available=100P
error: cannot set immutable property "space_available"

Some other properties are only immutable in certain conditions. For these properties, the set command is not valid. For example, if the user named pmd is a network user, the fullname property will be immutable:

hostname:> configuration users select pmd set fullname="Rembrandt Q. Einstein"
error: cannot set immutable property "fullname"

Related Topics