View Source

{excerpt}

The Datasource Status API provides a means to get information about whether a data source is currently being processed.

{toc}

h2. API Entry Points

{{[/api/collections/_collection_/datasources/_id_/status|#api1]}}{{:}} Get this data source's status

{anchor:api1}

h2. Get the Status of a Data Source

!Rest API^bullet.jpg! {{GET /api/collection/}}{{{}{_}collection{_}{}}}{{/datasources/}}{{{}{_}id{_}{}}}{{/status}}

h4. {bgcolor:#FEECC4}{*}Input{*}{bgcolor}

*Path Parameters*

| Key | Description |
| collection | The collection name |
| id | The data source ID |

*Query Parameters*

None

h4. {bgcolor:#FEECC4}{*}Output{*}{bgcolor}

*Output Content*

|| Key || Type || Description ||
| id | 32-bit integer | the ID of the activity |
| running | boolean | indicates {{true}} when the data source is in the process of being indexed |
| status | map | When running==true, this contains the [history instance|LWEUG17:Data Source History] of the current indexing process |

h4. {bgcolor:#FEECC4}{*}Examples{*}{bgcolor}

*Input*

{code:borderStyle=solid|borderColor=#666666}
curl 'http://localhost:8888/api/collections/collection1/datasources/2/status'
{code}

*Output*
While the data source is being processed:

{code:borderStyle=solid|borderColor=#666666}
{
"id" : 2,
"status" : {
"numUnchanged" : 0,
"crawlStarted" : "2010-06-03T15:21:55-0700",
"numRemoved" : 0,
"numNew" : 0,
"numUpdated" : 3
},
"running" : true
}
{code}

After processing is finished, and the data source is idle:

{code:borderStyle=solid|borderColor=#666666}
{
"id" : 2,
"description" : "Not running."
"status" : {},
"running" : false
}
{code}


{excerpt}