VARLINKCTL(1) | varlinkctl | VARLINKCTL(1) |
varlinkctl - Introspect with and invoke Varlink services
varlinkctl [OPTIONS...] info ADDRESS
varlinkctl [OPTIONS...] list-interfaces ADDRESS
varlinkctl [OPTIONS...] introspect ADDRESS INTERFACE
varlinkctl [OPTIONS...] call ADDRESS METHOD [PARAMETERS]
varlinkctl [OPTIONS...] validate-idl [FILE]
varlinkctl may be used to introspect and invoke Varlink[1] services.
Services are referenced by one of the following:
For convenience these two simpler (redundant) service address syntaxes are also supported:
The following commands are understood:
info ADDRESS
Added in version 255.
list-interfaces ADDRESS
Added in version 255.
introspect ADDRESS INTERFACE
Added in version 255.
call ADDRESS METHOD [ARGUMENTS]
The reply parameters are written as JSON object to STDOUT.
Added in version 255.
validate-idl [FILE]
Added in version 255.
help
Added in version 255.
The following options are understood:
--more
If this mode is enabled output is automatically switched to JSON-SEQ mode, so that individual reply objects can be easily discerned.
Added in version 255.
--oneway
Added in version 255.
--json=MODE
Added in version 255.
-j
Added in version 255.
--no-pager
-h, --help
--version
Example 1. Investigating a Service
The following three commands inspect the "io.systemd.Resolve" service implemented by systemd-resolved.service(8), listing general service information and implemented interfaces, and then displaying the interface definition of its primary interface:
$ varlinkctl info /run/systemd/resolve/io.systemd.Resolve Vendor: The systemd Project Product: systemd (systemd-resolved) Version: 254 (254-1522-g4790521^) URL: https://systemd.io/ Interfaces: io.systemd io.systemd.Resolve org.varlink.service $ varlinkctl list-interfaces /run/systemd/resolve/io.systemd.Resolve io.systemd io.systemd.Resolve org.varlink.service $ varlinkctl introspect /run/systemd/resolve/io.systemd.Resolve io.systemd.Resolve interface io.systemd.Resolve type ResolvedAddress( ifindex: ?int, ...
(Interface definition has been truncated in the example above, in the interest of brevity.)
Example 2. Invoking a Method
The following command resolves a hostname via systemd-resolved.service(8)'s ResolveHostname method call.
$ varlinkctl call /run/systemd/resolve/io.systemd.Resolve io.systemd.Resolve.ResolveHostname '{"name":"systemd.io","family":2}' -j { "addresses" : [ { "ifindex" : 2, "family" : 2, "address" : [ 185, 199, 111, 153 ] } ], "name" : "systemd.io", "flags" : 1048577 }
Example 3. Investigating a Service Executable
The following command inspects the /usr/lib/systemd/systemd-pcrextend executable and the IPC APIs it provides. It then invokes a method on it:
# varlinkctl info /usr/lib/systemd/systemd-pcrextend Vendor: The systemd Project Product: systemd (systemd-pcrextend) Version: 254 (254-1536-g97734fb) URL: https://systemd.io/ Interfaces: io.systemd io.systemd.PCRExtend org.varlink.service # varlinkctl introspect /usr/lib/systemd/systemd-pcrextend io.systemd.PCRExtend interface io.systemd.PCRExtend method Extend( pcr: int, text: ?string, data: ?string ) -> () # varlinkctl call /usr/lib/systemd/systemd-pcrextend io.systemd.PCRExtend.Extend '{"pcr":15,"text":"foobar"}' {}
busctl(1), Varlink[1]
systemd 255 |