Skip to content

Refactor things [IOT-1310] #27

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 4 commits into from
Aug 30, 2021
Merged

Refactor things [IOT-1310] #27

merged 4 commits into from
Aug 30, 2021

Conversation

polldo
Copy link
Contributor

@polldo polldo commented Aug 27, 2021

Motivation

This PR tries to adapt cloud-cli thing templates to the already established concept of template

  • templates like this can now be used to create new things
  • thing create command can now be used only to create new things from a template. The clone feature has been moved in a more specific command thing clone
  • properties have been renamed into variables in the project
  • extracted templates are more "compliant" with the already known templates

Change description

Additional Notes

Reviewer checklist

  • PR address a single concern.
  • PR title and description are properly filled.
  • Changes will be merged in main.
  • Changes are covered by tests.
  • Logging is meaningful in case of troubleshooting.
  • History is clean, commit messages are meaningful (see CONTRIBUTING.md) and are well formatted.

polldo added 4 commits August 27, 2021 14:07
remove properties_count, max_value, min_value, persist and tag fields
add template name field
change helper to remark that a template is being extracted instead of a thing.
thing create command has been split in two commands:
- thing create -> create a thing from a template. name parameter is optional and, if it's present, it overrides the name provided by the template
- thing clone  -> create a thing from an existing thing. name parameter of the new thing is mandatory

thing templates have been aligned with general iot cloud templates concept
now templates like this: https://github.com/bcmi-labs/cloud-templates/blob/main/templates/home-security-alarm/resources/thing.yml
can be directly used to create new things.
@polldo polldo requested review from eclipse1985 and stevisco August 27, 2021 14:21
@polldo polldo changed the title Refactor things Refactor things [IOT-1310] Aug 27, 2021
@polldo polldo merged commit 35b7bac into main Aug 30, 2021
@polldo polldo deleted the polldo/adapt-to-rfc branch August 30, 2021 12:02
polldo added a commit that referenced this pull request Aug 30, 2021
adapt cloud-cli thing templates to the already established concept of template:
- extracted templates are more "compliant" with the already known templates
- standard cloud thing templates can now be used to create new things

* Adapt template extraction

remove properties_count, max_value, min_value, persist and tag fields
add template name field
change helper to remark that a template is being extracted instead of a thing.

* Adapt thing creation to rfc

thing create command has been split in two commands:
- thing create -> create a thing from a template. name parameter is optional and, if it's present, it overrides the name provided by the template
- thing clone  -> create a thing from an existing thing. name parameter of the new thing is mandatory

thing templates have been aligned with general iot cloud templates concept
now templates like this: https://github.com/bcmi-labs/cloud-templates/blob/main/templates/home-security-alarm/resources/thing.yml
can be directly used to create new things.

* Replace Properties with Variables

* Update readme
polldo added a commit that referenced this pull request Sep 2, 2022
adapt cloud-cli thing templates to the already established concept of template:
- extracted templates are more "compliant" with the already known templates
- standard cloud thing templates can now be used to create new things

* Adapt template extraction

remove properties_count, max_value, min_value, persist and tag fields
add template name field
change helper to remark that a template is being extracted instead of a thing.

* Adapt thing creation to rfc

thing create command has been split in two commands:
- thing create -> create a thing from a template. name parameter is optional and, if it's present, it overrides the name provided by the template
- thing clone  -> create a thing from an existing thing. name parameter of the new thing is mandatory

thing templates have been aligned with general iot cloud templates concept
now templates like this: https://github.com/bcmi-labs/cloud-templates/blob/main/templates/home-security-alarm/resources/thing.yml
can be directly used to create new things.

* Replace Properties with Variables

* Update readme
polldo added a commit that referenced this pull request Sep 2, 2022
adapt cloud-cli thing templates to the already established concept of template:
- extracted templates are more "compliant" with the already known templates
- standard cloud thing templates can now be used to create new things

* Adapt template extraction

remove properties_count, max_value, min_value, persist and tag fields
add template name field
change helper to remark that a template is being extracted instead of a thing.

* Adapt thing creation to rfc

thing create command has been split in two commands:
- thing create -> create a thing from a template. name parameter is optional and, if it's present, it overrides the name provided by the template
- thing clone  -> create a thing from an existing thing. name parameter of the new thing is mandatory

thing templates have been aligned with general iot cloud templates concept
now templates like this: https://github.com/bcmi-labs/cloud-templates/blob/main/templates/home-security-alarm/resources/thing.yml
can be directly used to create new things.

* Replace Properties with Variables

* Update readme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants