共用方式為


EnrollmentGroup Class

Definition

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

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

Examples

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

{
   "enrollmentGroupId":"validEnrollmentGroupId",
   "attestation":{
       "type":"x509",
       "signingCertificates":{
           "primary":{
               "certificate":"[valid certificate]"
           }
       }
   },
   "iotHubHostName":"ContosoIoTHub.azure-devices.net",
   "provisioningStatus":"enabled"
}

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

{
   "enrollmentGroupId":"validEnrollmentGroupId",
   "attestation":{
       "type":"x509",
       "signingCertificates":{
           "primary":{
               "certificate":"[valid certificate]",
               "info": {
                   "subjectName": "CN=ROOT_00000000-0000-0000-0000-000000000000, OU=Azure IoT, O=MSFT, C=US",
                   "sha1Thumbprint": "0000000000000000000000000000000000",
                   "sha256Thumbprint": "validEnrollmentGroupId",
                   "issuerName": "CN=ROOT_00000000-0000-0000-0000-000000000000, OU=Azure IoT, O=MSFT, C=US",
                   "notBeforeUtc": "2017-11-14T12:34:18Z",
                   "notAfterUtc": "2017-11-20T12:34:18Z",
                   "serialNumber": "000000000000000000",
                   "version": 3
               }
           }
       }
   },
   "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 EnrollmentGroup information to the provisioning service, or receive EnrollmentGroup information from the provisioning service.

To create or update an EnrollmentGroup on the provisioning service you should fill this object and call the public API {@link ProvisioningServiceClient#createOrUpdateEnrollmentGroup(EnrollmentGroup)}. The minimum information required by the provisioning service is the {@link #enrollmentGroupId} and the {@link #attestation}.

To provision a device using EnrollmentGroup, it must contain a X509 chip with a signingCertificate for the {@link X509Attestation} mechanism.

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.

The content of this class can be filled by a JSON, received from the provisioning service, as result of a EnrollmentGroup operation like create, update, or query EnrollmentGroup.

Constructors

EnrollmentGroup(String, Attestation)

Creates a new instance of EnrollmentGroup.

Properties

AllocationPolicy

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

Attestation

Getter and setter for Attestation.

Capabilities

Capabilities of the device.

CreatedDateTimeUtc

The DateTime this resource was created.

CreatedOnUtc

The DateTime this resource was created.

CustomAllocationDefinition

Custom allocation definition.

EnrollmentGroupId

Enrollment Group Id.

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(s) 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.

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