Class DeviceRegistrationBulkService

This class allows for bulk registering devices.

Constructors

Methods

Constructors

Methods

  • A new device registration as bulk.

    Parameters

    • inputFile:
          | Stream
          | Blob
          | Buffer
          | File

    Returns Promise<IResult<IDeviceRegistrationBulkResult>>

    Response wrapped in [[IResult]]

    Example


    const csvString = `
    ID,CREDENTIALS,TENANT,TYPE,NAME,ICCID,IDTYPE,PATH,SHELL
    e2eDeviceRegistrationId,e2epassword123!,e2edocker,c8y_e2eDevice,e2eDevice,123456789,89456,e2eDeviceGroup,1
    900001,e2epassword123!,e2edocker,c8y_e2eDevice1,e2eDevice1,123456789,89456,e2eDeviceGroup,1
    900002,e2epassword123!,e2edocker,c8y_e2eDevice2,e2eDevice2,123456789,89456,e2eDeviceGroup,1`.trim();

    const csvBuffer = Buffer.from(csvString):

    (async () => {
    const {data, res} = await deviceRegistrationBulkService.create(csvBuffer);
    })();