<a id="hook-command-state-set"></a>

# `state-set`

> See also: [state-delete](https://documentation.ubuntu.com/juju/2.9/reference/hook-command/list-of-hook-commands/state-delete.md), [state-get](https://documentation.ubuntu.com/juju/2.9/reference/hook-command/list-of-hook-commands/state-get.md)

## Summary

Set server-side-state values.

## Usage

` state-set [options] key=value [key=value ...]`

### Options

| Flag     | Default   | Usage                           |
|----------|-----------|---------------------------------|
| `--file` |           | file containing key-value pairs |

## Details

state-set sets the value of the server side state specified by key.

The –file option should be used when one or more key-value pairs
are too long to fit within the command length limit of the shell
or operating system. The file will contain a YAML map containing
the settings as strings.  Settings in the file will be overridden
by any duplicate key-value arguments. A value of “-” for the filename
means <stdin>.

The following fixed size limits apply:

- Length of stored keys cannot exceed 256 bytes.
- Length of stored values cannot exceed 65536 bytes.
