#The "run" command is not supported from REST

1 messages · Page 1 of 1 (latest)

glad cliff
#

We need to set/enable "flexscale.readahead_blocks" options across all our cluster nodes while deploying. We can do this only via running system node run -node * -command options flexscale.readahead_blocks on command. I am trying to run this command using private-cli API endpoint but its erroring out.

Below is the output.

URI: https://CLUSTER/api/private/cli/system/node/run?node=*
PAYLOAD: {'command': ['options flexscale.readahead_blocks on']}
ERROR: REST API response received in text format: {
  "num_records": 0,
  "error": {
    "message": "The \"run\" command is not supported from REST.",
    "code": "12451842"
  }
}

can someone suggest a workaround/trick to enable flexscale.readahead_blocks option on all nodes?

brittle lynx
#

What version of ONTAP is running on the cluster(s) you are trying to run this API call for?

#

However, yes looking at our API Docs (even 9.12.1 version) it does state that run is not supported.

"There are some commands in the CLI that will not work using REST APIs. This includes most show commands that do not support "show -fields" in the CLI. The REST API also does not support CLI commands that create a new shell (like "run" and "vserver context")."

#

Let's see if anyone from the community has any suggestions though.

silk aspen
#

You could try it without run, there is a native "options" command in CDOT.

`Cluster::> options flexscale.readahead_blocks

Cluster-01
flexscale.readahead_blocks off`

glad cliff
#

DEBUG:narest.ontap:REST API response received in text format: {
"error": {
"message": "API not found",
"code": "3"
}
}

silk aspen
#

"API not found" sounds like you are doing something wrong. I tried it with the ansible module using an ONTAP Simulator and that works.
` na_ontap_rest_cli:
command: options
verb: GET
params:
option-name: flexscale.readahead_blocks
fields: option-value

        "num_records": 1,
        "records": [
            {
                "option_name": "flexscale.readahead_blocks",
                "option_value": "off",
                "vserver": "foo"
            }
        ]`

So URL I think should be: https://CLUSTER/api/private/cli/options