Dela via


IndividualEnrollment Class

Definition

Representation of a single Device Provisioning Service enrollment and their accessors with a JSON serializer and deserializer.

public class IndividualEnrollment : Microsoft.Azure.Devices.Shared.IETagHolder
public class IndividualEnrollment
type IndividualEnrollment = class
    interface IETagHolder
type IndividualEnrollment = class
Public Class IndividualEnrollment
Implements IETagHolder
Public Class IndividualEnrollment
Inheritance
IndividualEnrollment
Implements

Examples

When serialized, an individualEnrollment will look like the following example:

{
    "registrationId":"validRegistrationId",
    "deviceId":"ContosoDevice-123",
    "attestation":{
        "type":"tpm",
        "tpm":{
               "endorsementKey":"validEndorsementKey"
        }
    },
    "iotHubHostName":"ContosoIoTHub.azure-devices.net",
    "provisioningStatus":"enabled"
}

The following JSON is a sample of the individualEnrollment response, received from the provisioning service.

{
    "registrationId":"validRegistrationId",
    "deviceId":"ContosoDevice-123",
    "attestation":{
        "type":"tpm",
        "tpm":{
            "endorsementKey":"validEndorsementKey"
        }
    },
    "iotHubHostName":"ContosoIoTHub.azure-devices.net",
    "provisioningStatus":"enabled"
    "createdDateTimeUtc": "2017-09-28T16:29:42.3447817Z",
    "lastUpdatedDateTimeUtc": "2017-09-28T16:29:42.3447817Z",
    "etag": "\"00000000-0000-0000-0000-00000000000\""
}

Remarks

This object is used to send and receive individualEnrollment information to and from the provisioning service.

To create or update an Enrollment on the provisioning service you should fill this object and call the public API CreateOrUpdateAsync(IndividualEnrollment, CancellationToken).

The minimum information required by the provisioning service is the RegistrationId and the Attestation.

A new device can be provisioned by three attestation mechanisms, X509 (X509Attestation), Symmetric Key (see SymmetricKeyAttestation, and TPM (TpmAttestation). The definition of each one you should use depending on the physical authentication hardware that the device contains.

The content of this class will be serialized in a JSON format and sent as a body of the rest API to the provisioning service. Or the content of this class can be filled by a JSON, received from the provisioning service, as result of a individualEnrollment operation like create, update, or query.

Constructors

IndividualEnrollment(String, Attestation)

Creates a new instance of IndividualEnrollment.

Properties

AllocationPolicy

The allocation policy of this resource. Overrides the tenant level allocation policy.

Attestation

Attestation.

Capabilities

Capabilities of the device.

CreatedDateTimeUtc

The DateTime this resource was created.

CreatedOnUtc

The DateTime this resource was created.

CustomAllocationDefinition

Custom allocation definition.

DeviceId

Desired IoT hub device Id (optional).

ETag

Enrollment's ETag.

InitialTwinState

Initial twin state.

IotHubHostName

Desired IoT hub to assign the device to.

IotHubs

The list of names of IoT hubs the device in this resource can be allocated to. Must be a subset of tenant level list of IoT hubs.

LastUpdatedDateTimeUtc

The DateTime this resource was last updated.

LastUpdatedOnUtc

The DateTime this resource was last updated.

ProvisioningStatus

The provisioning status.

RegistrationId

Registration Id.

RegistrationState

Current registration state.

ReprovisionPolicy

The behavior when a device is re-provisioned to an IoT hub.

Methods

ToString()

Convert this object in a pretty print format.

Applies to