Skip to main content

 

Druva Documentation

Using the Events API

inSync Cloud Editions: File:/tick.png Elite Plus File:/tick.png Elite File:/cross.png Enterprise File:/cross.png Business

Events API is a REST API that can be called using any REST client like Postman, or a Web browser. By default, the Events API response is in JSON format.

Using Events API to export inSync events is a two step procedure:

Step 1: Generate a token to access inSync API 

Step 2: Access  Events API using a Rest client

Pre-requisites

Ensure that the inSync Cloud administrator has enabled the option to export events. For more information, see Configure inSync to export events.

Procedure

Step 1: Generate a token to access Events API

inSync uses HTTP Basic authentication for API requests. inSync Cloud administrator can create the authentication information from the inSync Management Console.

The authentication information consists of the following components:

  • Username: Email ID of the inSync Cloud administrator who creates the authentication token.
  • Password: Authentication token that is generated.

inSync stores the authentication information in the database, that is encrypted with the ekey of your organization. Whenever you request to access the API, you must specify the username and the password.

Procedure

To obtain the authentication information:
  1. Log on to the inSync Management Console as an inSync Cloud administrator.
  2. On the inSync Management Console menu bar, click wheel.png > Settings. The Settings page appears.
  3. Click the inSync APIs tab. The Access token for inSync APIs page appears.
  4. Click Copy Token. The token is copied to your clipboard.
    The Copy Token button is available only when the authentication token is valid. 
  5. If the token has expired, then click Create New Token and run the following steps:
    1. In the Expire on field, specify the expiry date of the authentication token.
    2. Click Done.
  6. Copy the token and retain it for requesting access to the API.

Note: By default, the token is valid for 30 days. The token's expiry date can be anywhere between 1 day to 365 days. You can create a new token even if the existing token is valid, if you feel that the token is compromised.

Step 2: Access Events API using a REST client

inSync uses basic authentication, where an inSync Cloud administrator has to provide username and password to authenticate each Events API request.

Access Events API

Access Events API using a REST Client or run it as a query to get response in JSON, the default format.

Header Request for APIs

Following is a sample query to access the Events API.

requests.get('https://cloud.druva.com/api/events/v1', auth=('<Username>', '<Password>'), cookies = {"progress": "<cookie value>"})

where,

  • <Username> - Email address of the inSync administrator who generated the token or authentication information in Step 1: Obtain authentication information.
  • <Password>- API access token, generated in Step 1: Obtain authentication information.
  • <cookie value> - Progress cookie is received in the previous Events API response. Use progress cookie to get unique set of new inSync events in your subsequent Events API calls.

Note: You receive the progress cookie in an Events API response. While making the first Events API  call only provide your authentication details.

Response Output format

By default, inSync provides Events API response in the JSON format.

Sample API response for an event

"EventID": "",
"Initiator": "cloud.admin@druva.org",
"inSyncDataSourceName": "Admin’s Mac mini",
"ClientVersion": "5.9.5r54841",
"Facility": 6,
"EventType": "Admin Audit Trail",
"ClientOS": "Mac OS X",
"inSyncUserID": 1,
"inSyncDataSourceID": 80,
"EventState": "Admin Event",
"EventDetails": "Device:cloud.admin@druva.org initiated backup for a device Admin’s Mac mini",
"IP": "192.168.0.0",
"ProfileID": 1,
"ProfileName": "Default",
"Timestamp": "09/21/17 13:41 ",
"inSyncUserName": "Ernie",
"Severity": 6

About Events API Response

  • Each inSync Events API response contains a maximum of 500 inSync events.
  • Every Events API response contains a progress cookie. A progress cookie, which is valid for the next 48 hours, is an identifier that contains inSync database reference and identifies the next set of unique events when successive Events API call is made.
  • If there are more than 500 events in the inSync database while returning an Events API response, the response contains nextpage header attribute that contains the next page URL. Use the nextpage header attribute along-with the progress cookie in your subsequent API call to get additional set of inSync events.

Attributes received in the Events API Response

The following table lists the attributes that are fetched when you use the Events API in JSON format.

Attribute Name Description
EventType

The exported inSync event type.

For the list of events, see Supported inSync events.

EventState

The state of the inSync event.

For example, event triggered by administrator. For full list of state of events, see Supported inSync events.

EventID

The identifier to inter-relate multiple associated events.

Example, all events with respect to backup event like Backup initialized, Backup paused, and Backup Success.

Timestamp The date and time when the event was generated.
Initiator

The initiator of the event.

For example, Manual backup triggered by a user named Ernie Carter.

In case of System event, the initiator will always be the name of the system.

EventDetails

Additional details about the event occurred.

Example, if it is a backup event, details such as number of files backed up, number of files missed, time for backup, and so on.

IP

The IP address of the device on which the event occurred.

In case of an admin event, IP address of the device on which the administrator logged on to perform inSync activity is displayed.

ProfileID inSync assigned identifier of the inSync profile to which the user, associated with the occurred event is linked to.
ProfileName The name of the inSync profile to which the user, associated with the occurred event is linked to.
inSyncUserID inSync assigned identifier of the user associated with the event.
inSyncUserName The name of the inSync user associated with the event.
inSyncDataSource ID The inSync assigned identifier of the user device, on which the event occurred.
inSyncDataSourceName The data source name on which the event occurred.
ClientVersion The inSync Client version on the user device.
ClientOS The OS on which the inSync Client is installed.
Facility The facility number as defined in inSync Management Console Events API settings. Default value is 23.
Severity The severity level of the event as defined in inSync.

inSync also sends a response code with every Events API response. To know more, see Events API response codes.

  • Was this article helpful?