This section contains a few tips to help you use the N1 System Manager command line interface.
Here is the general syntax for a N1 System Manager command:
command object [object-value] [object [object-value]]* [attribute[=][attribute-value]]* [keyword]* |
command – The action taken on the objects.
object – A system-defined object that is fundamental to the operation being performed. The target of the operation is usually the first object in the command's syntax.
object-value – A value for the object, which is usually user-defined. Values containing spaces must be enclosed within quotes.
attribute – A system–defined and optional object that affects the way the operation is performed.
attribute–value – A user-defined value for the attribute. Values containing spaces must be enclosed within quotes.
keyword – A system-defined attribute without a value.
For simplification purposes, the attribute term is usually used to describe both objects and keywords.
As a general rule, the command line interface allows the following character syntax for user-defined names, such as OS profile or role names: [A-Za-z][A-Za-z0-9._\-]*.
The id keyword is an optional keyword that can be used on the N1 System Manager command line before some attribute values, typically for the server attribute value. The purpose of this keyword is to provide an attribute value that may be the same name as a reserved keyword (for example, a server named all).
The equal sign (=) can be optionally used between attributes and attribute values on the N1 System Manager command line. For example, the following commands are equivalent:
N1-ok> set role MyRole description myDescription N1-ok> set role MyRole description=myDescription |
The equal sign variant is not shown in the command line help.
When creating a customized n1sh script, you can specify the comment character (#) at the beginning of the line to indicate that the rest of the line should be ignored. See To Run a Script of N1 System Manager Commands for details.
Where allowed, multiple attribute values can be specified as a comma–separated list on the N1 System Manager command line. For example:
N1-ok> set server serverA,serverB,serverC locator on |
In the command line help, multiple attribute values are shown using the following syntax notation: set server <server>[,<server>...]
Single and double quotation marks are supported on the N1 System Manager command line. If needed, either type of quotation mark can be escaped using the backslash character. For example:
N1-ok> set role myRole description "Some Role that I've made up" N1-ok> set role myRole description='Some Role that I\'ve made up' |
Depending on the shell you are using to run n1sh in UNIX command mode, some special characters may need to be escaped. For example, in the bash shell, quotes need to be escaped with the backslash character, like this:
$ n1sh set role MyRole description=\"Some Role that \\\"Paul\\\" made up\" |
See your specific shell's documentation for detailed information on escaping special characters.
In the n1sh shell mode, you do not have to escape special characters, so the same command described above would look like this:
N1-ok> set role MyRole description="Some Role that \"Paul\" made up" |
You can enter a question mark (?) for any password attribute value if you do not want the password to display in the command line. Once you enter the command, you are prompted for the password. Examples include the rootpassword and agentssh attributes.