Commit a68ea57d authored by Michael Leopard's avatar Michael Leopard

Update to include example remote import script and additional curl command

parent d01e5a04
......@@ -32,6 +32,14 @@ POST /projects/:id/export
curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" --data "description=FooBar&upload[http_method]=PUT&upload[url]="
Some systems may require the upload url to be url-encoded:
curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" \
--data "upload[http_method]=PUT" \
--data-urlencode "upload[url]="
"message": "202 Accepted"
......@@ -125,6 +133,29 @@ by `@`. For example:
curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" --form "path=api-project" --form "file=@/path/to/file"
cURL doesn't support posting a file from a remote server. Importing a project from a remote server can be accomplished through something like the following:
import requests
import urllib
import json
import sys
s3_file = urllib.urlopen(presigned_url)
url = ''
files = {'file': s3_file}
data = {
"path": "example-project",
"namespace": "example-group"
headers = {
'Private-Token': "9koXpg98eAheJpvBs5tK"
}, headers=headers, data=data, files=files)
"id": 1,
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment