Back to Influxdb

Api Endpoint

layouts/shortcodes/api-endpoint.html

latest682 B
Original Source

{{- $productData := partial "product/get-data.html" . -}} {{- $hostOverride := .Get "influxdb_host" | default "" -}} {{- $placeholderHost := cond (gt (len $hostOverride) 0) $hostOverride ($productData.placeholder_host | default "localhost:8086") -}} {{- $endpoint := .Get "endpoint" -}} {{- $method := .Get "method" | upper -}} {{- $methodStyle := .Get "method" | lower -}} {{- $apiRef := .Get "api-ref" | default "" -}} {{- $renderedEndpoint := $endpoint | replaceRE \{\{[\<%] influxdb/host .*[\>%]\}\} $placeholderHost -}}

{{- if ne $apiRef "" -}}[{{ $method }} {{ $renderedEndpoint }}]({{%20$apiRef%20}}){{- else -}}{{ $method }}{{ $renderedEndpoint }}
  {{- end -}}