No transform entry or scripts are defined through scripted REST API
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2023 03:03 PM
I am trying to create a scripted API that will accept some JSON data and put it in the cmdb_ci_computer table through an import set. Here are the steps I have taken:
- Extend the Import Set row table
- Label: logicmonitor_rest_api_device
- Name: u_logicmonitor_rest_api_device
- Columns: displayName (string), lmDeviceId (integer), name (string)
- Extended the cmdb_ci_computer class to cmdb_ci_computer_api_test
- Added the display name and LM device ID columns (I also added a second "name" column by mistake)
- Created a table transform map
- Source table: u_logicmonitor_rest_api_device
- Target table: cmdb_ci_computer_api_test
- Field maps: u_name = u_name, u_lmdeviceid = u_lm_device_id, u_name = name, and u_displayname = u_displayname
- Created a script include, which should be inserting into the u_logicmonitor_rest_api_device table (see attached scriptInclude.txt)
- Created a scripted REST resource which calls the script include (see attached rest.txt)
When I call the API, I get back:
{
"http_status": "500",
"status_message": "Unexpected import result during device transform. The import state is: error. The error message is: No transform entry or scripts are defined. And error code is: . ID of import set row is: undefined. The JSON looks like: {\"id\":18,\"name\":\"10.0.0.1\",\"displayName\":\"server1.domain.tld\"}"
}
This is the transform map (I blocked out the target table because I changed the table name between the screenshot and this post).
This is what I see in the import set. The Transform Map was blank for the top row, so I changed it, saved, and sent a POST to the API again. The second row was created and the top one never finishes:
What am I missing here?
0 REPLIES 0