Skip to content

Commit ecc3621

Browse files
Merge pull request #293958 from robertstarling/nexus-bmm-run-read-samples
Update BMM run-read-command examples to conform to Azure CLI Shorthand
2 parents 90b708b + 313916e commit ecc3621

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

articles/operator-nexus/howto-baremetal-run-read.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ The run-read command lets you run a command on the BMM that doesn't change anyth
6161
than one word, or need an argument to work. These commands are made like this to separate them from the ones
6262
that can change things. For example, run-read-command can use `kubectl get` but not `kubectl apply`. When you
6363
use these commands, you have to put all the words in the "command" field. For example,
64-
`{"command":"kubectl get","arguments":["nodes"]}` is right; `{"command":"kubectl","arguments":["get","nodes"]}`
64+
`{command:'kubectl get',arguments:[nodes]}` is right; `{command:kubectl,arguments:[get,nodes]}`
6565
is wrong.
6666

6767
Also note that some commands begin with `nc-toolbox nc-toolbox-runread` and must be entered as shown.
@@ -241,19 +241,26 @@ This list shows the commands you can use. Commands in `*italics*` can't have `ar
241241
- `nc-toolbox nc-toolbox-runread mstfwmanager` (requires `query` arg)
242242
- `nc-toolbox nc-toolbox-runread mlx_temp`
243243

244-
The command syntax is:
244+
The command syntax for a single command with no arguments is as follows, using `hostname` as an example:
245245

246246
```azurecli
247247
az networkcloud baremetalmachine run-read-command --name "<machine-name>"
248248
--limit-time-seconds "<timeout>" \
249-
--commands '[{"command":"<command1>"},{"command":"<command2>","arguments":["<arg1>","<arg2>"]}]' \
249+
--commands "[{command:hostname}]" \
250250
--resource-group "<cluster_MRG>" \
251251
--subscription "<subscription>"
252252
```
253253

254-
Multiple commands can be provided in json format to `--commands` option.
254+
- The `--commands` parameter always takes a list of commands, even if there's only one command.
255+
- Multiple commands can be provided in json format using [Azure CLI Shorthand](https://aka.ms/cli-shorthand) notation.
256+
- Any whitespace must be enclosed in single quotes.
257+
- Any arguments for each command must also be provided as a list, as shown in the following examples.
255258

256-
For a command with multiple arguments, provide as a list to `arguments` parameter. See [Azure CLI Shorthand](https://github.com/Azure/azure-cli/blob/dev/doc/shorthand_syntax.md) for instructions on constructing the `--commands` structure.
259+
```
260+
--commands "[{command:hostname},{command:'nc-toolbox nc-toolbox-runread racadm ifconfig'}]"
261+
--commands "[{command:hostname},{command:'nc-toolbox nc-toolbox-runread racadm getsysinfo',arguments:[-c]}]"
262+
--commands "[{command:ping,arguments:[198.51.102.1,-c,3]}]"
263+
```
257264

258265
These commands can be long running so the recommendation is to set `--limit-time-seconds` to at least 600 seconds (10 minutes). Running multiple commands might take longer than 10 minutes.
259266

@@ -279,7 +286,7 @@ az networkcloud baremetalmachine run-read-command --name "<bareMetalMachineName>
279286
```azurecli
280287
az networkcloud baremetalmachine run-read-command --name "<bareMetalMachineName>" \
281288
--limit-time-seconds 60 \
282-
--commands '[{"command":"hostname"},{"command":"ping","arguments":["198.51.102.1","-c","3"]}]' \
289+
--commands "[{command:hostname},{command:ping,arguments:[198.51.102.1,-c,3]}]" \
283290
--resource-group "<cluster_MRG>" \
284291
--subscription "<subscription>"
285292
```
@@ -289,7 +296,7 @@ az networkcloud baremetalmachine run-read-command --name "<bareMetalMachineName>
289296
```azurecli
290297
az networkcloud baremetalmachine run-read-command --name "<bareMetalMachineName>" \
291298
--limit-time-seconds 60 \
292-
--commands '[{"command":"nc-toolbox nc-toolbox-runread racadm getsysinfo","arguments":["-c"]}]' \
299+
--commands "[{command:'nc-toolbox nc-toolbox-runread racadm getsysinfo',arguments:[-c]}]" \
293300
--resource-group "<cluster_MRG>" \
294301
--subscription "<subscription>"
295302
```

0 commit comments

Comments
 (0)