dbus-systemd 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +8 -0
- data/README.md +57 -8
- data/Rakefile +5 -3
- data/Vagrantfile +3 -3
- data/bin/console +3 -3
- data/dbus-systemd.gemspec +14 -13
- data/lib/dbus/systemd.rb +20 -0
- data/lib/dbus/systemd/helpers.rb +20 -0
- data/lib/dbus/systemd/hostnamed.rb +22 -2
- data/lib/dbus/systemd/importd.rb +20 -0
- data/lib/dbus/systemd/importd/manager.rb +24 -4
- data/lib/dbus/systemd/importd/transfer.rb +22 -2
- data/lib/dbus/systemd/job.rb +22 -2
- data/lib/dbus/systemd/localed.rb +22 -2
- data/lib/dbus/systemd/logind.rb +20 -0
- data/lib/dbus/systemd/logind/manager.rb +27 -7
- data/lib/dbus/systemd/logind/seat.rb +22 -2
- data/lib/dbus/systemd/logind/session.rb +22 -2
- data/lib/dbus/systemd/logind/user.rb +22 -2
- data/lib/dbus/systemd/machined.rb +20 -0
- data/lib/dbus/systemd/machined/image.rb +22 -2
- data/lib/dbus/systemd/machined/machine.rb +22 -2
- data/lib/dbus/systemd/machined/manager.rb +25 -5
- data/lib/dbus/systemd/manager.rb +25 -5
- data/lib/dbus/systemd/mixin.rb +20 -0
- data/lib/dbus/systemd/networkd.rb +20 -0
- data/lib/dbus/systemd/networkd/link.rb +22 -2
- data/lib/dbus/systemd/networkd/manager.rb +23 -3
- data/lib/dbus/systemd/resolved.rb +20 -0
- data/lib/dbus/systemd/resolved/link.rb +22 -2
- data/lib/dbus/systemd/resolved/manager.rb +23 -3
- data/lib/dbus/systemd/timedated.rb +22 -2
- data/lib/dbus/systemd/unit.rb +22 -2
- data/lib/dbus/systemd/unit/automount.rb +26 -4
- data/lib/dbus/systemd/unit/device.rb +26 -4
- data/lib/dbus/systemd/unit/mount.rb +26 -4
- data/lib/dbus/systemd/unit/path.rb +26 -4
- data/lib/dbus/systemd/unit/scope.rb +26 -4
- data/lib/dbus/systemd/unit/service.rb +26 -4
- data/lib/dbus/systemd/unit/slice.rb +26 -4
- data/lib/dbus/systemd/unit/snapshot.rb +26 -4
- data/lib/dbus/systemd/unit/socket.rb +26 -4
- data/lib/dbus/systemd/unit/swap.rb +26 -4
- data/lib/dbus/systemd/unit/target.rb +26 -4
- data/lib/dbus/systemd/unit/timer.rb +26 -4
- data/lib/dbus/systemd/version.rb +21 -1
- metadata +21 -6
data/lib/dbus/systemd/localed.rb
CHANGED
@@ -1,4 +1,24 @@
|
|
1
1
|
#
|
2
|
+
# Copyright (C) 2016 Nathan Williams <nath.e.will@gmail.com>
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
5
|
+
# this software and associated documentation files (the "Software"), to deal in
|
6
|
+
# the Software without restriction, including without limitation the rights to
|
7
|
+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
8
|
+
# the Software, and to permit persons to whom the Software is furnished to do so,
|
9
|
+
# subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
16
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
17
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
18
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
19
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
#
|
21
|
+
#
|
2
22
|
# See docs for full API description:
|
3
23
|
# https://www.freedesktop.org/wiki/Software/systemd/localed/
|
4
24
|
#
|
@@ -8,8 +28,8 @@ require_relative 'mixin'
|
|
8
28
|
module DBus
|
9
29
|
module Systemd
|
10
30
|
class Localed
|
11
|
-
NODE = '/org/freedesktop/locale1'
|
12
|
-
INTERFACE = 'org.freedesktop.locale1'
|
31
|
+
NODE = '/org/freedesktop/locale1'.freeze
|
32
|
+
INTERFACE = 'org.freedesktop.locale1'.freeze
|
13
33
|
|
14
34
|
include Mixin::MethodMissing
|
15
35
|
include Mixin::Properties
|
data/lib/dbus/systemd/logind.rb
CHANGED
@@ -1,4 +1,24 @@
|
|
1
1
|
#
|
2
|
+
# Copyright (C) 2016 Nathan Williams <nath.e.will@gmail.com>
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
5
|
+
# this software and associated documentation files (the "Software"), to deal in
|
6
|
+
# the Software without restriction, including without limitation the rights to
|
7
|
+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
8
|
+
# the Software, and to permit persons to whom the Software is furnished to do so,
|
9
|
+
# subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
16
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
17
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
18
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
19
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
#
|
21
|
+
#
|
2
22
|
# See docs for full API description:
|
3
23
|
# https://www.freedesktop.org/wiki/Software/systemd/logind/
|
4
24
|
#
|
@@ -1,3 +1,23 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2016 Nathan Williams <nath.e.will@gmail.com>
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
5
|
+
# this software and associated documentation files (the "Software"), to deal in
|
6
|
+
# the Software without restriction, including without limitation the rights to
|
7
|
+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
8
|
+
# the Software, and to permit persons to whom the Software is furnished to do so,
|
9
|
+
# subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
16
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
17
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
18
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
19
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
#
|
1
21
|
require_relative '../helpers'
|
2
22
|
require_relative '../mixin'
|
3
23
|
require_relative 'session'
|
@@ -7,11 +27,11 @@ require_relative 'seat'
|
|
7
27
|
module DBus
|
8
28
|
module Systemd
|
9
29
|
module Logind
|
10
|
-
INTERFACE = 'org.freedesktop.login1'
|
30
|
+
INTERFACE = 'org.freedesktop.login1'.freeze
|
11
31
|
|
12
32
|
class Manager
|
13
|
-
NODE = '/org/freedesktop/login1'
|
14
|
-
INTERFACE = 'org.freedesktop.login1.Manager'
|
33
|
+
NODE = '/org/freedesktop/login1'.freeze
|
34
|
+
INTERFACE = 'org.freedesktop.login1.Manager'.freeze
|
15
35
|
|
16
36
|
SESSION_INDICES = {
|
17
37
|
id: 0,
|
@@ -19,18 +39,18 @@ module DBus
|
|
19
39
|
user_name: 2,
|
20
40
|
seat_id: 3,
|
21
41
|
object_path: 4
|
22
|
-
}
|
42
|
+
}.freeze
|
23
43
|
|
24
44
|
USER_INDICES = {
|
25
45
|
id: 0,
|
26
46
|
name: 1,
|
27
47
|
object_path: 2
|
28
|
-
}
|
48
|
+
}.freeze
|
29
49
|
|
30
50
|
SEAT_INDICES = {
|
31
51
|
id: 0,
|
32
52
|
object_path: 1
|
33
|
-
}
|
53
|
+
}.freeze
|
34
54
|
|
35
55
|
INHIBITOR_INDICES = {
|
36
56
|
what: 0,
|
@@ -39,7 +59,7 @@ module DBus
|
|
39
59
|
mode: 3,
|
40
60
|
user_id: 4,
|
41
61
|
process_id: 5
|
42
|
-
}
|
62
|
+
}.freeze
|
43
63
|
|
44
64
|
include Systemd::Mixin::MethodMissing
|
45
65
|
include Systemd::Mixin::Properties
|
@@ -1,3 +1,23 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2016 Nathan Williams <nath.e.will@gmail.com>
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
5
|
+
# this software and associated documentation files (the "Software"), to deal in
|
6
|
+
# the Software without restriction, including without limitation the rights to
|
7
|
+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
8
|
+
# the Software, and to permit persons to whom the Software is furnished to do so,
|
9
|
+
# subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
16
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
17
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
18
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
19
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
#
|
1
21
|
require_relative '../mixin'
|
2
22
|
require_relative 'manager'
|
3
23
|
|
@@ -5,7 +25,7 @@ module DBus
|
|
5
25
|
module Systemd
|
6
26
|
module Logind
|
7
27
|
class Seat
|
8
|
-
INTERFACE = 'org.freedesktop.login1.Seat'
|
28
|
+
INTERFACE = 'org.freedesktop.login1.Seat'.freeze
|
9
29
|
|
10
30
|
include Systemd::Mixin::MethodMissing
|
11
31
|
include Systemd::Mixin::Properties
|
@@ -13,7 +33,7 @@ module DBus
|
|
13
33
|
def initialize(id, manager = Manager.new)
|
14
34
|
seat_path = manager.GetSeat(id).first
|
15
35
|
@object = manager.service.object(seat_path)
|
16
|
-
|
36
|
+
.tap(&:introspect)
|
17
37
|
end
|
18
38
|
end
|
19
39
|
end
|
@@ -1,3 +1,23 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2016 Nathan Williams <nath.e.will@gmail.com>
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
5
|
+
# this software and associated documentation files (the "Software"), to deal in
|
6
|
+
# the Software without restriction, including without limitation the rights to
|
7
|
+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
8
|
+
# the Software, and to permit persons to whom the Software is furnished to do so,
|
9
|
+
# subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
16
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
17
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
18
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
19
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
#
|
1
21
|
require_relative '../mixin'
|
2
22
|
require_relative 'manager'
|
3
23
|
|
@@ -5,7 +25,7 @@ module DBus
|
|
5
25
|
module Systemd
|
6
26
|
module Logind
|
7
27
|
class Session
|
8
|
-
INTERFACE = 'org.freedesktop.login1.Session'
|
28
|
+
INTERFACE = 'org.freedesktop.login1.Session'.freeze
|
9
29
|
|
10
30
|
include Systemd::Mixin::MethodMissing
|
11
31
|
include Systemd::Mixin::Properties
|
@@ -13,7 +33,7 @@ module DBus
|
|
13
33
|
def initialize(id, manager = Manager.new)
|
14
34
|
session_path = manager.GetSession(id).first
|
15
35
|
@object = manager.service.object(session_path)
|
16
|
-
|
36
|
+
.tap(&:introspect)
|
17
37
|
end
|
18
38
|
end
|
19
39
|
end
|
@@ -1,3 +1,23 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2016 Nathan Williams <nath.e.will@gmail.com>
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
5
|
+
# this software and associated documentation files (the "Software"), to deal in
|
6
|
+
# the Software without restriction, including without limitation the rights to
|
7
|
+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
8
|
+
# the Software, and to permit persons to whom the Software is furnished to do so,
|
9
|
+
# subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
16
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
17
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
18
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
19
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
#
|
1
21
|
require_relative '../mixin'
|
2
22
|
require_relative 'manager'
|
3
23
|
|
@@ -5,7 +25,7 @@ module DBus
|
|
5
25
|
module Systemd
|
6
26
|
module Logind
|
7
27
|
class User
|
8
|
-
INTERFACE = 'org.freedesktop.login1.User'
|
28
|
+
INTERFACE = 'org.freedesktop.login1.User'.freeze
|
9
29
|
|
10
30
|
include Systemd::Mixin::MethodMissing
|
11
31
|
include Systemd::Mixin::Properties
|
@@ -13,7 +33,7 @@ module DBus
|
|
13
33
|
def initialize(id, manager = Manager.new)
|
14
34
|
user_path = manager.GetUser(id).first
|
15
35
|
@object = manager.service.object(user_path)
|
16
|
-
|
36
|
+
.tap(&:introspect)
|
17
37
|
end
|
18
38
|
end
|
19
39
|
end
|
@@ -1,4 +1,24 @@
|
|
1
1
|
#
|
2
|
+
# Copyright (C) 2016 Nathan Williams <nath.e.will@gmail.com>
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
5
|
+
# this software and associated documentation files (the "Software"), to deal in
|
6
|
+
# the Software without restriction, including without limitation the rights to
|
7
|
+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
8
|
+
# the Software, and to permit persons to whom the Software is furnished to do so,
|
9
|
+
# subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
16
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
17
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
18
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
19
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
#
|
21
|
+
#
|
2
22
|
# See docs for full API description:
|
3
23
|
# https://www.freedesktop.org/wiki/Software/systemd/machined/
|
4
24
|
#
|
@@ -1,3 +1,23 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2016 Nathan Williams <nath.e.will@gmail.com>
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
5
|
+
# this software and associated documentation files (the "Software"), to deal in
|
6
|
+
# the Software without restriction, including without limitation the rights to
|
7
|
+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
8
|
+
# the Software, and to permit persons to whom the Software is furnished to do so,
|
9
|
+
# subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
16
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
17
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
18
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
19
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
#
|
1
21
|
require_relative '../mixin'
|
2
22
|
require_relative 'manager'
|
3
23
|
|
@@ -5,7 +25,7 @@ module DBus
|
|
5
25
|
module Systemd
|
6
26
|
module Machined
|
7
27
|
class Image
|
8
|
-
INTERFACE = 'org.freedesktop.machine1.Image'
|
28
|
+
INTERFACE = 'org.freedesktop.machine1.Image'.freeze
|
9
29
|
|
10
30
|
include Systemd::Mixin::MethodMissing
|
11
31
|
include Systemd::Mixin::Properties
|
@@ -13,7 +33,7 @@ module DBus
|
|
13
33
|
def initialize(name, manager = Manager.new)
|
14
34
|
image_path = manager.GetImage(name).first
|
15
35
|
@object = manager.service.object(image_path)
|
16
|
-
|
36
|
+
.tap(&:introspect)
|
17
37
|
end
|
18
38
|
end
|
19
39
|
end
|
@@ -1,3 +1,23 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2016 Nathan Williams <nath.e.will@gmail.com>
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
5
|
+
# this software and associated documentation files (the "Software"), to deal in
|
6
|
+
# the Software without restriction, including without limitation the rights to
|
7
|
+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
8
|
+
# the Software, and to permit persons to whom the Software is furnished to do so,
|
9
|
+
# subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
16
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
17
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
18
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
19
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
#
|
1
21
|
require_relative '../mixin'
|
2
22
|
require_relative 'manager'
|
3
23
|
|
@@ -5,7 +25,7 @@ module DBus
|
|
5
25
|
module Systemd
|
6
26
|
module Machined
|
7
27
|
class Machine
|
8
|
-
INTERFACE = 'org.freedesktop.machine1.Machine'
|
28
|
+
INTERFACE = 'org.freedesktop.machine1.Machine'.freeze
|
9
29
|
|
10
30
|
include Systemd::Mixin::MethodMissing
|
11
31
|
include Systemd::Mixin::Properties
|
@@ -13,7 +33,7 @@ module DBus
|
|
13
33
|
def initialize(name, manager = Manager.new)
|
14
34
|
machine_path = manager.GetMachine(name).first
|
15
35
|
@object = manager.service.object(machine_path)
|
16
|
-
|
36
|
+
.tap(&:introspect)
|
17
37
|
end
|
18
38
|
end
|
19
39
|
end
|
@@ -1,3 +1,23 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2016 Nathan Williams <nath.e.will@gmail.com>
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
5
|
+
# this software and associated documentation files (the "Software"), to deal in
|
6
|
+
# the Software without restriction, including without limitation the rights to
|
7
|
+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
8
|
+
# the Software, and to permit persons to whom the Software is furnished to do so,
|
9
|
+
# subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
16
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
17
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
18
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
19
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
#
|
1
21
|
require_relative '../helpers'
|
2
22
|
require_relative '../mixin'
|
3
23
|
require_relative 'machine'
|
@@ -6,18 +26,18 @@ require_relative 'image'
|
|
6
26
|
module DBus
|
7
27
|
module Systemd
|
8
28
|
module Machined
|
9
|
-
INTERFACE = 'org.freedesktop.machine1'
|
29
|
+
INTERFACE = 'org.freedesktop.machine1'.freeze
|
10
30
|
|
11
31
|
class Manager
|
12
|
-
NODE = '/org/freedesktop/machine1'
|
13
|
-
INTERFACE = 'org.freedesktop.machine1.Manager'
|
32
|
+
NODE = '/org/freedesktop/machine1'.freeze
|
33
|
+
INTERFACE = 'org.freedesktop.machine1.Manager'.freeze
|
14
34
|
|
15
35
|
MACHINE_INDICES = {
|
16
36
|
name: 0,
|
17
37
|
class: 1,
|
18
38
|
service_id: 2,
|
19
39
|
object_path: 3
|
20
|
-
}
|
40
|
+
}.freeze
|
21
41
|
|
22
42
|
IMAGE_INDICES = {
|
23
43
|
name: 0,
|
@@ -27,7 +47,7 @@ module DBus
|
|
27
47
|
modification_time: 4,
|
28
48
|
disk_space: 5,
|
29
49
|
object_path: 6
|
30
|
-
}
|
50
|
+
}.freeze
|
31
51
|
|
32
52
|
include Systemd::Mixin::MethodMissing
|
33
53
|
include Systemd::Mixin::Properties
|
data/lib/dbus/systemd/manager.rb
CHANGED
@@ -1,4 +1,24 @@
|
|
1
1
|
#
|
2
|
+
# Copyright (C) 2016 Nathan Williams <nath.e.will@gmail.com>
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
5
|
+
# this software and associated documentation files (the "Software"), to deal in
|
6
|
+
# the Software without restriction, including without limitation the rights to
|
7
|
+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
8
|
+
# the Software, and to permit persons to whom the Software is furnished to do so,
|
9
|
+
# subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
16
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
17
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
18
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
19
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
#
|
21
|
+
#
|
2
22
|
# See docs for full API description:
|
3
23
|
# https://www.freedesktop.org/wiki/Software/systemd/dbus/
|
4
24
|
#
|
@@ -9,11 +29,11 @@ require_relative 'job'
|
|
9
29
|
|
10
30
|
module DBus
|
11
31
|
module Systemd
|
12
|
-
INTERFACE = 'org.freedesktop.systemd1'
|
32
|
+
INTERFACE = 'org.freedesktop.systemd1'.freeze
|
13
33
|
|
14
34
|
class Manager
|
15
|
-
NODE = '/org/freedesktop/systemd1'
|
16
|
-
INTERFACE = 'org.freedesktop.systemd1.Manager'
|
35
|
+
NODE = '/org/freedesktop/systemd1'.freeze
|
36
|
+
INTERFACE = 'org.freedesktop.systemd1.Manager'.freeze
|
17
37
|
|
18
38
|
UNIT_INDICES = {
|
19
39
|
name: 0,
|
@@ -26,7 +46,7 @@ module DBus
|
|
26
46
|
job_id: 7,
|
27
47
|
job_type: 8,
|
28
48
|
job_object_path: 9
|
29
|
-
}
|
49
|
+
}.freeze
|
30
50
|
|
31
51
|
JOB_INDICES = {
|
32
52
|
id: 0,
|
@@ -35,7 +55,7 @@ module DBus
|
|
35
55
|
state: 3,
|
36
56
|
object_path: 4,
|
37
57
|
unit_object_path: 5
|
38
|
-
}
|
58
|
+
}.freeze
|
39
59
|
|
40
60
|
include Mixin::MethodMissing
|
41
61
|
include Mixin::Properties
|