Optional
realtime: RealtimeAccepts the device registration for given id.
entity or id of registration. Using an entity object one can pass a securityToken as string next to the id.
Optional
securityToken: stringoptional security token to reduce the risk of devices which are not yet registered being taken over by threat actors.
Examples
const id = 'abc';
(async () => {
const {data, res} = await deviceRegistrationService.accept(id);
})();
const entity = { id: 'abc', securityToken: '<secretToken>' };
(async () => {
const {data, res} = await deviceRegistrationService.accept(entity);
})();
const id = 'abc';
const securityToken = '<secretToken>';
(async () => {
const {data, res} = await deviceRegistrationService.accept(id, securityToken);
})();
Providing a securityToken within an entity object together with another securityToken as a parameter of the
method will always use the securityToken of the entity object. In the example below
const entity = { id: 'abc', securityToken: '<secretTokenA>'};
const securityToken = '<secretTokenB>';
(async () => {
const {data, res} = await deviceRegistrationService.accept(entity, securityToken);
})();
Response wrapped in [[IResult]]
Accepts the device registration for all registrations in pending acceptance.
Response wrapped in [[IResultList]]
Example
(async () => {
const {data, res} = await deviceRegistrationService.acceptAll();
})();
Bootstraps the device with given id.
entity or id of registration. Using an entity object one can pass a securityToken as string next to the id.
for details see [[IDeviceBootstrapOptions]]
Optional
securityToken: stringoptional security token to reduce the risk of devices which are not yet registered being taken over by threat actors.
Examples
const id: 'abc';
const options: IDeviceBootstrapOptions = {
basicAuthToken: 'Basic dGVuYW50L3VzZXJuYW1lOnBhc3N3b3Jk',
basicAuth: {
user: 'username',
pass: 'password'
}
};
(async () => {
const {data, res} = await deviceRegistrationService.bootstrap(id, options);
})();
const entity: { id: '123', securityToken: '<secretToken>'};
const options: IDeviceBootstrapOptions = {
basicAuthToken: 'Basic dGVuYW50L3VzZXJuYW1lOnBhc3N3b3Jk',
basicAuth: {
user: 'username',
pass: 'password'
}
};
(async () => {
const {data, res} = await deviceRegistrationService.bootstrap(entity, options);
})();
const id: '123';
const options: IDeviceBootstrapOptions = {
basicAuthToken: 'Basic dGVuYW50L3VzZXJuYW1lOnBhc3N3b3Jk',
basicAuth: {
user: 'username',
pass: 'password'
}
};
const securityToken: '<secretToken>'
(async () => {
const {data, res} = await deviceRegistrationService.bootstrap(id, options, securityToken);
})();
Providing a securityToken within an entity object together with another securityToken as a parameter of the
method will always use the securityToken of the entity object. In the example below
const options: IDeviceBootstrapOptions = {
basicAuthToken: 'Basic dGVuYW50L3VzZXJuYW1lOnBhc3N3b3Jk',
basicAuth: {
user: 'username',
pass: 'password'
}
};
const entity: { id: '123', securityToken: '<secretTokenA>'};
const securityToken: '<secretTokenB>'
(async () => {
const {data, res} = await deviceRegistrationService.accept(entity, securityToken);
})();
Creates a new device registration.
Device registration object with mandantory fragments.
Response wrapped in [[IResult]]
Example
const mandantoryObject: IDeviceRegistrationCreate = {
id: 1,
};
(async () => {
const {data, res} = await deviceRegistrationService.create(mandantoryObject);
})();
Removes an registration with given id.
entity or id of the registration.
Example
const id = 'abc';
(async () => {
const {data, res} = await deviceRegistrationService.delete(id);
// data will be null
})();
Response wrapped in [[IResult]]
Gets the details of device registration.
Entity or Id of the entity.
Response wrapped in [[IResult]]
Example
const entityId: number = 1;
(async () => {
const {data, res} = await deviceRegistrationService.detail(entityId);
})();
Gets limitation information for registering devices to the platform
Response wrapped in [[IResult]]
Example
(async () => {
const {data, res} = await deviceRegistrationService.limit();
})();
Gets the list of device registrations by parameters.
Object containing filters for querying registrations.
Example
const filter: object = {
pageSize: 100,
withTotalPages: true
};
(async () => {
const {data, res, paging} = await deviceRegistrationService.list(filter);
})();
Response wrapped in [[IResultList]]
This class allows registration of a new device.