src/wiotp/sdk/api/registry/devices.py
def update(self, deviceUid, metadata=None, deviceInfo=None, status=None):
        """
        Update an existing device
        """

        if not isinstance(deviceUid, DeviceUid) and isinstance(deviceUid, dict):
            deviceUid = DeviceUid(**deviceUid)

        deviceUrl = "api/v0002/device/types/%s/devices/%s" % (deviceUid.typeId, deviceUid.deviceId)

        data = {"status": status, "deviceInfo": deviceInfo, "metadata": metadata}

        r = self._apiClient.put(deviceUrl, data)
        if r.status_code == 200:
            return Device(apiClient=self._apiClient, **r.json())
        else:
            raise ApiException(r)
def update(self, deviceUid, metadata=None, deviceInfo=None, status=None):
        """
        Update an existing device
        """

        if not isinstance(deviceUid, DeviceUid) and isinstance(deviceUid, dict):
            deviceUid = DeviceUid(**deviceUid)

        deviceUrl = "api/v0002/device/types/%s/devices/%s" % (deviceUid.typeId, deviceUid.deviceId)

        data = {"status": status, "deviceInfo": deviceInfo, "metadata": metadata}

        r = self._apiClient.put(deviceUrl, data)
        if r.status_code == 200:
            return Device(apiClient=self._apiClient, **r.json())
        else:
            raise ApiException(r)
Update an existing device