I started a go-c8y-cli extension c8y-mapper to manage mappings, connectors, … in the cumulocity-dynamic-mapper.
The extension feature is really great for these tasks from a command line tool. Thanks …
When developing the extension some question occurred:
- I use the API type to define the subcommand
mappings
for some actions:list, get, ...
. At the same time I definedactivate
for the same groupmappings
asCommand
as well. Can I use both at the same time? So:
c8y mapper mappings activate
→ command from commandsc8y mapper mappings list, ...
→ command from API
- In the command
activation
I use a c8y pipeline command to update a fragment in a managedObject. Can I achieve the same using the API type?
So, first retrieve the managedObject and then merge the changes to this retrieved object? I tried to look into jsonnet for this, but got stuck … - I defined a type for type-mapping similar to type-device to complete mapping ids.
When I use it I get the following error. What could be the reason?
# c8y-mapper % c8y mapper mappings get --id Mapping\ -\ 10
2024-10-14T09:02:43.486+0200 ERROR commandError: referenceByName: no matching items found. name=Mapping - 10 ::StatusCode=404