Open reubenmiller opened 5 months ago
Just a small clarification question: I saw in the code that it will first try to retrieve the MO and if non existing try to retrieve it via external ID. So even when the external ID is numeric only e.g. 12345 this case should work, correct?
Just a small clarification question: I saw in the code that it will first try to retrieve the MO and if non existing try to retrieve it via external ID. So even when the external ID is numeric only e.g. 12345 this case should work, correct?
Yes that will also work, though the client do one extra request (as it will think the given value is a managed object id get a 404 back which is ignored)
Allowing user's to provide the managed object id allows better integration with other tooling (e.g. go-c8y-cli). This allows other tooling to perform custom lookups to retrieve the managed object id and just pass that to c8ylp when it it started.
The new managed object id/external identity logic is as follows:
If the given input is numeric (only digits), then try looking up if it corresponds to a managed object id. If successful, then use the managed object result, otherwise try treat the input as an external identity. If the input is not numeric, then assume the input is an external identity (same behaviour as before).
Below shows an example that should now work: