xref: /spdk/examples/blob/cli/README.md (revision 94a84ae98590bea46939eb1dcd7a9876bd393b54)
1The blobcli tool has several options that are listed by using the -h command
2however the three operating modes are covered in more detail here:
3
4Command Mode
5------------
6
7This is the default and will just execute one command at a time. It's simple
8but the downside is that if you are going to interact quite a bit with the
9blobstore, the startup time for the application can be cumbersome.
10
11Shell Mode
12----------
13
14You startup shell mode by using the -S command. At that point you will get
15a "blob>" prompt where you can enter any of the commands, including -h,
16to execute them. You can stil enter just one at a time but the initial
17startup time for the application will not get in the way between commands
18anymore so it is much more usable.
19
20Script (aka test) Mode
21----------------------
22
23In script mode you just supply one command with a filename when you start
24the cli, for example `blobcli -T test.bs` will feed the tool the file
25called test.bs which contains a series of commands that will all run
26automatically and, like shell mode, will only initialize one time so is
27quick.
28
29The script file format (example) is shown below.  Comments are allowed and
30each line should contain one valid command (and its parameters) only. In
31order to operate on blobs via their ID value, use the token $Bn where n
32represents the instance of the blob created in the script.
33
34For example, the line `-s $B0` will operate on the blobid of the first
35blob created in the script (0 index based). `$B2` represents the third
36blob created in the script.
37
38If you start test mode with the additional "ignore" option, any invalid
39script lines will simply be skipped, otherwise the tool will exit if
40it runs into an invalid line (ie './blobcli -T test.bs ignore`).
41
42Sample test/bs file:
43
44~~~{.sh}
45# this is a comment
46-i
47-s bs
48-l bdevs
49-n 1
50-s bs
51-s $B0
52-n 2
53-s $B1
54-m $B0 Makefile
55-d $B0 M.blob
56-f $B1 65
57-d $B1 65.blob
58-s bs
59-x $B0 b0key boval
60-x $B1 b1key b1val
61-r $B0 b0key
62-s $B0
63-s $B1
64-s bs
65~~~
66