Create BMP target

POST /bgp/targets

Create a new BMP monitoring target. The BMP server will connect to this router's management IP on TCP port 11019 (configured in the router, not in Osprey).

routing_domain_id must exist AND belong to as_id, else 400 — the same scope check lane B applies (the FK proves only that the UUID names a real routing domain). A BGP-LS-enabled target is a projector source that takes the domain's NAME, so an out-of-scope pair silently lands the canvas rows under a different hierarchy than the configuration shows. PUT /bgp/targets/{id} re-checks the MERGED pair, since either half can move on a partial PUT.

Auth: admin, engineer

Request Body:

{
  "name": "rr1",
  "description": "Route Reflector 1",
  "sys_name": "rr1.example.com",
  "router_ip": "198.51.100.1",
  "as_id": "uuid",
  "routing_domain_id": "uuid",
  "protocol_instance_id": "uuid",
  "rib_mode": "loc_rib",
  "max_prefixes": 2000000,
  "max_initial_dump_seconds": 300,
  "history_mode": "best_path_peer",
  "history_prefix_filter": ["10.0.0.0/8"]
}

Required fields: name, router_ip, as_id, routing_domain_id.

Optional fields: protocol_instance_id (must reference a BGP PI if provided), max_initial_dump_seconds (EoR timeout, default 300), history_mode, history_prefix_filter.

Defaults: rib_mode defaults to "loc_rib" if empty. max_prefixes defaults to 2000000 if zero. history_mode defaults to "best_path_peer" if empty and must be one of off / best_path / best_path_peer / full (full records the per-peer RIB and enables as-of-T failure simulation — substantially more history data, depending on route count and churn); history_prefix_filter entries must be valid CIDRs and are capped at 1024 (invalid → 400). enabled in the request body is ignored — new targets are always created enabled (enabled=true). Use PUT /bgp/targets/{id}/toggle to disable a target afterward.

Response: 201 Created -- returns the created target with generated id, state, created_at, updated_at.