Hi all,
I'm trying to trigger scrubbing of a pool using the REST API of TrueNAS SCALE. Specifically (running TrueNAS-SCALE-22.12.2). Specifically, I'm trying to get the poolIdIdScrubPost endpoint to work properly.
If I understand the documentation correctly, the pool's ID is specified in the URL and the request body has to contain an
Using the poolGet endpoint I determined my pool ID to be 1.
So I tried this:
And this is the reply I got (with code 200)
With each try, the number that is returned increases by one, but scrubbing does not start.
While playing around with the endpoint I decided I wanted to see it fail, so I supplied a pool ID that does not exist. The request succeeded, simply returning the next number.
This is what I have tried:
Has anyone ever tried this? Am I missing something or is this behavior something that should be reported?
Thanks!
Best Regards,
blindfish
I'm trying to trigger scrubbing of a pool using the REST API of TrueNAS SCALE. Specifically (running TrueNAS-SCALE-22.12.2). Specifically, I'm trying to get the poolIdIdScrubPost endpoint to work properly.
If I understand the documentation correctly, the pool's ID is specified in the URL and the request body has to contain an
action
parameter with a value of either START
, STOP
or PAUSE
.Using the poolGet endpoint I determined my pool ID to be 1.
So I tried this:
Code:
curl --location --request POST 'http://truenas/api/v2.0/pool/id/1/scrub' \ --header 'Authorization: Bearer xxxxxx' \ --header 'Content-Type: application/json' \ --data-raw '{ "action": "START" }'
And this is the reply I got (with code 200)
Code:
186
With each try, the number that is returned increases by one, but scrubbing does not start.
While playing around with the endpoint I decided I wanted to see it fail, so I supplied a pool ID that does not exist. The request succeeded, simply returning the next number.
This is what I have tried:
- add an "id" parameter to the request body
- tried the other values for "action"
- not specifying a request body at all
- sending an empty request body
- tried nonsense values for "action" to see it fail - it did not, but returned the next number
- tried nonsense values for pool ID to see it fail - it did not, but returned the next number
- added undocumented foobar parameters to the body to see it fail (other endpoints complain about unknown parameters) - it did not, but returned the next number
Has anyone ever tried this? Am I missing something or is this behavior something that should be reported?
Thanks!
Best Regards,
blindfish