Configures a pool. For the parameters needed to create a pool, see the CLI configuration storage command. A dry run request to create a pool can be done that returns the available property names and values. This is done by setting the props query parameter properties to true.
Example Request:
POST /api/storage/v1/pools?props=true HTTP/1.1 Host: zfs-storage.example.com Authorization: Basic abhadbfsMWE= Content-Type: application/json Accept: application/json { "name": "p1", }
Example Response:
HTTP/1.1 200 OK Content-Type: application/json "props": [{ "choices": ["custom" ], "label": "Chassis 0", "name": "0", "type": "ChooseOne" }, { "choices": ["custom"], "label": "Chassis 1", "name": "1", "type": "ChooseOne" }, { "choices": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], "label": "Chassis 1 data", "name": "1-data", "type": "ChooseOne" }, { "choices": ["mirror", "mirror3", "raidz1", "raidz2", "raidz3_max", "stripe"], "label": "Data Profile", "name": "profile", "type": "ChooseOne" }] }
Example Request (to create a pool that uses 8 disks from chassis [1]):
POST /api/storage/v1/pools HTTP/1.1 Host: zfs-storage.example.com Authorization: Basic abhadbfsMWE= Content-Type: application/json Accept: application/json { "name": "p1", "profile": "stripe", "1-data": 8 }
Example Response:
HTTP/1.1 201 Created Content-Type: application/json { "pool": { "asn": "314d252e-c42b-e844-dab1-a3bca680b563", "errors": [], "name": "p1", "owner": "zfs-storage", "peer": "00000000-0000-0000-0000-000000000000", "profile": "stripe", "status": "online", "usage": { "available": 1194000466944.0, "dedupratio": 100, "total": 1194000908288.0, "used": 441344.0 } } }