Skip to main content

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

Body

    assetIdentifier stringrequired

    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.

    assetSignature string

    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.

    assetVersion stringrequired

    Asset version defines a version string. It is upto users to decide which versioning scheme is suitable for their application.

    assetDesc string

    Optional description of asset

    assetSigned booleanrequired

    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

    property name* string
    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

    multipart booleanrequired

    Default value: false

    Set to true if you want to upload asset in multiple parts

    numberOfParts integer

    Possible values: <= 100

    Default value: 1

    Number of parts in which you want to upload asset

    checksum string

    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

    assetFileName stringrequired

    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

OK

Schema
    assetId string

    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.

  • Array [
  • part integer

    Part number

    url string

    URL to which you can make a PUT request to upload the asset

  • ]
Loading...