View a Tugboat Service's History

Returns the activity history of a Tugboat Service, or a set of Services.

Arguments

  • service - Required
    The ID of the service 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.

  • 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', 'services', 'history', args, callback);

Output

single

[
    {
        "_id": "58f7d0a3b6e1d9000158a9db",
        "updatedAt": "2017-04-19T21:03:31.534Z",
        "createdAt": "2017-04-19T21:03:31.534Z",
        "type": "state",
        "data": { "state": "waiting" },
        "service": "58f7d071b6e1d9000158a9da",
        "project": "58f7cb35b6e1d9000158a9af",
        "repo": "58f7ce6db6e1d9000158a9bd",
        "preview": "58f7d06fb6e1d9000158a9d6",
        "id": "58f7d0a3b6e1d9000158a9db"
    },
    {
        "_id": "58f7d0a4b6e1d9000158a9dd",
        "updatedAt": "2017-04-19T21:03:32.376Z",
        "createdAt": "2017-04-19T21:03:32.376Z",
        "type": "state",
        "data": { "state": "starting" },
        "service": "58f7d071b6e1d9000158a9da",
        "project": "58f7cb35b6e1d9000158a9af",
        "repo": "58f7ce6db6e1d9000158a9bd",
        "preview": "58f7d06fb6e1d9000158a9d6",
        "id": "58f7d0a4b6e1d9000158a9dd"
    },
    {
        "_id": "58f7d0bab6e1d9000158a9f0",
        "updatedAt": "2017-04-19T21:03:54.913Z",
        "createdAt": "2017-04-19T21:03:54.913Z",
        "type": "state",
        "data": { "state": "ready" },
        "service": "58f7d071b6e1d9000158a9da",
        "project": "58f7cb35b6e1d9000158a9af",
        "repo": "58f7ce6db6e1d9000158a9bd",
        "preview": "58f7d06fb6e1d9000158a9d6",
        "id": "58f7d0bab6e1d9000158a9f0"
    }
]

array

[
    [
        {
            "_id": "58f7d0a3b6e1d9000158a9db",
            "updatedAt": "2017-04-19T21:03:31.534Z",
            "createdAt": "2017-04-19T21:03:31.534Z",
            "type": "state",
            "data": { "state": "waiting" },
            "service": "58f7d071b6e1d9000158a9da",
            "project": "58f7cb35b6e1d9000158a9af",
            "repo": "58f7ce6db6e1d9000158a9bd",
            "preview": "58f7d06fb6e1d9000158a9d6",
            "id": "58f7d0a3b6e1d9000158a9db"
        },
        {
            "_id": "58f7d0a4b6e1d9000158a9dd",
            "updatedAt": "2017-04-19T21:03:32.376Z",
            "createdAt": "2017-04-19T21:03:32.376Z",
            "type": "state",
            "data": { "state": "starting" },
            "service": "58f7d071b6e1d9000158a9da",
            "project": "58f7cb35b6e1d9000158a9af",
            "repo": "58f7ce6db6e1d9000158a9bd",
            "preview": "58f7d06fb6e1d9000158a9d6",
            "id": "58f7d0a4b6e1d9000158a9dd"
        },
        {
            "_id": "58f7d0bab6e1d9000158a9f0",
            "updatedAt": "2017-04-19T21:03:54.913Z",
            "createdAt": "2017-04-19T21:03:54.913Z",
            "type": "state",
            "data": { "state": "ready" },
            "service": "58f7d071b6e1d9000158a9da",
            "project": "58f7cb35b6e1d9000158a9af",
            "repo": "58f7ce6db6e1d9000158a9bd",
            "preview": "58f7d06fb6e1d9000158a9d6",
            "id": "58f7d0bab6e1d9000158a9f0"
        }
    ],
    [
        {
            "_id": "58f7d10cb6e1d9000158a9fd",
            "updatedAt": "2017-04-19T21:05:16.384Z",
            "createdAt": "2017-04-19T21:05:16.384Z",
            "type": "state",
            "data": { "state": "waiting" },
            "service": "58f7d10bb6e1d9000158a9fc",
            "project": "58f7cb35b6e1d9000158a9af",
            "repo": "58f7ce6db6e1d9000158a9bd",
            "preview": "58f7d109b6e1d9000158a9f8",
            "id": "58f7d10cb6e1d9000158a9fd"
        },
        {
            "_id": "58f7d10db6e1d9000158a9ff",
            "updatedAt": "2017-04-19T21:05:17.066Z",
            "createdAt": "2017-04-19T21:05:17.066Z",
            "type": "state",
            "data": { "state": "starting" },
            "service": "58f7d10bb6e1d9000158a9fc",
            "project": "58f7cb35b6e1d9000158a9af",
            "repo": "58f7ce6db6e1d9000158a9bd",
            "preview": "58f7d109b6e1d9000158a9f8",
            "id": "58f7d10db6e1d9000158a9ff"
        },
        {
            "_id": "58f7d120b6e1d9000158aa12",
            "updatedAt": "2017-04-19T21:05:36.863Z",
            "createdAt": "2017-04-19T21:05:36.863Z",
            "type": "state",
            "data": { "state": "ready" },
            "service": "58f7d10bb6e1d9000158a9fc",
            "project": "58f7cb35b6e1d9000158a9af",
            "repo": "58f7ce6db6e1d9000158a9bd",
            "preview": "58f7d109b6e1d9000158a9f8",
            "id": "58f7d120b6e1d9000158aa12"
        }
    ]
]

Errors

  • 1016: No Services Found
    Returned if the requested services do not exist, or the requestor does not have permission to view the history.

  • 1017: No Service ID Provided
    The required service argument was not included in the request.

results matching ""

    No results matching ""