Skip to main content

updateBotRecipe

A Graze API POST request that updates a Cookbook Bot Recipe.

Back to Graze API EndPoint Reference.

Request arguments

Endpoint updateBotRecipe takes the following request arguments. You must supply the name of the Bot Recipe plus at least one other argument that you want to change.

Name

Type

Required

Description

auth_token

String

Yes

A valid auth_token returned from the authenticate request. Alternatively, basic authenticate headers can be used in place of this parameter. See the authenticate endpoint for more information and usage examples.

name

String

Yes

Name of the Recipe that you want to update.

cookbooks

Array of Strings

No

A list of the Cookbooks that this Recipe belongs to.

description

String

No

Description of the Recipe.

alert_threshold

Positive Integer

No

Minimum number of alerts required before Cookbook creates a Situation.

trigger

String

No

A filter that determines the alerts that Cookbook considers for Situation creation. Cookbook includes alerts that match the trigger filter. By default Cookbook only includes alerts with a severity of 'Critical'. For details on creating a filter, see Filter Search Data. To set a vertex entropy trigger filter, see Configure Topology-based Clustering with Vertex Entropy for more information.

exclusion

String

No

A filter that determines the alerts to exclude from Situation creation. Cookbook ignores alerts that match the exclusion filter. For details on creating a filter, see Filter Search Data. To set a vertex entropy exclusion filter, see Configure Topology-based Clustering with Vertex Entropy for more information.

seed_alert

String

No

A filter that determines whether to create a Situation from a seed alert. The seed alert must meet both the trigger, exclusion and seed_alert criteria to create a Situation. Cookbook considers subsequent alerts for clustering if they meet the trigger and exclusion filter criteria. Alerts that arrive prior to the seed alert that met the trigger and exclusion filter criteria do not form Situations. For details on creating a filter, see Filter Search Data. To set a vertex entropy seed alert filter, see Configure Topology-based Clustering with Vertex Entropy for more information.

rate

Positive Integer

No

Rate, in number of alerts per second. Cookbook clusters alerts if they arrive at a higher rate than is specified here. Cookbook uses rate together with min_sample_size and max_sample_size to determines whether to cluster alerts into Situations. See Cookbook and Recipe Examples for more information.

min_sample_size

Positive Integer

No

Number of alerts that must arrive before the Cookbook starts to calculate the alert rate. See Cookbook and Recipe Examples for more information. Valid only if rate is non-zero.

max_sample_size

Positive Integer

No

Maximum number of alerts that are considered in the alert rate calculation. When more than this number of alerts have arrived, Cookbook discards the oldest alerts and calculates the alert rate based on the number of alerts in the max_sample_size. See Cookbook and Recipe Examples for more information. Valid only if rate is non-zero.

cook_for

Positive Integer

No

Minimum time period, in seconds, that the Cookbook Recipe clusters alerts for before it resets and starts a new cluster. See Cookbook and Recipe Examples for more information.

If you set a different cook_for time for a Recipe, it overrides the Cookbook value. Recipes without a cook_for time inherit the value from the Cookbook.

cook_for_extension

Positive Integer

No

Time period that the Cookbook Recipe can extend clustering alerts for before it resets and starts a new cluster. Setting this value enables the cook for auto-extension feature for this Cookbook. As Cookbook receives related alerts, it continues to extend the total clustering time until the max_cook_for period is reached. Used in conjunction with the max_cook_for value, the cook_for_extension period helps to ensure that Cookbook continues to cluster alerts together that are related to the same failure. The cook_for_extension period only applies to new related alerts; it does not apply to existing alerts that are updated with new events. See Cookbook and Recipe Examples for more information.

If you set a different cook_for_extension time for a Recipe, it overrides the Cookbook value. Recipes without a cook_for_extension time inherit the value from the Cookbook.

max_cook_for

Positive Integer

No

Maximum time period that the Cookbook Recipe clusters alerts for before it resets and starts a new cluster. It works in conjunction with the cook_for_extension time to help ensure that Cookbook continues to cluster alerts together that are related to the same failure. This value is ignored unless the cook_for_extension time is specified. See Cookbook and Recipe Examples for more information.

If you set a different max_cook_for time for a Recipe, it overrides the Cookbook value. Recipes without a max_cook_for value inherit the value from the Cookbook.

cluster_by

String

No

Determines Cookbook's clustering behavior. Set to an empty string to use the Cookbook cluster_by setting. Set to first_match so that Cookbook adds alerts to the first cluster over the similarity threshold value. Set to closest_match to add alerts to the cluster with the highest similarity greater than the similarity threshold value. This option may be less efficient because Cookbook needs to compare alerts against each cluster in a Recipe. Set to an empty string to use the Cookbook setting.

If you set a different cluster_by value for a Recipe, it overrides the Cookbook value. Recipes without a cluster_by value inherit the value from the Cookbook.

initialize_function

JSON Function Name

No

Default is initBuckets.

member_function

JSON Function Name

No

Default is checkBucket.

can_start_cluster

JSON Function Name

No

Default is null.

use_in_recipe

JSON Function Name

No

Default is null.

similarity

Double

No

Value between 0 and 1. Default is 0.8.

Response

Endpoint updateBotRecipe returns the following response:

Examples

The following examples demonstrate typical use of endpoint updateBotRecipe:

Request example

Example cURL request to update the alert threshold to 4 in Bot Recipe "BotRecipe2":

curl -X POST -u graze:graze -k -v "https://localhost/graze/v1/updateBotRecipe" -H "Content-Type: application/json; charset=UTF-8" -d '{"name":"BotRecipe2","alert_threshold":4}'

Response example