-
Notifications
You must be signed in to change notification settings - Fork 66
feat: support c8y device availability feature #2940
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
rina23q
merged 18 commits into
thin-edge:main
from
rina23q:feature/2862/support-c8y-device-availability-version-2
Jul 4, 2024
Merged
feat: support c8y device availability feature #2940
rina23q
merged 18 commits into
thin-edge:main
from
rina23q:feature/2862/support-c8y-device-availability-version-2
Jul 4, 2024
Conversation
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
albinsuresh
reviewed
Jun 17, 2024
I'll add user guide tomorrow. Since the code and tests are ready for review, I would change the status to open. |
gligorisaev
reviewed
Jun 19, 2024
tests/RobotFramework/tests/cumulocity/availability/c8y_required_availability.robot
Outdated
Show resolved
Hide resolved
tests/RobotFramework/tests/cumulocity/availability/heartbeat.robot
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is in a good shape. Some points can still be improved, though.
crates/common/tedge_config/src/tedge_config_cli/tedge_config.rs
Outdated
Show resolved
Hide resolved
Robot Results
Failed Tests
|
c68e00a
to
ac55af8
Compare
albinsuresh
reviewed
Jun 21, 2024
crates/common/tedge_config/src/tedge_config_cli/tedge_config.rs
Outdated
Show resolved
Hide resolved
Add is_default_service() to EntityTopicId Add health endpoint /status/health to ChannelFilter Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
…nfig Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
If c8y.availability.enable is set to true, tedge-mapper-c8y publishes a SmartREST '117' message to set c8y_RequiredAvailability fragment for both main and child devices. If c8y.availability.enable is set to true AND c8y.availability.period is set to value > 0, tedge-mapper-c8y sends an empty inventory update message periodically. For the main device, the heartbeat timer starts during initialization. When the timer fires, the health status of tedge-agent is checked. If it is up, the heartbeat message will be sent. For child devices, the heartbeat timer starts when the entity is registered to the entity store. By default, like the main device case, the heartbeat message will be sent when tedge-agent for the child device is up. However, if `at_health` (EntityTopicId) is set to its metadata, tedge-mapper-c8y looks up the status of the leadService. Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com> Signed-off-by: Reuben Miller <reuben.d.miller@gmail.com>
Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
* Move all 117 related struct to c8y_api crate * `at_health` accepts any valid EntityTopicId * Heartbeat signal is sent in the half time of the interval from c8y.availability.interval (e.g. congig = 60m, heartbeat interval = 30m) Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com> Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
…d Have Fragment Values` Signed-off-by: Reuben Miller <reuben.d.miller@gmail.com>
Signed-off-by: Reuben Miller <reuben.d.miller@gmail.com>
Signed-off-by: Reuben Miller <reuben.d.miller@gmail.com>
* Improve logging messages and avoid multiple timer creation * Fix tedge-mapper-c8y shutdown issue when availability feature is disabled Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
…tion disabled Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
Signed-off-by: Didier Wenzek <didier.wenzek@free.fr>
Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
3b6ead8
to
d55b5a2
Compare
18 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Proposed changes
This PR is the replacement of the PR #2866.
Now
@health
is limited toEntityTopicId
scheme, the 4-segments identifier.If user wants to monitor a custom service, they need to provide
@health
in the registration message payload like below.Then, the status of
te/any/four/segments/topic/status/health
will be respected.Todo:
Types of changes
Paste Link to the issue
#2842
Checklist
cargo fmt
as mentioned in CODING_GUIDELINEScargo clippy
as mentioned in CODING_GUIDELINESFurther comments