View a Tugboat Preview's History

Returns the activity history of a Tugboat Preview, or a set of Previews.

Arguments

  • preview - Required
    The ID of the preview for which to retrieve the history.

  • type - Optional
    The type of event to return. If not specified, all events are returned. This can be a single value, or an array of types.

  • children - Optional
    If true, the events of the preview's children are also returned. Default: false

  • before - Optional
    Only return events that occurred before this date. A Date object is expected.

  • after - Optional
    Only return events that occurred after this date. A Date object is expected.

  • limit - Optional
    Only return the last N events.

Example

socket.emit('tugboat', 'previews', 'history', args, callback);

Output

single

[
    {
        "_id": "58f7d06fb6e1d9000158a9d7",
        "updatedAt": "2017-04-19T21:02:39.792Z",
        "createdAt": "2017-04-19T21:02:39.792Z",
        "type": "activity",
        "data": { "event": "create", "authkey": "0" },
        "preview": "58f7d06fb6e1d9000158a9d6",
        "project": "58f7cb35b6e1d9000158a9af",
        "repo": "58f7ce6db6e1d9000158a9bd",
        "id": "58f7d06fb6e1d9000158a9d7"
    },
    {
        "_id": "58f7d071b6e1d9000158a9d8",
        "updatedAt": "2017-04-19T21:02:41.184Z",
        "createdAt": "2017-04-19T21:02:41.184Z",
        "type": "state",
        "data": { "state": "building" },
        "preview": "58f7d06fb6e1d9000158a9d6",
        "project": "58f7cb35b6e1d9000158a9af",
        "repo": "58f7ce6db6e1d9000158a9bd",
        "id": "58f7d071b6e1d9000158a9d8"
    },
    {
        "_id": "58f7d0bab6e1d9000158a9e9",
        "updatedAt": "2017-04-19T21:03:54.405Z",
        "createdAt": "2017-04-19T21:03:54.405Z",
        "type": "state",
        "data": { "state": "ready" },
        "preview": "58f7d06fb6e1d9000158a9d6",
        "project": "58f7cb35b6e1d9000158a9af",
        "repo": "58f7ce6db6e1d9000158a9bd",
        "id": "58f7d0bab6e1d9000158a9e9"
    },
    {
        "_id": "58f7d0bab6e1d9000158a9eb",
        "updatedAt": "2017-04-19T21:03:54.461Z",
        "createdAt": "2017-04-19T21:03:54.461Z",
        "type": "activity",
        "data": { "event": "create", "result": "success", "authkey": "0" },
        "preview": "58f7d06fb6e1d9000158a9d6",
        "project": "58f7cb35b6e1d9000158a9af",
        "repo": "58f7ce6db6e1d9000158a9bd",
        "id": "58f7d0bab6e1d9000158a9eb"
    }
]

array

[
    [
        {
            "_id": "58f7d06fb6e1d9000158a9d7",
            "updatedAt": "2017-04-19T21:02:39.792Z",
            "createdAt": "2017-04-19T21:02:39.792Z",
            "type": "activity",
            "data": { "event": "create", "authkey": "0" },
            "preview": "58f7d06fb6e1d9000158a9d6",
            "project": "58f7cb35b6e1d9000158a9af",
            "repo": "58f7ce6db6e1d9000158a9bd",
            "id": "58f7d06fb6e1d9000158a9d7"
        },
        {
            "_id": "58f7d071b6e1d9000158a9d8",
            "updatedAt": "2017-04-19T21:02:41.184Z",
            "createdAt": "2017-04-19T21:02:41.184Z",
            "type": "state",
            "data": { "state": "building" },
            "preview": "58f7d06fb6e1d9000158a9d6",
            "project": "58f7cb35b6e1d9000158a9af",
            "repo": "58f7ce6db6e1d9000158a9bd",
            "id": "58f7d071b6e1d9000158a9d8"
        },
        {
            "_id": "58f7d0bab6e1d9000158a9e9",
            "updatedAt": "2017-04-19T21:03:54.405Z",
            "createdAt": "2017-04-19T21:03:54.405Z",
            "type": "state",
            "data": { "state": "ready" },
            "preview": "58f7d06fb6e1d9000158a9d6",
            "project": "58f7cb35b6e1d9000158a9af",
            "repo": "58f7ce6db6e1d9000158a9bd",
            "id": "58f7d0bab6e1d9000158a9e9"
        },
        {
            "_id": "58f7d0bab6e1d9000158a9eb",
            "updatedAt": "2017-04-19T21:03:54.461Z",
            "createdAt": "2017-04-19T21:03:54.461Z",
            "type": "activity",
            "data": { "event": "create", "result": "success", "authkey": "0" },
            "preview": "58f7d06fb6e1d9000158a9d6",
            "project": "58f7cb35b6e1d9000158a9af",
            "repo": "58f7ce6db6e1d9000158a9bd",
            "id": "58f7d0bab6e1d9000158a9eb"
        }
    ],
    [
        {
            "_id": "58f7d109b6e1d9000158a9f9",
            "updatedAt": "2017-04-19T21:05:13.686Z",
            "createdAt": "2017-04-19T21:05:13.686Z",
            "type": "activity",
            "data": { "event": "create", "authkey": "0" },
            "preview": "58f7d109b6e1d9000158a9f8",
            "project": "58f7cb35b6e1d9000158a9af",
            "repo": "58f7ce6db6e1d9000158a9bd",
            "id": "58f7d109b6e1d9000158a9f9"
        },
        {
            "_id": "58f7d10bb6e1d9000158a9fa",
            "updatedAt": "2017-04-19T21:05:15.055Z",
            "createdAt": "2017-04-19T21:05:15.055Z",
            "type": "state",
            "data": { "state": "building" },
            "preview": "58f7d109b6e1d9000158a9f8",
            "project": "58f7cb35b6e1d9000158a9af",
            "repo": "58f7ce6db6e1d9000158a9bd",
            "id": "58f7d10bb6e1d9000158a9fa"
        },
        {
            "_id": "58f7d120b6e1d9000158aa0b",
            "updatedAt": "2017-04-19T21:05:36.218Z",
            "createdAt": "2017-04-19T21:05:36.218Z",
            "type": "state",
            "data": { "state": "ready" },
            "preview": "58f7d109b6e1d9000158a9f8",
            "project": "58f7cb35b6e1d9000158a9af",
            "repo": "58f7ce6db6e1d9000158a9bd",
            "id": "58f7d120b6e1d9000158aa0b"
        },
        {
            "_id": "58f7d120b6e1d9000158aa0d",
            "updatedAt": "2017-04-19T21:05:36.255Z",
            "createdAt": "2017-04-19T21:05:36.255Z",
            "type": "activity",
            "data": { "event": "create", "result": "success", "authkey": "0" },
            "preview": "58f7d109b6e1d9000158a9f8",
            "project": "58f7cb35b6e1d9000158a9af",
            "repo": "58f7ce6db6e1d9000158a9bd",
            "id": "58f7d120b6e1d9000158aa0d"
        }
    ]
]

Errors

  • 1014: No Previews Found
    Returned if the requested previews do not exist, or the requestor does not have permission to view their history.

  • 1015: No Preview ID Provided
    The required preview argument was not included in the request.

results matching ""

    No results matching ""