Software/Firmware upload via webSDK

Hello,

I want to programmaticaly upload a software on the platform via the websdk. I managed to create the software itself (managedObject with fragment software), but I don’t understand how to upload a binary and attach it to the software object

The UI does it in 4 POST operations..

  1. POST /inventory/binaries to upload the binary. See Cumulocity - OpenAPI
  2. POST /inventory/managedObjects to create the software managed object. See Cumulocity - OpenAPI
  3. POST /inventory/managedObjects/<id returned in 2 above>/childAdditions with payload similar to (binary id from first POST)..

This creates a Software Binary managed object.

  1. POST /inventory/managedObjects/<id returned in 3 above>/childAdditions with a payload similar to (id is of the binary created in 1)…

    image

    This associates the uploaded binary with the Software binary managed object.

1 Like

Hi @paul.de-la-porte-des,

in addition to the API calls mentioned by Robert above, you might also be able to reuse some of the functionality provided by the RepositoryService that is part of the @c8y/ngx-components lib.

I don’t understand the steps 3 and 4 : why is there a double “/” in 3rd step url ? And how are the objects linked ? Could you explain which object is a child or is linked to which object in the end ? I’m sorry, I’m really confused…

The double / is just a typo. I’ve corrected it and added some more comments to the above.

Ultimately the Software managed object has a child addition that points to the Software Binary managed object and this has a childAddition that points to the binary itself.