yes I believe we already have a bug already tracking usage of null in this
scenario, in this case the workaround is to set value to 0
ex.
curl --anyauth --user admin:admin -X PUT -H 'Content-type: application/json'
-d'{"modules-database":0}'
http://node1:8002/manage/v2/servers/test1/properties\?group-id\=Default\&format\=json
hth,J
________________________________
From: [email protected]
[[email protected]] on behalf of Florent Georges
[[email protected]]
Sent: 29 June 2017 12:36
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Management API: remove modules db from server,
to use filesystem instead
Hi,
I have an application server, with a modules database configured. Using the
Management API, I'd like to "remove" it, so it will use the filesystem instead
for the modules.
So I send a PUT request with { "modules-database": null } to the server
properties endpoint. But the response is 400 bad Request, because the modules
database I give has no name.
I can't find how to do it in the documentation. Any idea?
To replicate, with HTTPie:
echo '{ "modules-database" : null }' | \
http -v -a admin:admin -A digest PUT \
ml911:8002/manage/v2/servers/dataplay/properties?group-id=Default \
Content-Type:application/json
The request (I removed non-relevant headers for clarity):
PUT /manage/v2/servers/dataplay/properties?group-id=Default HTTP/1.1
Accept: application/json, */*
Content-Type: application/json
{
"modules-database": null
}
The response (I removed non-relevant headers for clarity):
HTTP/1.1 400 Bad Request
Content-type: application/json; charset=UTF-8
{
"errorResponse": {
"message": "XDMP-VALIDATEBADTYPE: (err:XQDY0027) validate strict {
$nsfix } -- Invalid node type: srvprop:modules-database lexical value \"\"
invalid for expected type #xs:NMTOKEN at
/srvprop:http-server-properties/srvprop:modules-database using schema
\"manage-server-properties.xsd\"",
"messageCode": "XDMP-VALIDATEBADTYPE",
"status": "Bad Request",
"statusCode": "400"
}
}
Thank you. Regards,
--
Florent Georges
H2O Consulting
http://h2o.consulting/
_______________________________________________
General mailing list
[email protected]
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general