ThingsKit物联网平台API文档-监控运维(OTA升级)

Get OTA Package Infos (getOtaPackages)

接口地址:/api/otaPackages/{deviceProfileId}/{type}{?page,pageSize,sortOrder,sortProperty,textSearch}

请求方式:GET

请求数据类型:application/x-www-form-urlencoded

响应数据类型:*/*

接口描述:

Returns a page of OTA Package Info objects owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See the ‘Model’ tab of the Response Class for more details. OTA Package Info is a lightweight object that includes main information about the OTA Package excluding the heavyweight data.

Available for users with ‘TENANT_ADMIN’ or ‘CUSTOMER_USER’ authority.

请求参数:

参数名称参数说明请求类型是否必须数据类型
deviceProfileIdA string value representing the device profile id. For example, ‘784f394c-42b6-435a-983c-b7beff2784f9’pathtruestring
typeOTA Package type.,可用值:FIRMWARE,SOFTWAREpathtruestring
pageSizeMaximum amount of entities in a one pagequerytrueinteger(int32)
pageSequence number of page starting from 0querytrueinteger(int32)
textSearchThe case insensitive ‘substring’ filter based on the ota package title.queryfalsestring
sortPropertyProperty of entity to sort by,可用值:checksum,createdTime,dataSize,fileName,tag,title,type,url,versionqueryfalsestring
sortOrderSort order. ASC (ASCENDING) or DESC (DESCENDING),可用值:ASC,DESCqueryfalsestring

响应参数:

参数名称参数说明类型
dataArray of the entitiesarray
additionalInfoOTA Package description.JsonNode
checksumOTA Package checksum.string
checksumAlgorithmOTA Package checksum algorithm.,可用值:CRC32,MD5,MURMUR3_128,MURMUR3_32,SHA256,SHA384,SHA512string
contentTypeOTA Package content type.string
createdTimeTimestamp of the ota package creation, in millisecondsinteger(int64)
dataSizeOTA Package data size.integer(int64)
deviceProfileIdJSON object with Device Profile Id. Device Profile Id of the ota package can’t be changed.DeviceProfileIdRes
entityTypestring,可用值:DEVICE_PROFILEstring
idID of the entity, time-based UUID v1string
fileNameOTA Package file name.string
hasDataIndicates OTA Package ‘has data’. Field is returned from DB (‘true’ if data exists or url is set). If OTA Package ‘has data’ is ‘false’ we can not assign the OTA Package to the Device or Device Profile.boolean
idJSON object with the ota package Id. Specify existing ota package Id to update the ota package. Referencing non-existing ota package id will cause error. Omit this field to create new ota package.OtaPackageIdRes
entityTypestring,可用值:OTA_PACKAGEstring
idID of the entity, time-based UUID v1string
tagOTA Package tag.string
tenantIdJSON object with Tenant Id. Tenant Id of the ota package can’t be changed.TenantIdRes
entityTypestring,可用值:TENANTstring
idID of the entity, time-based UUID v1string
titleOTA Package title.string
typeOTA Package type.,可用值:FIRMWARE,SOFTWAREstring
urlOTA Package url.string
versionOTA Package version.string
hasNext‘false’ value indicates the end of the result setboolean
totalElementsTotal number of elements in all available pagesinteger(int64)
totalPagesTotal number of available pages. Calculated based on the ‘pageSize’ request parameter and total number of entities that match search criteriainteger(int32)

响应示例:

{}

Get OTA Package Infos (getOtaPackages)

接口地址:/api/otaPackages{?page,pageSize,sortOrder,sortProperty,textSearch}

请求方式:GET

请求数据类型:application/x-www-form-urlencoded

响应数据类型:*/*

接口描述:

Returns a page of OTA Package Info objects owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See the ‘Model’ tab of the Response Class for more details. OTA Package Info is a lightweight object that includes main information about the OTA Package excluding the heavyweight data.

Available for users with ‘TENANT_ADMIN’ or ‘CUSTOMER_USER’ authority.

请求参数:

参数名称参数说明请求类型是否必须数据类型
pageSizeMaximum amount of entities in a one pagequerytrueinteger(int32)
pageSequence number of page starting from 0querytrueinteger(int32)
textSearchThe case insensitive ‘substring’ filter based on the ota package title.queryfalsestring
sortPropertyProperty of entity to sort by,可用值:checksum,createdTime,dataSize,fileName,tag,title,type,url,versionqueryfalsestring
sortOrderSort order. ASC (ASCENDING) or DESC (DESCENDING),可用值:ASC,DESCqueryfalsestring

响应参数:

参数名称参数说明类型
dataArray of the entitiesarray
additionalInfoOTA Package description.JsonNode
checksumOTA Package checksum.string
checksumAlgorithmOTA Package checksum algorithm.,可用值:CRC32,MD5,MURMUR3_128,MURMUR3_32,SHA256,SHA384,SHA512string
contentTypeOTA Package content type.string
createdTimeTimestamp of the ota package creation, in millisecondsinteger(int64)
dataSizeOTA Package data size.integer(int64)
deviceProfileIdJSON object with Device Profile Id. Device Profile Id of the ota package can’t be changed.DeviceProfileIdRes
entityTypestring,可用值:DEVICE_PROFILEstring
idID of the entity, time-based UUID v1string
fileNameOTA Package file name.string
hasDataIndicates OTA Package ‘has data’. Field is returned from DB (‘true’ if data exists or url is set). If OTA Package ‘has data’ is ‘false’ we can not assign the OTA Package to the Device or Device Profile.boolean
idJSON object with the ota package Id. Specify existing ota package Id to update the ota package. Referencing non-existing ota package id will cause error. Omit this field to create new ota package.OtaPackageIdRes
entityTypestring,可用值:OTA_PACKAGEstring
idID of the entity, time-based UUID v1string
tagOTA Package tag.string
tenantIdJSON object with Tenant Id. Tenant Id of the ota package can’t be changed.TenantIdRes
entityTypestring,可用值:TENANTstring
idID of the entity, time-based UUID v1string
titleOTA Package title.string
typeOTA Package type.,可用值:FIRMWARE,SOFTWAREstring
urlOTA Package url.string
versionOTA Package version.string
hasNext‘false’ value indicates the end of the result setboolean
totalElementsTotal number of elements in all available pagesinteger(int64)
totalPagesTotal number of available pages. Calculated based on the ‘pageSize’ request parameter and total number of entities that match search criteriainteger(int32)

响应示例:

{}