Skip to main content
POST
/
repos
/
{repo_id}
/
p4-import-state
Update P4 import state
curl --request POST \
  --url https://api.diversion.dev/v0/repos/{repo_id}/p4-import-state \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "branch_ref": "dv.branch.1",
  "p4_import_path": "//depot/main/...",
  "last_changelist": 1,
  "last_import_unix": 123
}
'
{
  "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"

Body

application/json

Update the state of a Perforce import job after manual initial import

branch_ref
string
required

Ref ID of the branch to import to

Required string length: 1 - 128
Example:

"dv.branch.1"

p4_import_path
string
required

Path in Perforce depot to import from

Required string length: 1 - 1024
Example:

"//depot/main/..."

last_changelist
integer
required

Last Perforce changelist number that was imported

Required range: x >= 0
last_import_unix
integer | null

Unix timestamp of the last successful import

Response

Import state updated 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