on 06-11-2019 2:15 PM
Hello everybody,
I'm doing some work on the Leonardo IoT API right now. My task is to create node.js scripts to create / update and delete packages / ThinkTyps / ThinkTypProperties / Thinks and ThinkHierarchies.
For this I already looked at the "iot-application-services-sdk-nodejs" package and of course the online documentation. The scripts should all work with OData.
I already managed that I can create a package. But already with the update I fail. Getting the ETag is no problem in my opinion. However, I always get an error message with the error number 412. I get the values with the read command and pass them directly to the update command. Just for understanding, is this correct? (at least this is how the manual should be understood).
When creating ThingTyps I fail completely: here I proceed exactly according to the instructions ( https://help.sap.com/viewer/080fabc6cae6423fb45fca7752adb61e/1905a/en-US/15eb5681d78c442a8c274752b6b... ) However, the microservice "config-thing-sap" is not supported by the "Starter Package". Can anyone help me here?
Hi Daniel,
I was able to update the package like this:
GET YOUR PACKAGE NAME:
METHOD: GET
URL: https://config-package-sap.cfapps.eu10.hana.ondemand.com/Package/v1/Packages(‘your-package-name’)
COPY THE IF-MATCH from the response headers. The etag is the if-match and is 32 characters long.
UPDATE YOUR PACKAGE:
METHOD: PATCH
URL:https://config-package-sap.cfapps.eu10.hana.ondemand.com/Package/v1/Packages(‘your-package-name’)
Headers:
So the second call has the following headers and the following body:
CREATE THIN TYPE
METHOD: POST
Headers:
For your body -> name yourpackagename:nameforthingtype
No special characters in thingtype + package and thing type name seperated by a :
If you already created propertysets you can pass them in the body too.
This should do it. 🙂
Kind regards,
Dries
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Dries Van Vaerenbergh: I didn't say it worked that way for me. I just said it's a good way to check it out. Specifically, I want to create NodeJ's scripts and use the APIs with them and the Postman environment only helps me to a limited extent. The basis for my work is the already mentioned "node-wrapper for IoT AE". Here are some problems with the actuality of the product. I was hoping to get a way to work around the problems with NodeJ's script.
Best regards,
Daniel
Hi Dries,
you didn't get anything wrong.
My procedure is exactly the same.
--> Yesterday evening I found the "error" with the ETag. Obviously the spelling was checked. Now I wrote it exactly as it says in the postman and it works now. Interestingly, it only seems to concern this parameter, which unfortunately doesn't make debugging any easier.
Thanks for your support.
Best regards,
Daniel
User | Count |
---|---|
10 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.