mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-04-16 07:26:37 +00:00
device register: Add support for the --deviceType
option
Resolves: #2531 Change-type: minor Signed-off-by: Thodoris Greasidis <thodoris@balena.io>
This commit is contained in:
parent
f99244603a
commit
34b4ac2d9f
@ -1037,6 +1037,7 @@ Examples:
|
||||
$ balena device register MyFleet
|
||||
$ balena device register MyFleet --uuid <uuid>
|
||||
$ balena device register myorg/myfleet --uuid <uuid>
|
||||
$ balena device register myorg/myfleet --uuid <uuid> --deviceType <deviceTypeSlug>
|
||||
|
||||
### Arguments
|
||||
|
||||
@ -1050,6 +1051,10 @@ fleet name or slug (preferred)
|
||||
|
||||
custom uuid
|
||||
|
||||
#### --deviceType DEVICETYPE
|
||||
|
||||
device type slug (run 'balena devices supported' for possible values)
|
||||
|
||||
## device rename <uuid> [newName]
|
||||
|
||||
Rename a device.
|
||||
|
@ -25,6 +25,7 @@ import { applicationIdInfo } from '../../utils/messages';
|
||||
|
||||
interface FlagsDef {
|
||||
uuid?: string;
|
||||
deviceType?: string;
|
||||
help: void;
|
||||
}
|
||||
|
||||
@ -47,6 +48,7 @@ export default class DeviceRegisterCmd extends Command {
|
||||
'$ balena device register MyFleet',
|
||||
'$ balena device register MyFleet --uuid <uuid>',
|
||||
'$ balena device register myorg/myfleet --uuid <uuid>',
|
||||
'$ balena device register myorg/myfleet --uuid <uuid> --deviceType <deviceTypeSlug>',
|
||||
];
|
||||
|
||||
public static args: Array<IArg<any>> = [ca.fleetRequired];
|
||||
@ -58,6 +60,10 @@ export default class DeviceRegisterCmd extends Command {
|
||||
description: 'custom uuid',
|
||||
char: 'u',
|
||||
}),
|
||||
deviceType: flags.string({
|
||||
description:
|
||||
"device type slug (run 'balena devices supported' for possible values)",
|
||||
}),
|
||||
help: cf.help,
|
||||
};
|
||||
|
||||
@ -77,7 +83,11 @@ export default class DeviceRegisterCmd extends Command {
|
||||
|
||||
console.info(`Registering to ${application.slug}: ${uuid}`);
|
||||
|
||||
const result = await balena.models.device.register(application.id, uuid);
|
||||
const result = await balena.models.device.register(
|
||||
application.id,
|
||||
uuid,
|
||||
options.deviceType,
|
||||
);
|
||||
|
||||
return result && result.uuid;
|
||||
}
|
||||
|
4
npm-shrinkwrap.json
generated
4
npm-shrinkwrap.json
generated
@ -4616,7 +4616,7 @@
|
||||
"buffer-shims": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz",
|
||||
"integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E="
|
||||
"integrity": "sha512-Zy8ZXMyxIT6RMTeY7OP/bDndfj6bwCan7SS98CEndS6deHwWPpseeHlwarNcBim+etXnF9HBc1non5JgDaJU1g=="
|
||||
},
|
||||
"buffers": {
|
||||
"version": "0.1.1",
|
||||
@ -16909,7 +16909,7 @@
|
||||
"bluebird": {
|
||||
"version": "3.4.7",
|
||||
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.4.7.tgz",
|
||||
"integrity": "sha1-9y12C+Cbf3bQjtj66Ysomo0F+rM="
|
||||
"integrity": "sha512-iD3898SR7sWVRHbiQv+sHUtHnMvC1o3nW5rAcqnq3uOn07DSAppZYUkIGslDz6gXC7HfunPe7YVBgoEJASPcHA=="
|
||||
},
|
||||
"process-nextick-args": {
|
||||
"version": "1.0.7",
|
||||
|
Loading…
x
Reference in New Issue
Block a user