Functions can update state when they execute. For example, a function can increment a counter or set a metric value.
Viewing current state value
To view the current value of a state key associated with a function:
- From the left sidebar menu, select Functions/Manage.
- Find the function you would like to delete. You can filter the listed functions by name, runtime, and namespace. Once you find the function, click on the Manage button.
- You should now see the details of the function. Click on the State button at the bottom of the screen.
- Enter the name of the key you want to retrieve in the Key field.
- Click on the Get button.
- The current value of the key is displayed along with its type and version number.
Setting a state value
To set the value of a state key associated with a function:
- From the left sidebar menu, select Functions/Manage.
- Find the function you would like to delete. You can filter the listed functions by name, runtime, and namespace. Once you find the function, click on the Manage button.
- You should now see the details of the function. Click on the State button at the bottom of the screen.
- Enter the name of the key you want to set in the Key field.
- Enter a value for the key in the Value field.
- Select a type for the key in the Type field.
- Click on the Set button.
- The key is set to the value and the version number is updated in the Version field.
