Chuyển tới nội dung chính

Start import

POST/api/projects/{projectId}/sources/{sourceId}/imports
Quản trị viên

Đọc thêm: Import lịch sửMã nguồn: SourceImportApiController#startImport(mở trong thẻ mới)

Tham số đường dẫn​

TênKiểuBắt buộcGhi chú
projectIdstring (uuid)Bắt buộc
sourceIdstring (uuid)Bắt buộc

Response​

Thành công: 202

TrườngKiểuBắt buộcGhi chú
sourceIdstring (uuid)Tùy chọn
typeenum SourceTypeTùy chọnGITHUBGITLABLINEARJIRA
externalProjectKeystringTùy chọn
externalTeamKeystringTùy chọn
deliveryMechanismstringTùy chọn
supportsImportbooleanTùy chọn
polledbooleanTùy chọn
nextPollAtstring (date-time)Tùy chọn
accessTokenConfiguredbooleanTùy chọn
statusstringTùy chọn
windowStartstring (date-time)Tùy chọn
windowEndstring (date-time)Tùy chọn
scannedCountintegerTùy chọn
importedCountintegerTùy chọn
itemLimitintegerTùy chọn
requesterNamestringTùy chọn
startedAtstring (date-time)Tùy chọn
completedAtstring (date-time)Tùy chọn
nextAttemptAtstring (date-time)Tùy chọn
lastErrorstringTùy chọn
lastSyncAtstring (date-time)Tùy chọn
lastErrorCodestringTùy chọn
canResumeImportbooleanTùy chọn
lastDeliveryAtstring (date-time)Tùy chọn
healthSourceHealthTùy chọn
health.connectedbooleanTùy chọn
health.disconnectedAtstring (date-time)Tùy chọn
health.secretUpdatedAtstring (date-time)Tùy chọn
health.signatureFailureCountintegerTùy chọn
health.lastSignatureFailureAtstring (date-time)Tùy chọn
health.quietbooleanTùy chọn
health.quietSincestring (date-time)Tùy chọn
health.usualGapHoursintegerTùy chọn
health.overduebooleanTùy chọn

Lỗi​

Trạng tháiMãÁp dụng cho
400validation_failedthiếu trường hoặc giá trị nằm ngoài khoảng cho phépMọi endpoint
400invalid_parametermột tham số trên đường dẫn hoặc query bị thiếu hoặc không chuyển đổi được, chẳng hạn một ID không phải UUIDMọi endpoint
401authentication_requiredchưa có phiên đăng nhậpMọi endpoint
403access_deniedendpoint dành cho quản trị viên, hoặc CSRF token thiếu hay đã cũMọi endpoint
404not_foundkhông có địa chỉ đóMọi endpoint
405method_not_allowedđịa chỉ không nhận phương thức đóMọi endpoint
415unsupported_media_typeđịa chỉ không đọc body thuộc kiểu đóMọi endpoint
500internal_errormột lỗi ReleaseFlow không lường trước; body không bao giờ chứa exception gây ra nóMọi endpoint
400gitlab_base_url_invalidKhu vực Sources
400gitlab_host_not_allowedKhu vực Sources
400jira_site_invalidKhu vực Sources
400github_token_rejectedKhu vực Sources
400gitlab_token_rejectedKhu vực Sources
400linear_token_rejectedKhu vực Sources
400jira_token_rejectedKhu vực Sources
400source_credential_requiredKhu vực Sources
400source_signing_token_invalidKhu vực Sources
404project_not_foundKhu vực Sources
404source_not_foundKhu vực Sources
409github_repository_already_connectedKhu vực Sources
409gitlab_project_already_connectedKhu vực Sources
409linear_team_already_connectedKhu vực Sources
409jira_project_already_connectedKhu vực Sources
409source_token_missingKhu vực Sources
409source_sync_in_progressKhu vực Sources
409source_import_not_supportedKhu vực Sources
409source_import_not_resumableKhu vực Sources
409source_disconnectedKhu vực Sources
409source_not_disconnectedKhu vực Sources
409source_reconnect_requiredKhu vực Sources
409source_has_no_webhookKhu vực Sources
409source_secret_generatedKhu vực Sources
409source_secret_pastedKhu vực Sources
503github_unavailableKhu vực Sources
503gitlab_unavailableKhu vực Sources
503jira_unavailableKhu vực Sources

Request

bash
# Sign in first and keep the session cookie in cookies.txt (see Sessions and CSRF).
# CSRF_HEADER and CSRF_TOKEN are the headerName and token GET /api/csrf returned.
curl -X POST "http://localhost:8080/api/projects/$PROJECT_ID/sources/$SOURCE_ID/imports" \
-b cookies.txt -c cookies.txt \
-H "$CSRF_HEADER: $CSRF_TOKEN"

Response

202

Ví dụ

{
  "sourceId": "<uuid>",
  "type": "GITHUB",
  "externalProjectKey": "<string>",
  "externalTeamKey": "<string>",
  "deliveryMechanism": "<string>",
  "supportsImport": false,
  "polled": false,
  "nextPollAt": "<date-time>",
  "accessTokenConfigured": false,
  "status": "<string>",
  "windowStart": "<date-time>",
  "windowEnd": "<date-time>",
  "scannedCount": 0,
  "importedCount": 0,
  "itemLimit": 0,
  "requesterName": "<string>",
  "startedAt": "<date-time>",
  "completedAt": "<date-time>",
  "nextAttemptAt": "<date-time>",
  "lastError": "<string>",
  "lastSyncAt": "<date-time>",
  "lastErrorCode": "<string>",
  "canResumeImport": false,
  "lastDeliveryAt": "<date-time>",
  "health": {
    "connected": false,
    "disconnectedAt": "<date-time>",
    "secretUpdatedAt": "<date-time>",
    "signatureFailureCount": 0,
    "lastSignatureFailureAt": "<date-time>",
    "quiet": false,
    "quietSince": "<date-time>",
    "usualGapHours": 0,
    "overdue": false
  }
}