chiark / gitweb /
systemadm; fix alignment of labels
[elogind.git] / systemd-interfaces.vala
1 /***
2   This file is part of systemd.
3
4   Copyright 2010 Lennart Poettering
5
6   systemd is free software; you can redistribute it and/or modify it
7   under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2 of the License, or
9   (at your option) any later version.
10
11   systemd is distributed in the hope that it will be useful, but
12   WITHOUT ANY WARRANTY; without even the implied warranty of
13   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14   General Public License for more details.
15
16   You should have received a copy of the GNU General Public License
17   along with systemd; If not, see <http://www.gnu.org/licenses/>.
18 ***/
19
20 using DBus;
21
22 [DBus (name = "org.freedesktop.systemd1.Manager")]
23 public interface Manager : DBus.Object {
24
25         public struct UnitInfo {
26                 string id;
27                 string description;
28                 string load_state;
29                 string active_state;
30                 string sub_state;
31                 ObjectPath unit_path;
32                 uint32 job_id;
33                 string job_type;
34                 ObjectPath job_path;
35         }
36
37         public struct JobInfo {
38                 uint32 id;
39                 string name;
40                 string type;
41                 string state;
42                 ObjectPath job_path;
43                 ObjectPath unit_path;
44         }
45
46         public abstract UnitInfo[] list_units() throws DBus.Error;
47         public abstract JobInfo[] list_jobs() throws DBus.Error;
48
49         public abstract ObjectPath get_unit(string name) throws DBus.Error;
50         public abstract ObjectPath load_unit(string name) throws DBus.Error;
51         public abstract ObjectPath get_job(uint32 id) throws DBus.Error;
52
53         public abstract void clear_jobs() throws DBus.Error;
54
55         public abstract void subscribe() throws DBus.Error;
56         public abstract void unsubscribe() throws DBus.Error;
57
58         public abstract string dump() throws DBus.Error;
59
60         public abstract void reload() throws DBus.Error;
61         public abstract void reexecute() throws DBus.Error;
62         public abstract void exit() throws DBus.Error;
63
64         public abstract ObjectPath create_snapshot(string name = "", bool cleanup = false) throws DBus.Error;
65
66         public abstract signal void unit_new(string id, ObjectPath path);
67         public abstract signal void unit_removed(string id, ObjectPath path);
68         public abstract signal void job_new(uint32 id, ObjectPath path);
69         public abstract signal void job_removed(uint32 id, ObjectPath path);
70 }
71
72 [DBus (name = "org.freedesktop.systemd1.Unit")]
73 public interface Unit : DBus.Object {
74         public struct JobLink {
75                 uint32 id;
76                 ObjectPath path;
77         }
78
79         public abstract string id { owned get; }
80         public abstract string[] names { owned get; }
81         public abstract string description { owned get; }
82         public abstract string load_state { owned get; }
83         public abstract string active_state { owned get; }
84         public abstract string sub_state { owned get; }
85         public abstract string fragment_path { owned get; }
86         public abstract uint64 active_enter_timestamp { owned get; }
87         public abstract uint64 active_exit_timestamp { owned get; }
88         public abstract bool can_start { owned get; }
89         public abstract bool can_reload { owned get; }
90         public abstract JobLink job { owned get; /* FIXME: this setter is a temporary fix to make valac not segfault */ set; }
91         public abstract bool recursive_stop { owned get; }
92         public abstract bool stop_when_unneeded { owned get; }
93         public abstract string default_control_group { owned get; }
94
95         public abstract ObjectPath start(string mode) throws DBus.Error;
96         public abstract ObjectPath stop(string mode) throws DBus.Error;
97         public abstract ObjectPath restart(string mode) throws DBus.Error;
98         public abstract ObjectPath reload(string mode) throws DBus.Error;
99
100         public abstract signal void changed();
101 }
102
103 [DBus (name = "org.freedesktop.systemd1.Job")]
104 public interface Job : DBus.Object {
105         public struct UnitLink {
106                 string id;
107                 ObjectPath path;
108         }
109
110         public abstract uint32 id { owned get; }
111         public abstract string state { owned get; }
112         public abstract string job_type { owned get; }
113         public abstract UnitLink unit { owned get; /* FIXME: this setter is a temporary fix to make valac not segfault */ set; }
114
115         public abstract void cancel() throws DBus.Error;
116
117         public abstract signal void changed();
118 }