v2

latestOpenAPI 3.1.0CC-BY-SA 2.02026-07-2617789528.6 KB
🧩 Data sources

Create a data source

Create a new data source

put/datasources

Request body

idstring

Unique identifier of the data source to create.

namestring

The human readable name of the data source to create.

descriptionstring

Description of the goal of the data source to create.

enabledboolean

Enable or disable data source.

updateTimeoutinteger

Duration in seconds before aborting data source update. The main goal is to prevent never ending requests. If a periodicity if configured, you should set that timeout at a lower value.

Example request

{
  "id": "test-data-source",
  "name": "Test data source",
  "description": "Synchronize example data from the CMDB",
  "enabled": true,
  "updateTimeout": 30,
  "runParameters": {
    "onGeneration": true,
    "onNewNode": true,
    "schedule": {
      "type": "scheduled"
    }
  },
  "type": {
    "name": "HTTP",
    "parameters": {
      "url": "http://jsonplaceholder.typicode.com/users/1",
      "requestMethod": "GET",
      "headers": [
        {
          "name": "X-API-Key",
          "value": "05ce8e3d9df6"
        }
      ],
      "checkSsl": true,
      "requestTimeout": 10,
      "requestMode": {
        "name": "byNode"
      }
    }
  }
}

Response

Created

result'success' | 'error' required

Result of the request

action'createDataSource' required

The id of the action

Example response

{
  "data": {
    "datasources": [
      {
        "id": "test-data-source",
        "name": "Test data source",
        "description": "Synchronize example data from the CMDB",
        "enabled": true,
        "updateTimeout": 30,
        "runParameters": {
          "onGeneration": true,
          "onNewNode": true,
          "schedule": {
            "type": "scheduled"
          }
        },
        "type": {
          "name": "HTTP",
          "parameters": {
            "url": "http://jsonplaceholder.typicode.com/users/1",
            "requestMethod": "GET",
            "headers": [
              {
                "name": "X-API-Key",
                "value": "05ce8e3d9df6"
              }
            ],
            "checkSsl": true,
            "requestTimeout": 10,
            "requestMode": {
              "name": "byNode"
            }
          }
        }
      }
    ]
  }
}