Active tasks

Important: All Cloudant documentation has moved to the IBM Bluemix platform. You can find the new content here, and the Active tasks topic in particular here.

Content on this page will no longer be updated (Jan 31st, 2017).

The /_active_tasks endpoint provides a list of the tasks running on the server. For more examples on using this endpoint, see the Managing tasks guide.

Retrieving a list of active tasks

GET /_active_tasks HTTP/1.1
curl https://$ \
var nano = require('nano');
var account = nano('https://$');

  path: '_active_tasks'
}, function (err, body) {
  if (!err) {
    "user": null,
    "updated_on": 1363274088,
    "type": "replication",
    "target": "https://repl:*****",
    "docs_read": 0,
    "doc_write_failures": 0,
    "doc_id": "tsm-admin__to__user-3dglstqg8aq0uunzimv4uiimy",
    "continuous": true,
    "checkpointed_source_seq": "403-g1AAAADfeJzLYWBgYMlgTmGQS0lKzi9KdUhJMjTRyyrNSS3QS87JL01JzCvRy0styQGqY0pkSLL___9_VmIymg5TXDqSHIBkUj1YUxyaJkNcmvJYgCRDA5AC6tuflZhGrPsgGg9ANAJtzMkCAPFSStc",
    "changes_pending": 134,
    "pid": "<0.1781.4101>",
    "node": "",
    "docs_written": 0,
    "missing_revisions_found": 0,
    "replication_id": "d0cdbfee50a80fd43e83a9f62ea650ad+continuous",
    "revisions_checked": 0,
    "source": "https://repl:*****",
    "source_seq": "537-g1AAAADfeJzLYWBgYMlgTmGQS0lKzi9KdUhJMjTUyyrNSS3QS87JL01JzCvRy0styQGqY0pkSLL___9_VmI9mg4jXDqSHIBkUj1WTTityWMBkgwNQAqob39WYhextkE0HoBoBNo4MQsAFuVLVQ",
    "started_on": 1363274083

    "user": "acceptly",
    "updated_on": 1363273779,
    "type": "indexer",
    "node": "",
    "pid": "<0.20723.4070>",
    "changes_done": 189,
    "database": "shards/00000000-3fffffff/acceptly/acceptly_my_chances_logs_live.1321035717",
    "design_document": "_design/MyChancesLogCohortReport",
    "started_on": 1363273094,
    "total_changes": 26389

    "user": "username",
    "updated_on": 1371118433,
    "type": "search_indexer",
    "total_changes": 5466,
    "node": "",
    "pid": "<0.29569.7037>",
    "changes_done": 4611,
    "database": "shards/40000000-7fffffff/username/database_name",
    "design_document": "_design/lucene",
    "index": "search1",
    "started_on": 1371118426

    "view": 1,
    "user": "acceptly",
    "updated_on": 1363273504,
    "type": "view_compaction",
    "total_changes": 26095,
    "node": "",
    "pid": "<0.21218.4070>",
    "changes_done": 20000,
    "database": "shards/80000000-bfffffff/acceptly/acceptly_my_chances_logs_live.1321035717",
    "design_document": "_design/MyChancesLogCohortReport",
    "phase": "view",
    "started_on": 1363273094

    "updated_on": 1363274040,
    "node": "",
    "pid": "<0.29256.4053>",
    "changes_done": 272195,
    "database": "shards/00000000-3fffffff/heroku/app3245179/id_f21a08b7005e_logs.1346083461",
    "started_on": 1363272496,
    "total_changes": 272195,
    "type": "database_compaction"

You can obtain a list of active tasks by using the /_active_tasks URL. The result is a JSON array of the currently running tasks, with each task being described with a single object.

The returned structure includes the following fields for each task:

In the type field, possible values include:

The meaning of other fields in the JSON response depends on the type of the task.

Specific response fields for compaction tasks

In the phase field, the value indicates the stage that compaction has reached:

  1. ids: Document compaction is in progress.
  2. views: View compaction is in progress.

Specific response fields for replication tasks

Specific response fields for indexing tasks