cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Change Capability (add property)

david_sooter2
Explorer
0 Kudos
708

Dear SAP IOT experts,

we would like to create capabilities on the fly and add properties to those capabilities as a device send more data.
Sadly the Device API does not allow it. There is a put method for capabilities but it only allows us to alter the name or alternateid.
I understand that removing properties would be bad. But what about adding new ones? Is this in any way possible?

If not is there any sorta work around where we could add more properies as we go? I know we could create more property sets but it would make mapping the incoming data more difficult.

Thanks in advance
David

Accepted Solutions (0)

Answers (3)

Answers (3)

marcus_behrens1
Product and Topic Expert
Product and Topic Expert

... checking ...

marcus_behrens1
Product and Topic Expert
Product and Topic Expert
0 Kudos

I found this so far:

johnchacko
Employee
Employee
0 Kudos

Release Note: https://help.sap.com/viewer/a91b9b0c730241f99b6dd32fdc310a5b/Cloud/en-US/3ab34ec5a9ac4da5942a89a7ef3...

The PUT API for Capability will accept null properties, If the properties field is null then only the alternate id and the name is updated. If the properties field in the request has vales, these values should have all the existing properties in same order as when created and any additional properties at the end, if any. Failing to specify the exiting properties will result in a validation error with HTTP 400 and message as “Unable to update a capability. Existing properties do not match with the incoming properties.”

Valid message body Examples for put API:

1. With only name and alternate id

{
"alternateId": "sampleCapAltId",
"name": "capability1",
}

2. With existing property:

{
"alternateId": "sampleCapAltId",
"name": "capability1",
"properties": [{
 "name": "existingProerty",
 "dataType": "integer",
 "unitOfMeasure": "C",
 "formatter": {
  "dataType": "integer",
  "scale": 0,
  "shift": 0,
  "swap": true
  }
 }]
}

3. With Existing property and additional property:

{
"alternateId": "sampleCapAltId",
"name": "capability1",
"properties": [{
 "name": "existingProerty",
 "dataType": "integer",
 "unitOfMeasure": "C",
 "formatter": {
  "dataType": "integer",
  "scale": 0,
  "shift": 0,
  "swap": true
  }
 },{
 "name": "newProperty",
 "dataType": "integer",
 "unitOfMeasure": "C",
 "formatter": {
  "dataType": "integer",
  "scale": 0, 
  "shift": 0,
  "swap": true
  }
 }]
}

Hope This helps!

david_sooter2
Explorer
0 Kudos

Thank you guys so much for the quick response and the the fix.

That fixed our problem.

Kind regards.

David

marcus_behrens1
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi, what is possible since last fall is that you have a capability with lots of properties and only send an (increasing) subset of it. Adding properties to an existing property set in the thing model (or the equipment model when using EPD or PAI) is possible today already. I learnt from product management colleagues is that "To make it possible to add a property for an existing capability" is under discussion for future development. I will update this question if this moves from "under discussion" to "planned". Regards, Marcus

david_sooter2
Explorer
0 Kudos

Hi Marcus,

Do you have any new infos on this subject. We need the possibility to add properties to devices and we need these properites to run through the rules framework. Atm im considing creating properites as placeholder properties (ex. custom_prop1, custom_prop2 ) but its not really the ideal solution.... I would be greatful for any informatio.

Kind regards.

David