Skip to main content
GET
/
repos
/
{repo_id}
/
p4-import-state
Get Perforce import state
curl --request GET \
  --url https://api.diversion.dev/v0/repos/{repo_id}/p4-import-state \
  --header 'Authorization: Bearer <token>'
{
  "last_changelist": 1,
  "error_count": 0,
  "branch_ref": "dv.branch.1",
  "p4_import_path": "<string>",
  "last_import_unix": 123,
  "running_job_id": "<string>",
  "last_error": "<string>",
  "last_error_unix": 123,
  "started_unix": 123
}

Authorizations

Authorization
string
header
required

This API uses OAuth 2 with the implicit grant flow

Path Parameters

repo_id
string
required

The repo ID of the repository. Repo name can be used instead of the ID, but usage of ID for permanent linking and API requests is preferred.

Required string length: 3 - 128
Example:

"example_id"

Query Parameters

branch_ref
string

Ref ID of the branch to import to

Required string length: 1 - 128
Example:

"dv.branch.1"

p4_import_path
string

Path in Perforce depot to import from

Required string length: 1 - 1024
Example:

"//depot/main/..."

Response

Import state retrieved successfully

Details of a Perforce continuous import job Current state of the Perforce continuous import job

last_changelist
integer
required

Last Perforce changelist number that was imported

Required range: x >= 0
error_count
integer
default:0
required

Number of consecutive errors encountered

branch_ref
string
required

reference name of the branch being synced

Example:

"dv.branch.1"

p4_import_path
string
required

Perforce depot path being imported (e.g., //depot/main/...)

last_import_unix
integer | null

Unix timestamp of the last successful import

running_job_id
string | null

ID of the currently running import job, if any

last_error
string | null

Last error message encountered during import

last_error_unix
integer | null

Unix timestamp of the last error

started_unix
integer | null

Unix timestamp when the current job started running