Skip to content

Commit

Permalink
Rename Manager -> Controller (#712)
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Kemel <mkemel@redhat.com>
  • Loading branch information
mkemel authored Jan 18, 2024
1 parent 13f022d commit f2cd879
Show file tree
Hide file tree
Showing 108 changed files with 1,251 additions and 1,231 deletions.
4 changes: 2 additions & 2 deletions README.developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ of installation for your setup.
/org/eclipse/bluechi

NAME TYPE SIGNATURE RESULT/VALUE FLAGS
org.eclipse.bluechi.Manager interface - - -
org.eclipse.bluechi.Controller interface - - -
.CreateMonitor method - o -
.DisableMetrics method - - -
.EnableMetrics method - - -
Expand Down Expand Up @@ -100,7 +100,7 @@ org.freedesktop.DBus.Properties interface - - -
```bash
export SERVICE="org.eclipse.bluechi"
export OBJECT="/org/eclipse/bluechi"
export INTERFACE="org.eclipse.bluechi.Manager"
export INTERFACE="org.eclipse.bluechi.Controller"
export METHOD="ListNodes"

# busctl call \
Expand Down
2 changes: 1 addition & 1 deletion bluechi.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ This package contains the controller service.
%license LICENSE
%{_libexecdir}/bluechi-controller
%{_datadir}/dbus-1/interfaces/org.eclipse.bluechi.Job.xml
%{_datadir}/dbus-1/interfaces/org.eclipse.bluechi.Manager.xml
%{_datadir}/dbus-1/interfaces/org.eclipse.bluechi.Controller.xml
%{_datadir}/dbus-1/interfaces/org.eclipse.bluechi.Monitor.xml
%{_datadir}/dbus-1/interfaces/org.eclipse.bluechi.Node.xml
%{_datadir}/dbus-1/system.d/org.eclipse.bluechi.conf
Expand Down
4 changes: 2 additions & 2 deletions config/agent/agent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
#NodeName=

#
# The IP address that bluechi-agent can use to connect to bluechi manager. It must be a valid IPv4 or IPv6 address.
# The IP address that bluechi-agent can use to connect to bluechi-controller. It must be a valid IPv4 or IPv6 address.
# One of the ControllerHost or ControllerAddress options must be set for each bluechi-agent.
#ControllerHost=

#
# The port the manager listens on to establish connections with the bluechi agents.
# The port the controller listens on to establish connections with the bluechi agents.
#ControllerPort=842

#
Expand Down
6 changes: 3 additions & 3 deletions config/controller/controller.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
[bluechi-controller]

#
# A comma separated list of unique bluechi-agent names. Only nodes with names mentioned in the list can connect to bluechi
# manager. These names are defined in the agent's configuration file under the `NodeName` option.
# A comma separated list of unique bluechi-agent names. Only nodes with names mentioned in the list can connect to
# bluechi-controller. These names are defined in the agent's configuration file under the `NodeName` option.
# (see `bluechi-agent.conf(5)`).
# Note: The maximum line length is 500 characters. If the list exceeds this, use multiple, indented lines.
#AllowedNodeNames=

#
# The port the manager listens on to establish connections with the bluechi agents.
# The port the controller listens on to establish connections with the bluechi agents.
#ControllerPort=842

#
Expand Down
2 changes: 1 addition & 1 deletion data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
install_data(
[
'org.eclipse.bluechi.Job.xml',
'org.eclipse.bluechi.Manager.xml',
'org.eclipse.bluechi.Controller.xml',
'org.eclipse.bluechi.Monitor.xml',
'org.eclipse.bluechi.Node.xml',
'org.eclipse.bluechi.Agent.xml'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<node>

<!--
org.eclipse.bluechi.Manager:
org.eclipse.bluechi.Controller:
@short_description: Public interface of BlueChi on the managing node providing methods and signals for all nodes.
This interface can be used to get information about all nodes and their units, create monitors and listen for job signals.
-->
<interface name="org.eclipse.bluechi.Manager">
<interface name="org.eclipse.bluechi.Controller">

<!--
ListUnits:
Expand Down Expand Up @@ -84,7 +84,7 @@
SetLogLevel:
@loglevel: The new loglevel to use.
Change the loglevel of the manager.
Change the loglevel of the controller.
-->
<method name="SetLogLevel">
<arg name="loglevel" type="s" direction="in" />
Expand Down
2 changes: 1 addition & 1 deletion data/org.eclipse.bluechi.Metrics.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
org.eclipse.bluechi.Metrics:
@short_description: Public interface of BlueChi on the managing node providing signals for performance metrics.
This interface is only available if the metrics have been enabled before via the Manager interface.
This interface is only available if the metrics have been enabled before via the Controller interface.
-->
<interface name="org.eclipse.bluechi.Metrics">

Expand Down
2 changes: 1 addition & 1 deletion data/org.eclipse.bluechi.Monitor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
org.eclipse.bluechi.Monitor:
@short_description: Public interface of BlueChi on the managing node providing monitoring functionality.
This interface is only available if a monitor has been created before via the Manager interface.
This interface is only available if a monitor has been created before via the Controller interface.
It provides methods to subscribe to changes in systemd units on managed nodes as well as signals for those changes.
-->
<interface name="org.eclipse.bluechi.Monitor">
Expand Down
4 changes: 2 additions & 2 deletions data/org.eclipse.bluechi.Node.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
fails if mode is fail.
The job returned is an object path for an object implementing org.eclipse.bluechi.Job, and which be monitored for the progress of the job, or used
to cancel the job. To track the result of the job, follow the JobRemoved signal on the Manager.
to cancel the job. To track the result of the job, follow the JobRemoved signal on the Controller.
-->
<method name="StartUnit">
<arg name="name" type="s" direction="in" />
Expand Down Expand Up @@ -205,7 +205,7 @@
SetLogLevel:
@loglevel: The new loglevel to use.
Change the loglevel of the manager.
Change the loglevel of the controller.
-->
<method name="SetLogLevel">
<arg name="level" type="s" direction="in" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
<node>
<interface name="org.eclipse.bluechi.internal.Manager">
<interface name="org.eclipse.bluechi.internal.Controller">
<method name="Register">
<arg name="name" type="s" direction="in" />
</method>
Expand Down
2 changes: 1 addition & 1 deletion doc/api-examples/c/list-nodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ int main() {
bus,
"org.eclipse.bluechi",
"/org/eclipse/bluechi",
"org.eclipse.bluechi.Manager",
"org.eclipse.bluechi.Controller",
"ListNodes",
&error,
&result,
Expand Down
2 changes: 1 addition & 1 deletion doc/api-examples/c/start-unit.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ static int get_node_path(sd_bus *bus, char *node_name, char **ret_node_path) {
bus,
"org.eclipse.bluechi",
"/org/eclipse/bluechi",
"org.eclipse.bluechi.Manager",
"org.eclipse.bluechi.Controller",
"GetNode",
&error,
&result,
Expand Down
2 changes: 1 addition & 1 deletion doc/api-examples/go/enable-unit.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
const (
BcDusInterface = "org.eclipse.bluechi"
BcObjectPath = "/org/eclipse/bluechi"
MethodGetNode = "org.eclipse.bluechi.Manager.GetNode"
MethodGetNode = "org.eclipse.bluechi.Controller.GetNode"
MethodEnableUnitFiles = "org.eclipse.bluechi.Node.EnableUnitFiles"
)

Expand Down
2 changes: 1 addition & 1 deletion doc/api-examples/go/get-cpuweight.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
const (
BcDusInterface = "org.eclipse.bluechi"
BcObjectPath = "/org/eclipse/bluechi"
MethodGetNode = "org.eclipse.bluechi.Manager.GetNode"
MethodGetNode = "org.eclipse.bluechi.Controller.GetNode"
MethodGetUnitProperty = "org.eclipse.bluechi.Node.GetUnitProperty"
)

Expand Down
2 changes: 1 addition & 1 deletion doc/api-examples/go/list-node-units.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
const (
BcDusInterface = "org.eclipse.bluechi"
BcObjectPath = "/org/eclipse/bluechi"
MethodGetNode = "org.eclipse.bluechi.Manager.GetNode"
MethodGetNode = "org.eclipse.bluechi.Controller.GetNode"
MethodListUnits = "org.eclipse.bluechi.Node.ListUnits"
)

Expand Down
2 changes: 1 addition & 1 deletion doc/api-examples/go/list-nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
const (
BcDusInterface = "org.eclipse.bluechi"
BcObjectPath = "/org/eclipse/bluechi"
MethodListNodes = "org.eclipse.bluechi.Manager.ListNodes"
MethodListNodes = "org.eclipse.bluechi.Controller.ListNodes"
)

func main() {
Expand Down
8 changes: 4 additions & 4 deletions doc/api-examples/go/monitor-system-status.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
)

const (
BcDusInterface = "org.eclipse.bluechi"
BcObjectPath = "/org/eclipse/bluechi"
BcManagerInterface = "org.eclipse.bluechi.Manager"
BcDusInterface = "org.eclipse.bluechi"
BcObjectPath = "/org/eclipse/bluechi"
BcControllerInterface = "org.eclipse.bluechi.Controller"
)

func main() {
Expand All @@ -34,7 +34,7 @@ func main() {
conn.Signal(c)
for v := range c {
ifaceName := v.Body[0]
if ifaceName == BcManagerInterface {
if ifaceName == BcControllerInterface {
changedValues, ok := v.Body[1].(map[string]dbus.Variant)
if !ok {
fmt.Println("Received invalid property changed signal")
Expand Down
2 changes: 1 addition & 1 deletion doc/api-examples/go/monitor-unit.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
const (
BcDusInterface = "org.eclipse.bluechi"
BcObjectPath = "/org/eclipse/bluechi"
MethodCreateMonitor = "org.eclipse.bluechi.Manager.CreateMonitor"
MethodCreateMonitor = "org.eclipse.bluechi.Controller.CreateMonitor"
MethodSubscribe = "org.eclipse.bluechi.Monitor.Subscribe"

SignalUnitNew = "UnitNew"
Expand Down
2 changes: 1 addition & 1 deletion doc/api-examples/go/set-cpuweight.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
const (
BcDusInterface = "org.eclipse.bluechi"
BcObjectPath = "/org/eclipse/bluechi"
MethodGetNode = "org.eclipse.bluechi.Manager.GetNode"
MethodGetNode = "org.eclipse.bluechi.Controller.GetNode"
MethodSetUnitProperties = "org.eclipse.bluechi.Node.SetUnitProperties"
)

Expand Down
2 changes: 1 addition & 1 deletion doc/api-examples/go/start-unit.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
const (
BcDusInterface = "org.eclipse.bluechi"
BcObjectPath = "/org/eclipse/bluechi"
MethodGetNode = "org.eclipse.bluechi.Manager.GetNode"
MethodGetNode = "org.eclipse.bluechi.Controller.GetNode"
MethodStartUnit = "org.eclipse.bluechi.Node.StartUnit"
)

Expand Down
4 changes: 2 additions & 2 deletions doc/api-examples/python/enable-unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

node_name = sys.argv[1]

manager = bus.get_proxy("org.eclipse.bluechi", "/org/eclipse/bluechi")
node_path = manager.GetNode(node_name)
controller = bus.get_proxy("org.eclipse.bluechi", "/org/eclipse/bluechi")
node_path = controller.GetNode(node_name)
node = bus.get_proxy("org.eclipse.bluechi", node_path)

response = node.EnableUnitFiles(sys.argv[2:], False, False)
Expand Down
4 changes: 2 additions & 2 deletions doc/api-examples/python/get-cpuweight.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
node_name = sys.argv[1]
unit_name = sys.argv[2]

manager = bus.get_proxy("org.eclipse.bluechi", "/org/eclipse/bluechi")
node_path = manager.GetNode(node_name)
controller = bus.get_proxy("org.eclipse.bluechi", "/org/eclipse/bluechi")
node_path = controller.GetNode(node_name)
node = bus.get_proxy("org.eclipse.bluechi", node_path)

value = node.GetUnitProperty(unit_name, "org.freedesktop.systemd1.Service", "CPUWeight")
Expand Down
4 changes: 2 additions & 2 deletions doc/api-examples/python/get-unit-properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
node_name = sys.argv[1]
unit_name = sys.argv[2]

manager = bus.get_proxy("org.eclipse.bluechi", "/org/eclipse/bluechi")
node_path = manager.GetNode(node_name)
controller = bus.get_proxy("org.eclipse.bluechi", "/org/eclipse/bluechi")
node_path = controller.GetNode(node_name)
node = bus.get_proxy("org.eclipse.bluechi", node_path)

properties = node.GetUnitProperties(unit_name, "org.freedesktop.systemd1.Unit")
Expand Down
4 changes: 2 additions & 2 deletions doc/api-examples/python/get-unit-property.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
iface_name = sys.argv[3]
property_name = sys.argv[4]

manager = bus.get_proxy("org.eclipse.bluechi", "/org/eclipse/bluechi")
node_path = manager.GetNode(node_name)
controller = bus.get_proxy("org.eclipse.bluechi", "/org/eclipse/bluechi")
node_path = controller.GetNode(node_name)
node = bus.get_proxy("org.eclipse.bluechi", node_path)

val = node.GetUnitProperty(unit_name, iface_name, property_name)
Expand Down
4 changes: 2 additions & 2 deletions doc/api-examples/python/list-active-services.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"description", "load_state", "active_state", "sub_state", "follower",
"object_path", "job_id", "job_type", "job_object_path"])

manager = bus.get_proxy("org.eclipse.bluechi", "/org/eclipse/bluechi")
units = manager.ListUnits()
controller = bus.get_proxy("org.eclipse.bluechi", "/org/eclipse/bluechi")
units = controller.ListUnits()
for u in units:
info = NodeUnitInfo(*u)
if info.active_state == "active" and info.name.endswith(".service"):
Expand Down
4 changes: 2 additions & 2 deletions doc/api-examples/python/list-node-units.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

node_name = sys.argv[1]

manager = bus.get_proxy("org.eclipse.bluechi", "/org/eclipse/bluechi")
node_path = manager.GetNode(node_name)
controller = bus.get_proxy("org.eclipse.bluechi", "/org/eclipse/bluechi")
node_path = controller.GetNode(node_name)
node = bus.get_proxy("org.eclipse.bluechi", node_path)

units = node.ListUnits()
Expand Down
4 changes: 2 additions & 2 deletions doc/api-examples/python/list-nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

NodeInfo = namedtuple("NodeInfo", ["name", "object_path", "status"])

manager = bus.get_proxy("org.eclipse.bluechi", "/org/eclipse/bluechi")
nodes = manager.ListNodes()
controller = bus.get_proxy("org.eclipse.bluechi", "/org/eclipse/bluechi")
nodes = controller.ListNodes()
for n in nodes:
info = NodeInfo(*n)
print(f"Node: {info.name}, State: {info.status}")
4 changes: 2 additions & 2 deletions doc/api-examples/python/monitor-node-connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
loop = EventLoop()
bus = dasbus.connection.SystemMessageBus()

manager = bus.get_proxy("org.eclipse.bluechi", "/org/eclipse/bluechi")
nodes = manager.ListNodes()
controller = bus.get_proxy("org.eclipse.bluechi", "/org/eclipse/bluechi")
nodes = controller.ListNodes()
cached_nodes = []
for n in nodes:
# node: [name, path, status]
Expand Down
4 changes: 2 additions & 2 deletions doc/api-examples/python/monitor-unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ def print_dict_changes(old, new):

bus = dasbus.connection.SystemMessageBus()

manager = bus.get_proxy("org.eclipse.bluechi", "/org/eclipse/bluechi")
controller = bus.get_proxy("org.eclipse.bluechi", "/org/eclipse/bluechi")

monitor_path = manager.CreateMonitor()
monitor_path = controller.CreateMonitor()
monitor = bus.get_proxy("org.eclipse.bluechi", monitor_path)

old_values = {}
Expand Down
4 changes: 2 additions & 2 deletions doc/api-examples/python/set-cpuweight.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
# Don't persist change
runtime = True

manager = bus.get_proxy("org.eclipse.bluechi", "/org/eclipse/bluechi")
node_path = manager.GetNode(node_name)
controller = bus.get_proxy("org.eclipse.bluechi", "/org/eclipse/bluechi")
node_path = controller.GetNode(node_name)
node = bus.get_proxy("org.eclipse.bluechi", node_path)

node.SetUnitProperties(unit_name, runtime, [("CPUWeight", Variant("t", value))])
4 changes: 2 additions & 2 deletions doc/api-examples/python/start-unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
node_name = sys.argv[1]
unit_name = sys.argv[2]

manager = bus.get_proxy("org.eclipse.bluechi", "/org/eclipse/bluechi")
node_path = manager.GetNode(node_name)
controller = bus.get_proxy("org.eclipse.bluechi", "/org/eclipse/bluechi")
node_path = controller.GetNode(node_name)
node = bus.get_proxy("org.eclipse.bluechi", node_path)

my_job_path = node.StartUnit(unit_name, "replace")
Expand Down
2 changes: 1 addition & 1 deletion doc/api-examples/rust/enable-unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
);

let (node,): (Path,) =
bluechi.method_call("org.eclipse.bluechi.Manager", "GetNode", (args.node_name,))?;
bluechi.method_call("org.eclipse.bluechi.Controller", "GetNode", (args.node_name,))?;

let node_proxy = conn.with_proxy("org.eclipse.bluechi", node, Duration::from_millis(5000));

Expand Down
2 changes: 1 addition & 1 deletion doc/api-examples/rust/get-cpuweight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
);

let (node,): (Path,) =
bluechi.method_call("org.eclipse.bluechi.Manager", "GetNode", (args.node_name,))?;
bluechi.method_call("org.eclipse.bluechi.Controller", "GetNode", (args.node_name,))?;

let node_proxy = conn.with_proxy("org.eclipse.bluechi", node, Duration::from_millis(5000));

Expand Down
2 changes: 1 addition & 1 deletion doc/api-examples/rust/list-node-units.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
);

let (node,): (Path,) =
bluechi.method_call("org.eclipse.bluechi.Manager", "GetNode", (args.node_name,))?;
bluechi.method_call("org.eclipse.bluechi.Controller", "GetNode", (args.node_name,))?;

let node_proxy = conn.with_proxy("org.eclipse.bluechi", node, Duration::from_millis(5000));

Expand Down
2 changes: 1 addition & 1 deletion doc/api-examples/rust/list-nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
);

let (nodes,): (Vec<(String, dbus::Path, String)>,) =
bluechi.method_call("org.eclipse.bluechi.Manager", "ListNodes", ())?;
bluechi.method_call("org.eclipse.bluechi.Controller", "ListNodes", ())?;

for (name, _, status) in nodes {
println!("Node: {}, Status: {}", name, status);
Expand Down
Loading

0 comments on commit f2cd879

Please sign in to comment.