Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'doc/api/import.md')
-rw-r--r--doc/api/import.md22
1 files changed, 19 insertions, 3 deletions
diff --git a/doc/api/import.md b/doc/api/import.md
index e377853ade0..27f5915b206 100644
--- a/doc/api/import.md
+++ b/doc/api/import.md
@@ -1,3 +1,9 @@
+---
+stage: none
+group: unassigned
+info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
+---
+
# Import API
## Import repository from GitHub
@@ -13,10 +19,20 @@ POST /import/github
| `personal_access_token` | string | yes | GitHub personal access token |
| `repo_id` | integer | yes | GitHub repository ID |
| `new_name` | string | no | New repository name |
-| `target_namespace` | string | yes | Namespace to import repository into |
+| `target_namespace` | string | yes | Namespace to import repository into. Supports subgroups like `/namespace/subgroup`. |
+| `github_hostname` | string | no | Custom GitHub enterprise hostname. Defaults to GitHub.com if `github_hostname` is not set. |
```shell
-curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --data "personal_access_token=abc123&repo_id=12345&target_namespace=root" "https://gitlab.example.com/api/v4/import/github"
+curl --request POST \
+ --url "https://gitlab.example.com/api/v4/import/github" \
+ --header "content-type: application/json" \
+ --header "PRIVATE-TOKEN: <your_access_token>" \
+ --data '{
+ "personal_access_token": "aBc123abC12aBc123abC12abC123+_A/c123",
+ "repo_id": "12345",
+ "target_namespace": "group/subgroup",
+ "new_name": "NEW-NAME"
+}'
```
Example response:
@@ -51,7 +67,7 @@ POST /import/bitbucket_server
| `bitbucket_server_project` | string | yes | Bitbucket Project Key |
| `bitbucket_server_repo` | string | yes | Bitbucket Repository Name |
| `new_name` | string | no | New repository name |
-| `target_namespace` | string | no | Namespace to import repository into |
+| `target_namespace` | string | no | Namespace to import repository into. Supports subgroups like `/namespace/subgroup` |
```shell
curl --request POST \