Via API: Follow along with our Postman Collection
To access the requests associated with the System endpoint, click on the OT Systems data folder in our Postman collection.
Retrieving the system repository
Returns a list with all systems in the system repository.
Request:
API Request
Python
Request:
GET ot-base/api/v1/systems
import requests
# Enter your hostname (for example: myserver.com or 127.0.0.1) between the quotes.
hostname = 'enterHostnameOrIP'
# Replace username and password with your username and password credentials.
auth=('username', 'password')
url = 'https://'+hostname+'/ot-base/api/v1/systems/'
response = requests.get(url, auth=auth)
print(response.status_code)
print(response.text)
Response:
API Request
{
"data": [
{
"systemId": "string", (unique alphanumeric ID of system)
"parent_systemId": "string", (unique alphanumeric ID of parent system, can be empty string)
"name": "string",
"full_name": "string", (full path with parents name and own name in end),
"description": "string",
"locationId": "string", (unique alphanumeric ID of a location)
"location": "string", (full path of the location with its parents)
"group_name": "string", (system group)
"approved": "string",
"approved_on": "string",
"approved_by": "string",
"release": "string",
"criticality": "string",
"process": "string", (full path of a linked process)
"relations": "array", (array of linked relations)
}
],
"info": {
"total": 0, (amount of entries found)
"offset": 0,
"user": "admin", (name of the requesting user)
"origin": "OT Base Inventory 8.02" (current version of OT Base Inventory)
}
}
Retrieving location data for a single system
Data for a particular system can be retrieved by addressing the system as a sub-resource of the systems resource.
Note: You can only use system IDs, but not system names.
Request:
API Request
Python
Request:
GET ot-base/api/v1/systems/systemId
import requests
# Enter your hostname (for example: myserver.com or 127.0.0.1) between the quotes.
hostname = 'enterHostnameOrIP'
# Replace username and password with your username and password credentials.
auth=('username', 'password')
# Replace enterSystemID with a system id defined in Asset Center.
systemID = 'enterSystemID'
url = 'https://'+hostname+'/ot-base/api/v1/systems/'+systemID
response = requests.get(url, auth=auth)
print(response.status_code)
print(response.text)
Response:
API Request
{
"data": [
{
"systemId": "string", (unique alphanumeric ID of system)
"parent_systemId": "string", (unique alphanumeric ID of parent system, can be empty string)
"name": "string",
"full_name": "string", (full path with parents name and own name in end),
"description": "string",
"locationId": "string", (unique alphanumeric ID of a location)
"location": "string", (full path of the location with its parents)
"group_name": "string", (system group)
"approved": "string",
"approved_on": "string",
"approved_by": "string",
"release": "string",
"criticality": "string",
"process": "string", (full path of a linked process)
"relations": "array", (array of linked relations)
}
],
"info": {
"user": "admin", (name of the requesting user)
"origin": "OT Base Inventory 8.02" (current version of OT Base Inventory)
}
}
Updating system data, and creating a new system
Data for a particular system can be updated with a POST command.
If the system ID supplied with the command doesn't exist, a new system is created provided that a name is supplied.
It is also possible to update the custom fields for your system. To do that, just add the "extended" parameter in your request with the specific custom field name as an attribute.
Info: Please keep in mind that either the name or the full_name field is mandatory to create a new system. Otherwise an error will occur, pointing to exactly that problem. In addition: only the systemId in the URI and the name OR the full_name are mandatory. Every other field is not needed, but is changeable. If no name is given, the last name of the full_name attribute will be used as the system name.
API Request
Python
Request:
POST ot-base/api/v1/systems/systemId
Request Body:
data = {
"systemId": "newSystemId", "name":"enterNewSystemName",
"full_name": "path/to/new/system",
"description": "new description",
"locationId": "new locationId",
"group_name": "new group name",
"criticality": "new criticality info",
"process": "new process path",
"extended": {
"yourCustomField": "your value"
} }
import requests
# Enter your hostname (for example: myserver.com or 127.0.0.1) between the quotes.
hostname = 'enterHostnameOrIP'
# Replace username and password with your username and password credentials.
auth=('username', 'password')
# Replace enterSystemID with a system id defined in Asset Center.
systemID = 'enterSystemID'
url = 'https://'+hostname+'/ot-base/api/v1/systems/'+systemID
data = {
"name":"enterNewSystemName"
}
response = requests.post(url, json=data auth=auth)
print(response.status_code)
print(response.text)
Via Excel
With our latest version, you now have the ability to export your systems to an excel file.
(Info: >= OT Base Inventory Version 8.02)
Retrieving all systems
- Navigate to your OT Base Inventory and select the Inventory menu Item from the dropdown menu at the top of your OT Base Inventory.
- On the left side, inside your sidebar, click on the Systems menu item.
- Click on the excel export button in the top of your systems list.
An excel file containing your systems will be downloaded automatically.
Importing / Creating / Updating Systems from Excel
- Navigate to your OT Base Inventory and select the Inventory menu Item from the dropdown menu at the top of your OT Base Inventory.
- On the left side, inside your sidebar, click on the Import menu item.
- On the newly opened page, click on the Excel tab on the top of the page.
- Lastly, choose your edited Excel file at the Import Systems section and press import afterwards.
Important Notes on Excel Import
- Data columns: When importing, only the following columns are used: systemId, name, full_name, description, locationId, group_name, criticality, and process. Ensure any edits you want to be applied are within these columns.
- Consistency: Ensure the systemId remains unique and consistent with the system's records to avoid conflicts during the import process.
- full_name column: The full_name field consists of the names of the systems. Therefore, you need to be careful, that only the names of the systems will be in here. (For Example: “Factories / Factory #1” will look for a system with the name “Factories” and move the “Factory #1” to it.)
- Backup: It's recommended to keep a backup of the original exported file before making any changes, in case you need to revert or reference the original data.
By following these instructions, you can efficiently export and import your system data using Excel, streamlining your data management process
Comments
0 comments
Please sign in to leave a comment.