Updates - Import Update
Import new update version.
POST https://{accountEndpoint}/deviceupdate/{instanceId}/v2/updates?action=import
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
account
|
path | True |
string |
Account endpoint. |
instance
|
path | True |
string |
Account instance identifier. |
action
|
query | True |
Import update action. |
Request Body
Name | Required | Type | Description |
---|---|---|---|
files | True |
One or more update file properties like filename and source URL. |
|
importManifest | True |
Import manifest metadata like source URL, file size/hashes, etc. |
Responses
Name | Type | Description |
---|---|---|
202 Accepted |
Accepted update import request; background operation location to track status is specified in Operation-Location response header. Headers
|
|
429 Too Many Requests |
Too many requests; there is a rate limit on how many operations can be executed within a time period and there is also a limit on how many concurrent import and delete background operations can be executed. |
Security
azure_auth_implicit
Azure Active Directory OAuth2 Implicit Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize
Scopes
Name | Description |
---|---|
user_impersonation | impersonate your user account |
azure_auth_code
Azure Active Directory OAuth2 AccessCode Flow
Type:
oauth2
Flow:
accessCode
Authorization URL:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize
Token URL:
https://login.microsoftonline.com/common/oauth2/v2.0/token
Scopes
Name | Description |
---|---|
user_impersonation | impersonate your user account |
azure_auth_application
Azure Active Directory OAuth2 Application Flow
Type:
oauth2
Flow:
application
Token URL:
https://login.microsoftonline.com/common/oauth2/v2.0/token
Scopes
Name | Description |
---|---|
.default | client credential scope |
azure_auth_password
Azure Active Directory OAuth2 Password Flow
Type:
oauth2
Flow:
password
Token URL:
https://login.microsoftonline.com/common/oauth2/v2.0/token
Scopes
Name | Description |
---|---|
user_impersonation | impersonate your user account |
Examples
Updates_ImportUpdate
Sample request
POST https://contoso.api.adu.microsoft.com/deviceupdate/blue/v2/updates?action=import
{
"importManifest": {
"url": "http://test.blob.core.windows.net/test/uploadimportMan.json",
"sizeInBytes": 816,
"hashes": {
"sha256": "O19LyyncPe1AGstOdkcmozLV8pSbBdqrE18HdYVohRc="
}
},
"files": [
{
"filename": "file1.bin",
"url": "http://test.blob.core.windows.net/test/upload1v5uww1q"
},
{
"filename": "file2.bin",
"url": "http://test.blob.core.windows.net/test/uploadkrmn5yw0"
},
{
"filename": "file3.bin",
"url": "http://test.blob.core.windows.net/test/uploaddq52ky5m"
}
]
}
Sample response
Location: /deviceupdate/instanceId/v2/updates/operations/e4491c54-916f-443d-9094-bcca546ace2f
Operation-Location: /deviceupdate/instanceId/v2/updates/operations/e4491c54-916f-443d-9094-bcca546ace2f
Definitions
Name | Description |
---|---|
File |
Metadata describing an update file. |
Import |
Import update action. |
Import |
Metadata describing the import manifest, a document which describes the files and other metadata about an update version. |
Import |
Import update input metadata. |
FileImportMetadata
Metadata describing an update file.
Name | Type | Description |
---|---|---|
filename |
string |
Update file name as specified inside import manifest. |
url |
string |
Azure Blob location from which the update file can be downloaded by Device Update for IoT Hub. This is typically a read-only SAS-protected blob URL with an expiration set to at least 4 hours. |
ImportAction
Import update action.
Name | Type | Description |
---|---|---|
import |
string |
Import action. |
ImportManifestMetadata
Metadata describing the import manifest, a document which describes the files and other metadata about an update version.
Name | Type | Description |
---|---|---|
hashes |
object |
A JSON object containing the hash(es) of the file. At least SHA256 hash is required. This object can be thought of as a set of key-value pairs where the key is the hash algorithm, and the value is the hash of the file calculated using that algorithm. |
sizeInBytes |
integer |
File size in number of bytes. |
url |
string |
Azure Blob location from which the import manifest can be downloaded by Device Update for IoT Hub. This is typically a read-only SAS-protected blob URL with an expiration set to at least 4 hours. |
ImportUpdateInput
Import update input metadata.
Name | Type | Description |
---|---|---|
files |
One or more update file properties like filename and source URL. |
|
importManifest |
Import manifest metadata like source URL, file size/hashes, etc. |