Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

Make readings list help msg more informative #213

Closed
difince opened this issue Jun 15, 2020 · 0 comments
Closed

Make readings list help msg more informative #213

difince opened this issue Jun 15, 2020 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@difince
Copy link
Contributor

difince commented Jun 15, 2020

🐞 Bug Report

Affected Command

./edgex-cli reading list

Is this a regression?

No

Description and Minimal Reproduction

  • Help message is not enough informative. It says "Return all device readings." All readings belong to device - so it is not clear if the help msg meant - returning all readings or returning all reading that belongs to specific device. It does not specify if device id or device name should be provided. There is mismatch in edgex-go between documentation and implementation - see issue mismatch between documentation and implementation of delete endpoints /event/device/{deviceId} and reading/device/{deviceId}/{limit} edgex-go#2591. There is no flag for specifying the device, so the device need to be sent as an Argument but it is somehow not clear.
    In addition the --limit flag is applied only if a device arg is provided. Otherwise it is not taken in consideration. (it should be obviously said). go-mod-contracts does not have a function that returns all events limited by number. @mkbhanda have opened an issue about that in edgex-go No limit on /v1/reading edgex-go#2560

If device argument is not provided, the current behavior is to list all readings if they are not too much.
If the readings are too much an error is returned

Error: 500 - limit 69584 exceeds configured max
null

So, an usage example and additional information in the help message should be provided.

./edgex-cli reading list -h

Return all device readings.

Usage:
edgex-cli reading list [flags]

Flags:
-h, --help help for list
-l, --limit int32 Limit number of results

Global Flags:
--config-file string configuration file
--no-pager Do not pipe output into a pager.
-u, --url Print URL(s) used by the entered command.
-v, --verbose Print entire HTTP response.

Here is a working example:
./edgex-cli reading list Random-Integer-Device -l 2

@difince difince added the bug Something isn't working label Jun 15, 2020
difince added a commit to difince/edgex-cli that referenced this issue Jun 17, 2020
Usually Args are reserved for commonad object ID (in our case reading ID)
That is why now the device (name) is currently set by flag --device
Address partially: edgexfoundry#213

Signed-off-by: Diana Atanasova <dianaa@vmware.com>
difince added a commit to difince/edgex-cli that referenced this issue Jun 17, 2020
Usually Args are reserved for commonad object ID (in our case reading ID)
That is why now the device (name) is currently set by flag --device
Address partially: edgexfoundry#213

Signed-off-by: Diana Atanasova <dianaa@vmware.com>
@difince difince self-assigned this Jun 17, 2020
difince added a commit to difince/edgex-cli that referenced this issue Jun 17, 2020
Usually Args are reserved for commonad object ID (in our case reading ID)
That is why now the device (name) is currently set by flag --device
Set more appropriate helpers messages

Address partially: edgexfoundry#213

Signed-off-by: Diana Atanasova <dianaa@vmware.com>
@difince difince closed this as completed Jun 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant