summaryrefslogtreecommitdiff
path: root/src/session.mli
blob: 8e5805d617a3351927ebe3d452a0e180590a09d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
type cfg_op =
    | CfgSet of string list * string option * Vyos1x.Config_tree.value_behaviour
    | CfgDelete of string list * string option

type world = {
    mutable running_config: Vyos1x.Config_tree.t;
    mutable reference_tree: Vyos1x.Reference_tree.t;
    vyconf_config: Vyconf_config.t;
    dirs: Directories.t
}

type session_data = {
    proposed_config : Vyos1x.Config_tree.t;
    modified: bool;
    conf_mode: bool;
    changeset: cfg_op list;
    client_app: string;
    user: string;
    client_pid: int32
}

exception Session_error of string

val make : world -> string -> string -> int32 -> session_data

val set_modified : session_data -> session_data

val apply_changes : cfg_op list -> Vyos1x.Config_tree.t -> Vyos1x.Config_tree.t

val validate : world -> session_data -> string list -> unit

val set : world -> session_data -> string list -> session_data

val delete : world -> session_data -> string list -> session_data

val discard : world -> session_data -> session_data

val session_changed : world -> session_data -> bool

val load : world -> session_data -> string -> session_data

val save : world -> session_data -> string -> session_data

val get_value : world -> session_data -> string list -> string

val get_values : world -> session_data -> string list -> string list

val exists : world -> session_data -> string list -> bool

val list_children : world -> session_data -> string list -> string list

val string_of_op : cfg_op -> string

val prepare_commit : ?dry_run:bool -> world -> session_data -> string -> Commitd_client.Commit.commit_data

val get_config : world -> session_data -> string -> string

val cleanup_config : world -> string -> unit

val show_config : world -> session_data -> string list -> Vyconf_connect.Vyconf_pbt.request_config_format -> string