reconcile method

Future<ConvergeResult> reconcile(
  1. String id, {
  2. bool dryRun = false,
  3. bool purgeAdopted = false,
})

Makes id what it was declared to be, and waits.

Idempotent: a converged node has nothing outstanding, so this changes nothing the second time — which is what makes it safe on a timer. dryRun plans without touching anything.

Implementation

Future<ConvergeResult> reconcile(
  String id, {
  bool dryRun = false,
  bool purgeAdopted = false,
}) async => ConvergeResult.fromJson(
  await _object(
    await post('/nodes/$id/reconcile', {
      if (dryRun) 'dryRun': true,
      if (purgeAdopted) 'purgeAdopted': true,
    }),
  ),
);