mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-04-16 23:38:53 +00:00
api key expiry date
Change-type: patch
This commit is contained in:
parent
ccf97cfc9f
commit
8dea1333ca
@ -333,6 +333,10 @@ Examples:
|
||||
|
||||
the API key name
|
||||
|
||||
#### EXPIRYDATE
|
||||
|
||||
the API key expiry date
|
||||
|
||||
## api-key list
|
||||
|
||||
### Aliases
|
||||
|
@ -48,6 +48,10 @@ export default class GenerateCmd extends Command {
|
||||
description: 'the API key name',
|
||||
required: true,
|
||||
}),
|
||||
expiryDate: Args.string({
|
||||
description: 'the API key expiry date',
|
||||
required: true,
|
||||
}),
|
||||
};
|
||||
|
||||
public static authenticated = true;
|
||||
@ -57,7 +61,10 @@ export default class GenerateCmd extends Command {
|
||||
|
||||
let key;
|
||||
try {
|
||||
key = await getBalenaSdk().models.apiKey.create(params.name);
|
||||
key = await getBalenaSdk().models.apiKey.create(
|
||||
params.name,
|
||||
params.expiryDate,
|
||||
);
|
||||
} catch (e) {
|
||||
if (e.name === 'BalenaNotLoggedIn') {
|
||||
if (await isLoggedInWithJwt()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user