mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-04-07 03:16:42 +00:00
Merge pull request #2877 from balena-io/devices-support-to-device-type-list
Add alias `device-type list` for command `devices supported`
This commit is contained in:
commit
f52e218290
@ -8,14 +8,14 @@ _balena() {
|
||||
local context state line curcontext="$curcontext"
|
||||
|
||||
# Valid top-level completions
|
||||
main_commands=( api-key app block build config deploy device devices env fleet internal join leave local login logout organization os preload push release settings ssh-key support tag util version whoami )
|
||||
main_commands=( api-key app block build config deploy device device-type env fleet internal join leave local login logout organization os preload push release settings ssh-key support tag util version whoami )
|
||||
# Sub-completions
|
||||
api_key_cmds=( generate list revoke )
|
||||
app_cmds=( create )
|
||||
block_cmds=( create )
|
||||
config_cmds=( generate inject read reconfigure write )
|
||||
device_type_cmds=( list )
|
||||
device_cmds=( deactivate detect identify init list local-mode logs move note os-update pin public-url purge reboot register rename restart rm shutdown ssh start-service stop-service track-fleet tunnel )
|
||||
devices_cmds=( supported )
|
||||
env_cmds=( list rename rm set )
|
||||
fleet_cmds=( create list pin purge rename restart rm track-latest )
|
||||
internal_cmds=( osinit )
|
||||
@ -55,12 +55,12 @@ _balena_sec_cmds() {
|
||||
"config")
|
||||
_describe -t config_cmds 'config_cmd' config_cmds "$@" && ret=0
|
||||
;;
|
||||
"device-type")
|
||||
_describe -t device_type_cmds 'device-type_cmd' device_type_cmds "$@" && ret=0
|
||||
;;
|
||||
"device")
|
||||
_describe -t device_cmds 'device_cmd' device_cmds "$@" && ret=0
|
||||
;;
|
||||
"devices")
|
||||
_describe -t devices_cmds 'devices_cmd' devices_cmds "$@" && ret=0
|
||||
;;
|
||||
"env")
|
||||
_describe -t env_cmds 'env_cmd' env_cmds "$@" && ret=0
|
||||
;;
|
||||
|
@ -7,14 +7,14 @@ _balena_complete()
|
||||
local cur prev
|
||||
|
||||
# Valid top-level completions
|
||||
main_commands="api-key app block build config deploy device devices env fleet internal join leave local login logout organization os preload push release settings ssh-key support tag util version whoami"
|
||||
main_commands="api-key app block build config deploy device device-type env fleet internal join leave local login logout organization os preload push release settings ssh-key support tag util version whoami"
|
||||
# Sub-completions
|
||||
api_key_cmds="generate list revoke"
|
||||
app_cmds="create"
|
||||
block_cmds="create"
|
||||
config_cmds="generate inject read reconfigure write"
|
||||
device_type_cmds="list"
|
||||
device_cmds="deactivate detect identify init list local-mode logs move note os-update pin public-url purge reboot register rename restart rm shutdown ssh start-service stop-service track-fleet tunnel"
|
||||
devices_cmds="supported"
|
||||
env_cmds="list rename rm set"
|
||||
fleet_cmds="create list pin purge rename restart rm track-latest"
|
||||
internal_cmds="osinit"
|
||||
@ -49,12 +49,12 @@ _balena_complete()
|
||||
config)
|
||||
COMPREPLY=( $(compgen -W "$config_cmds" -- $cur) )
|
||||
;;
|
||||
device-type)
|
||||
COMPREPLY=( $(compgen -W "$device_type_cmds" -- $cur) )
|
||||
;;
|
||||
device)
|
||||
COMPREPLY=( $(compgen -W "$device_cmds" -- $cur) )
|
||||
;;
|
||||
devices)
|
||||
COMPREPLY=( $(compgen -W "$devices_cmds" -- $cur) )
|
||||
;;
|
||||
env)
|
||||
COMPREPLY=( $(compgen -W "$env_cmds" -- $cur) )
|
||||
;;
|
||||
|
@ -193,6 +193,10 @@ are encouraged to regularly update the balena CLI to the latest version.
|
||||
- [build](#build)
|
||||
- [deploy](#deploy)
|
||||
|
||||
- Device-type
|
||||
|
||||
- [device-type list](#device-type-list)
|
||||
|
||||
- Devices
|
||||
|
||||
- [device deactivate](#device-deactivate)
|
||||
@ -220,7 +224,6 @@ are encouraged to regularly update the balena CLI to the latest version.
|
||||
- [device stop-service](#device-stop-service)
|
||||
- [device track-fleet](#device-track-fleet)
|
||||
- [device tunnel](#device-tunnel)
|
||||
- [devices supported](#devices-supported)
|
||||
|
||||
- Environment Variables
|
||||
|
||||
@ -397,7 +400,7 @@ should be provided. Organization handles can be listed with the
|
||||
`balena organization list` command.
|
||||
|
||||
The app's default device type is specified with the `--type` option.
|
||||
The `balena devices supported` command can be used to list the available
|
||||
The `balena device-type list` command can be used to list the available
|
||||
device types.
|
||||
|
||||
Interactive dropdowns will be shown for selection if no device type or
|
||||
@ -426,7 +429,7 @@ handle of the organization the app should belong to
|
||||
|
||||
#### -t, --type TYPE
|
||||
|
||||
app device type (Check available types with `balena devices supported`)
|
||||
app device type (Check available types with `balena device-type list`)
|
||||
|
||||
# Authentication
|
||||
|
||||
@ -527,7 +530,7 @@ should be provided. Organization handles can be listed with the
|
||||
`balena organization list` command.
|
||||
|
||||
The block's default device type is specified with the `--type` option.
|
||||
The `balena devices supported` command can be used to list the available
|
||||
The `balena device-type list` command can be used to list the available
|
||||
device types.
|
||||
|
||||
Interactive dropdowns will be shown for selection if no device type or
|
||||
@ -556,7 +559,7 @@ handle of the organization the block should belong to
|
||||
|
||||
#### -t, --type TYPE
|
||||
|
||||
block device type (Check available types with `balena devices supported`)
|
||||
block device type (Check available types with `balena device-type list`)
|
||||
|
||||
# Config
|
||||
|
||||
@ -638,7 +641,7 @@ custom device key - note that this is only supported on balenaOS 2.0.3+
|
||||
|
||||
#### --deviceType DEVICETYPE
|
||||
|
||||
device type slug (run 'balena devices supported' for possible values)
|
||||
device type slug (run 'balena device-type list' for possible values)
|
||||
|
||||
#### --generate-device-api-key
|
||||
|
||||
@ -1220,6 +1223,47 @@ Docker host TLS certificate file
|
||||
|
||||
Docker host TLS key file
|
||||
|
||||
# Device-type
|
||||
|
||||
## device-type list
|
||||
|
||||
### Aliases
|
||||
|
||||
- `devices supported`
|
||||
|
||||
|
||||
To use one of the aliases, replace `device-type list` with the alias.
|
||||
|
||||
### Description
|
||||
|
||||
List the device types supported by balena (like 'raspberrypi3' or 'intel-nuc').
|
||||
|
||||
By default, only actively supported device types are listed.
|
||||
The --all option can be used to list all device types, including those that are
|
||||
no longer supported by balena.
|
||||
|
||||
The --json option is recommended when scripting the output of this command,
|
||||
because the JSON format is less likely to change and it better represents data
|
||||
types like lists and empty strings (for example, the ALIASES column contains a
|
||||
list of zero or more values). The 'jq' utility may be helpful in shell scripts
|
||||
(https://stedolan.github.io/jq/manual/).
|
||||
|
||||
Examples:
|
||||
|
||||
$ balena device-type list
|
||||
$ balena device-type list --all
|
||||
$ balena device-type list --json
|
||||
|
||||
### Options
|
||||
|
||||
#### -j, --json
|
||||
|
||||
produce JSON output instead of tabular output
|
||||
|
||||
#### --all
|
||||
|
||||
include device types no longer supported by balena
|
||||
|
||||
# Devices
|
||||
|
||||
## device deactivate
|
||||
@ -1826,7 +1870,7 @@ custom uuid
|
||||
|
||||
#### --deviceType DEVICETYPE
|
||||
|
||||
device type slug (run 'balena devices supported' for possible values)
|
||||
device type slug (run 'balena device-type list' for possible values)
|
||||
|
||||
## device rename
|
||||
|
||||
@ -2138,29 +2182,6 @@ device UUID or fleet name/slug
|
||||
|
||||
port mapping in the format <remotePort>[:[localIP:]localPort]
|
||||
|
||||
## devices supported
|
||||
|
||||
### Description
|
||||
|
||||
List the supported device types (like 'raspberrypi3' or 'intel-nuc').
|
||||
|
||||
The --json option is recommended when scripting the output of this command,
|
||||
because the JSON format is less likely to change and it better represents data
|
||||
types like lists and empty strings (for example, the ALIASES column contains a
|
||||
list of zero or more values). The 'jq' utility may be helpful in shell scripts
|
||||
(https://stedolan.github.io/jq/manual/).
|
||||
|
||||
Examples:
|
||||
|
||||
$ balena devices supported
|
||||
$ balena devices supported --json
|
||||
|
||||
### Options
|
||||
|
||||
#### -j, --json
|
||||
|
||||
produce JSON output instead of tabular output
|
||||
|
||||
# Environment Variables
|
||||
|
||||
## env list
|
||||
@ -2479,7 +2500,7 @@ should be provided. Organization handles can be listed with the
|
||||
`balena organization list` command.
|
||||
|
||||
The fleet's default device type is specified with the `--type` option.
|
||||
The `balena devices supported` command can be used to list the available
|
||||
The `balena device-type list` command can be used to list the available
|
||||
device types.
|
||||
|
||||
Interactive dropdowns will be shown for selection if no device type or
|
||||
@ -2508,7 +2529,7 @@ handle of the organization the fleet should belong to
|
||||
|
||||
#### -t, --type TYPE
|
||||
|
||||
fleet device type (Check available types with `balena devices supported`)
|
||||
fleet device type (Check available types with `balena device-type list`)
|
||||
|
||||
## fleet
|
||||
|
||||
@ -2992,7 +3013,7 @@ expiry date assigned to generated provisioning api key (format: YYYY-MM-DD)
|
||||
### Description
|
||||
|
||||
Download an unconfigured OS image for the specified device type.
|
||||
Check available device types with 'balena devices supported'.
|
||||
Check available device types with 'balena device-type list'.
|
||||
|
||||
Note: Currently this command only works with balenaCloud, not openBalena.
|
||||
If using openBalena, please download the OS from: https://www.balena.io/os/
|
||||
@ -3071,7 +3092,7 @@ path to OS image
|
||||
|
||||
#### -t, --type TYPE
|
||||
|
||||
device type (Check available types with `balena devices supported`)
|
||||
device type (Check available types with `balena device-type list`)
|
||||
|
||||
#### -d, --drive DRIVE
|
||||
|
||||
@ -3088,7 +3109,7 @@ answer "yes" to all questions (non interactive use)
|
||||
### Description
|
||||
|
||||
Show the available balenaOS versions for the given device type.
|
||||
Check available types with `balena devices supported`.
|
||||
Check available types with `balena device-type list`.
|
||||
|
||||
balenaOS ESR versions can be listed with the '--esr' option. See also:
|
||||
https://www.balena.io/docs/reference/OS/extended-support-release/
|
||||
|
82
npm-shrinkwrap.json
generated
82
npm-shrinkwrap.json
generated
@ -1189,19 +1189,21 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-string-parser": {
|
||||
"version": "7.25.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.7.tgz",
|
||||
"integrity": "sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g==",
|
||||
"version": "7.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz",
|
||||
"integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-validator-identifier": {
|
||||
"version": "7.25.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.7.tgz",
|
||||
"integrity": "sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==",
|
||||
"version": "7.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz",
|
||||
"integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
@ -1262,12 +1264,13 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@babel/parser": {
|
||||
"version": "7.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.8.tgz",
|
||||
"integrity": "sha512-HcttkxzdPucv3nNFmfOOMfFf64KgdJVqm1KaCm25dPGMLElo9nsLvXeJECQg8UzPuBGLyTSA0ZzqCtDSzKTEoQ==",
|
||||
"version": "7.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.9.tgz",
|
||||
"integrity": "sha512-aI3jjAAO1fh7vY/pBGsn1i9LDbRP43+asrRlkPuTXW5yHXtd1NgTEMudbBoDDxrf1daEEfPJqR+JBMakzrR4Dg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.25.8"
|
||||
"@babel/types": "^7.25.9"
|
||||
},
|
||||
"bin": {
|
||||
"parser": "bin/babel-parser.js"
|
||||
@ -1277,14 +1280,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/parser/node_modules/@babel/types": {
|
||||
"version": "7.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.8.tgz",
|
||||
"integrity": "sha512-JWtuCu8VQsMladxVz/P4HzHUGCAwpuqacmowgXFs5XjxIgKuNjnLokQzuVjlTvIzODaDmpjT3oxcC48vyk9EWg==",
|
||||
"version": "7.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.9.tgz",
|
||||
"integrity": "sha512-OwS2CM5KocvQ/k7dFJa8i5bNGJP0hXWfVCfDkqRFP1IreH1JDC7wG6eCYCi0+McbfT8OR/kNqsI0UU0xP9H6PQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/helper-string-parser": "^7.25.7",
|
||||
"@babel/helper-validator-identifier": "^7.25.7",
|
||||
"to-fast-properties": "^2.0.0"
|
||||
"@babel/helper-string-parser": "^7.25.9",
|
||||
"@babel/helper-validator-identifier": "^7.25.9"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
@ -1305,14 +1308,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/template/node_modules/@babel/types": {
|
||||
"version": "7.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.8.tgz",
|
||||
"integrity": "sha512-JWtuCu8VQsMladxVz/P4HzHUGCAwpuqacmowgXFs5XjxIgKuNjnLokQzuVjlTvIzODaDmpjT3oxcC48vyk9EWg==",
|
||||
"version": "7.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.9.tgz",
|
||||
"integrity": "sha512-OwS2CM5KocvQ/k7dFJa8i5bNGJP0hXWfVCfDkqRFP1IreH1JDC7wG6eCYCi0+McbfT8OR/kNqsI0UU0xP9H6PQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/helper-string-parser": "^7.25.7",
|
||||
"@babel/helper-validator-identifier": "^7.25.7",
|
||||
"to-fast-properties": "^2.0.0"
|
||||
"@babel/helper-string-parser": "^7.25.9",
|
||||
"@babel/helper-validator-identifier": "^7.25.9"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
@ -1340,12 +1343,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/traverse/node_modules/@babel/generator": {
|
||||
"version": "7.25.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.7.tgz",
|
||||
"integrity": "sha512-5Dqpl5fyV9pIAD62yK9P7fcA768uVPUyrQmqpqstHWgMma4feF1x/oFysBCVZLY5wJ2GkMUCdsNDnGZrPoR6rA==",
|
||||
"version": "7.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.9.tgz",
|
||||
"integrity": "sha512-omlUGkr5EaoIJrhLf9CJ0TvjBRpd9+AXRG//0GEQ9THSo8wPiTlbpy1/Ow8ZTrbXpjd9FHXfbFQx32I04ht0FA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.25.7",
|
||||
"@babel/types": "^7.25.9",
|
||||
"@jridgewell/gen-mapping": "^0.3.5",
|
||||
"@jridgewell/trace-mapping": "^0.3.25",
|
||||
"jsesc": "^3.0.2"
|
||||
@ -1355,14 +1359,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/traverse/node_modules/@babel/types": {
|
||||
"version": "7.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.8.tgz",
|
||||
"integrity": "sha512-JWtuCu8VQsMladxVz/P4HzHUGCAwpuqacmowgXFs5XjxIgKuNjnLokQzuVjlTvIzODaDmpjT3oxcC48vyk9EWg==",
|
||||
"version": "7.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.9.tgz",
|
||||
"integrity": "sha512-OwS2CM5KocvQ/k7dFJa8i5bNGJP0hXWfVCfDkqRFP1IreH1JDC7wG6eCYCi0+McbfT8OR/kNqsI0UU0xP9H6PQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/helper-string-parser": "^7.25.7",
|
||||
"@babel/helper-validator-identifier": "^7.25.7",
|
||||
"to-fast-properties": "^2.0.0"
|
||||
"@babel/helper-string-parser": "^7.25.9",
|
||||
"@babel/helper-validator-identifier": "^7.25.9"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
@ -3743,9 +3747,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "20.16.13",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.13.tgz",
|
||||
"integrity": "sha512-GjQ7im10B0labo8ZGXDGROUl9k0BNyDgzfGpb4g/cl+4yYDWVKcozANF4FGr4/p0O/rAkQClM6Wiwkije++1Tg==",
|
||||
"version": "20.16.15",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.15.tgz",
|
||||
"integrity": "sha512-DV58qQz9dBMqVVn+qnKwGa51QzCD4YM/tQM16qLKxdf5tqz5W4QwtrMzjSTbabN1cFTSuyxVYBy+QWHjWW8X/g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"undici-types": "~6.19.2"
|
||||
}
|
||||
@ -5405,9 +5410,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/balena-sdk/node_modules/@types/node": {
|
||||
"version": "18.19.57",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.57.tgz",
|
||||
"integrity": "sha512-I2ioBd/IPrYDMv9UNR5NlPElOZ68QB7yY5V2EsLtSrTO0LM0PnCEFF9biLWHf5k+sIy4ohueCV9t4gk1AEdlVA==",
|
||||
"version": "18.19.59",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.59.tgz",
|
||||
"integrity": "sha512-vizm2EqwV/7Zay+A6J3tGl9Lhr7CjZe2HmWS988sefiEmsyP9CeXEleho6i4hJk/8UtZAo0bWN4QPZZr83RxvQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"undici-types": "~5.26.4"
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ export default class AppCreateCmd extends Command {
|
||||
\`balena organization list\` command.
|
||||
|
||||
The app's default device type is specified with the \`--type\` option.
|
||||
The \`balena devices supported\` command can be used to list the available
|
||||
The \`balena device-type list\` command can be used to list the available
|
||||
device types.
|
||||
|
||||
Interactive dropdowns will be shown for selection if no device type or
|
||||
@ -62,7 +62,7 @@ export default class AppCreateCmd extends Command {
|
||||
type: Flags.string({
|
||||
char: 't',
|
||||
description:
|
||||
'app device type (Check available types with `balena devices supported`)',
|
||||
'app device type (Check available types with `balena device-type list`)',
|
||||
}),
|
||||
help: cf.help,
|
||||
};
|
||||
|
@ -31,7 +31,7 @@ export default class BlockCreateCmd extends Command {
|
||||
\`balena organization list\` command.
|
||||
|
||||
The block's default device type is specified with the \`--type\` option.
|
||||
The \`balena devices supported\` command can be used to list the available
|
||||
The \`balena device-type list\` command can be used to list the available
|
||||
device types.
|
||||
|
||||
Interactive dropdowns will be shown for selection if no device type or
|
||||
@ -62,7 +62,7 @@ export default class BlockCreateCmd extends Command {
|
||||
type: Flags.string({
|
||||
char: 't',
|
||||
description:
|
||||
'block device type (Check available types with `balena devices supported`)',
|
||||
'block device type (Check available types with `balena device-type list`)',
|
||||
}),
|
||||
help: cf.help,
|
||||
};
|
||||
|
@ -82,7 +82,7 @@ export default class ConfigGenerateCmd extends Command {
|
||||
}),
|
||||
deviceType: Flags.string({
|
||||
description:
|
||||
"device type slug (run 'balena devices supported' for possible values)",
|
||||
"device type slug (run 'balena device-type list' for possible values)",
|
||||
}),
|
||||
'generate-device-api-key': Flags.boolean({
|
||||
description: 'generate a fresh device key for the device',
|
||||
|
@ -20,11 +20,17 @@ import * as _ from 'lodash';
|
||||
import * as cf from '../../utils/common-flags';
|
||||
import { getBalenaSdk, getVisuals, stripIndent } from '../../utils/lazy';
|
||||
|
||||
export default class DevicesSupportedCmd extends Command {
|
||||
public static description = stripIndent`
|
||||
List the supported device types (like 'raspberrypi3' or 'intel-nuc').
|
||||
export default class DeviceTypeListCmd extends Command {
|
||||
public static aliases = ['devices supported'];
|
||||
|
||||
List the supported device types (like 'raspberrypi3' or 'intel-nuc').
|
||||
public static description = stripIndent`
|
||||
List the device types supported by balena (like 'raspberrypi3' or 'intel-nuc').
|
||||
|
||||
List the device types supported by balena (like 'raspberrypi3' or 'intel-nuc').
|
||||
|
||||
By default, only actively supported device types are listed.
|
||||
The --all option can be used to list all device types, including those that are
|
||||
no longer supported by balena.
|
||||
|
||||
The --json option is recommended when scripting the output of this command,
|
||||
because the JSON format is less likely to change and it better represents data
|
||||
@ -33,8 +39,9 @@ export default class DevicesSupportedCmd extends Command {
|
||||
(https://stedolan.github.io/jq/manual/).
|
||||
`;
|
||||
public static examples = [
|
||||
'$ balena devices supported',
|
||||
'$ balena devices supported --json',
|
||||
'$ balena device-type list',
|
||||
'$ balena device-type list --all',
|
||||
'$ balena device-type list --json',
|
||||
];
|
||||
|
||||
public static flags = {
|
||||
@ -43,10 +50,14 @@ export default class DevicesSupportedCmd extends Command {
|
||||
char: 'j',
|
||||
description: 'produce JSON output instead of tabular output',
|
||||
}),
|
||||
all: Flags.boolean({
|
||||
description: 'include device types no longer supported by balena',
|
||||
default: false,
|
||||
}),
|
||||
};
|
||||
|
||||
public async run() {
|
||||
const { flags: options } = await this.parse(DevicesSupportedCmd);
|
||||
const { flags: options } = await this.parse(DeviceTypeListCmd);
|
||||
const pineOptions = {
|
||||
$select: ['slug', 'name'],
|
||||
$expand: {
|
||||
@ -57,9 +68,11 @@ export default class DevicesSupportedCmd extends Command {
|
||||
},
|
||||
},
|
||||
} satisfies BalenaSdk.PineOptions<BalenaSdk.DeviceType>;
|
||||
const dts = (await getBalenaSdk().models.deviceType.getAllSupported(
|
||||
pineOptions,
|
||||
)) as Array<
|
||||
const dts = (
|
||||
options.all
|
||||
? await getBalenaSdk().models.deviceType.getAll(pineOptions)
|
||||
: await getBalenaSdk().models.deviceType.getAllSupported(pineOptions)
|
||||
) as Array<
|
||||
BalenaSdk.PineTypedResult<BalenaSdk.DeviceType, typeof pineOptions>
|
||||
>;
|
||||
interface DT {
|
@ -50,7 +50,7 @@ export default class DeviceRegisterCmd extends Command {
|
||||
}),
|
||||
deviceType: Flags.string({
|
||||
description:
|
||||
"device type slug (run 'balena devices supported' for possible values)",
|
||||
"device type slug (run 'balena device-type list' for possible values)",
|
||||
}),
|
||||
help: cf.help,
|
||||
};
|
||||
|
@ -31,7 +31,7 @@ export default class FleetCreateCmd extends Command {
|
||||
\`balena organization list\` command.
|
||||
|
||||
The fleet's default device type is specified with the \`--type\` option.
|
||||
The \`balena devices supported\` command can be used to list the available
|
||||
The \`balena device-type list\` command can be used to list the available
|
||||
device types.
|
||||
|
||||
Interactive dropdowns will be shown for selection if no device type or
|
||||
@ -62,7 +62,7 @@ export default class FleetCreateCmd extends Command {
|
||||
type: Flags.string({
|
||||
char: 't',
|
||||
description:
|
||||
'fleet device type (Check available types with `balena devices supported`)',
|
||||
'fleet device type (Check available types with `balena device-type list`)',
|
||||
}),
|
||||
help: cf.help,
|
||||
};
|
||||
|
@ -24,7 +24,7 @@ export default class OsDownloadCmd extends Command {
|
||||
Download an unconfigured OS image.
|
||||
|
||||
Download an unconfigured OS image for the specified device type.
|
||||
Check available device types with 'balena devices supported'.
|
||||
Check available device types with 'balena device-type list'.
|
||||
|
||||
Note: Currently this command only works with balenaCloud, not openBalena.
|
||||
If using openBalena, please download the OS from: https://www.balena.io/os/
|
||||
|
@ -24,7 +24,7 @@ export default class OsVersionsCmd extends Command {
|
||||
Show available balenaOS versions for the given device type.
|
||||
|
||||
Show the available balenaOS versions for the given device type.
|
||||
Check available types with \`balena devices supported\`.
|
||||
Check available types with \`balena device-type list\`.
|
||||
|
||||
balenaOS ESR versions can be listed with the '--esr' option. See also:
|
||||
https://www.balena.io/docs/reference/OS/extended-support-release/
|
||||
|
@ -190,7 +190,7 @@ const messages: {
|
||||
const slug = error.deviceTypeSlug ? `"${error.deviceTypeSlug}"` : 'slug';
|
||||
return stripIndent`
|
||||
Device type ${slug} not recognized. Perhaps misspelled?
|
||||
Check available device types with "balena devices supported"`;
|
||||
Check available device types with "balena device-type list"`;
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -94,7 +94,7 @@ export const driveOrImg = Flags.string({
|
||||
|
||||
export const deviceType = Flags.string({
|
||||
description:
|
||||
'device type (Check available types with `balena devices supported`)',
|
||||
'device type (Check available types with `balena device-type list`)',
|
||||
char: 't',
|
||||
required: true,
|
||||
});
|
||||
|
@ -20,7 +20,7 @@ import { expect } from 'chai';
|
||||
import { BalenaAPIMock } from '../../nock/balena-api-mock';
|
||||
import { cleanOutput, runCommand } from '../../helpers';
|
||||
|
||||
describe('balena devices supported', function () {
|
||||
describe('balena device-type list', function () {
|
||||
let api: BalenaAPIMock;
|
||||
|
||||
beforeEach(() => {
|
||||
@ -34,9 +34,9 @@ describe('balena devices supported', function () {
|
||||
});
|
||||
|
||||
it('should print help text with the -h flag', async () => {
|
||||
const { out, err } = await runCommand('devices supported -h');
|
||||
const { out, err } = await runCommand('device-type list -h');
|
||||
|
||||
expect(cleanOutput(out)).to.contain('$ balena devices supported');
|
||||
expect(cleanOutput(out)).to.contain('$ balena device-type list');
|
||||
|
||||
expect(err).to.eql([]);
|
||||
});
|
||||
@ -44,7 +44,7 @@ describe('balena devices supported', function () {
|
||||
it('should list currently supported devices, with correct filtering', async () => {
|
||||
api.expectGetDeviceTypes();
|
||||
|
||||
const { out, err } = await runCommand('devices supported');
|
||||
const { out, err } = await runCommand('device-type list');
|
||||
|
||||
const lines = cleanOutput(out, true);
|
||||
|
@ -64,7 +64,7 @@ ADDITIONAL COMMANDS
|
||||
device shutdown shutdown a device
|
||||
device ssh SSH into the host or application container of a device
|
||||
device tunnel tunnel local ports to your balenaOS device
|
||||
devices supported list the supported device types (like 'raspberrypi3' or 'intel-nuc')
|
||||
device-type list list the device types supported by balena (like 'raspberrypi3' or 'intel-nuc').
|
||||
env set add or update env or config variable to application(s), device(s) or service(s)
|
||||
env list list the environment or config variables of an application, device or service
|
||||
env rename change the value of a config or env var for an app, device or service
|
||||
|
@ -141,7 +141,7 @@
|
||||
%2: build/commands/device/tunnel.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/devices/supported.js
|
||||
%2: build/commands/device-type/list.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/env/list.js
|
||||
|
@ -141,7 +141,7 @@
|
||||
%2: build/commands/device/tunnel.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/devices/supported.js
|
||||
%2: build/commands/device-type/list.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/env/list.js
|
||||
|
@ -141,7 +141,7 @@
|
||||
%2: build/commands/device/tunnel.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/devices/supported.js
|
||||
%2: build/commands/device-type/list.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/env/list.js
|
||||
|
@ -141,7 +141,7 @@
|
||||
%2: build/commands/device/tunnel.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/devices/supported.js
|
||||
%2: build/commands/device-type/list.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules/@oclif/core/package.json
|
||||
%2: build/commands/env/list.js
|
||||
|
@ -141,7 +141,7 @@
|
||||
%2: build\commands\device\tunnel.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules\@oclif\core\package.json
|
||||
%2: build\commands\devices\supported.js
|
||||
%2: build\commands\device-type\list.js
|
||||
> Warning Entry 'main' not found in %1
|
||||
%1: node_modules\@oclif\core\package.json
|
||||
%2: build\commands\env\list.js
|
||||
|
Loading…
x
Reference in New Issue
Block a user