Skip to content

Commit 9b7ea15

Browse files
committed
DiscoveryCommand, Snmp: use local client
1 parent 345f566 commit 9b7ea15

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

application/clicommands/DiscoveryCommand.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ public function runAction(): void
6161
if (! $rule) {
6262
$this->fail('There is no such rule: ' . $ruleName);
6363
}
64+
65+
// TODO: We might want to trigger only the affected node
66+
$localClient = (new IMEdgeClient());
67+
$localClient->request('inventory.shipConfigForLocalFeatures');
68+
$localClient->request('inventory.shipConfigForConnectedPeers');
69+
6470
$client = (new IMEdgeClient())->withTarget($this->getDataNodeUuid()->toString());
6571
$client->request('inventory.shipConfigForLocalFeatures');
6672
$client->request('inventory.shipConfigForConnectedPeers');

application/controllers/SnmpController.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,11 @@ public function deviceAction(): void
150150
try {
151151
$nodeUuid = $form->getDatanodeUuid();
152152
$deviceUuid = $form->getUuid();
153+
$localClient = (new IMEdgeClient());
153154
$client = (new IMEdgeClient())->withTarget($nodeUuid->toString());
154-
// TODO: also remote
155-
await($client->request('inventory.shipConfigForLocalFeatures'), Loop::get());
156-
await($client->request('inventory.shipConfigForConnectedPeers'), Loop::get());
155+
// TODO: We might want to trigger only the affected node
156+
await($localClient->request('inventory.shipConfigForLocalFeatures'), Loop::get());
157+
await($localClient->request('inventory.shipConfigForConnectedPeers'), Loop::get());
157158
await($client->request('snmp.triggerScenario', [
158159
'deviceUuid' => $deviceUuid,
159160
'name' => 'sysInfo',

0 commit comments

Comments
 (0)