Connector Status

Returns connector status information.

Connectors allow you to retrieve information from external systems and update it through Haven OnDemand APIs. You can use them to create an index of the data in the external repository, automate workflows, for notifications, or to facilitate migration to other locations.

The Connector Status API allows you to check the status of the last run of your connector (either for a scheduled run, or a run that you started manually with the Start Connector API).

You can optionally add the schedule_information parameter to return the time of the next scheduled run for any created connector with a configured schedule.

Quick Start

This API is available only for cloud connector flavors, such as the Web Cloud Connector. The only required input parameter is the name of the connector.

/1/api/[async|sync]/connectorstatus/v1?connector=myconnector

Additionally, you can opt to include information about the schedule for the connector.

{
  "connector": "mycloudconnector",
  "status": "PROCESSING",
  "queued_time": "08/07/2016 13:12:09 +00:00",
  "time_in_queue": 4,
  "process_start_time": "08/07/2016 13:12:13 +00:00",
  "time_processing": 4557,
  "document_counts": {},
  "start_time": "08/07/2016 13:12:09 +00:00",
  "token": "MTAuOC4xNi45OjcyMDA6RkVUQ0g6MTQ2Nzk4MzUyOTYwMS0yMDMwMTcwMjY2",
  "destination_index_name": null,
  "destination_index_status": null,
  "schedule": {
    "occurrences_remaining": -1,
    "next_run_time": "08/07/2016 17:22:23 +00:00",
    "last_run_time": null
  },
  "flavor": "web_cloud"
}

The Connector Status API returns the status of the connector at the moment you run it. This status can be IDLE, QUEUED. PROCESSING, FINISHED, ERROR, STOPPING, or STOPPED. The response also includes additional information, such as the number of documents added, the start time, or how long the job has been running (in seconds).

The token property in the response is a unique identifier for the specific connector run started when you last sent a request, or by the schedule, if you have configured one.

In contrast, the similar API returns a list of all the actions of the connector since its creation.

Getting the Status for Onsite Connectors

To get the equivalent status or history for an onsite flavor connector, run the following command in a browser on the machine where the onsite connector is running. The action port, called the aciPort, is the one you set when you create the connector configuration (8000 by default; see File System Onsite Connector):

localhost:aciPort/action=QueueInfo&QueueAction=GetStatus&QueueName=Fetch

The above command returns, in XML format, the status of all previous connector runs, with the most recent status returned first.

Synchronous
https://api.havenondemand.com/1/api/sync/connectorstatus/v1
Asynchronous
https://api.havenondemand.com/1/api/async/connectorstatus/v1
Authentication

This API requires an authentication token to be supplied in the following parameter:

Parameter Description
apikey The API key to use to authenticate the API request.
Parameters

This API accepts the following parameters:

Required
Name Type Description
connector
resource The name of the connector. Maximum length of 100 characters.
Optional
Name Type Description
schedule_information
boolean Set to true to return information about the schedule for the connector. Default value: false.

This API returns a JSON response that is described by the model below. This single model is presented both as an easy to read abstract definition and as the formal JSON schema.

Asynchronous Use

Additional requests are required to get the result if this API is invoked asynchronously.

You can use /1/job/status/<job-id> to get the status of the job, including results if the job is finished.

You can also use /1/job/result/<job-id>, which waits until the job has finished and then returns the result.

Model
This is an abstract definition of the response that describes each of the properties that might be returned.
Connector Status Response {
connector ( string ) The name of the connector.
flavor ( string ) The flavor of the connector.
status ( string ) The current state of the connector job.
document_counts ( Document_counts , optional) Information about the documents processed during the connector job.
error ( string , optional) Error message for this connector job.
failed ( string , optional) The failed reason for this connector job.
process_end_time ( string , optional) The time when the connector job finished processing. Format: DD/MM/YYYY HH:mm:ss Z.
process_start_time ( string , optional) The time when the connector job started being processed. Format: DD/MM/YYYY HH:mm:ss Z.
start_time ( string , optional) The last time when the connector job has been updated or processed. Format: DD/MM/YYYY HH:mm:ss Z.
queued_time ( string , optional) The time when the connector job has been put on the queue. Format: DD/MM/YYYY HH:mm:ss Z.
time_in_queue ( number , optional) The number of seconds the connector job spent in the queue.
time_processing ( number , optional) The number of seconds spent processing the connector job.
token ( string , optional) Start connector token.
schedule ( Schedule , optional) Schedule information for this connector.
}
Connector Status Response:Document_counts {
added ( number , optional) The number of added documents.
deleted ( number , optional) The number of deleted documents.
errors ( number , optional) The number of documents errors.
ingest_added ( number , optional) The number of ingest-added documents.
ingest_deleted ( number , optional) The number of ingest-deleted documents.
ingest_failed ( number , optional) The number of ingest-failed documents.
}
Connector Status Response:Schedule {
last_run_time ( , optional) The last time the connector was scheduled to run. Format: DD/MM/YYYY HH:mm:ss Z.
next_run_time ( , optional) The next time the connector is scheduled to run. Format: DD/MM/YYYY HH:mm:ss Z.
occurrences_remaining ( number , optional) The number occurrences remaining for your connector schedule. If occurrences is unlimited, this value is -1.
}
Model Schema
This is a JSON schema that describes the syntax of the response. See json-schema.org for a complete reference.
{
    "properties": {
        "connector": {
            "type": "string"
        },
        "flavor": {
            "type": "string"
        },
        "status": {
            "type": "string"
        },
        "document_counts": {
            "properties": {
                "added": {
                    "type": "number"
                },
                "deleted": {
                    "type": "number"
                },
                "errors": {
                    "type": "number"
                },
                "ingest_added": {
                    "type": "number"
                },
                "ingest_deleted": {
                    "type": "number"
                },
                "ingest_failed": {
                    "type": "number"
                }
            },
            "type": "object"
        },
        "error": {
            "type": "string"
        },
        "failed": {
            "type": "string"
        },
        "process_end_time": {
            "type": "string"
        },
        "process_start_time": {
            "type": "string"
        },
        "start_time": {
            "type": "string"
        },
        "queued_time": {
            "type": "string"
        },
        "time_in_queue": {
            "type": "number"
        },
        "time_processing": {
            "type": "number"
        },
        "token": {
            "type": "string"
        },
        "schedule": {
            "properties": {
                "last_run_time": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "next_run_time": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "occurrences_remaining": {
                    "type": "number"
                }
            },
            "type": "object"
        }
    },
    "required": [
        "connector",
        "flavor",
        "status"
    ],
    "type": "object"
}


If you would like to provide us with more information then please use the box below:

We will use your submission to help improve our product.