{"type":"model","meta":{"id":"/apps/pubhub/media/000-v7-apis/5b3454a4300b838cc17f7b2cdc0690fdd15058d5/c08488fb-7a2d-3d7d-9594-8f650f96122b","info":{"description":"Templates provide a streamlined approach to creating multiple tests (Synthetic/CEA and Endpoint), alert rules, dashboards, labels and other assets within ThousandEyes from a single configuration file.\nTemplates make it easy to configure monitoring for even the most complex monitoring scenarios.\nThe following applies to templates:\n* ThousandEyes provides a pre-defined set of templates for monitoring common services and applications like Office365, Webex, Atlassian, Slack, custom network, HTTP, API, and Web targets.\n* You can easily create tests for monitoring common services and applications such as Office365, Webex, and others using the predefined set of ThousandEyes built-in templates.\n* Users can create their own templates, which are visible to any other users in the account group the template was created in, provided they have the `View Templates Read` permission.\n* Templates support dynamic user inputs, which are values provided by users when a template is deployed. Templates leverage Handlebars templating notation to allow dynamically configuring ThousandEyes resources based on user provided inputs.\n* Templates can be deployed from the UI or the API.\n* Credentials (usernames, passwords, tokens, etc.) may be included in a template only as placeholders whose value is provided by user input when deployed. Creating or updating a template that contains a credentials field in plain text will result in a bad request (ie, HTTP 400).\n* Templates can also use Handlebars temlate notation to reference fields of other assets defined in the template. To support this, assets are created in the order below, which also determines what other assets a given asset can reference\n(ex. Labels cannot reference other assets, Tests can only reference labels, etc.)\n 1. Labels\n 2. Tests\n 3. Endpoint Tests\n 4. Tags\n 5. Alert Rules\n 6. Dashboard Filters\n 7. Dashboards\n\nFor more information about Templates, see the [product documentation](https://docs.thousandeyes.com/product-documentation/internet-and-wan-monitoring/tests/test-templates).\n","title":"Templates API","version":"7.0.34"},"security":[{"BearerAuth":[]}],"tags":[{"name":"Templates"}],"openapi":"3.0.0","servers":[{"description":"ThousandEyes API production URL","url":"https://api.thousandeyes.com/v7"}],"securitySchemes":{"BearerAuth":{"description":"Bearer authentication token","scheme":"bearer","type":"http"}}},"spec":{"description":"Alert Rule configuration. See [ThousandEyes v6 API spec](https://developer.cisco.com/docs/thousandeyes/v6/metadata/#alert-rule-metadata) for schema details.","externalDocs":{"url":"https://developer.cisco.com/docs/thousandeyes/v6/metadata/#alert-rule-metadata"},"properties":{"ruleName":{"anyOf":[{"type":"string"},{"description":"A valid Handlebars expression. Can reference user inputs, such as `{{name}}`, or fields of other assets defined in the template.\n* `{{userInputs.\u003ckey\u003e}}` - resolves to the user provided value the `userInput` identified its key.\n* `{{name}}` - resolves to the name of the deployed template.\n* `{{\u003casset key\u003e.\u003cfield\u003e}}` - resolves to the value of a field of another asset defined in the template identified by the asset key and field name. \nFor example, set the `testIds` field of an `alertRule` by referencing the `testId` field of a `tests` asset.\n **Note**: Due to dependencies, assets can only reference fields of other assets based on the heiarchy below (i.e. labels cannot reference other assets in the template, tests can only reference labels, etc.)\n - Labels\n - Tests\n - Endpoint Tests\n - Tags\n - Alert Rules\n - Dashboard Filters\n - Dashboards\n","example":"{{userInputs.testName}}","pattern":".*{{.*}}.*","type":"string","$$ref":"#/components/schemas/HandlebarsExpression"}],"$$ref":"#/components/schemas/StringTemplate"},"alertType":{"anyOf":[{"enum":["Page Load","HTTP Server","End-to-End (Server)","End-to-End (Agent)","Voice","DNS Server","DNS Trace","DNSSEC","Web Transactions","BGP","Path Trace","FTP","SIP Server"],"example":"Page Load","type":"string","$$ref":"#/components/schemas/AlertRuleTypeTemplate"},{"description":"A valid Handlebars expression. Can reference user inputs, such as `{{name}}`, or fields of other assets defined in the template.\n* `{{userInputs.\u003ckey\u003e}}` - resolves to the user provided value the `userInput` identified its key.\n* `{{name}}` - resolves to the name of the deployed template.\n* `{{\u003casset key\u003e.\u003cfield\u003e}}` - resolves to the value of a field of another asset defined in the template identified by the asset key and field name. \nFor example, set the `testIds` field of an `alertRule` by referencing the `testId` field of a `tests` asset.\n **Note**: Due to dependencies, assets can only reference fields of other assets based on the heiarchy below (i.e. labels cannot reference other assets in the template, tests can only reference labels, etc.)\n - Labels\n - Tests\n - Endpoint Tests\n - Tags\n - Alert Rules\n - Dashboard Filters\n - Dashboards\n","example":"{{userInputs.testName}}","pattern":".*{{.*}}.*","type":"string","$$ref":"#/components/schemas/HandlebarsExpression"}],"description":"The type of the alert rule.","$$ref":"#/components/schemas/AlertRuleConfigurationTemplate_alertType"},"expression":{"anyOf":[{"type":"string"},{"description":"A valid Handlebars expression. Can reference user inputs, such as `{{name}}`, or fields of other assets defined in the template.\n* `{{userInputs.\u003ckey\u003e}}` - resolves to the user provided value the `userInput` identified its key.\n* `{{name}}` - resolves to the name of the deployed template.\n* `{{\u003casset key\u003e.\u003cfield\u003e}}` - resolves to the value of a field of another asset defined in the template identified by the asset key and field name. \nFor example, set the `testIds` field of an `alertRule` by referencing the `testId` field of a `tests` asset.\n **Note**: Due to dependencies, assets can only reference fields of other assets based on the heiarchy below (i.e. labels cannot reference other assets in the template, tests can only reference labels, etc.)\n - Labels\n - Tests\n - Endpoint Tests\n - Tags\n - Alert Rules\n - Dashboard Filters\n - Dashboards\n","example":"{{userInputs.testName}}","pattern":".*{{.*}}.*","type":"string","$$ref":"#/components/schemas/HandlebarsExpression"}],"description":"The alert rule expression. Must be valid JSON. See [V6 API](https://developer.cisco.com/docs/thousandeyes/v6/metadata/#expressions) documentation for examples.","example":"((totalTime \u003e= 500 ms) && (responseTime \u003e= 500 ms))","$$ref":"#/components/schemas/AlertRuleConfigurationTemplate_expression"},"roundsViolatingRequired":{"anyOf":[{"enum":[0,1],"example":0,"type":"integer","$$ref":"#/components/schemas/BooleanNumber"},{"description":"A valid Handlebars expression. Can reference user inputs, such as `{{name}}`, or fields of other assets defined in the template.\n* `{{userInputs.\u003ckey\u003e}}` - resolves to the user provided value the `userInput` identified its key.\n* `{{name}}` - resolves to the name of the deployed template.\n* `{{\u003casset key\u003e.\u003cfield\u003e}}` - resolves to the value of a field of another asset defined in the template identified by the asset key and field name. \nFor example, set the `testIds` field of an `alertRule` by referencing the `testId` field of a `tests` asset.\n **Note**: Due to dependencies, assets can only reference fields of other assets based on the heiarchy below (i.e. labels cannot reference other assets in the template, tests can only reference labels, etc.)\n - Labels\n - Tests\n - Endpoint Tests\n - Tags\n - Alert Rules\n - Dashboard Filters\n - Dashboards\n","example":"{{userInputs.testName}}","pattern":".*{{.*}}.*","type":"string","$$ref":"#/components/schemas/HandlebarsExpression"}],"description":"Specifies the numerator (X value) of the \"X of Y times\" condition in an alert rule.","title":"RoundsViolatingRequired","$$ref":"#/components/schemas/RoundsViolatingRequired"},"roundsViolatingOutOf":{"anyOf":[{"enum":[0,1],"example":0,"type":"integer","$$ref":"#/components/schemas/BooleanNumber"},{"description":"A valid Handlebars expression. Can reference user inputs, such as `{{name}}`, or fields of other assets defined in the template.\n* `{{userInputs.\u003ckey\u003e}}` - resolves to the user provided value the `userInput` identified its key.\n* `{{name}}` - resolves to the name of the deployed template.\n* `{{\u003casset key\u003e.\u003cfield\u003e}}` - resolves to the value of a field of another asset defined in the template identified by the asset key and field name. \nFor example, set the `testIds` field of an `alertRule` by referencing the `testId` field of a `tests` asset.\n **Note**: Due to dependencies, assets can only reference fields of other assets based on the heiarchy below (i.e. labels cannot reference other assets in the template, tests can only reference labels, etc.)\n - Labels\n - Tests\n - Endpoint Tests\n - Tags\n - Alert Rules\n - Dashboard Filters\n - Dashboards\n","example":"{{userInputs.testName}}","pattern":".*{{.*}}.*","type":"string","$$ref":"#/components/schemas/HandlebarsExpression"}],"description":"Specifies the divisor (Y value) of the \"X of Y times\" condition in an alert rule.","title":"RoundsViolatingOutOf","$$ref":"#/components/schemas/RoundsViolatingOutOf"},"severity":{"anyOf":[{"enum":["INFO","MAJOR","MINOR","CRITICAL"],"example":"MINOR","type":"string","$$ref":"#/components/schemas/AlertRuleSeverityTemplate"},{"description":"A valid Handlebars expression. Can reference user inputs, such as `{{name}}`, or fields of other assets defined in the template.\n* `{{userInputs.\u003ckey\u003e}}` - resolves to the user provided value the `userInput` identified its key.\n* `{{name}}` - resolves to the name of the deployed template.\n* `{{\u003casset key\u003e.\u003cfield\u003e}}` - resolves to the value of a field of another asset defined in the template identified by the asset key and field name. \nFor example, set the `testIds` field of an `alertRule` by referencing the `testId` field of a `tests` asset.\n **Note**: Due to dependencies, assets can only reference fields of other assets based on the heiarchy below (i.e. labels cannot reference other assets in the template, tests can only reference labels, etc.)\n - Labels\n - Tests\n - Endpoint Tests\n - Tags\n - Alert Rules\n - Dashboard Filters\n - Dashboards\n","example":"{{userInputs.testName}}","pattern":".*{{.*}}.*","type":"string","$$ref":"#/components/schemas/HandlebarsExpression"}],"description":"The severity that will be assigned when an alert is generated by this alert rule.","$$ref":"#/components/schemas/AlertRuleConfigurationTemplate_severity"},"testIds":{"anyOf":[{"items":{"example":43289,"type":"number"},"type":"array"},{"description":"A valid Handlebars expression. Can reference user inputs, such as `{{name}}`, or fields of other assets defined in the template.\n* `{{userInputs.\u003ckey\u003e}}` - resolves to the user provided value the `userInput` identified its key.\n* `{{name}}` - resolves to the name of the deployed template.\n* `{{\u003casset key\u003e.\u003cfield\u003e}}` - resolves to the value of a field of another asset defined in the template identified by the asset key and field name. \nFor example, set the `testIds` field of an `alertRule` by referencing the `testId` field of a `tests` asset.\n **Note**: Due to dependencies, assets can only reference fields of other assets based on the heiarchy below (i.e. labels cannot reference other assets in the template, tests can only reference labels, etc.)\n - Labels\n - Tests\n - Endpoint Tests\n - Tags\n - Alert Rules\n - Dashboard Filters\n - Dashboards\n","example":"{{userInputs.testName}}","pattern":".*{{.*}}.*","type":"string","$$ref":"#/components/schemas/HandlebarsExpression"}],"description":"The tests that the alert rule will be assigned to identified by the test ID.","title":"TestIds","$$ref":"#/components/schemas/TestIds"},"minimumSources":{"description":"The minimum number of agents that must meet the specified criteria in order to trigger an alert.","example":1,"type":"number"}},"required":["alertType","expression","roundsViolatingOutOf","roundsViolatingRequired","ruleName"],"type":"object","$$ref":"#/components/schemas/AlertRuleConfigurationTemplate","title":"AlertRuleConfigurationTemplate"}}