seqdiag {
    span_height = 10;
    activation = none;
    Barbican;
    === In Octavia ===
    Octavia -> Octavia [label="Get a new cert/key from CertGenerator"];
    Octavia -> "Compute Driver" [label="Create new Amphora"] {
        "Compute Driver" -> Nova [label="Create instance", note="Ref Impl, ConfigDrive: Octavia Controller certificate and IP, and a generated/signed cert + private key"];
    }
    Octavia => "Compute Driver" [label="Wait for Amphora Ready"];
    loop {
        "Compute Driver" => Nova [label="Poll for ACTIVE Amphora", note="Ref Impl", return="Amphora Management IP"];
    }
    Octavia -> Octavia [label="Store Amphora IP"];
    Octavia => "Amp Driver" [label="Run Amphora Self-Test", return="PASS/FAIL"] {
        "Amp Driver" -> "Amp Driver" [label="Poll DB until first Heartbeat arrives", note="Ref Impl"];
        "Amp Driver" => "Amphora API" [label="Run Self-Test", note="Ref Impl"] {
            === If Self-test passes ===
            Octavia -> Octavia [label="Add Amphora to standby pool"];
            === If Self-test fails ===
            Octavia -> Octavia [label="Delete Amphora"];
        }
    }

    === In the Amphora (Ref Impl) ===
    Amphora -> Amphora [label="Start Services (API, Heartbeat)"];
    "Amp Heartbeat" -> "Amp Driver" [label="Announce", note="UDP"] {
        "Amp Driver" -> "Amp Driver" [label="Verify Amphora by Signed UDP Heartbeat"];
        === If Verification fails ===
        "Amp Driver" -> "Amp Driver" [label="Log and Ignore"];
        === If Verification succeeds ===
        "Amp Driver" -> "Health Manager" [label="Store Heartbeat"];
    }
}
