Linking or De-Linking CIs and Retrieving CI Relationship Using APIs
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
Linking CI Relations
Use this API to link CI Relations.
API Details
Request Parameters
Parameter Name | Type | Description | Linking Type and Parameter Values | ||
---|---|---|---|---|---|
CI-CI | CI-Service | Service-CI | |||
SourceKey * | STRING | Name of the Source. | The value can be one of the following:
| The value can be one of the following:
| The value is either Service ID or ServiceName. |
TargetKey * | STRING | Name of the Target. | The value can be one of the following:
| The value is either ServiceID or ServiceName. | The value can be one of the following:
|
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:
| Note: The Relationship parameter value must be Service if the SourceKey parameter value is one of the following:
| |
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 |
De-Linking CI Relations
Use this API to de-link CI Relations.
API Details
Request Parameters
For more information, see Request Parameters.
Retrieving CI Relationship
Use this API to retrieve CI Relations.
API Details
Request Parameters
Parameter Name | Type | Description | Notes |
---|---|---|---|
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 |
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 |
---|---|
Invalid | API Request is failed to fetch due to an invalid value. The value can be a Parameter value, Header value, or Property value. |
Specify the value | API Request is missing with the mandatory Parameter value. |
APIKey and AuthType | API Request is failed due to missing values of either APIKey or AuthType. |
Invalid or expired API Key | Specified 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)