dbus-systemd 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0d7cb7f2cc7465907d88f909e89cfab72fc2417
|
4
|
+
data.tar.gz: f883e6d2188cb5ccda2c5a995ac480a611afda26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 759886ec0c0824f88ded4061564ced21937a9dc090c8cc8c3069dfa5493e3d54bf1345a95d4472bf52c09ca36e0db8e3d6adf00df31c20e5fcc4fab4fe1febfc
|
7
|
+
data.tar.gz: 6d54949564d74a83c60cb9ee4d300d01fe1dbc8a0411740cc6b6463632affdf05f57eca30453fc92343aeeb31983be1cb01e1cfbdc37a1c33afc8df1f00a71d2
|
data/.rubocop.yml
ADDED
data/README.md
CHANGED
@@ -42,7 +42,7 @@ irb(main):004:0> h.Get(DBus::Systemd::Hostnamed::INTERFACE, 'Hostname').first
|
|
42
42
|
=> "derp.localdomain"
|
43
43
|
irb(main):005:0> h.SetHostname('my-hostname.localdomain', false)
|
44
44
|
=> []
|
45
|
-
irb(main):006:0> h.
|
45
|
+
irb(main):006:0> h.properties['Hostname']
|
46
46
|
=> "my-hostname.localdomain"
|
47
47
|
```
|
48
48
|
|
@@ -70,7 +70,7 @@ irb(main):009:0> l = DBus::Systemd::Localed.new
|
|
70
70
|
=> ...
|
71
71
|
irb(main):010:0> l.object.methods - Object.methods
|
72
72
|
=> [:Set, :Get, :GetAll, :Ping, :GetMachineId, :Introspect, :SetLocale, :SetVConsoleKeyboard, :SetX11Keyboard, :[], :[]=, :path, :destination, :bus, :introspect, :api, :subnodes, :introspected, :default_iface, :interfaces, :define_shortcut_methods, :has_iface?, :on_signal, :subnodes=, :introspected=, :default_iface=]
|
73
|
-
irb(main):011:0> l.
|
73
|
+
irb(main):011:0> l.properties
|
74
74
|
=> {"Locale"=>["LANG=en_US.UTF-8"], "X11Layout"=>"", "X11Model"=>"", "X11Variant"=>"", "X11Options"=>"", "VConsoleKeymap"=>"us", "VConsoleKeymapToggle"=>""}
|
75
75
|
```
|
76
76
|
|
@@ -91,7 +91,7 @@ irb(main):016:0> l.sessions
|
|
91
91
|
=> [{:id=>"3", :user_id=>1000, :user_name=>"vagrant", :seat_id=>"", :object_path=>"/org/freedesktop/login1/session/_33"}]
|
92
92
|
irb(main):017:0> u = l.user(1000)
|
93
93
|
=> ...
|
94
|
-
irb(main):019:0> u.
|
94
|
+
irb(main):019:0> u.properties
|
95
95
|
=> {"UID"=>1000, "GID"=>1000, "Name"=>"vagrant", "Timestamp"=>1475452037907590, "TimestampMonotonic"=>122159600, "RuntimePath"=>"/run/user/1000", "Service"=>"user@1000.service", "Slice"=>"user-1000.slice", "Display"=>["3", "/org/freedesktop/login1/session/_33"], "State"=>"active", "Sessions"=>[["3", "/org/freedesktop/login1/session/_33"]], "IdleHint"=>false, "IdleSinceHint"=>0, "IdleSinceHintMonotonic"=>0, "Linger"=>false}
|
96
96
|
```
|
97
97
|
|
@@ -108,22 +108,71 @@ irb(main):024:0> mm.machines
|
|
108
108
|
=> [{:name=>".host", :class=>"host", :service_id=>"", :object_path=>"/org/freedesktop/machine1/machine/_2ehost"}]
|
109
109
|
irb(main):023:0> mm.images
|
110
110
|
=> [{:name=>"Fedora-23", :type=>"raw", :read_only=>false, :creation_time=>1446171608000000, :modification_time=>1446171608000000, :disk_space=>589676544, :object_path=>"/org/freedesktop/machine1/image/Fedora_2d23"}, {:name=>".raw-https:\\x2f\\x2fdl\\x2efedoraproject\\x2eorg\\x2fpub\\x2ffedora\\x2flinux\\x2freleases\\x2f24\\x2fCloudImages\\x2fx86_64\\x2fimages\\x2fFedora-Cloud-Base-24-1\\x2e2\\x2ex86_64\\x2eraw\\x2exz.\\x227fef0a4-5353f9c7441a0\\x22", :type=>"raw", :read_only=>true, :creation_time=>1465922207000000, :modification_time=>1465922207000000, :disk_space=>540872704, :object_path=>"/org/freedesktop/machine1/image/_2eraw_2dhttps_3a_5cx2f_5cx2fdl_5cx2efedoraproject_5cx2eorg_5cx2fpub_5cx2ffedora_5cx2flinux_5cx2freleases_5cx2f24_5cx2fCloudImages_5cx2fx86_5f64_5cx2fimages_5cx2fFedora_2dCloud_2dBase_2d24_2d1_5cx2e2_5cx2ex86_5f64_5cx2eraw_5cx2exz_2e_5cx227fef0a4_2d5353f9c7441a0_5cx22"}, {:name=>".raw-https:\\x2f\\x2fdl\\x2efedoraproject\\x2eorg\\x2fpub\\x2ffedora\\x2flinux\\x2freleases\\x2f23\\x2fCloud\\x2fx86_64\\x2fImages\\x2fFedora-Cloud-Base-23-20151030\\x2ex86_64\\x2eraw\\x2exz.\\x229205894-5234910faa600\\x22", :type=>"raw", :read_only=>true, :creation_time=>1446171608000000, :modification_time=>1446171608000000, :disk_space=>589676544, :object_path=>"/org/freedesktop/machine1/image/_2eraw_2dhttps_3a_5cx2f_5cx2fdl_5cx2efedoraproject_5cx2eorg_5cx2fpub_5cx2ffedora_5cx2flinux_5cx2freleases_5cx2f23_5cx2fCloud_5cx2fx86_5f64_5cx2fImages_5cx2fFedora_2dCloud_2dBase_2d23_2d20151030_5cx2ex86_5f64_5cx2eraw_5cx2exz_2e_5cx229205894_2d5234910faa600_5cx22"}, {:name=>"Fedora-24", :type=>"raw", :read_only=>false, :creation_time=>1465922207000000, :modification_time=>1465922207000000, :disk_space=>540872704, :object_path=>"/org/freedesktop/machine1/image/Fedora_2d24"}, {:name=>"test", :type=>"raw", :read_only=>false, :creation_time=>1446171608000000, :modification_time=>1446171608000000, :disk_space=>589676544, :object_path=>"/org/freedesktop/machine1/image/test"}, {:name=>".host", :type=>"directory", :read_only=>false, :creation_time=>0, :modification_time=>0, :disk_space=>18446744073709551615, :object_path=>"/org/freedesktop/machine1/image/_2ehost"}]
|
111
|
-
irb(main):025:0> mm.
|
111
|
+
irb(main):025:0> mm.properties
|
112
112
|
=> {"PoolPath"=>"/var/lib/machines", "PoolUsage"=>1191448576, "PoolLimit"=>2105020416}
|
113
113
|
irb(main):026:0> mi = mm.image('Fedora-24')
|
114
114
|
=> ...
|
115
115
|
irb(main):027:0> mi.object.methods - Object.methods
|
116
116
|
=> [:Set, :Get, :GetAll, :Ping, :GetMachineId, :Introspect, :Remove, :Rename, :Clone, :MarkReadOnly, :SetLimit, :[], :[]=, :path, :destination, :bus, :introspect, :api, :subnodes, :introspected, :default_iface, :interfaces, :define_shortcut_methods, :has_iface?, :on_signal, :subnodes=, :introspected=, :default_iface=]
|
117
|
-
irb(main):028:0> mi.
|
117
|
+
irb(main):028:0> mi.properties
|
118
118
|
=> {"Name"=>"Fedora-24", "Path"=>"/var/lib/machines/Fedora-24.raw", "Type"=>"raw", "ReadOnly"=>false, "CreationTimestamp"=>1465922207000000, "ModificationTimestamp"=>1465922207000000, "Usage"=>540872704, "Limit"=>3221225472, "UsageExclusive"=>540872704, "LimitExclusive"=>3221225472}
|
119
119
|
irb(main):029:0> machine = mm.machine('.host')
|
120
120
|
=> ..
|
121
121
|
irb(main):030:0> machine.object.methods - Object.methods
|
122
122
|
=> [:Set, :Get, :GetAll, :Kill, :Ping, :GetMachineId, :Introspect, :Terminate, :GetAddresses, :GetOSRelease, :OpenPTY, :OpenLogin, :OpenShell, :BindMount, :CopyFrom, :CopyTo, :[], :[]=, :path, :destination, :bus, :introspect, :api, :subnodes, :introspected, :default_iface, :interfaces, :define_shortcut_methods, :has_iface?, :on_signal, :subnodes=, :introspected=, :default_iface=]
|
123
|
-
irb(main):032:0> machine.
|
123
|
+
irb(main):032:0> machine.properties
|
124
124
|
=> {"Name"=>".host", "Id"=>[77, 46, 68, 242, 105, 232, 78, 52, 157, 152, 76, 171, 175, 145, 140, 130], "Timestamp"=>1475451915747985, "TimestampMonotonic"=>0, "Service"=>"", "Unit"=>"-.slice", "Leader"=>1, "Class"=>"host", "RootDirectory"=>"/", "NetworkInterfaces"=>[], "State"=>"running"}
|
125
125
|
```
|
126
126
|
|
127
|
+
### DBus::Systemd::Networkd
|
128
|
+
|
129
|
+
There's not really documentation published for this, but some busctl work will show you what's available.
|
130
|
+
|
131
|
+
e.g....
|
132
|
+
|
133
|
+
```bash
|
134
|
+
[root@localhost vagrant]# busctl introspect org.freedesktop.network1 /org/freedesktop/network1
|
135
|
+
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
|
136
|
+
org.freedesktop.DBus.Introspectable interface - - -
|
137
|
+
.Introspect method - s -
|
138
|
+
org.freedesktop.DBus.Peer interface - - -
|
139
|
+
.GetMachineId method - s -
|
140
|
+
.Ping method - - -
|
141
|
+
org.freedesktop.DBus.Properties interface - - -
|
142
|
+
.Get method ss v -
|
143
|
+
.GetAll method s a{sv} -
|
144
|
+
.Set method ssv - -
|
145
|
+
.PropertiesChanged signal sa{sv}as - -
|
146
|
+
org.freedesktop.network1.Manager interface - - -
|
147
|
+
.OperationalState property s "routable" emits-change
|
148
|
+
[root@localhost vagrant]# busctl introspect org.freedesktop.network1 /org/freedesktop/network1/link/1
|
149
|
+
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
|
150
|
+
org.freedesktop.DBus.Introspectable interface - - -
|
151
|
+
.Introspect method - s -
|
152
|
+
org.freedesktop.DBus.Peer interface - - -
|
153
|
+
.GetMachineId method - s -
|
154
|
+
.Ping method - - -
|
155
|
+
org.freedesktop.DBus.Properties interface - - -
|
156
|
+
.Get method ss v -
|
157
|
+
.GetAll method s a{sv} -
|
158
|
+
.Set method ssv - -
|
159
|
+
.PropertiesChanged signal sa{sv}as - -
|
160
|
+
org.freedesktop.network1.Link interface - - -
|
161
|
+
.AdministrativeState property s "unmanaged" emits-change
|
162
|
+
.OperationalState property s "carrier" emits-change
|
163
|
+
```
|
164
|
+
|
165
|
+
```ruby
|
166
|
+
irb(main):003:0> nm = DBus::Systemd::Networkd::Manager.new
|
167
|
+
=> ...
|
168
|
+
irb(main):004:0> nm.properties
|
169
|
+
=> {"OperationalState"=>"routable"}
|
170
|
+
irb(main):003:0> l = nm.link(1)
|
171
|
+
=> ...
|
172
|
+
irb(main):004:0> l.properties
|
173
|
+
=> {"OperationalState"=>"carrier", "AdministrativeState"=>"unmanaged"}
|
174
|
+
```
|
175
|
+
|
127
176
|
### DBus::Systemd::Resolved
|
128
177
|
|
129
178
|
For full docs, see [official docs](https://www.freedesktop.org/wiki/Software/systemd/resolved/).
|
@@ -150,7 +199,7 @@ irb(main):030:0> t.GetAll(DBus::Systemd::Timedated::INTERFACE).first
|
|
150
199
|
=> {"Timezone"=>"UTC", "LocalRTC"=>true, "CanNTP"=>true, "NTP"=>false, "NTPSynchronized"=>true, "TimeUSec"=>1475454744352557, "RTCTimeUSec"=>1475454742000000}
|
151
200
|
irb(main):030:0> t.SetTimezone('America/Los_Angeles', false)
|
152
201
|
=> []
|
153
|
-
irb(main):030:0> t.
|
202
|
+
irb(main):030:0> t.properties['Timezone']
|
154
203
|
=> "America/Los_Angeles"
|
155
204
|
```
|
156
205
|
|
@@ -169,7 +218,7 @@ irb(main):036:0> mgr.Get(DBus::Systemd::Manager::INTERFACE, 'Version').first
|
|
169
218
|
=> "229"
|
170
219
|
irb(main):037:0> mgr.Get(DBus::Systemd::Manager::INTERFACE, 'UnitPath').first
|
171
220
|
=> ["/etc/systemd/system", "/run/systemd/system", "/run/systemd/generator", "/usr/local/lib/systemd/system", "/usr/lib/systemd/system", "/run/systemd/generator.late"]
|
172
|
-
irb(main):038:0> mgr.
|
221
|
+
irb(main):038:0> mgr.properties['NFailedUnits']
|
173
222
|
=> 0
|
174
223
|
```
|
175
224
|
|
data/Rakefile
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'rspec/core/rake_task'
|
3
|
+
require 'rubocop/rake_task'
|
3
4
|
|
5
|
+
RuboCop::RakeTask.new
|
4
6
|
RSpec::Core::RakeTask.new(:spec)
|
5
7
|
|
6
|
-
task :
|
8
|
+
task default: [:rubocop, :spec]
|
data/Vagrantfile
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
Vagrant.configure('2') do |config|
|
5
5
|
config.vm.box = 'bento/fedora-24'
|
6
|
-
config.vm.box_version = '2.2.9'
|
7
6
|
config.vm.box_check_update = true
|
8
7
|
|
9
|
-
config.vm.provision
|
10
|
-
dnf install -y git ruby
|
8
|
+
config.vm.provision 'shell', inline: <<-SHELL
|
9
|
+
dnf install -y git ruby systemd-container btrfs-progs
|
10
|
+
gem instal bundler --no-document
|
11
11
|
SHELL
|
12
12
|
end
|
data/bin/console
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'dbus/systemd'
|
5
5
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +10,5 @@ require "dbus/systemd"
|
|
10
10
|
# require "pry"
|
11
11
|
# Pry.start
|
12
12
|
|
13
|
-
require
|
13
|
+
require 'irb'
|
14
14
|
IRB.start
|
data/dbus-systemd.gemspec
CHANGED
@@ -4,32 +4,33 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'dbus/systemd/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'dbus-systemd'
|
8
8
|
spec.version = DBus::Systemd::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
9
|
+
spec.authors = ['Nathan Williams']
|
10
|
+
spec.email = ['nath.e.will@gmail.com']
|
11
11
|
|
12
12
|
spec.summary = 'systemd D-Bus API library'
|
13
13
|
spec.description = 'library for interfacing with systemd D-Bus APIs'
|
14
|
-
spec.homepage =
|
15
|
-
spec.license =
|
14
|
+
spec.homepage = 'https://github.com/nathwill/ruby-dbus-systemd'
|
15
|
+
spec.license = 'MIT'
|
16
16
|
|
17
17
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
18
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
19
|
if spec.respond_to?(:metadata)
|
20
|
-
spec.metadata['allowed_push_host'] =
|
20
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
21
21
|
else
|
22
|
-
raise
|
22
|
+
raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
|
23
23
|
end
|
24
24
|
|
25
25
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
26
|
-
spec.bindir =
|
26
|
+
spec.bindir = 'exe'
|
27
27
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
|
-
spec.require_paths = [
|
28
|
+
spec.require_paths = ['lib']
|
29
29
|
|
30
|
-
spec.add_runtime_dependency
|
30
|
+
spec.add_runtime_dependency 'ruby-dbus', '~> 0.13'
|
31
31
|
|
32
|
-
spec.add_development_dependency
|
33
|
-
spec.add_development_dependency
|
34
|
-
spec.add_development_dependency
|
32
|
+
spec.add_development_dependency 'bundler', '~> 1.12'
|
33
|
+
spec.add_development_dependency 'rake', '~> 10.5'
|
34
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
35
|
+
spec.add_development_dependency 'rubocop', '~> 0.43'
|
35
36
|
end
|
data/lib/dbus/systemd.rb
CHANGED
@@ -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 'systemd/helpers'
|
2
22
|
require_relative 'systemd/hostnamed'
|
3
23
|
require_relative 'systemd/importd'
|
data/lib/dbus/systemd/helpers.rb
CHANGED
@@ -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 'dbus'
|
2
22
|
|
3
23
|
module DBus
|
@@ -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/hostnamed/
|
4
24
|
#
|
@@ -8,8 +28,8 @@ require_relative 'mixin'
|
|
8
28
|
module DBus
|
9
29
|
module Systemd
|
10
30
|
class Hostnamed
|
11
|
-
NODE = '/org/freedesktop/hostname1'
|
12
|
-
INTERFACE = 'org.freedesktop.hostname1'
|
31
|
+
NODE = '/org/freedesktop/hostname1'.freeze
|
32
|
+
INTERFACE = 'org.freedesktop.hostname1'.freeze
|
13
33
|
|
14
34
|
include Mixin::MethodMissing
|
15
35
|
include Mixin::Properties
|
data/lib/dbus/systemd/importd.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/importd/
|
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 'transfer'
|
@@ -5,11 +25,11 @@ require_relative 'transfer'
|
|
5
25
|
module DBus
|
6
26
|
module Systemd
|
7
27
|
module Importd
|
8
|
-
INTERFACE = 'org.freedesktop.import1'
|
28
|
+
INTERFACE = 'org.freedesktop.import1'.freeze
|
9
29
|
|
10
30
|
class Manager
|
11
|
-
NODE = '/org/freedesktop/import1'
|
12
|
-
INTERFACE = 'org.freedesktop.import1.Manager'
|
31
|
+
NODE = '/org/freedesktop/import1'.freeze
|
32
|
+
INTERFACE = 'org.freedesktop.import1.Manager'.freeze
|
13
33
|
|
14
34
|
TRANSFER_INDICES = {
|
15
35
|
id: 0,
|
@@ -18,7 +38,7 @@ module DBus
|
|
18
38
|
image_name: 3,
|
19
39
|
progress: 4,
|
20
40
|
object_path: 5
|
21
|
-
}
|
41
|
+
}.freeze
|
22
42
|
|
23
43
|
include Systemd::Mixin::MethodMissing
|
24
44
|
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,14 +25,14 @@ module DBus
|
|
5
25
|
module Systemd
|
6
26
|
module Importd
|
7
27
|
class Transfer
|
8
|
-
INTERFACE = 'org.freedesktop.import1.Transfer'
|
28
|
+
INTERFACE = 'org.freedesktop.import1.Transfer'.freeze
|
9
29
|
|
10
30
|
include Systemd::Mixin::MethodMissing
|
11
31
|
include Systemd::Mixin::Properties
|
12
32
|
|
13
33
|
def initialize(id, manager = Manager.new)
|
14
34
|
@object = manager.service.object("#{Manager::NODE}/transfer/_#{id}")
|
15
|
-
|
35
|
+
.tap(&:introspect)
|
16
36
|
end
|
17
37
|
end
|
18
38
|
end
|
data/lib/dbus/systemd/job.rb
CHANGED
@@ -1,10 +1,30 @@
|
|
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 'manager'
|
2
22
|
require_relative 'mixin'
|
3
23
|
|
4
24
|
module DBus
|
5
25
|
module Systemd
|
6
26
|
class Job
|
7
|
-
INTERFACE = 'org.freedesktop.systemd1.Job'
|
27
|
+
INTERFACE = 'org.freedesktop.systemd1.Job'.freeze
|
8
28
|
|
9
29
|
include Mixin::MethodMissing
|
10
30
|
include Mixin::Properties
|
@@ -12,7 +32,7 @@ module DBus
|
|
12
32
|
def initialize(id, manager = Manager.new)
|
13
33
|
job_path = manager.GetJob(id).first
|
14
34
|
@object = manager.service.object(job_path)
|
15
|
-
|
35
|
+
.tap(&:introspect)
|
16
36
|
end
|
17
37
|
end
|
18
38
|
end
|