Expose CI Information

This call returns the information related to the CIs of a certain type, and provides the possibility to filter and sort the data from the database by given attribute values.

URL

/rest-api/exposeCI/getInformation?isGlobalId=false

Method

POST

Headers

Required:

Authorization: Bearer <token>

Example:

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0Njc5ODQ5MTcsImN1c3RvbWVyIjoxLCJ1c2VybmFtZSI6InN5c2FkbWluIn0.Ph8WHtzvpvfuH1j0CtwHqyBhX1uLlfhr0eQQ7m0_gT0

Request type

JSON

Response type

JSON

URL Parameters

Required: isGlobalId

Represents the Global IDs of the CIs. The following values are available:

  • true. Adds the global_id column in the output with its values (if it does not already exist in the given layout).
  • false. Displays the Global IDs of the CIs in the output, if the global_id column exists in the layout. Or, if the global_id column does not exist in the layout, then the Global IDs of the CIs are not displayed in the output.

Optional: None

JSON Template

{
    "type": "",
    "includeSubtypes": "",
    "layout": [
    ],
    "filtering": {
        "logicalOperator": "",
        "conditions": [ 
      		{
                "column": "",
                "value": [],
                "filteringAttributeCondOperator": ""
		}
        ]
     },
    "sortBy": [
	 "attribute": "",
        "order": ""
    ]
}

Template Parameters

Required:

  • type. The CI Type. This field cannot be empty or missing.
  • layout. The columns that will be displayed in the output. This field cannot be empty or missing.

Optional:

  • filtering. The conditions used to filter the data
  • logicalOperator. The operator that will be between the conditions. The supported operators are: or, and.
  • conditions. The list of conditions. A condition contains the column name, the value of the column, and the SQL operator.

  • sortBy. A list of sorting conditions containing the name of the column after which the data will be sort, and the order in which the data is displayed. The order field can have the following values: ASC, or DESC.

SQL Operators

The following SQL operators are supported:

  • NOT_EQUALS
  • EQUALS
  • IS_NULL
  • GREATER
  • GREATER_OR_EQUAL
  • LESS
  • LESS_OR_EQUAL
  • IN
  • LIKE
  • LIKE_CASE_INSENSITIVE
  • EQUALS_CASE_INSENSITIVE

    Note  

    • When you use the IS_NULL operator, the value field in the condition will be noted as empty string.
    • When you use the IN operator, the value field will be represented as a list of the desired values.

Example:

{
    "type": "node",
    "includeSubtypes": "false",
    "layout": [
        "display_label",
        "name",
        "description",
        "node_role",
        "contextmenu",
        "global_id"
    ],
    "filtering": {
        "logicalOperator": "and",
        "conditions": [
            {
                "column": "name",
                "value": [
                    "node",
                    "newci"
                ],
                "filteringAttributeCondOperator": "IN"
            }
        ]
    },
    "sortBy": [
        {
            "attribute": "name",
            "order": "DESC"
        }
    ]
}

Output

The output has the format of a list of DataInConfigurationItem.

Example:

[
    {
        "ucmdbId": "4c2ba8bb16d18827b961d83740815446",
        "globalId": "4c2ba8bb16d18827b961d83740815446",
        "type": "node",
        "properties": {
            "display_label": "node",
            "node_role": " 'server'  'virtual' ",
            "name": "node",
            "global_id": "4c2ba8bb16d18827b961d83740815446",
            "description": "bbbb"
        }
    },
    {
        "ucmdbId": "483505dd3ccd50318a56f5e01d230bce",
        "globalId": "483505dd3ccd50318a56f5e01d230bce",
        "type": "node",
        "properties": {
            "display_label": "delete1",
            "node_role": " 'aaaa'  'bbb' ",
            "name": "delete1",
            "global_id": "483505dd3ccd50318a56f5e01d230bce",
            "description": "bbbb"
        }
    }
]

Success response

Code: 200

Error response

Code: 405, 500, or 400

Content:

{
  error: [string]
} 

Example:

Code: 400

Content:

{
  error": "The following error has occurred: Invalid input format. Please consult logs for more details"
}

Notes

The user needs access to SDK permission.