Generate Change Report

This call generate a change report about the attributes of the given CIs.

URL

changeReports/generate/blacklist

changeReports/generate/whitelist

changeReports/generate/all

Method

POST

Headers

Required:

Authorization: Bearer <token>

Note <token> is the token that was returned by the Authentication call.

Example:

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0Njc5ODQ5MTcsImN1c3RvbWVyIjoxLCJ1c2VybmFtZSI6InN5c2FkbWluIn0.Ph8WHtzvpvfuH1j0CtwHqyBhX1uLlfhr0eQQ7m0_gT0

Request type

JSON

Response type

JSON

URL Parameters

Required:

none

Optional:

none

Payload

There are three cases for each of the URLs above:

Case 1: Requesting the following JSON to <host>/rest-api/changeReports/generate/blacklist

{
     "dateFrom": "1454364000000",
     "dateTo" : "1485986400000",
     "viewName": "yourView",
     "attributes": [ "description","name "]
}

generates a report that contains no information about the attributes written in list "attributes".

Case 2: Requesting the following Json to <host>/rest-api/changeReports/generate/whitelist

{
     "dateFrom": "1454364000000",
     "dateTo" : "1485986400000",
     "viewName": "yourView",
     "attributes": [ "description","name "]
}

generates a report that contains information just about the attributes written in list "attributes".

Case 3: Requesting the following JSON to <host>/rest-api/changeReports/generate/all

{
     "dateFrom": "1454364000000",
     "dateTo" : "1485986400000",
     "viewName": "yourView",
}

generates a report that contains information about all attributes.

Note Details about attributes:

dateFrom represents the date from which changes of attributes should be taken into consideration at the generated report.

dateTo represents the limit date to which changes of attributes should be taken into consideration at the generated report.

viewName is a view that has as result some CIs on which report will be based on.

attributes is a list of attributes which should or should not appear in the generated report.

Success response

Code: 200

Content: has two main objects

changes represent all the changes to the found CIs

{
"changes":{
   "<ci-id>":{
       "ciId":"<ci-id>",
       "displayLabel":"<display-label>",
       "className":"class-name>",
       "properties": [
       {   
       "name": "name",
       "value": "value"
       },
       { 
       "name": "name",
       "value": "value"
       }
       ],
       "changes":{
          "<attribute-name>":[
             {
                "attribute":"<attribute-name>",
                "oldValue":"<attribute-old-value>",
                "newValue":"<attribute-new-value>",
                "changer":"<changer>",
                "changeDate":"<date-of-change>"
             },
             {
                "attribute":"<attribute-name>",
                "oldValue":"<attribute-old-value>",
                "newValue":"<attribute-new-value>",
                "changer":"<changer>",
                "changeDate":"<date-of-change>"
             },
             ...
          ],
          "<attribute-name>":[
             {
                "attribute":"<attribute-name>",
                "oldValue":"<attribute-old-value>",
                "newValue":"<attribute-new-value>",
                "changer":"<changer>",
                "changeDate":"<date-of-change>"
             },
             {
                "attribute":"<attribute-name>",
                "oldValue":"<attribute-old-value>",
                "newValue":"<attribute-new-value>",
                "changer":"<changer>",
                "changeDate":"<date-of-change>"
             },
          ...
       ]
     }
  },
  ...
},
}

 

Example:
{ 
   "changes":{ 
	"4278e81d3dd6640a835e419d2865905d":{ 
	   "ciId":"4278e81d3dd6640a835e419d2865905d",
	   "displayLabel":"create222",
	   "className":"node",
	   "properties": [
	      {
	      "name": "Display Label",
	      "value": "USER LABEL"
	      },
	      {
	      "name": "Create Time",
	      "value": "Fri Jan 20 14:13:40 EET 2017"
	      },
	      {
	      "name": "Description",
	      "value": "description"
	      }
	      ],
	   "changes":{ 
	      "name":[ 
	         { 
		    "attribute":"name",
		    "oldValue":"create2",
		    "newValue":"create22",
		    "changer":"User:{UISysadmin###UCMDB},LoggedInUser:{admin###UCMDB}",
		    "changeDate":1484741091500
	         }
	      ]
	   }
	}
    },
}

Error response

none