System API
System API has a number of resources you can use to manage the instance, the API is available in Asset and ETL by ASST-1718 - Løst fix version 3.0.31.
Only users with role TTADMIN can use the system API.
Manage instance
- /etl/system/config/instance
- /asset/api/1/system/config/instance
The instance endpoint let you add/remove and list nodes managed by the running Asset/ETL instance.
Add instance
/etl/system/config/instance |
|||||||||
Description |
Add a new instance |
||||||||
URI parameters |
|
||||||||
HTTP method |
|
Example
curl $SERVER/asset/api/1/system/config/instance -d instance=$INSTANCE -u $TTUSER
{
"error": null,
"message": {
"reason": "OK",
"message": "added new instance"
},
"instance": [
{
"prefix": "$INSTANCE",
"nodeId": "$NODEID"
}
]
}
Remove instance
/etl/system/config/instance |
|||||||||
Description |
Remove existing instance |
||||||||
URI parameters |
|
||||||||
HTTP method |
|
Example
curl -XDELETE $SERVER/asset/api/1/system/config/instance -G -d instance=$INSTANCE -u $TTUSER
{
"error": null,
"message": {
"reason": "OK",
"message": "removed old instance"
},
"instance": [
{
"prefix": "$INSTANCE",
"nodeId": "$NODEID"
}
]
}
List instances
/etl/system/config/instance |
|
Description |
List all instances |
URI parameters |
|
HTTP method |
|
Example
curl $SERVER/asset/api/1/system/config/instance
{
"error": null,
"message": null,
"instance": [
{
"prefix": "$INSTANCE_1",
"nodeId": "$NODEID_2"
},
{
"prefix": "$INSTANCE_2",
"nodeId": "$NODEID_2"
}
]
}
Manage cache
- /asset/api/1/system/cache/{name}
The cache endpoint let you apply actions to cache in the scope of a nodeId.
Refresh cache
/asset/api/1/system/cache |
|||||||||||||||||||||||
Description |
Refresh data in cache |
||||||||||||||||||||||
URI parameters |
|
||||||||||||||||||||||
HTTP method |
|
Example
curl $SERVER/asset/api/1/system/cache/mapping -d nodeId=$NODEID -u $TTUSER
{
"error": null,
"message": {
"reason": "OK",
"message": "mapping cache reloaded"
},
"instance": [
{
"prefix": "$INSTANCE",
"nodeId": "$NODEID"
}
]
}
Resources
ASST-1718 - Add ability to add companyPrefix at runtime Løst
ASST-1717 - EPC/Asset cache is not reloaded by admin/install.jsf Løst