To me, this sounds like a feature request since the task_result doesn't yet include the unit_id of the import. If you agree, let me know and we'll switch it to a Story.
wget https://repos.fedorapeople.org/repos/pulp/pulp/fixtures/rpm/mouse-0.1.12-1.noarch.rpm
pulp-admin rpm repo create --repo-id uploadtest
pulp-admin -vv rpm repo uploads rpm --file ./mouse-0.1.12-1.noarch.rpm --repo-id uploadtest
This command causes several API calls to occur. First the upload request is created with the following request URL and response body.
POST /pulp/api/v2/content/uploads/
{
"upload_id": "0ac8e9f3-807d-4576-b9ab-b4ab080dd448",
"_href": "/pulp/api/v2/content/uploads/0ac8e9f3-807d-4576-b9ab-b4ab080dd448/"
}
Then it uploads the data to the created upload request with the following request URL:
PUT /pulp/api/v2/content/uploads/0ac8e9f3-807d-4576-b9ab-b4ab080dd448/0/
It then causes the import to occur which spawns an asynchronous task so the request URL and response body are:
POST /pulp/api/v2/repositories/uploadtest/actions/import_upload/
{
"spawned_tasks": [
{
"_href": "/pulp/api/v2/tasks/b8383aaf-22ee-4382-8ed8-83626405509d/",
"task_id": "b8383aaf-22ee-4382-8ed8-83626405509d"
}
],
"result": null,
"error": null
}
Finally the task results of the import task are shown with this request URL and response body:
GET /pulp/api/v2/tasks/b8383aaf-22ee-4382-8ed8-83626405509d/
{
"exception": null,
"task_type": "pulp.server.managers.content.upload.import_uploaded_unit",
"_href": "/pulp/api/v2/tasks/b8383aaf-22ee-4382-8ed8-83626405509d/",
"task_id": "b8383aaf-22ee-4382-8ed8-83626405509d",
"tags": [
"pulp:repository:uploadtest",
"pulp:action:import_upload"
],
"finish_time": "2016-05-25T15:28:36Z",
"_ns": "task_status",
"start_time": "2016-05-25T15:28:36Z",
"traceback": null,
"spawned_tasks": [],
"progress_report": {},
"queue": "reserved_resource_worker-0@dev.dq",
"state": "finished",
"worker_name": "reserved_resource_worker-0@dev",
"result": {
"details": {},
"success_flag": true,
"summary": ""
},
"error": null,
"_id": {
"$oid": "5745c4a4c473cd1cfa75392a"
},
"id": "5745c4a4c473cd1cfa75392a"
}
Can you be more specific about which request should contain the unit_id?