API Requirements

We need to expose APIs for configuring, commanding and monitoring replication agents.

Configuration API

Command API

Monitoring API

API endpoints 

Configuration API

Command API

Monitoring API

API Implementation 

Custom servlets vs Standard servlets

There are two main to implement the APIs: use custom servlets or use standard servlets. 

 

Conclusion:

Flatten vs granular 

The commands and monitoring APIs can be implemented using either a flat or a granular approach (or both)

 

 Conclusion: Granular design is desirable if we can get some agreement on how to represent the dynamic hierarchy.


Sample payloads

Replicate to multiple agents

POST /system/replication/all/replicate
Request
{
"action" :  "add",
"paths" : [ "/content/tree1", "/content/tree2" ],
"agents" : [ "publish1", "publish2" ]
}
Response
{
"statusList" : [ { "agent" : "publish1", "status" : "queued" },
{ "agent" : "publish2", "status" : "error" } ]
"id" : "ds54eaw543rft4"
}


 

Import to multiple agents

 

POST /system/replication/all/import
Request
{
"action" :  "import",
"paths" : [ "/content/tree1", "/content/tree2" ],
"agents" : [ "publish1", "publish2" ],
"package": "packagestream"
}
-----------------------------separator
Content-Disposition: form-data; name="packagestream"; filename="vltpackage.zip"
Content-Type: application/octetstream


(binary data)
-----------------------------separator


Response
{
"statusList" : [ { "agent" : "publish1", "status" : "queued" },
{ "agent" : "publish2", "status" : "error" } ],
"id": "dfqw43t3g"
}