fastly kv-store-entry create
Insert a key-value pair.
Syntax
$ fastly kv-store-entry create --store-id=STORE-ID
Options
Key | Required? | Default | Description |
---|---|---|---|
--store-id | Yes | Store ID | |
--dir | No | Path to a directory containing individual files where the filename is the key and the file contents is the value | |
--dir-allow-hidden | No | Allow hidden files (e.g. dot files) to be included (skipped by default) | |
--dir-concurrency | No | 50 | Limit the number of concurrent network resources allocated |
--file | No | Path to a file containing individual JSON objects (e.g., {"key":"...","value":"base64_encoded_value"}) separated by new-line delimiter | |
--json | No | Render output as JSON | |
--key | No | Key name | |
--stdin | No | Read new-line separated JSON stream via STDIN | |
--value | No | Value |
Global options
Key | Required? | Default | Description |
---|---|---|---|
--help | No | Show context-sensitive help. | |
--accept-defaults | No | Accept default options for all interactive prompts apart from Yes/No confirmations | |
--auto-yes | No | Answer yes automatically to all Yes/No confirmations. This may suppress security warnings | |
--debug-mode | No | Print API request and response details (NOTE: can disrupt the normal CLI flow output formatting) | |
--enable-sso | No | Enable Single-Sign On (SSO) for current profile execution (see also: 'fastly sso') | |
--non-interactive | No | Do not prompt for user input - suitable for CI processes. Equivalent to --accept-defaults and --auto-yes | |
--profile | No | Switch account profile for single command execution (see also: 'fastly profile switch') | |
--quiet | No | Silence all output except direct command output. This won't prevent interactive prompts (see: --accept-defaults, --auto-yes, --non-interactive) | |
--token | No | Fastly API token (or via FASTLY_API_TOKEN) | |
--verbose | No | Verbose logging |
Examples
Stream data into a KV Store using STDIN
Each JSON entry should be separated by a newline ( ) delimiter, and the value to be inserted should be base64 encoded.
$ echo '{"key":"example","value":"VkFMVUU="}' | fastly kv-store-entry create --stdin
Stream data into a KV Store using a JSON file
Each entry in the JSON file should be its own JSON object separated by a newline, and the value to be inserted should be base64 encoded.
$ fastly kv-store-entry create --file data.json
Concurrently insert data into a KV Store using a file directory structure
The filename will be used as the key, and the file contents will be used as the value (unlike other options, the file content doesn't need to be base64 encoded).
$ fastly kv-store-entry create --dir ./data/
API equivalent
This command internally uses the following Fastly public APIs: