blob: 69b4df6c6ea75776aeeea52c3a6a2cf578e0dc42 [file] [log] [blame]
Tomáš Peckaba2dc312021-01-23 22:29:11 +01001/*
2 * Copyright (C) 2020 CESNET, https://photonics.cesnet.cz/
3 *
4 * Written by Tomáš Pecka <tomas.pecka@fit.cvut.cz>
5 *
6 */
7
8#pragma once
9
10#include <sysrepo-cpp/Session.hpp>
11#include <string>
12
13namespace velia::utils {
14
Tomáš Pecka53f08ee2021-04-28 12:38:11 +020015struct YANGPair {
16 std::string m_xpath;
17 std::string m_value;
18
19 YANGPair(std::string xpath, std::string value);
20};
21
22void valuesToYang(const std::vector<YANGPair>& values, const std::vector<std::string>& removePaths, std::shared_ptr<::sysrepo::Session> session, std::shared_ptr<libyang::Data_Node>& parent);
Tomáš Pecka498e91c2021-03-02 17:46:47 +010023void valuesToYang(const std::map<std::string, std::string>& values, const std::vector<std::string>& removePaths, std::shared_ptr<::sysrepo::Session> session, std::shared_ptr<libyang::Data_Node>& parent);
Tomáš Pecka53f08ee2021-04-28 12:38:11 +020024
Tomáš Pecka498e91c2021-03-02 17:46:47 +010025void valuesPush(const std::map<std::string, std::string>& values, const std::vector<std::string>& removePaths, std::shared_ptr<::sysrepo::Session> session);
Tomáš Pecka53f08ee2021-04-28 12:38:11 +020026void valuesPush(const std::vector<YANGPair>& values, const std::vector<std::string>& removePaths, std::shared_ptr<::sysrepo::Session> session);
Tomáš Pecka498e91c2021-03-02 17:46:47 +010027void valuesPush(const std::map<std::string, std::string>& values, const std::vector<std::string>& removePaths, std::shared_ptr<::sysrepo::Session> session, sr_datastore_t datastore);
Tomáš Pecka53f08ee2021-04-28 12:38:11 +020028void valuesPush(const std::vector<YANGPair>& values, const std::vector<std::string>& removePaths, std::shared_ptr<::sysrepo::Session> session, sr_datastore_t datastore);
29
Tomáš Peckaba2dc312021-01-23 22:29:11 +010030void initLogsSysrepo();
Václav Kubernát6fa7f342021-01-26 17:00:01 +010031void ensureModuleImplemented(std::shared_ptr<::sysrepo::Session> session, const std::string& module, const std::string& revision);
Tomáš Peckaba2dc312021-01-23 22:29:11 +010032
33}