API

GitImport

Operations

Every route this entity exposes. Each route links to its own reference on this page.

Method Route SDK operation Returns
POST /api/v1/organizations/{organization_id}/git_imports create Success
POST /api/v1/git_imports/{id}/complete create Success
POST /api/v1/git_imports/{id}/retry create Success
GET /api/v1/git_imports/{id} load Git durability and native readiness

Examples

One example per SDK, generated from the API model. The argument names are the parameters and fields of this entity, and the values are placeholders. The examples are not compiled or executed.

Golang

Construct client as shown in the Golang setup, then call the operations:

git_import, err := client.GitImport(nil).Load(map[string]any{"id": "example_id"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(git_import)
created, err := client.GitImport(nil).Create(map[string]any{"organization_id": "example", "destination_mode": "example", "idempotency_key": "example", "root_path": "example", "slug": "example", "source_branch": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(created)

Lua

Construct client as shown in the Lua setup, then call the operations:

local git_import, err = client:GitImport():load({ id = "example_id" })
local created, err = client:GitImport():create({ organization_id = "example", destination_mode = "example", idempotency_key = "example", root_path = "example", slug = "example", source_branch = "example" })

PHP

Construct client as shown in the PHP setup, then call the operations:

$git_import = $client->GitImport()->load(["id" => "example_id"]);
$created = $client->GitImport()->create(["organization_id" => "example", "destination_mode" => "example", "idempotency_key" => "example", "root_path" => "example", "slug" => "example", "source_branch" => "example"]);

Python

Construct client as shown in the Python setup, then call the operations:

git_import = client.GitImport().load({"id": "example_id"})
created = client.GitImport().create({ "organization_id": "example", "destination_mode": "example", "idempotency_key": "example", "root_path": "example", "slug": "example", "source_branch": "example" })

Ruby

Construct client as shown in the Ruby setup, then call the operations:

git_import = client.GitImport.load({ "id" => "example_id" })
created = client.GitImport.create({ "organization_id" => "example", "destination_mode" => "example", "idempotency_key" => "example", "root_path" => "example", "slug" => "example", "source_branch" => "example" })

TypeScript

Construct client as shown in the TypeScript setup, then call the operations:

const git_import = await client.GitImport().load({ id: "example_id" })
const created = await client.GitImport().create({ organization_id: "example", destination_mode: "example", idempotency_key: "example", root_path: "example", slug: "example", source_branch: "example" })

Fields

Field Type Required Description
destination_mode string Yes Destination Mode
error one,string,null No Error
git_default_branch string No Original Git symbolic HEAD branch, independent of the branch selected for JJ conversion
git_status string Yes Git Status
git_url string Yes Git Url
id string Yes Id
idempotency_key string Yes Idempotency Key
name string No Name
native_status string Yes Native Status
organization string Yes Organization
repository_id one,string,null No Repository Id
root_path string Yes Root Path
slug string Yes Slug
source_branch string Yes Source Branch
target_branch string Yes Target Branch

create

POST /api/v1/organizations/{organization_id}/git_imports

Operation ID: api_v1_organization_git_imports.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
organization_id path string Yes

Request body

application/json

Property Type Required Description
destination_mode enum: standalone, home Yes
git_default_branch string No Original Git symbolic HEAD branch, independent of the branch selected for JJ conversion
idempotency_key string Yes
name string No
root_path string Yes
slug string Yes
source_branch string Yes
target_branch string No

Responses

200: Success

application/json

The response is object.

201: Scoped Git upload destination

application/json

The response is object and object.

202: Writer preparation is pending. Repeat the same idempotent creation request after Retry-After; no transfer credential is issued yet

application/json

The response is object and object.

401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

POST /api/v1/git_imports/{id}/complete

Operation ID: complete_api_v1_git_import.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
id path string Yes

Request body

application/json

The request body is object.

Responses

200: Success

application/json

The response is object.

202: Git is durable; conversion proceeds asynchronously

application/json

Property Type Required Description
error string No
git_status enum: receiving, durable Yes
git_url string Yes
id string Yes
native_status enum: pending, running, ready, failed, canceled Yes
organization string Yes
repository_id string No
root_path string Yes
slug string Yes
source_branch string Yes
target_branch string Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

POST /api/v1/git_imports/{id}/retry

Operation ID: retry_api_v1_git_import.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
id path string Yes

Request body

application/json

The request body is object.

Responses

200: Success

application/json

The response is object.

202: Native repair queued from retained Git storage

application/json

Property Type Required Description
error string No
git_status enum: receiving, durable Yes
git_url string Yes
id string Yes
native_status enum: pending, running, ready, failed, canceled Yes
organization string Yes
repository_id string No
root_path string Yes
slug string Yes
source_branch string Yes
target_branch string Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

load

GET /api/v1/git_imports/{id}

Operation ID: api_v1_git_import.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
id path string Yes

Responses

200: Git durability and native readiness

application/json

Property Type Required Description
error string No
git_status enum: receiving, durable Yes
git_url string Yes
id string Yes
native_status enum: pending, running, ready, failed, canceled Yes
organization string Yes
repository_id string No
root_path string Yes
slug string Yes
source_branch string Yes
target_branch string Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway