Hi @Cloudman ,
Thanks for your detail explaination. I have checked with expert in house and it looks like this could be a API limitation/design? Basically the /commands/ for the replication doesn't expose info for the sub-commands in the API.
For example, If you run an HDFS replication you'd see the parent command=id = "969" and for each child command_id = parent. But for restarting a service you'd get a parent and child commands.
# For example replication
http://cm-host:7180/api/v19/commands/969/
{
"id": 969,
"name": "HdfsReplicationCommand",
"startTime": "2019-06-05T22:25:11.248Z",
"endTime": "2019-06-05T22:29:58.629Z",
"active": false,
"success": true,
"resultMessage": "HDFS replication command succeeded.",
"resultDataUrl": "http://cm-host:7180/cmf/command/969/download",
"serviceRef": {
"clusterName": "Cluster 1",
"serviceName": "hdfs"
},
"children": {
"items": [ ] <<<<<===== no child, although the child tasks are visible in UI CM> All Recent Commands or replication history.
},
"canRetry": false
}
# For example restart service
http://cm-host:7180/api/v19/commands/950/
{
"id": 950,
"name": "Restart",
"startTime": "2019-05-30T23:02:18.071Z",
"endTime": "2019-05-30T23:02:43.880Z",
"active": false,
"success": true,
"resultMessage": "Successfully restarted service.",
"serviceRef": {
"serviceName": "mgmt"
},
"children": { <<<<<<<<========== CHILD COMMANDS
"items": [
{
"id": 951, <<<<<<<< CHILD COMMANDS
"name": "Stop",
"startTime": "2019-05-30T23:02:18.072Z",
"endTime": "2019-05-30T23:02:20.310Z",
"active": false,
"success": true,
"resultMessage": "Successfully stopped service.",
"serviceRef": {
"serviceName": "mgmt"
}
},
{
"id": 953, <<<<<<<< CHILD COMMANDS
"name": "Start",
"startTime": "2019-05-30T23:02:20.319Z",
"endTime": "2019-05-30T23:02:43.879Z",
"active": false,
"success": true,
"resultMessage": "Successfully started service.",
"serviceRef": {
"serviceName": "mgmt"
}
}
]
},
"canRetry": false
}
I have opened an internal jira #OPSAPS-51023 to see whether we can enhance this in future releases.
Thanks and hope this helps,
Li