Details
-
Enhancement
-
Resolution: Unresolved
-
Major
-
None
-
10.0.0.CR3
-
None
Description
An XML cache configuration like this:
<infinispan> <cache-container> <distributed-cache name="example" mode="SYNC"> <backups> <backup site="SiteA" strategy="ASYNC" timeout="30000"/> </backups> </distributed-cache> </cache-container> </infinispan>
Can be created with curl with:
curl -v -u ... -d '<infinispan><cache-container><distributed-cache name="example" mode="SYNC"><backups><backup site="SiteA" strategy="ASYNC" timeout="30000"/></backups></distributed-cache></cache-container></infinispan>' -H "Content-Type: application/xml" -X POST .../rest/v2/caches/example2
Retrieving it as JSON returns:
@g ~ $ curl -u ... -H "Content-Type: application/json" .../rest/v2/caches/example2?action=config | jq { "distributed-cache": { "mode": "SYNC", "backups": { "backup": { "site": "SiteA", "strategy": "ASYNC", "timeout": 30000 } }, "transaction": { "mode": "NONE" } } }
That JSON is correct. Backups should be an array.
An FAQ should be added so that users know how to transform XML configuration to JSON. JSON is way less verbose, so might be preferable for curl commands.