{"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":{"properties":{"type":{"description":"The type of test. Cannot be templated with Handlebars.","enum":["agent-to-server","agent-to-agent","dns-server","dns-trace","http-server","page-load","web-transactions","sip-server","voice"],"example":"http-server","type":"string","$$ref":"#/components/schemas/TestTypeTemplate"},"testName":{"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 name of the test, must be unique.","$$ref":"#/components/schemas/TestBaseTemplate_testName"},"agents":{"anyOf":[{"items":{"properties":{"agentId":{"anyOf":[{"type":"number"},{"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/NumberTemplate"}},"type":"object","$$ref":"#/components/schemas/AgentAssignmentTemplate"},"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 agents to assign to the test identified by `agentId`.","title":"Agents","$$ref":"#/components/schemas/Agents"},"groups":{"anyOf":[{"items":{"description":"Label to assign to a test, identified by the ID (`groupId`).","properties":{"groupId":{"anyOf":[{"type":"number"},{"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/NumberTemplate"}},"type":"object","$$ref":"#/components/schemas/LabelAssignmentTemplate"},"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 Labels to assign to the test.","$$ref":"#/components/schemas/TestBaseTemplate_groups"},"description":{"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":"Description of the test.","$$ref":"#/components/schemas/TestBaseTemplate_description"}},"required":["agents","testName","type"],"type":"object","$$ref":"#/components/schemas/TestBaseTemplate","title":"TestBaseTemplate"}}