From fb6e59ebe34f4c51c212ce0587a9a48066081fd7 Mon Sep 17 00:00:00 2001 From: Evan Read Date: Fri, 15 Feb 2019 09:39:23 +0000 Subject: Refactor of API landing page - Breaks up into more sections. - Also minor fixes to pages within sections. --- doc/api/project_import_export.md | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'doc/api/project_import_export.md') diff --git a/doc/api/project_import_export.md b/doc/api/project_import_export.md index fc91c5741da..5155e996158 100644 --- a/doc/api/project_import_export.md +++ b/doc/api/project_import_export.md @@ -1,8 +1,8 @@ # Project import/export API -[Introduced][ce-41899] in GitLab 10.6 +> [Introduced][ce-41899] in GitLab 10.6. -[See also the project import/export documentation](../user/project/settings/import_export.md) +See also the [project import/export documentation](../user/project/settings/import_export.md). ## Schedule an export @@ -16,7 +16,7 @@ data file uploads to the final server. If the `upload` params is present, `upload[url]` param is required. (**Note:** This feature was introduced in GitLab 10.7) -```http +```text POST /projects/:id/export ``` @@ -28,8 +28,7 @@ POST /projects/:id/export | `upload[url]` | string | yes | The URL to upload the project | | `upload[http_method]` | string | no | The HTTP method to upload the exported project. Only `PUT` and `POST` methods allowed. Default is `PUT` | - -```console +```sh curl --request POST --header "PRIVATE-TOKEN: " https://gitlab.example.com/api/v4/projects/1/export \ --data "upload[http_method]=PUT" \ --data-urlencode "upload[url]=https://example-bucket.s3.eu-west-3.amazonaws.com/backup?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIMBJHN2O62W8IELQ%2F20180312%2Feu-west-3%2Fs3%2Faws4_request&X-Amz-Date=20180312T110328Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&X-Amz-Signature=8413facb20ff33a49a147a0b4abcff4c8487cc33ee1f7e450c46e8f695569dbd" @@ -45,7 +44,7 @@ curl --request POST --header "PRIVATE-TOKEN: " https://gitlab Get the status of export. -```http +```text GET /projects/:id/export ``` @@ -53,7 +52,7 @@ GET /projects/:id/export | --------- | -------------- | -------- | ---------------------------------------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | -```console +```sh curl --header "PRIVATE-TOKEN: " https://gitlab.example.com/api/v4/projects/1/export ``` @@ -86,7 +85,7 @@ to a web server, etc. Download the finished export. -```http +```text GET /projects/:id/export/download ``` @@ -94,18 +93,18 @@ GET /projects/:id/export/download | --------- | -------------- | -------- | ---------------------------------------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | -```console +```sh curl --header "PRIVATE-TOKEN: " --remote-header-name --remote-name https://gitlab.example.com/api/v4/projects/5/export/download ``` -```console +```sh ls *export.tar.gz 2017-12-05_22-11-148_namespace_project_export.tar.gz ``` ## Import a file -```http +```text POST /projects/import ``` @@ -124,7 +123,7 @@ cURL to post data using the header `Content-Type: multipart/form-data`. The `file=` parameter must point to a file on your file system and be preceded by `@`. For example: -```console +```sh curl --request POST --header "PRIVATE-TOKEN: " --form "path=api-project" --form "file=@/path/to/file" https://gitlab.example.com/api/v4/projects/import ``` @@ -168,7 +167,7 @@ requests.post(url, headers=headers, data=data, files=files) Get the status of an import. -```http +```text GET /projects/:id/import ``` @@ -176,7 +175,7 @@ GET /projects/:id/import | --------- | -------------- | -------- | ---------------------------------------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | -```console +```sh curl --header "PRIVATE-TOKEN: " https://gitlab.example.com/api/v4/projects/1/import ``` -- cgit v1.2.1