-
-
Notifications
You must be signed in to change notification settings - Fork 5
[DESIGN] Tags introduction [IOT-1359] #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
513f6f7
Draft tags introduction
polldo e932520
Improve doc format
dfd99cf
Rename tag into tags
polldo 10c4b50
Update flags constraints
polldo 436e826
Update error handling
polldo 529d57d
Update new command design
polldo aac5c46
Insert use experience
polldo 109f579
Add second device in usecase
polldo a811c5b
Add tags during resource creation
polldo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Introduction of tags for device and thing | ||
|
||
## Review Period | ||
|
||
Best before October, 18 2021. | ||
|
||
## What is the problem? | ||
We need to design the commands to **handle tags** for things and devices. Tags could be attached and detached to/from any thing or device. Also, certain commands could take tags as input in order to perform operations on multiple things/devices. | ||
|
||
## Out-of-Scope | ||
|
||
## User Experience Walkthrough | ||
|
||
|
||
## Implementation | ||
|
||
### Project Changes | ||
|
||
Commands that could regard multiple things or devices could be changed in order to accept tags. | ||
|
||
These commands can be: | ||
|
||
**list commands**: | ||
|
||
`thing list --tag <key0>=<value0>,<key1>=<value1>` to list all the things having all the tags passed | ||
polldo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
`device list --tag <key0>=<value0>,<key1>=<value1>` to list all the devices having all the tags passed | ||
|
||
alternative: `--filter` instead of `--tag` | ||
polldo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
**delete commands**: | ||
|
||
`thing delete --tag <key0>=<value0>,<key1>=<value1>` to delete all the things having all the tags passed | ||
|
||
`device delete --tag <key0>=<value0>,<key1>=<value1>` to delete all the devices having all the tags passed | ||
|
||
|
||
**ota command**: | ||
|
||
`ota upload --device-tag <key0>=<value0>,<key1>=<value1> --file <sketch-file.ino.bin>` to perform an upload via ota to all the devices having all the tags passed | ||
polldo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
To be decided, **which flag is mandatory and which is optional**: | ||
In delete and ota commands, the `--id` flag should become **optional** instead of mandatory. | ||
Then, if neither `--id` nor `--tag` is passed, the command could return an error telling the user to specify at least one of the two flags. | ||
On the other hand, if both flags are passed, we could follow different approaches: return an error, use only one flag (only tags or only id), try to use both flags. | ||
polldo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Another thing to be decided is **how to handle errors**: | ||
- Try to execute the command on all the indicated resources, without stopping in case of errors. At the end, print all the errors details. | ||
- Stop as soon as an error is encountered. | ||
polldo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Breaking Change | ||
|
||
The changes listed above should not break anything, the commands could be used as before. | ||
|
||
### Design | ||
|
||
New commands should be introduced in order to add and delete tags to devices and things. Here are some alternatives: | ||
|
||
Implementing a tag command: | ||
`arduino-cloud-cli tag create --thing <thingID> --tags <key0>=<value0>,<key1>=<value1>` | ||
|
||
Adding a tag subcommand in device and thing commands: | ||
polldo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
`arduino-cloud-cli thing create-tags --thing <thingID> --tags <key0>=<value0>,<key1>=<value1>` and same for device | ||
polldo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
polldo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
### Documentation Changes | ||
|
||
Readme should be updated | ||
|
||
## Additional Notes | ||
|
||
https://arduino.atlassian.net/jira/software/projects/IOT/boards/277?selectedIssue=IOT-1359 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.