This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
IoTHub Manager Packages API
Elvin Morales edited this page Jan 24, 2019
·
1 revision
POST /v1/packages
The packages API in contrast to other APIs supported expects a multipart/form-data content-type to facilitate file upload.
Basic structure of request:
{
"type": "EDGE_MANIFEST"
"package": PackageToUpload
}
Example HTML:
<form action="http://uri/v1/packages" enctype="multipart/form-data" method="post">
<input type="text" name="type" value="EDGE_MANIFEST" />
<input type="file" name="package" />
<input type="submit">
</form>
Example cURL generated with Postman:
curl -X POST \
http://uri/v1/packages \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: multipart/form-data' \
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
-F '[email protected]' \
-F type=EDGE_MANIFEST
Response
- Status Code 200 - Returns OK and the new package object, with auto generated
id
- Status Code 400 - Invalid input provided such as a bad type, or an invalid/empty file.
GET /v1/packages/{id}
Response
- Status Code 200 - Returns OK and the package object
- Status Code 404 - The request package does not exist
GET /v1/packages
Response
- Status Code 200 - Returns OK and the list of previously upload package objects
DELETE /v1/packages
Response
- Status Code 200 - Returns OK meaning the package was deleted
- Status Code 404 - The package requested to be deleted was not found.