API Explorer 1 endpoints

Trigger a Metrics Archive Run

POST /obp/v7.0.0/management/system/diagnostics/metrics/run

OBPv7.0.0-triggerMetricsArchiveRun Roles: CanCreateMetricsArchiveRun MetricSystemAPI

Manually run the metrics-archiving job once, on demand.

This invokes the same code path as the scheduled MetricsArchiveScheduler run, so it respects all the same checks:

  • Concurrency lock — if an archive run is already in progress (the JobScheduler lock is held, on this or another node), no new run is started and the response status is skipped_already_in_progress.
  • Retention rules — moves metric rows older than retain_metrics_days to metricarchive, up to retain_metrics_move_limit rows; then deletes metricarchive rows older than retain_archive_metrics_days.
  • Run log — the outcome is written to the metricsarchiverun audit log, exactly as a scheduled run would be.

Response fields:

  • status — completed (a run executed — inspect run.success) or skipped_already_in_progress.
  • message — human-readable summary.
  • run — the recorded run (run id, counts, duration, success, remark); absent when skipped.
  • in_progress — present only when skipped: the lock that blocked the run (job_id, api_instance_id, started_at, age_seconds). A large age_seconds (much older than a normal run) indicates a stale lock left by a dead JVM — clear the matching jobscheduler row to unblock.

Note: the run executes synchronously, so a large backlog may take a while.

User Authentication is Required. The User must be logged in. The Application must also be authenticated.

JSON request body fields (0)
JSON response body fields (12)
api_instance_id
api_instance_id
duration_ms
duration_ms
ended_at
ended_at
message
123456
remark
remark
rows_deleted_from_archive
rows_deleted_from_archive
rows_moved_to_archive
rows_moved_to_archive
run_id
run_id
started_at
started_at
status
success
run
run
Example success response
{
  "status": "completed",
  "message": "Archive run completed: moved 4000 rows to the archive, deleted 1500 outdated archive rows.",
  "run": {
    "run_id": "9f3c2b1a-7d4e-4c8a-9b2f-1e6d5a0c4b7e",
    "api_instance_id": "obp",
    "started_at": "2024-06-01T00:00:00Z",
    "ended_at": "2024-06-01T00:00:12Z",
    "duration_ms": 12000,
    "rows_moved_to_archive": 4000,
    "rows_deleted_from_archive": 1500,
    "success": true,
    "remark": ""
  }
}
Possible errors (3)
  • OBP-20001: User not logged in. Authentication is required!
  • OBP-20006: User is missing one or more roles:
  • OBP-50000: Unknown Error.
Implemented by OBPv7.0.0 triggerMetricsArchiveRun