8. Upload the file chunks. The offset starts at 0 for the first chunk and increases by 2000000 for
each file. Note the use of the offset parameter and how it relates to the file size. Note also that
the indexes are used after the path variable, for example, ${path}0, ${path}1.
Example requests:
$ curl -u sat_username:sat_password -H Accept:application/json -H \
Content-Type:multipart/form-data \
-X PUT --data-urlencode size=$size --data-urlencode offset=0 \
--data-urlencode content@${path}0 https://$(hostname -
f)/katello/api/v2/repositories/76/content_uploads/$upload_id
$ curl -u sat_username:sat_password -H Accept:application/json -H \
Content-Type:multipart/form-data \
-X PUT --data-urlencode size=$size --data-urlencode offset=2000000 \
--data-urlencode content@${path}1 https://$(hostname -
f)/katello/api/v2/repositories/76/content_uploads/$upload_id
$ curl -u sat_username:sat_password -H Accept:application/json -H \
Content-Type:multipart/form-data \
-X PUT --data-urlencode size=$size --data-urlencode offset=4000000 \
--data-urlencode content@${path}2 https://$(hostname -
f)/katello/api/v2/repositories/76/content_uploads/$upload_id
$curl -u sat_username:sat_password -H Accept:application/json -H \
Content-Type:multipart/form-data \
-X PUT --data-urlencode size=$size --data-urlencode offset=6000000
--data-urlencode content@${path}3 https://$(hostname -
f)/katello/api/v2/repositories/76/content_uploads/$upload_id
$ curl -u sat_username:sat_password -H Accept:application/json -H \
Content-Type:multipart/form-data \
-X PUT --data-urlencode size=$size --data-urlencode offset=8000000 \
--data-urlencode content@${path}4 https://$(hostname -
f)/katello/api/v2/repositories/76/content_uploads/$upload_id
9. Import the complete upload to the repository:
$ curl -H "Content-Type:application/json" -X PUT -u \
sat_username:sat_password -k -d \
"{\"uploads\":[{\"id\": \"$upload_id\", \
\"name\": \"$name\", \"checksum\": \"$checksum\" }]}" \
https://$(hostname -f)/katello/api/v2/repositories/76/import_uploads
10. Delete the upload request:
$ curl -H 'Content-Type: application/json' -X DELETE -k \
-u sat_username:sat_password -d "{}" \
https://$(hostname -f)/katello/api/v2/repositories/76/content_uploads/$upload_id
Uploading duplicate content
Note that if you try to upload duplicate content using:
Example request: