/
Linking or De-Linking CIs and Retrieving CI Relationship Using APIs

Linking or De-Linking CIs and Retrieving CI Relationship Using APIs

Read Complete Release Notes

Feature released in SummitAI Service Management (Denali SP1, CMDB)

What's New?

The following new APIs are added for the CMDB module:

Authentication

To authenticate the APIs, use the Form or API login details. Create a User with the required Role Template access, use these details to authenticate, and execute the APIs. For more information, see Adding Users.

Common Parameters

 For API Key Based Authentication

Common Parameters

Parameter Name

Type

Description

Notes

APIKey

STRING

APIKey that is generated is described in API Authentication and Authorization section.
AuthType

STRING

Type of Authentication.Value should be APIKey.
OrgID

INTEGER

Unique Identification of the Organization.
ProxyID

INTEGER

Unique Identification number of the proxy.
ReturnType

STRING

Type of the request return.Example: Json, XML, YAML, etc.
TokenID

STRING

Number of the token whose details should come in Response.
 For Username and Password Based Authentication

Common Parameters

Parameter Name

Type

Description

Notes

UserName

STRING

Login name of the User.
Password

STRING

Login password of the User.
ProxyID

INTEGER

Unique Identification number of the proxy.
ReturnType

STRING

Type of the request return.Example: Json, XML, YAML, etc.
OrgID

INTEGER

Unique Identification of the Organization.
TokenID

STRING

Number of the token whose details must come in Response.


Linking CI Relations

Use this API to link CI Relations.

API Details

Sample Request
{
  "ServiceName": "CMDB_CreateCIRelations",
  "objCommonParameters": {
    "_ProxyDetails": {
      "ProxyID": 0,
      "ReturnType": "JSON",
      "APIKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "AuthType": "APIKEY"
    },
    "_CMDBCIRelations": {
      "SourceKey": "CIID",
      "TargetKey": "CIID",
      "SourceType": "CI",
      "TargetType": "CI",
      "SourceValue": "354",
      "Relationship": "Parent",
      "TargetValues": "340"
    }
  }
}

Request Parameters

Parameter NameTypeDescriptionLinking Type and Parameter Values
CI-CICI-ServiceService-CI

SourceKey * 

STRING

Name of the Source.

The value can be one of the following: 

  • CIID
  • HostName 
  • SerialNo 
  • IP Address

The value can be one of the following: 

  • CIID
  • HostName 
  • SerialNo 
  • IP Address
The value is either Service ID or ServiceName.

TargetKey * 

STRING

Name of the Target.

The value can be one of the following: 

  • CIID
  • HostName 
  • SerialNo 
  • IP Address
The value is either ServiceID or ServiceName.

The value can be one of the following: 

  • CIID
  • HostName 
  • SerialNo 
  • IP Address

SourceType * 

STRING

Type of Source.

The value is CI.

The value is CI.The value is Service.

TargetType * 

STRING

Type of Target.

The value is CI.

The value is Service.The value is CI.

SourceValue * 

STRING

or

INTEGER

Value of the Source.

Note:

If the Sourcekey parameter value is CIID, the SourceValue parameter value must be numeric or else string.


Note:

If the Sourcekey parameter value is ServiceID, the SourceValue parameter value must be numeric or else string.

Relationship * 

STRING

Relationship between the Source and Target.

Note:

The Relationship parameter value must not be Service if the SourceKey and Targetkey parameter values are any of the following: 

  • CIID
  • HostName 
  • SerialNo 
  • IP Address

Note:

The Relationship parameter value must be Service if the SourceKey parameter value is one of the following:

  • CIID
  • HostName 
  • SerialNo 
  • IP Address

TargetValues * 

STRING

or

INTEGER

Value of the Target. You can specify multiple values with a comma separator.

Note:

If the TargetKey parameter value is CIID, the TargetValues parameter value must be numeric or else string.

Note:

If the TargetKey parameter value is ServiceID, the TargetValues parameter value must be numeric or else string.

Note:

If the TargetKey parameter value is CIID, the TargetValues parameter value must be numeric or else string.

* Indicates mandatory fields


Sample Response
{
  "Errors": "",
  "Message": "CMDB CI Relations created successfully!",
  "Output": "",
  "TokenID": null,
  "OrgID": 0,
  "OutputObject": null,
  "OutputID": 0,
  "Input": null
}

De-Linking CI Relations

Use this API to de-link CI Relations.

API Details

Sample Request
{
  "ServiceName": " CMDB_DelinkCIRelations ",
  "objCommonParameters": {
    "_ProxyDetails": {
      "ProxyID": 0,
      "ReturnType": "JSON",
      "APIKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "AuthType": "APIKEY"
    },
    "_CMDBCIRelations": {
      "SourceKey": "CIID",
      "TargetKey": "CIID",
      "SourceType": "CI",
      "TargetType": "CI",
      "SourceValue": "354",
      "Relationship": "Parent",
      "TargetValues": "340"
    }
  }
}

Request Parameters

For more information, see Request Parameters.

Sample Response
{
  "Errors": "",
  "Message": " CMDB Relations De-Linked successfully!",
  "Output": "",
  "TokenID": null,
  "OrgID": 0,
  "OutputObject": null,
  "OutputID": 0,
  "Input": null
}

Retrieving CI Relationship

Use this API to retrieve CI Relations.

API Details

Sample Request
{
  "ServiceName": "CMDB_GetCIRelationship",
  "objCommonParameters": {
    "_ProxyDetails": {
      "ProxyID": 0,
      "ReturnType": "JSON",
      "APIKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "AuthType": "APIKEY"
    },
    "_CMDBDetails": {
      "InstanceName": "CMT",
      "Configuration_Id": "354",
      "Device_Host_Name": "",
      "Serial_No": "",
      "IPAddress": "",
      "CurrentPageIndex": 0,
      "PageSize": 0
    }
  }
}

Request Parameters

Parameter NameTypeDescriptionNotes

InstanceName * 

STRING

Name of the Instance.

Example: Information technology.

Configuration_Id

INTEGER

Unique Identification number of the Configuration Item (CI).


You are required to specify any one of these parameter as mandatory (*).

Device_Host_Name 

STRING

Name of the device Host.

Serial_No 

STRING

Serial number of the CI.

IPAddress

STRING

IP Address of the CI.

CurrentPageIndex 

INTEGER

Current Index of the page that you are looking into.

Example:

If each page contains 10 records and there are 10 pages. Items from 1 to 10 are displayed when you specify the  CurrentPageIndex value as 0.

PageSize 

INTEGER

Number of records that should be displayed per each page.

If you do not specify any value, by default, the page displays 20 records with the CurrentPageIndex value as 0.

Example:

Consider you specified the PageSize value as 100. Based on the CurrentPageIndex, the API Response displays 100 records.

* Indicates mandatory fields

Sample Response
{
  "Errors": "",
  "Message": "5 CI Relationship Record(s) found.",
  "Output": "",
  "TokenID": "1D82B465C5D100A4B5DD92354AA1A4A288F5F57D1C44B61E00B7B1BD1BFDCF5D958500B60CA963F3940CAB8EEA3AB427923DA6C3AB3E2CDA9C5D5800D50317DEB2CA9CED2C8A5D
EBF825D04DBE8FE3399C4A84BD48B40CF338987D77C1A9D4953A8D6358824BF24F5EFB0B8170AA756347997080503B47200B43818EAADB758FDD047C4FD0FD2098195BFEC85E72FC3A656359A1CF96C74A5EDC77370FF4EA47",
  "OrgID": 0,
  "OutputObject": {
    "TotalRecords ": 5,
    "CIRelations": [
      {
        "ID": 4,
        "RelationshipType": "SERVICE",
        "Classification": "SERVICE",
        "ServiceName": "Service243",
        "Criticality": "",
        "Device_HostName": "",
        "Serial_No": "",
        "IPAddress": "",
        "MAC_Address": "",
        "Location": ""
      },
      {
        "ID": 41,
        "RelationshipType": "PARENT",
        "Classification": "Desktop",
        "ServiceName": "",
        "Criticality": "",
        "Device_HostName": "TestNew56",
        "Serial_No": "New343",
        "IPAddress": null,
        "MAC_Address": null,
        "Location": null
      },
      {
        "ID": 340,
        "RelationshipType": "PARENT",
        "Classification": "CMDB Classification",
        "ServiceName": "",
        "Criticality": "HIGH",
        "Device_HostName": "cmtDevice002",
        "Serial_No": "cmtser002",
        "IPAddress": "",
        "MAC_Address": null,
        "Location": null
      },
      {
        "ID": 351,
        "RelationshipType": "PARENT",
        "Classification": "Server",
        "ServiceName": "",
        "Criticality": "HIGH",
        "Device_HostName": "INBANLSU0335-12",
        "Serial_No": "1000-12",
        "IPAddress": "XXX.XXX.XX.XXX",
        "MAC_Address": "8C-16-45-C1-66-32",
        "Location": null
      },
      {
        "ID": 352,
        "RelationshipType": "PARENT",
        "Classification": "Server",
        "ServiceName": "",
        "Criticality": "HIGH",
        "Device_HostName": "INBANLSU0335-15",
        "Serial_No": "1000-15",
        "IPAddress": "XXX.XXX.XX.XXX",
        "MAC_Address": "8C-16-45-C1-66-35",
        "Location": null
      }
    ]
  },
  "OutputID": 0,
  "Input": null
}

Errors Messages

All successful API Responses return with the HTTP Status code 200 OK. This document contains some of the errors that APIs return in Response.

Error

Description

InvalidAPI Request is failed to fetch due to an invalid value. The value can be a Parameter value,  Header value, or  Property value.
Specify the valueAPI Request is missing with the mandatory Parameter value.
APIKey and AuthTypeAPI Request is failed due to missing values of either APIKey or AuthType.
Invalid or expired API KeySpecified API Key is invalid or expired. Generate a new API Key or extend the API expiry date. For more information, see API Authentication and Authorization.

Note:

Standard HTTP status codes are displayed to indicate whether the API request is executed successfully or not. Following are the standards response codes:

  • Successful Responses (200-299)
  • Client Errors (400-499)
  • Server Errors (500-599)


Related content