]>
Commit | Line | Data |
---|---|---|
a7334b09 LP |
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 | ||
501c7d0b LP |
20 | using DBus; |
21 | ||
22 | [DBus (name = "org.freedesktop.systemd1")] | |
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 | ObjectPath unit_path; | |
31 | uint32 job_id; | |
32 | string job_type; | |
33 | ObjectPath job_path; | |
34 | } | |
35 | ||
36 | public struct JobInfo { | |
37 | uint32 id; | |
38 | string name; | |
39 | string type; | |
40 | string state; | |
41 | ObjectPath job_path; | |
42 | ObjectPath unit_path; | |
43 | } | |
44 | ||
45 | public abstract UnitInfo[] list_units() throws DBus.Error; | |
46 | public abstract JobInfo[] list_jobs() throws DBus.Error; | |
47 | ||
48 | public abstract ObjectPath get_unit(string name) throws DBus.Error; | |
49 | public abstract ObjectPath load_unit(string name) throws DBus.Error; | |
50 | public abstract ObjectPath get_job(uint32 id) throws DBus.Error; | |
51 | ||
52 | public abstract void clear_jobs() throws DBus.Error; | |
c1e1601e LP |
53 | |
54 | public abstract void subscribe() throws DBus.Error; | |
55 | public abstract void unsubscribe() throws DBus.Error; | |
56 | ||
b152adec LP |
57 | public abstract string dump() throws DBus.Error; |
58 | ||
c1e1601e LP |
59 | public abstract signal void unit_new(string id, ObjectPath path); |
60 | public abstract signal void unit_removed(string id, ObjectPath path); | |
61 | public abstract signal void job_new(uint32 id, ObjectPath path); | |
62 | public abstract signal void job_removed(uint32 id, ObjectPath path); | |
501c7d0b LP |
63 | } |
64 | ||
65 | [DBus (name = "org.freedesktop.systemd1.Unit")] | |
66 | public interface Unit : DBus.Object { | |
c1e1601e LP |
67 | public struct JobLink { |
68 | uint32 id; | |
69 | ObjectPath path; | |
70 | } | |
71 | ||
501c7d0b LP |
72 | public abstract string id { owned get; } |
73 | public abstract string description { owned get; } | |
74 | public abstract string load_state { owned get; } | |
75 | public abstract string active_state { owned get; } | |
6be1e7d5 | 76 | public abstract string fragment_path { owned get; } |
501c7d0b LP |
77 | public abstract uint64 active_enter_timestamp { owned get; } |
78 | public abstract uint64 active_exit_timestamp { owned get; } | |
79 | public abstract bool can_reload { owned get; } | |
80 | public abstract bool can_start { owned get; } | |
c1e1601e | 81 | public abstract JobLink job { owned get; /* FIXME: this setter is a temporary fix to make valac not segfault */ set; } |
501c7d0b LP |
82 | |
83 | public abstract ObjectPath start(string mode) throws DBus.Error; | |
84 | public abstract ObjectPath stop(string mode) throws DBus.Error; | |
85 | public abstract ObjectPath restart(string mode) throws DBus.Error; | |
86 | public abstract ObjectPath reload(string mode) throws DBus.Error; | |
c1e1601e LP |
87 | |
88 | public abstract signal void changed(); | |
501c7d0b LP |
89 | } |
90 | ||
91 | [DBus (name = "org.freedesktop.systemd1.Job")] | |
92 | public interface Job : DBus.Object { | |
c1e1601e LP |
93 | public struct UnitLink { |
94 | string id; | |
95 | ObjectPath path; | |
96 | } | |
97 | ||
501c7d0b LP |
98 | public abstract uint32 id { owned get; } |
99 | public abstract string state { owned get; } | |
100 | public abstract string job_type { owned get; } | |
c1e1601e | 101 | public abstract UnitLink unit { owned get; /* FIXME: this setter is a temporary fix to make valac not segfault */ set; } |
501c7d0b LP |
102 | |
103 | public abstract void cancel() throws DBus.Error; | |
c1e1601e LP |
104 | |
105 | public abstract signal void changed(); | |
501c7d0b | 106 | } |