Operation IED APP¶
This guide describes how to operate application on IED from IEM side, the following HTTP request you may need:
- a POST request with your username and password and receive a lightweight token that will enable you as a user to authenticate future requests.
- a GET request to receive the ID of the IED that you would like to get installed applications.
- a GET request to receive all the applications installed on a specific IED or all IEDs with an optional query field.
- a GET request to receive all catalog applications on IEM.
- a GET request to receive all the developer applications on IEM.
- a GET request to receive the configuration details of a specific application.
- a GET request to download the specific configuration version or template file of a specific application.
- a POST request to operate a specific version app on IEDs. You can shedule the job or do it right now.
- a POST request to import an application to IEM catalog with the app file.
Get authentication token for IEM API¶
See Authentication guide.
Get target Industrial Edge Device ID¶
To get the IED statistics, you require device IDs as unique identifier of the target devices. Use this request to list all available Industrial Edge Devices including the device ID:
curl -i -X GET \
-H "Authorization:<your-authorization-token>" \
**'https://<your-iem-url>/portal/api/v1/devices'**
A successful response looks like this:
{
"data": [
{
"userId": "c0bc43d7b7544bb9a45f2c9e3d30e525",
"deviceId": "fbbeb5943ed244a1ab38bdd19b80a3ff",
"deviceName": "ied-iem",
"deviceStatus": "ACTIVE",
"platformId": "8773f1b11586405b91828b99ad91c177",
"swPlatformId": "26592f675aeb4427b34a72784c8983ca",
"createdDate": 1673942712000,
"modifiedDate": 1673946633000,
"softwarePlatformName": "DOCKER_COMPOSE"
}
],
"pageNo": 1,
"totalPages": 1,
"pageSize": 5,
"totalCount": 1
}
List installed apps on IED¶
List all installed apps on IEDs. Use this request:
curl -i -X GET \
-H "Authorization:<your-authorization-token>" \
'https://<your-iem-url>/portal/api/v1/devices/installed-apps'
A successful response looks like this:
{
"data": [
{
"applicationId": "09e900303f9e45029f88b9051e9a36a3",
"icon": "https://localhost:443/pp/PortalCache/app/09e900303f9e45029f88b9051e9a36a3/3.png",
"title": "cloudnginx",
"deviceId": "b76e727ecb584c529411d4bf814d6926",
"deviceName": "cloudied",
"verionId": "cZEVJd5esDNd98e9TxrDO6Bd50reGIO6",
"versionNumber": "0.0.1",
"status": "REVIEWED"
},
{
"applicationId": "c57179a3b78c4c78b4ae009cef14c055",
"icon": "https://localhost:443/pp/PortalCache/app/c57179a3b78c4c78b4ae009cef14c055/16.png",
"title": "edgenginx",
"deviceId": "b76e727ecb584c529411d4bf814d6926",
"deviceName": "cloudied",
"verionId": "Wwf5PmYsVbG4HdlayezcZp2GpTsZtyft",
"versionNumber": "0.0.1",
"status": "REVIEWED"
},
{
"applicationId": "hI5FOxrLcRCQ7doCpoQTDLXTki8al5sI",
"icon": "https://localhost:443/pp/PortalCache/app/hI5FOxrLcRCQ7doCpoQTDLXTki8al5sI/appicon.png",
"title": "tom-nginx",
"deviceId": "b76e727ecb584c529411d4bf814d6926",
"deviceName": "cloudied",
"verionId": "MyVXdONT5Mq5JBRxFl56thmZwowl6tYk",
"versionNumber": "0.0.5",
"status": "LIVE"
}
]
}
List apps on IEM¶
List all catalog apps on IEM. Use this request:
curl -i -X GET \
-H "Authorization:<your-authorization-token>" \
'https://<your-iem-url>/portal/api/v1/applications'
A successful response looks like this:
{
"data": [
{
"applicationId": "hI5FOxrLcRCQ7doCpoQTDLXTki8al5sI",
"userId": "f8dd4206b24f4f108ceb81e0159f4faf",
"icon": "https://localhost:443/pp/PortalCache/app/hI5FOxrLcRCQ7doCpoQTDLXTki8al5sI/appicon.png",
"title": "tom-nginx"
}
]
}
List developer apps on IEM¶
List all developer applications on IEM. Use this request:
curl -i -X GET \
-H "Authorization:<your-authorization-token>" \
'https://<your-iem-url>/portal/api/v1/developer-applications'
A successful response looks like this:
{
"data": {
"developer-applications": [
{
"id": "610758a711434e19b1f85de8f8ffb8eb",
"userId": "88b0d08729b94a949ad8f4ae1abf60c7",
"title": "test",
"iconUrl": "https://localhost:443/pp/PortalCache/app/610758a711434e19b1f85de8f8ffb8eb/29.png"
}
]
}
}
List app configuration on IEM¶
List app configuration on IEM. You need application(either catalog application or developer application) ID as unique identifier of the app, then use the request:
curl -i -X GET \
-H "Authorization:<your-authorization-token>" \
'https://<your-iem-url>/portal/api/v1/applications/<your-app-id>/configs'
A successful response looks like this:
{
"data": [
{
"appConfigId": "365076f4237f48f2b332bc6565b27a5b",
"displayName": "test",
"description": "test",
"appConfigVersionLst": [
{
"appConfigVersionId": "eef6d9492b81410e986a601a3e3d5c0e",
"refName": "displayname",
"description": "display",
"filename": "config.yaml"
},
{
"appConfigVersionId": "1b08c594df2f4cb9b294b58d2e5b954d",
"refName": "test",
"description": "test",
"filename": "config.json"
}
],
"versioned": true,
"templateVo": {
"refName": "",
"filename": ""
}
},
{
"appConfigId": "e0f163d1bd994f85bdced653ed063700",
"displayName": "testTemplate",
"description": "template",
"appConfigVersionLst": [],
"versioned": false,
"templateVo": {
"appConfigTemplateId": "797fe61061b84c509034179bafe04fc4",
"refName": "temp1",
"description": "temp",
"filename": "config.json",
"schemaType": "OTHER"
}
}
]
}
Download App Configuration Version File¶
You can use this reques to download the config version file of a specific application, you also need the specific config ID and the version ID, if you want to download the template file, then you need the template ID as the last path field, if you want to download the version file, then you need the version ID as the last path field:
curl -i -X GET \
-H "Authorization:<your-authorization-token>" \
'https://<your-iem-url>/portal/api/v1/applications/{your-app-id}/configs/{your-config-id}/template/{your-template-id}'
A successful response looks like this:
you may get a file named like config.json
Operation app on IEM¶
The versionId can be optional when running an application on the IEM. If the application is a catalog application, there is no need to set the versionId. But if you want to install a developer application with a specific version, you need to set the versionId to install the according version. The operation type can be installApplication, updateApplication, uninstallApplication, startApplication, restartApplication, stopApplication, updateAppConfig, deleteAppConfig. Use the request:
curl -i -X POST \
-H "Authorization:<your-authorization-token>" \
'https://<your-iem-url>/portal/api/v1/batches?appid=<your-app-id>&operation=<your-operation-type>&versionId=<your-version-id>' \
--data-raw '{
"infoMap ": {
"devices": [
"string"
],
"delayTime":integer,
"configs": [
{
"configId": "string",
"versionId": "string",
"templateId": "string",
"editedTemplateText": "string",
"fileId": "string"
}
]
}
}'
A successful response looks like this:
{
"data": "f1f9a2ddd44c4a4180ed9f3c1ae1d48b"
}
Import an app to IEM Catalog¶
This method describes how to import an app to IEM Catalog. You need to export an app file and then use the request related api documentation:
curl -i -X POST \
-H "Authorization:<your-authorization-token>" \
'https://<your-iem-url>/portal/api/v1/application-import-jobs' \
--form 'file=<your-.app-file>'
A successful response looks like this:
{
"data": {
"id": "eea1ed58a01f444c805a138cea33247a",
"status": "PENDING",
"message": ""
}
}