{
  "swagger": "2.0",
  "info": {
    "title": "Connection bootstrapper service",
    "version": "0.1507.0",
    "description": "Send your API key as a bearer token: `Authorization: Bearer <api key>`."
  },
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "securityDefinitions": {
    "ApiKey": {
      "type": "apiKey",
      "in": "header",
      "name": "Authorization",
      "description": "Your API key as a bearer token: `Authorization: Bearer <api key>`."
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ],
  "paths": {
    "/data-source/connection/v1/{rid}/populateSeries": {
      "post": {
        "operationId": "ConnectionBootstrapperService_populateSeries",
        "summary": "Populate series",
        "tags": [
          "Connection Bootstrapper Service"
        ],
        "description": "Populates the connection with series, by querying within the requested time range. If start or end are both omitted, will query the last 7 days by default. If one of start or end is omitted, will query a 7 day range from the provided start or end. Will throw if the requested range is larger than 30 days.",
        "parameters": [
          {
            "name": "rid",
            "in": "path",
            "type": "string",
            "format": "rid",
            "x-alias": "ConnectionRid",
            "required": true
          },
          {
            "name": "request",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/PopulateSeriesRequest"
            },
            "required": true,
            "x-example": {
              "startTime": "2026-01-01T00:00:00Z",
              "endTime": "2026-01-01T00:00:00Z"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content."
          }
        }
      }
    }
  },
  "definitions": {
    "PopulateSeriesRequest": {
      "type": "object",
      "properties": {
        "startTime": {
          "type": "string",
          "format": "date-time"
        },
        "endTime": {
          "type": "string",
          "format": "date-time"
        }
      },
      "example": {
        "startTime": "2026-01-01T00:00:00Z",
        "endTime": "2026-01-01T00:00:00Z"
      }
    }
  },
  "tags": [
    {
      "name": "Connection Bootstrapper Service",
      "x-displayName": "Connection bootstrapper service",
      "description": "Nominal periodically scrapes connected databases (Connections) in order to maintain a database of all series that can be read from that database. This service is responsible for executing the scrape, and can be used manually to trigger a rescrape for any reason (for example, when updating a schema).",
      "x-errors": [
        {
          "status": 404,
          "errorCode": "NOT_FOUND",
          "errorName": "Connection:ConnectionNotFound"
        },
        {
          "status": 500,
          "errorCode": "INTERNAL",
          "errorName": "Connection:FailedToCreateConnection"
        },
        {
          "status": 403,
          "errorCode": "PERMISSION_DENIED",
          "errorName": "Connection:NotAllowedToCreateConnection"
        },
        {
          "status": 400,
          "errorCode": "INVALID_ARGUMENT",
          "errorName": "Connection:PopulateSeriesTimeRangeTooLarge"
        },
        {
          "status": 404,
          "errorCode": "NOT_FOUND",
          "errorName": "Connection:SecretsNotFound"
        },
        {
          "status": 404,
          "errorCode": "NOT_FOUND",
          "errorName": "Connection:DatasourceRidNotFound"
        },
        {
          "status": 404,
          "errorCode": "NOT_FOUND",
          "errorName": "Connection:DatasetRidNotFound"
        },
        {
          "status": 400,
          "errorCode": "INVALID_ARGUMENT",
          "errorName": "Connection:NoSecretRidProvided"
        },
        {
          "status": 400,
          "errorCode": "INVALID_ARGUMENT",
          "errorName": "Connection:FailedToAddTagsToConnection",
          "description": "Cannot manually add tags to a Nominal connection."
        }
      ]
    }
  ]
}
