Create a new deployable Asset
POST/assets/create
Creates an asset in the system. Returns ID of the asset and a URL which can be used to upload the asset. The asset upload URLs are s3 compaitible and you can upload the assset in single request or through multipart upload over multiple parallel connections.
The multipart upload will be valid for 24Hrs only. And if the upload is not completed within 24 Hrs, the partial uploaded parts will be deleted.
::note You need to call completeUpload API afte uploading the asset. ::
::note You can upload only one file in asset. If you want to bundle multiple files in single asset, you need to combine them in an archive like zip or tar. ::
In response you will receive a URL on which PUT
request needs to be made. A curl
example is given below
curl -X PUT {Upload URL} \
--header 'Content-Disposition: attachment;filename={filename}' \
--header 'Content-Type: application/octet-stream'
-d @path/to/file
Request
- application/json
Body
A unique identifier through which your device can identify the deployed file. You can define different assets depending on configuration in your hardware. For example, in a advanced edge computing gateway, there can be multiple services. You can create an asset for each updatedable servce.
You can implement a Signing algorithm without actually creating a signed binary asset. This option allows you to specify signature outside binary for convenience. You device will recieve this signature along with other information and can use to verify authenticity of the harwdare.
Asset version defines a version string. It is upto users to decide which versioning scheme is suitable for their application.
Optional description of asset
Set to true if you are specifying the uploaded asset to be either a signed binary or specified by assetSignature
field.
assetMeta object
You can specify upto 50 key value pairs in each asset. This data is also provided to the devices as a part of deployment. You can implement additional logic in devices to take actions according to data found in asset metadata
uploadConfig objectrequired
It is adivisable to upload assets larger than 100MB through multipart upload, to get benefit of multiple parallel connections and reduced chance of failure. You need to divide your whole binary into predefined number of chunks. We recommend maximum chunk size of 100MB. Anedya support maximum 10000 chunks.
Please note that each asset part should be minimum 5MB in size or else merge operation will fail
Default value: false
Set to true if you want to upload asset in multiple parts
Possible values: <= 100
Default value: 1
Number of parts in which you want to upload asset
Specify checksum of the asset. Anedya does not compute checksum. This information is simply passed on to the device. You can implement integrity checks in your device with algorithm of your choice
You can specify the filename which will be provided to downloaded file.
It'll be set as Content-disposition
header filename parameter when downloaded in browser or in device side
You need to specify same file name in the header as well while uploading the asset in whole or part
Responses
- 200
OK
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
Unique ID of the created asset
uploadInfo object
uploadURL object[]
Cotains a presigned S3 URL which can be utilized to upload the asset file In case of multipart upload, the platform initates a s3 multipart upload, retunrs set of multipart upload URLs which can be used to upload multiple parts.
Part number
URL to which you can make a PUT
request to upload the asset
{
"assetId": "string",
"uploadInfo": {
"uploadURL": [
{
"part": 0,
"url": "string"
}
]
}
}