Templates

Runs a template script and returns the result.

Runs a template script and returns the result. The result should be deserializable to a GreprJobGraph if the 'testDeserialization' parameter is true in the payload.

post/v1/templates/test

Request

  • Base URL
    https://docs.grepr.ai (the document declares no server; this is the origin it was published from)
  • Auth
    • API key in header GREPR-API-KEY
    • or OpenID Connect (https://grepr-prod.us.auth0.com/.well-known/openid-configuration)

Request body

checkValidGreprJobGraphboolean

Tries to deserialize the result of the template script to see if it's a valid Grepr job graph. The API call will fail if the output is invalid.

skipInputValidationboolean

When true, the server skips validating the input values against the template's input schema before running the script. Mirrors the in-process executeTemplateWithoutThrottling path used by some tests and tooling.

Example request

{
  "input": {
    "draft": true,
    "values": {
      "pattern": "^foo",
      "threshold": 10
    }
  },
  "template": {
    "description": "Parses JSON log events and extracts fields.",
    "draftOutputs": [
      {
        "name": "parsedOutput",
        "tagKey": "draft",
        "tagValue": "true"
      }
    ],
    "id": "template-123",
    "inputs": {
      "input": "log_reducer:input"
    },
    "name": "Parse JSON Logs",
    "organizationId": "org-456",
    "sourceHash": "c354755d7b9b669e3111fcdd40a3432386d13a1b5548c2464ca2d73bcf3f70f1",
    "teamIds": [
      "team-1",
      "team-2"
    ],
    "version": 1
  }
}

Response

Job graph generated successfully

edgesstring[] required

Edges that connect the vertices of the Grepr job graph

Example response

{
  "edges": [
    "source -> sink"
  ],
  "vertices": [
    {
      "end": "2024-08-07T22:05:07Z",
      "integrationId": "0jn5rdc93r10t",
      "name": "source",
      "processing": "BATCH",
      "query": {
        "query": "service:grepr-query",
        "type": "datadog-query"
      },
      "start": "2024-08-07T22:00:07Z",
      "table": "logevent_raw_devpipeline",
      "type": "logs-iceberg-table-source"
    },
    {
      "name": "sink",
      "type": "logs-sync-sink"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.