The Get Calendar Event call returns a representative JSON object. Events can be filtered based on the Environment to which the calendar belongs, the Application associated with the event, a date/time range, or a combination of all.


Query:


http://host/dmadminweb/API/calendar?

[env=env_identifier]

[&app=app_identifier]

[&start=starttime]

[&end=endtime]


Where:

Host

Is the hostname and port of the DeployHub Server Server (e.g.: hostname:8080 or for SaaS console.deployhub.com)

Env_Identifier

Is the identifier of an Environment. Either its name, its qualified name (i.e.: with its parent Domain(s) included in dot notation) or its internal ID. Specifying the Environment filters the results to those events associated with the given Environment.

App_Identifier

Is the identifier of an Application. Either its name, its qualified name (i.e.: with its parent Domain(s) included in dot notation) or its internal ID. Specifying the Application filters the results to those events associated with the given Application.

starttime

Is a date/time which – if specified – restricts the result to only include events which start on or after the specified time. If starttime is not provided, the API only returns events that in the future. Specifying a starttime before the current date/time will return historical events

endtime

Is a date/time which – if specified – restricts the result to only include events which start on or before the specified time. If endtime is not provided, the API returns all future events.


Filter Time Format


The time format for start time and end time can be specified as follows:


YYYY:MM:DD

A date (4 digit year, a 2 digit month number and a 2 digit day of month).

YYYY:MM:DD:hh:mm

A date and time (4 digit year, a 2 digit month number, a 2 digit day of month and then the hours and minutes).

nnnnnnnnnn

An integer number representing the number of seconds since midnight, 1st Jan 1970 (Epoch time).



Returned Time Format

Date and Times returned by the API are specified in both YYYY:MM:DD:hh:mm and Epoch formats – your client Application can then processes this data in whichever format it prefers.


Example Result:


{

       "success": true,

       "result": [

               {

                       "allday": false,

                       "Application": {

                               "id": 220,

                               "name": "ITGuys;1"

                       },

                       "created": {

                               "datetime": "2016:03:07:16:11",

                               "timestamp": 1457367105

                       },

                       "creator": {

                               "id": 626,

                               "name": "fisadmin"

                       },

                       "deployid": 0,

                       "desc": "testing",

                       "endtime": {

                               "datetime": "2016:03:09:08:00",

                               "timestamp": 1457510400

                       },

                       "Environment": {

                               "id": 19,

                               "name": "ProdEnv1"

                       },

                       "id": 164,

                       "pending": true,

                       "starttime": {

                               "datetime": "2016:03:09:07:00",

                               "timestamp": 1457506800

                       },

                       "title": "t1",

                       "type": "Reserved"

               }

               Repeats for each Event…

       ]        

}


success

Is true or false depending on the success or failure of the query. If success is false then result is not returned and a text field named “error” is returned instead.

result

Is a JSON array of JSON Objects – each one represents a retrieved event.


For each Event:

allday

Is a Boolean indicating whether the event is an “all day” event.

Application

Is an object representing the Application with which the event is associated. Within the Application:

       Id is the internal Application ID.

Name is the Application name.

created

Is an object representing the time when the event was created. Within the created object:

Datetime is the date/time in YYY:MM:DD:hh:mm format.


Timestamp is the date/time in Epoch Time.

creato

Is an object representing the user who created the event. Within the creator object:

Id is the internal user id.

Name is the name of the user.

deployid

Is the ID of the deployment (if this is a deployment record), 0 otherwise.

desc

Is the Description of the event.

endtime

Is an object representing the time when the event ends. Within the endtime object:

       Datetime is the date/time in YYYY:MM:DD:hh:mm format.


       Timestamp is the date/time in Epoch Time.

environment        

Is an object representing the Environment with which the event is associated. Within the Environment:

Id is the internal Environment ID.


Name is the Environment name.

id

Is the internal event id.

pending

Is a Boolean indicating whether the event is awaiting approval by the Environment owner.

starttime

Is an object representing the time when the event starts. Within the starttime object:

Datetime is the date/time in YYYY:MM:DD:hh:mm format

Timestamp is the date/time in Epoch Time.

title

Is the event title.

type

Is the event type.