Start import
POST
/api/projects/{projectId}/sources/{sourceId}/importsQuản trị viên
Tham số đường dẫn
| Tên | Kiểu | Bắt buộc | Ghi chú |
|---|---|---|---|
projectId | string (uuid) | Bắt buộc | |
sourceId | string (uuid) | Bắt buộc |
Response
Thành công: 202
| Trường | Kiểu | Bắt buộc | Ghi chú |
|---|---|---|---|
sourceId | string (uuid) | Tùy chọn | |
type | enum SourceType | Tùy chọn | GITHUBGITLABLINEARJIRA |
externalProjectKey | string | Tùy chọn | |
externalTeamKey | string | Tùy chọn | |
deliveryMechanism | string | Tùy chọn | |
supportsImport | boolean | Tùy chọn | |
polled | boolean | Tùy chọn | |
nextPollAt | string (date-time) | Tùy chọn | |
accessTokenConfigured | boolean | Tùy chọn | |
status | string | Tùy chọn | |
windowStart | string (date-time) | Tùy chọn | |
windowEnd | string (date-time) | Tùy chọn | |
scannedCount | integer | Tùy chọn | |
importedCount | integer | Tùy chọn | |
itemLimit | integer | Tùy chọn | |
requesterName | string | Tùy chọn | |
startedAt | string (date-time) | Tùy chọn | |
completedAt | string (date-time) | Tùy chọn | |
nextAttemptAt | string (date-time) | Tùy chọn | |
lastError | string | Tùy chọn | |
lastSyncAt | string (date-time) | Tùy chọn | |
lastErrorCode | string | Tùy chọn | |
canResumeImport | boolean | Tùy chọn | |
lastDeliveryAt | string (date-time) | Tùy chọn | |
health | SourceHealth | Tùy chọn | |
health.connected | boolean | Tùy chọn | |
health.disconnectedAt | string (date-time) | Tùy chọn | |
health.secretUpdatedAt | string (date-time) | Tùy chọn | |
health.signatureFailureCount | integer | Tùy chọn | |
health.lastSignatureFailureAt | string (date-time) | Tùy chọn | |
health.quiet | boolean | Tùy chọn | |
health.quietSince | string (date-time) | Tùy chọn | |
health.usualGapHours | integer | Tùy chọn | |
health.overdue | boolean | Tùy chọn |
Lỗi
| Trạng thái | Mã | Áp dụng cho |
|---|---|---|
400 | validation_failedthiếu trường hoặc giá trị nằm ngoài khoảng cho phép | Mọi endpoint |
400 | invalid_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 UUID | Mọi endpoint |
401 | authentication_requiredchưa có phiên đăng nhập | Mọi endpoint |
403 | access_deniedendpoint dành cho quản trị viên, hoặc CSRF token thiếu hay đã cũ | Mọi endpoint |
404 | not_foundkhông có địa chỉ đó | Mọi endpoint |
405 | method_not_allowedđịa chỉ không nhận phương thức đó | Mọi endpoint |
415 | unsupported_media_typeđịa chỉ không đọc body thuộc kiểu đó | Mọi endpoint |
500 | internal_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 |
400 | gitlab_base_url_invalid | Khu vực Sources |
400 | gitlab_host_not_allowed | Khu vực Sources |
400 | jira_site_invalid | Khu vực Sources |
400 | github_token_rejected | Khu vực Sources |
400 | gitlab_token_rejected | Khu vực Sources |
400 | linear_token_rejected | Khu vực Sources |
400 | jira_token_rejected | Khu vực Sources |
400 | source_credential_required | Khu vực Sources |
400 | source_signing_token_invalid | Khu vực Sources |
404 | project_not_found | Khu vực Sources |
404 | source_not_found | Khu vực Sources |
409 | github_repository_already_connected | Khu vực Sources |
409 | gitlab_project_already_connected | Khu vực Sources |
409 | linear_team_already_connected | Khu vực Sources |
409 | jira_project_already_connected | Khu vực Sources |
409 | source_token_missing | Khu vực Sources |
409 | source_sync_in_progress | Khu vực Sources |
409 | source_import_not_supported | Khu vực Sources |
409 | source_import_not_resumable | Khu vực Sources |
409 | source_disconnected | Khu vực Sources |
409 | source_not_disconnected | Khu vực Sources |
409 | source_reconnect_required | Khu vực Sources |
409 | source_has_no_webhook | Khu vực Sources |
409 | source_secret_generated | Khu vực Sources |
409 | source_secret_pasted | Khu vực Sources |
503 | github_unavailable | Khu vực Sources |
503 | gitlab_unavailable | Khu vực Sources |
503 | jira_unavailable | Khu 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
202Ví 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
}
}