Getting Started
The following sections introduce you to the Cisco Edge Intelligence Release 2.0 API and provide information on how to access the API to get started.
What are Cisco Edge Intelligence Release 2.0 API used for?
The Cisco Edge Intelligence Release 2.0 API allows operations at scale with the following API:
- Agent Management: View or reset the status of the Cisco Edge Intelligence agent.
- Authentication: Obtain or refresh authentication tokens, and manage user credentials.
- Event Management: View event information.
- Policy Management: View and manage one or multiple pipelines in your Cisco Edge Intelligence agent.
Base URL
Every API request begins with the following base URL.
https://localhost/api/v2/edge-intelligence
Try Out Cisco Edge Intelligence Release 2.0 API
Generate an authentication token to use the Cisco Edge Intelligence Release 2.0 API.
Define and deploy a Cisco Edge Intelligence pipeline.
Request
curl --location --request POST 'https://192.0.12.11:8008/api/v2/edge-intelligence/pipelines' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwidG9rZW5fdmVyc2lvbiI6MSwic2VjcmV0IjoyLCJleHAiOjE3NDU5MzQ3NjksImlhdCI6MTc0NTkzNDQ2OX0.mSwRPP6Bn3Lxrm9byofQgZT4sYEJ7Fk3jbLZ5NBFNoc' \
--data '{
"name": "Jpipeline1",
"data": {
"dataSources": {
"input": {
"assetId": "bserial1",
"type": "MQTT",
"dataSourceConfiguration": {
"port": null,
"secure": false,
"useWebSockets": false,
"clientId": "bclient",
"deviceName": "b-mqtt1",
"assetId": "bserial1",
"name": "endpoint_1883",
"endpoints": [
{
"clientId": "bclient",
"port": "1883",
"name": "endpoint_1883",
"metrics": {
"pressure": {
"label": "pressure",
"topic": "pressure",
"datatype": "String"
},
"temperature": {
"label": "temperature",
"topic": "temperature",
"datatype": "Int"
}
},
"secure": false,
"credentials": []
}
]
},
"fields": [
{
"type": "subscription",
"key": "pressure",
"source": "/endpoints/endpoint_1883/bclient/pressure"
},
{
"type": "subscription",
"key": "temperature",
"source": "/endpoints/endpoint_1883/bclient/temperature"
}
]
}
},
"dataTarget": {
"type": "MQTT",
"dataTargetConfiguration": {
"connectors": [
{
"host": "test.mosquitto.org",
"port": 1883,
"secure": false,
"mqttQoS": 1,
"username": "",
"clientId": "bserial1",
"cleanSession": true,
"publish": {
"resultPath": {
"mqttRetain": true,
"mqttQos": 1,
"mqttTopic": "cisco/edge-intelligence/telemetry/bserial1"
}
}
}
]
}
},
"outputModel": {
"temperature": {
"addTimestamp": true,
"targetPath": "deviceData/temperature",
"type": "INT",
"emit": true
},
"pressure": {
"addTimestamp": true,
"targetPath": "deviceData/pressure",
"type": "STRING",
"emit": true
}
}
}
} '
Response
{
"success": true,
"data": {
"id": "7f4c1690-dba5-4b28-bd46-d556b010689d_2747eac8-2c00-4630-80f9-0c2772425521",
"status": "[[\"SUCCESS\"]]"
},
"message": "Pipeline deployment successful"
}
- Retrieve information on deployed Cisco Edge Intelligence pipelines.
Request
curl --location --request GET 'https://192.0.12.11:8008/api/v2/edge-intelligence/pipelines' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwidG9rZW5fdmVyc2lvbiI6MSwic2VjcmV0IjoyLCJleHAiOjE3NDU5MzQ3NjksImlhdCI6MTc0NTkzNDQ2OX0.mSwRPP6Bn3Lxrm9byofQgZT4sYEJ7Fk3jbLZ5NBFNoc' \
--data ''
Response
{
"success": true,
"data": [
{
"configStatus": {
"dataSources": {
"input": {
"assetId": "bserial1",
"dataSourceConfiguration": {
"assetId": "bserial1",
"clientId": "bclient",
"deviceName": "b-mqtt1",
"endpoints": [
{
"clientId": "bclient",
"credentials": [],
"metrics": {
"pressure": {
"datatype": "String",
"label": "pressure",
"topic": "pressure"
},
"temperature": {
"datatype": "Int",
"label": "temperature",
"topic": "temperature"
}
},
"name": "endpoint_1883",
"port": "1883",
"secure": false
}
],
"name": "endpoint_1883",
"port": null,
"secure": false,
"useWebSockets": false
},
"fields": [
{
"key": "pressure",
"source": "/endpoints/endpoint_1883/bclient/pressure",
"type": "subscription"
},
{
"key": "temperature",
"source": "/endpoints/endpoint_1883/bclient/temperature",
"type": "subscription"
}
],
"type": "MQTT"
}
},
"dataTarget": {
"assetId": "bserial1_7f4c1690-dba5-4b28-bd46-d556b010689d",
"dataTargetConfiguration": {
"connectors": [
{
"cleanSession": true,
"clientId": "bserial1",
"host": "test.mosquitto.org",
"mqttQoS": 1,
"name": "bserial1_7f4c1690-dba5-4b28-bd46-d556b010689d",
"port": 1883,
"publish": {
"resultPath": {
"mqttQos": 1,
"mqttRetain": true,
"mqttTopic": "cisco/edge-intelligence/telemetry/bserial1"
}
},
"secure": false,
"username": ""
}
]
},
"type": "MQTT"
},
"id": "7f4c1690-dba5-4b28-bd46-d556b010689d_2747eac8-2c00-4630-80f9-0c2772425521",
"outputModel": {
"pressure": {
"addTimestamp": true,
"emit": true,
"targetPath": "deviceData/pressure",
"type": "STRING"
},
"temperature": {
"addTimestamp": true,
"emit": true,
"targetPath": "deviceData/temperature",
"type": "INT"
}
},
"version": 3
},
"name": "Jpipeline1",
"pipelineStatus": "Stopped"
}
],
"message": "Successfully Retrieved Pipeline Config"
}
Try It Out Using Postman Collection
Prefer to use Postman rather than code or the command line? Check out our Postman Collection.