diff --git a/.github/workflows/deploy-stage.yaml b/.github/workflows/deploy-stage.yaml new file mode 100644 index 0000000..ffbc502 --- /dev/null +++ b/.github/workflows/deploy-stage.yaml @@ -0,0 +1,170 @@ +name: Deploy connector, release cli on github +on: + push: + branches: + - main + tags: + - 'v*' + +# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds. +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. + permissions: + contents: read + packages: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + # Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here. + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + # This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels. + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages. + # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository. + # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + build-cli-binaries: + name: build the CLI binaries + strategy: + matrix: + include: + - runner: ubuntu-latest + target: x86_64-unknown-linux-musl + goos: linux + goarch: amd64 + - runner: ubuntu-latest + target: aarch64-unknown-linux-musl + goos: linux + goarch: arm64 + - runner: macos-latest + target: x86_64-apple-darwin + goos: darwin + goarch: amd64 + - runner: macos-latest + target: aarch64-apple-darwin + goos: darwin + goarch: arm64 + - runner: windows-latest + target: x86_64-pc-windows-msvc + goos: windows + goarch: amd64 + extension: .exe + runs-on: ${{ matrix.runner }} + steps: + - uses: actions/checkout@v4 + + - name: Set up Go environment + uses: actions/setup-go@v5 + with: + go-version: '1.22' + + - name: Build binary + run: | + mkdir -p release + echo "Building binary file for target: ${{ matrix.goos }}${{ matrix.goarch }}" + env GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o ./release/ndc-elasticsearch-cli-${{ matrix.target }}${{ matrix.extension }} + + - uses: actions/upload-artifact@v4 + with: + name: ndc-elasticsearch-cli-${{ matrix.target }}${{ matrix.extension }} + path: release/ + if-no-files-found: error + + release: + name: release to GitHub + permissions: + contents: write + needs: + - build-and-push-image + - build-cli-binaries + runs-on: ubuntu-latest + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + steps: + - uses: actions/checkout@v4 + + - uses: actions/download-artifact@v4 + with: + path: release/artifacts + merge-multiple: true + + - name: generate CLI manifest + run: | + set -evo pipefail + ROOT="$(pwd)" + + export CLI_VERSION="$GITHUB_REF_NAME" + + export LINUX_AMD64_SHA256=$(sha256sum ${ROOT}/release/artifacts/ndc-elasticsearch-cli-x86_64-unknown-linux-musl | cut -f1 -d' ') + export MACOS_AMD64_SHA256=$(sha256sum ${ROOT}/release/artifacts/ndc-elasticsearch-cli-x86_64-apple-darwin | cut -f1 -d' ') + export WINDOWS_AMD64_SHA256=$(sha256sum ${ROOT}/release/artifacts/ndc-elasticsearch-cli-x86_64-pc-windows-msvc.exe | cut -f1 -d' ') + export LINUX_ARM64_SHA256=$(sha256sum ${ROOT}/release/artifacts/ndc-elasticsearch-cli-aarch64-unknown-linux-musl | cut -f1 -d' ') + export MACOS_ARM64_SHA256=$(sha256sum ${ROOT}/release/artifacts/ndc-elasticsearch-cli-aarch64-apple-darwin | cut -f1 -d' ') + + mkdir -p "${ROOT}/release/" + cat "${ROOT}/ci/templates/manifest.yaml" | envsubst > "${ROOT}/release/manifest.yaml" + + - uses: actions/upload-artifact@v4 + with: + name: manifest.yaml + path: release/manifest.yaml + if-no-files-found: error + + - name: Build connector definition + run: | + set -evo pipefail + ROOT="$(pwd)" + + export DOCKER_IMAGE="ghcr.io/hasura/ndc-elasticsearch:$GITHUB_REF_NAME" + export CLI_VERSION=$GITHUB_REF_NAME + + mkdir -p "${ROOT}/release/connector-definition/.hasura-connector/" + cat "${ROOT}/ci/templates/connector-metadata.yaml" | envsubst > "${ROOT}/release/connector-definition/.hasura-connector/connector-metadata.yaml" + tar -czvf "${ROOT}/release/artifacts/connector-definition.tgz" --directory "${ROOT}/release/connector-definition/" . + + - uses: actions/upload-artifact@v4 + with: + name: connector-definition.tgz + path: ./release/artifacts/connector-definition.tgz + compression-level: 0 # Already compressed + + - name: Get version from tag + id: get-version + run: | + echo "tagged_version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT + shell: bash + + - uses: mindsers/changelog-reader-action@v2 + id: changelog-reader + with: + version: ${{ steps.get-version.outputs.tagged_version }} + path: ./CHANGELOG.md + + - name: create a draft release + uses: ncipollo/release-action@v1 + with: + draft: true + tag: v${{ steps.get-version.outputs.tagged_version }} + body: ${{ steps.changelog-reader.outputs.changes }} + artifacts: release/artifacts/* \ No newline at end of file diff --git a/.hasura-connector/.dockerignore b/.hasura-connector/.dockerignore deleted file mode 100644 index 4e059e3..0000000 --- a/.hasura-connector/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -.hasura-connector/ -.codegen/ -*.hml \ No newline at end of file diff --git a/.hasura-connector/Dockerfile b/.hasura-connector/Dockerfile deleted file mode 100644 index 65a0b33..0000000 --- a/.hasura-connector/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -# build context at repo root: docker build -f Dockerfile . -FROM golang:1.22 AS builder - -WORKDIR /app -COPY go.mod go.sum ./ -RUN go mod download -COPY . . -RUN CGO_ENABLED=0 go build -v -o ndc-cli . - -# stage 2: production image -FROM gcr.io/distroless/static-debian12:nonroot - -# Copy the binary to the production image from the builder stage. -COPY --from=builder /app/ndc-cli /ndc-cli - -# Run the web service on container startup. -CMD ["/ndc-cli", "serve"] \ No newline at end of file diff --git a/.hasura-connector/connector-metadata.yaml b/.hasura-connector/connector-metadata.yaml deleted file mode 100644 index df60b40..0000000 --- a/.hasura-connector/connector-metadata.yaml +++ /dev/null @@ -1,18 +0,0 @@ -packagingDefinition: - type: ManagedDockerBuild -supportedEnvironmentVariables: [] -commands: {} -dockerComposeWatch: - # Rebuild the container if root files or dependencies are changed - - path: go.mod - action: rebuild - - path: go.sum - action: rebuild - - path: main.go - action: rebuild - - path: connector.go - action: rebuild - - path: connector.generated.go - action: rebuild - - path: schema.generated.json - action: rebuild \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..99f6b5d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.1.0] + +- Initial release of the Hasura connector for Elasticsearch. diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..665f0c5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,33 @@ +# Stage 1: Build the Go binary +FROM golang:1.22 AS builder + +WORKDIR /app +COPY go.mod go.sum ./ +RUN go mod download +COPY . . + +# Build the Go application +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ndc-elasticsearch + +# Stage 2: Create a minimal image with the Go binary +FROM alpine:3.18.3 + +# Install necessary certificates for the application to run +RUN apk --no-cache add ca-certificates + +# Set the working directory inside the container +WORKDIR /root/ + +RUN mkdir -p /etc/connector + +# Copy the Go binary from the builder stage +COPY --from=builder /app/ndc-elasticsearch . + +# Expose the port on which the service will run +EXPOSE 8080 + +ENV HASURA_CONFIGURATION_DIRECTORY=/etc/connector + +# Run the web service on container startup. +ENTRYPOINT [ "./ndc-elasticsearch" ] +CMD [ "serve" ] \ No newline at end of file diff --git a/ci/templates/connector-metadata.yaml b/ci/templates/connector-metadata.yaml new file mode 100644 index 0000000..1a415af --- /dev/null +++ b/ci/templates/connector-metadata.yaml @@ -0,0 +1,25 @@ +packagingDefinition: + type: PrebuiltDockerImage + dockerImage: "${DOCKER_IMAGE}" +supportedEnvironmentVariables: + - name: ELASTICSEARCH_URL + description: The comma-separated list of Elasticsearch host addresses for connection. + - name: ELASTICSEARCH_USERNAME + description: The username for authenticating to the Elasticsearch cluster. + - name: ELASTICSEARCH_PASSWORD + description: The password for the Elasticsearch user account. + - name: ELASTICSEARCH_API_KEY + description: The Elasticsearch API key for authenticating to the Elasticsearch cluster. + - name: ELASTICSEARCH_CA_CERT_PATH + description: The path to the Certificate Authority (CA) certificate for verifying the Elasticsearch server's SSL certificate. + - name: ELASTICSEARCH_INDEX_PATTERN + description: The pattern for matching Elasticsearch indices, potentially including wildcards, used by the connector. +commands: + update: hasura-elasticsearch update +cliPlugin: + name: elasticsearch + version: "${CLI_VERSION}" +dockerComposeWatch: + - path: ./ + target: /etc/connector + action: sync+restart \ No newline at end of file diff --git a/ci/templates/manifest.yaml b/ci/templates/manifest.yaml new file mode 100644 index 0000000..5b83a39 --- /dev/null +++ b/ci/templates/manifest.yaml @@ -0,0 +1,41 @@ +name: elasticsearch +version: "${CLI_VERSION}" +shortDescription: "CLI plugin for Hasura ndc-elasticsearch" +homepage: https://hasura.io/connectors/elasticsearch +hidden: true +platforms: + - selector: darwin-arm64 + uri: "https://github.com/hasura/ndc-elasticsearch/releases/download/${CLI_VERSION}/ndc-elasticsearch-cli-aarch64-apple-darwin" + sha256: "${MACOS_ARM64_SHA256}" + bin: "hasura-elasticsearch" + files: + - from: "./ndc-elasticsearch-cli-aarch64-apple-darwin" + to: "hasura-elasticsearch" + - selector: linux-arm64 + uri: "https://github.com/hasura/ndc-elasticsearch/releases/download/${CLI_VERSION}/ndc-elasticsearch-cli-aarch64-unknown-linux-musl" + sha256: "${LINUX_ARM64_SHA256}" + bin: "hasura-elasticsearch" + files: + - from: "./ndc-elasticsearch-cli-aarch64-unknown-linux-musl" + to: "hasura-elasticsearch" + - selector: darwin-amd64 + uri: "https://github.com/hasura/ndc-elasticsearch/releases/download/${CLI_VERSION}/ndc-elasticsearch-cli-x86_64-apple-darwin" + sha256: "${MACOS_AMD64_SHA256}" + bin: "hasura-elasticsearch" + files: + - from: "./ndc-elasticsearch-cli-x86_64-apple-darwin" + to: "hasura-elasticsearch" + - selector: windows-amd64 + uri: "https://github.com/hasura/ndc-elasticsearch/releases/download/${CLI_VERSION}/ndc-elasticsearch-cli-x86_64-pc-windows-msvc.exe" + sha256: "${WINDOWS_AMD64_SHA256}" + bin: "hasura-elasticsearch.exe" + files: + - from: "./ndc-elasticsearch-cli-x86_64-pc-windows-msvc.exe" + to: "hasura-elasticsearch.exe" + - selector: linux-amd64 + uri: "https://github.com/hasura/ndc-elasticsearch/releases/download/${CLI_VERSION}/ndc-elasticsearch-cli-x86_64-unknown-linux-musl" + sha256: "${LINUX_AMD64_SHA256}" + bin: "hasura-elasticsearch" + files: + - from: "./ndc-elasticsearch-cli-x86_64-unknown-linux-musl" + to: "hasura-elasticsearch" \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..1280368 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,218 @@ +version: '3.8' +services: + ndc-elasticsearch: + build: . + volumes: + - ./configuration.json:/etc/connector/configuration.json + - certs:/usr/share/elasticsearch/config/certs + ports: + - 8080:8080 + environment: + HASURA_CONNECTOR_PORT: 8080 + HASURA_CONFIGURATION_DIRECTORY: /etc/connector + OTEL_EXPORTER_OTLP_ENDPOINT: "http://jaeger:4318" + OTEL_SERVICE_NAME: "ndc-elasticsarch" + ELASTICSEARCH_URL: https://es01:9200 + ELASTICSEARCH_USERNAME: elastic + ELASTICSEARCH_PASSWORD: ${ELASTIC_PASSWORD:-default} + ELASTICSEARCH_CA_CERT_PATH: /usr/share/elasticsearch/config/certs/es01/es01.crt + command: serve + depends_on: + jaeger: + condition: service_started + es01: + condition: service_healthy + + setup: + image: docker.elastic.co/elasticsearch/elasticsearch:${STACK_VERSION:-8.13.4} + volumes: + - certs:/usr/share/elasticsearch/config/certs + user: "0" + command: > + bash -c ' + if [ ! -f config/certs/ca.zip ]; then + echo "Creating CA"; + bin/elasticsearch-certutil ca --silent --pem -out config/certs/ca.zip; + unzip config/certs/ca.zip -d config/certs; + fi; + if [ ! -f config/certs/ca.zip ]; then + echo "Creating CA"; + bin/elasticsearch-certutil ca --silent --pem -out config/certs/ca.zip; + unzip config/certs/ca.zip -d config/certs; + fi; + if [ ! -f config/certs/certs.zip ]; then + echo "Creating certs"; + echo -ne \ + "instances:\n"\ + " - name: es01\n"\ + " dns:\n"\ + " - es01\n"\ + " - localhost\n"\ + " ip:\n"\ + " - 127.0.0.1\n"\ + > config/certs/instances.yml; + bin/elasticsearch-certutil cert --silent --pem -out config/certs/certs.zip --in config/certs/instances.yml --ca-cert config/certs/ca/ca.crt --ca-key config/certs/ca/ca.key; + unzip config/certs/certs.zip -d config/certs; + fi; + echo "Setting file permissions" + chown -R root:root config/certs; + find . -type d -exec chmod 750 \{\} \;; + find . -type f -exec chmod 640 \{\} \;; + echo "Waiting for Elasticsearch availability"; + until curl -s --cacert config/certs/ca/ca.crt https://es01:9200 | grep -q "missing authentication credentials"; do sleep 30; done; + echo "Setting kibana_system password"; + until curl -s -X POST --cacert config/certs/ca/ca.crt -u "elastic:${ELASTIC_PASSWORD:-default}" -H "Content-Type: application/json" https://es01:9200/_security/user/kibana_system/_password -d "{\"password\":\"${KIBANA_PASSWORD:-default}\"}" | grep -q "^{}"; do sleep 10; done; + echo "All done!"; + ' + healthcheck: + test: ["CMD-SHELL", "[ -f config/certs/es01/es01.crt ]"] + interval: 1s + timeout: 5s + retries: 120 + + es01: + depends_on: + setup: + condition: service_healthy + image: docker.elastic.co/elasticsearch/elasticsearch:${STACK_VERSION:-8.13.4} + volumes: + - certs:/usr/share/elasticsearch/config/certs + - esdata01:/usr/share/elasticsearch/data + ports: + - ${ES_PORT:-9200}:9200 + environment: + - node.name=es01 + - cluster.name=${CLUSTER_NAME:-docker-cluster} + - cluster.initial_master_nodes=es01 + - ELASTIC_PASSWORD=${ELASTIC_PASSWORD:-default} + - bootstrap.memory_lock=true + - xpack.security.enabled=true + - xpack.security.http.ssl.enabled=true + - xpack.security.http.ssl.key=certs/es01/es01.key + - xpack.security.http.ssl.certificate=certs/es01/es01.crt + - xpack.security.http.ssl.certificate_authorities=certs/ca/ca.crt + - xpack.security.transport.ssl.enabled=true + - xpack.security.transport.ssl.key=certs/es01/es01.key + - xpack.security.transport.ssl.certificate=certs/es01/es01.crt + - xpack.security.transport.ssl.certificate_authorities=certs/ca/ca.crt + - xpack.security.transport.ssl.verification_mode=certificate + - xpack.license.self_generated.type=${LICENSE:-basic} + mem_limit: ${MEM_LIMIT:-1073741824} + ulimits: + memlock: + soft: -1 + hard: -1 + healthcheck: + test: + [ + "CMD-SHELL", + "curl -s --cacert config/certs/ca/ca.crt https://localhost:9200 | grep -q 'missing authentication credentials'", + ] + interval: 10s + timeout: 10s + retries: 120 + + kibana: + depends_on: + es01: + condition: service_healthy + image: docker.elastic.co/kibana/kibana:${STACK_VERSION:-8.13.4} + volumes: + - certs:/usr/share/kibana/config/certs + - kibanadata:/usr/share/kibana/data + ports: + - ${KIBANA_PORT:-5601}:5601 + environment: + - SERVERNAME=kibana + - ELASTICSEARCH_HOSTS=https://es01:9200 + - ELASTICSEARCH_USERNAME=kibana_system + - ELASTICSEARCH_PASSWORD=${KIBANA_PASSWORD:-default} + - ELASTICSEARCH_SSL_CERTIFICATEAUTHORITIES=config/certs/ca/ca.crt + mem_limit: ${MEM_LIMIT:-1073741824} + healthcheck: + test: + [ + "CMD-SHELL", + "curl -s -I http://localhost:5601 | grep -q 'HTTP/1.1 302 Found'", + ] + interval: 10s + timeout: 10s + retries: 120 + + engine: + image: ghcr.io/hasura/v3-engine:6c9979ddaad50d476c0996d1ece48f0cf1c8e99d + platform: linux/amd64 + environment: + - METADATA_PATH=/metadata/metadata.json + - AUTHN_CONFIG_PATH=/metadata/auth_config.json + - OTLP_ENDPOINT=http://jaeger:4317 + ports: + - 3000:3000 + volumes: + - ./resources:/metadata + depends_on: + ndc-elasticsearch: + condition: service_started + jaeger: + condition: service_started + auth_hook: + condition: service_started + develop: + watch: + - path: ./resources/metadata.json + target: /metadata.json + action: sync+restart + - path: ./resources/auth_config.json + target: /auth_config.json + action: sync+restart + + auth_hook: + image: ghcr.io/hasura/v3-dev-auth-webhook + platform: linux/amd64 + environment: + OTLP_ENDPOINT: "http://jaeger:4317" + ports: + - "3050:3050" + depends_on: + jaeger: + condition: service_started + + jaeger: + image: jaegertracing/all-in-one:1.55 + restart: always + ports: + - 5775:5775/udp + - 6831:6831/udp + - 6832:6832/udp + - 5778:5778 + - 4002:16686 + - 14250:14250 + - 14268:14268 + - 14269:14269 + - 4317:4317 # OTLP gRPC + - 4318:4318 # OTLP HTTP + - 9411:9411 + environment: + COLLECTOR_OTLP_ENABLED: "true" + COLLECTOR_ZIPKIN_HOST_PORT: "9411" + + prometheus: + image: prom/prometheus + container_name: prometheus + command: + - "--config.file=/etc/prometheus/prometheus.yaml" + ports: + - 9090:9090 + restart: unless-stopped + volumes: + - type: bind + source: ./resources/prometheus/prometheus.yaml + target: /etc/prometheus/prometheus.yaml + +volumes: + certs: + driver: local + esdata01: + driver: local + kibanadata: + driver: local diff --git a/resources/auth_config.json b/resources/auth_config.json new file mode 100644 index 0000000..4e24d80 --- /dev/null +++ b/resources/auth_config.json @@ -0,0 +1,12 @@ +{ + "version": "v1", + "definition": { + "allowRoleEmulationBy": "admin", + "mode": { + "webhook": { + "url": "http://auth_hook:3050/validate-request", + "method": "Post" + } + } + } +} \ No newline at end of file diff --git a/resources/metadata.json b/resources/metadata.json new file mode 100644 index 0000000..4d79ce2 --- /dev/null +++ b/resources/metadata.json @@ -0,0 +1,2972 @@ +{ + "version": "v2", + "supergraph": { + "objects": [ + { + "kind": "GraphqlConfig", + "version": "v1", + "definition": { + "query": { + "rootOperationTypeName": "Query", + "argumentsInput": { + "fieldName": "args" + }, + "limitInput": { + "fieldName": "limit" + }, + "offsetInput": { + "fieldName": "offset" + }, + "filterInput": { + "fieldName": "where", + "operatorNames": { + "and": "_and", + "or": "_or", + "not": "_not", + "isNull": "_is_null" + } + }, + "orderByInput": { + "fieldName": "order_by", + "enumDirectionValues": { + "asc": "Asc", + "desc": "Desc" + }, + "enumTypeNames": [ + { + "directions": [ + "Asc", + "Desc" + ], + "typeName": "OrderBy" + } + ] + } + }, + "mutation": { + "rootOperationTypeName": "Mutation" + } + } + } + ] + }, + "subgraphs": [ + { + "name": "app", + "objects": [ + { + "kind": "DataConnectorLink", + "version": "v1", + "definition": { + "name": "elasticsearch", + "url": { + "singleUrl": { + "value": "http://ndc-elasticsearch:8080" + } + }, + "schema": { + "version": "v0.1", + "schema": { + "scalar_types": { + "_id": { + "representation": { + "type": "string" + }, + "aggregate_functions": {}, + "comparison_operators": { + "match": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "_id" + } + }, + "match_phrase": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "_id" + } + }, + "term": { + "type": "equal" + }, + "terms": { + "type": "custom", + "argument_type": { + "type": "array", + "element_type": { + "type": "named", + "name": "_id" + } + } + } + } + }, + "boolean": { + "representation": { + "type": "boolean" + }, + "aggregate_functions": { + "avg": { + "result_type": { + "type": "named", + "name": "integer" + } + }, + "cardinality": { + "result_type": { + "type": "named", + "name": "integer" + } + }, + "max": { + "result_type": { + "type": "named", + "name": "integer" + } + }, + "min": { + "result_type": { + "type": "named", + "name": "integer" + } + }, + "stats": { + "result_type": { + "type": "named", + "name": "stats" + } + }, + "sum": { + "result_type": { + "type": "named", + "name": "integer" + } + }, + "value_count": { + "result_type": { + "type": "named", + "name": "integer" + } + } + }, + "comparison_operators": { + "match": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "boolean" + } + }, + "match_phrase": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "boolean" + } + }, + "term": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "boolean" + } + }, + "terms": { + "type": "custom", + "argument_type": { + "type": "array", + "element_type": { + "type": "named", + "name": "boolean" + } + } + } + } + }, + "date": { + "representation": { + "type": "string" + }, + "aggregate_functions": { + "avg": { + "result_type": { + "type": "named", + "name": "long" + } + }, + "cardinality": { + "result_type": { + "type": "named", + "name": "integer" + } + }, + "max": { + "result_type": { + "type": "named", + "name": "long" + } + }, + "min": { + "result_type": { + "type": "named", + "name": "long" + } + }, + "stats": { + "result_type": { + "type": "named", + "name": "stats" + } + }, + "sum": { + "result_type": { + "type": "named", + "name": "long" + } + }, + "value_count": { + "result_type": { + "type": "named", + "name": "integer" + } + } + }, + "comparison_operators": { + "match": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "date" + } + }, + "match_phrase": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "date" + } + }, + "term": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "date" + } + }, + "terms": { + "type": "custom", + "argument_type": { + "type": "array", + "element_type": { + "type": "named", + "name": "date" + } + } + } + } + }, + "double": { + "representation": { + "type": "number" + }, + "aggregate_functions": { + "avg": { + "result_type": { + "type": "named", + "name": "double" + } + }, + "cardinality": { + "result_type": { + "type": "named", + "name": "integer" + } + }, + "max": { + "result_type": { + "type": "named", + "name": "double" + } + }, + "min": { + "result_type": { + "type": "named", + "name": "double" + } + }, + "stats": { + "result_type": { + "type": "named", + "name": "stats" + } + }, + "sum": { + "result_type": { + "type": "named", + "name": "double" + } + }, + "value_count": { + "result_type": { + "type": "named", + "name": "integer" + } + } + }, + "comparison_operators": { + "match": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "double" + } + }, + "match_phrase": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "double" + } + }, + "term": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "double" + } + }, + "terms": { + "type": "custom", + "argument_type": { + "type": "array", + "element_type": { + "type": "named", + "name": "double" + } + } + } + } + }, + "float": { + "representation": { + "type": "number" + }, + "aggregate_functions": { + "avg": { + "result_type": { + "type": "named", + "name": "float" + } + }, + "cardinality": { + "result_type": { + "type": "named", + "name": "integer" + } + }, + "max": { + "result_type": { + "type": "named", + "name": "float" + } + }, + "min": { + "result_type": { + "type": "named", + "name": "float" + } + }, + "stats": { + "result_type": { + "type": "named", + "name": "stats" + } + }, + "sum": { + "result_type": { + "type": "named", + "name": "float" + } + }, + "value_count": { + "result_type": { + "type": "named", + "name": "integer" + } + } + }, + "comparison_operators": { + "match": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "float" + } + }, + "match_phrase": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "float" + } + }, + "term": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "float" + } + }, + "terms": { + "type": "custom", + "argument_type": { + "type": "array", + "element_type": { + "type": "named", + "name": "float" + } + } + } + } + }, + "half_float": { + "representation": { + "type": "number" + }, + "aggregate_functions": { + "avg": { + "result_type": { + "type": "named", + "name": "half_float" + } + }, + "cardinality": { + "result_type": { + "type": "named", + "name": "integer" + } + }, + "max": { + "result_type": { + "type": "named", + "name": "half_float" + } + }, + "min": { + "result_type": { + "type": "named", + "name": "half_float" + } + }, + "stats": { + "result_type": { + "type": "named", + "name": "stats" + } + }, + "sum": { + "result_type": { + "type": "named", + "name": "half_float" + } + }, + "value_count": { + "result_type": { + "type": "named", + "name": "integer" + } + } + }, + "comparison_operators": { + "match": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "half_float" + } + }, + "match_phrase": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "half_float" + } + }, + "term": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "half_float" + } + }, + "terms": { + "type": "custom", + "argument_type": { + "type": "array", + "element_type": { + "type": "named", + "name": "half_float" + } + } + } + } + }, + "integer": { + "representation": { + "type": "integer" + }, + "aggregate_functions": { + "avg": { + "result_type": { + "type": "named", + "name": "integer" + } + }, + "cardinality": { + "result_type": { + "type": "named", + "name": "integer" + } + }, + "max": { + "result_type": { + "type": "named", + "name": "integer" + } + }, + "min": { + "result_type": { + "type": "named", + "name": "integer" + } + }, + "stats": { + "result_type": { + "type": "named", + "name": "stats" + } + }, + "sum": { + "result_type": { + "type": "named", + "name": "integer" + } + }, + "value_count": { + "result_type": { + "type": "named", + "name": "integer" + } + } + }, + "comparison_operators": { + "match": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "integer" + } + }, + "match_phrase": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "integer" + } + }, + "term": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "integer" + } + }, + "terms": { + "type": "custom", + "argument_type": { + "type": "array", + "element_type": { + "type": "named", + "name": "integer" + } + } + } + } + }, + "keyword": { + "representation": { + "type": "string" + }, + "aggregate_functions": { + "cardinality": { + "result_type": { + "type": "named", + "name": "integer" + } + }, + "string_stats": { + "result_type": { + "type": "named", + "name": "string_stats" + } + }, + "value_count": { + "result_type": { + "type": "named", + "name": "integer" + } + } + }, + "comparison_operators": { + "match": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "keyword" + } + }, + "match_bool_prefix": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "keyword" + } + }, + "match_phrase": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "keyword" + } + }, + "prefix": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "keyword" + } + }, + "regexp": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "keyword" + } + }, + "term": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "keyword" + } + }, + "terms": { + "type": "custom", + "argument_type": { + "type": "array", + "element_type": { + "type": "named", + "name": "keyword" + } + } + }, + "wildcard": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "keyword" + } + } + } + }, + "text": { + "representation": { + "type": "string" + }, + "aggregate_functions": {}, + "comparison_operators": { + "match": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "text" + } + }, + "match_bool_prefix": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "text" + } + }, + "match_phrase": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "text" + } + }, + "match_phrase_prefix": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "text" + } + }, + "prefix": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "text" + } + }, + "regexp": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "text" + } + }, + "term": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "text" + } + }, + "terms": { + "type": "custom", + "argument_type": { + "type": "array", + "element_type": { + "type": "named", + "name": "text" + } + } + }, + "wildcard": { + "type": "custom", + "argument_type": { + "type": "named", + "name": "text" + } + } + } + } + }, + "object_types": { + "alias": { + "fields": {} + }, + "date_range": { + "fields": {} + }, + "dense_vector": { + "fields": {} + }, + "double_range": { + "fields": {} + }, + "event": { + "fields": {} + }, + "float_range": { + "fields": {} + }, + "geo_point": { + "fields": {} + }, + "geo_shape": { + "fields": {} + }, + "geoip": { + "fields": {} + }, + "histogram": { + "fields": { + "counts": { + "type": { + "type": "named", + "name": "integer" + } + }, + "values": { + "type": { + "type": "named", + "name": "float" + } + } + } + }, + "integer_range": { + "fields": {} + }, + "ip_range": { + "fields": {} + }, + "join": { + "fields": {} + }, + "kibana_sample_data_ecommerce": { + "fields": { + "_id": { + "type": { + "type": "named", + "name": "_id" + } + }, + "category": { + "type": { + "type": "named", + "name": "text" + } + }, + "currency": { + "type": { + "type": "named", + "name": "keyword" + } + }, + "customer_birth_date": { + "type": { + "type": "named", + "name": "date" + } + }, + "customer_first_name": { + "type": { + "type": "named", + "name": "text" + } + }, + "customer_full_name": { + "type": { + "type": "named", + "name": "text" + } + }, + "customer_gender": { + "type": { + "type": "named", + "name": "keyword" + } + }, + "customer_id": { + "type": { + "type": "named", + "name": "keyword" + } + }, + "customer_last_name": { + "type": { + "type": "named", + "name": "text" + } + }, + "customer_phone": { + "type": { + "type": "named", + "name": "keyword" + } + }, + "day_of_week": { + "type": { + "type": "named", + "name": "keyword" + } + }, + "day_of_week_i": { + "type": { + "type": "named", + "name": "integer" + } + }, + "email": { + "type": { + "type": "named", + "name": "keyword" + } + }, + "event": { + "type": { + "type": "named", + "name": "event" + } + }, + "geoip": { + "type": { + "type": "named", + "name": "geoip" + } + }, + "manufacturer": { + "type": { + "type": "named", + "name": "text" + } + }, + "order_date": { + "type": { + "type": "named", + "name": "date" + } + }, + "order_id": { + "type": { + "type": "named", + "name": "keyword" + } + }, + "products": { + "type": { + "type": "named", + "name": "products" + } + }, + "sku": { + "type": { + "type": "named", + "name": "keyword" + } + }, + "taxful_total_price": { + "type": { + "type": "named", + "name": "half_float" + } + }, + "taxless_total_price": { + "type": { + "type": "named", + "name": "half_float" + } + }, + "total_quantity": { + "type": { + "type": "named", + "name": "integer" + } + }, + "total_unique_products": { + "type": { + "type": "named", + "name": "integer" + } + }, + "type": { + "type": { + "type": "named", + "name": "keyword" + } + }, + "user": { + "type": { + "type": "named", + "name": "keyword" + } + } + } + }, + "kibana_sample_data_flights": { + "fields": { + "AvgTicketPrice": { + "type": { + "type": "named", + "name": "float" + } + }, + "Cancelled": { + "type": { + "type": "named", + "name": "boolean" + } + }, + "Carrier": { + "type": { + "type": "named", + "name": "keyword" + } + }, + "Dest": { + "type": { + "type": "named", + "name": "keyword" + } + }, + "DestAirportID": { + "type": { + "type": "named", + "name": "keyword" + } + }, + "DestCityName": { + "type": { + "type": "named", + "name": "keyword" + } + }, + "DestCountry": { + "type": { + "type": "named", + "name": "keyword" + } + }, + "DestLocation": { + "type": { + "type": "named", + "name": "geo_point" + } + }, + "DestRegion": { + "type": { + "type": "named", + "name": "keyword" + } + }, + "DestWeather": { + "type": { + "type": "named", + "name": "keyword" + } + }, + "DistanceKilometers": { + "type": { + "type": "named", + "name": "float" + } + }, + "DistanceMiles": { + "type": { + "type": "named", + "name": "float" + } + }, + "FlightDelay": { + "type": { + "type": "named", + "name": "boolean" + } + }, + "FlightDelayMin": { + "type": { + "type": "named", + "name": "integer" + } + }, + "FlightDelayType": { + "type": { + "type": "named", + "name": "keyword" + } + }, + "FlightNum": { + "type": { + "type": "named", + "name": "keyword" + } + }, + "FlightTimeHour": { + "type": { + "type": "named", + "name": "keyword" + } + }, + "FlightTimeMin": { + "type": { + "type": "named", + "name": "float" + } + }, + "Origin": { + "type": { + "type": "named", + "name": "keyword" + } + }, + "OriginAirportID": { + "type": { + "type": "named", + "name": "keyword" + } + }, + "OriginCityName": { + "type": { + "type": "named", + "name": "keyword" + } + }, + "OriginCountry": { + "type": { + "type": "named", + "name": "keyword" + } + }, + "OriginLocation": { + "type": { + "type": "named", + "name": "geo_point" + } + }, + "OriginRegion": { + "type": { + "type": "named", + "name": "keyword" + } + }, + "OriginWeather": { + "type": { + "type": "named", + "name": "keyword" + } + }, + "_id": { + "type": { + "type": "named", + "name": "_id" + } + }, + "dayOfWeek": { + "type": { + "type": "named", + "name": "integer" + } + }, + "timestamp": { + "type": { + "type": "named", + "name": "date" + } + } + } + }, + "long_range": { + "fields": {} + }, + "percolator": { + "fields": {} + }, + "point": { + "fields": {} + }, + "products": { + "fields": {} + }, + "rank_feature": { + "fields": {} + }, + "rank_features": { + "fields": {} + }, + "shape": { + "fields": {} + }, + "sparse_vector": { + "fields": {} + }, + "stats": { + "fields": { + "avg": { + "type": { + "type": "named", + "name": "double" + } + }, + "count": { + "type": { + "type": "named", + "name": "integer" + } + }, + "max": { + "type": { + "type": "named", + "name": "double" + } + }, + "min": { + "type": { + "type": "named", + "name": "double" + } + }, + "sum": { + "type": { + "type": "named", + "name": "double" + } + } + } + }, + "string_stats": { + "fields": { + "avg_length": { + "type": { + "type": "named", + "name": "double" + } + }, + "count": { + "type": { + "type": "named", + "name": "integer" + } + }, + "entropy": { + "type": { + "type": "named", + "name": "double" + } + }, + "max_length": { + "type": { + "type": "named", + "name": "integer" + } + }, + "min_length": { + "type": { + "type": "named", + "name": "integer" + } + } + } + } + }, + "collections": [ + { + "name": "kibana_sample_data_ecommerce", + "arguments": {}, + "type": "kibana_sample_data_ecommerce", + "uniqueness_constraints": { + "kibana_sample_data_ecommerce_by_id": { + "unique_columns": [ + "_id" + ] + } + }, + "foreign_keys": {} + }, + { + "name": "kibana_sample_data_flights", + "arguments": {}, + "type": "kibana_sample_data_flights", + "uniqueness_constraints": { + "kibana_sample_data_flights_by_id": { + "unique_columns": [ + "_id" + ] + } + }, + "foreign_keys": {} + } + ], + "functions": [], + "procedures": [] + }, + "capabilities": { + "version": "0.1.2", + "capabilities": { + "query": { + "aggregates": {}, + "variables": {} + }, + "mutation": {} + } + } + } + } + }, + { + "kind": "DataConnectorScalarRepresentation", + "version": "v1", + "definition": { + "graphql": { + "comparisonExpressionTypeName": "App_IdComparisonExp" + }, + "dataConnectorName": "elasticsearch", + "dataConnectorScalarType": "_id", + "representation": "Id" + } + }, + { + "kind": "DataConnectorScalarRepresentation", + "version": "v1", + "definition": { + "graphql": { + "comparisonExpressionTypeName": "App_TextComparisonExp" + }, + "dataConnectorName": "elasticsearch", + "dataConnectorScalarType": "text", + "representation": "Text" + } + }, + { + "kind": "DataConnectorScalarRepresentation", + "version": "v1", + "definition": { + "graphql": { + "comparisonExpressionTypeName": "App_KeywordComparisonExp" + }, + "dataConnectorName": "elasticsearch", + "dataConnectorScalarType": "keyword", + "representation": "Keyword" + } + }, + { + "kind": "DataConnectorScalarRepresentation", + "version": "v1", + "definition": { + "graphql": { + "comparisonExpressionTypeName": "App_DateComparisonExp" + }, + "dataConnectorName": "elasticsearch", + "dataConnectorScalarType": "date", + "representation": "Date" + } + }, + { + "kind": "DataConnectorScalarRepresentation", + "version": "v1", + "definition": { + "graphql": { + "comparisonExpressionTypeName": "App_IntegerComparisonExp" + }, + "dataConnectorName": "elasticsearch", + "dataConnectorScalarType": "integer", + "representation": "Integer" + } + }, + { + "kind": "DataConnectorScalarRepresentation", + "version": "v1", + "definition": { + "graphql": { + "comparisonExpressionTypeName": "App_HalfFloatComparisonExp" + }, + "dataConnectorName": "elasticsearch", + "dataConnectorScalarType": "half_float", + "representation": "HalfFloat" + } + }, + { + "kind": "DataConnectorScalarRepresentation", + "version": "v1", + "definition": { + "graphql": { + "comparisonExpressionTypeName": "App_Float1ComparisonExp" + }, + "dataConnectorName": "elasticsearch", + "dataConnectorScalarType": "float", + "representation": "Float_1" + } + }, + { + "kind": "DataConnectorScalarRepresentation", + "version": "v1", + "definition": { + "graphql": { + "comparisonExpressionTypeName": "App_Boolean1ComparisonExp" + }, + "dataConnectorName": "elasticsearch", + "dataConnectorScalarType": "boolean", + "representation": "Boolean_1" + } + }, + { + "kind": "Model", + "version": "v1", + "definition": { + "name": "KibanaSampleDataEcommerce", + "graphql": { + "selectUniques": [ + { + "queryRootField": "app_kibanaSampleDataEcommerceById", + "uniqueIdentifier": [ + "id" + ] + } + ], + "selectMany": { + "queryRootField": "app_kibanaSampleDataEcommerce" + }, + "orderByExpressionType": "App_KibanaSampleDataEcommerceOrderBy" + }, + "objectType": "KibanaSampleDataEcommerce", + "source": { + "dataConnectorName": "elasticsearch", + "collection": "kibana_sample_data_ecommerce" + }, + "filterExpressionType": "KibanaSampleDataEcommerceBoolExp", + "orderableFields": [ + { + "fieldName": "id", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "category", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "currency", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "customerBirthDate", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "customerFirstName", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "customerFullName", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "customerGender", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "customerId", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "customerLastName", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "customerPhone", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "dayOfWeek", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "dayOfWeekI", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "email", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "event", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "geoip", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "manufacturer", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "orderDate", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "orderId", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "products", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "sku", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "taxfulTotalPrice", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "taxlessTotalPrice", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "totalQuantity", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "totalUniqueProducts", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "type", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "user", + "orderByDirections": { + "enableAll": true + } + } + ] + } + }, + { + "kind": "Model", + "version": "v1", + "definition": { + "name": "KibanaSampleDataFlights", + "graphql": { + "selectUniques": [ + { + "queryRootField": "app_kibanaSampleDataFlightsById", + "uniqueIdentifier": [ + "id" + ] + } + ], + "selectMany": { + "queryRootField": "app_kibanaSampleDataFlights" + }, + "orderByExpressionType": "App_KibanaSampleDataFlightsOrderBy" + }, + "objectType": "KibanaSampleDataFlights", + "source": { + "dataConnectorName": "elasticsearch", + "collection": "kibana_sample_data_flights" + }, + "filterExpressionType": "KibanaSampleDataFlightsBoolExp", + "orderableFields": [ + { + "fieldName": "id", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "avgTicketPrice", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "cancelled", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "carrier", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "dest", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "destAirportId", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "destCityName", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "destCountry", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "destLocation", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "destRegion", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "destWeather", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "distanceKilometers", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "distanceMiles", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "flightDelay", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "flightDelayMin", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "flightDelayType", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "flightNum", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "flightTimeHour", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "flightTimeMin", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "origin", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "originAirportId", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "originCityName", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "originCountry", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "originLocation", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "originRegion", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "originWeather", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "dayOfWeek", + "orderByDirections": { + "enableAll": true + } + }, + { + "fieldName": "timestamp", + "orderByDirections": { + "enableAll": true + } + } + ] + } + }, + { + "kind": "ModelPermissions", + "version": "v1", + "definition": { + "permissions": [ + { + "role": "admin", + "select": { + "filter": null + } + } + ], + "modelName": "KibanaSampleDataEcommerce" + } + }, + { + "kind": "ModelPermissions", + "version": "v1", + "definition": { + "permissions": [ + { + "role": "admin", + "select": { + "filter": null + } + } + ], + "modelName": "KibanaSampleDataFlights" + } + }, + { + "kind": "ObjectBooleanExpressionType", + "version": "v1", + "definition": { + "name": "KibanaSampleDataEcommerceBoolExp", + "graphql": { + "typeName": "App_KibanaSampleDataEcommerceBoolExp" + }, + "objectType": "KibanaSampleDataEcommerce", + "dataConnectorName": "elasticsearch", + "dataConnectorObjectType": "kibana_sample_data_ecommerce", + "comparableFields": [ + { + "fieldName": "id", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "category", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "currency", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "customerBirthDate", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "customerFirstName", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "customerFullName", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "customerGender", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "customerId", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "customerLastName", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "customerPhone", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "dayOfWeek", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "dayOfWeekI", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "email", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "event", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "geoip", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "manufacturer", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "orderDate", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "orderId", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "products", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "sku", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "taxfulTotalPrice", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "taxlessTotalPrice", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "totalQuantity", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "totalUniqueProducts", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "type", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "user", + "operators": { + "enableAll": true + } + } + ] + } + }, + { + "kind": "ObjectBooleanExpressionType", + "version": "v1", + "definition": { + "name": "KibanaSampleDataFlightsBoolExp", + "graphql": { + "typeName": "App_KibanaSampleDataFlightsBoolExp" + }, + "objectType": "KibanaSampleDataFlights", + "dataConnectorName": "elasticsearch", + "dataConnectorObjectType": "kibana_sample_data_flights", + "comparableFields": [ + { + "fieldName": "id", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "avgTicketPrice", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "cancelled", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "carrier", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "dest", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "destAirportId", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "destCityName", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "destCountry", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "destLocation", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "destRegion", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "destWeather", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "distanceKilometers", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "distanceMiles", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "flightDelay", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "flightDelayMin", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "flightDelayType", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "flightNum", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "flightTimeHour", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "flightTimeMin", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "origin", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "originAirportId", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "originCityName", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "originCountry", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "originLocation", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "originRegion", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "originWeather", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "dayOfWeek", + "operators": { + "enableAll": true + } + }, + { + "fieldName": "timestamp", + "operators": { + "enableAll": true + } + } + ] + } + }, + { + "kind": "ObjectType", + "version": "v1", + "definition": { + "name": "Event", + "fields": [], + "graphql": { + "typeName": "App_Event", + "inputTypeName": "App_EventInput" + }, + "dataConnectorTypeMapping": [ + { + "dataConnectorName": "elasticsearch", + "dataConnectorObjectType": "event" + } + ] + } + }, + { + "kind": "ObjectType", + "version": "v1", + "definition": { + "name": "Geoip", + "fields": [], + "graphql": { + "typeName": "App_Geoip", + "inputTypeName": "App_GeoipInput" + }, + "dataConnectorTypeMapping": [ + { + "dataConnectorName": "elasticsearch", + "dataConnectorObjectType": "geoip" + } + ] + } + }, + { + "kind": "ObjectType", + "version": "v1", + "definition": { + "name": "Products", + "fields": [], + "graphql": { + "typeName": "App_Products", + "inputTypeName": "App_ProductsInput" + }, + "dataConnectorTypeMapping": [ + { + "dataConnectorName": "elasticsearch", + "dataConnectorObjectType": "products" + } + ] + } + }, + { + "kind": "ObjectType", + "version": "v1", + "definition": { + "name": "KibanaSampleDataEcommerce", + "fields": [ + { + "name": "id", + "type": "Id!" + }, + { + "name": "category", + "type": "Text!" + }, + { + "name": "currency", + "type": "Keyword!" + }, + { + "name": "customerBirthDate", + "type": "Date!" + }, + { + "name": "customerFirstName", + "type": "Text!" + }, + { + "name": "customerFullName", + "type": "Text!" + }, + { + "name": "customerGender", + "type": "Keyword!" + }, + { + "name": "customerId", + "type": "Keyword!" + }, + { + "name": "customerLastName", + "type": "Text!" + }, + { + "name": "customerPhone", + "type": "Keyword!" + }, + { + "name": "dayOfWeek", + "type": "Keyword!" + }, + { + "name": "dayOfWeekI", + "type": "Integer!" + }, + { + "name": "email", + "type": "Keyword!" + }, + { + "name": "event", + "type": "Event!" + }, + { + "name": "geoip", + "type": "Geoip!" + }, + { + "name": "manufacturer", + "type": "Text!" + }, + { + "name": "orderDate", + "type": "Date!" + }, + { + "name": "orderId", + "type": "Keyword!" + }, + { + "name": "products", + "type": "Products!" + }, + { + "name": "sku", + "type": "Keyword!" + }, + { + "name": "taxfulTotalPrice", + "type": "HalfFloat!" + }, + { + "name": "taxlessTotalPrice", + "type": "HalfFloat!" + }, + { + "name": "totalQuantity", + "type": "Integer!" + }, + { + "name": "totalUniqueProducts", + "type": "Integer!" + }, + { + "name": "type", + "type": "Keyword!" + }, + { + "name": "user", + "type": "Keyword!" + } + ], + "graphql": { + "typeName": "App_KibanaSampleDataEcommerce", + "inputTypeName": "App_KibanaSampleDataEcommerceInput" + }, + "dataConnectorTypeMapping": [ + { + "dataConnectorName": "elasticsearch", + "dataConnectorObjectType": "kibana_sample_data_ecommerce", + "fieldMapping": { + "category": { + "column": { + "name": "category" + } + }, + "currency": { + "column": { + "name": "currency" + } + }, + "customerBirthDate": { + "column": { + "name": "customer_birth_date" + } + }, + "customerFirstName": { + "column": { + "name": "customer_first_name" + } + }, + "customerFullName": { + "column": { + "name": "customer_full_name" + } + }, + "customerGender": { + "column": { + "name": "customer_gender" + } + }, + "customerId": { + "column": { + "name": "customer_id" + } + }, + "customerLastName": { + "column": { + "name": "customer_last_name" + } + }, + "customerPhone": { + "column": { + "name": "customer_phone" + } + }, + "dayOfWeek": { + "column": { + "name": "day_of_week" + } + }, + "dayOfWeekI": { + "column": { + "name": "day_of_week_i" + } + }, + "email": { + "column": { + "name": "email" + } + }, + "event": { + "column": { + "name": "event" + } + }, + "geoip": { + "column": { + "name": "geoip" + } + }, + "id": { + "column": { + "name": "_id" + } + }, + "manufacturer": { + "column": { + "name": "manufacturer" + } + }, + "orderDate": { + "column": { + "name": "order_date" + } + }, + "orderId": { + "column": { + "name": "order_id" + } + }, + "products": { + "column": { + "name": "products" + } + }, + "sku": { + "column": { + "name": "sku" + } + }, + "taxfulTotalPrice": { + "column": { + "name": "taxful_total_price" + } + }, + "taxlessTotalPrice": { + "column": { + "name": "taxless_total_price" + } + }, + "totalQuantity": { + "column": { + "name": "total_quantity" + } + }, + "totalUniqueProducts": { + "column": { + "name": "total_unique_products" + } + }, + "type": { + "column": { + "name": "type" + } + }, + "user": { + "column": { + "name": "user" + } + } + } + } + ] + } + }, + { + "kind": "ObjectType", + "version": "v1", + "definition": { + "name": "GeoPoint", + "fields": [], + "graphql": { + "typeName": "App_GeoPoint", + "inputTypeName": "App_GeoPointInput" + }, + "dataConnectorTypeMapping": [ + { + "dataConnectorName": "elasticsearch", + "dataConnectorObjectType": "geo_point" + } + ] + } + }, + { + "kind": "ObjectType", + "version": "v1", + "definition": { + "name": "KibanaSampleDataFlights", + "fields": [ + { + "name": "id", + "type": "Id!" + }, + { + "name": "avgTicketPrice", + "type": "Float_1!" + }, + { + "name": "cancelled", + "type": "Boolean_1!" + }, + { + "name": "carrier", + "type": "Keyword!" + }, + { + "name": "dest", + "type": "Keyword!" + }, + { + "name": "destAirportId", + "type": "Keyword!" + }, + { + "name": "destCityName", + "type": "Keyword!" + }, + { + "name": "destCountry", + "type": "Keyword!" + }, + { + "name": "destLocation", + "type": "GeoPoint!" + }, + { + "name": "destRegion", + "type": "Keyword!" + }, + { + "name": "destWeather", + "type": "Keyword!" + }, + { + "name": "distanceKilometers", + "type": "Float_1!" + }, + { + "name": "distanceMiles", + "type": "Float_1!" + }, + { + "name": "flightDelay", + "type": "Boolean_1!" + }, + { + "name": "flightDelayMin", + "type": "Integer!" + }, + { + "name": "flightDelayType", + "type": "Keyword!" + }, + { + "name": "flightNum", + "type": "Keyword!" + }, + { + "name": "flightTimeHour", + "type": "Keyword!" + }, + { + "name": "flightTimeMin", + "type": "Float_1!" + }, + { + "name": "origin", + "type": "Keyword!" + }, + { + "name": "originAirportId", + "type": "Keyword!" + }, + { + "name": "originCityName", + "type": "Keyword!" + }, + { + "name": "originCountry", + "type": "Keyword!" + }, + { + "name": "originLocation", + "type": "GeoPoint!" + }, + { + "name": "originRegion", + "type": "Keyword!" + }, + { + "name": "originWeather", + "type": "Keyword!" + }, + { + "name": "dayOfWeek", + "type": "Integer!" + }, + { + "name": "timestamp", + "type": "Date!" + } + ], + "graphql": { + "typeName": "App_KibanaSampleDataFlights", + "inputTypeName": "App_KibanaSampleDataFlightsInput" + }, + "dataConnectorTypeMapping": [ + { + "dataConnectorName": "elasticsearch", + "dataConnectorObjectType": "kibana_sample_data_flights", + "fieldMapping": { + "avgTicketPrice": { + "column": { + "name": "AvgTicketPrice" + } + }, + "cancelled": { + "column": { + "name": "Cancelled" + } + }, + "carrier": { + "column": { + "name": "Carrier" + } + }, + "dayOfWeek": { + "column": { + "name": "dayOfWeek" + } + }, + "dest": { + "column": { + "name": "Dest" + } + }, + "destAirportId": { + "column": { + "name": "DestAirportID" + } + }, + "destCityName": { + "column": { + "name": "DestCityName" + } + }, + "destCountry": { + "column": { + "name": "DestCountry" + } + }, + "destLocation": { + "column": { + "name": "DestLocation" + } + }, + "destRegion": { + "column": { + "name": "DestRegion" + } + }, + "destWeather": { + "column": { + "name": "DestWeather" + } + }, + "distanceKilometers": { + "column": { + "name": "DistanceKilometers" + } + }, + "distanceMiles": { + "column": { + "name": "DistanceMiles" + } + }, + "flightDelay": { + "column": { + "name": "FlightDelay" + } + }, + "flightDelayMin": { + "column": { + "name": "FlightDelayMin" + } + }, + "flightDelayType": { + "column": { + "name": "FlightDelayType" + } + }, + "flightNum": { + "column": { + "name": "FlightNum" + } + }, + "flightTimeHour": { + "column": { + "name": "FlightTimeHour" + } + }, + "flightTimeMin": { + "column": { + "name": "FlightTimeMin" + } + }, + "id": { + "column": { + "name": "_id" + } + }, + "origin": { + "column": { + "name": "Origin" + } + }, + "originAirportId": { + "column": { + "name": "OriginAirportID" + } + }, + "originCityName": { + "column": { + "name": "OriginCityName" + } + }, + "originCountry": { + "column": { + "name": "OriginCountry" + } + }, + "originLocation": { + "column": { + "name": "OriginLocation" + } + }, + "originRegion": { + "column": { + "name": "OriginRegion" + } + }, + "originWeather": { + "column": { + "name": "OriginWeather" + } + }, + "timestamp": { + "column": { + "name": "timestamp" + } + } + } + } + ] + } + }, + { + "kind": "ScalarType", + "version": "v1", + "definition": { + "name": "Id", + "graphql": { + "typeName": "App_Id" + } + } + }, + { + "kind": "ScalarType", + "version": "v1", + "definition": { + "name": "Text", + "graphql": { + "typeName": "App_Text" + } + } + }, + { + "kind": "ScalarType", + "version": "v1", + "definition": { + "name": "Keyword", + "graphql": { + "typeName": "App_Keyword" + } + } + }, + { + "kind": "ScalarType", + "version": "v1", + "definition": { + "name": "Date", + "graphql": { + "typeName": "App_Date" + } + } + }, + { + "kind": "ScalarType", + "version": "v1", + "definition": { + "name": "Integer", + "graphql": { + "typeName": "App_Integer" + } + } + }, + { + "kind": "ScalarType", + "version": "v1", + "definition": { + "name": "HalfFloat", + "graphql": { + "typeName": "App_HalfFloat" + } + } + }, + { + "kind": "ScalarType", + "version": "v1", + "definition": { + "name": "Float_1", + "graphql": { + "typeName": "App_Float1" + } + } + }, + { + "kind": "ScalarType", + "version": "v1", + "definition": { + "name": "Boolean_1", + "graphql": { + "typeName": "App_Boolean1" + } + } + }, + { + "kind": "TypePermissions", + "version": "v1", + "definition": { + "typeName": "Event", + "permissions": [ + { + "role": "admin", + "output": { + "allowedFields": [] + } + } + ] + } + }, + { + "kind": "TypePermissions", + "version": "v1", + "definition": { + "typeName": "Geoip", + "permissions": [ + { + "role": "admin", + "output": { + "allowedFields": [] + } + } + ] + } + }, + { + "kind": "TypePermissions", + "version": "v1", + "definition": { + "typeName": "Products", + "permissions": [ + { + "role": "admin", + "output": { + "allowedFields": [] + } + } + ] + } + }, + { + "kind": "TypePermissions", + "version": "v1", + "definition": { + "typeName": "KibanaSampleDataEcommerce", + "permissions": [ + { + "role": "admin", + "output": { + "allowedFields": [ + "id", + "category", + "currency", + "customerBirthDate", + "customerFirstName", + "customerFullName", + "customerGender", + "customerId", + "customerLastName", + "customerPhone", + "dayOfWeek", + "dayOfWeekI", + "email", + "event", + "geoip", + "manufacturer", + "orderDate", + "orderId", + "products", + "sku", + "taxfulTotalPrice", + "taxlessTotalPrice", + "totalQuantity", + "totalUniqueProducts", + "type", + "user" + ] + } + } + ] + } + }, + { + "kind": "TypePermissions", + "version": "v1", + "definition": { + "typeName": "GeoPoint", + "permissions": [ + { + "role": "admin", + "output": { + "allowedFields": [] + } + } + ] + } + }, + { + "kind": "TypePermissions", + "version": "v1", + "definition": { + "typeName": "KibanaSampleDataFlights", + "permissions": [ + { + "role": "admin", + "output": { + "allowedFields": [ + "id", + "avgTicketPrice", + "cancelled", + "carrier", + "dest", + "destAirportId", + "destCityName", + "destCountry", + "destLocation", + "destRegion", + "destWeather", + "distanceKilometers", + "distanceMiles", + "flightDelay", + "flightDelayMin", + "flightDelayType", + "flightNum", + "flightTimeHour", + "flightTimeMin", + "origin", + "originAirportId", + "originCityName", + "originCountry", + "originLocation", + "originRegion", + "originWeather", + "dayOfWeek", + "timestamp" + ] + } + } + ] + } + } + ] + } + ] + } \ No newline at end of file diff --git a/resources/prometheus/prometheus.yaml b/resources/prometheus/prometheus.yaml new file mode 100644 index 0000000..df89e8e --- /dev/null +++ b/resources/prometheus/prometheus.yaml @@ -0,0 +1,21 @@ +global: + scrape_interval: 15s + scrape_timeout: 10s + evaluation_interval: 15s +alerting: + alertmanagers: + - static_configs: + - targets: [] + scheme: http + timeout: 10s + api_version: v1 +scrape_configs: + - job_name: ndc-learn + honor_timestamps: true + scrape_interval: 15s + scrape_timeout: 10s + metrics_path: /metrics + scheme: http + static_configs: + - targets: + - connector:8080 \ No newline at end of file