sysrepo  1.4.70
YANG datastore
Session Class Reference

Class for wrapping sr_session_ctx_t. More...

#include <Session.hpp>

Public Member Functions

 Session (S_Connection conn, sr_datastore_t datastore=(sr_datastore_t) DS_RUNNING)
 
 Session (sr_session_ctx_t *sess, S_Deleter deleter=nullptr)
 
void session_stop ()
 
void session_switch_ds (sr_datastore_t ds)
 
sr_datastore_t session_get_ds ()
 
void session_notif_buffer ()
 
S_Errors get_error ()
 
void set_error (const char *message, const char *path)
 
uint32_t get_id ()
 
void set_nc_id (uint32_t nc_id)
 
uint32_t get_nc_id ()
 
void set_user (const char *user)
 
const char * get_user ()
 
libyang::S_Context get_context ()
 
S_Val get_item (const char *path, uint32_t timeout_ms=0)
 
S_Vals get_items (const char *xpath, uint32_t timeout_ms=0, const sr_get_oper_options_t opts=OPER_DEFAULT)
 
libyang::S_Data_Node get_subtree (const char *path, uint32_t timeout_ms=0)
 
libyang::S_Data_Node get_data (const char *xpath, uint32_t max_depth=0, uint32_t timeout_ms=0, const sr_get_oper_options_t opts=OPER_DEFAULT)
 
void set_item (const char *path, S_Val value=nullptr, const sr_edit_options_t opts=EDIT_DEFAULT)
 
void set_item_str (const char *path, const char *value, const char *origin=nullptr, const sr_edit_options_t opts=EDIT_DEFAULT)
 
void delete_item (const char *path, const sr_edit_options_t opts=EDIT_DEFAULT)
 
void move_item (const char *path, const sr_move_position_t position, const char *list_keys=nullptr, const char *leaflist_value=nullptr, const char *origin=nullptr, const sr_edit_options_t opts=EDIT_DEFAULT)
 
void edit_batch (const libyang::S_Data_Node edit, const char *default_operation)
 
void validate (const char *module_name=nullptr, uint32_t timeout_ms=0)
 
void apply_changes (uint32_t timeout_ms=0, int wait=0)
 
void discard_changes ()
 
void replace_config (const libyang::S_Data_Node src_config, const char *module_name=nullptr, uint32_t timeout_ms=0, int wait=0)
 
void copy_config (sr_datastore_t src_datastore, const char *module_name=nullptr, uint32_t timeout_ms=0, int wait=0)
 
void lock (const char *module_name=nullptr)
 
void unlock (const char *module_name=nullptr)
 
S_Iter_Change get_changes_iter (const char *xpath)
 
S_Iter_Change dup_changes_iter (const char *xpath)
 
S_Change get_change_next (S_Iter_Change iter)
 
S_Tree_Change get_change_tree_next (S_Iter_Change iter)
 
 ~Session ()
 
S_Vals rpc_send (const char *path, S_Vals input, uint32_t timeout_ms=0)
 
libyang::S_Data_Node rpc_send (libyang::S_Data_Node input, uint32_t timeout_ms=0)
 
void event_notif_send (const char *path, S_Vals values)
 
void event_notif_send (libyang::S_Data_Node notif)
 

Friends

class Subscribe
 

Detailed Description

Class for wrapping sr_session_ctx_t.

Definition at line 52 of file Session.hpp.

Constructor & Destructor Documentation

◆ Session() [1/2]

Session ( S_Connection  conn,
sr_datastore_t  datastore = (sr_datastore_t) DS_RUNNING 
)

Wrapper for sr_session_start

◆ Session() [2/2]

Session ( sr_session_ctx_t sess,
S_Deleter  deleter = nullptr 
)

Wrapper for sr_session_ctx_t, for internal use only.

◆ ~Session()

~Session ( )

Member Function Documentation

◆ session_stop()

void session_stop ( )

Wrapper for sr_session_stop

◆ session_switch_ds()

void session_switch_ds ( sr_datastore_t  ds)

Wrapper for sr_session_switch_ds

◆ session_get_ds()

sr_datastore_t session_get_ds ( )

Wrapper for sr_session_get_ds

◆ session_notif_buffer()

void session_notif_buffer ( )

◆ get_error()

S_Errors get_error ( )

Wrapper for sr_get_error

◆ set_error()

void set_error ( const char *  message,
const char *  path 
)

Wrapper for sr_set_error

◆ get_id()

uint32_t get_id ( )

Wrapper for sr_session_get_id

◆ set_nc_id()

void set_nc_id ( uint32_t  nc_id)

Wrapper for sr_session_set_nc_id

◆ get_nc_id()

uint32_t get_nc_id ( )

Wrapper for sr_session_get_nc_id

◆ set_user()

void set_user ( const char *  user)

Wrapper for sr_session_set_user

◆ get_user()

const char* get_user ( )

Wrapper for sr_session_get_user

◆ get_context()

libyang::S_Context get_context ( )

Get libyang context directly from a session.

◆ get_item()

S_Val get_item ( const char *  path,
uint32_t  timeout_ms = 0 
)

Wrapper for sr_get_item

◆ get_items()

S_Vals get_items ( const char *  xpath,
uint32_t  timeout_ms = 0,
const sr_get_oper_options_t  opts = OPER_DEFAULT 
)

Wrapper for sr_get_items

◆ get_subtree()

libyang::S_Data_Node get_subtree ( const char *  path,
uint32_t  timeout_ms = 0 
)

Wrapper for sr_get_subtree

◆ get_data()

libyang::S_Data_Node get_data ( const char *  xpath,
uint32_t  max_depth = 0,
uint32_t  timeout_ms = 0,
const sr_get_oper_options_t  opts = OPER_DEFAULT 
)

Wrapper for sr_get_data

◆ set_item()

void set_item ( const char *  path,
S_Val  value = nullptr,
const sr_edit_options_t  opts = EDIT_DEFAULT 
)

Wrapper for sr_set_item

◆ set_item_str()

void set_item_str ( const char *  path,
const char *  value,
const char *  origin = nullptr,
const sr_edit_options_t  opts = EDIT_DEFAULT 
)

Wrapper for sr_set_item_str

◆ delete_item()

void delete_item ( const char *  path,
const sr_edit_options_t  opts = EDIT_DEFAULT 
)

Wrapper for sr_delete_item

◆ move_item()

void move_item ( const char *  path,
const sr_move_position_t  position,
const char *  list_keys = nullptr,
const char *  leaflist_value = nullptr,
const char *  origin = nullptr,
const sr_edit_options_t  opts = EDIT_DEFAULT 
)

Wrapper for sr_move_item

◆ edit_batch()

void edit_batch ( const libyang::S_Data_Node  edit,
const char *  default_operation 
)

Wrapper for sr_edit_batch

◆ validate()

void validate ( const char *  module_name = nullptr,
uint32_t  timeout_ms = 0 
)

Wrapper for sr_validate

◆ apply_changes()

void apply_changes ( uint32_t  timeout_ms = 0,
int  wait = 0 
)

Wrapper for sr_apply_changes

◆ discard_changes()

void discard_changes ( )

Wrapper for sr_discard_changes

◆ replace_config()

void replace_config ( const libyang::S_Data_Node  src_config,
const char *  module_name = nullptr,
uint32_t  timeout_ms = 0,
int  wait = 0 
)

Wrapper for sr_replace_config

◆ copy_config()

void copy_config ( sr_datastore_t  src_datastore,
const char *  module_name = nullptr,
uint32_t  timeout_ms = 0,
int  wait = 0 
)

Wrapper for sr_copy_config

◆ lock()

void lock ( const char *  module_name = nullptr)

Wrapper for sr_lock

◆ unlock()

void unlock ( const char *  module_name = nullptr)

Wrapper for sr_unlock

◆ get_changes_iter()

S_Iter_Change get_changes_iter ( const char *  xpath)

Wrapper for sr_get_changes_iter

◆ dup_changes_iter()

S_Iter_Change dup_changes_iter ( const char *  xpath)

Wrapper for sr_dup_changes_iter

◆ get_change_next()

S_Change get_change_next ( S_Iter_Change  iter)

Wrapper for sr_get_change_next

◆ get_change_tree_next()

S_Tree_Change get_change_tree_next ( S_Iter_Change  iter)

◆ rpc_send() [1/2]

S_Vals rpc_send ( const char *  path,
S_Vals  input,
uint32_t  timeout_ms = 0 
)

Wrapper for sr_rpc_send

◆ rpc_send() [2/2]

libyang::S_Data_Node rpc_send ( libyang::S_Data_Node  input,
uint32_t  timeout_ms = 0 
)

Wrapper for sr_rpc_send_tree

◆ event_notif_send() [1/2]

void event_notif_send ( const char *  path,
S_Vals  values 
)

Wrapper for sr_event_notif_send

◆ event_notif_send() [2/2]

void event_notif_send ( libyang::S_Data_Node  notif)

Friends And Related Function Documentation

◆ Subscribe

friend class Subscribe
friend

Definition at line 144 of file Session.hpp.


The documentation for this class was generated from the following file: