Create-key command
Creates a new application key. Prints the application key information. This is the only time the application key itself will be returned. Listing application keys will show their IDs, but not the secret keys.
The capabilities are passed in as a comma-separated list, like readFiles,writeFiles
.
Optionally, you can pass all capabilities known to this client with --allCapabilities
.
The duration
is the length of time (in seconds) the new application key will exist.
When the time expires the key will disappear and will no longer be usable. If not
specified, the key will not expire.
The bucket
is the name of a bucket in the account. When specified, the key
will only allow access to that bucket.
The namePrefix
restricts file access to files whose names start with the prefix.
The output is the new application key ID, followed by the application key itself.
The two values returned are the two that you pass to authorize-account
to use the key.
Requires capability:
writeKeys
b2 create-key [-h] [--bucket BUCKET] [--namePrefix NAMEPREFIX]
[--duration DURATION] [--allCapabilities]
keyName [capabilities]
Positional Arguments
- keyName
- capabilities
Named Arguments
- --bucket
- --namePrefix
- --duration
- --allCapabilities
Default: False