Preference¶
-
POST/api/v1/preference/(string: key)¶ Request JSON Object: - value (string) – set the value of key
Response JSON Object: - id (int) – primary key ID
Example request
$ curl -XPOST -sq -b cookies.txt -d '{"value":"I am sphinx"}' \ http://${QIP}:${QPORT}/api/v1/preference/doc_test
Example response
{ "id": 5 }
-
GET/api/v1/preference/¶ Response JSON Object: - key-name (string) – value
Example request
$ curl -sq -b cookies.txt http://${QIP}:${QPORT}/api/v1/preference/
Example response
{ "backup_concurrent": "5", "doc_test": "I am sphinx", "etag_template": "Fri, 15 May 2015 05:41:12 GMT", "etag_xml": "Fri, 15 May 2015 05:41:10 GMT", "log_rotate": "30" }
-
GET/api/v1/preference/(string: key)¶ Response JSON Object: - key-name (string) – value
Example request
$ curl -sq -b cookies.txt http://${QIP}:${QPORT}/api/v1/preference/doc_test
Example response
{ "doc_test": "I am sphinx" }
-
PUT/api/v1/preference/(string: key)¶ Request JSON Object: - value (string) – set the value of key
Response JSON Object: - result (bool) – true when success
Example request
$ curl -XPUT -sq -b cookies.txt -d '{"value":"I am container station"}' \ http://${QIP}:${QPORT}/api/v1/preference/doc_test $ curl -sq -b cookies.txt http://${QIP}:${QPORT}/api/v1/preference/doc_test
Example response
{ "result": true } { "doc_test": "I am container station" }
-
DELETE/api/v1/preference/(string: key)¶ Example request
$ curl -XDELETE -sq -b cookies.txt http://${QIP}:${QPORT}/api/v1/preference/doc_test
Example response
{}
Special preference settings¶
Default image folder¶
-
GET/api/v1/preference/folder¶ Response JSON Object: - folder (string) – Get current image directory path
Example request
$ curl -XGET -sq -b cookies.txt http://${QIP}:${QPORT}/api/v1/preference/folder
-
PUT/api/v1/preference/folder¶ Request JSON Object: - path (string) – New image directory
Example request
$ curl -XPUT -sq -b cookies.txt -d '{"path":"/Public"}' \ http://${QIP}:${QPORT}/api/v1/preference/folder
Network settings¶
-
GET/api/v1/preference/network¶ Response JSON Object: - LXC_DHCP_MAX (string) – DHCP Max
- LXC_NETMASK (string) – Netmask
- LXC_ADDR (string) – IP address
- LXC_DHCP_RANGE (string) – DHCP range
- LXC_NETWORK (string) – Network
- LXC_BRIDGE (string) – Bridge name
Example request
$ curl -XGET -sq -b cookies.txt http://${QIP}:${QPORT}/api/v1/preference/network
-
PUT/api/v1/preference/network¶ Example request
$ curl -XPUT -sq -b cookies.txt -d '{"LXC_NETWORK":"88.8.89.0/24"}' \ http://${QIP}:${QPORT}/api/v1/preference/network