D-Link DSN-540 CLI User's Guide for DSN-1100-10 - Page 31

Editing Command Lines, Concatenating Commands, Referencing Root Items

Page 31 highlights

3.1.5 Editing Command Lines The CLI allows you to view all previously entered commands by pressing the up-arrow key on your keyboard. Once you have examined a previously entered command, you can move forward in the list by pressing the down-arrow key on your keyboard. If you view a command you want to reuse, you can edit it or press the Enter key to execute it. 3.1.6 Concatenating Commands The CLI is ideally suited to handling large batches of tasks by allowing you to chain (or concatenate) commands on a command line using a dot (period). The following command lines provide examples of concatenating commands on a single command line. Example 1: This command line lists all volumes whose names begin with mynewvol. The square bracket selects a volume that starts with [mynewvol]. Show volumeList.Volumes[mynewvol] Example 2: This command line lists all volumes. Show volumeList.Volumes Example 3: This command line grants all iSCSI initiators with access to the volume named mynewvol. volumeList.Volumes[mynewvol].target.grantInitiatorAccess All Example 4: This command line is similar to the one above. However, in this example, quotation marks are added to the grantInitiatorAccess argument because it consists of more than one word. The grantInitiatorAccess command accepts one argument. In this example, however, the argument consists of two words (All Initiators) separated by a space. Including the quotation marks tells the CLI to treat the items between the quotation marks as a single object instead of as two arguments (in which case, the command line would fail). volumeList.Volumes[mynewvol].target.grantInitiatorAccess "All Initiators" Example 5: This command line deletes the volume mynewvol. volumeList.Volumes[mynewvol].delete 3.1.7 Referencing Root Items There may be times when you are in a subcontext and want to execute commands that are only available at the top (root) context. One way to accomplish this is to use the Pop command to reach the root level and then type the command line. Alternatively, you can issue the command line without having to leave the current subcontext by prefacing the command line with the caret (^) character. Command Line Interface User's Guide 21

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97

Command Line Interface User’s Guide
21
3.1.5
Editing Command Lines
The CLI allows you to view all previously entered commands by pressing the up-arrow key on
your keyboard. Once you have examined a previously entered command, you can move
forward in the list by pressing the down-arrow key on your keyboard.
If you view a command you want to reuse, you can edit it or press the Enter key to execute
it.
3.1.6
Concatenating Commands
The CLI is ideally suited to handling large batches of tasks by allowing you to chain (or
concatenate) commands on a command line using a dot (period). The following command
lines provide examples of concatenating commands on a single command line.
Example 1: This command line lists all volumes whose names begin with mynewvol. The
square bracket selects a volume that starts with
[mynewvol]
.
Show volumeList.Volumes[mynewvol]
Example 2: This command line lists all volumes.
Show volumeList.Volumes
Example 3: This command line grants all iSCSI initiators with access to the volume named
mynewvol.
volumeList.Volumes[mynewvol].target.grantInitiatorAccess All
Example 4: This command line is similar to the one above. However, in this example,
quotation marks are added to the
grantInitiatorAccess
argument because it consists of
more than one word. The
grantInitiatorAccess
command accepts one argument. In this
example, however, the argument consists of two words (
All Initiators
) separated by a space.
Including the quotation marks tells the CLI to treat the items between the quotation marks
as a single object instead of as two arguments (in which case, the command line would fail).
volumeList.Volumes[mynewvol].target.grantInitiatorAccess "All
Initiators"
Example 5: This command line deletes the volume mynewvol.
volumeList.Volumes[mynewvol].delete
3.1.7
Referencing Root Items
There may be times when you are in a subcontext and want to execute commands that are
only available at the top (root) context. One way to accomplish this is to use the
Pop
command to reach the root level and then type the command line. Alternatively, you can
issue the command line without having to leave the current subcontext by prefacing the
command line with the caret (
^
) character.