summaryrefslogtreecommitdiffstats
path: root/crates/core/tedge_mapper/src/sm_c8y_mapper
AgeCommit message (Collapse)Author
2022-02-18Move module to subdirectories and adjust useLukasz Woznicki
Signed-off-by: Lukasz Woznicki <lukasz.woznicki@softwareag.com>
2022-02-17Merge pull request #856 from matthiasbeyer/clippy-fixes-c8y_smartrestMatthias Beyer
Clippy fixes for: c8y_smartrest
2022-02-15fixed session name buginitard
- renamed jwt token session - renamed file C8y_LogfileRequest to c8y_LogfileRequest - added cargo deb asset to create binary in /usr/bin/tedge_logfile_request_plugin - closing mqtt client connection in plugin Signed-off-by: initard <solo@softwareag.com>
2022-02-15moving implemenation specific code to plugin (#790)initard
- Moved mqtt client and http client to pluing main.rs - Removed empty test file and default cargo lib test - Moved log specific messages from topic.rs to plugin - Fixed mapper session name Signed-off-by: initard <solo@softwareag.com>
2022-02-15c8y_api lib, tedge config, mqtt/http utilities (#790)initard
Preparing the repo for the log request plugin. Restructuring folders, moving code out of sm_c8y_mapper and into c8y_api, c8y_smartrest or tedge_config. Signed-off-by: initard <solo@softwareag.com>
2022-02-14Use 'time' instead of 'chrono' due to CVE for thin_edge_json and all ↵Lukasz Woznicki
dependent crates [1/3] Use 'time' instead of 'chrono' due to CVE for thin_edge_json and all dependent crates [1/3]
2022-02-14Merge pull request #865 from matthiasbeyer/clippy-fixes-agent_interfaceMatthias Beyer
Clippy fixes for: agent_interface
2022-02-14Use 'time' instead of 'chrono' due to CVE for thin_edge_json and all ↵Lukasz Woznicki
dependent crates Signed-off-by: Lukasz Woznicki <lukasz.woznicki@softwareag.com>
2022-02-11Use 'time' instead of 'chrono' due to CVE for c8y_smartrest and all ↵Lukasz Woznicki
dependent crates Signed-off-by: Lukasz Woznicki <lukasz.woznicki@softwareag.com>
2022-02-11Replace new() constructor with Default implMatthias Beyer
This fixes clippy lint `clippy::new_without_default`. Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
2022-02-08Use `futures` channels instead of `tokio` channelsDidier Wenzek
The motivation is to ease testing with the `StreamExt` extension Signed-off-by: Didier Wenzek <didier.wenzek@free.fr>
2022-02-07Replace new() constructor with Default implMatthias Beyer
This fixes clippy lint `clippy::new_without_default`. Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
2022-02-07Replace new() constructor with Default implMatthias Beyer
This fixes clippy lint `clippy::new_without_default`. Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
2022-02-04[#735] Detect and reconcile alarms updated while mapper was down (#791)Albin Suresh
* [#735] Detect and reconcile cleared alarms while mapper was down on its restart * Rust integration test for C8Y mapper * Rust integration test for alarm syncing on startup * New publish apis in mqtt_test crate that supports retain flag and QoS * Refactor alarm conversion logic to dedicated AlarmConverter enum
2022-02-04[699] init/clear agent and mapper sessions (#797)PradeepKiruvale
* add init to tedge_agent * init mapper * init mapper and agent postinst * separate init and clear session functions * use tokio::mutex instead of std::mutex * pysys test for agent init * system test for mapper init session * use mqtt_channel init/clear session apis Co-authored-by: Pradeep Kumar K J <pradeepkumar.kj@sofwareag.com>
2022-01-19Refactoring the MQTT client API (#575)Didier Wenzek
* Basic data types for MQTT channels * Mqtt connection * Mqtt-channel: subscribe to topics * Mqtt-channel: publish messages Signed-off-by: Wenzek <diw@softwareag.com> * Mqtt-channel: an MQTT client as no direct dependency to MQTT Signed-off-by: Wenzek <diw@softwareag.com> * Mqtt-chanels: no message lost on reconnect Signed-off-by: Wenzek <diw@softwareag.com> * Cargo fmt Signed-off-by: Wenzek <diw@softwareag.com> * Merge with child device management * Remove the dependency to the `async-broadcast` and `async-channel` crates * Moving the helper functions to the `mqtt_tests` crate * Ensure an MQTT client can be tested without an MQTT broker * Removing dependency on the mqtt_client crate * Use the new `mqtt_channel` crate in the `sm-c8y` mapper This actually fixes the bug #570 * [570] Cargo fmt * Remove the dependency of the collectd mapper on the `mqtt_client` crate Signed-off-by: Wenzek <diw@softwareag.com> * Make configurable the maximum size of a message Signed-off-by: Didier Wenzek <didier.wenzek@free.fr> * Fix typo in comment Signed-off-by: Didier Wenzek <didier.wenzek@free.fr> * Use mqtt_channel instead of mqtt_client in tedge_agent Signed-off-by: Didier Wenzek <didier.wenzek@free.fr> * Improve doc comments Signed-off-by: Didier Wenzek <didier.wenzek@free.fr> * Add error case on closed channel Signed-off-by: Didier Wenzek <didier.wenzek@free.fr> * Add PubChannel & SubChannel traits Signed-off-by: Didier Wenzek <didier.wenzek@free.fr> * Cargo fmt Signed-off-by: Didier Wenzek <didier.wenzek@free.fr> * Revert erroneously added changes Signed-off-by: Didier Wenzek <didier.wenzek@free.fr> * Add a channel for errors Signed-off-by: Didier Wenzek <didier.wenzek@free.fr> * Log MQTT connection errors Signed-off-by: Didier Wenzek <didier.wenzek@free.fr> * Fix HTTP_proxy port Signed-off-by: Didier Wenzek <didier.wenzek@free.fr> * Remove unused code Signed-off-by: Didier Wenzek <didier.wenzek@free.fr> * Improve tests Signed-off-by: Didier Wenzek <didier.wenzek@free.fr> * Move session configuration from Connection to Config * Set max_packet_size default to 1M Signed-off-by: Didier Wenzek <didier.wenzek@free.fr> * Cargo fmt Signed-off-by: Didier Wenzek <didier.wenzek@free.fr> * Fix broken tests (on missing operation directory) Signed-off-by: Didier Wenzek <didier.wenzek@free.fr> Co-authored-by: Wenzek <diw@softwareag.com> Co-authored-by: Didier Wenzek <didier.wenzek@free.fr>
2022-01-19Operations execution from operations files. (#764)Lukasz Woznicki
* Add operations reading from operations file and execute when template called * Update docs * Update docs to list supported parameters Signed-off-by: Lukasz Woznicki <lukasz.woznicki@softwareag.com>
2022-01-11[663] agent topics (#731)PradeepKiruvale
* move topics to json_sm crate * rename json_sm to sm_interface * format * rename agent interface * fix order of crates * rename crate * rename topics enum * refactor downloader code * move topicerror to error.rs * trigger wf * cargo fmt * address review comments * separate c8y topics * add tests * cargo fmt * change match cases * use download from common crate * update test names * fix the match issue * fix the topic matching * address review comments * remove mqtt dependancy * simplify try_from Co-authored-by: Pradeep Kumar K J <pradeepkumar.kj@sofwareag.com>
2021-12-07#596 Declare supported operations (#652)Lukasz Woznicki
* Add operations to tedge_mapper * Add operations directory on install, remove supported ops from sm-c8y mapper * Update install command in postinst script to correctly create ops files Signed-off-by: Lukasz Woznicki <lukasz.woznicki@softwareag.com>
2021-12-06Refactor the sm_c8y mapper extracting http code (#659)Didier Wenzek
* Move out any HTTP related code from the MQTT mapper to an HTTP proxy * Update the tests * Simplify the jwt tests with a background generator * Reuse the reqwest client for all requests * Rename `JwtAuthHttpProxy` the main `C8yHttpProxy` implementation * Fix typo Co-authored-by: Wenzek <diw@softwareag.com>
2021-12-06Feature/599/restart device cloud operation (#662)initard
* cloud restart operation #599 Signed-off-by: initard <solo@softwareag.com> * operation set to executing c8y #599 Signed-off-by: initard <solo@softwareag.com> * cargo fmt Signed-off-by: initard <solo@softwareag.com> * removing debug hard-coded echo Signed-off-by: initard <solo@softwareag.com> * updated handle_restart_opeartion signature in test #599 Signed-off-by: initard <solo@softwareag.com> * test update for c8y_Restart Signed-off-by: initard <solo@softwareag.com> * removed panic on empty restart request #599 Signed-off-by: initard <solo@softwareag.com> Co-authored-by: initard <solo@softwareag.com>
2021-11-26[CIT-659] restart device local operation (#591)initard
* [CIT-659] operation status rename Signed-off-by: Alex <solo@softwareag.com> * [CIT-659] OperationStatus rename Signed-off-by: Alex <solo@softwareag.com> * [CIT-659] adding new structs to lib import Signed-off-by: Alex <solo@softwareag.com> * [CIT-659] restart operation implementation Signed-off-by: Alex <solo@softwareag.com> * [CIT-659] restart operation check (WIP) Signed-off-by: Alex <solo@softwareag.com> * [CIT-659] wip Signed-off-by: Alex <solo@softwareag.com> * [CIT-659] restart operation check when /run/tedge_agent_restart persists after operation Signed-off-by: Alex <solo@softwareag.com> * [CIT-659] stash merge Signed-off-by: initard <solo@softwareag.com> * [CIT-659] restart operation refactoring, - chrono dependency Signed-off-by: initard <solo@softwareag.com> * [CIT-659] removed package feature, made file creation more explicit Signed-off-by: initard <solo@softwareag.com> * [CIT-659] dealing with some unwraps and error handling Signed-off-by: initard <solo@softwareag.com> * [CIT-659] reverting changes to operation_logs + error handling Signed-off-by: initard <solo@softwareag.com> * [CIT-659] changed operation from echo 6 to init 6 Signed-off-by: initard <solo@softwareag.com> * [CIT-659] fixing restart check logic Signed-off-by: initard <solo@softwareag.com> * [CIT-659] refactored error handling and added unit test for /run/tedge_agent_restart Signed-off-by: initard <solo@softwareag.com> * [CIT-659] refactoring of tests Signed-off-by: initard <solo@softwareag.com> * [CIT-659] ignored failed test Signed-off-by: initard <solo@softwareag.com> Co-authored-by: Alex <solo@softwareag.com>
2021-11-26Fix #640: Fix url field formatting in c8y software list (#646)Albin Suresh
2021-11-24Restructure directories of the workspace (#559)Lukasz Woznicki
* Restructure directories of the workspace * Rename c8y_translator_lib to c8y_translator * Update comment on how to get dummy plugin path Signed-off-by: Lukasz Woznicki <lukasz.woznicki@softwareag.com>