@azure-rest/iot-device-update
Version:
Device Update for IoT Hub is an Azure service that enables customers to publish update for their IoT devices to the cloud, and then deploy that update to their devices (approve updates to groups of devices managed and provisioned in IoT Hub). It leverages
547 lines • 22.9 kB
TypeScript
/** The list of updates. */
export interface UpdateListOutput {
/** The collection of pageable items. */
value: Array<UpdateOutput>;
/** The link to the next page of items. */
nextLink?: string;
}
/** Update metadata. */
export interface UpdateOutput {
/** Update identity. */
updateId: UpdateIdOutput;
/** Update description specified by creator. */
description?: string;
/** Friendly update name specified by importer. */
friendlyName?: string;
/** Whether the update can be deployed to a device on its own. */
isDeployable?: boolean;
/** Update type. Deprecated in latest import manifest schema. */
updateType?: string;
/** String interpreted by Device Update client to determine if the update is installed on the device. Deprecated in latest import manifest schema. */
installedCriteria?: string;
/** List of update compatibility information. */
compatibility: Array<Record<string, string>>;
/** Update install instructions. */
instructions?: InstructionsOutput;
/** List of update identities that reference this update. */
referencedBy?: Array<UpdateIdOutput>;
/** Update aggregate scan result (calculated from payload file scan results). */
scanResult?: string;
/** Schema version of manifest used to import the update. */
manifestVersion: string;
/** Date and time in UTC when the update was imported. */
importedDateTime: string;
/** Date and time in UTC when the update was created. */
createdDateTime: string;
/** Update ETag. */
etag?: string;
}
/** Update identifier. */
export interface UpdateIdOutput {
/** Update provider. */
provider: string;
/** Update name. */
name: string;
/** Update version. */
version: string;
}
export interface InstructionsOutput {
/** Collection of installation steps. */
steps: Array<StepOutput>;
}
/** Update install instruction step. */
export interface StepOutput {
/** Step type. */
type?: "Inline" | "Reference";
/** Step description. */
description?: string;
/** Identity of handler that will execute this step. Required if step type is inline. */
handler?: string;
/** Parameters to be passed to handler during execution. */
handlerProperties?: Record<string, unknown>;
/** Collection of file names to be passed to handler during execution. Required if step type is inline. */
files?: Array<string>;
/** Referenced child update identity. Required if step type is reference. */
updateId?: UpdateIdOutput;
}
/** Common error response. */
export interface ErrorResponseOutput {
/** The error details. */
error: ErrorModelOutput;
}
/** Error details. */
export interface ErrorModelOutput {
/** Server defined error code. */
code: string;
/** A human-readable representation of the error. */
message: string;
/** The target of the error. */
target?: string;
/** An array of errors that led to the reported error. */
details?: Array<ErrorModelOutput>;
/** An object containing more specific information than the current object about the error. */
innererror?: InnerErrorOutput;
/** Date and time in UTC when the error occurred. */
occurredDateTime?: string;
}
/** An object containing more specific information than the current object about the error. */
export interface InnerErrorOutput {
/** A more specific error code than what was provided by the containing error. */
code: string;
/** A human-readable representation of the error. */
message?: string;
/** The internal error or exception message. */
errorDetail?: string;
/** An object containing more specific information than the current object about the error. */
innerError?: InnerErrorOutput;
}
/** The list of strings with server paging support. */
export interface StringsListOutput {
/** The collection of pageable items. */
value: Array<string>;
/** The link to the next page of items. */
nextLink?: string;
}
/** Update file metadata. */
export interface UpdateFileOutput extends UpdateFileBaseOutput {
/** File identity, generated by server at import time. */
fileId: string;
/** Optional related files metadata used together DownloadHandler metadata to download payload file. */
relatedFiles?: Array<UpdateFileBaseOutput>;
/** Optional download handler for utilizing related files to download payload file. */
downloadHandler?: UpdateFileDownloadHandlerOutput;
/** File ETag. */
etag?: string;
}
/** Update file basic metadata. */
export interface UpdateFileBaseOutput {
/** File name. */
fileName: string;
/** File size in number of bytes. */
sizeInBytes: number;
/** Mapping of hashing algorithm to base64 encoded hash values. */
hashes: Record<string, string>;
/** File MIME type. */
mimeType?: string;
/** Anti-malware scan result. */
scanResult?: string;
/** Anti-malware scan details. */
scanDetails?: string;
/** Optional file properties (not consumed by service but pass-through to device). */
properties?: Record<string, string>;
}
/** Download handler for utilizing related files to download payload file. */
export interface UpdateFileDownloadHandlerOutput {
/** Download handler identifier. */
id: string;
}
/** The list of operations with server paging support. */
export interface UpdateOperationsListOutput {
/** The collection of pageable items. */
value: Array<UpdateOperationOutput>;
/** The link to the next page of items. */
nextLink?: string;
}
/** Operation metadata. */
export interface UpdateOperationOutput {
/** Operation Id. */
operationId: string;
/** Operation status. */
status: "NotStarted" | "Running" | "Succeeded" | "Failed";
/** The update being imported or deleted. For import, this property will only be populated after import manifest is processed successfully. */
update?: UpdateInfoOutput;
/** Location of the imported update when operation is successful. */
resourceLocation?: string;
/** Operation error encountered, if any. */
error?: ErrorModelOutput;
/** Operation correlation identity that can used by Microsoft Support for troubleshooting. */
traceId?: string;
/** Date and time in UTC when the operation status was last updated. */
lastActionDateTime: string;
/** Date and time in UTC when the operation was created. */
createdDateTime: string;
/** Operation ETag. */
etag?: string;
}
/** Update information. */
export interface UpdateInfoOutput {
/** Update identifier. */
updateId: UpdateIdOutput;
/** Update description. */
readonly description?: string;
/** Friendly update name. */
readonly friendlyName?: string;
}
/** The list of device classes. */
export interface DeviceClassesListOutput {
/** The collection of pageable items. */
value: Array<DeviceClassOutput>;
/** The link to the next page of items. */
nextLink?: string;
}
/** Device class metadata. */
export interface DeviceClassOutput {
/** The device class identifier. This is generated from the model Id and the compat properties reported by the device update agent in the Device Update PnP interface in IoT Hub. It is a hex-encoded SHA1 hash. */
deviceClassId: string;
/** The device class friendly name. This can be updated by callers after the device class has been automatically created. */
friendlyName?: string;
/** The device class properties that are used to calculate the device class Id */
deviceClassProperties: DeviceClassPropertiesOutput;
/** Update that is the highest version compatible with this device class. */
bestCompatibleUpdate?: UpdateInfoOutput;
}
/** The device class properties that are used to calculate the device class Id */
export interface DeviceClassPropertiesOutput {
/** The Device Update agent contract model. */
contractModel?: ContractModelOutput;
/** The compat properties of the device class. This object can be thought of as a set of key-value pairs where the key is the name of the compatibility property and the value is the value of the compatibility property. There will always be at least 1 compat property */
compatProperties: Record<string, string>;
}
/** The Device Update agent contract model. */
export interface ContractModelOutput {
/** The Device Update agent contract model Id of the device class. This is also used to calculate the device class Id. */
id: string;
/** The Device Update agent contract model name of the device class. Intended to be a more readable form of the contract model Id. */
name: string;
}
/** List of update information. */
export interface UpdateInfoListOutput {
/** The collection of pageable items. */
value: Array<UpdateInfoOutput>;
/** The link to the next page of items. */
nextLink?: string;
}
/** The list of devices. */
export interface DevicesListOutput {
/** The collection of pageable items. */
value: Array<DeviceOutput>;
/** The link to the next page of items. */
nextLink?: string;
}
/** Device metadata. */
export interface DeviceOutput {
/** Device identity. */
deviceId: string;
/** Device module identity. */
moduleId?: string;
/** Device class identity. */
deviceClassId: string;
/** Device group identity. */
groupId?: string;
/** The update that device last attempted to install. */
lastAttemptedUpdate?: UpdateInfoOutput;
/** State of the device in its last deployment. */
deploymentStatus?: "Succeeded" | "InProgress" | "Canceled" | "Failed";
/** Currently installed update on device. */
installedUpdate?: UpdateInfoOutput;
/** Boolean flag indicating whether the latest update (the best compatible update for the device's device class and group) is installed on the device */
onLatestUpdate: boolean;
/** The deployment identifier for the last deployment to the device */
lastDeploymentId?: string;
/** Last install result. */
lastInstallResult?: InstallResultOutput;
}
/** The install result of an update and any step results under it. */
export interface InstallResultOutput {
/** Install result code. */
resultCode: number;
/** Install extended result code */
extendedResultCode: number;
/** A string containing further details about the install result */
resultDetails?: string;
/** Array of step results */
stepResults?: Array<StepResultOutput>;
}
/** The step result under an update. */
export interface StepResultOutput {
/** The update that this step installs if it is of reference type. */
update?: UpdateInfoOutput;
/** Step description. */
description?: string;
/** Install result code. */
resultCode: number;
/** Install extended result code */
extendedResultCode: number;
/** A string containing further details about the install result */
resultDetails?: string;
}
/** Update compliance information. */
export interface UpdateComplianceOutput {
/** Total number of devices. */
totalDeviceCount: number;
/** Number of devices on the latest update. */
onLatestUpdateDeviceCount: number;
/** Number of devices with a newer update available. */
newUpdatesAvailableDeviceCount: number;
/** Number of devices with update in-progress. */
updatesInProgressDeviceCount: number;
}
/** The list of groups. */
export interface GroupsListOutput {
/** The collection of pageable items. */
value: Array<GroupOutput>;
/** The link to the next page of items. */
nextLink?: string;
}
/** Group details. */
export interface GroupOutput {
/** Group identity. This is created from the value of the ADUGroup tag in the Iot Hub's device/module twin or $default for devices with no tag. */
groupId: string;
/** Group type. */
groupType: "IoTHubTag" | "DefaultNoTag";
/** Date and time when the update was created. */
createdDateTime: string;
/** The number of devices in the group. */
deviceCount?: number;
/** The count of subgroups with new updates available. */
subgroupsWithNewUpdatesAvailableCount?: number;
/** The count of subgroups with updates in progress. */
subgroupsWithUpdatesInProgressCount?: number;
/** The count of subgroups with devices on the latest update. */
subgroupsWithOnLatestUpdateCount?: number;
/** The active deployment Ids for the group */
deployments?: Array<string>;
}
/** The list of updatable devices for a device class subgroup. */
export interface DeviceClassSubgroupUpdatableDevicesListOutput {
/** The collection of pageable items. */
value: Array<DeviceClassSubgroupUpdatableDevicesOutput>;
/** The link to the next page of items. */
nextLink?: string;
}
/** Device class subgroup, update information, and the number of devices for which the update is applicable. */
export interface DeviceClassSubgroupUpdatableDevicesOutput {
/** The group Id */
groupId: string;
/** The device class subgroup's device class Id */
deviceClassId: string;
/** Update information. */
update: UpdateInfoOutput;
/** Total number of devices for which the update is applicable. */
deviceCount: number;
}
/** The list of deployments. */
export interface DeploymentsListOutput {
/** The collection of pageable items. */
value: Array<DeploymentOutput>;
/** The link to the next page of items. */
nextLink?: string;
}
/** Deployment metadata. */
export interface DeploymentOutput {
/** The caller-provided deployment identifier. This cannot be longer than 73 characters, must be all lower-case, and cannot contain '&', '^', '[', ']', '{', '}', '|', '<', '>', forward slash, backslash, or double quote. The Updates view in the Azure Portal IoT Hub resource generates a GUID for deploymentId when you create a deployment. */
deploymentId: string;
/** The deployment start datetime. */
startDateTime: string;
/** Update information for the update in the deployment. */
update: UpdateInfoOutput;
/** The group identity for the devices the deployment is intended to update. */
groupId: string;
/** The device class subgroups the deployment is compatible with and subgroup deployments have been created for. This is not provided by the caller during CreateOrUpdateDeployment but is automatically determined by Device Update */
deviceClassSubgroups?: Array<string>;
/** Boolean flag indicating whether the deployment was canceled. */
isCanceled?: boolean;
/** Boolean flag indicating whether the deployment has been retried. */
isRetried?: boolean;
/** The rollback policy for the deployment. */
rollbackPolicy?: CloudInitiatedRollbackPolicyOutput;
/** Boolean flag indicating whether the deployment is a rollback deployment. */
isCloudInitiatedRollback?: boolean;
}
/** Rollback policy for deployment */
export interface CloudInitiatedRollbackPolicyOutput {
/** Update to rollback to. */
update: UpdateInfoOutput;
/** Failure conditions to initiate rollback policy. */
failure: CloudInitiatedRollbackPolicyFailureOutput;
}
/** Failure conditions to initiate rollback policy */
export interface CloudInitiatedRollbackPolicyFailureOutput {
/** Percentage of devices that failed. */
devicesFailedPercentage: number;
/** Number of devices that failed. */
devicesFailedCount: number;
}
/** Deployment status metadata. */
export interface DeploymentStatusOutput {
/** The group identity */
groupId: string;
/** The state of the deployment. */
deploymentState: "Active" | "ActiveWithSubgroupFailures" | "Failed" | "Inactive" | "Canceled";
/** The error details of the Failed state. This is not present if the deployment state is not Failed. */
error?: ErrorModelOutput;
/** The collection of device class subgroup status objects */
subgroupStatus: Array<DeviceClassSubgroupDeploymentStatusOutput>;
}
/** Device class subgroup deployment status metadata. */
export interface DeviceClassSubgroupDeploymentStatusOutput {
/** The group identity */
groupId: string;
/** The device class subgroup identity */
deviceClassId: string;
/** The state of the subgroup deployment. */
deploymentState: "Active" | "Failed" | "Inactive" | "Canceled";
/** The error details of the Failed state. This is not present if the deployment state is not Failed. */
error?: ErrorModelOutput;
/** The total number of devices in the deployment. */
totalDevices?: number;
/** The number of devices that are currently in deployment. */
devicesInProgressCount?: number;
/** The number of devices that have completed deployment with a failure. */
devicesCompletedFailedCount?: number;
/** The number of devices which have successfully completed deployment. */
devicesCompletedSucceededCount?: number;
/** The number of devices which have had their deployment canceled. */
devicesCanceledCount?: number;
}
/** The list of device class subgroups within a group. */
export interface DeviceClassSubgroupsListOutput {
/** The collection of pageable items. */
value: Array<DeviceClassSubgroupOutput>;
/** The link to the next page of items. */
nextLink?: string;
}
/** Device class subgroup details. A device class subgroup is a subset of devices in a group that share the same device class id. */
export interface DeviceClassSubgroupOutput {
/** Device class subgroup identity. This is generated from the model Id and the compat properties reported by the device update agent in the Device Update PnP interface in IoT Hub. It is a hex-encoded SHA1 hash. */
deviceClassId: string;
/** Group identity. */
groupId: string;
/** Date and time when the device class subgroup was created. */
createdDateTime: string;
/** The number of devices in the device class subgroup. */
deviceCount?: number;
/** The active deployment Id for the device class subgroup. */
deploymentId?: string;
}
/** The list of deployment device states. */
export interface DeploymentDeviceStatesListOutput {
/** The collection of pageable items. */
value: Array<DeploymentDeviceStateOutput>;
/** The link to the next page of items. */
nextLink?: string;
}
/** Deployment device status. */
export interface DeploymentDeviceStateOutput {
/** Device identity. */
deviceId: string;
/** Device module identity. */
moduleId?: string;
/** The number of times this deployment has been retried on this device. */
retryCount: number;
/** Boolean flag indicating whether this device is in a newer deployment and can no longer retry this deployment. */
movedOnToNewDeployment: boolean;
/** Deployment device state. */
deviceState: "Succeeded" | "InProgress" | "Canceled" | "Failed";
}
/** Operation metadata. */
export interface DeviceOperationOutput {
/** Operation Id. */
operationId: string;
/** Operation status. */
status: "NotStarted" | "Running" | "Succeeded" | "Failed";
/** Operation error encountered, if any. */
error?: ErrorModelOutput;
/** Operation correlation identity that can used by Microsoft Support for troubleshooting. */
traceId?: string;
/** Date and time in UTC when the operation status was last updated. */
lastActionDateTime: string;
/** Date and time in UTC when the operation was created. */
createdDateTime: string;
/** Operation ETag. */
etag?: string;
}
/** The list of device operations with server paging support. */
export interface DeviceOperationsListOutput {
/** The collection of pageable items. */
value: Array<DeviceOperationOutput>;
/** The link to the next page of items. */
nextLink?: string;
}
/** Diagnostics request body */
export interface LogCollectionOutput {
/** The log collection id. */
operationId?: string;
/** Array of Device Update agent ids */
deviceList: Array<DeviceUpdateAgentIdOutput>;
/** Description of the diagnostics operation. */
description?: string;
/** The timestamp when the operation was created. */
readonly createdDateTime?: string;
/** A timestamp for when the current state was entered. */
readonly lastActionDateTime?: string;
/** Operation status. */
readonly status?: "NotStarted" | "Running" | "Succeeded" | "Failed";
}
/** Device Update agent id */
export interface DeviceUpdateAgentIdOutput {
/** Device Id */
deviceId: string;
/** Module Id */
moduleId?: string;
}
/** The list of log collections with server paging support. */
export interface LogCollectionListOutput {
/** The collection of pageable items. */
value: Array<LogCollectionOutput>;
/** The link to the next page of items. */
nextLink?: string;
}
/** Device diagnostics operation detailed status */
export interface LogCollectionOperationDetailedStatusOutput {
/** The device diagnostics operation id. */
operationId?: string;
/** The timestamp when the operation was created. */
createdDateTime?: string;
/** A timestamp for when the current state was entered. */
lastActionDateTime?: string;
/** Operation status. */
status?: "NotStarted" | "Running" | "Succeeded" | "Failed";
/** Status of the devices in the operation */
deviceStatus?: Array<LogCollectionOperationDeviceStatusOutput>;
/** Device diagnostics operation description. */
description?: string;
}
/** Diagnostics operation device status */
export interface LogCollectionOperationDeviceStatusOutput {
/** Device id */
deviceId: string;
/** Module id. */
moduleId?: string;
/** Log upload status */
status: "NotStarted" | "Running" | "Succeeded" | "Failed";
/** Log upload result code */
resultCode?: string;
/** Log upload extended result code */
extendedResultCode?: string;
/** Log upload location */
logLocation?: string;
}
/** Array of Device Health, with server paging support. */
export interface DeviceHealthListOutput {
/** The collection of pageable items. */
value: Array<DeviceHealthOutput>;
/** The link to the next page of items. */
nextLink?: string;
}
/** Device Health */
export interface DeviceHealthOutput {
/** Device id */
deviceId: string;
/** Module id */
moduleId?: string;
/** Aggregate device health state */
state: "healthy" | "unhealthy";
/** Digital twin model Id */
digitalTwinModelId?: string;
/** Array of health checks and their results */
healthChecks: Array<HealthCheckOutput>;
}
/** Health check */
export interface HealthCheckOutput {
/** Health check name */
name?: string;
/** Health check result */
result?: "success" | "userError";
}
//# sourceMappingURL=outputModels.d.ts.map