Closes #210

Adds the ability for you to fetch all children of an activity

Example
GET http://localhost:8081/v1/activities/abc123/children/recurse

```
{
    "sCxsLgvm": {
        "id": "sCxsLgvm",
        "displayName": "invoking start[locations] on 1 node",
        "description": "",
        "entityId": "z81e0jl9j4",
        "entityDisplayName": "simple-app",
        "tags": [
            "SUB-TASK",
            {
                "type": 
"org.apache.brooklyn.core.test.entity.LocalManagementContextForTests"
            },
            {
                "wrappingType": "contextEntity",
                "entity": {
                    "type": "org.apache.brooklyn.api.entity.Entity",
                    "id": "z81e0jl9j4"
                }
            }
        ],
        "submitTimeUtc": 1466502440778,
        "startTimeUtc": 1466502440778,
        "endTimeUtc": 1466502441114,
        "currentStatus": "Completed",
        "result": [
            null
        ],
        "isError": false,
        "isCancelled": false,
        "children": [
            {
                "link": "/activities/WfYmdAuS",
                "metadata": {
                    "id": "WfYmdAuS",
                    "taskName": "start",
                    "entityId": "cmfr998e06",
                    "entityDisplayName": "simple-ent"
                }
            }
        ],
        "submittedByTask": {
            "link": "/activities/umIaqimp",
            "metadata": {
                "id": "umIaqimp",
                "taskName": "start",
                "entityId": "z81e0jl9j4",
                "entityDisplayName": "simple-app"
            }
        },
        "detailedStatus": "Completed after 336ms\n\nResult: [null]",
        "streams": {},
        "links": {
            "self": "/activities/sCxsLgvm",
            "children": "/activities/sCxsLgvm/children",
            "entity": "/applications/z81e0jl9j4/entities/z81e0jl9j4"
        }
    },
    "WfYmdAuS": {
        "id": "WfYmdAuS",
        "displayName": "start",
        "description": "Invoking effector start on simple-ent with parameters 
{locations=[LocalhostMachineProvisioningLocation{id=g1zmb43lie, 
name=localhost}]}",
        "entityId": "cmfr998e06",
        "entityDisplayName": "simple-ent",
        "tags": [
            "EFFECTOR",
            "SUB-TASK",
            {
                "wrappingType": "contextEntity",
                "entity": {
                    "type": "org.apache.brooklyn.api.entity.Entity",
                    "id": "cmfr998e06"
                }
            },
            {
                "type": 
"org.apache.brooklyn.core.test.entity.LocalManagementContextForTests"
            },
            {
                "wrappingType": "targetEntity",
                "entity": {
                    "type": "org.apache.brooklyn.api.entity.Entity",
                    "id": "cmfr998e06"
                }
            },
            {
                "entityId": "cmfr998e06",
                "effectorName": "start"
            }
        ],
        "submitTimeUtc": 1466502440778,
        "startTimeUtc": 1466502440778,
        "endTimeUtc": 1466502441114,
        "currentStatus": "Completed",
        "result": null,
        "isError": false,
        "isCancelled": false,
        "children": [
            {
                "link": "/activities/X9MqBujF",
                "metadata": {
                    "id": "X9MqBujF",
                    "taskName": "provisioning (localhost)",
                    "entityId": "cmfr998e06",
                    "entityDisplayName": "simple-ent"
                }
            },
            {
                "link": "/activities/ErGE1oPr",
                "metadata": {
                    "id": "ErGE1oPr",
                    "taskName": "pre-start",
                    "entityId": "cmfr998e06",
                    "entityDisplayName": "simple-ent"
                }
            },
            {
                "link": "/activities/ud8TXRaU",
                "metadata": {
                    "id": "ud8TXRaU",
                    "taskName": "start (processes)",
                    "entityId": "cmfr998e06",
                    "entityDisplayName": "simple-ent"
                }
            },
            {
                "link": "/activities/J1Kkj2xF",
                "metadata": {
                    "id": "J1Kkj2xF",
                    "taskName": "post-start",
                    "entityId": "cmfr998e06",
                    "entityDisplayName": "simple-ent"
                }
            }
        ],
        "submittedByTask": {
            "link": "/activities/sCxsLgvm",
            "metadata": {
                "id": "sCxsLgvm",
                "taskName": "invoking start[locations] on 1 node",
                "entityId": "z81e0jl9j4",
                "entityDisplayName": "simple-app"
            }
        },
        "detailedStatus": "Completed after 336ms\n\nNo return value (null)",
        "streams": {},
        "links": {
            "self": "/activities/WfYmdAuS",
            "children": "/activities/WfYmdAuS/children",
            "entity": "/applications/z81e0jl9j4/entities/cmfr998e06"
        }
    },
    "X9MqBujF": {
        "id": "X9MqBujF",
        "displayName": "provisioning (localhost)",
        "description": "",
        "entityId": "cmfr998e06",
        "entityDisplayName": "simple-ent",
        "tags": [
            "SUB-TASK",
            {
                "wrappingType": "contextEntity",
                "entity": {
                    "type": "org.apache.brooklyn.api.entity.Entity",
                    "id": "cmfr998e06"
                }
            },
            {
                "type": 
"org.apache.brooklyn.core.test.entity.LocalManagementContextForTests"
            }
        ],
        "submitTimeUtc": 1466502440782,
        "startTimeUtc": 1466502440782,
        "endTimeUtc": 1466502440799,
        "currentStatus": "Completed",
        "result": {
            "type": "org.apache.brooklyn.api.location.Location",
            "id": "fe4jz35nvm"
        },
        "isError": false,
        "isCancelled": false,
        "children": [],
        "submittedByTask": {
            "link": "/activities/WfYmdAuS",
            "metadata": {
                "id": "WfYmdAuS",
                "taskName": "start",
                "entityId": "cmfr998e06",
                "entityDisplayName": "simple-ent"
            }
        },
        "detailedStatus": "Completed after 17ms\n\nResult: 
SshMachineLocation[localhost:[email protected]/192.168.4.161:22(id=fe4jz35nvm)]",
        "streams": {},
        "links": {
            "self": "/activities/X9MqBujF",
            "children": "/activities/X9MqBujF/children",
            "entity": "/applications/z81e0jl9j4/entities/cmfr998e06"
        }
    },
########################
# RESPONSE TRUNCATED #
########################
}
```


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/d9cbe117
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/d9cbe117
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/d9cbe117

Branch: refs/heads/master
Commit: d9cbe117d757d1c493abe2527a9ab4bcb188afce
Parents: 4388cbe a3f15ba
Author: Svetoslav Neykov <[email protected]>
Authored: Thu Jun 23 14:10:42 2016 +0300
Committer: Svetoslav Neykov <[email protected]>
Committed: Thu Jun 23 14:10:42 2016 +0300

----------------------------------------------------------------------
 .../apache/brooklyn/rest/api/ActivityApi.java   | 15 ++++++-
 .../rest/resources/ActivityResource.java        | 41 +++++++++++++++-----
 2 files changed, 44 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


Reply via email to