Deploy template

POST {{baseUrl}}/templates/:id/deploy?aid=1234

Deploys a template, which will result in creating any of the tests, alert rules, dashboards or other assets defined in the template. You must specify any userInputValues required by the template in the request body. userInputValues enables you to specify a minimum set of user values required to configure the tests from a template. This way, you do not have to edit all the details of each test configuration. If necessary, you can edit the test details directly in the template.

Considerations

Consider the following when deploying a template: * To deploy a template, you must first create a template or use one of ThousandEyes' built-in templates. * The deployment strategy allows you to specify what should happen to a particular asset in the event that a template is redeployed. When you attempt to deploy a template that has already been deployed, the API service compares any assets that have not yet been deployed with the assets that were deployed in the previous deployment (the comparison is done using the asset key; the asset keys are simply the object keys used in the tests, labels, alertRules, and dashboards fields). By default, if the configuration of a particular asset has not changed from the previous deployment, that asset is ignored. If a change is detected: * If the asset is a test, a new test is created with the new configuration. * If the asset is not a test, the asset is updated. * You can create new resources such as tests, alert rules, labels, dashboards, and modify existing resources defined in templates, overwriting the default configurations. * You can also use existing resources (such as those created outside the template deployment flow) by adding their ID either in the raw template or using the overrides when deploying the template. See example usage below for the raw template sample. Note: The template API does not currently track live configuration of assets. Any changes made to assets outside of the template API will not be considered when comparing changes during the redeployment scenario.

Example usage:

/v7/tests/templates/fcbb89a7-61cf-4616-9c4f-828fa3cb4684/deploy
{
  "userInputValues": {
    "interval": 120,
    "target": "https://microsoft.com",
    "agents": [{"agentId":11}],
    "domain": "microsoft.com"
  },
  "name":"Microsoft Suite",
  "tests": {
    "secondPageLoadTest": {
      "httpInterval": 120,
      "interval": 120,
      "testId": 182481,
      "type": "page-load",
      "url": "https://microsoft.com",
      "testName": "Microsoft Suite - Second Page Load",
      "agents": [
        {
          "agentId": 11
        }
      ]
    }
  }
}

Raw Template Sample

{
  ...
  "tests": {
      "existingTest": {
          "testId": "123", //The API will only try to update this test; will never create it
          "type": "http-server",
          ....
      },
      ...
  },
  ...
}

Request Params

KeyDatatypeRequiredDescription
aidnumberA unique identifier associated with your account group. You can retrieve your AccountGroupId from the /account-groups endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.

Request Body

{"userInputValues"=>{"interval"=>120, "target"=>"https://microsoft.com", "agents"=>[{"agentId"=>11}], "domain"=>"microsoft.com"}, "name"=>"Microsoft Suite"}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring
Acceptstring

RESPONSES

status: OK

{"name":"My Template","id":"fcbb89a7-61cf-4616-9c4f-828fa3cb4684","dateCreated":"2023-07-17T22:00:54Z","description":"A description of My Template","icon":"server","isBuiltIn":false,"certificationLevel":"user","userInputs":{"targetDomain":{"name":"Target Domain","description":"Name of target domain that will be used for configuring tests in this template.","type":"string"},"region":{"name":"Cloud Region","description":"The available cloud regions to target.","type":"string","allowedValues":[{"name":"West","value":"us-west-1"},{"name":"East","value":"us-east-2"}]},"agents":{"name":"Source Agents","description":"The agents that will be used by the tests in this template.","type":"agents"}},"labels":{"dolore_9ac":{"name":"amet elit exercitation lab","type":"tests","tests":[{"testId":"irure do dolore"},{"testId":"voluptate Excepteur ea"}],"endpointTests":[{"testId":"fugiat velit nostrud"},{"testId":"ut exercitation elit"}]},"velita17":{"name":"dolor do culpa in","type":"tests","tests":[{"testId":"aliqua tempor de"},{"testId":"deserunt ipsum sed"}],"endpointTests":[{"testId":"id"},{"testId":"eiusmod enim Excepteur"}]}},"tests":{"adipisicing_e":{"agents":[{"agentId":78269894.63059258},{"agentId":54135674.45486817}],"interval":60,"server":"anim sint non","testName":"laboris esse","type":"http-server","groups":[{"groupId":23561620.429320753},{"groupId":62241899.87751219}],"description":"sunt exercitation voluptate","port":33590493,"bgpMeasurements":0,"bandwidthMeasurements":0,"mtuMeasurements":0,"numPathTraces":3,"pathTraceMode":"classic","probeMode":"AUTO","protocol":"TCP","continuousMode":0,"fixedPacketRate":0},"ex_8":{"agents":[{"agentId":-75256907.71236628},{"agentId":72841235.2775662}],"interval":60,"server":"Ut occaecat","testName":"aliquip et","type":"http-server","groups":[{"groupId":16692341.520655066},{"groupId":-14656512.404159412}],"description":"Excep","port":-40559641,"bgpMeasurements":0,"bandwidthMeasurements":0,"mtuMeasurements":0,"numPathTraces":3,"pathTraceMode":"classic","probeMode":"AUTO","protocol":"TCP","continuousMode":0,"fixedPacketRate":0},"officia_c":{"agents":[{"agentId":-9561831.676358461},{"agentId":88227880.05539027}],"interval":60,"server":"dolor sed nulla","testName":"aliqua","type":"http-server","groups":[{"groupId":-31090401.595557183},{"groupId":43208020.778699875}],"description":"Ut est","port":95538558,"bgpMeasurements":0,"bandwidthMeasurements":0,"mtuMeasurements":0,"numPathTraces":3,"pathTraceMode":"classic","probeMode":"AUTO","protocol":"TCP","continuousMode":0,"fixedPacketRate":0}},"endpointTests":{"aliqua2a3":{"genericConfig":{"interval":60,"priority":64414061},"machineConfig":{"maxMachines":62984618,"monitoringSettingsType":"ANY_AGENT","agentIds":["nisi ","sunt aliqua exercitation"],"labelIds":[-79493638,54984276]},"networkConfig":{"flagPing":true,"flagTraceroute":true,"ipVersion":"V4_ONLY","networkProtocol":"AUTODETECT","pathtraceInSession":true,"tcpConnect":false,"tcpProbeMode":"SACK"},"testCategory":"SCHEDULED_TEST","testType":"Http","testName":"reprehenderit","description":"officia nulla dolor","flagEnabled":true,"alertRules":[{"ruleId":-7147435},{"ruleId":-56942394}],"server":{"port":80,"serverName":"www.example.com"},"httpConfig":{"httpTimeLimit":27707,"sslVersion":0,"targetFetchTime":60890537,"targetResponseTime":-212306,"url":"https://meet.google.com","verifyCertHostname":true,"headers":"elit enim","authType":"BASIC","bytesToDownload":-37140844,"username":"anim occaecat veniam","password":"incididunt voluptate consequat","postBody":"fugiat nisi exercitation","contentRegex":"t","expectedResponseCode":-80061286,"targetIpOverride":"ut adipisicing","clientCert":"labore","userAgent":"est culpa labore","maxRedirects":30912657,"proxyId":-26900350,"proxyDirect":false},"testLabelIds":[-42492799.87481747,45398507.753878534]}},"alertRules":{"httpAlert":{"alertType":"HTTP Server","ruleName":"{{userInputs.tenantName}} - Alert Rule","expression":"((totalTime \u003e= 500 ms) \u0026\u0026 (responseTime \u003e= 500 ms))","roundsViolatingRequired":1,"roundsViolatingOutOf":1,"testIds":["{{tests.pageLoadTest.testId}}"]}},"dashboards":{"in708":{"title":"aliquip officia cupidatat ipsum","description":"cillum","globalFilterId":"nostrud exercitation ","widgets":[{"title":"sed","type":"Multi Metric Table","visualMode":"Full","metricGroup":"BGP","direction":"FROM_TARGET","metric":"ENDPOINT_GATEWAY_CPU_LOAD_PERCENT","filters":{"TEST":[5187,5227],"ENDPOINT_MACHINE_ID":["fbd0050c-07f7-43f7-9631-14b32f096962"]},"measure":{"type":"MEAN","percentileValue":95},"fixedTimespan":{"value":10,"unit":"Days"},"shouldExcludeAlertSuppressionWindows":true},{"title":"ea elit si","type":"Alert List","visualMode":"Full","metricGroup":"BGP","direction":"FROM_TARGET","metric":"ENDPOINT_GATEWAY_CPU_LOAD_PERCENT","filters":{"TEST":[5187,5227],"ENDPOINT_MACHINE_ID":["fbd0050c-07f7-43f7-9631-14b32f096962"]},"measure":{"type":"MEAN","percentileValue":95},"fixedTimespan":{"value":10,"unit":"Days"},"shouldExcludeAlertSuppressionWindows":true}],"refreshRate":"false"}},"dashboardFilters":{"netHealthDashboardFilter":{"name":"{{userInputs.dashboardFilterTitle}}","context":[{"dataSourceId":"VIRTUAL_AGENT","filters":[{"filterId":"TEST_LABEL","metricIds":["NET_LOSS","NET_LATENCY","NET_JITTER"],"values":["{{labels.testLabel.groupId}}"]}]}]}},"deploymentStrategy":{"testVoiceLabel":"update","testVideoLabel":"update","testLabel":"update","dnsTest":"ignore","webexDashboard":"ignore","serverTest":"create"},"modules":["default"],"_links":{"self":{"href":"https://api.thousandeyes.com/v7/link/to/resource/id","templated":false,"type":"et Excepteur","deprecation":"ipsum ut magna","name":"laboris n","profile":"dolore","title":"culpa dolore labore ex","hreflang":"aliqua est ex"}}}