Llibyddap
Cadet
- Joined
- Dec 9, 2017
- Messages
- 6
I'm trying to setup some Ansible automation for TrueNAS-SCALE-22.12.0 running in VirtualBox (for testing). So far I've had great success with most of the endpoints needed, but what doesn't seem to work is the api/v2.0/pool endpoint. I'm working on a new install without any modification other than adding a password for the admin user. Skipping all the Ansible coding, and going right to the swagger interface I've made the following POST to the endpoint (not worried about the authentication it is not meant to be secure):
This returns code 200 and a response body of 186. This response code changes with every execution but is always a two or three digit number. However, it does not result in the creation of a new Pool named Tank with four disks.
What I've tired:
- with and without providing a "name" (unsuccessfully)
- exactly replicating the swagger example with all 6 disks (unsuccessfully)
- manually creating my above example/desired structure using the GUI (successfully)
Because I'm able to do everything I'd like via the UI, it doesn't appear to be a VirtualBox issue.
Any thoughts?
Code:
curl -X 'POST' \ 'http://192.168.58.102/api/v2.0/pool' \ -H 'accept: */*' \ -H 'Authorization: Basic YWRtaW46MSRQYXNzd29yZA==' \ -H 'Content-Type: application/json' \ -d '{ "data": [ { "disks": ["sdb", "sdc", "sdd", "sde"], "name": "Tank", "type": "RAIDZ1" } ] }'
This returns code 200 and a response body of 186. This response code changes with every execution but is always a two or three digit number. However, it does not result in the creation of a new Pool named Tank with four disks.
What I've tired:
- with and without providing a "name" (unsuccessfully)
- exactly replicating the swagger example with all 6 disks (unsuccessfully)
- manually creating my above example/desired structure using the GUI (successfully)
Because I'm able to do everything I'd like via the UI, it doesn't appear to be a VirtualBox issue.
Any thoughts?