Create or replace a Custom Device data source
PUT/api/v1/orgs/{orgId}/devices/{deviceId}/data-source
Create the device's data source if none exists yet, or fully replace it if one
does (upsert). Every field in the request overwrites the corresponding stored field. Omitting
description clears it, it is not preserved from the previous value.
Request Body
name(string, required): A descriptive name for the data source.description(string, optional): A detailed description of the data source.connectorType(string, optional): One ofMQTT(v3.1),WEDA Data-Stream,HTTP-Server. Immutable once set: while the data source's currentconnectorTypeis unset, this may set it; once it has a value, sending the same value again is accepted as a no-op, but sending a different value returns400.
Parameters
orgId(string, required, path): Organization identifier.deviceId(UUID, required, path): Custom device identifier.
Responses
201 Created: No data source existed yet for this device. A new one was created.200 OK: A data source already existed. It was replaced.400 Bad Request:connectorTypewas already set to a different value and this request tries to change it.417 Expectation Failed: The data source was saved, but applying it failed. The whole change was rolled back.
Request
Responses
- 200
- 201
- 400
- 417
OK
Created
Bad Request - connectorType is already set and the request tries to change it to a different value.
Expectation Failed - the data source was saved, but applying it failed; the whole change was rolled back.