aws-samples / aws-iot-twinmaker-samples

Apache License 2.0
97 stars 77 forks source link

Fix UDQ query for SiteWise addon #62

Closed AlfHou closed 2 years ago

AlfHou commented 2 years ago

Running the command in step 3 of the Sitewise Add-on gives the error message:

Parameter validation failed:
Missing required parameter in input: "endDateTime"
Missing required parameter in input: "startDateTime"
Unknown parameter in input: "endTime", must be one of: componentName, componentTypeId, endDateTime, entityId, interpolation, maxResults, nextToken, orderByTime, propertyFilters, selectedProperties, startDateTime, workspaceId
Unknown parameter in input: "startTime", must be one of: componentName, componentTypeId, endDateTime, entityId, interpolation, maxResults, nextToken, orderByTime, propertyFilters, selectedProperties, startDateTime, workspaceId

Changing the command to use startDateTime and endDateTime instead og startTime and endTime seems to fix this.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

johnnyw-aws commented 2 years ago

Hi @AlfHou, thanks for looking into this.

Actually, we recently added the new startTime and endTime parameters to provide better precision for UDQ requests and replace the previous startDateTime and endDateTime parameters [1].

The SDKs were updated so that the previous fields are now optional (left for backwards-compatability). Can you please confirm the AWS CLI and boto3 versions you're using? The error suggests you may be using an older version where client-side validation is treating them as required.

AlfHou commented 2 years ago

aws CLI version was at 2.5.4 boto3 was at version 1.21.40.

It seems upgrading the aws CLI to version2.6.3 fixed my issue.