runFormula method

Future<FormulaRunResult> runFormula(
  1. String id, {
  2. required String formula,
  3. required FormulaAction action,
  4. String? version,
})

Runs a formula action and waits for the answer.

Fine for verify; an install can outlive the Hub's request timeout, and a caller that waits for one is told a failure that did not happen. Use runFormulaAsync for those.

Implementation

Future<FormulaRunResult> runFormula(
  String id, {
  required String formula,
  required FormulaAction action,
  String? version,
}) async => FormulaRunResult.fromJson(
  await _object(
    await post('/nodes/$id/formula', {
      'formula': formula,
      'action': action.name,
      'version': ?version,
    }),
  ),
);