From 8125419ffde05465fb4a6955dec877efe44f123b Mon Sep 17 00:00:00 2001 From: Thulasiraj Komminar Date: Mon, 23 Jun 2025 23:38:14 +0200 Subject: [PATCH 1/2] feat: added changelog --- .github/workflows/update-changelog.yml | 31 ++++++++++++++++++++++++++ CHANGELOG.md | 6 +++++ 2 files changed, 37 insertions(+) create mode 100644 .github/workflows/update-changelog.yml create mode 100644 CHANGELOG.md diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml new file mode 100644 index 0000000..d747477 --- /dev/null +++ b/.github/workflows/update-changelog.yml @@ -0,0 +1,31 @@ +name: "update-changelog" + +on: + release: + types: + - published + +permissions: + contents: write + +jobs: + update: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + token: ${{ secrets.BOT_GITHUB_TOKEN }} + + - name: Update Changelog + uses: stefanzweifel/changelog-updater-action@v1 + with: + latest-version: ${{ github.event.release.tag_name }} + release-notes: ${{ github.event.release.body }} + + - name: Commit updated Changelog + uses: stefanzweifel/git-auto-commit-action@v5 + with: + branch: ${{ github.event.repository.default_branch }} + commit_message: "docs(changelog): update changelog" + file_pattern: CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..2551e7d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +All notable changes to this project will automatically be documented in this file. + +The format is based on vKeep a Changelog(https://keepachangelog.com/en/1.0.0/), +and this project adheres to vSemantic Versioning(https://semver.org/spec/v2.0.0.html). From ee2c9120593492a4620a63b74ba001350e08de1b Mon Sep 17 00:00:00 2001 From: Thulasiraj Komminar Date: Mon, 23 Jun 2025 23:41:46 +0200 Subject: [PATCH 2/2] feat: restructure for multi-variant support with automated OpenAPI sync MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Restructure InfluxDB v3 Go client to support Cloud, Core, and Enterprise variants BREAKING CHANGE: Module renamed and restructured into variant-specific packages ### Major Changes: - **Module Rename**: `github.com/komminarlabs/influxdb3` โ†’ `github.com/komminarlabs/influxdb3-management-go` - **Multi-Variant Architecture**: Separate packages for Cloud Dedicated, Core, and Enterprise - **Automated OpenAPI Sync**: Daily GitHub Actions workflow to sync specs and open PRs ### New Structure: - `cloud/` - InfluxDB Cloud Dedicated Management API client - `core/` - InfluxDB Core API client - `enterprise/` - InfluxDB Enterprise API client with processing engine support - `specs/` - OpenAPI specifications for all variants - `examples/` - Working examples for each variant ### Features Added: - โœจ Generated Go clients for all three InfluxDB v3 variants - ๐Ÿค– Automated monthly sync of OpenAPI specs from upstream sources - ๐Ÿ“š Comprehensive examples and documentation for each variant - ๐Ÿ”„ GitHub Actions workflow for spec updates and PR automation - ๐Ÿ“– Migration guide for users upgrading from v0.x ### Breaking Changes: - Import paths changed from `github.com/komminarlabs/influxdb3` to variant-specific: - `github.com/komminarlabs/influxdb3-management-go/cloud` - `github.com/komminarlabs/influxdb3-management-go/core` - `github.com/komminarlabs/influxdb3-management-go/enterprise` - API methods may differ between variants based on their OpenAPI specs --- .github/workflows/sync-openapi-specs.yml | 112 + README.md | 104 +- UPGRADING.md | 30 + client.gen.go => cloud/client.gen.go | 40 +- cloud/cloud.go | 12 + types.gen.go => cloud/types.gen.go | 22 +- core/client.gen.go | 4969 +++++++++++++++++++++ core/core.go | 11 + core/types.gen.go | 842 ++++ enterprise/client.gen.go | 5079 ++++++++++++++++++++++ enterprise/enterprise.go | 11 + enterprise/types.gen.go | 872 ++++ examples/cloud/main.go | 76 + examples/core/main.go | 107 + examples/enterprise/main.go | 131 + examples/go.mod | 11 +- examples/go.sum | 18 - examples/main.go | 58 - generate.go | 13 +- go.mod | 2 +- openapi.yml => specs/cloud/openapi.yml | 50 +- specs/core/ref.yml | 2075 +++++++++ specs/enterprise/ref.yml | 2136 +++++++++ 23 files changed, 16591 insertions(+), 190 deletions(-) create mode 100644 .github/workflows/sync-openapi-specs.yml create mode 100644 UPGRADING.md rename client.gen.go => cloud/client.gen.go (98%) create mode 100644 cloud/cloud.go rename types.gen.go => cloud/types.gen.go (97%) create mode 100644 core/client.gen.go create mode 100644 core/core.go create mode 100644 core/types.gen.go create mode 100644 enterprise/client.gen.go create mode 100644 enterprise/enterprise.go create mode 100644 enterprise/types.gen.go create mode 100644 examples/cloud/main.go create mode 100644 examples/core/main.go create mode 100644 examples/enterprise/main.go delete mode 100644 examples/main.go rename openapi.yml => specs/cloud/openapi.yml (96%) create mode 100644 specs/core/ref.yml create mode 100644 specs/enterprise/ref.yml diff --git a/.github/workflows/sync-openapi-specs.yml b/.github/workflows/sync-openapi-specs.yml new file mode 100644 index 0000000..7309d9c --- /dev/null +++ b/.github/workflows/sync-openapi-specs.yml @@ -0,0 +1,112 @@ +name: Sync OpenAPI Specs + +on: + schedule: + # Run monthly on the 1st day at 6:00 AM UTC + - cron: "0 6 1 * *" + workflow_dispatch: # Allow manual trigger + +jobs: + sync-specs: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: "1.22.5" + + - name: Download latest OpenAPI specs + run: | + # Create temporary directory for new specs + mkdir -p temp_specs/cloud temp_specs/core temp_specs/enterprise + + # Download Cloud Dedicated spec + curl -f -o temp_specs/cloud/openapi.yml \ + https://raw.githubusercontent.com/influxdata/docs-v2/master/api-docs/influxdb3/cloud-dedicated/management/openapi.yml + + # Download Core spec + curl -f -o temp_specs/core/ref.yml \ + https://raw.githubusercontent.com/influxdata/docs-v2/master/api-docs/influxdb3/core/v3/ref.yml + + # Download Enterprise spec + curl -f -o temp_specs/enterprise/ref.yml \ + https://raw.githubusercontent.com/influxdata/docs-v2/master/api-docs/influxdb3/enterprise/v3/ref.yml + + - name: Check for changes + id: check-changes + run: | + changes_detected=false + + # Check Cloud spec + if ! cmp -s temp_specs/cloud/openapi.yml specs/cloud/openapi.yml; then + echo "Changes detected in Cloud spec" + changes_detected=true + fi + + # Check Core spec + if ! cmp -s temp_specs/core/ref.yml specs/core/ref.yml; then + echo "Changes detected in Core spec" + changes_detected=true + fi + + # Check Enterprise spec + if ! cmp -s temp_specs/enterprise/ref.yml specs/enterprise/ref.yml; then + echo "Changes detected in Enterprise spec" + changes_detected=true + fi + + echo "changes_detected=$changes_detected" >> $GITHUB_OUTPUT + + - name: Update specs and regenerate code + if: steps.check-changes.outputs.changes_detected == 'true' + run: | + # Copy new specs + cp temp_specs/cloud/openapi.yml specs/cloud/openapi.yml + cp temp_specs/core/ref.yml specs/core/ref.yml + cp temp_specs/enterprise/ref.yml specs/enterprise/ref.yml + + # Regenerate Go code + go generate ./... + + - name: Create Pull Request + if: steps.check-changes.outputs.changes_detected == 'true' + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: "feat: update OpenAPI specs and regenerate client code" + title: "chore: sync OpenAPI specs from upstream" + body: | + ## ๐Ÿ”„ Automated OpenAPI Spec Sync + + This PR was automatically generated to sync the OpenAPI specifications with the latest versions from the InfluxData documentation repository. + + ### Changes + - ๐ŸŒค๏ธ **InfluxDB Cloud Dedicated**: Updated management API spec + - ๐Ÿ—๏ธ **InfluxDB Core**: Updated v3 API spec + - ๐Ÿข **InfluxDB Enterprise**: Updated v3 API spec + + ### What's Updated + - OpenAPI specification files in `specs/` directory + - Generated Go client code in `cloud/`, `core/`, and `enterprise/` packages + + ### Verification + - [ ] Specs downloaded successfully + - [ ] Go code generation completed without errors + - [ ] All tests pass (if applicable) + + --- + ๐Ÿค– This is an automated PR created by the sync workflow. + branch: automated/sync-openapi-specs + delete-branch: true + + - name: Cleanup + run: rm -rf temp_specs diff --git a/README.md b/README.md index d1faf8d..534819b 100644 --- a/README.md +++ b/README.md @@ -1,82 +1,46 @@ -# InfluxDB v3 Cloud Dedicated Management API Go Client Library +# InfluxDB v3 Management Go Client Library -The InfluxDB v3 Management API Go client library lets you manage an InfluxDB Cloud Dedicated instance and integrate functions such as creating and managing databases, permissions, and tokens into your workflow or application. +A Go client library for InfluxDB v3 products, supporting Cloud Dedicated, Core, and Enterprise deployments. -## Generated types and API client +## Supported products -This library is generated using [oapi-codegen](https://github.com/oapi-codegen/oapi-codegen) from this [OpenAPI spec](https://github.com/influxdata/docs-v2/blob/master/api-docs/influxdb3/cloud-dedicated/management/openapi.yml) +### InfluxDB 3 Cloud Dedicated -### Generate +Management API for InfluxDB Cloud Dedicated clusters, databases, and tokens. -```go -go generate ./... -``` +**Import**: `import "github.com/komminarlabs/influxdb3-management-go/cloud"` + +### InfluxDB 3 Core + +Core API for writing data, querying with SQL/InfluxQL, and managing local instances. + +**Import**: `import "github.com/komminarlabs/influxdb3-management-go/core"` + +### InfluxDB 3 Enterprise + +Enterprise API with advanced features including processing engine and fine-grained permissions. -## Usage +**Import**: `import "github.com/komminarlabs/influxdb3-management-go/enterprise"` -### Environment variables +## ๐Ÿš€ Installation + +Install the product(s) you need: ```bash -export INFLUXDB_BASE_URL="https://console.influxdata.com/api/v0" -export INFLUXDB_ACCOUNT_ID="4ade9b2e-0a52-4a46-b3b8-1b43ea493a98" -export INFLUXDB_CLUSTER_ID="a379c48a-791e-47fe-ba64-628ba19507e8" -export INFLUXDB_TOKEN="1e0f14063eb14a9e94fe765bf999a90cb7962f8e0f394110b91053ea26cdce5071d6bca29e4d4684bed463cf2ea9f381" +# Cloud Dedicated +go get github.com/komminarlabs/influxdb3-management-go/cloud + +# Core +go get github.com/komminarlabs/influxdb3-management-go/core + +# Enterprise +go get github.com/komminarlabs/influxdb3-management-go/enterprise ``` -### Sample code to list database tokens - -```go -package main - -import ( - "context" - "io" - "net/http" - - "github.com/caarlos0/env/v11" - "github.com/komminarlabs/influxdb3" -) - -type InfluxdbConfig struct { - AccountId influxdb3.UuidV4 `env:"INFLUXDB_ACCOUNT_ID"` - BaseURL string `env:"INFLUXDB_BASE_URL"` - ClusterId influxdb3.UuidV4 `env:"INFLUXDB_CLUSTER_ID"` - Token string `env:"INFLUXDB_TOKEN"` -} - -func main() { - cfg := InfluxdbConfig{} - opts := env.Options{RequiredIfNoDef: true} - - err := env.ParseWithOptions(&cfg, opts) - if err != nil { - panic(err) - } - - ctx := context.Background() - client, err := influxdb3.NewClient(cfg.BaseURL, influxdb3.WithRequestEditorFn(func(ctx context.Context, req *http.Request) error { - req.Header.Set("Accept", "application/json") - req.Header.Set("Authorization", "Bearer "+cfg.Token) - return nil - - })) - if err != nil { - panic(err) - } - - resp, err := client.GetDatabaseTokens(ctx, cfg.AccountId, cfg.ClusterId) - if err != nil { - panic(err) - } - defer resp.Body.Close() - - if resp.StatusCode == http.StatusOK { - bodyBytes, err := io.ReadAll(resp.Body) - if err != nil { - panic(err) - } - bodyString := string(bodyBytes) - println(bodyString) - } -} +## ๐Ÿ”ง Development + +### Generate Go Code from OpenAPI Specs + +```bash +go generate ./... ``` diff --git a/UPGRADING.md b/UPGRADING.md new file mode 100644 index 0000000..1849707 --- /dev/null +++ b/UPGRADING.md @@ -0,0 +1,30 @@ +# Upgrading Notes + +This document captures required refactoring on your part when upgrading to a module version that contains breaking changes. + +## Upgrading to v1.0.0 + +### Key Changes + +#### Before (Old Structure) + +```go +import "github.com/komminarlabs/influxdb3" + +// Single client for Cloud Dedicated only +client, err := influxdb3.NewClient(baseURL) +``` + +### After (New Structure) + +```go +// Choose your InfluxDB variant +import "github.com/komminarlabs/influxdb3-management-go/cloud" // Cloud Dedicated +import "github.com/komminarlabs/influxdb3-management-go/core" // Core +import "github.com/komminarlabs/influxdb3-management-go/enterprise" // Enterprise + +// Create variant-specific clients +cloudClient, err := cloud.NewClient(baseURL) +coreClient, err := core.NewClient(baseURL) +enterpriseClient, err := enterprise.NewClient(baseURL) +``` diff --git a/client.gen.go b/cloud/client.gen.go similarity index 98% rename from client.gen.go rename to cloud/client.gen.go index 664aa4b..e3fd838 100644 --- a/client.gen.go +++ b/cloud/client.gen.go @@ -1,7 +1,7 @@ -// Package influxdb3 provides primitives to interact with the openapi HTTP API. +// Package cloud provides primitives to interact with the openapi HTTP API. // // Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT. -package influxdb3 +package cloud import ( "bytes" @@ -929,9 +929,9 @@ type GetClusterDatabasesResponse struct { // PartitionTemplate A template for [partitioning](/influxdb3/cloud-dedicated/admin/custom-partitions/) a cluster database. // - // Each template part is evaluated in sequence, concatinating the final - // partition key from the output of each part, delimited by the partition - // key delimiter `|`. + // Each partition template part is evaluated in sequence. + // The outputs from each part are concatenated with the + // `|` delimiter to form the final partition key. // // For example, using the partition template below: // @@ -1024,9 +1024,9 @@ type CreateClusterDatabaseResponse struct { // PartitionTemplate A template for [partitioning](/influxdb3/cloud-dedicated/admin/custom-partitions/) a cluster database. // - // Each template part is evaluated in sequence, concatinating the final - // partition key from the output of each part, delimited by the partition - // key delimiter `|`. + // Each partition template part is evaluated in sequence. + // The outputs from each part are concatenated with the + // `|` delimiter to form the final partition key. // // For example, using the partition template below: // @@ -1187,9 +1187,9 @@ type CreateClusterDatabaseTableResponse struct { // PartitionTemplate A template for [partitioning](/influxdb3/cloud-dedicated/admin/custom-partitions/) a cluster database. // - // Each template part is evaluated in sequence, concatinating the final - // partition key from the output of each part, delimited by the partition - // key delimiter `|`. + // Each partition template part is evaluated in sequence. + // The outputs from each part are concatenated with the + // `|` delimiter to form the final partition key. // // For example, using the partition template below: // @@ -1604,9 +1604,9 @@ func ParseGetClusterDatabasesResponse(rsp *http.Response) (*GetClusterDatabasesR // PartitionTemplate A template for [partitioning](/influxdb3/cloud-dedicated/admin/custom-partitions/) a cluster database. // - // Each template part is evaluated in sequence, concatinating the final - // partition key from the output of each part, delimited by the partition - // key delimiter `|`. + // Each partition template part is evaluated in sequence. + // The outputs from each part are concatenated with the + // `|` delimiter to form the final partition key. // // For example, using the partition template below: // @@ -1733,9 +1733,9 @@ func ParseCreateClusterDatabaseResponse(rsp *http.Response) (*CreateClusterDatab // PartitionTemplate A template for [partitioning](/influxdb3/cloud-dedicated/admin/custom-partitions/) a cluster database. // - // Each template part is evaluated in sequence, concatinating the final - // partition key from the output of each part, delimited by the partition - // key delimiter `|`. + // Each partition template part is evaluated in sequence. + // The outputs from each part are concatenated with the + // `|` delimiter to form the final partition key. // // For example, using the partition template below: // @@ -1998,9 +1998,9 @@ func ParseCreateClusterDatabaseTableResponse(rsp *http.Response) (*CreateCluster // PartitionTemplate A template for [partitioning](/influxdb3/cloud-dedicated/admin/custom-partitions/) a cluster database. // - // Each template part is evaluated in sequence, concatinating the final - // partition key from the output of each part, delimited by the partition - // key delimiter `|`. + // Each partition template part is evaluated in sequence. + // The outputs from each part are concatenated with the + // `|` delimiter to form the final partition key. // // For example, using the partition template below: // diff --git a/cloud/cloud.go b/cloud/cloud.go new file mode 100644 index 0000000..c58face --- /dev/null +++ b/cloud/cloud.go @@ -0,0 +1,12 @@ +// Package cloud provides a Go client for the InfluxDB 3 Cloud Dedicated Management API. +// +// This package contains generated types and client methods for interacting with +// InfluxDB 3 Cloud Dedicated clusters, databases, and tokens. +// +// The InfluxDB v3 Management API Go client library lets you manage an InfluxDB Cloud Dedicated +// instance and integrate functions such as creating and managing databases, permissions, +// and tokens into your workflow or application. +package cloud + +//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -generate types -o types.gen.go -package cloud ../specs/cloud/openapi.yml +//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -generate client -o client.gen.go -package cloud ../specs/cloud/openapi.yml diff --git a/types.gen.go b/cloud/types.gen.go similarity index 97% rename from types.gen.go rename to cloud/types.gen.go index d342329..91f4165 100644 --- a/types.gen.go +++ b/cloud/types.gen.go @@ -1,7 +1,7 @@ -// Package influxdb3 provides primitives to interact with the openapi HTTP API. +// Package cloud provides primitives to interact with the openapi HTTP API. // // Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT. -package influxdb3 +package cloud import ( "encoding/json" @@ -47,9 +47,9 @@ type ClusterDatabaseName = string // ClusterDatabasePartitionTemplate A template for [partitioning](/influxdb3/cloud-dedicated/admin/custom-partitions/) a cluster database. // -// Each template part is evaluated in sequence, concatinating the final -// partition key from the output of each part, delimited by the partition -// key delimiter `|`. +// Each partition template part is evaluated in sequence. +// The outputs from each part are concatenated with the +// `|` delimiter to form the final partition key. // // For example, using the partition template below: // @@ -225,9 +225,9 @@ type CreateClusterDatabaseJSONBody struct { // PartitionTemplate A template for [partitioning](/influxdb3/cloud-dedicated/admin/custom-partitions/) a cluster database. // - // Each template part is evaluated in sequence, concatinating the final - // partition key from the output of each part, delimited by the partition - // key delimiter `|`. + // Each partition template part is evaluated in sequence. + // The outputs from each part are concatenated with the + // `|` delimiter to form the final partition key. // // For example, using the partition template below: // @@ -301,9 +301,9 @@ type CreateClusterDatabaseTableJSONBody struct { // PartitionTemplate A template for [partitioning](/influxdb3/cloud-dedicated/admin/custom-partitions/) a cluster database. // - // Each template part is evaluated in sequence, concatinating the final - // partition key from the output of each part, delimited by the partition - // key delimiter `|`. + // Each partition template part is evaluated in sequence. + // The outputs from each part are concatenated with the + // `|` delimiter to form the final partition key. // // For example, using the partition template below: // diff --git a/core/client.gen.go b/core/client.gen.go new file mode 100644 index 0000000..b4af8cc --- /dev/null +++ b/core/client.gen.go @@ -0,0 +1,4969 @@ +// Package core provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT. +package core + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "strings" + + "github.com/oapi-codegen/runtime" +) + +// RequestEditorFn is the function signature for the RequestEditor callback function +type RequestEditorFn func(ctx context.Context, req *http.Request) error + +// Doer performs HTTP requests. +// +// The standard http.Client implements this interface. +type HttpRequestDoer interface { + Do(req *http.Request) (*http.Response, error) +} + +// Client which conforms to the OpenAPI3 specification for this service. +type Client struct { + // The endpoint of the server conforming to this interface, with scheme, + // https://api.deepmap.com for example. This can contain a path relative + // to the server, such as https://api.deepmap.com/dev-test, and all the + // paths in the swagger spec will be appended to the server. + Server string + + // Doer for performing requests, typically a *http.Client with any + // customized settings, such as certificate chains. + Client HttpRequestDoer + + // A list of callbacks for modifying requests which are generated before sending over + // the network. + RequestEditors []RequestEditorFn +} + +// ClientOption allows setting custom parameters during construction +type ClientOption func(*Client) error + +// Creates a new Client, with reasonable defaults +func NewClient(server string, opts ...ClientOption) (*Client, error) { + // create a client with sane default values + client := Client{ + Server: server, + } + // mutate client and add all optional params + for _, o := range opts { + if err := o(&client); err != nil { + return nil, err + } + } + // ensure the server URL always has a trailing slash + if !strings.HasSuffix(client.Server, "/") { + client.Server += "/" + } + // create httpClient, if not already present + if client.Client == nil { + client.Client = &http.Client{} + } + return &client, nil +} + +// WithHTTPClient allows overriding the default Doer, which is +// automatically created using http.Client. This is useful for tests. +func WithHTTPClient(doer HttpRequestDoer) ClientOption { + return func(c *Client) error { + c.Client = doer + return nil + } +} + +// WithRequestEditorFn allows setting up a callback function, which will be +// called right before sending the request. This can be used to mutate the request. +func WithRequestEditorFn(fn RequestEditorFn) ClientOption { + return func(c *Client) error { + c.RequestEditors = append(c.RequestEditors, fn) + return nil + } +} + +// The interface specification for the client above. +type ClientInterface interface { + // GetHealthV1 request + GetHealthV1(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV2WriteWithBody request with any body + PostV2WriteWithBody(ctx context.Context, params *PostV2WriteParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostV2WriteWithTextBody(ctx context.Context, params *PostV2WriteParams, body PostV2WriteTextRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteConfigureDatabase request + DeleteConfigureDatabase(ctx context.Context, params *DeleteConfigureDatabaseParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetConfigureDatabase request + GetConfigureDatabase(ctx context.Context, params *GetConfigureDatabaseParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostConfigureDatabaseWithBody request with any body + PostConfigureDatabaseWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostConfigureDatabase(ctx context.Context, body PostConfigureDatabaseJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostConfigureDistinctCacheWithBody request with any body + PostConfigureDistinctCacheWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostConfigureDistinctCache(ctx context.Context, body PostConfigureDistinctCacheJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteConfigureLastCache request + DeleteConfigureLastCache(ctx context.Context, params *DeleteConfigureLastCacheParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostConfigureLastCacheWithBody request with any body + PostConfigureLastCacheWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostConfigureLastCache(ctx context.Context, body PostConfigureLastCacheJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostInstallPluginPackagesWithBody request with any body + PostInstallPluginPackagesWithBody(ctx context.Context, params *PostInstallPluginPackagesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostInstallPluginPackages(ctx context.Context, params *PostInstallPluginPackagesParams, body PostInstallPluginPackagesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostInstallPluginRequirementsWithBody request with any body + PostInstallPluginRequirementsWithBody(ctx context.Context, params *PostInstallPluginRequirementsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostInstallPluginRequirements(ctx context.Context, params *PostInstallPluginRequirementsParams, body PostInstallPluginRequirementsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteConfigureProcessingEngineTrigger request + DeleteConfigureProcessingEngineTrigger(ctx context.Context, params *DeleteConfigureProcessingEngineTriggerParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostConfigureProcessingEngineTriggerWithBody request with any body + PostConfigureProcessingEngineTriggerWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostConfigureProcessingEngineTrigger(ctx context.Context, body PostConfigureProcessingEngineTriggerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostDisableProcessingEngineTriggerWithBody request with any body + PostDisableProcessingEngineTriggerWithBody(ctx context.Context, params *PostDisableProcessingEngineTriggerParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostDisableProcessingEngineTrigger(ctx context.Context, params *PostDisableProcessingEngineTriggerParams, body PostDisableProcessingEngineTriggerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostEnableProcessingEngineTriggerWithBody request with any body + PostEnableProcessingEngineTriggerWithBody(ctx context.Context, params *PostEnableProcessingEngineTriggerParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostEnableProcessingEngineTrigger(ctx context.Context, params *PostEnableProcessingEngineTriggerParams, body PostEnableProcessingEngineTriggerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteConfigureTable request + DeleteConfigureTable(ctx context.Context, params *DeleteConfigureTableParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostConfigureTableWithBody request with any body + PostConfigureTableWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostConfigureTable(ctx context.Context, body PostConfigureTableJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostCreateAdminToken request + PostCreateAdminToken(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostRegenerateAdminToken request + PostRegenerateAdminToken(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetProcessingEnginePluginRequest request + GetProcessingEnginePluginRequest(ctx context.Context, pluginPath string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostProcessingEnginePluginRequestWithBody request with any body + PostProcessingEnginePluginRequestWithBody(ctx context.Context, pluginPath string, params *PostProcessingEnginePluginRequestParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostProcessingEnginePluginRequest(ctx context.Context, pluginPath string, params *PostProcessingEnginePluginRequestParams, body PostProcessingEnginePluginRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostTestSchedulingPlugin request + PostTestSchedulingPlugin(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostTestWALPlugin request + PostTestWALPlugin(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetExecuteInfluxQLQuery request + GetExecuteInfluxQLQuery(ctx context.Context, params *GetExecuteInfluxQLQueryParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostExecuteQueryInfluxQLWithBody request with any body + PostExecuteQueryInfluxQLWithBody(ctx context.Context, params *PostExecuteQueryInfluxQLParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostExecuteQueryInfluxQL(ctx context.Context, params *PostExecuteQueryInfluxQLParams, body PostExecuteQueryInfluxQLJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetExecuteQuerySQL request + GetExecuteQuerySQL(ctx context.Context, params *GetExecuteQuerySQLParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostExecuteQuerySQLWithBody request with any body + PostExecuteQuerySQLWithBody(ctx context.Context, params *PostExecuteQuerySQLParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostExecuteQuerySQL(ctx context.Context, params *PostExecuteQuerySQLParams, body PostExecuteQuerySQLJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostWriteLPWithBody request with any body + PostWriteLPWithBody(ctx context.Context, params *PostWriteLPParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostWriteLPWithTextBody(ctx context.Context, params *PostWriteLPParams, body PostWriteLPTextRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetHealth request + GetHealth(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetMetrics request + GetMetrics(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetPing request + GetPing(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV1ExecuteQuery request + GetV1ExecuteQuery(ctx context.Context, params *GetV1ExecuteQueryParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostExecuteV1QueryWithBody request with any body + PostExecuteV1QueryWithBody(ctx context.Context, params *PostExecuteV1QueryParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostExecuteV1Query(ctx context.Context, params *PostExecuteV1QueryParams, body PostExecuteV1QueryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV1WriteWithBody request with any body + PostV1WriteWithBody(ctx context.Context, params *PostV1WriteParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostV1WriteWithTextBody(ctx context.Context, params *PostV1WriteParams, body PostV1WriteTextRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +} + +func (c *Client) GetHealthV1(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetHealthV1Request(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostV2WriteWithBody(ctx context.Context, params *PostV2WriteParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV2WriteRequestWithBody(c.Server, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostV2WriteWithTextBody(ctx context.Context, params *PostV2WriteParams, body PostV2WriteTextRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV2WriteRequestWithTextBody(c.Server, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteConfigureDatabase(ctx context.Context, params *DeleteConfigureDatabaseParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteConfigureDatabaseRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetConfigureDatabase(ctx context.Context, params *GetConfigureDatabaseParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetConfigureDatabaseRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostConfigureDatabaseWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostConfigureDatabaseRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostConfigureDatabase(ctx context.Context, body PostConfigureDatabaseJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostConfigureDatabaseRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostConfigureDistinctCacheWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostConfigureDistinctCacheRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostConfigureDistinctCache(ctx context.Context, body PostConfigureDistinctCacheJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostConfigureDistinctCacheRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteConfigureLastCache(ctx context.Context, params *DeleteConfigureLastCacheParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteConfigureLastCacheRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostConfigureLastCacheWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostConfigureLastCacheRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostConfigureLastCache(ctx context.Context, body PostConfigureLastCacheJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostConfigureLastCacheRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostInstallPluginPackagesWithBody(ctx context.Context, params *PostInstallPluginPackagesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostInstallPluginPackagesRequestWithBody(c.Server, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostInstallPluginPackages(ctx context.Context, params *PostInstallPluginPackagesParams, body PostInstallPluginPackagesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostInstallPluginPackagesRequest(c.Server, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostInstallPluginRequirementsWithBody(ctx context.Context, params *PostInstallPluginRequirementsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostInstallPluginRequirementsRequestWithBody(c.Server, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostInstallPluginRequirements(ctx context.Context, params *PostInstallPluginRequirementsParams, body PostInstallPluginRequirementsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostInstallPluginRequirementsRequest(c.Server, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteConfigureProcessingEngineTrigger(ctx context.Context, params *DeleteConfigureProcessingEngineTriggerParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteConfigureProcessingEngineTriggerRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostConfigureProcessingEngineTriggerWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostConfigureProcessingEngineTriggerRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostConfigureProcessingEngineTrigger(ctx context.Context, body PostConfigureProcessingEngineTriggerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostConfigureProcessingEngineTriggerRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostDisableProcessingEngineTriggerWithBody(ctx context.Context, params *PostDisableProcessingEngineTriggerParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostDisableProcessingEngineTriggerRequestWithBody(c.Server, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostDisableProcessingEngineTrigger(ctx context.Context, params *PostDisableProcessingEngineTriggerParams, body PostDisableProcessingEngineTriggerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostDisableProcessingEngineTriggerRequest(c.Server, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostEnableProcessingEngineTriggerWithBody(ctx context.Context, params *PostEnableProcessingEngineTriggerParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostEnableProcessingEngineTriggerRequestWithBody(c.Server, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostEnableProcessingEngineTrigger(ctx context.Context, params *PostEnableProcessingEngineTriggerParams, body PostEnableProcessingEngineTriggerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostEnableProcessingEngineTriggerRequest(c.Server, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteConfigureTable(ctx context.Context, params *DeleteConfigureTableParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteConfigureTableRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostConfigureTableWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostConfigureTableRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostConfigureTable(ctx context.Context, body PostConfigureTableJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostConfigureTableRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostCreateAdminToken(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostCreateAdminTokenRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostRegenerateAdminToken(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostRegenerateAdminTokenRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetProcessingEnginePluginRequest(ctx context.Context, pluginPath string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetProcessingEnginePluginRequestRequest(c.Server, pluginPath) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostProcessingEnginePluginRequestWithBody(ctx context.Context, pluginPath string, params *PostProcessingEnginePluginRequestParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostProcessingEnginePluginRequestRequestWithBody(c.Server, pluginPath, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostProcessingEnginePluginRequest(ctx context.Context, pluginPath string, params *PostProcessingEnginePluginRequestParams, body PostProcessingEnginePluginRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostProcessingEnginePluginRequestRequest(c.Server, pluginPath, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostTestSchedulingPlugin(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostTestSchedulingPluginRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostTestWALPlugin(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostTestWALPluginRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetExecuteInfluxQLQuery(ctx context.Context, params *GetExecuteInfluxQLQueryParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetExecuteInfluxQLQueryRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostExecuteQueryInfluxQLWithBody(ctx context.Context, params *PostExecuteQueryInfluxQLParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostExecuteQueryInfluxQLRequestWithBody(c.Server, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostExecuteQueryInfluxQL(ctx context.Context, params *PostExecuteQueryInfluxQLParams, body PostExecuteQueryInfluxQLJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostExecuteQueryInfluxQLRequest(c.Server, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetExecuteQuerySQL(ctx context.Context, params *GetExecuteQuerySQLParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetExecuteQuerySQLRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostExecuteQuerySQLWithBody(ctx context.Context, params *PostExecuteQuerySQLParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostExecuteQuerySQLRequestWithBody(c.Server, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostExecuteQuerySQL(ctx context.Context, params *PostExecuteQuerySQLParams, body PostExecuteQuerySQLJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostExecuteQuerySQLRequest(c.Server, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostWriteLPWithBody(ctx context.Context, params *PostWriteLPParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostWriteLPRequestWithBody(c.Server, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostWriteLPWithTextBody(ctx context.Context, params *PostWriteLPParams, body PostWriteLPTextRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostWriteLPRequestWithTextBody(c.Server, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetHealth(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetHealthRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetMetrics(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetMetricsRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetPing(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetPingRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetV1ExecuteQuery(ctx context.Context, params *GetV1ExecuteQueryParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV1ExecuteQueryRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostExecuteV1QueryWithBody(ctx context.Context, params *PostExecuteV1QueryParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostExecuteV1QueryRequestWithBody(c.Server, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostExecuteV1Query(ctx context.Context, params *PostExecuteV1QueryParams, body PostExecuteV1QueryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostExecuteV1QueryRequest(c.Server, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostV1WriteWithBody(ctx context.Context, params *PostV1WriteParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV1WriteRequestWithBody(c.Server, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostV1WriteWithTextBody(ctx context.Context, params *PostV1WriteParams, body PostV1WriteTextRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV1WriteRequestWithTextBody(c.Server, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// NewGetHealthV1Request generates requests for GetHealthV1 +func NewGetHealthV1Request(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v1/health") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostV2WriteRequestWithTextBody calls the generic PostV2Write builder with text/plain body +func NewPostV2WriteRequestWithTextBody(server string, params *PostV2WriteParams, body PostV2WriteTextRequestBody) (*http.Request, error) { + var bodyReader io.Reader + bodyReader = strings.NewReader(string(body)) + return NewPostV2WriteRequestWithBody(server, params, "text/plain", bodyReader) +} + +// NewPostV2WriteRequestWithBody generates requests for PostV2Write with any type of body +func NewPostV2WriteRequestWithBody(server string, params *PostV2WriteParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v2/write") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "db", runtime.ParamLocationQuery, params.Db); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if params.AcceptPartial != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "accept_partial", runtime.ParamLocationQuery, *params.AcceptPartial); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "precision", runtime.ParamLocationQuery, params.Precision); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.ContentType != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Content-Type", runtime.ParamLocationHeader, *params.ContentType) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Type", headerParam0) + } + + if params.ContentEncoding != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Content-Encoding", runtime.ParamLocationHeader, *params.ContentEncoding) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Encoding", headerParam1) + } + + if params.ContentLength != nil { + var headerParam2 string + + headerParam2, err = runtime.StyleParamWithLocation("simple", false, "Content-Length", runtime.ParamLocationHeader, *params.ContentLength) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Length", headerParam2) + } + + if params.Accept != nil { + var headerParam3 string + + headerParam3, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam3) + } + + } + + return req, nil +} + +// NewDeleteConfigureDatabaseRequest generates requests for DeleteConfigureDatabase +func NewDeleteConfigureDatabaseRequest(server string, params *DeleteConfigureDatabaseParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/database") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "db", runtime.ParamLocationQuery, params.Db); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetConfigureDatabaseRequest generates requests for GetConfigureDatabase +func NewGetConfigureDatabaseRequest(server string, params *GetConfigureDatabaseParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/database") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "format", runtime.ParamLocationQuery, params.Format); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostConfigureDatabaseRequest calls the generic PostConfigureDatabase builder with application/json body +func NewPostConfigureDatabaseRequest(server string, body PostConfigureDatabaseJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostConfigureDatabaseRequestWithBody(server, "application/json", bodyReader) +} + +// NewPostConfigureDatabaseRequestWithBody generates requests for PostConfigureDatabase with any type of body +func NewPostConfigureDatabaseRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/database") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewPostConfigureDistinctCacheRequest calls the generic PostConfigureDistinctCache builder with application/json body +func NewPostConfigureDistinctCacheRequest(server string, body PostConfigureDistinctCacheJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostConfigureDistinctCacheRequestWithBody(server, "application/json", bodyReader) +} + +// NewPostConfigureDistinctCacheRequestWithBody generates requests for PostConfigureDistinctCache with any type of body +func NewPostConfigureDistinctCacheRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/distinct_cache") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteConfigureLastCacheRequest generates requests for DeleteConfigureLastCache +func NewDeleteConfigureLastCacheRequest(server string, params *DeleteConfigureLastCacheParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/last_cache") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "db", runtime.ParamLocationQuery, params.Db); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "table", runtime.ParamLocationQuery, params.Table); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "name", runtime.ParamLocationQuery, params.Name); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostConfigureLastCacheRequest calls the generic PostConfigureLastCache builder with application/json body +func NewPostConfigureLastCacheRequest(server string, body PostConfigureLastCacheJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostConfigureLastCacheRequestWithBody(server, "application/json", bodyReader) +} + +// NewPostConfigureLastCacheRequestWithBody generates requests for PostConfigureLastCache with any type of body +func NewPostConfigureLastCacheRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/last_cache") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewPostInstallPluginPackagesRequest calls the generic PostInstallPluginPackages builder with application/json body +func NewPostInstallPluginPackagesRequest(server string, params *PostInstallPluginPackagesParams, body PostInstallPluginPackagesJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostInstallPluginPackagesRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostInstallPluginPackagesRequestWithBody generates requests for PostInstallPluginPackages with any type of body +func NewPostInstallPluginPackagesRequestWithBody(server string, params *PostInstallPluginPackagesParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/plugin_environment/install_packages") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.ContentType != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Content-Type", runtime.ParamLocationHeader, *params.ContentType) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Type", headerParam0) + } + + } + + return req, nil +} + +// NewPostInstallPluginRequirementsRequest calls the generic PostInstallPluginRequirements builder with application/json body +func NewPostInstallPluginRequirementsRequest(server string, params *PostInstallPluginRequirementsParams, body PostInstallPluginRequirementsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostInstallPluginRequirementsRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostInstallPluginRequirementsRequestWithBody generates requests for PostInstallPluginRequirements with any type of body +func NewPostInstallPluginRequirementsRequestWithBody(server string, params *PostInstallPluginRequirementsParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/plugin_environment/install_requirements") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.ContentType != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Content-Type", runtime.ParamLocationHeader, *params.ContentType) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Type", headerParam0) + } + + } + + return req, nil +} + +// NewDeleteConfigureProcessingEngineTriggerRequest generates requests for DeleteConfigureProcessingEngineTrigger +func NewDeleteConfigureProcessingEngineTriggerRequest(server string, params *DeleteConfigureProcessingEngineTriggerParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/processing_engine_trigger") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "db", runtime.ParamLocationQuery, params.Db); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "trigger_name", runtime.ParamLocationQuery, params.TriggerName); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if params.Force != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "force", runtime.ParamLocationQuery, *params.Force); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostConfigureProcessingEngineTriggerRequest calls the generic PostConfigureProcessingEngineTrigger builder with application/json body +func NewPostConfigureProcessingEngineTriggerRequest(server string, body PostConfigureProcessingEngineTriggerJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostConfigureProcessingEngineTriggerRequestWithBody(server, "application/json", bodyReader) +} + +// NewPostConfigureProcessingEngineTriggerRequestWithBody generates requests for PostConfigureProcessingEngineTrigger with any type of body +func NewPostConfigureProcessingEngineTriggerRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/processing_engine_trigger") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewPostDisableProcessingEngineTriggerRequest calls the generic PostDisableProcessingEngineTrigger builder with application/json body +func NewPostDisableProcessingEngineTriggerRequest(server string, params *PostDisableProcessingEngineTriggerParams, body PostDisableProcessingEngineTriggerJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostDisableProcessingEngineTriggerRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostDisableProcessingEngineTriggerRequestWithBody generates requests for PostDisableProcessingEngineTrigger with any type of body +func NewPostDisableProcessingEngineTriggerRequestWithBody(server string, params *PostDisableProcessingEngineTriggerParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/processing_engine_trigger/disable") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.ContentType != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Content-Type", runtime.ParamLocationHeader, *params.ContentType) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Type", headerParam0) + } + + } + + return req, nil +} + +// NewPostEnableProcessingEngineTriggerRequest calls the generic PostEnableProcessingEngineTrigger builder with application/json body +func NewPostEnableProcessingEngineTriggerRequest(server string, params *PostEnableProcessingEngineTriggerParams, body PostEnableProcessingEngineTriggerJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostEnableProcessingEngineTriggerRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostEnableProcessingEngineTriggerRequestWithBody generates requests for PostEnableProcessingEngineTrigger with any type of body +func NewPostEnableProcessingEngineTriggerRequestWithBody(server string, params *PostEnableProcessingEngineTriggerParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/processing_engine_trigger/enable") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.ContentType != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Content-Type", runtime.ParamLocationHeader, *params.ContentType) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Type", headerParam0) + } + + } + + return req, nil +} + +// NewDeleteConfigureTableRequest generates requests for DeleteConfigureTable +func NewDeleteConfigureTableRequest(server string, params *DeleteConfigureTableParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/table") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "db", runtime.ParamLocationQuery, params.Db); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "table", runtime.ParamLocationQuery, params.Table); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostConfigureTableRequest calls the generic PostConfigureTable builder with application/json body +func NewPostConfigureTableRequest(server string, body PostConfigureTableJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostConfigureTableRequestWithBody(server, "application/json", bodyReader) +} + +// NewPostConfigureTableRequestWithBody generates requests for PostConfigureTable with any type of body +func NewPostConfigureTableRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/table") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewPostCreateAdminTokenRequest generates requests for PostCreateAdminToken +func NewPostCreateAdminTokenRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/token/admin") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostRegenerateAdminTokenRequest generates requests for PostRegenerateAdminToken +func NewPostRegenerateAdminTokenRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/token/admin/regenerate") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetProcessingEnginePluginRequestRequest generates requests for GetProcessingEnginePluginRequest +func NewGetProcessingEnginePluginRequestRequest(server string, pluginPath string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "plugin_path", runtime.ParamLocationPath, pluginPath) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/engine/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostProcessingEnginePluginRequestRequest calls the generic PostProcessingEnginePluginRequest builder with application/json body +func NewPostProcessingEnginePluginRequestRequest(server string, pluginPath string, params *PostProcessingEnginePluginRequestParams, body PostProcessingEnginePluginRequestJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostProcessingEnginePluginRequestRequestWithBody(server, pluginPath, params, "application/json", bodyReader) +} + +// NewPostProcessingEnginePluginRequestRequestWithBody generates requests for PostProcessingEnginePluginRequest with any type of body +func NewPostProcessingEnginePluginRequestRequestWithBody(server string, pluginPath string, params *PostProcessingEnginePluginRequestParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "plugin_path", runtime.ParamLocationPath, pluginPath) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/engine/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.ContentType != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Content-Type", runtime.ParamLocationHeader, *params.ContentType) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Type", headerParam0) + } + + } + + return req, nil +} + +// NewPostTestSchedulingPluginRequest generates requests for PostTestSchedulingPlugin +func NewPostTestSchedulingPluginRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/plugin_test/schedule") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostTestWALPluginRequest generates requests for PostTestWALPlugin +func NewPostTestWALPluginRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/plugin_test/wal") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetExecuteInfluxQLQueryRequest generates requests for GetExecuteInfluxQLQuery +func NewGetExecuteInfluxQLQueryRequest(server string, params *GetExecuteInfluxQLQueryParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/query_influxql") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Db != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "db", runtime.ParamLocationQuery, *params.Db); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "q", runtime.ParamLocationQuery, params.Q); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if params.Format != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "format", runtime.ParamLocationQuery, *params.Format); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + if params != nil { + + if params.Accept != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam0) + } + + } + + return req, nil +} + +// NewPostExecuteQueryInfluxQLRequest calls the generic PostExecuteQueryInfluxQL builder with application/json body +func NewPostExecuteQueryInfluxQLRequest(server string, params *PostExecuteQueryInfluxQLParams, body PostExecuteQueryInfluxQLJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostExecuteQueryInfluxQLRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostExecuteQueryInfluxQLRequestWithBody generates requests for PostExecuteQueryInfluxQL with any type of body +func NewPostExecuteQueryInfluxQLRequestWithBody(server string, params *PostExecuteQueryInfluxQLParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/query_influxql") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.Accept != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam0) + } + + if params.ContentType != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Content-Type", runtime.ParamLocationHeader, *params.ContentType) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Type", headerParam1) + } + + } + + return req, nil +} + +// NewGetExecuteQuerySQLRequest generates requests for GetExecuteQuerySQL +func NewGetExecuteQuerySQLRequest(server string, params *GetExecuteQuerySQLParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/query_sql") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "db", runtime.ParamLocationQuery, params.Db); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "q", runtime.ParamLocationQuery, params.Q); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if params.Format != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "format", runtime.ParamLocationQuery, *params.Format); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + if params != nil { + + if params.Accept != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam0) + } + + if params.ContentType != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Content-Type", runtime.ParamLocationHeader, *params.ContentType) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Type", headerParam1) + } + + } + + return req, nil +} + +// NewPostExecuteQuerySQLRequest calls the generic PostExecuteQuerySQL builder with application/json body +func NewPostExecuteQuerySQLRequest(server string, params *PostExecuteQuerySQLParams, body PostExecuteQuerySQLJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostExecuteQuerySQLRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostExecuteQuerySQLRequestWithBody generates requests for PostExecuteQuerySQL with any type of body +func NewPostExecuteQuerySQLRequestWithBody(server string, params *PostExecuteQuerySQLParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/query_sql") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.Accept != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam0) + } + + if params.ContentType != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Content-Type", runtime.ParamLocationHeader, *params.ContentType) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Type", headerParam1) + } + + } + + return req, nil +} + +// NewPostWriteLPRequestWithTextBody calls the generic PostWriteLP builder with text/plain body +func NewPostWriteLPRequestWithTextBody(server string, params *PostWriteLPParams, body PostWriteLPTextRequestBody) (*http.Request, error) { + var bodyReader io.Reader + bodyReader = strings.NewReader(string(body)) + return NewPostWriteLPRequestWithBody(server, params, "text/plain", bodyReader) +} + +// NewPostWriteLPRequestWithBody generates requests for PostWriteLP with any type of body +func NewPostWriteLPRequestWithBody(server string, params *PostWriteLPParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/write_lp") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "db", runtime.ParamLocationQuery, params.Db); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if params.AcceptPartial != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "accept_partial", runtime.ParamLocationQuery, *params.AcceptPartial); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "precision", runtime.ParamLocationQuery, params.Precision); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if params.NoSync != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "no_sync", runtime.ParamLocationQuery, *params.NoSync); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.ContentType != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Content-Type", runtime.ParamLocationHeader, *params.ContentType) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Type", headerParam0) + } + + if params.Accept != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam1) + } + + if params.ContentEncoding != nil { + var headerParam2 string + + headerParam2, err = runtime.StyleParamWithLocation("simple", false, "Content-Encoding", runtime.ParamLocationHeader, *params.ContentEncoding) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Encoding", headerParam2) + } + + if params.ContentLength != nil { + var headerParam3 string + + headerParam3, err = runtime.StyleParamWithLocation("simple", false, "Content-Length", runtime.ParamLocationHeader, *params.ContentLength) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Length", headerParam3) + } + + } + + return req, nil +} + +// NewGetHealthRequest generates requests for GetHealth +func NewGetHealthRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/health") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetMetricsRequest generates requests for GetMetrics +func NewGetMetricsRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/metrics") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetPingRequest generates requests for GetPing +func NewGetPingRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/ping") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetV1ExecuteQueryRequest generates requests for GetV1ExecuteQuery +func NewGetV1ExecuteQueryRequest(server string, params *GetV1ExecuteQueryParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/query") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Chunked != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "chunked", runtime.ParamLocationQuery, *params.Chunked); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.ChunkSize != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "chunk_size", runtime.ParamLocationQuery, *params.ChunkSize); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Db != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "db", runtime.ParamLocationQuery, *params.Db); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Pretty != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pretty", runtime.ParamLocationQuery, *params.Pretty); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "q", runtime.ParamLocationQuery, params.Q); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if params.Epoch != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "epoch", runtime.ParamLocationQuery, *params.Epoch); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + if params != nil { + + if params.Accept != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam0) + } + + } + + return req, nil +} + +// NewPostExecuteV1QueryRequest calls the generic PostExecuteV1Query builder with application/json body +func NewPostExecuteV1QueryRequest(server string, params *PostExecuteV1QueryParams, body PostExecuteV1QueryJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostExecuteV1QueryRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostExecuteV1QueryRequestWithBody generates requests for PostExecuteV1Query with any type of body +func NewPostExecuteV1QueryRequestWithBody(server string, params *PostExecuteV1QueryParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/query") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.Accept != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam0) + } + + } + + return req, nil +} + +// NewPostV1WriteRequestWithTextBody calls the generic PostV1Write builder with text/plain body +func NewPostV1WriteRequestWithTextBody(server string, params *PostV1WriteParams, body PostV1WriteTextRequestBody) (*http.Request, error) { + var bodyReader io.Reader + bodyReader = strings.NewReader(string(body)) + return NewPostV1WriteRequestWithBody(server, params, "text/plain", bodyReader) +} + +// NewPostV1WriteRequestWithBody generates requests for PostV1Write with any type of body +func NewPostV1WriteRequestWithBody(server string, params *PostV1WriteParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/write") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "db", runtime.ParamLocationQuery, params.Db); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "precision", runtime.ParamLocationQuery, params.Precision); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.ContentType != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Content-Type", runtime.ParamLocationHeader, *params.ContentType) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Type", headerParam0) + } + + if params.Accept != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam1) + } + + if params.ContentEncoding != nil { + var headerParam2 string + + headerParam2, err = runtime.StyleParamWithLocation("simple", false, "Content-Encoding", runtime.ParamLocationHeader, *params.ContentEncoding) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Encoding", headerParam2) + } + + if params.ContentLength != nil { + var headerParam3 string + + headerParam3, err = runtime.StyleParamWithLocation("simple", false, "Content-Length", runtime.ParamLocationHeader, *params.ContentLength) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Length", headerParam3) + } + + } + + return req, nil +} + +func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { + for _, r := range c.RequestEditors { + if err := r(ctx, req); err != nil { + return err + } + } + for _, r := range additionalEditors { + if err := r(ctx, req); err != nil { + return err + } + } + return nil +} + +// ClientWithResponses builds on ClientInterface to offer response payloads +type ClientWithResponses struct { + ClientInterface +} + +// NewClientWithResponses creates a new ClientWithResponses, which wraps +// Client with return type handling +func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { + client, err := NewClient(server, opts...) + if err != nil { + return nil, err + } + return &ClientWithResponses{client}, nil +} + +// WithBaseURL overrides the baseURL. +func WithBaseURL(baseURL string) ClientOption { + return func(c *Client) error { + newBaseURL, err := url.Parse(baseURL) + if err != nil { + return err + } + c.Server = newBaseURL.String() + return nil + } +} + +// ClientWithResponsesInterface is the interface specification for the client with responses above. +type ClientWithResponsesInterface interface { + // GetHealthV1WithResponse request + GetHealthV1WithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthV1Response, error) + + // PostV2WriteWithBodyWithResponse request with any body + PostV2WriteWithBodyWithResponse(ctx context.Context, params *PostV2WriteParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV2WriteResponse, error) + + PostV2WriteWithTextBodyWithResponse(ctx context.Context, params *PostV2WriteParams, body PostV2WriteTextRequestBody, reqEditors ...RequestEditorFn) (*PostV2WriteResponse, error) + + // DeleteConfigureDatabaseWithResponse request + DeleteConfigureDatabaseWithResponse(ctx context.Context, params *DeleteConfigureDatabaseParams, reqEditors ...RequestEditorFn) (*DeleteConfigureDatabaseResponse, error) + + // GetConfigureDatabaseWithResponse request + GetConfigureDatabaseWithResponse(ctx context.Context, params *GetConfigureDatabaseParams, reqEditors ...RequestEditorFn) (*GetConfigureDatabaseResponse, error) + + // PostConfigureDatabaseWithBodyWithResponse request with any body + PostConfigureDatabaseWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostConfigureDatabaseResponse, error) + + PostConfigureDatabaseWithResponse(ctx context.Context, body PostConfigureDatabaseJSONRequestBody, reqEditors ...RequestEditorFn) (*PostConfigureDatabaseResponse, error) + + // PostConfigureDistinctCacheWithBodyWithResponse request with any body + PostConfigureDistinctCacheWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostConfigureDistinctCacheResponse, error) + + PostConfigureDistinctCacheWithResponse(ctx context.Context, body PostConfigureDistinctCacheJSONRequestBody, reqEditors ...RequestEditorFn) (*PostConfigureDistinctCacheResponse, error) + + // DeleteConfigureLastCacheWithResponse request + DeleteConfigureLastCacheWithResponse(ctx context.Context, params *DeleteConfigureLastCacheParams, reqEditors ...RequestEditorFn) (*DeleteConfigureLastCacheResponse, error) + + // PostConfigureLastCacheWithBodyWithResponse request with any body + PostConfigureLastCacheWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostConfigureLastCacheResponse, error) + + PostConfigureLastCacheWithResponse(ctx context.Context, body PostConfigureLastCacheJSONRequestBody, reqEditors ...RequestEditorFn) (*PostConfigureLastCacheResponse, error) + + // PostInstallPluginPackagesWithBodyWithResponse request with any body + PostInstallPluginPackagesWithBodyWithResponse(ctx context.Context, params *PostInstallPluginPackagesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostInstallPluginPackagesResponse, error) + + PostInstallPluginPackagesWithResponse(ctx context.Context, params *PostInstallPluginPackagesParams, body PostInstallPluginPackagesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostInstallPluginPackagesResponse, error) + + // PostInstallPluginRequirementsWithBodyWithResponse request with any body + PostInstallPluginRequirementsWithBodyWithResponse(ctx context.Context, params *PostInstallPluginRequirementsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostInstallPluginRequirementsResponse, error) + + PostInstallPluginRequirementsWithResponse(ctx context.Context, params *PostInstallPluginRequirementsParams, body PostInstallPluginRequirementsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostInstallPluginRequirementsResponse, error) + + // DeleteConfigureProcessingEngineTriggerWithResponse request + DeleteConfigureProcessingEngineTriggerWithResponse(ctx context.Context, params *DeleteConfigureProcessingEngineTriggerParams, reqEditors ...RequestEditorFn) (*DeleteConfigureProcessingEngineTriggerResponse, error) + + // PostConfigureProcessingEngineTriggerWithBodyWithResponse request with any body + PostConfigureProcessingEngineTriggerWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostConfigureProcessingEngineTriggerResponse, error) + + PostConfigureProcessingEngineTriggerWithResponse(ctx context.Context, body PostConfigureProcessingEngineTriggerJSONRequestBody, reqEditors ...RequestEditorFn) (*PostConfigureProcessingEngineTriggerResponse, error) + + // PostDisableProcessingEngineTriggerWithBodyWithResponse request with any body + PostDisableProcessingEngineTriggerWithBodyWithResponse(ctx context.Context, params *PostDisableProcessingEngineTriggerParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostDisableProcessingEngineTriggerResponse, error) + + PostDisableProcessingEngineTriggerWithResponse(ctx context.Context, params *PostDisableProcessingEngineTriggerParams, body PostDisableProcessingEngineTriggerJSONRequestBody, reqEditors ...RequestEditorFn) (*PostDisableProcessingEngineTriggerResponse, error) + + // PostEnableProcessingEngineTriggerWithBodyWithResponse request with any body + PostEnableProcessingEngineTriggerWithBodyWithResponse(ctx context.Context, params *PostEnableProcessingEngineTriggerParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostEnableProcessingEngineTriggerResponse, error) + + PostEnableProcessingEngineTriggerWithResponse(ctx context.Context, params *PostEnableProcessingEngineTriggerParams, body PostEnableProcessingEngineTriggerJSONRequestBody, reqEditors ...RequestEditorFn) (*PostEnableProcessingEngineTriggerResponse, error) + + // DeleteConfigureTableWithResponse request + DeleteConfigureTableWithResponse(ctx context.Context, params *DeleteConfigureTableParams, reqEditors ...RequestEditorFn) (*DeleteConfigureTableResponse, error) + + // PostConfigureTableWithBodyWithResponse request with any body + PostConfigureTableWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostConfigureTableResponse, error) + + PostConfigureTableWithResponse(ctx context.Context, body PostConfigureTableJSONRequestBody, reqEditors ...RequestEditorFn) (*PostConfigureTableResponse, error) + + // PostCreateAdminTokenWithResponse request + PostCreateAdminTokenWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostCreateAdminTokenResponse, error) + + // PostRegenerateAdminTokenWithResponse request + PostRegenerateAdminTokenWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostRegenerateAdminTokenResponse, error) + + // GetProcessingEnginePluginRequestWithResponse request + GetProcessingEnginePluginRequestWithResponse(ctx context.Context, pluginPath string, reqEditors ...RequestEditorFn) (*GetProcessingEnginePluginRequestResponse, error) + + // PostProcessingEnginePluginRequestWithBodyWithResponse request with any body + PostProcessingEnginePluginRequestWithBodyWithResponse(ctx context.Context, pluginPath string, params *PostProcessingEnginePluginRequestParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostProcessingEnginePluginRequestResponse, error) + + PostProcessingEnginePluginRequestWithResponse(ctx context.Context, pluginPath string, params *PostProcessingEnginePluginRequestParams, body PostProcessingEnginePluginRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*PostProcessingEnginePluginRequestResponse, error) + + // PostTestSchedulingPluginWithResponse request + PostTestSchedulingPluginWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostTestSchedulingPluginResponse, error) + + // PostTestWALPluginWithResponse request + PostTestWALPluginWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostTestWALPluginResponse, error) + + // GetExecuteInfluxQLQueryWithResponse request + GetExecuteInfluxQLQueryWithResponse(ctx context.Context, params *GetExecuteInfluxQLQueryParams, reqEditors ...RequestEditorFn) (*GetExecuteInfluxQLQueryResponse, error) + + // PostExecuteQueryInfluxQLWithBodyWithResponse request with any body + PostExecuteQueryInfluxQLWithBodyWithResponse(ctx context.Context, params *PostExecuteQueryInfluxQLParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostExecuteQueryInfluxQLResponse, error) + + PostExecuteQueryInfluxQLWithResponse(ctx context.Context, params *PostExecuteQueryInfluxQLParams, body PostExecuteQueryInfluxQLJSONRequestBody, reqEditors ...RequestEditorFn) (*PostExecuteQueryInfluxQLResponse, error) + + // GetExecuteQuerySQLWithResponse request + GetExecuteQuerySQLWithResponse(ctx context.Context, params *GetExecuteQuerySQLParams, reqEditors ...RequestEditorFn) (*GetExecuteQuerySQLResponse, error) + + // PostExecuteQuerySQLWithBodyWithResponse request with any body + PostExecuteQuerySQLWithBodyWithResponse(ctx context.Context, params *PostExecuteQuerySQLParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostExecuteQuerySQLResponse, error) + + PostExecuteQuerySQLWithResponse(ctx context.Context, params *PostExecuteQuerySQLParams, body PostExecuteQuerySQLJSONRequestBody, reqEditors ...RequestEditorFn) (*PostExecuteQuerySQLResponse, error) + + // PostWriteLPWithBodyWithResponse request with any body + PostWriteLPWithBodyWithResponse(ctx context.Context, params *PostWriteLPParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostWriteLPResponse, error) + + PostWriteLPWithTextBodyWithResponse(ctx context.Context, params *PostWriteLPParams, body PostWriteLPTextRequestBody, reqEditors ...RequestEditorFn) (*PostWriteLPResponse, error) + + // GetHealthWithResponse request + GetHealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthResponse, error) + + // GetMetricsWithResponse request + GetMetricsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetMetricsResponse, error) + + // GetPingWithResponse request + GetPingWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetPingResponse, error) + + // GetV1ExecuteQueryWithResponse request + GetV1ExecuteQueryWithResponse(ctx context.Context, params *GetV1ExecuteQueryParams, reqEditors ...RequestEditorFn) (*GetV1ExecuteQueryResponse, error) + + // PostExecuteV1QueryWithBodyWithResponse request with any body + PostExecuteV1QueryWithBodyWithResponse(ctx context.Context, params *PostExecuteV1QueryParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostExecuteV1QueryResponse, error) + + PostExecuteV1QueryWithResponse(ctx context.Context, params *PostExecuteV1QueryParams, body PostExecuteV1QueryJSONRequestBody, reqEditors ...RequestEditorFn) (*PostExecuteV1QueryResponse, error) + + // PostV1WriteWithBodyWithResponse request with any body + PostV1WriteWithBodyWithResponse(ctx context.Context, params *PostV1WriteParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV1WriteResponse, error) + + PostV1WriteWithTextBodyWithResponse(ctx context.Context, params *PostV1WriteParams, body PostV1WriteTextRequestBody, reqEditors ...RequestEditorFn) (*PostV1WriteResponse, error) +} + +type GetHealthV1Response struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r GetHealthV1Response) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetHealthV1Response) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostV2WriteResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostV2WriteResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostV2WriteResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteConfigureDatabaseResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r DeleteConfigureDatabaseResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteConfigureDatabaseResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetConfigureDatabaseResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ShowDatabasesResponse + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r GetConfigureDatabaseResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetConfigureDatabaseResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostConfigureDatabaseResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostConfigureDatabaseResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostConfigureDatabaseResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostConfigureDistinctCacheResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r PostConfigureDistinctCacheResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostConfigureDistinctCacheResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteConfigureLastCacheResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r DeleteConfigureLastCacheResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteConfigureLastCacheResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostConfigureLastCacheResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostConfigureLastCacheResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostConfigureLastCacheResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostInstallPluginPackagesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostInstallPluginPackagesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostInstallPluginPackagesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostInstallPluginRequirementsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostInstallPluginRequirementsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostInstallPluginRequirementsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteConfigureProcessingEngineTriggerResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r DeleteConfigureProcessingEngineTriggerResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteConfigureProcessingEngineTriggerResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostConfigureProcessingEngineTriggerResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostConfigureProcessingEngineTriggerResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostConfigureProcessingEngineTriggerResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostDisableProcessingEngineTriggerResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostDisableProcessingEngineTriggerResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostDisableProcessingEngineTriggerResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostEnableProcessingEngineTriggerResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostEnableProcessingEngineTriggerResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostEnableProcessingEngineTriggerResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteConfigureTableResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r DeleteConfigureTableResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteConfigureTableResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostConfigureTableResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostConfigureTableResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostConfigureTableResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostCreateAdminTokenResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *AdminTokenObject + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostCreateAdminTokenResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostCreateAdminTokenResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostRegenerateAdminTokenResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *AdminTokenObject + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostRegenerateAdminTokenResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostRegenerateAdminTokenResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetProcessingEnginePluginRequestResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r GetProcessingEnginePluginRequestResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetProcessingEnginePluginRequestResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostProcessingEnginePluginRequestResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostProcessingEnginePluginRequestResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostProcessingEnginePluginRequestResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostTestSchedulingPluginResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostTestSchedulingPluginResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostTestSchedulingPluginResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostTestWALPluginResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostTestWALPluginResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostTestWALPluginResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetExecuteInfluxQLQueryResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *QueryResponse + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r GetExecuteInfluxQLQueryResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetExecuteInfluxQLQueryResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostExecuteQueryInfluxQLResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *QueryResponse + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostExecuteQueryInfluxQLResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostExecuteQueryInfluxQLResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetExecuteQuerySQLResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *QueryResponse + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r GetExecuteQuerySQLResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetExecuteQuerySQLResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostExecuteQuerySQLResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *QueryResponse + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostExecuteQuerySQLResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostExecuteQuerySQLResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostWriteLPResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostWriteLPResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostWriteLPResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetHealthResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r GetHealthResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetHealthResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetMetricsResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r GetMetricsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetMetricsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetPingResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *interface{} +} + +// Status returns HTTPResponse.Status +func (r GetPingResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetPingResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetV1ExecuteQueryResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *QueryResponse + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r GetV1ExecuteQueryResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV1ExecuteQueryResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostExecuteV1QueryResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *QueryResponse + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostExecuteV1QueryResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostExecuteV1QueryResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostV1WriteResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostV1WriteResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostV1WriteResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// GetHealthV1WithResponse request returning *GetHealthV1Response +func (c *ClientWithResponses) GetHealthV1WithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthV1Response, error) { + rsp, err := c.GetHealthV1(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetHealthV1Response(rsp) +} + +// PostV2WriteWithBodyWithResponse request with arbitrary body returning *PostV2WriteResponse +func (c *ClientWithResponses) PostV2WriteWithBodyWithResponse(ctx context.Context, params *PostV2WriteParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV2WriteResponse, error) { + rsp, err := c.PostV2WriteWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV2WriteResponse(rsp) +} + +func (c *ClientWithResponses) PostV2WriteWithTextBodyWithResponse(ctx context.Context, params *PostV2WriteParams, body PostV2WriteTextRequestBody, reqEditors ...RequestEditorFn) (*PostV2WriteResponse, error) { + rsp, err := c.PostV2WriteWithTextBody(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV2WriteResponse(rsp) +} + +// DeleteConfigureDatabaseWithResponse request returning *DeleteConfigureDatabaseResponse +func (c *ClientWithResponses) DeleteConfigureDatabaseWithResponse(ctx context.Context, params *DeleteConfigureDatabaseParams, reqEditors ...RequestEditorFn) (*DeleteConfigureDatabaseResponse, error) { + rsp, err := c.DeleteConfigureDatabase(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteConfigureDatabaseResponse(rsp) +} + +// GetConfigureDatabaseWithResponse request returning *GetConfigureDatabaseResponse +func (c *ClientWithResponses) GetConfigureDatabaseWithResponse(ctx context.Context, params *GetConfigureDatabaseParams, reqEditors ...RequestEditorFn) (*GetConfigureDatabaseResponse, error) { + rsp, err := c.GetConfigureDatabase(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetConfigureDatabaseResponse(rsp) +} + +// PostConfigureDatabaseWithBodyWithResponse request with arbitrary body returning *PostConfigureDatabaseResponse +func (c *ClientWithResponses) PostConfigureDatabaseWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostConfigureDatabaseResponse, error) { + rsp, err := c.PostConfigureDatabaseWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostConfigureDatabaseResponse(rsp) +} + +func (c *ClientWithResponses) PostConfigureDatabaseWithResponse(ctx context.Context, body PostConfigureDatabaseJSONRequestBody, reqEditors ...RequestEditorFn) (*PostConfigureDatabaseResponse, error) { + rsp, err := c.PostConfigureDatabase(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostConfigureDatabaseResponse(rsp) +} + +// PostConfigureDistinctCacheWithBodyWithResponse request with arbitrary body returning *PostConfigureDistinctCacheResponse +func (c *ClientWithResponses) PostConfigureDistinctCacheWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostConfigureDistinctCacheResponse, error) { + rsp, err := c.PostConfigureDistinctCacheWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostConfigureDistinctCacheResponse(rsp) +} + +func (c *ClientWithResponses) PostConfigureDistinctCacheWithResponse(ctx context.Context, body PostConfigureDistinctCacheJSONRequestBody, reqEditors ...RequestEditorFn) (*PostConfigureDistinctCacheResponse, error) { + rsp, err := c.PostConfigureDistinctCache(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostConfigureDistinctCacheResponse(rsp) +} + +// DeleteConfigureLastCacheWithResponse request returning *DeleteConfigureLastCacheResponse +func (c *ClientWithResponses) DeleteConfigureLastCacheWithResponse(ctx context.Context, params *DeleteConfigureLastCacheParams, reqEditors ...RequestEditorFn) (*DeleteConfigureLastCacheResponse, error) { + rsp, err := c.DeleteConfigureLastCache(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteConfigureLastCacheResponse(rsp) +} + +// PostConfigureLastCacheWithBodyWithResponse request with arbitrary body returning *PostConfigureLastCacheResponse +func (c *ClientWithResponses) PostConfigureLastCacheWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostConfigureLastCacheResponse, error) { + rsp, err := c.PostConfigureLastCacheWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostConfigureLastCacheResponse(rsp) +} + +func (c *ClientWithResponses) PostConfigureLastCacheWithResponse(ctx context.Context, body PostConfigureLastCacheJSONRequestBody, reqEditors ...RequestEditorFn) (*PostConfigureLastCacheResponse, error) { + rsp, err := c.PostConfigureLastCache(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostConfigureLastCacheResponse(rsp) +} + +// PostInstallPluginPackagesWithBodyWithResponse request with arbitrary body returning *PostInstallPluginPackagesResponse +func (c *ClientWithResponses) PostInstallPluginPackagesWithBodyWithResponse(ctx context.Context, params *PostInstallPluginPackagesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostInstallPluginPackagesResponse, error) { + rsp, err := c.PostInstallPluginPackagesWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostInstallPluginPackagesResponse(rsp) +} + +func (c *ClientWithResponses) PostInstallPluginPackagesWithResponse(ctx context.Context, params *PostInstallPluginPackagesParams, body PostInstallPluginPackagesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostInstallPluginPackagesResponse, error) { + rsp, err := c.PostInstallPluginPackages(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostInstallPluginPackagesResponse(rsp) +} + +// PostInstallPluginRequirementsWithBodyWithResponse request with arbitrary body returning *PostInstallPluginRequirementsResponse +func (c *ClientWithResponses) PostInstallPluginRequirementsWithBodyWithResponse(ctx context.Context, params *PostInstallPluginRequirementsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostInstallPluginRequirementsResponse, error) { + rsp, err := c.PostInstallPluginRequirementsWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostInstallPluginRequirementsResponse(rsp) +} + +func (c *ClientWithResponses) PostInstallPluginRequirementsWithResponse(ctx context.Context, params *PostInstallPluginRequirementsParams, body PostInstallPluginRequirementsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostInstallPluginRequirementsResponse, error) { + rsp, err := c.PostInstallPluginRequirements(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostInstallPluginRequirementsResponse(rsp) +} + +// DeleteConfigureProcessingEngineTriggerWithResponse request returning *DeleteConfigureProcessingEngineTriggerResponse +func (c *ClientWithResponses) DeleteConfigureProcessingEngineTriggerWithResponse(ctx context.Context, params *DeleteConfigureProcessingEngineTriggerParams, reqEditors ...RequestEditorFn) (*DeleteConfigureProcessingEngineTriggerResponse, error) { + rsp, err := c.DeleteConfigureProcessingEngineTrigger(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteConfigureProcessingEngineTriggerResponse(rsp) +} + +// PostConfigureProcessingEngineTriggerWithBodyWithResponse request with arbitrary body returning *PostConfigureProcessingEngineTriggerResponse +func (c *ClientWithResponses) PostConfigureProcessingEngineTriggerWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostConfigureProcessingEngineTriggerResponse, error) { + rsp, err := c.PostConfigureProcessingEngineTriggerWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostConfigureProcessingEngineTriggerResponse(rsp) +} + +func (c *ClientWithResponses) PostConfigureProcessingEngineTriggerWithResponse(ctx context.Context, body PostConfigureProcessingEngineTriggerJSONRequestBody, reqEditors ...RequestEditorFn) (*PostConfigureProcessingEngineTriggerResponse, error) { + rsp, err := c.PostConfigureProcessingEngineTrigger(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostConfigureProcessingEngineTriggerResponse(rsp) +} + +// PostDisableProcessingEngineTriggerWithBodyWithResponse request with arbitrary body returning *PostDisableProcessingEngineTriggerResponse +func (c *ClientWithResponses) PostDisableProcessingEngineTriggerWithBodyWithResponse(ctx context.Context, params *PostDisableProcessingEngineTriggerParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostDisableProcessingEngineTriggerResponse, error) { + rsp, err := c.PostDisableProcessingEngineTriggerWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostDisableProcessingEngineTriggerResponse(rsp) +} + +func (c *ClientWithResponses) PostDisableProcessingEngineTriggerWithResponse(ctx context.Context, params *PostDisableProcessingEngineTriggerParams, body PostDisableProcessingEngineTriggerJSONRequestBody, reqEditors ...RequestEditorFn) (*PostDisableProcessingEngineTriggerResponse, error) { + rsp, err := c.PostDisableProcessingEngineTrigger(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostDisableProcessingEngineTriggerResponse(rsp) +} + +// PostEnableProcessingEngineTriggerWithBodyWithResponse request with arbitrary body returning *PostEnableProcessingEngineTriggerResponse +func (c *ClientWithResponses) PostEnableProcessingEngineTriggerWithBodyWithResponse(ctx context.Context, params *PostEnableProcessingEngineTriggerParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostEnableProcessingEngineTriggerResponse, error) { + rsp, err := c.PostEnableProcessingEngineTriggerWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostEnableProcessingEngineTriggerResponse(rsp) +} + +func (c *ClientWithResponses) PostEnableProcessingEngineTriggerWithResponse(ctx context.Context, params *PostEnableProcessingEngineTriggerParams, body PostEnableProcessingEngineTriggerJSONRequestBody, reqEditors ...RequestEditorFn) (*PostEnableProcessingEngineTriggerResponse, error) { + rsp, err := c.PostEnableProcessingEngineTrigger(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostEnableProcessingEngineTriggerResponse(rsp) +} + +// DeleteConfigureTableWithResponse request returning *DeleteConfigureTableResponse +func (c *ClientWithResponses) DeleteConfigureTableWithResponse(ctx context.Context, params *DeleteConfigureTableParams, reqEditors ...RequestEditorFn) (*DeleteConfigureTableResponse, error) { + rsp, err := c.DeleteConfigureTable(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteConfigureTableResponse(rsp) +} + +// PostConfigureTableWithBodyWithResponse request with arbitrary body returning *PostConfigureTableResponse +func (c *ClientWithResponses) PostConfigureTableWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostConfigureTableResponse, error) { + rsp, err := c.PostConfigureTableWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostConfigureTableResponse(rsp) +} + +func (c *ClientWithResponses) PostConfigureTableWithResponse(ctx context.Context, body PostConfigureTableJSONRequestBody, reqEditors ...RequestEditorFn) (*PostConfigureTableResponse, error) { + rsp, err := c.PostConfigureTable(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostConfigureTableResponse(rsp) +} + +// PostCreateAdminTokenWithResponse request returning *PostCreateAdminTokenResponse +func (c *ClientWithResponses) PostCreateAdminTokenWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostCreateAdminTokenResponse, error) { + rsp, err := c.PostCreateAdminToken(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostCreateAdminTokenResponse(rsp) +} + +// PostRegenerateAdminTokenWithResponse request returning *PostRegenerateAdminTokenResponse +func (c *ClientWithResponses) PostRegenerateAdminTokenWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostRegenerateAdminTokenResponse, error) { + rsp, err := c.PostRegenerateAdminToken(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostRegenerateAdminTokenResponse(rsp) +} + +// GetProcessingEnginePluginRequestWithResponse request returning *GetProcessingEnginePluginRequestResponse +func (c *ClientWithResponses) GetProcessingEnginePluginRequestWithResponse(ctx context.Context, pluginPath string, reqEditors ...RequestEditorFn) (*GetProcessingEnginePluginRequestResponse, error) { + rsp, err := c.GetProcessingEnginePluginRequest(ctx, pluginPath, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetProcessingEnginePluginRequestResponse(rsp) +} + +// PostProcessingEnginePluginRequestWithBodyWithResponse request with arbitrary body returning *PostProcessingEnginePluginRequestResponse +func (c *ClientWithResponses) PostProcessingEnginePluginRequestWithBodyWithResponse(ctx context.Context, pluginPath string, params *PostProcessingEnginePluginRequestParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostProcessingEnginePluginRequestResponse, error) { + rsp, err := c.PostProcessingEnginePluginRequestWithBody(ctx, pluginPath, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostProcessingEnginePluginRequestResponse(rsp) +} + +func (c *ClientWithResponses) PostProcessingEnginePluginRequestWithResponse(ctx context.Context, pluginPath string, params *PostProcessingEnginePluginRequestParams, body PostProcessingEnginePluginRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*PostProcessingEnginePluginRequestResponse, error) { + rsp, err := c.PostProcessingEnginePluginRequest(ctx, pluginPath, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostProcessingEnginePluginRequestResponse(rsp) +} + +// PostTestSchedulingPluginWithResponse request returning *PostTestSchedulingPluginResponse +func (c *ClientWithResponses) PostTestSchedulingPluginWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostTestSchedulingPluginResponse, error) { + rsp, err := c.PostTestSchedulingPlugin(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostTestSchedulingPluginResponse(rsp) +} + +// PostTestWALPluginWithResponse request returning *PostTestWALPluginResponse +func (c *ClientWithResponses) PostTestWALPluginWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostTestWALPluginResponse, error) { + rsp, err := c.PostTestWALPlugin(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostTestWALPluginResponse(rsp) +} + +// GetExecuteInfluxQLQueryWithResponse request returning *GetExecuteInfluxQLQueryResponse +func (c *ClientWithResponses) GetExecuteInfluxQLQueryWithResponse(ctx context.Context, params *GetExecuteInfluxQLQueryParams, reqEditors ...RequestEditorFn) (*GetExecuteInfluxQLQueryResponse, error) { + rsp, err := c.GetExecuteInfluxQLQuery(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetExecuteInfluxQLQueryResponse(rsp) +} + +// PostExecuteQueryInfluxQLWithBodyWithResponse request with arbitrary body returning *PostExecuteQueryInfluxQLResponse +func (c *ClientWithResponses) PostExecuteQueryInfluxQLWithBodyWithResponse(ctx context.Context, params *PostExecuteQueryInfluxQLParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostExecuteQueryInfluxQLResponse, error) { + rsp, err := c.PostExecuteQueryInfluxQLWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostExecuteQueryInfluxQLResponse(rsp) +} + +func (c *ClientWithResponses) PostExecuteQueryInfluxQLWithResponse(ctx context.Context, params *PostExecuteQueryInfluxQLParams, body PostExecuteQueryInfluxQLJSONRequestBody, reqEditors ...RequestEditorFn) (*PostExecuteQueryInfluxQLResponse, error) { + rsp, err := c.PostExecuteQueryInfluxQL(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostExecuteQueryInfluxQLResponse(rsp) +} + +// GetExecuteQuerySQLWithResponse request returning *GetExecuteQuerySQLResponse +func (c *ClientWithResponses) GetExecuteQuerySQLWithResponse(ctx context.Context, params *GetExecuteQuerySQLParams, reqEditors ...RequestEditorFn) (*GetExecuteQuerySQLResponse, error) { + rsp, err := c.GetExecuteQuerySQL(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetExecuteQuerySQLResponse(rsp) +} + +// PostExecuteQuerySQLWithBodyWithResponse request with arbitrary body returning *PostExecuteQuerySQLResponse +func (c *ClientWithResponses) PostExecuteQuerySQLWithBodyWithResponse(ctx context.Context, params *PostExecuteQuerySQLParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostExecuteQuerySQLResponse, error) { + rsp, err := c.PostExecuteQuerySQLWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostExecuteQuerySQLResponse(rsp) +} + +func (c *ClientWithResponses) PostExecuteQuerySQLWithResponse(ctx context.Context, params *PostExecuteQuerySQLParams, body PostExecuteQuerySQLJSONRequestBody, reqEditors ...RequestEditorFn) (*PostExecuteQuerySQLResponse, error) { + rsp, err := c.PostExecuteQuerySQL(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostExecuteQuerySQLResponse(rsp) +} + +// PostWriteLPWithBodyWithResponse request with arbitrary body returning *PostWriteLPResponse +func (c *ClientWithResponses) PostWriteLPWithBodyWithResponse(ctx context.Context, params *PostWriteLPParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostWriteLPResponse, error) { + rsp, err := c.PostWriteLPWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostWriteLPResponse(rsp) +} + +func (c *ClientWithResponses) PostWriteLPWithTextBodyWithResponse(ctx context.Context, params *PostWriteLPParams, body PostWriteLPTextRequestBody, reqEditors ...RequestEditorFn) (*PostWriteLPResponse, error) { + rsp, err := c.PostWriteLPWithTextBody(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostWriteLPResponse(rsp) +} + +// GetHealthWithResponse request returning *GetHealthResponse +func (c *ClientWithResponses) GetHealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthResponse, error) { + rsp, err := c.GetHealth(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetHealthResponse(rsp) +} + +// GetMetricsWithResponse request returning *GetMetricsResponse +func (c *ClientWithResponses) GetMetricsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetMetricsResponse, error) { + rsp, err := c.GetMetrics(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetMetricsResponse(rsp) +} + +// GetPingWithResponse request returning *GetPingResponse +func (c *ClientWithResponses) GetPingWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetPingResponse, error) { + rsp, err := c.GetPing(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetPingResponse(rsp) +} + +// GetV1ExecuteQueryWithResponse request returning *GetV1ExecuteQueryResponse +func (c *ClientWithResponses) GetV1ExecuteQueryWithResponse(ctx context.Context, params *GetV1ExecuteQueryParams, reqEditors ...RequestEditorFn) (*GetV1ExecuteQueryResponse, error) { + rsp, err := c.GetV1ExecuteQuery(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV1ExecuteQueryResponse(rsp) +} + +// PostExecuteV1QueryWithBodyWithResponse request with arbitrary body returning *PostExecuteV1QueryResponse +func (c *ClientWithResponses) PostExecuteV1QueryWithBodyWithResponse(ctx context.Context, params *PostExecuteV1QueryParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostExecuteV1QueryResponse, error) { + rsp, err := c.PostExecuteV1QueryWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostExecuteV1QueryResponse(rsp) +} + +func (c *ClientWithResponses) PostExecuteV1QueryWithResponse(ctx context.Context, params *PostExecuteV1QueryParams, body PostExecuteV1QueryJSONRequestBody, reqEditors ...RequestEditorFn) (*PostExecuteV1QueryResponse, error) { + rsp, err := c.PostExecuteV1Query(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostExecuteV1QueryResponse(rsp) +} + +// PostV1WriteWithBodyWithResponse request with arbitrary body returning *PostV1WriteResponse +func (c *ClientWithResponses) PostV1WriteWithBodyWithResponse(ctx context.Context, params *PostV1WriteParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV1WriteResponse, error) { + rsp, err := c.PostV1WriteWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV1WriteResponse(rsp) +} + +func (c *ClientWithResponses) PostV1WriteWithTextBodyWithResponse(ctx context.Context, params *PostV1WriteParams, body PostV1WriteTextRequestBody, reqEditors ...RequestEditorFn) (*PostV1WriteResponse, error) { + rsp, err := c.PostV1WriteWithTextBody(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV1WriteResponse(rsp) +} + +// ParseGetHealthV1Response parses an HTTP response from a GetHealthV1WithResponse call +func ParseGetHealthV1Response(rsp *http.Response) (*GetHealthV1Response, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetHealthV1Response{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParsePostV2WriteResponse parses an HTTP response from a PostV2WriteWithResponse call +func ParsePostV2WriteResponse(rsp *http.Response) (*PostV2WriteResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostV2WriteResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParseDeleteConfigureDatabaseResponse parses an HTTP response from a DeleteConfigureDatabaseWithResponse call +func ParseDeleteConfigureDatabaseResponse(rsp *http.Response) (*DeleteConfigureDatabaseResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteConfigureDatabaseResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParseGetConfigureDatabaseResponse parses an HTTP response from a GetConfigureDatabaseWithResponse call +func ParseGetConfigureDatabaseResponse(rsp *http.Response) (*GetConfigureDatabaseResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetConfigureDatabaseResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ShowDatabasesResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostConfigureDatabaseResponse parses an HTTP response from a PostConfigureDatabaseWithResponse call +func ParsePostConfigureDatabaseResponse(rsp *http.Response) (*PostConfigureDatabaseResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostConfigureDatabaseResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostConfigureDistinctCacheResponse parses an HTTP response from a PostConfigureDistinctCacheWithResponse call +func ParsePostConfigureDistinctCacheResponse(rsp *http.Response) (*PostConfigureDistinctCacheResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostConfigureDistinctCacheResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseDeleteConfigureLastCacheResponse parses an HTTP response from a DeleteConfigureLastCacheWithResponse call +func ParseDeleteConfigureLastCacheResponse(rsp *http.Response) (*DeleteConfigureLastCacheResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteConfigureLastCacheResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostConfigureLastCacheResponse parses an HTTP response from a PostConfigureLastCacheWithResponse call +func ParsePostConfigureLastCacheResponse(rsp *http.Response) (*PostConfigureLastCacheResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostConfigureLastCacheResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostInstallPluginPackagesResponse parses an HTTP response from a PostInstallPluginPackagesWithResponse call +func ParsePostInstallPluginPackagesResponse(rsp *http.Response) (*PostInstallPluginPackagesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostInstallPluginPackagesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostInstallPluginRequirementsResponse parses an HTTP response from a PostInstallPluginRequirementsWithResponse call +func ParsePostInstallPluginRequirementsResponse(rsp *http.Response) (*PostInstallPluginRequirementsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostInstallPluginRequirementsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParseDeleteConfigureProcessingEngineTriggerResponse parses an HTTP response from a DeleteConfigureProcessingEngineTriggerWithResponse call +func ParseDeleteConfigureProcessingEngineTriggerResponse(rsp *http.Response) (*DeleteConfigureProcessingEngineTriggerResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteConfigureProcessingEngineTriggerResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostConfigureProcessingEngineTriggerResponse parses an HTTP response from a PostConfigureProcessingEngineTriggerWithResponse call +func ParsePostConfigureProcessingEngineTriggerResponse(rsp *http.Response) (*PostConfigureProcessingEngineTriggerResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostConfigureProcessingEngineTriggerResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostDisableProcessingEngineTriggerResponse parses an HTTP response from a PostDisableProcessingEngineTriggerWithResponse call +func ParsePostDisableProcessingEngineTriggerResponse(rsp *http.Response) (*PostDisableProcessingEngineTriggerResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostDisableProcessingEngineTriggerResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostEnableProcessingEngineTriggerResponse parses an HTTP response from a PostEnableProcessingEngineTriggerWithResponse call +func ParsePostEnableProcessingEngineTriggerResponse(rsp *http.Response) (*PostEnableProcessingEngineTriggerResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostEnableProcessingEngineTriggerResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParseDeleteConfigureTableResponse parses an HTTP response from a DeleteConfigureTableWithResponse call +func ParseDeleteConfigureTableResponse(rsp *http.Response) (*DeleteConfigureTableResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteConfigureTableResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostConfigureTableResponse parses an HTTP response from a PostConfigureTableWithResponse call +func ParsePostConfigureTableResponse(rsp *http.Response) (*PostConfigureTableResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostConfigureTableResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostCreateAdminTokenResponse parses an HTTP response from a PostCreateAdminTokenWithResponse call +func ParsePostCreateAdminTokenResponse(rsp *http.Response) (*PostCreateAdminTokenResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostCreateAdminTokenResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest AdminTokenObject + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostRegenerateAdminTokenResponse parses an HTTP response from a PostRegenerateAdminTokenWithResponse call +func ParsePostRegenerateAdminTokenResponse(rsp *http.Response) (*PostRegenerateAdminTokenResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostRegenerateAdminTokenResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest AdminTokenObject + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParseGetProcessingEnginePluginRequestResponse parses an HTTP response from a GetProcessingEnginePluginRequestWithResponse call +func ParseGetProcessingEnginePluginRequestResponse(rsp *http.Response) (*GetProcessingEnginePluginRequestResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetProcessingEnginePluginRequestResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostProcessingEnginePluginRequestResponse parses an HTTP response from a PostProcessingEnginePluginRequestWithResponse call +func ParsePostProcessingEnginePluginRequestResponse(rsp *http.Response) (*PostProcessingEnginePluginRequestResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostProcessingEnginePluginRequestResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostTestSchedulingPluginResponse parses an HTTP response from a PostTestSchedulingPluginWithResponse call +func ParsePostTestSchedulingPluginResponse(rsp *http.Response) (*PostTestSchedulingPluginResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostTestSchedulingPluginResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostTestWALPluginResponse parses an HTTP response from a PostTestWALPluginWithResponse call +func ParsePostTestWALPluginResponse(rsp *http.Response) (*PostTestWALPluginResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostTestWALPluginResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParseGetExecuteInfluxQLQueryResponse parses an HTTP response from a GetExecuteInfluxQLQueryWithResponse call +func ParseGetExecuteInfluxQLQueryResponse(rsp *http.Response) (*GetExecuteInfluxQLQueryResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetExecuteInfluxQLQueryResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest QueryResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case rsp.StatusCode == 200: + // Content-type (text/csv) unsupported + + } + + return response, nil +} + +// ParsePostExecuteQueryInfluxQLResponse parses an HTTP response from a PostExecuteQueryInfluxQLWithResponse call +func ParsePostExecuteQueryInfluxQLResponse(rsp *http.Response) (*PostExecuteQueryInfluxQLResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostExecuteQueryInfluxQLResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest QueryResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case rsp.StatusCode == 200: + // Content-type (text/csv) unsupported + + } + + return response, nil +} + +// ParseGetExecuteQuerySQLResponse parses an HTTP response from a GetExecuteQuerySQLWithResponse call +func ParseGetExecuteQuerySQLResponse(rsp *http.Response) (*GetExecuteQuerySQLResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetExecuteQuerySQLResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest QueryResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case rsp.StatusCode == 200: + // Content-type (text/csv) unsupported + + } + + return response, nil +} + +// ParsePostExecuteQuerySQLResponse parses an HTTP response from a PostExecuteQuerySQLWithResponse call +func ParsePostExecuteQuerySQLResponse(rsp *http.Response) (*PostExecuteQuerySQLResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostExecuteQuerySQLResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest QueryResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case rsp.StatusCode == 200: + // Content-type (text/csv) unsupported + + } + + return response, nil +} + +// ParsePostWriteLPResponse parses an HTTP response from a PostWriteLPWithResponse call +func ParsePostWriteLPResponse(rsp *http.Response) (*PostWriteLPResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostWriteLPResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParseGetHealthResponse parses an HTTP response from a GetHealthWithResponse call +func ParseGetHealthResponse(rsp *http.Response) (*GetHealthResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetHealthResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseGetMetricsResponse parses an HTTP response from a GetMetricsWithResponse call +func ParseGetMetricsResponse(rsp *http.Response) (*GetMetricsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetMetricsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseGetPingResponse parses an HTTP response from a GetPingWithResponse call +func ParseGetPingResponse(rsp *http.Response) (*GetPingResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetPingResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest interface{} + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV1ExecuteQueryResponse parses an HTTP response from a GetV1ExecuteQueryWithResponse call +func ParseGetV1ExecuteQueryResponse(rsp *http.Response) (*GetV1ExecuteQueryResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV1ExecuteQueryResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest QueryResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case rsp.StatusCode == 200: + // Content-type (application/csv) unsupported + + } + + return response, nil +} + +// ParsePostExecuteV1QueryResponse parses an HTTP response from a PostExecuteV1QueryWithResponse call +func ParsePostExecuteV1QueryResponse(rsp *http.Response) (*PostExecuteV1QueryResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostExecuteV1QueryResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest QueryResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case rsp.StatusCode == 200: + // Content-type (application/csv) unsupported + + } + + return response, nil +} + +// ParsePostV1WriteResponse parses an HTTP response from a PostV1WriteWithResponse call +func ParsePostV1WriteResponse(rsp *http.Response) (*PostV1WriteResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostV1WriteResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} diff --git a/core/core.go b/core/core.go new file mode 100644 index 0000000..88f6d60 --- /dev/null +++ b/core/core.go @@ -0,0 +1,11 @@ +// Package core provides a Go client for the InfluxDB 3 Core API. +// +// This package contains generated types and client methods for interacting with +// InfluxDB 3 Core databases, tables, queries, and administrative functions. +// +// The InfluxDB HTTP API for InfluxDB 3 Core provides a programmatic interface for +// interacting with InfluxDB 3 Core databases and resources. +package core + +//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -generate types -o types.gen.go -package core ../specs/core/ref.yml +//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -generate client -o client.gen.go -package core ../specs/core/ref.yml diff --git a/core/types.gen.go b/core/types.gen.go new file mode 100644 index 0000000..6a96c23 --- /dev/null +++ b/core/types.gen.go @@ -0,0 +1,842 @@ +// Package core provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT. +package core + +import ( + "time" +) + +const ( + BearerAuthScopes = "BearerAuth.Scopes" +) + +// Defines values for ContentEncoding. +const ( + ContentEncodingGzip ContentEncoding = "gzip" + ContentEncodingIdentity ContentEncoding = "identity" +) + +// Defines values for CreateTableRequestFieldsType. +const ( + Bool CreateTableRequestFieldsType = "bool" + Float64 CreateTableRequestFieldsType = "float64" + Int64 CreateTableRequestFieldsType = "int64" + Uint64 CreateTableRequestFieldsType = "uint64" + Utf8 CreateTableRequestFieldsType = "utf8" +) + +// Defines values for EpochCompatibility. +const ( + EpochCompatibilityH EpochCompatibility = "h" + EpochCompatibilityM EpochCompatibility = "m" + EpochCompatibilityMs EpochCompatibility = "ms" + EpochCompatibilityNs EpochCompatibility = "ns" + EpochCompatibilityS EpochCompatibility = "s" + EpochCompatibilityU EpochCompatibility = "u" + EpochCompatibilityฮœ EpochCompatibility = "ยต" +) + +// Defines values for Format. +const ( + FormatCsv Format = "csv" + FormatJson Format = "json" + FormatJsonl Format = "jsonl" + FormatParquet Format = "parquet" +) + +// Defines values for LineProtocol. +const ( + Textplain LineProtocol = "text/plain" + TextplainCharsetUtf8 LineProtocol = "text/plain; charset=utf-8" +) + +// Defines values for PrecisionWrite. +const ( + Auto PrecisionWrite = "auto" + Microsecond PrecisionWrite = "microsecond" + Millisecond PrecisionWrite = "millisecond" + Nanosecond PrecisionWrite = "nanosecond" + Second PrecisionWrite = "second" +) + +// Defines values for PrecisionWriteCompatibility. +const ( + PrecisionWriteCompatibilityMs PrecisionWriteCompatibility = "ms" + PrecisionWriteCompatibilityNs PrecisionWriteCompatibility = "ns" + PrecisionWriteCompatibilityS PrecisionWriteCompatibility = "s" + PrecisionWriteCompatibilityUs PrecisionWriteCompatibility = "us" +) + +// Defines values for QueryRequestObjectFormat. +const ( + QueryRequestObjectFormatCsv QueryRequestObjectFormat = "csv" + QueryRequestObjectFormatJson QueryRequestObjectFormat = "json" + QueryRequestObjectFormatJsonl QueryRequestObjectFormat = "jsonl" + QueryRequestObjectFormatParquet QueryRequestObjectFormat = "parquet" + QueryRequestObjectFormatPretty QueryRequestObjectFormat = "pretty" +) + +// Defines values for AcceptQueryHeader. +const ( + AcceptQueryHeaderApplicationjson AcceptQueryHeader = "application/json" + AcceptQueryHeaderApplicationjsonl AcceptQueryHeader = "application/jsonl" + AcceptQueryHeaderApplicationvndApacheParquet AcceptQueryHeader = "application/vnd.apache.parquet" + AcceptQueryHeaderTextcsv AcceptQueryHeader = "text/csv" +) + +// Defines values for ContentType. +const ( + ContentTypeApplicationjson ContentType = "application/json" +) + +// Defines values for PostV2WriteParamsContentEncoding. +const ( + PostV2WriteParamsContentEncodingGzip PostV2WriteParamsContentEncoding = "gzip" + PostV2WriteParamsContentEncodingIdentity PostV2WriteParamsContentEncoding = "identity" +) + +// Defines values for PostV2WriteParamsAccept. +const ( + PostV2WriteParamsAcceptApplicationjson PostV2WriteParamsAccept = "application/json" +) + +// Defines values for PostInstallPluginPackagesParamsContentType. +const ( + PostInstallPluginPackagesParamsContentTypeApplicationjson PostInstallPluginPackagesParamsContentType = "application/json" +) + +// Defines values for PostInstallPluginRequirementsParamsContentType. +const ( + PostInstallPluginRequirementsParamsContentTypeApplicationjson PostInstallPluginRequirementsParamsContentType = "application/json" +) + +// Defines values for PostDisableProcessingEngineTriggerParamsContentType. +const ( + PostDisableProcessingEngineTriggerParamsContentTypeApplicationjson PostDisableProcessingEngineTriggerParamsContentType = "application/json" +) + +// Defines values for PostEnableProcessingEngineTriggerParamsContentType. +const ( + PostEnableProcessingEngineTriggerParamsContentTypeApplicationjson PostEnableProcessingEngineTriggerParamsContentType = "application/json" +) + +// Defines values for PostProcessingEnginePluginRequestParamsContentType. +const ( + PostProcessingEnginePluginRequestParamsContentTypeApplicationjson PostProcessingEnginePluginRequestParamsContentType = "application/json" +) + +// Defines values for GetExecuteInfluxQLQueryParamsAccept. +const ( + GetExecuteInfluxQLQueryParamsAcceptApplicationjson GetExecuteInfluxQLQueryParamsAccept = "application/json" + GetExecuteInfluxQLQueryParamsAcceptApplicationjsonl GetExecuteInfluxQLQueryParamsAccept = "application/jsonl" + GetExecuteInfluxQLQueryParamsAcceptApplicationvndApacheParquet GetExecuteInfluxQLQueryParamsAccept = "application/vnd.apache.parquet" + GetExecuteInfluxQLQueryParamsAcceptTextcsv GetExecuteInfluxQLQueryParamsAccept = "text/csv" +) + +// Defines values for PostExecuteQueryInfluxQLParamsAccept. +const ( + PostExecuteQueryInfluxQLParamsAcceptApplicationjson PostExecuteQueryInfluxQLParamsAccept = "application/json" + PostExecuteQueryInfluxQLParamsAcceptApplicationjsonl PostExecuteQueryInfluxQLParamsAccept = "application/jsonl" + PostExecuteQueryInfluxQLParamsAcceptApplicationvndApacheParquet PostExecuteQueryInfluxQLParamsAccept = "application/vnd.apache.parquet" + PostExecuteQueryInfluxQLParamsAcceptTextcsv PostExecuteQueryInfluxQLParamsAccept = "text/csv" +) + +// Defines values for PostExecuteQueryInfluxQLParamsContentType. +const ( + PostExecuteQueryInfluxQLParamsContentTypeApplicationjson PostExecuteQueryInfluxQLParamsContentType = "application/json" +) + +// Defines values for GetExecuteQuerySQLParamsAccept. +const ( + GetExecuteQuerySQLParamsAcceptApplicationjson GetExecuteQuerySQLParamsAccept = "application/json" + GetExecuteQuerySQLParamsAcceptApplicationjsonl GetExecuteQuerySQLParamsAccept = "application/jsonl" + GetExecuteQuerySQLParamsAcceptApplicationvndApacheParquet GetExecuteQuerySQLParamsAccept = "application/vnd.apache.parquet" + GetExecuteQuerySQLParamsAcceptTextcsv GetExecuteQuerySQLParamsAccept = "text/csv" +) + +// Defines values for GetExecuteQuerySQLParamsContentType. +const ( + GetExecuteQuerySQLParamsContentTypeApplicationjson GetExecuteQuerySQLParamsContentType = "application/json" +) + +// Defines values for PostExecuteQuerySQLParamsAccept. +const ( + PostExecuteQuerySQLParamsAcceptApplicationjson PostExecuteQuerySQLParamsAccept = "application/json" + PostExecuteQuerySQLParamsAcceptApplicationjsonl PostExecuteQuerySQLParamsAccept = "application/jsonl" + PostExecuteQuerySQLParamsAcceptApplicationvndApacheParquet PostExecuteQuerySQLParamsAccept = "application/vnd.apache.parquet" + PostExecuteQuerySQLParamsAcceptTextcsv PostExecuteQuerySQLParamsAccept = "text/csv" +) + +// Defines values for PostExecuteQuerySQLParamsContentType. +const ( + PostExecuteQuerySQLParamsContentTypeApplicationjson PostExecuteQuerySQLParamsContentType = "application/json" +) + +// Defines values for PostWriteLPParamsAccept. +const ( + PostWriteLPParamsAcceptApplicationjson PostWriteLPParamsAccept = "application/json" +) + +// Defines values for GetV1ExecuteQueryParamsAccept. +const ( + GetV1ExecuteQueryParamsAcceptApplicationcsv GetV1ExecuteQueryParamsAccept = "application/csv" + GetV1ExecuteQueryParamsAcceptApplicationjson GetV1ExecuteQueryParamsAccept = "application/json" + GetV1ExecuteQueryParamsAcceptTextcsv GetV1ExecuteQueryParamsAccept = "text/csv" +) + +// Defines values for PostExecuteV1QueryParamsAccept. +const ( + PostExecuteV1QueryParamsAcceptApplicationcsv PostExecuteV1QueryParamsAccept = "application/csv" + PostExecuteV1QueryParamsAcceptApplicationjson PostExecuteV1QueryParamsAccept = "application/json" + PostExecuteV1QueryParamsAcceptTextcsv PostExecuteV1QueryParamsAccept = "text/csv" +) + +// Defines values for PostExecuteV1QueryJSONBodyEpoch. +const ( + H PostExecuteV1QueryJSONBodyEpoch = "h" + M PostExecuteV1QueryJSONBodyEpoch = "m" + Ms PostExecuteV1QueryJSONBodyEpoch = "ms" + Ns PostExecuteV1QueryJSONBodyEpoch = "ns" + S PostExecuteV1QueryJSONBodyEpoch = "s" + U PostExecuteV1QueryJSONBodyEpoch = "u" + ฮœ PostExecuteV1QueryJSONBodyEpoch = "ยต" +) + +// Defines values for PostV1WriteParamsAccept. +const ( + Applicationjson PostV1WriteParamsAccept = "application/json" +) + +// AcceptPartial Accept partial writes. +type AcceptPartial = bool + +// AdminTokenObject defines model for AdminTokenObject. +type AdminTokenObject struct { + CreatedAt *time.Time `json:"created_at,omitempty"` + Expiry *interface{} `json:"expiry,omitempty"` + Hash *string `json:"hash,omitempty"` + Id *int `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Token *string `json:"token,omitempty"` +} + +// ContentEncoding Content coding. +// Use `gzip` for compressed data or `identity` for unmodified, uncompressed data. +type ContentEncoding string + +// ContentLength The length in decimal number of octets. +type ContentLength = int + +// CreateDatabaseRequest defines model for CreateDatabaseRequest. +type CreateDatabaseRequest struct { + Db string `json:"db"` +} + +// CreateTableRequest defines model for CreateTableRequest. +type CreateTableRequest struct { + Db string `json:"db"` + Fields *[]struct { + Name string `json:"name"` + Type CreateTableRequestFieldsType `json:"type"` + } `json:"fields,omitempty"` + Table string `json:"table"` + Tags []string `json:"tags"` +} + +// CreateTableRequestFieldsType defines model for CreateTableRequest.Fields.Type. +type CreateTableRequestFieldsType string + +// DistinctCacheCreateRequest defines model for DistinctCacheCreateRequest. +type DistinctCacheCreateRequest struct { + Columns []string `json:"columns"` + Db string `json:"db"` + + // MaxAge Optional maximum age in seconds. + MaxAge *int `json:"max_age,omitempty"` + + // MaxCardinality Optional maximum cardinality. + MaxCardinality *int `json:"max_cardinality,omitempty"` + + // Name Optional cache name. + Name *string `json:"name,omitempty"` + Table string `json:"table"` +} + +// EpochCompatibility A unix timestamp precision. +// - `h` for hours +// - `m` for minutes +// - `s` for seconds +// - `ms` for milliseconds +// - `u` or `ยต` for microseconds +// - `ns` for nanoseconds +type EpochCompatibility string + +// ErrorMessage defines model for ErrorMessage. +type ErrorMessage struct { + Data *map[string]interface{} `json:"data"` + Error *string `json:"error,omitempty"` +} + +// Format The format of data in the response body. +type Format string + +// LastCacheCreateRequest defines model for LastCacheCreateRequest. +type LastCacheCreateRequest struct { + // Count Optional count. + Count *int `json:"count,omitempty"` + Db string `json:"db"` + + // KeyColumns Optional list of key columns. + KeyColumns *[]string `json:"key_columns,omitempty"` + + // Name Optional cache name. + Name *string `json:"name,omitempty"` + Table string `json:"table"` + + // Ttl Optional time-to-live in seconds. + Ttl *int `json:"ttl,omitempty"` + + // ValueColumns Optional list of value columns. + ValueColumns *[]string `json:"value_columns,omitempty"` +} + +// LineProtocol `text/plain` is the content type for line protocol. `UTF-8` is the default character set. +type LineProtocol string + +// NoSync Acknowledges a successful write without waiting for WAL persistence. +// +// #### Related +// +// - [Use the HTTP API and client libraries to write data](/influxdb3/core/write-data/api-client-libraries/) +// - [Data durability](/influxdb3/core/reference/internals/durability/) +type NoSync = bool + +// PrecisionWrite The precision for unix timestamps in the line protocol batch. +type PrecisionWrite string + +// PrecisionWriteCompatibility The precision for unix timestamps in the line protocol batch. +// Use `ms` for milliseconds, `s` for seconds, `us` for microseconds, or `ns` for nanoseconds. +type PrecisionWriteCompatibility string + +// ProcessingEngineTriggerRequest defines model for ProcessingEngineTriggerRequest. +type ProcessingEngineTriggerRequest struct { + Db string `json:"db"` + + // Disabled Whether the trigger is disabled. + Disabled *bool `json:"disabled,omitempty"` + + // PluginFilename The path and filename of the plugin to execute--for example, + // `schedule.py` or `endpoints/report.py`. + // The path can be absolute or relative to the `--plugins-dir` directory configured when starting InfluxDB 3. + // + // The plugin file must implement the trigger interface associated with the trigger's specification (`trigger_spec`). + PluginFilename string `json:"plugin_filename"` + + // TriggerArguments Optional arguments passed to the plugin. + TriggerArguments *map[string]interface{} `json:"trigger_arguments,omitempty"` + TriggerName string `json:"trigger_name"` + + // TriggerSpecification Specifies when and how the processing engine trigger should be invoked. + // + // ## Supported trigger specifications: + // + // ### Cron-based scheduling + // Format: `cron:CRON_EXPRESSION` + // + // Uses extended (6-field) cron format (second minute hour day_of_month month day_of_week): + // ``` + // โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ second (0-59) + // โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ minute (0-59) + // โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ hour (0-23) + // โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ day of month (1-31) + // โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ month (1-12) + // โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ day of week (0-6, Sunday=0) + // โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ + // * * * * * * + // ``` + // Examples: + // - `cron:0 0 6 * * 1-5` - Every weekday at 6:00 AM + // - `cron:0 30 14 * * 5` - Every Friday at 2:30 PM + // - `cron:0 0 0 1 * *` - First day of every month at midnight + // + // ### Interval-based scheduling + // Format: `every:DURATION` + // + // Supported durations: `s` (seconds), `m` (minutes), `h` (hours), `d` (days): + // - `every:30s` - Every 30 seconds + // - `every:5m` - Every 5 minutes + // - `every:1h` - Every hour + // - `every:1d` - Every day + // + // ### Table-based triggers + // - `all_tables` - Triggers on write events to any table in the database + // - `table:TABLE_NAME` - Triggers on write events to a specific table + // + // ### On-demand triggers + // Format: `path:ENDPOINT_NAME` + // + // Creates an HTTP endpoint `/api/v3/engine/ENDPOINT_NAME` for manual invocation: + // - `path:hello-world` - Creates endpoint `/api/v3/engine/hello-world` + // - `path:data-export` - Creates endpoint `/api/v3/engine/data-export` + TriggerSpecification string `json:"trigger_specification"` +} + +// QueryRequestObject defines model for QueryRequestObject. +type QueryRequestObject struct { + // Database The name of the database to query. + // Required if the query (`query_str`) doesn't specify the database. + Database string `json:"database"` + + // Format The format of the query results. + Format *QueryRequestObjectFormat `json:"format,omitempty"` + + // Params Additional parameters for the query. + // Use this field to pass query parameters. + Params *map[string]interface{} `json:"params,omitempty"` + + // QueryStr The query to execute. + QueryStr string `json:"query_str"` +} + +// QueryRequestObjectFormat The format of the query results. +type QueryRequestObjectFormat string + +// QueryResponse defines model for QueryResponse. +type QueryResponse struct { + Results *[]map[string]interface{} `json:"results,omitempty"` +} + +// ShowDatabasesResponse defines model for ShowDatabasesResponse. +type ShowDatabasesResponse struct { + Databases *[]string `json:"databases,omitempty"` +} + +// AcceptQueryHeader defines model for AcceptQueryHeader. +type AcceptQueryHeader string + +// ContentType defines model for ContentType. +type ContentType string + +// CompatibilityPrecisionParam The precision for unix timestamps in the line protocol batch. +// Use `ms` for milliseconds, `s` for seconds, `us` for microseconds, or `ns` for nanoseconds. +type CompatibilityPrecisionParam = PrecisionWriteCompatibility + +// Db defines model for db. +type Db = string + +// DbQueryParam defines model for dbQueryParam. +type DbQueryParam = string + +// DbWriteParam defines model for dbWriteParam. +type DbWriteParam = string + +// FormatRequired The format of data in the response body. +type FormatRequired = Format + +// PrecisionParam The precision for unix timestamps in the line protocol batch. +type PrecisionParam = PrecisionWrite + +// QuerySqlParam defines model for querySqlParam. +type QuerySqlParam = string + +// Unauthorized defines model for Unauthorized. +type Unauthorized = ErrorMessage + +// QueryRequestBody defines model for queryRequestBody. +type QueryRequestBody = QueryRequestObject + +// PostV2WriteTextBody defines parameters for PostV2Write. +type PostV2WriteTextBody = string + +// PostV2WriteParams defines parameters for PostV2Write. +type PostV2WriteParams struct { + // Db A database name. + // InfluxDB creates the database if it doesn't already exist, and then + // writes all points in the batch to the database. + Db string `form:"db" json:"db"` + AcceptPartial *AcceptPartial `form:"accept_partial,omitempty" json:"accept_partial,omitempty"` + + // Precision The precision for unix timestamps in the line protocol batch. + Precision CompatibilityPrecisionParam `form:"precision" json:"precision"` + + // ContentType The content type of the request payload. + ContentType *LineProtocol `json:"Content-Type,omitempty"` + + // ContentEncoding The compression applied to the line protocol in the request payload. + // To send a gzip payload, pass `Content-Encoding: gzip` header. + ContentEncoding *PostV2WriteParamsContentEncoding `json:"Content-Encoding,omitempty"` + + // ContentLength The size of the entity-body, in bytes, sent to InfluxDB. + ContentLength *int `json:"Content-Length,omitempty"` + + // Accept The content type that the client can understand. + // Writes only return a response body if they fail (partially or completely)--for example, + // due to a syntax problem or type mismatch. + Accept *PostV2WriteParamsAccept `json:"Accept,omitempty"` +} + +// PostV2WriteParamsContentEncoding defines parameters for PostV2Write. +type PostV2WriteParamsContentEncoding string + +// PostV2WriteParamsAccept defines parameters for PostV2Write. +type PostV2WriteParamsAccept string + +// DeleteConfigureDatabaseParams defines parameters for DeleteConfigureDatabase. +type DeleteConfigureDatabaseParams struct { + // Db The name of the database. + Db Db `form:"db" json:"db"` +} + +// GetConfigureDatabaseParams defines parameters for GetConfigureDatabase. +type GetConfigureDatabaseParams struct { + Format FormatRequired `form:"format" json:"format"` +} + +// DeleteConfigureLastCacheParams defines parameters for DeleteConfigureLastCache. +type DeleteConfigureLastCacheParams struct { + // Db The name of the database. + Db Db `form:"db" json:"db"` + Table string `form:"table" json:"table"` + Name string `form:"name" json:"name"` +} + +// PostInstallPluginPackagesJSONBody defines parameters for PostInstallPluginPackages. +type PostInstallPluginPackagesJSONBody struct { + // Packages A list of Python package names to install. + // Can include version specifiers (e.g., "scipy==1.9.0"). + Packages []string `json:"packages"` +} + +// PostInstallPluginPackagesParams defines parameters for PostInstallPluginPackages. +type PostInstallPluginPackagesParams struct { + // ContentType The format of the data in the request body. + ContentType *PostInstallPluginPackagesParamsContentType `json:"Content-Type,omitempty"` +} + +// PostInstallPluginPackagesParamsContentType defines parameters for PostInstallPluginPackages. +type PostInstallPluginPackagesParamsContentType string + +// PostInstallPluginRequirementsJSONBody defines parameters for PostInstallPluginRequirements. +type PostInstallPluginRequirementsJSONBody struct { + // RequirementsLocation The path to the requirements file containing Python packages to install. + // Can be a relative path (relative to the plugin directory) or an absolute path. + RequirementsLocation string `json:"requirements_location"` +} + +// PostInstallPluginRequirementsParams defines parameters for PostInstallPluginRequirements. +type PostInstallPluginRequirementsParams struct { + // ContentType The format of the data in the request body. + ContentType *PostInstallPluginRequirementsParamsContentType `json:"Content-Type,omitempty"` +} + +// PostInstallPluginRequirementsParamsContentType defines parameters for PostInstallPluginRequirements. +type PostInstallPluginRequirementsParamsContentType string + +// DeleteConfigureProcessingEngineTriggerParams defines parameters for DeleteConfigureProcessingEngineTrigger. +type DeleteConfigureProcessingEngineTriggerParams struct { + // Db The name of the database. + Db Db `form:"db" json:"db"` + TriggerName string `form:"trigger_name" json:"trigger_name"` + Force *bool `form:"force,omitempty" json:"force,omitempty"` +} + +// PostDisableProcessingEngineTriggerParams defines parameters for PostDisableProcessingEngineTrigger. +type PostDisableProcessingEngineTriggerParams struct { + // ContentType The format of the data in the request body. + ContentType *PostDisableProcessingEngineTriggerParamsContentType `json:"Content-Type,omitempty"` +} + +// PostDisableProcessingEngineTriggerParamsContentType defines parameters for PostDisableProcessingEngineTrigger. +type PostDisableProcessingEngineTriggerParamsContentType string + +// PostEnableProcessingEngineTriggerParams defines parameters for PostEnableProcessingEngineTrigger. +type PostEnableProcessingEngineTriggerParams struct { + // ContentType The format of the data in the request body. + ContentType *PostEnableProcessingEngineTriggerParamsContentType `json:"Content-Type,omitempty"` +} + +// PostEnableProcessingEngineTriggerParamsContentType defines parameters for PostEnableProcessingEngineTrigger. +type PostEnableProcessingEngineTriggerParamsContentType string + +// DeleteConfigureTableParams defines parameters for DeleteConfigureTable. +type DeleteConfigureTableParams struct { + // Db The name of the database. + Db Db `form:"db" json:"db"` + Table string `form:"table" json:"table"` +} + +// PostProcessingEnginePluginRequestJSONBody defines parameters for PostProcessingEnginePluginRequest. +type PostProcessingEnginePluginRequestJSONBody map[string]interface{} + +// PostProcessingEnginePluginRequestParams defines parameters for PostProcessingEnginePluginRequest. +type PostProcessingEnginePluginRequestParams struct { + // ContentType The format of the data in the request body. + ContentType *PostProcessingEnginePluginRequestParamsContentType `json:"Content-Type,omitempty"` +} + +// PostProcessingEnginePluginRequestParamsContentType defines parameters for PostProcessingEnginePluginRequest. +type PostProcessingEnginePluginRequestParamsContentType string + +// GetExecuteInfluxQLQueryParams defines parameters for GetExecuteInfluxQLQuery. +type GetExecuteInfluxQLQueryParams struct { + // Db The name of the database. + // + // If you provide a query that specifies the database, you can omit the 'db' parameter from your request. + Db *DbQueryParam `form:"db,omitempty" json:"db,omitempty"` + Q string `form:"q" json:"q"` + Format *string `form:"format,omitempty" json:"format,omitempty"` + + // Accept The content type that the client can understand. + Accept *GetExecuteInfluxQLQueryParamsAccept `json:"Accept,omitempty"` +} + +// GetExecuteInfluxQLQueryParamsAccept defines parameters for GetExecuteInfluxQLQuery. +type GetExecuteInfluxQLQueryParamsAccept string + +// PostExecuteQueryInfluxQLParams defines parameters for PostExecuteQueryInfluxQL. +type PostExecuteQueryInfluxQLParams struct { + // Accept The content type that the client can understand. + Accept *PostExecuteQueryInfluxQLParamsAccept `json:"Accept,omitempty"` + + // ContentType The format of the data in the request body. + ContentType *PostExecuteQueryInfluxQLParamsContentType `json:"Content-Type,omitempty"` +} + +// PostExecuteQueryInfluxQLParamsAccept defines parameters for PostExecuteQueryInfluxQL. +type PostExecuteQueryInfluxQLParamsAccept string + +// PostExecuteQueryInfluxQLParamsContentType defines parameters for PostExecuteQueryInfluxQL. +type PostExecuteQueryInfluxQLParamsContentType string + +// GetExecuteQuerySQLParams defines parameters for GetExecuteQuerySQL. +type GetExecuteQuerySQLParams struct { + // Db The name of the database. + Db Db `form:"db" json:"db"` + + // Q The query to execute. + Q QuerySqlParam `form:"q" json:"q"` + Format *Format `form:"format,omitempty" json:"format,omitempty"` + + // Accept The content type that the client can understand. + Accept *GetExecuteQuerySQLParamsAccept `json:"Accept,omitempty"` + + // ContentType The format of the data in the request body. + ContentType *GetExecuteQuerySQLParamsContentType `json:"Content-Type,omitempty"` +} + +// GetExecuteQuerySQLParamsAccept defines parameters for GetExecuteQuerySQL. +type GetExecuteQuerySQLParamsAccept string + +// GetExecuteQuerySQLParamsContentType defines parameters for GetExecuteQuerySQL. +type GetExecuteQuerySQLParamsContentType string + +// PostExecuteQuerySQLParams defines parameters for PostExecuteQuerySQL. +type PostExecuteQuerySQLParams struct { + // Accept The content type that the client can understand. + Accept *PostExecuteQuerySQLParamsAccept `json:"Accept,omitempty"` + + // ContentType The format of the data in the request body. + ContentType *PostExecuteQuerySQLParamsContentType `json:"Content-Type,omitempty"` +} + +// PostExecuteQuerySQLParamsAccept defines parameters for PostExecuteQuerySQL. +type PostExecuteQuerySQLParamsAccept string + +// PostExecuteQuerySQLParamsContentType defines parameters for PostExecuteQuerySQL. +type PostExecuteQuerySQLParamsContentType string + +// PostWriteLPTextBody defines parameters for PostWriteLP. +type PostWriteLPTextBody = string + +// PostWriteLPParams defines parameters for PostWriteLP. +type PostWriteLPParams struct { + // Db The name of the database. + // InfluxDB creates the database if it doesn't already exist, and then + // writes all points in the batch to the database. + Db DbWriteParam `form:"db" json:"db"` + AcceptPartial *AcceptPartial `form:"accept_partial,omitempty" json:"accept_partial,omitempty"` + + // Precision The precision for unix timestamps in the line protocol batch. + Precision PrecisionParam `form:"precision" json:"precision"` + NoSync *NoSync `form:"no_sync,omitempty" json:"no_sync,omitempty"` + + // ContentType The content type of the request payload. + ContentType *LineProtocol `json:"Content-Type,omitempty"` + + // Accept The content type that the client can understand. + // Writes only return a response body if they fail (partially or completely)--for example, + // due to a syntax problem or type mismatch. + Accept *PostWriteLPParamsAccept `json:"Accept,omitempty"` + + // ContentEncoding The compression applied to the line protocol in the request payload. + // To send a gzip payload, pass `Content-Encoding: gzip` header. + ContentEncoding *ContentEncoding `json:"Content-Encoding,omitempty"` + + // ContentLength The size of the entity-body, in bytes, sent to InfluxDB. + ContentLength *ContentLength `json:"Content-Length,omitempty"` +} + +// PostWriteLPParamsAccept defines parameters for PostWriteLP. +type PostWriteLPParamsAccept string + +// GetV1ExecuteQueryParams defines parameters for GetV1ExecuteQuery. +type GetV1ExecuteQueryParams struct { + // Chunked If true, the response is divided into chunks of size `chunk_size`. + Chunked *bool `form:"chunked,omitempty" json:"chunked,omitempty"` + + // ChunkSize The number of records that will go into a chunk. + // This parameter is only used if `chunked=true`. + ChunkSize *int `form:"chunk_size,omitempty" json:"chunk_size,omitempty"` + + // Db The database to query. If not provided, the InfluxQL query string must specify the database. + Db *string `form:"db,omitempty" json:"db,omitempty"` + + // Pretty If true, the JSON response is formatted in a human-readable format. + Pretty *bool `form:"pretty,omitempty" json:"pretty,omitempty"` + + // Q The InfluxQL query string. + Q string `form:"q" json:"q"` + + // Epoch Formats timestamps as [unix (epoch) timestamps](/influxdb3/core/reference/glossary/#unix-timestamp) with the specified precision + // instead of [RFC3339 timestamps](/influxdb3/core/reference/glossary/#rfc3339-timestamp) with nanosecond precision. + Epoch *EpochCompatibility `form:"epoch,omitempty" json:"epoch,omitempty"` + + // Accept The content type that the client can understand. + // + // If `text/csv` is specified, the `Content-type` response header is `application/csv` and the response is formatted as CSV. + // + // Returns an error if the format is invalid or non-UTF8. + Accept *GetV1ExecuteQueryParamsAccept `json:"Accept,omitempty"` +} + +// GetV1ExecuteQueryParamsAccept defines parameters for GetV1ExecuteQuery. +type GetV1ExecuteQueryParamsAccept string + +// PostExecuteV1QueryJSONBody defines parameters for PostExecuteV1Query. +type PostExecuteV1QueryJSONBody struct { + // ChunkSize The number of records that will go into a chunk. + // This parameter is only used if `chunked=true`. + ChunkSize *int `json:"chunk_size,omitempty"` + + // Chunked If true, the response is divided into chunks of size `chunk_size`. + Chunked *bool `json:"chunked,omitempty"` + + // Db The database to query. If not provided, the InfluxQL query string must specify the database. + Db *string `json:"db,omitempty"` + + // Epoch A unix timestamp precision. + // + // - `h` for hours + // - `m` for minutes + // - `s` for seconds + // - `ms` for milliseconds + // - `u` or `ยต` for microseconds + // - `ns` for nanoseconds + // + // Formats timestamps as [unix (epoch) timestamps](/influxdb3/core/reference/glossary/#unix-timestamp) with the specified precision + // instead of [RFC3339 timestamps](/influxdb3/core/reference/glossary/#rfc3339-timestamp) with nanosecond precision. + Epoch *PostExecuteV1QueryJSONBodyEpoch `json:"epoch,omitempty"` + + // Pretty If true, the JSON response is formatted in a human-readable format. + Pretty *bool `json:"pretty,omitempty"` + + // Q The InfluxQL query string. + Q string `json:"q"` +} + +// PostExecuteV1QueryParams defines parameters for PostExecuteV1Query. +type PostExecuteV1QueryParams struct { + // Accept The content type that the client can understand. + // + // If `text/csv` is specified, the `Content-type` response header is `application/csv` and the response is formatted as CSV. + // + // Returns an error if the format is invalid or non-UTF8. + Accept *PostExecuteV1QueryParamsAccept `json:"Accept,omitempty"` +} + +// PostExecuteV1QueryParamsAccept defines parameters for PostExecuteV1Query. +type PostExecuteV1QueryParamsAccept string + +// PostExecuteV1QueryJSONBodyEpoch defines parameters for PostExecuteV1Query. +type PostExecuteV1QueryJSONBodyEpoch string + +// PostV1WriteTextBody defines parameters for PostV1Write. +type PostV1WriteTextBody = string + +// PostV1WriteParams defines parameters for PostV1Write. +type PostV1WriteParams struct { + // Db The name of the database. + // InfluxDB creates the database if it doesn't already exist, and then + // writes all points in the batch to the database. + Db DbWriteParam `form:"db" json:"db"` + + // Precision The precision for unix timestamps in the line protocol batch. + Precision CompatibilityPrecisionParam `form:"precision" json:"precision"` + + // ContentType The content type of the request payload. + ContentType *LineProtocol `json:"Content-Type,omitempty"` + + // Accept The content type that the client can understand. + // Writes only return a response body if they fail (partially or completely)--for example, + // due to a syntax problem or type mismatch. + Accept *PostV1WriteParamsAccept `json:"Accept,omitempty"` + + // ContentEncoding The compression applied to the line protocol in the request payload. + // To send a gzip payload, pass `Content-Encoding: gzip` header. + ContentEncoding *ContentEncoding `json:"Content-Encoding,omitempty"` + + // ContentLength The size of the entity-body, in bytes, sent to InfluxDB. + ContentLength *ContentLength `json:"Content-Length,omitempty"` +} + +// PostV1WriteParamsAccept defines parameters for PostV1Write. +type PostV1WriteParamsAccept string + +// PostV2WriteTextRequestBody defines body for PostV2Write for text/plain ContentType. +type PostV2WriteTextRequestBody = PostV2WriteTextBody + +// PostConfigureDatabaseJSONRequestBody defines body for PostConfigureDatabase for application/json ContentType. +type PostConfigureDatabaseJSONRequestBody = CreateDatabaseRequest + +// PostConfigureDistinctCacheJSONRequestBody defines body for PostConfigureDistinctCache for application/json ContentType. +type PostConfigureDistinctCacheJSONRequestBody = DistinctCacheCreateRequest + +// PostConfigureLastCacheJSONRequestBody defines body for PostConfigureLastCache for application/json ContentType. +type PostConfigureLastCacheJSONRequestBody = LastCacheCreateRequest + +// PostInstallPluginPackagesJSONRequestBody defines body for PostInstallPluginPackages for application/json ContentType. +type PostInstallPluginPackagesJSONRequestBody PostInstallPluginPackagesJSONBody + +// PostInstallPluginRequirementsJSONRequestBody defines body for PostInstallPluginRequirements for application/json ContentType. +type PostInstallPluginRequirementsJSONRequestBody PostInstallPluginRequirementsJSONBody + +// PostConfigureProcessingEngineTriggerJSONRequestBody defines body for PostConfigureProcessingEngineTrigger for application/json ContentType. +type PostConfigureProcessingEngineTriggerJSONRequestBody = ProcessingEngineTriggerRequest + +// PostDisableProcessingEngineTriggerJSONRequestBody defines body for PostDisableProcessingEngineTrigger for application/json ContentType. +type PostDisableProcessingEngineTriggerJSONRequestBody = ProcessingEngineTriggerRequest + +// PostEnableProcessingEngineTriggerJSONRequestBody defines body for PostEnableProcessingEngineTrigger for application/json ContentType. +type PostEnableProcessingEngineTriggerJSONRequestBody = ProcessingEngineTriggerRequest + +// PostConfigureTableJSONRequestBody defines body for PostConfigureTable for application/json ContentType. +type PostConfigureTableJSONRequestBody = CreateTableRequest + +// PostProcessingEnginePluginRequestJSONRequestBody defines body for PostProcessingEnginePluginRequest for application/json ContentType. +type PostProcessingEnginePluginRequestJSONRequestBody PostProcessingEnginePluginRequestJSONBody + +// PostExecuteQueryInfluxQLJSONRequestBody defines body for PostExecuteQueryInfluxQL for application/json ContentType. +type PostExecuteQueryInfluxQLJSONRequestBody = QueryRequestObject + +// PostExecuteQuerySQLJSONRequestBody defines body for PostExecuteQuerySQL for application/json ContentType. +type PostExecuteQuerySQLJSONRequestBody = QueryRequestObject + +// PostWriteLPTextRequestBody defines body for PostWriteLP for text/plain ContentType. +type PostWriteLPTextRequestBody = PostWriteLPTextBody + +// PostExecuteV1QueryJSONRequestBody defines body for PostExecuteV1Query for application/json ContentType. +type PostExecuteV1QueryJSONRequestBody PostExecuteV1QueryJSONBody + +// PostV1WriteTextRequestBody defines body for PostV1Write for text/plain ContentType. +type PostV1WriteTextRequestBody = PostV1WriteTextBody diff --git a/enterprise/client.gen.go b/enterprise/client.gen.go new file mode 100644 index 0000000..f96787f --- /dev/null +++ b/enterprise/client.gen.go @@ -0,0 +1,5079 @@ +// Package enterprise provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT. +package enterprise + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "strings" + + "github.com/oapi-codegen/runtime" +) + +// RequestEditorFn is the function signature for the RequestEditor callback function +type RequestEditorFn func(ctx context.Context, req *http.Request) error + +// Doer performs HTTP requests. +// +// The standard http.Client implements this interface. +type HttpRequestDoer interface { + Do(req *http.Request) (*http.Response, error) +} + +// Client which conforms to the OpenAPI3 specification for this service. +type Client struct { + // The endpoint of the server conforming to this interface, with scheme, + // https://api.deepmap.com for example. This can contain a path relative + // to the server, such as https://api.deepmap.com/dev-test, and all the + // paths in the swagger spec will be appended to the server. + Server string + + // Doer for performing requests, typically a *http.Client with any + // customized settings, such as certificate chains. + Client HttpRequestDoer + + // A list of callbacks for modifying requests which are generated before sending over + // the network. + RequestEditors []RequestEditorFn +} + +// ClientOption allows setting custom parameters during construction +type ClientOption func(*Client) error + +// Creates a new Client, with reasonable defaults +func NewClient(server string, opts ...ClientOption) (*Client, error) { + // create a client with sane default values + client := Client{ + Server: server, + } + // mutate client and add all optional params + for _, o := range opts { + if err := o(&client); err != nil { + return nil, err + } + } + // ensure the server URL always has a trailing slash + if !strings.HasSuffix(client.Server, "/") { + client.Server += "/" + } + // create httpClient, if not already present + if client.Client == nil { + client.Client = &http.Client{} + } + return &client, nil +} + +// WithHTTPClient allows overriding the default Doer, which is +// automatically created using http.Client. This is useful for tests. +func WithHTTPClient(doer HttpRequestDoer) ClientOption { + return func(c *Client) error { + c.Client = doer + return nil + } +} + +// WithRequestEditorFn allows setting up a callback function, which will be +// called right before sending the request. This can be used to mutate the request. +func WithRequestEditorFn(fn RequestEditorFn) ClientOption { + return func(c *Client) error { + c.RequestEditors = append(c.RequestEditors, fn) + return nil + } +} + +// The interface specification for the client above. +type ClientInterface interface { + // GetHealthV1 request + GetHealthV1(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV2WriteWithBody request with any body + PostV2WriteWithBody(ctx context.Context, params *PostV2WriteParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostV2WriteWithTextBody(ctx context.Context, params *PostV2WriteParams, body PostV2WriteTextRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteConfigureDatabase request + DeleteConfigureDatabase(ctx context.Context, params *DeleteConfigureDatabaseParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetConfigureDatabase request + GetConfigureDatabase(ctx context.Context, params *GetConfigureDatabaseParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostConfigureDatabaseWithBody request with any body + PostConfigureDatabaseWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostConfigureDatabase(ctx context.Context, body PostConfigureDatabaseJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostConfigureDistinctCacheWithBody request with any body + PostConfigureDistinctCacheWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostConfigureDistinctCache(ctx context.Context, body PostConfigureDistinctCacheJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostCreateResourceToken request + PostCreateResourceToken(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteConfigureLastCache request + DeleteConfigureLastCache(ctx context.Context, params *DeleteConfigureLastCacheParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostConfigureLastCacheWithBody request with any body + PostConfigureLastCacheWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostConfigureLastCache(ctx context.Context, body PostConfigureLastCacheJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostInstallPluginPackagesWithBody request with any body + PostInstallPluginPackagesWithBody(ctx context.Context, params *PostInstallPluginPackagesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostInstallPluginPackages(ctx context.Context, params *PostInstallPluginPackagesParams, body PostInstallPluginPackagesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostInstallPluginRequirementsWithBody request with any body + PostInstallPluginRequirementsWithBody(ctx context.Context, params *PostInstallPluginRequirementsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostInstallPluginRequirements(ctx context.Context, params *PostInstallPluginRequirementsParams, body PostInstallPluginRequirementsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteConfigureProcessingEngineTrigger request + DeleteConfigureProcessingEngineTrigger(ctx context.Context, params *DeleteConfigureProcessingEngineTriggerParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostConfigureProcessingEngineTriggerWithBody request with any body + PostConfigureProcessingEngineTriggerWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostConfigureProcessingEngineTrigger(ctx context.Context, body PostConfigureProcessingEngineTriggerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostDisableProcessingEngineTriggerWithBody request with any body + PostDisableProcessingEngineTriggerWithBody(ctx context.Context, params *PostDisableProcessingEngineTriggerParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostDisableProcessingEngineTrigger(ctx context.Context, params *PostDisableProcessingEngineTriggerParams, body PostDisableProcessingEngineTriggerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostEnableProcessingEngineTriggerWithBody request with any body + PostEnableProcessingEngineTriggerWithBody(ctx context.Context, params *PostEnableProcessingEngineTriggerParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostEnableProcessingEngineTrigger(ctx context.Context, params *PostEnableProcessingEngineTriggerParams, body PostEnableProcessingEngineTriggerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteConfigureTable request + DeleteConfigureTable(ctx context.Context, params *DeleteConfigureTableParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostConfigureTableWithBody request with any body + PostConfigureTableWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostConfigureTable(ctx context.Context, body PostConfigureTableJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostCreateAdminToken request + PostCreateAdminToken(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostRegenerateAdminToken request + PostRegenerateAdminToken(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetProcessingEnginePluginRequest request + GetProcessingEnginePluginRequest(ctx context.Context, pluginPath string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostProcessingEnginePluginRequestWithBody request with any body + PostProcessingEnginePluginRequestWithBody(ctx context.Context, pluginPath string, params *PostProcessingEnginePluginRequestParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostProcessingEnginePluginRequest(ctx context.Context, pluginPath string, params *PostProcessingEnginePluginRequestParams, body PostProcessingEnginePluginRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostTestSchedulingPlugin request + PostTestSchedulingPlugin(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostTestWALPlugin request + PostTestWALPlugin(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetExecuteInfluxQLQuery request + GetExecuteInfluxQLQuery(ctx context.Context, params *GetExecuteInfluxQLQueryParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostExecuteQueryInfluxQLWithBody request with any body + PostExecuteQueryInfluxQLWithBody(ctx context.Context, params *PostExecuteQueryInfluxQLParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostExecuteQueryInfluxQL(ctx context.Context, params *PostExecuteQueryInfluxQLParams, body PostExecuteQueryInfluxQLJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetExecuteQuerySQL request + GetExecuteQuerySQL(ctx context.Context, params *GetExecuteQuerySQLParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostExecuteQuerySQLWithBody request with any body + PostExecuteQuerySQLWithBody(ctx context.Context, params *PostExecuteQuerySQLParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostExecuteQuerySQL(ctx context.Context, params *PostExecuteQuerySQLParams, body PostExecuteQuerySQLJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostWriteLPWithBody request with any body + PostWriteLPWithBody(ctx context.Context, params *PostWriteLPParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostWriteLPWithTextBody(ctx context.Context, params *PostWriteLPParams, body PostWriteLPTextRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetHealth request + GetHealth(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetMetrics request + GetMetrics(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetPing request + GetPing(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetV1ExecuteQuery request + GetV1ExecuteQuery(ctx context.Context, params *GetV1ExecuteQueryParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostExecuteV1QueryWithBody request with any body + PostExecuteV1QueryWithBody(ctx context.Context, params *PostExecuteV1QueryParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostExecuteV1Query(ctx context.Context, params *PostExecuteV1QueryParams, body PostExecuteV1QueryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostV1WriteWithBody request with any body + PostV1WriteWithBody(ctx context.Context, params *PostV1WriteParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostV1WriteWithTextBody(ctx context.Context, params *PostV1WriteParams, body PostV1WriteTextRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +} + +func (c *Client) GetHealthV1(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetHealthV1Request(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostV2WriteWithBody(ctx context.Context, params *PostV2WriteParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV2WriteRequestWithBody(c.Server, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostV2WriteWithTextBody(ctx context.Context, params *PostV2WriteParams, body PostV2WriteTextRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV2WriteRequestWithTextBody(c.Server, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteConfigureDatabase(ctx context.Context, params *DeleteConfigureDatabaseParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteConfigureDatabaseRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetConfigureDatabase(ctx context.Context, params *GetConfigureDatabaseParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetConfigureDatabaseRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostConfigureDatabaseWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostConfigureDatabaseRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostConfigureDatabase(ctx context.Context, body PostConfigureDatabaseJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostConfigureDatabaseRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostConfigureDistinctCacheWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostConfigureDistinctCacheRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostConfigureDistinctCache(ctx context.Context, body PostConfigureDistinctCacheJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostConfigureDistinctCacheRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostCreateResourceToken(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostCreateResourceTokenRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteConfigureLastCache(ctx context.Context, params *DeleteConfigureLastCacheParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteConfigureLastCacheRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostConfigureLastCacheWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostConfigureLastCacheRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostConfigureLastCache(ctx context.Context, body PostConfigureLastCacheJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostConfigureLastCacheRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostInstallPluginPackagesWithBody(ctx context.Context, params *PostInstallPluginPackagesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostInstallPluginPackagesRequestWithBody(c.Server, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostInstallPluginPackages(ctx context.Context, params *PostInstallPluginPackagesParams, body PostInstallPluginPackagesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostInstallPluginPackagesRequest(c.Server, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostInstallPluginRequirementsWithBody(ctx context.Context, params *PostInstallPluginRequirementsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostInstallPluginRequirementsRequestWithBody(c.Server, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostInstallPluginRequirements(ctx context.Context, params *PostInstallPluginRequirementsParams, body PostInstallPluginRequirementsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostInstallPluginRequirementsRequest(c.Server, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteConfigureProcessingEngineTrigger(ctx context.Context, params *DeleteConfigureProcessingEngineTriggerParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteConfigureProcessingEngineTriggerRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostConfigureProcessingEngineTriggerWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostConfigureProcessingEngineTriggerRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostConfigureProcessingEngineTrigger(ctx context.Context, body PostConfigureProcessingEngineTriggerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostConfigureProcessingEngineTriggerRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostDisableProcessingEngineTriggerWithBody(ctx context.Context, params *PostDisableProcessingEngineTriggerParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostDisableProcessingEngineTriggerRequestWithBody(c.Server, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostDisableProcessingEngineTrigger(ctx context.Context, params *PostDisableProcessingEngineTriggerParams, body PostDisableProcessingEngineTriggerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostDisableProcessingEngineTriggerRequest(c.Server, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostEnableProcessingEngineTriggerWithBody(ctx context.Context, params *PostEnableProcessingEngineTriggerParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostEnableProcessingEngineTriggerRequestWithBody(c.Server, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostEnableProcessingEngineTrigger(ctx context.Context, params *PostEnableProcessingEngineTriggerParams, body PostEnableProcessingEngineTriggerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostEnableProcessingEngineTriggerRequest(c.Server, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteConfigureTable(ctx context.Context, params *DeleteConfigureTableParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteConfigureTableRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostConfigureTableWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostConfigureTableRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostConfigureTable(ctx context.Context, body PostConfigureTableJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostConfigureTableRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostCreateAdminToken(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostCreateAdminTokenRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostRegenerateAdminToken(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostRegenerateAdminTokenRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetProcessingEnginePluginRequest(ctx context.Context, pluginPath string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetProcessingEnginePluginRequestRequest(c.Server, pluginPath) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostProcessingEnginePluginRequestWithBody(ctx context.Context, pluginPath string, params *PostProcessingEnginePluginRequestParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostProcessingEnginePluginRequestRequestWithBody(c.Server, pluginPath, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostProcessingEnginePluginRequest(ctx context.Context, pluginPath string, params *PostProcessingEnginePluginRequestParams, body PostProcessingEnginePluginRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostProcessingEnginePluginRequestRequest(c.Server, pluginPath, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostTestSchedulingPlugin(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostTestSchedulingPluginRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostTestWALPlugin(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostTestWALPluginRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetExecuteInfluxQLQuery(ctx context.Context, params *GetExecuteInfluxQLQueryParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetExecuteInfluxQLQueryRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostExecuteQueryInfluxQLWithBody(ctx context.Context, params *PostExecuteQueryInfluxQLParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostExecuteQueryInfluxQLRequestWithBody(c.Server, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostExecuteQueryInfluxQL(ctx context.Context, params *PostExecuteQueryInfluxQLParams, body PostExecuteQueryInfluxQLJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostExecuteQueryInfluxQLRequest(c.Server, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetExecuteQuerySQL(ctx context.Context, params *GetExecuteQuerySQLParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetExecuteQuerySQLRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostExecuteQuerySQLWithBody(ctx context.Context, params *PostExecuteQuerySQLParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostExecuteQuerySQLRequestWithBody(c.Server, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostExecuteQuerySQL(ctx context.Context, params *PostExecuteQuerySQLParams, body PostExecuteQuerySQLJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostExecuteQuerySQLRequest(c.Server, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostWriteLPWithBody(ctx context.Context, params *PostWriteLPParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostWriteLPRequestWithBody(c.Server, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostWriteLPWithTextBody(ctx context.Context, params *PostWriteLPParams, body PostWriteLPTextRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostWriteLPRequestWithTextBody(c.Server, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetHealth(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetHealthRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetMetrics(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetMetricsRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetPing(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetPingRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetV1ExecuteQuery(ctx context.Context, params *GetV1ExecuteQueryParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetV1ExecuteQueryRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostExecuteV1QueryWithBody(ctx context.Context, params *PostExecuteV1QueryParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostExecuteV1QueryRequestWithBody(c.Server, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostExecuteV1Query(ctx context.Context, params *PostExecuteV1QueryParams, body PostExecuteV1QueryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostExecuteV1QueryRequest(c.Server, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostV1WriteWithBody(ctx context.Context, params *PostV1WriteParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV1WriteRequestWithBody(c.Server, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostV1WriteWithTextBody(ctx context.Context, params *PostV1WriteParams, body PostV1WriteTextRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostV1WriteRequestWithTextBody(c.Server, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// NewGetHealthV1Request generates requests for GetHealthV1 +func NewGetHealthV1Request(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v1/health") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostV2WriteRequestWithTextBody calls the generic PostV2Write builder with text/plain body +func NewPostV2WriteRequestWithTextBody(server string, params *PostV2WriteParams, body PostV2WriteTextRequestBody) (*http.Request, error) { + var bodyReader io.Reader + bodyReader = strings.NewReader(string(body)) + return NewPostV2WriteRequestWithBody(server, params, "text/plain", bodyReader) +} + +// NewPostV2WriteRequestWithBody generates requests for PostV2Write with any type of body +func NewPostV2WriteRequestWithBody(server string, params *PostV2WriteParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v2/write") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "db", runtime.ParamLocationQuery, params.Db); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if params.AcceptPartial != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "accept_partial", runtime.ParamLocationQuery, *params.AcceptPartial); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "precision", runtime.ParamLocationQuery, params.Precision); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.ContentType != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Content-Type", runtime.ParamLocationHeader, *params.ContentType) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Type", headerParam0) + } + + if params.ContentEncoding != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Content-Encoding", runtime.ParamLocationHeader, *params.ContentEncoding) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Encoding", headerParam1) + } + + if params.ContentLength != nil { + var headerParam2 string + + headerParam2, err = runtime.StyleParamWithLocation("simple", false, "Content-Length", runtime.ParamLocationHeader, *params.ContentLength) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Length", headerParam2) + } + + if params.Accept != nil { + var headerParam3 string + + headerParam3, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam3) + } + + } + + return req, nil +} + +// NewDeleteConfigureDatabaseRequest generates requests for DeleteConfigureDatabase +func NewDeleteConfigureDatabaseRequest(server string, params *DeleteConfigureDatabaseParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/database") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "db", runtime.ParamLocationQuery, params.Db); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetConfigureDatabaseRequest generates requests for GetConfigureDatabase +func NewGetConfigureDatabaseRequest(server string, params *GetConfigureDatabaseParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/database") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "format", runtime.ParamLocationQuery, params.Format); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostConfigureDatabaseRequest calls the generic PostConfigureDatabase builder with application/json body +func NewPostConfigureDatabaseRequest(server string, body PostConfigureDatabaseJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostConfigureDatabaseRequestWithBody(server, "application/json", bodyReader) +} + +// NewPostConfigureDatabaseRequestWithBody generates requests for PostConfigureDatabase with any type of body +func NewPostConfigureDatabaseRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/database") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewPostConfigureDistinctCacheRequest calls the generic PostConfigureDistinctCache builder with application/json body +func NewPostConfigureDistinctCacheRequest(server string, body PostConfigureDistinctCacheJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostConfigureDistinctCacheRequestWithBody(server, "application/json", bodyReader) +} + +// NewPostConfigureDistinctCacheRequestWithBody generates requests for PostConfigureDistinctCache with any type of body +func NewPostConfigureDistinctCacheRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/distinct_cache") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewPostCreateResourceTokenRequest generates requests for PostCreateResourceToken +func NewPostCreateResourceTokenRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/enterprise/token") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewDeleteConfigureLastCacheRequest generates requests for DeleteConfigureLastCache +func NewDeleteConfigureLastCacheRequest(server string, params *DeleteConfigureLastCacheParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/last_cache") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "db", runtime.ParamLocationQuery, params.Db); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "table", runtime.ParamLocationQuery, params.Table); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "name", runtime.ParamLocationQuery, params.Name); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostConfigureLastCacheRequest calls the generic PostConfigureLastCache builder with application/json body +func NewPostConfigureLastCacheRequest(server string, body PostConfigureLastCacheJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostConfigureLastCacheRequestWithBody(server, "application/json", bodyReader) +} + +// NewPostConfigureLastCacheRequestWithBody generates requests for PostConfigureLastCache with any type of body +func NewPostConfigureLastCacheRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/last_cache") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewPostInstallPluginPackagesRequest calls the generic PostInstallPluginPackages builder with application/json body +func NewPostInstallPluginPackagesRequest(server string, params *PostInstallPluginPackagesParams, body PostInstallPluginPackagesJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostInstallPluginPackagesRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostInstallPluginPackagesRequestWithBody generates requests for PostInstallPluginPackages with any type of body +func NewPostInstallPluginPackagesRequestWithBody(server string, params *PostInstallPluginPackagesParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/plugin_environment/install_packages") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.ContentType != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Content-Type", runtime.ParamLocationHeader, *params.ContentType) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Type", headerParam0) + } + + } + + return req, nil +} + +// NewPostInstallPluginRequirementsRequest calls the generic PostInstallPluginRequirements builder with application/json body +func NewPostInstallPluginRequirementsRequest(server string, params *PostInstallPluginRequirementsParams, body PostInstallPluginRequirementsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostInstallPluginRequirementsRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostInstallPluginRequirementsRequestWithBody generates requests for PostInstallPluginRequirements with any type of body +func NewPostInstallPluginRequirementsRequestWithBody(server string, params *PostInstallPluginRequirementsParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/plugin_environment/install_requirements") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.ContentType != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Content-Type", runtime.ParamLocationHeader, *params.ContentType) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Type", headerParam0) + } + + } + + return req, nil +} + +// NewDeleteConfigureProcessingEngineTriggerRequest generates requests for DeleteConfigureProcessingEngineTrigger +func NewDeleteConfigureProcessingEngineTriggerRequest(server string, params *DeleteConfigureProcessingEngineTriggerParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/processing_engine_trigger") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "db", runtime.ParamLocationQuery, params.Db); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "trigger_name", runtime.ParamLocationQuery, params.TriggerName); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if params.Force != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "force", runtime.ParamLocationQuery, *params.Force); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostConfigureProcessingEngineTriggerRequest calls the generic PostConfigureProcessingEngineTrigger builder with application/json body +func NewPostConfigureProcessingEngineTriggerRequest(server string, body PostConfigureProcessingEngineTriggerJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostConfigureProcessingEngineTriggerRequestWithBody(server, "application/json", bodyReader) +} + +// NewPostConfigureProcessingEngineTriggerRequestWithBody generates requests for PostConfigureProcessingEngineTrigger with any type of body +func NewPostConfigureProcessingEngineTriggerRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/processing_engine_trigger") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewPostDisableProcessingEngineTriggerRequest calls the generic PostDisableProcessingEngineTrigger builder with application/json body +func NewPostDisableProcessingEngineTriggerRequest(server string, params *PostDisableProcessingEngineTriggerParams, body PostDisableProcessingEngineTriggerJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostDisableProcessingEngineTriggerRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostDisableProcessingEngineTriggerRequestWithBody generates requests for PostDisableProcessingEngineTrigger with any type of body +func NewPostDisableProcessingEngineTriggerRequestWithBody(server string, params *PostDisableProcessingEngineTriggerParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/processing_engine_trigger/disable") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.ContentType != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Content-Type", runtime.ParamLocationHeader, *params.ContentType) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Type", headerParam0) + } + + } + + return req, nil +} + +// NewPostEnableProcessingEngineTriggerRequest calls the generic PostEnableProcessingEngineTrigger builder with application/json body +func NewPostEnableProcessingEngineTriggerRequest(server string, params *PostEnableProcessingEngineTriggerParams, body PostEnableProcessingEngineTriggerJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostEnableProcessingEngineTriggerRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostEnableProcessingEngineTriggerRequestWithBody generates requests for PostEnableProcessingEngineTrigger with any type of body +func NewPostEnableProcessingEngineTriggerRequestWithBody(server string, params *PostEnableProcessingEngineTriggerParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/processing_engine_trigger/enable") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.ContentType != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Content-Type", runtime.ParamLocationHeader, *params.ContentType) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Type", headerParam0) + } + + } + + return req, nil +} + +// NewDeleteConfigureTableRequest generates requests for DeleteConfigureTable +func NewDeleteConfigureTableRequest(server string, params *DeleteConfigureTableParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/table") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "db", runtime.ParamLocationQuery, params.Db); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "table", runtime.ParamLocationQuery, params.Table); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostConfigureTableRequest calls the generic PostConfigureTable builder with application/json body +func NewPostConfigureTableRequest(server string, body PostConfigureTableJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostConfigureTableRequestWithBody(server, "application/json", bodyReader) +} + +// NewPostConfigureTableRequestWithBody generates requests for PostConfigureTable with any type of body +func NewPostConfigureTableRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/table") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewPostCreateAdminTokenRequest generates requests for PostCreateAdminToken +func NewPostCreateAdminTokenRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/token/admin") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostRegenerateAdminTokenRequest generates requests for PostRegenerateAdminToken +func NewPostRegenerateAdminTokenRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/configure/token/admin/regenerate") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetProcessingEnginePluginRequestRequest generates requests for GetProcessingEnginePluginRequest +func NewGetProcessingEnginePluginRequestRequest(server string, pluginPath string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "plugin_path", runtime.ParamLocationPath, pluginPath) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/engine/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostProcessingEnginePluginRequestRequest calls the generic PostProcessingEnginePluginRequest builder with application/json body +func NewPostProcessingEnginePluginRequestRequest(server string, pluginPath string, params *PostProcessingEnginePluginRequestParams, body PostProcessingEnginePluginRequestJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostProcessingEnginePluginRequestRequestWithBody(server, pluginPath, params, "application/json", bodyReader) +} + +// NewPostProcessingEnginePluginRequestRequestWithBody generates requests for PostProcessingEnginePluginRequest with any type of body +func NewPostProcessingEnginePluginRequestRequestWithBody(server string, pluginPath string, params *PostProcessingEnginePluginRequestParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "plugin_path", runtime.ParamLocationPath, pluginPath) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/engine/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.ContentType != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Content-Type", runtime.ParamLocationHeader, *params.ContentType) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Type", headerParam0) + } + + } + + return req, nil +} + +// NewPostTestSchedulingPluginRequest generates requests for PostTestSchedulingPlugin +func NewPostTestSchedulingPluginRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/plugin_test/schedule") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostTestWALPluginRequest generates requests for PostTestWALPlugin +func NewPostTestWALPluginRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/plugin_test/wal") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetExecuteInfluxQLQueryRequest generates requests for GetExecuteInfluxQLQuery +func NewGetExecuteInfluxQLQueryRequest(server string, params *GetExecuteInfluxQLQueryParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/query_influxql") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Db != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "db", runtime.ParamLocationQuery, *params.Db); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "q", runtime.ParamLocationQuery, params.Q); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if params.Format != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "format", runtime.ParamLocationQuery, *params.Format); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + if params != nil { + + if params.Accept != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam0) + } + + } + + return req, nil +} + +// NewPostExecuteQueryInfluxQLRequest calls the generic PostExecuteQueryInfluxQL builder with application/json body +func NewPostExecuteQueryInfluxQLRequest(server string, params *PostExecuteQueryInfluxQLParams, body PostExecuteQueryInfluxQLJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostExecuteQueryInfluxQLRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostExecuteQueryInfluxQLRequestWithBody generates requests for PostExecuteQueryInfluxQL with any type of body +func NewPostExecuteQueryInfluxQLRequestWithBody(server string, params *PostExecuteQueryInfluxQLParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/query_influxql") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.Accept != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam0) + } + + if params.ContentType != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Content-Type", runtime.ParamLocationHeader, *params.ContentType) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Type", headerParam1) + } + + } + + return req, nil +} + +// NewGetExecuteQuerySQLRequest generates requests for GetExecuteQuerySQL +func NewGetExecuteQuerySQLRequest(server string, params *GetExecuteQuerySQLParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/query_sql") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "db", runtime.ParamLocationQuery, params.Db); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "q", runtime.ParamLocationQuery, params.Q); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if params.Format != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "format", runtime.ParamLocationQuery, *params.Format); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + if params != nil { + + if params.Accept != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam0) + } + + if params.ContentType != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Content-Type", runtime.ParamLocationHeader, *params.ContentType) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Type", headerParam1) + } + + } + + return req, nil +} + +// NewPostExecuteQuerySQLRequest calls the generic PostExecuteQuerySQL builder with application/json body +func NewPostExecuteQuerySQLRequest(server string, params *PostExecuteQuerySQLParams, body PostExecuteQuerySQLJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostExecuteQuerySQLRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostExecuteQuerySQLRequestWithBody generates requests for PostExecuteQuerySQL with any type of body +func NewPostExecuteQuerySQLRequestWithBody(server string, params *PostExecuteQuerySQLParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/query_sql") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.Accept != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam0) + } + + if params.ContentType != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Content-Type", runtime.ParamLocationHeader, *params.ContentType) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Type", headerParam1) + } + + } + + return req, nil +} + +// NewPostWriteLPRequestWithTextBody calls the generic PostWriteLP builder with text/plain body +func NewPostWriteLPRequestWithTextBody(server string, params *PostWriteLPParams, body PostWriteLPTextRequestBody) (*http.Request, error) { + var bodyReader io.Reader + bodyReader = strings.NewReader(string(body)) + return NewPostWriteLPRequestWithBody(server, params, "text/plain", bodyReader) +} + +// NewPostWriteLPRequestWithBody generates requests for PostWriteLP with any type of body +func NewPostWriteLPRequestWithBody(server string, params *PostWriteLPParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/v3/write_lp") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "db", runtime.ParamLocationQuery, params.Db); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if params.AcceptPartial != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "accept_partial", runtime.ParamLocationQuery, *params.AcceptPartial); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "precision", runtime.ParamLocationQuery, params.Precision); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if params.NoSync != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "no_sync", runtime.ParamLocationQuery, *params.NoSync); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.ContentType != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Content-Type", runtime.ParamLocationHeader, *params.ContentType) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Type", headerParam0) + } + + if params.Accept != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam1) + } + + if params.ContentEncoding != nil { + var headerParam2 string + + headerParam2, err = runtime.StyleParamWithLocation("simple", false, "Content-Encoding", runtime.ParamLocationHeader, *params.ContentEncoding) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Encoding", headerParam2) + } + + if params.ContentLength != nil { + var headerParam3 string + + headerParam3, err = runtime.StyleParamWithLocation("simple", false, "Content-Length", runtime.ParamLocationHeader, *params.ContentLength) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Length", headerParam3) + } + + } + + return req, nil +} + +// NewGetHealthRequest generates requests for GetHealth +func NewGetHealthRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/health") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetMetricsRequest generates requests for GetMetrics +func NewGetMetricsRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/metrics") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetPingRequest generates requests for GetPing +func NewGetPingRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/ping") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetV1ExecuteQueryRequest generates requests for GetV1ExecuteQuery +func NewGetV1ExecuteQueryRequest(server string, params *GetV1ExecuteQueryParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/query") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Chunked != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "chunked", runtime.ParamLocationQuery, *params.Chunked); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.ChunkSize != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "chunk_size", runtime.ParamLocationQuery, *params.ChunkSize); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Db != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "db", runtime.ParamLocationQuery, *params.Db); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Pretty != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pretty", runtime.ParamLocationQuery, *params.Pretty); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "q", runtime.ParamLocationQuery, params.Q); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if params.Epoch != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "epoch", runtime.ParamLocationQuery, *params.Epoch); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + if params != nil { + + if params.Accept != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam0) + } + + } + + return req, nil +} + +// NewPostExecuteV1QueryRequest calls the generic PostExecuteV1Query builder with application/json body +func NewPostExecuteV1QueryRequest(server string, params *PostExecuteV1QueryParams, body PostExecuteV1QueryJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostExecuteV1QueryRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostExecuteV1QueryRequestWithBody generates requests for PostExecuteV1Query with any type of body +func NewPostExecuteV1QueryRequestWithBody(server string, params *PostExecuteV1QueryParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/query") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.Accept != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam0) + } + + } + + return req, nil +} + +// NewPostV1WriteRequestWithTextBody calls the generic PostV1Write builder with text/plain body +func NewPostV1WriteRequestWithTextBody(server string, params *PostV1WriteParams, body PostV1WriteTextRequestBody) (*http.Request, error) { + var bodyReader io.Reader + bodyReader = strings.NewReader(string(body)) + return NewPostV1WriteRequestWithBody(server, params, "text/plain", bodyReader) +} + +// NewPostV1WriteRequestWithBody generates requests for PostV1Write with any type of body +func NewPostV1WriteRequestWithBody(server string, params *PostV1WriteParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/write") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "db", runtime.ParamLocationQuery, params.Db); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "precision", runtime.ParamLocationQuery, params.Precision); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.ContentType != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Content-Type", runtime.ParamLocationHeader, *params.ContentType) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Type", headerParam0) + } + + if params.Accept != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam1) + } + + if params.ContentEncoding != nil { + var headerParam2 string + + headerParam2, err = runtime.StyleParamWithLocation("simple", false, "Content-Encoding", runtime.ParamLocationHeader, *params.ContentEncoding) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Encoding", headerParam2) + } + + if params.ContentLength != nil { + var headerParam3 string + + headerParam3, err = runtime.StyleParamWithLocation("simple", false, "Content-Length", runtime.ParamLocationHeader, *params.ContentLength) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Length", headerParam3) + } + + } + + return req, nil +} + +func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { + for _, r := range c.RequestEditors { + if err := r(ctx, req); err != nil { + return err + } + } + for _, r := range additionalEditors { + if err := r(ctx, req); err != nil { + return err + } + } + return nil +} + +// ClientWithResponses builds on ClientInterface to offer response payloads +type ClientWithResponses struct { + ClientInterface +} + +// NewClientWithResponses creates a new ClientWithResponses, which wraps +// Client with return type handling +func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { + client, err := NewClient(server, opts...) + if err != nil { + return nil, err + } + return &ClientWithResponses{client}, nil +} + +// WithBaseURL overrides the baseURL. +func WithBaseURL(baseURL string) ClientOption { + return func(c *Client) error { + newBaseURL, err := url.Parse(baseURL) + if err != nil { + return err + } + c.Server = newBaseURL.String() + return nil + } +} + +// ClientWithResponsesInterface is the interface specification for the client with responses above. +type ClientWithResponsesInterface interface { + // GetHealthV1WithResponse request + GetHealthV1WithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthV1Response, error) + + // PostV2WriteWithBodyWithResponse request with any body + PostV2WriteWithBodyWithResponse(ctx context.Context, params *PostV2WriteParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV2WriteResponse, error) + + PostV2WriteWithTextBodyWithResponse(ctx context.Context, params *PostV2WriteParams, body PostV2WriteTextRequestBody, reqEditors ...RequestEditorFn) (*PostV2WriteResponse, error) + + // DeleteConfigureDatabaseWithResponse request + DeleteConfigureDatabaseWithResponse(ctx context.Context, params *DeleteConfigureDatabaseParams, reqEditors ...RequestEditorFn) (*DeleteConfigureDatabaseResponse, error) + + // GetConfigureDatabaseWithResponse request + GetConfigureDatabaseWithResponse(ctx context.Context, params *GetConfigureDatabaseParams, reqEditors ...RequestEditorFn) (*GetConfigureDatabaseResponse, error) + + // PostConfigureDatabaseWithBodyWithResponse request with any body + PostConfigureDatabaseWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostConfigureDatabaseResponse, error) + + PostConfigureDatabaseWithResponse(ctx context.Context, body PostConfigureDatabaseJSONRequestBody, reqEditors ...RequestEditorFn) (*PostConfigureDatabaseResponse, error) + + // PostConfigureDistinctCacheWithBodyWithResponse request with any body + PostConfigureDistinctCacheWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostConfigureDistinctCacheResponse, error) + + PostConfigureDistinctCacheWithResponse(ctx context.Context, body PostConfigureDistinctCacheJSONRequestBody, reqEditors ...RequestEditorFn) (*PostConfigureDistinctCacheResponse, error) + + // PostCreateResourceTokenWithResponse request + PostCreateResourceTokenWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostCreateResourceTokenResponse, error) + + // DeleteConfigureLastCacheWithResponse request + DeleteConfigureLastCacheWithResponse(ctx context.Context, params *DeleteConfigureLastCacheParams, reqEditors ...RequestEditorFn) (*DeleteConfigureLastCacheResponse, error) + + // PostConfigureLastCacheWithBodyWithResponse request with any body + PostConfigureLastCacheWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostConfigureLastCacheResponse, error) + + PostConfigureLastCacheWithResponse(ctx context.Context, body PostConfigureLastCacheJSONRequestBody, reqEditors ...RequestEditorFn) (*PostConfigureLastCacheResponse, error) + + // PostInstallPluginPackagesWithBodyWithResponse request with any body + PostInstallPluginPackagesWithBodyWithResponse(ctx context.Context, params *PostInstallPluginPackagesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostInstallPluginPackagesResponse, error) + + PostInstallPluginPackagesWithResponse(ctx context.Context, params *PostInstallPluginPackagesParams, body PostInstallPluginPackagesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostInstallPluginPackagesResponse, error) + + // PostInstallPluginRequirementsWithBodyWithResponse request with any body + PostInstallPluginRequirementsWithBodyWithResponse(ctx context.Context, params *PostInstallPluginRequirementsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostInstallPluginRequirementsResponse, error) + + PostInstallPluginRequirementsWithResponse(ctx context.Context, params *PostInstallPluginRequirementsParams, body PostInstallPluginRequirementsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostInstallPluginRequirementsResponse, error) + + // DeleteConfigureProcessingEngineTriggerWithResponse request + DeleteConfigureProcessingEngineTriggerWithResponse(ctx context.Context, params *DeleteConfigureProcessingEngineTriggerParams, reqEditors ...RequestEditorFn) (*DeleteConfigureProcessingEngineTriggerResponse, error) + + // PostConfigureProcessingEngineTriggerWithBodyWithResponse request with any body + PostConfigureProcessingEngineTriggerWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostConfigureProcessingEngineTriggerResponse, error) + + PostConfigureProcessingEngineTriggerWithResponse(ctx context.Context, body PostConfigureProcessingEngineTriggerJSONRequestBody, reqEditors ...RequestEditorFn) (*PostConfigureProcessingEngineTriggerResponse, error) + + // PostDisableProcessingEngineTriggerWithBodyWithResponse request with any body + PostDisableProcessingEngineTriggerWithBodyWithResponse(ctx context.Context, params *PostDisableProcessingEngineTriggerParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostDisableProcessingEngineTriggerResponse, error) + + PostDisableProcessingEngineTriggerWithResponse(ctx context.Context, params *PostDisableProcessingEngineTriggerParams, body PostDisableProcessingEngineTriggerJSONRequestBody, reqEditors ...RequestEditorFn) (*PostDisableProcessingEngineTriggerResponse, error) + + // PostEnableProcessingEngineTriggerWithBodyWithResponse request with any body + PostEnableProcessingEngineTriggerWithBodyWithResponse(ctx context.Context, params *PostEnableProcessingEngineTriggerParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostEnableProcessingEngineTriggerResponse, error) + + PostEnableProcessingEngineTriggerWithResponse(ctx context.Context, params *PostEnableProcessingEngineTriggerParams, body PostEnableProcessingEngineTriggerJSONRequestBody, reqEditors ...RequestEditorFn) (*PostEnableProcessingEngineTriggerResponse, error) + + // DeleteConfigureTableWithResponse request + DeleteConfigureTableWithResponse(ctx context.Context, params *DeleteConfigureTableParams, reqEditors ...RequestEditorFn) (*DeleteConfigureTableResponse, error) + + // PostConfigureTableWithBodyWithResponse request with any body + PostConfigureTableWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostConfigureTableResponse, error) + + PostConfigureTableWithResponse(ctx context.Context, body PostConfigureTableJSONRequestBody, reqEditors ...RequestEditorFn) (*PostConfigureTableResponse, error) + + // PostCreateAdminTokenWithResponse request + PostCreateAdminTokenWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostCreateAdminTokenResponse, error) + + // PostRegenerateAdminTokenWithResponse request + PostRegenerateAdminTokenWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostRegenerateAdminTokenResponse, error) + + // GetProcessingEnginePluginRequestWithResponse request + GetProcessingEnginePluginRequestWithResponse(ctx context.Context, pluginPath string, reqEditors ...RequestEditorFn) (*GetProcessingEnginePluginRequestResponse, error) + + // PostProcessingEnginePluginRequestWithBodyWithResponse request with any body + PostProcessingEnginePluginRequestWithBodyWithResponse(ctx context.Context, pluginPath string, params *PostProcessingEnginePluginRequestParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostProcessingEnginePluginRequestResponse, error) + + PostProcessingEnginePluginRequestWithResponse(ctx context.Context, pluginPath string, params *PostProcessingEnginePluginRequestParams, body PostProcessingEnginePluginRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*PostProcessingEnginePluginRequestResponse, error) + + // PostTestSchedulingPluginWithResponse request + PostTestSchedulingPluginWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostTestSchedulingPluginResponse, error) + + // PostTestWALPluginWithResponse request + PostTestWALPluginWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostTestWALPluginResponse, error) + + // GetExecuteInfluxQLQueryWithResponse request + GetExecuteInfluxQLQueryWithResponse(ctx context.Context, params *GetExecuteInfluxQLQueryParams, reqEditors ...RequestEditorFn) (*GetExecuteInfluxQLQueryResponse, error) + + // PostExecuteQueryInfluxQLWithBodyWithResponse request with any body + PostExecuteQueryInfluxQLWithBodyWithResponse(ctx context.Context, params *PostExecuteQueryInfluxQLParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostExecuteQueryInfluxQLResponse, error) + + PostExecuteQueryInfluxQLWithResponse(ctx context.Context, params *PostExecuteQueryInfluxQLParams, body PostExecuteQueryInfluxQLJSONRequestBody, reqEditors ...RequestEditorFn) (*PostExecuteQueryInfluxQLResponse, error) + + // GetExecuteQuerySQLWithResponse request + GetExecuteQuerySQLWithResponse(ctx context.Context, params *GetExecuteQuerySQLParams, reqEditors ...RequestEditorFn) (*GetExecuteQuerySQLResponse, error) + + // PostExecuteQuerySQLWithBodyWithResponse request with any body + PostExecuteQuerySQLWithBodyWithResponse(ctx context.Context, params *PostExecuteQuerySQLParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostExecuteQuerySQLResponse, error) + + PostExecuteQuerySQLWithResponse(ctx context.Context, params *PostExecuteQuerySQLParams, body PostExecuteQuerySQLJSONRequestBody, reqEditors ...RequestEditorFn) (*PostExecuteQuerySQLResponse, error) + + // PostWriteLPWithBodyWithResponse request with any body + PostWriteLPWithBodyWithResponse(ctx context.Context, params *PostWriteLPParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostWriteLPResponse, error) + + PostWriteLPWithTextBodyWithResponse(ctx context.Context, params *PostWriteLPParams, body PostWriteLPTextRequestBody, reqEditors ...RequestEditorFn) (*PostWriteLPResponse, error) + + // GetHealthWithResponse request + GetHealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthResponse, error) + + // GetMetricsWithResponse request + GetMetricsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetMetricsResponse, error) + + // GetPingWithResponse request + GetPingWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetPingResponse, error) + + // GetV1ExecuteQueryWithResponse request + GetV1ExecuteQueryWithResponse(ctx context.Context, params *GetV1ExecuteQueryParams, reqEditors ...RequestEditorFn) (*GetV1ExecuteQueryResponse, error) + + // PostExecuteV1QueryWithBodyWithResponse request with any body + PostExecuteV1QueryWithBodyWithResponse(ctx context.Context, params *PostExecuteV1QueryParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostExecuteV1QueryResponse, error) + + PostExecuteV1QueryWithResponse(ctx context.Context, params *PostExecuteV1QueryParams, body PostExecuteV1QueryJSONRequestBody, reqEditors ...RequestEditorFn) (*PostExecuteV1QueryResponse, error) + + // PostV1WriteWithBodyWithResponse request with any body + PostV1WriteWithBodyWithResponse(ctx context.Context, params *PostV1WriteParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV1WriteResponse, error) + + PostV1WriteWithTextBodyWithResponse(ctx context.Context, params *PostV1WriteParams, body PostV1WriteTextRequestBody, reqEditors ...RequestEditorFn) (*PostV1WriteResponse, error) +} + +type GetHealthV1Response struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r GetHealthV1Response) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetHealthV1Response) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostV2WriteResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostV2WriteResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostV2WriteResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteConfigureDatabaseResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r DeleteConfigureDatabaseResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteConfigureDatabaseResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetConfigureDatabaseResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ShowDatabasesResponse + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r GetConfigureDatabaseResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetConfigureDatabaseResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostConfigureDatabaseResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostConfigureDatabaseResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostConfigureDatabaseResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostConfigureDistinctCacheResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r PostConfigureDistinctCacheResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostConfigureDistinctCacheResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostCreateResourceTokenResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *ResourceTokenObject + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostCreateResourceTokenResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostCreateResourceTokenResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteConfigureLastCacheResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r DeleteConfigureLastCacheResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteConfigureLastCacheResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostConfigureLastCacheResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostConfigureLastCacheResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostConfigureLastCacheResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostInstallPluginPackagesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostInstallPluginPackagesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostInstallPluginPackagesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostInstallPluginRequirementsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostInstallPluginRequirementsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostInstallPluginRequirementsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteConfigureProcessingEngineTriggerResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r DeleteConfigureProcessingEngineTriggerResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteConfigureProcessingEngineTriggerResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostConfigureProcessingEngineTriggerResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostConfigureProcessingEngineTriggerResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostConfigureProcessingEngineTriggerResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostDisableProcessingEngineTriggerResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostDisableProcessingEngineTriggerResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostDisableProcessingEngineTriggerResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostEnableProcessingEngineTriggerResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostEnableProcessingEngineTriggerResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostEnableProcessingEngineTriggerResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteConfigureTableResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r DeleteConfigureTableResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteConfigureTableResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostConfigureTableResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostConfigureTableResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostConfigureTableResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostCreateAdminTokenResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *AdminTokenObject + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostCreateAdminTokenResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostCreateAdminTokenResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostRegenerateAdminTokenResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *AdminTokenObject + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostRegenerateAdminTokenResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostRegenerateAdminTokenResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetProcessingEnginePluginRequestResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r GetProcessingEnginePluginRequestResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetProcessingEnginePluginRequestResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostProcessingEnginePluginRequestResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostProcessingEnginePluginRequestResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostProcessingEnginePluginRequestResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostTestSchedulingPluginResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostTestSchedulingPluginResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostTestSchedulingPluginResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostTestWALPluginResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostTestWALPluginResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostTestWALPluginResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetExecuteInfluxQLQueryResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *QueryResponse + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r GetExecuteInfluxQLQueryResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetExecuteInfluxQLQueryResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostExecuteQueryInfluxQLResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *QueryResponse + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostExecuteQueryInfluxQLResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostExecuteQueryInfluxQLResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetExecuteQuerySQLResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *QueryResponse + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r GetExecuteQuerySQLResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetExecuteQuerySQLResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostExecuteQuerySQLResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *QueryResponse + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostExecuteQuerySQLResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostExecuteQuerySQLResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostWriteLPResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostWriteLPResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostWriteLPResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetHealthResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r GetHealthResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetHealthResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetMetricsResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r GetMetricsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetMetricsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetPingResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *interface{} +} + +// Status returns HTTPResponse.Status +func (r GetPingResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetPingResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetV1ExecuteQueryResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *QueryResponse + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r GetV1ExecuteQueryResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetV1ExecuteQueryResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostExecuteV1QueryResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *QueryResponse + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostExecuteV1QueryResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostExecuteV1QueryResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostV1WriteResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized +} + +// Status returns HTTPResponse.Status +func (r PostV1WriteResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostV1WriteResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// GetHealthV1WithResponse request returning *GetHealthV1Response +func (c *ClientWithResponses) GetHealthV1WithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthV1Response, error) { + rsp, err := c.GetHealthV1(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetHealthV1Response(rsp) +} + +// PostV2WriteWithBodyWithResponse request with arbitrary body returning *PostV2WriteResponse +func (c *ClientWithResponses) PostV2WriteWithBodyWithResponse(ctx context.Context, params *PostV2WriteParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV2WriteResponse, error) { + rsp, err := c.PostV2WriteWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV2WriteResponse(rsp) +} + +func (c *ClientWithResponses) PostV2WriteWithTextBodyWithResponse(ctx context.Context, params *PostV2WriteParams, body PostV2WriteTextRequestBody, reqEditors ...RequestEditorFn) (*PostV2WriteResponse, error) { + rsp, err := c.PostV2WriteWithTextBody(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV2WriteResponse(rsp) +} + +// DeleteConfigureDatabaseWithResponse request returning *DeleteConfigureDatabaseResponse +func (c *ClientWithResponses) DeleteConfigureDatabaseWithResponse(ctx context.Context, params *DeleteConfigureDatabaseParams, reqEditors ...RequestEditorFn) (*DeleteConfigureDatabaseResponse, error) { + rsp, err := c.DeleteConfigureDatabase(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteConfigureDatabaseResponse(rsp) +} + +// GetConfigureDatabaseWithResponse request returning *GetConfigureDatabaseResponse +func (c *ClientWithResponses) GetConfigureDatabaseWithResponse(ctx context.Context, params *GetConfigureDatabaseParams, reqEditors ...RequestEditorFn) (*GetConfigureDatabaseResponse, error) { + rsp, err := c.GetConfigureDatabase(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetConfigureDatabaseResponse(rsp) +} + +// PostConfigureDatabaseWithBodyWithResponse request with arbitrary body returning *PostConfigureDatabaseResponse +func (c *ClientWithResponses) PostConfigureDatabaseWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostConfigureDatabaseResponse, error) { + rsp, err := c.PostConfigureDatabaseWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostConfigureDatabaseResponse(rsp) +} + +func (c *ClientWithResponses) PostConfigureDatabaseWithResponse(ctx context.Context, body PostConfigureDatabaseJSONRequestBody, reqEditors ...RequestEditorFn) (*PostConfigureDatabaseResponse, error) { + rsp, err := c.PostConfigureDatabase(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostConfigureDatabaseResponse(rsp) +} + +// PostConfigureDistinctCacheWithBodyWithResponse request with arbitrary body returning *PostConfigureDistinctCacheResponse +func (c *ClientWithResponses) PostConfigureDistinctCacheWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostConfigureDistinctCacheResponse, error) { + rsp, err := c.PostConfigureDistinctCacheWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostConfigureDistinctCacheResponse(rsp) +} + +func (c *ClientWithResponses) PostConfigureDistinctCacheWithResponse(ctx context.Context, body PostConfigureDistinctCacheJSONRequestBody, reqEditors ...RequestEditorFn) (*PostConfigureDistinctCacheResponse, error) { + rsp, err := c.PostConfigureDistinctCache(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostConfigureDistinctCacheResponse(rsp) +} + +// PostCreateResourceTokenWithResponse request returning *PostCreateResourceTokenResponse +func (c *ClientWithResponses) PostCreateResourceTokenWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostCreateResourceTokenResponse, error) { + rsp, err := c.PostCreateResourceToken(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostCreateResourceTokenResponse(rsp) +} + +// DeleteConfigureLastCacheWithResponse request returning *DeleteConfigureLastCacheResponse +func (c *ClientWithResponses) DeleteConfigureLastCacheWithResponse(ctx context.Context, params *DeleteConfigureLastCacheParams, reqEditors ...RequestEditorFn) (*DeleteConfigureLastCacheResponse, error) { + rsp, err := c.DeleteConfigureLastCache(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteConfigureLastCacheResponse(rsp) +} + +// PostConfigureLastCacheWithBodyWithResponse request with arbitrary body returning *PostConfigureLastCacheResponse +func (c *ClientWithResponses) PostConfigureLastCacheWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostConfigureLastCacheResponse, error) { + rsp, err := c.PostConfigureLastCacheWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostConfigureLastCacheResponse(rsp) +} + +func (c *ClientWithResponses) PostConfigureLastCacheWithResponse(ctx context.Context, body PostConfigureLastCacheJSONRequestBody, reqEditors ...RequestEditorFn) (*PostConfigureLastCacheResponse, error) { + rsp, err := c.PostConfigureLastCache(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostConfigureLastCacheResponse(rsp) +} + +// PostInstallPluginPackagesWithBodyWithResponse request with arbitrary body returning *PostInstallPluginPackagesResponse +func (c *ClientWithResponses) PostInstallPluginPackagesWithBodyWithResponse(ctx context.Context, params *PostInstallPluginPackagesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostInstallPluginPackagesResponse, error) { + rsp, err := c.PostInstallPluginPackagesWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostInstallPluginPackagesResponse(rsp) +} + +func (c *ClientWithResponses) PostInstallPluginPackagesWithResponse(ctx context.Context, params *PostInstallPluginPackagesParams, body PostInstallPluginPackagesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostInstallPluginPackagesResponse, error) { + rsp, err := c.PostInstallPluginPackages(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostInstallPluginPackagesResponse(rsp) +} + +// PostInstallPluginRequirementsWithBodyWithResponse request with arbitrary body returning *PostInstallPluginRequirementsResponse +func (c *ClientWithResponses) PostInstallPluginRequirementsWithBodyWithResponse(ctx context.Context, params *PostInstallPluginRequirementsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostInstallPluginRequirementsResponse, error) { + rsp, err := c.PostInstallPluginRequirementsWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostInstallPluginRequirementsResponse(rsp) +} + +func (c *ClientWithResponses) PostInstallPluginRequirementsWithResponse(ctx context.Context, params *PostInstallPluginRequirementsParams, body PostInstallPluginRequirementsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostInstallPluginRequirementsResponse, error) { + rsp, err := c.PostInstallPluginRequirements(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostInstallPluginRequirementsResponse(rsp) +} + +// DeleteConfigureProcessingEngineTriggerWithResponse request returning *DeleteConfigureProcessingEngineTriggerResponse +func (c *ClientWithResponses) DeleteConfigureProcessingEngineTriggerWithResponse(ctx context.Context, params *DeleteConfigureProcessingEngineTriggerParams, reqEditors ...RequestEditorFn) (*DeleteConfigureProcessingEngineTriggerResponse, error) { + rsp, err := c.DeleteConfigureProcessingEngineTrigger(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteConfigureProcessingEngineTriggerResponse(rsp) +} + +// PostConfigureProcessingEngineTriggerWithBodyWithResponse request with arbitrary body returning *PostConfigureProcessingEngineTriggerResponse +func (c *ClientWithResponses) PostConfigureProcessingEngineTriggerWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostConfigureProcessingEngineTriggerResponse, error) { + rsp, err := c.PostConfigureProcessingEngineTriggerWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostConfigureProcessingEngineTriggerResponse(rsp) +} + +func (c *ClientWithResponses) PostConfigureProcessingEngineTriggerWithResponse(ctx context.Context, body PostConfigureProcessingEngineTriggerJSONRequestBody, reqEditors ...RequestEditorFn) (*PostConfigureProcessingEngineTriggerResponse, error) { + rsp, err := c.PostConfigureProcessingEngineTrigger(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostConfigureProcessingEngineTriggerResponse(rsp) +} + +// PostDisableProcessingEngineTriggerWithBodyWithResponse request with arbitrary body returning *PostDisableProcessingEngineTriggerResponse +func (c *ClientWithResponses) PostDisableProcessingEngineTriggerWithBodyWithResponse(ctx context.Context, params *PostDisableProcessingEngineTriggerParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostDisableProcessingEngineTriggerResponse, error) { + rsp, err := c.PostDisableProcessingEngineTriggerWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostDisableProcessingEngineTriggerResponse(rsp) +} + +func (c *ClientWithResponses) PostDisableProcessingEngineTriggerWithResponse(ctx context.Context, params *PostDisableProcessingEngineTriggerParams, body PostDisableProcessingEngineTriggerJSONRequestBody, reqEditors ...RequestEditorFn) (*PostDisableProcessingEngineTriggerResponse, error) { + rsp, err := c.PostDisableProcessingEngineTrigger(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostDisableProcessingEngineTriggerResponse(rsp) +} + +// PostEnableProcessingEngineTriggerWithBodyWithResponse request with arbitrary body returning *PostEnableProcessingEngineTriggerResponse +func (c *ClientWithResponses) PostEnableProcessingEngineTriggerWithBodyWithResponse(ctx context.Context, params *PostEnableProcessingEngineTriggerParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostEnableProcessingEngineTriggerResponse, error) { + rsp, err := c.PostEnableProcessingEngineTriggerWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostEnableProcessingEngineTriggerResponse(rsp) +} + +func (c *ClientWithResponses) PostEnableProcessingEngineTriggerWithResponse(ctx context.Context, params *PostEnableProcessingEngineTriggerParams, body PostEnableProcessingEngineTriggerJSONRequestBody, reqEditors ...RequestEditorFn) (*PostEnableProcessingEngineTriggerResponse, error) { + rsp, err := c.PostEnableProcessingEngineTrigger(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostEnableProcessingEngineTriggerResponse(rsp) +} + +// DeleteConfigureTableWithResponse request returning *DeleteConfigureTableResponse +func (c *ClientWithResponses) DeleteConfigureTableWithResponse(ctx context.Context, params *DeleteConfigureTableParams, reqEditors ...RequestEditorFn) (*DeleteConfigureTableResponse, error) { + rsp, err := c.DeleteConfigureTable(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteConfigureTableResponse(rsp) +} + +// PostConfigureTableWithBodyWithResponse request with arbitrary body returning *PostConfigureTableResponse +func (c *ClientWithResponses) PostConfigureTableWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostConfigureTableResponse, error) { + rsp, err := c.PostConfigureTableWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostConfigureTableResponse(rsp) +} + +func (c *ClientWithResponses) PostConfigureTableWithResponse(ctx context.Context, body PostConfigureTableJSONRequestBody, reqEditors ...RequestEditorFn) (*PostConfigureTableResponse, error) { + rsp, err := c.PostConfigureTable(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostConfigureTableResponse(rsp) +} + +// PostCreateAdminTokenWithResponse request returning *PostCreateAdminTokenResponse +func (c *ClientWithResponses) PostCreateAdminTokenWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostCreateAdminTokenResponse, error) { + rsp, err := c.PostCreateAdminToken(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostCreateAdminTokenResponse(rsp) +} + +// PostRegenerateAdminTokenWithResponse request returning *PostRegenerateAdminTokenResponse +func (c *ClientWithResponses) PostRegenerateAdminTokenWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostRegenerateAdminTokenResponse, error) { + rsp, err := c.PostRegenerateAdminToken(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostRegenerateAdminTokenResponse(rsp) +} + +// GetProcessingEnginePluginRequestWithResponse request returning *GetProcessingEnginePluginRequestResponse +func (c *ClientWithResponses) GetProcessingEnginePluginRequestWithResponse(ctx context.Context, pluginPath string, reqEditors ...RequestEditorFn) (*GetProcessingEnginePluginRequestResponse, error) { + rsp, err := c.GetProcessingEnginePluginRequest(ctx, pluginPath, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetProcessingEnginePluginRequestResponse(rsp) +} + +// PostProcessingEnginePluginRequestWithBodyWithResponse request with arbitrary body returning *PostProcessingEnginePluginRequestResponse +func (c *ClientWithResponses) PostProcessingEnginePluginRequestWithBodyWithResponse(ctx context.Context, pluginPath string, params *PostProcessingEnginePluginRequestParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostProcessingEnginePluginRequestResponse, error) { + rsp, err := c.PostProcessingEnginePluginRequestWithBody(ctx, pluginPath, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostProcessingEnginePluginRequestResponse(rsp) +} + +func (c *ClientWithResponses) PostProcessingEnginePluginRequestWithResponse(ctx context.Context, pluginPath string, params *PostProcessingEnginePluginRequestParams, body PostProcessingEnginePluginRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*PostProcessingEnginePluginRequestResponse, error) { + rsp, err := c.PostProcessingEnginePluginRequest(ctx, pluginPath, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostProcessingEnginePluginRequestResponse(rsp) +} + +// PostTestSchedulingPluginWithResponse request returning *PostTestSchedulingPluginResponse +func (c *ClientWithResponses) PostTestSchedulingPluginWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostTestSchedulingPluginResponse, error) { + rsp, err := c.PostTestSchedulingPlugin(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostTestSchedulingPluginResponse(rsp) +} + +// PostTestWALPluginWithResponse request returning *PostTestWALPluginResponse +func (c *ClientWithResponses) PostTestWALPluginWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostTestWALPluginResponse, error) { + rsp, err := c.PostTestWALPlugin(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostTestWALPluginResponse(rsp) +} + +// GetExecuteInfluxQLQueryWithResponse request returning *GetExecuteInfluxQLQueryResponse +func (c *ClientWithResponses) GetExecuteInfluxQLQueryWithResponse(ctx context.Context, params *GetExecuteInfluxQLQueryParams, reqEditors ...RequestEditorFn) (*GetExecuteInfluxQLQueryResponse, error) { + rsp, err := c.GetExecuteInfluxQLQuery(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetExecuteInfluxQLQueryResponse(rsp) +} + +// PostExecuteQueryInfluxQLWithBodyWithResponse request with arbitrary body returning *PostExecuteQueryInfluxQLResponse +func (c *ClientWithResponses) PostExecuteQueryInfluxQLWithBodyWithResponse(ctx context.Context, params *PostExecuteQueryInfluxQLParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostExecuteQueryInfluxQLResponse, error) { + rsp, err := c.PostExecuteQueryInfluxQLWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostExecuteQueryInfluxQLResponse(rsp) +} + +func (c *ClientWithResponses) PostExecuteQueryInfluxQLWithResponse(ctx context.Context, params *PostExecuteQueryInfluxQLParams, body PostExecuteQueryInfluxQLJSONRequestBody, reqEditors ...RequestEditorFn) (*PostExecuteQueryInfluxQLResponse, error) { + rsp, err := c.PostExecuteQueryInfluxQL(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostExecuteQueryInfluxQLResponse(rsp) +} + +// GetExecuteQuerySQLWithResponse request returning *GetExecuteQuerySQLResponse +func (c *ClientWithResponses) GetExecuteQuerySQLWithResponse(ctx context.Context, params *GetExecuteQuerySQLParams, reqEditors ...RequestEditorFn) (*GetExecuteQuerySQLResponse, error) { + rsp, err := c.GetExecuteQuerySQL(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetExecuteQuerySQLResponse(rsp) +} + +// PostExecuteQuerySQLWithBodyWithResponse request with arbitrary body returning *PostExecuteQuerySQLResponse +func (c *ClientWithResponses) PostExecuteQuerySQLWithBodyWithResponse(ctx context.Context, params *PostExecuteQuerySQLParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostExecuteQuerySQLResponse, error) { + rsp, err := c.PostExecuteQuerySQLWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostExecuteQuerySQLResponse(rsp) +} + +func (c *ClientWithResponses) PostExecuteQuerySQLWithResponse(ctx context.Context, params *PostExecuteQuerySQLParams, body PostExecuteQuerySQLJSONRequestBody, reqEditors ...RequestEditorFn) (*PostExecuteQuerySQLResponse, error) { + rsp, err := c.PostExecuteQuerySQL(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostExecuteQuerySQLResponse(rsp) +} + +// PostWriteLPWithBodyWithResponse request with arbitrary body returning *PostWriteLPResponse +func (c *ClientWithResponses) PostWriteLPWithBodyWithResponse(ctx context.Context, params *PostWriteLPParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostWriteLPResponse, error) { + rsp, err := c.PostWriteLPWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostWriteLPResponse(rsp) +} + +func (c *ClientWithResponses) PostWriteLPWithTextBodyWithResponse(ctx context.Context, params *PostWriteLPParams, body PostWriteLPTextRequestBody, reqEditors ...RequestEditorFn) (*PostWriteLPResponse, error) { + rsp, err := c.PostWriteLPWithTextBody(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostWriteLPResponse(rsp) +} + +// GetHealthWithResponse request returning *GetHealthResponse +func (c *ClientWithResponses) GetHealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthResponse, error) { + rsp, err := c.GetHealth(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetHealthResponse(rsp) +} + +// GetMetricsWithResponse request returning *GetMetricsResponse +func (c *ClientWithResponses) GetMetricsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetMetricsResponse, error) { + rsp, err := c.GetMetrics(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetMetricsResponse(rsp) +} + +// GetPingWithResponse request returning *GetPingResponse +func (c *ClientWithResponses) GetPingWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetPingResponse, error) { + rsp, err := c.GetPing(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetPingResponse(rsp) +} + +// GetV1ExecuteQueryWithResponse request returning *GetV1ExecuteQueryResponse +func (c *ClientWithResponses) GetV1ExecuteQueryWithResponse(ctx context.Context, params *GetV1ExecuteQueryParams, reqEditors ...RequestEditorFn) (*GetV1ExecuteQueryResponse, error) { + rsp, err := c.GetV1ExecuteQuery(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetV1ExecuteQueryResponse(rsp) +} + +// PostExecuteV1QueryWithBodyWithResponse request with arbitrary body returning *PostExecuteV1QueryResponse +func (c *ClientWithResponses) PostExecuteV1QueryWithBodyWithResponse(ctx context.Context, params *PostExecuteV1QueryParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostExecuteV1QueryResponse, error) { + rsp, err := c.PostExecuteV1QueryWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostExecuteV1QueryResponse(rsp) +} + +func (c *ClientWithResponses) PostExecuteV1QueryWithResponse(ctx context.Context, params *PostExecuteV1QueryParams, body PostExecuteV1QueryJSONRequestBody, reqEditors ...RequestEditorFn) (*PostExecuteV1QueryResponse, error) { + rsp, err := c.PostExecuteV1Query(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostExecuteV1QueryResponse(rsp) +} + +// PostV1WriteWithBodyWithResponse request with arbitrary body returning *PostV1WriteResponse +func (c *ClientWithResponses) PostV1WriteWithBodyWithResponse(ctx context.Context, params *PostV1WriteParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostV1WriteResponse, error) { + rsp, err := c.PostV1WriteWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV1WriteResponse(rsp) +} + +func (c *ClientWithResponses) PostV1WriteWithTextBodyWithResponse(ctx context.Context, params *PostV1WriteParams, body PostV1WriteTextRequestBody, reqEditors ...RequestEditorFn) (*PostV1WriteResponse, error) { + rsp, err := c.PostV1WriteWithTextBody(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostV1WriteResponse(rsp) +} + +// ParseGetHealthV1Response parses an HTTP response from a GetHealthV1WithResponse call +func ParseGetHealthV1Response(rsp *http.Response) (*GetHealthV1Response, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetHealthV1Response{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParsePostV2WriteResponse parses an HTTP response from a PostV2WriteWithResponse call +func ParsePostV2WriteResponse(rsp *http.Response) (*PostV2WriteResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostV2WriteResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParseDeleteConfigureDatabaseResponse parses an HTTP response from a DeleteConfigureDatabaseWithResponse call +func ParseDeleteConfigureDatabaseResponse(rsp *http.Response) (*DeleteConfigureDatabaseResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteConfigureDatabaseResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParseGetConfigureDatabaseResponse parses an HTTP response from a GetConfigureDatabaseWithResponse call +func ParseGetConfigureDatabaseResponse(rsp *http.Response) (*GetConfigureDatabaseResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetConfigureDatabaseResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ShowDatabasesResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostConfigureDatabaseResponse parses an HTTP response from a PostConfigureDatabaseWithResponse call +func ParsePostConfigureDatabaseResponse(rsp *http.Response) (*PostConfigureDatabaseResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostConfigureDatabaseResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostConfigureDistinctCacheResponse parses an HTTP response from a PostConfigureDistinctCacheWithResponse call +func ParsePostConfigureDistinctCacheResponse(rsp *http.Response) (*PostConfigureDistinctCacheResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostConfigureDistinctCacheResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParsePostCreateResourceTokenResponse parses an HTTP response from a PostCreateResourceTokenWithResponse call +func ParsePostCreateResourceTokenResponse(rsp *http.Response) (*PostCreateResourceTokenResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostCreateResourceTokenResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest ResourceTokenObject + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParseDeleteConfigureLastCacheResponse parses an HTTP response from a DeleteConfigureLastCacheWithResponse call +func ParseDeleteConfigureLastCacheResponse(rsp *http.Response) (*DeleteConfigureLastCacheResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteConfigureLastCacheResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostConfigureLastCacheResponse parses an HTTP response from a PostConfigureLastCacheWithResponse call +func ParsePostConfigureLastCacheResponse(rsp *http.Response) (*PostConfigureLastCacheResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostConfigureLastCacheResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostInstallPluginPackagesResponse parses an HTTP response from a PostInstallPluginPackagesWithResponse call +func ParsePostInstallPluginPackagesResponse(rsp *http.Response) (*PostInstallPluginPackagesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostInstallPluginPackagesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostInstallPluginRequirementsResponse parses an HTTP response from a PostInstallPluginRequirementsWithResponse call +func ParsePostInstallPluginRequirementsResponse(rsp *http.Response) (*PostInstallPluginRequirementsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostInstallPluginRequirementsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParseDeleteConfigureProcessingEngineTriggerResponse parses an HTTP response from a DeleteConfigureProcessingEngineTriggerWithResponse call +func ParseDeleteConfigureProcessingEngineTriggerResponse(rsp *http.Response) (*DeleteConfigureProcessingEngineTriggerResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteConfigureProcessingEngineTriggerResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostConfigureProcessingEngineTriggerResponse parses an HTTP response from a PostConfigureProcessingEngineTriggerWithResponse call +func ParsePostConfigureProcessingEngineTriggerResponse(rsp *http.Response) (*PostConfigureProcessingEngineTriggerResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostConfigureProcessingEngineTriggerResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostDisableProcessingEngineTriggerResponse parses an HTTP response from a PostDisableProcessingEngineTriggerWithResponse call +func ParsePostDisableProcessingEngineTriggerResponse(rsp *http.Response) (*PostDisableProcessingEngineTriggerResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostDisableProcessingEngineTriggerResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostEnableProcessingEngineTriggerResponse parses an HTTP response from a PostEnableProcessingEngineTriggerWithResponse call +func ParsePostEnableProcessingEngineTriggerResponse(rsp *http.Response) (*PostEnableProcessingEngineTriggerResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostEnableProcessingEngineTriggerResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParseDeleteConfigureTableResponse parses an HTTP response from a DeleteConfigureTableWithResponse call +func ParseDeleteConfigureTableResponse(rsp *http.Response) (*DeleteConfigureTableResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteConfigureTableResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostConfigureTableResponse parses an HTTP response from a PostConfigureTableWithResponse call +func ParsePostConfigureTableResponse(rsp *http.Response) (*PostConfigureTableResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostConfigureTableResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostCreateAdminTokenResponse parses an HTTP response from a PostCreateAdminTokenWithResponse call +func ParsePostCreateAdminTokenResponse(rsp *http.Response) (*PostCreateAdminTokenResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostCreateAdminTokenResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest AdminTokenObject + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostRegenerateAdminTokenResponse parses an HTTP response from a PostRegenerateAdminTokenWithResponse call +func ParsePostRegenerateAdminTokenResponse(rsp *http.Response) (*PostRegenerateAdminTokenResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostRegenerateAdminTokenResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest AdminTokenObject + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParseGetProcessingEnginePluginRequestResponse parses an HTTP response from a GetProcessingEnginePluginRequestWithResponse call +func ParseGetProcessingEnginePluginRequestResponse(rsp *http.Response) (*GetProcessingEnginePluginRequestResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetProcessingEnginePluginRequestResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostProcessingEnginePluginRequestResponse parses an HTTP response from a PostProcessingEnginePluginRequestWithResponse call +func ParsePostProcessingEnginePluginRequestResponse(rsp *http.Response) (*PostProcessingEnginePluginRequestResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostProcessingEnginePluginRequestResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostTestSchedulingPluginResponse parses an HTTP response from a PostTestSchedulingPluginWithResponse call +func ParsePostTestSchedulingPluginResponse(rsp *http.Response) (*PostTestSchedulingPluginResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostTestSchedulingPluginResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParsePostTestWALPluginResponse parses an HTTP response from a PostTestWALPluginWithResponse call +func ParsePostTestWALPluginResponse(rsp *http.Response) (*PostTestWALPluginResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostTestWALPluginResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParseGetExecuteInfluxQLQueryResponse parses an HTTP response from a GetExecuteInfluxQLQueryWithResponse call +func ParseGetExecuteInfluxQLQueryResponse(rsp *http.Response) (*GetExecuteInfluxQLQueryResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetExecuteInfluxQLQueryResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest QueryResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case rsp.StatusCode == 200: + // Content-type (text/csv) unsupported + + } + + return response, nil +} + +// ParsePostExecuteQueryInfluxQLResponse parses an HTTP response from a PostExecuteQueryInfluxQLWithResponse call +func ParsePostExecuteQueryInfluxQLResponse(rsp *http.Response) (*PostExecuteQueryInfluxQLResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostExecuteQueryInfluxQLResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest QueryResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case rsp.StatusCode == 200: + // Content-type (text/csv) unsupported + + } + + return response, nil +} + +// ParseGetExecuteQuerySQLResponse parses an HTTP response from a GetExecuteQuerySQLWithResponse call +func ParseGetExecuteQuerySQLResponse(rsp *http.Response) (*GetExecuteQuerySQLResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetExecuteQuerySQLResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest QueryResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case rsp.StatusCode == 200: + // Content-type (text/csv) unsupported + + } + + return response, nil +} + +// ParsePostExecuteQuerySQLResponse parses an HTTP response from a PostExecuteQuerySQLWithResponse call +func ParsePostExecuteQuerySQLResponse(rsp *http.Response) (*PostExecuteQuerySQLResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostExecuteQuerySQLResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest QueryResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case rsp.StatusCode == 200: + // Content-type (text/csv) unsupported + + } + + return response, nil +} + +// ParsePostWriteLPResponse parses an HTTP response from a PostWriteLPWithResponse call +func ParsePostWriteLPResponse(rsp *http.Response) (*PostWriteLPResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostWriteLPResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} + +// ParseGetHealthResponse parses an HTTP response from a GetHealthWithResponse call +func ParseGetHealthResponse(rsp *http.Response) (*GetHealthResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetHealthResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseGetMetricsResponse parses an HTTP response from a GetMetricsWithResponse call +func ParseGetMetricsResponse(rsp *http.Response) (*GetMetricsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetMetricsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseGetPingResponse parses an HTTP response from a GetPingWithResponse call +func ParseGetPingResponse(rsp *http.Response) (*GetPingResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetPingResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest interface{} + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetV1ExecuteQueryResponse parses an HTTP response from a GetV1ExecuteQueryWithResponse call +func ParseGetV1ExecuteQueryResponse(rsp *http.Response) (*GetV1ExecuteQueryResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetV1ExecuteQueryResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest QueryResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case rsp.StatusCode == 200: + // Content-type (application/csv) unsupported + + } + + return response, nil +} + +// ParsePostExecuteV1QueryResponse parses an HTTP response from a PostExecuteV1QueryWithResponse call +func ParsePostExecuteV1QueryResponse(rsp *http.Response) (*PostExecuteV1QueryResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostExecuteV1QueryResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest QueryResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case rsp.StatusCode == 200: + // Content-type (application/csv) unsupported + + } + + return response, nil +} + +// ParsePostV1WriteResponse parses an HTTP response from a PostV1WriteWithResponse call +func ParsePostV1WriteResponse(rsp *http.Response) (*PostV1WriteResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostV1WriteResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + } + + return response, nil +} diff --git a/enterprise/enterprise.go b/enterprise/enterprise.go new file mode 100644 index 0000000..d4866de --- /dev/null +++ b/enterprise/enterprise.go @@ -0,0 +1,11 @@ +// Package enterprise provides a Go client for the InfluxDB 3 Enterprise API. +// +// This package contains generated types and client methods for interacting with +// InfluxDB 3 Enterprise databases, tables, queries, processing engine, and administrative functions. +// +// The InfluxDB HTTP API for InfluxDB 3 Enterprise provides a programmatic interface for +// interacting with InfluxDB 3 Enterprise databases and resources. +package enterprise + +//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -generate types -o types.gen.go -package enterprise ../specs/enterprise/ref.yml +//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -generate client -o client.gen.go -package enterprise ../specs/enterprise/ref.yml diff --git a/enterprise/types.gen.go b/enterprise/types.gen.go new file mode 100644 index 0000000..bb32055 --- /dev/null +++ b/enterprise/types.gen.go @@ -0,0 +1,872 @@ +// Package enterprise provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT. +package enterprise + +import ( + "time" +) + +const ( + BearerAuthScopes = "BearerAuth.Scopes" +) + +// Defines values for ContentEncoding. +const ( + ContentEncodingGzip ContentEncoding = "gzip" + ContentEncodingIdentity ContentEncoding = "identity" +) + +// Defines values for CreateTableRequestFieldsType. +const ( + Bool CreateTableRequestFieldsType = "bool" + Float64 CreateTableRequestFieldsType = "float64" + Int64 CreateTableRequestFieldsType = "int64" + Uint64 CreateTableRequestFieldsType = "uint64" + Utf8 CreateTableRequestFieldsType = "utf8" +) + +// Defines values for EpochCompatibility. +const ( + EpochCompatibilityH EpochCompatibility = "h" + EpochCompatibilityM EpochCompatibility = "m" + EpochCompatibilityMs EpochCompatibility = "ms" + EpochCompatibilityNs EpochCompatibility = "ns" + EpochCompatibilityS EpochCompatibility = "s" + EpochCompatibilityU EpochCompatibility = "u" + EpochCompatibilityฮœ EpochCompatibility = "ยต" +) + +// Defines values for Format. +const ( + FormatCsv Format = "csv" + FormatJson Format = "json" + FormatJsonl Format = "jsonl" + FormatParquet Format = "parquet" +) + +// Defines values for LineProtocol. +const ( + Textplain LineProtocol = "text/plain" + TextplainCharsetUtf8 LineProtocol = "text/plain; charset=utf-8" +) + +// Defines values for PrecisionWrite. +const ( + Auto PrecisionWrite = "auto" + Microsecond PrecisionWrite = "microsecond" + Millisecond PrecisionWrite = "millisecond" + Nanosecond PrecisionWrite = "nanosecond" + Second PrecisionWrite = "second" +) + +// Defines values for PrecisionWriteCompatibility. +const ( + PrecisionWriteCompatibilityMs PrecisionWriteCompatibility = "ms" + PrecisionWriteCompatibilityNs PrecisionWriteCompatibility = "ns" + PrecisionWriteCompatibilityS PrecisionWriteCompatibility = "s" + PrecisionWriteCompatibilityUs PrecisionWriteCompatibility = "us" +) + +// Defines values for QueryRequestObjectFormat. +const ( + QueryRequestObjectFormatCsv QueryRequestObjectFormat = "csv" + QueryRequestObjectFormatJson QueryRequestObjectFormat = "json" + QueryRequestObjectFormatJsonl QueryRequestObjectFormat = "jsonl" + QueryRequestObjectFormatParquet QueryRequestObjectFormat = "parquet" + QueryRequestObjectFormatPretty QueryRequestObjectFormat = "pretty" +) + +// Defines values for ResourceTokenObjectPermissionsActions. +const ( + Read ResourceTokenObjectPermissionsActions = "read" + Write ResourceTokenObjectPermissionsActions = "write" +) + +// Defines values for ResourceTokenObjectPermissionsResourceType. +const ( + ResourceTokenObjectPermissionsResourceTypeDb ResourceTokenObjectPermissionsResourceType = "db" + ResourceTokenObjectPermissionsResourceTypeSystem ResourceTokenObjectPermissionsResourceType = "system" +) + +// Defines values for AcceptQueryHeader. +const ( + AcceptQueryHeaderApplicationjson AcceptQueryHeader = "application/json" + AcceptQueryHeaderApplicationjsonl AcceptQueryHeader = "application/jsonl" + AcceptQueryHeaderApplicationvndApacheParquet AcceptQueryHeader = "application/vnd.apache.parquet" + AcceptQueryHeaderTextcsv AcceptQueryHeader = "text/csv" +) + +// Defines values for ContentType. +const ( + ContentTypeApplicationjson ContentType = "application/json" +) + +// Defines values for PostV2WriteParamsContentEncoding. +const ( + PostV2WriteParamsContentEncodingGzip PostV2WriteParamsContentEncoding = "gzip" + PostV2WriteParamsContentEncodingIdentity PostV2WriteParamsContentEncoding = "identity" +) + +// Defines values for PostV2WriteParamsAccept. +const ( + PostV2WriteParamsAcceptApplicationjson PostV2WriteParamsAccept = "application/json" +) + +// Defines values for PostInstallPluginPackagesParamsContentType. +const ( + PostInstallPluginPackagesParamsContentTypeApplicationjson PostInstallPluginPackagesParamsContentType = "application/json" +) + +// Defines values for PostInstallPluginRequirementsParamsContentType. +const ( + PostInstallPluginRequirementsParamsContentTypeApplicationjson PostInstallPluginRequirementsParamsContentType = "application/json" +) + +// Defines values for PostDisableProcessingEngineTriggerParamsContentType. +const ( + PostDisableProcessingEngineTriggerParamsContentTypeApplicationjson PostDisableProcessingEngineTriggerParamsContentType = "application/json" +) + +// Defines values for PostEnableProcessingEngineTriggerParamsContentType. +const ( + PostEnableProcessingEngineTriggerParamsContentTypeApplicationjson PostEnableProcessingEngineTriggerParamsContentType = "application/json" +) + +// Defines values for PostProcessingEnginePluginRequestParamsContentType. +const ( + PostProcessingEnginePluginRequestParamsContentTypeApplicationjson PostProcessingEnginePluginRequestParamsContentType = "application/json" +) + +// Defines values for GetExecuteInfluxQLQueryParamsAccept. +const ( + GetExecuteInfluxQLQueryParamsAcceptApplicationjson GetExecuteInfluxQLQueryParamsAccept = "application/json" + GetExecuteInfluxQLQueryParamsAcceptApplicationjsonl GetExecuteInfluxQLQueryParamsAccept = "application/jsonl" + GetExecuteInfluxQLQueryParamsAcceptApplicationvndApacheParquet GetExecuteInfluxQLQueryParamsAccept = "application/vnd.apache.parquet" + GetExecuteInfluxQLQueryParamsAcceptTextcsv GetExecuteInfluxQLQueryParamsAccept = "text/csv" +) + +// Defines values for PostExecuteQueryInfluxQLParamsAccept. +const ( + PostExecuteQueryInfluxQLParamsAcceptApplicationjson PostExecuteQueryInfluxQLParamsAccept = "application/json" + PostExecuteQueryInfluxQLParamsAcceptApplicationjsonl PostExecuteQueryInfluxQLParamsAccept = "application/jsonl" + PostExecuteQueryInfluxQLParamsAcceptApplicationvndApacheParquet PostExecuteQueryInfluxQLParamsAccept = "application/vnd.apache.parquet" + PostExecuteQueryInfluxQLParamsAcceptTextcsv PostExecuteQueryInfluxQLParamsAccept = "text/csv" +) + +// Defines values for PostExecuteQueryInfluxQLParamsContentType. +const ( + PostExecuteQueryInfluxQLParamsContentTypeApplicationjson PostExecuteQueryInfluxQLParamsContentType = "application/json" +) + +// Defines values for GetExecuteQuerySQLParamsAccept. +const ( + GetExecuteQuerySQLParamsAcceptApplicationjson GetExecuteQuerySQLParamsAccept = "application/json" + GetExecuteQuerySQLParamsAcceptApplicationjsonl GetExecuteQuerySQLParamsAccept = "application/jsonl" + GetExecuteQuerySQLParamsAcceptApplicationvndApacheParquet GetExecuteQuerySQLParamsAccept = "application/vnd.apache.parquet" + GetExecuteQuerySQLParamsAcceptTextcsv GetExecuteQuerySQLParamsAccept = "text/csv" +) + +// Defines values for GetExecuteQuerySQLParamsContentType. +const ( + GetExecuteQuerySQLParamsContentTypeApplicationjson GetExecuteQuerySQLParamsContentType = "application/json" +) + +// Defines values for PostExecuteQuerySQLParamsAccept. +const ( + PostExecuteQuerySQLParamsAcceptApplicationjson PostExecuteQuerySQLParamsAccept = "application/json" + PostExecuteQuerySQLParamsAcceptApplicationjsonl PostExecuteQuerySQLParamsAccept = "application/jsonl" + PostExecuteQuerySQLParamsAcceptApplicationvndApacheParquet PostExecuteQuerySQLParamsAccept = "application/vnd.apache.parquet" + PostExecuteQuerySQLParamsAcceptTextcsv PostExecuteQuerySQLParamsAccept = "text/csv" +) + +// Defines values for PostExecuteQuerySQLParamsContentType. +const ( + PostExecuteQuerySQLParamsContentTypeApplicationjson PostExecuteQuerySQLParamsContentType = "application/json" +) + +// Defines values for PostWriteLPParamsAccept. +const ( + PostWriteLPParamsAcceptApplicationjson PostWriteLPParamsAccept = "application/json" +) + +// Defines values for GetV1ExecuteQueryParamsAccept. +const ( + GetV1ExecuteQueryParamsAcceptApplicationcsv GetV1ExecuteQueryParamsAccept = "application/csv" + GetV1ExecuteQueryParamsAcceptApplicationjson GetV1ExecuteQueryParamsAccept = "application/json" + GetV1ExecuteQueryParamsAcceptTextcsv GetV1ExecuteQueryParamsAccept = "text/csv" +) + +// Defines values for PostExecuteV1QueryParamsAccept. +const ( + PostExecuteV1QueryParamsAcceptApplicationcsv PostExecuteV1QueryParamsAccept = "application/csv" + PostExecuteV1QueryParamsAcceptApplicationjson PostExecuteV1QueryParamsAccept = "application/json" + PostExecuteV1QueryParamsAcceptTextcsv PostExecuteV1QueryParamsAccept = "text/csv" +) + +// Defines values for PostExecuteV1QueryJSONBodyEpoch. +const ( + H PostExecuteV1QueryJSONBodyEpoch = "h" + M PostExecuteV1QueryJSONBodyEpoch = "m" + Ms PostExecuteV1QueryJSONBodyEpoch = "ms" + Ns PostExecuteV1QueryJSONBodyEpoch = "ns" + S PostExecuteV1QueryJSONBodyEpoch = "s" + U PostExecuteV1QueryJSONBodyEpoch = "u" + ฮœ PostExecuteV1QueryJSONBodyEpoch = "ยต" +) + +// Defines values for PostV1WriteParamsAccept. +const ( + Applicationjson PostV1WriteParamsAccept = "application/json" +) + +// AcceptPartial Accept partial writes. +type AcceptPartial = bool + +// AdminTokenObject defines model for AdminTokenObject. +type AdminTokenObject struct { + CreatedAt *time.Time `json:"created_at,omitempty"` + Expiry *interface{} `json:"expiry,omitempty"` + Hash *string `json:"hash,omitempty"` + Id *int `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Token *string `json:"token,omitempty"` +} + +// ContentEncoding Content coding. +// Use `gzip` for compressed data or `identity` for unmodified, uncompressed data. +type ContentEncoding string + +// ContentLength The length in decimal number of octets. +type ContentLength = int + +// CreateDatabaseRequest defines model for CreateDatabaseRequest. +type CreateDatabaseRequest struct { + Db string `json:"db"` +} + +// CreateTableRequest defines model for CreateTableRequest. +type CreateTableRequest struct { + Db string `json:"db"` + Fields *[]struct { + Name string `json:"name"` + Type CreateTableRequestFieldsType `json:"type"` + } `json:"fields,omitempty"` + Table string `json:"table"` + Tags []string `json:"tags"` +} + +// CreateTableRequestFieldsType defines model for CreateTableRequest.Fields.Type. +type CreateTableRequestFieldsType string + +// DistinctCacheCreateRequest defines model for DistinctCacheCreateRequest. +type DistinctCacheCreateRequest struct { + Columns []string `json:"columns"` + Db string `json:"db"` + + // MaxAge Optional maximum age in seconds. + MaxAge *int `json:"max_age,omitempty"` + + // MaxCardinality Optional maximum cardinality. + MaxCardinality *int `json:"max_cardinality,omitempty"` + + // Name Optional cache name. + Name *string `json:"name,omitempty"` + Table string `json:"table"` +} + +// EpochCompatibility A unix timestamp precision. +// - `h` for hours +// - `m` for minutes +// - `s` for seconds +// - `ms` for milliseconds +// - `u` or `ยต` for microseconds +// - `ns` for nanoseconds +type EpochCompatibility string + +// ErrorMessage defines model for ErrorMessage. +type ErrorMessage struct { + Data *map[string]interface{} `json:"data"` + Error *string `json:"error,omitempty"` +} + +// Format The format of data in the response body. +type Format string + +// LastCacheCreateRequest defines model for LastCacheCreateRequest. +type LastCacheCreateRequest struct { + // Count Optional count. + Count *int `json:"count,omitempty"` + Db string `json:"db"` + + // KeyColumns Optional list of key columns. + KeyColumns *[]string `json:"key_columns,omitempty"` + + // Name Optional cache name. + Name *string `json:"name,omitempty"` + Table string `json:"table"` + + // Ttl Optional time-to-live in seconds. + Ttl *int `json:"ttl,omitempty"` + + // ValueColumns Optional list of value columns. + ValueColumns *[]string `json:"value_columns,omitempty"` +} + +// LineProtocol `text/plain` is the content type for line protocol. `UTF-8` is the default character set. +type LineProtocol string + +// NoSync Acknowledges a successful write without waiting for WAL persistence. +// +// #### Related +// +// - [Use the HTTP API and client libraries to write data](/influxdb3/enterprise/write-data/api-client-libraries/) +// - [Data durability](/influxdb3/enterprise/reference/internals/durability/) +type NoSync = bool + +// PrecisionWrite The precision for unix timestamps in the line protocol batch. +type PrecisionWrite string + +// PrecisionWriteCompatibility The precision for unix timestamps in the line protocol batch. +// Use `ms` for milliseconds, `s` for seconds, `us` for microseconds, or `ns` for nanoseconds. +type PrecisionWriteCompatibility string + +// ProcessingEngineTriggerRequest defines model for ProcessingEngineTriggerRequest. +type ProcessingEngineTriggerRequest struct { + Db string `json:"db"` + + // Disabled Whether the trigger is disabled. + Disabled *bool `json:"disabled,omitempty"` + + // PluginFilename The path and filename of the plugin to execute--for example, + // `schedule.py` or `endpoints/report.py`. + // The path can be absolute or relative to the `--plugins-dir` directory configured when starting InfluxDB 3. + // + // The plugin file must implement the trigger interface associated with the trigger's specification (`trigger_spec`). + PluginFilename string `json:"plugin_filename"` + + // TriggerArguments Optional arguments passed to the plugin. + TriggerArguments *map[string]interface{} `json:"trigger_arguments,omitempty"` + TriggerName string `json:"trigger_name"` + + // TriggerSpecification Specifies when and how the processing engine trigger should be invoked. + // + // ## Supported trigger specifications: + // + // ### Cron-based scheduling + // Format: `cron:CRON_EXPRESSION` + // + // Uses extended (6-field) cron format (second minute hour day_of_month month day_of_week): + // ``` + // โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ second (0-59) + // โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ minute (0-59) + // โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ hour (0-23) + // โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ day of month (1-31) + // โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ month (1-12) + // โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ day of week (0-6, Sunday=0) + // โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ + // * * * * * * + // ``` + // Examples: + // - `cron:0 0 6 * * 1-5` - Every weekday at 6:00 AM + // - `cron:0 30 14 * * 5` - Every Friday at 2:30 PM + // - `cron:0 0 0 1 * *` - First day of every month at midnight + // + // ### Interval-based scheduling + // Format: `every:DURATION` + // + // Supported durations: `s` (seconds), `m` (minutes), `h` (hours), `d` (days): + // - `every:30s` - Every 30 seconds + // - `every:5m` - Every 5 minutes + // - `every:1h` - Every hour + // - `every:1d` - Every day + // + // ### Table-based triggers + // - `all_tables` - Triggers on write events to any table in the database + // - `table:TABLE_NAME` - Triggers on write events to a specific table + // + // ### On-demand triggers + // Format: `path:ENDPOINT_NAME` + // + // Creates an HTTP endpoint `/api/v3/engine/ENDPOINT_NAME` for manual invocation: + // - `path:hello-world` - Creates endpoint `/api/v3/engine/hello-world` + // - `path:data-export` - Creates endpoint `/api/v3/engine/data-export` + TriggerSpecification string `json:"trigger_specification"` +} + +// QueryRequestObject defines model for QueryRequestObject. +type QueryRequestObject struct { + // Database The name of the database to query. + // Required if the query (`query_str`) doesn't specify the database. + Database string `json:"database"` + + // Format The format of the query results. + Format *QueryRequestObjectFormat `json:"format,omitempty"` + + // Params Additional parameters for the query. + // Use this field to pass query parameters. + Params *map[string]interface{} `json:"params,omitempty"` + + // QueryStr The query to execute. + QueryStr string `json:"query_str"` +} + +// QueryRequestObjectFormat The format of the query results. +type QueryRequestObjectFormat string + +// QueryResponse defines model for QueryResponse. +type QueryResponse struct { + Results *[]map[string]interface{} `json:"results,omitempty"` +} + +// ResourceTokenObject defines model for ResourceTokenObject. +type ResourceTokenObject struct { + // ExpirySecs The expiration time in seconds. + ExpirySecs *int `json:"expiry_secs,omitempty"` + Permissions *[]struct { + Actions *[]ResourceTokenObjectPermissionsActions `json:"actions,omitempty"` + ResourceIdentifier *[]string `json:"resource_identifier,omitempty"` + ResourceType *ResourceTokenObjectPermissionsResourceType `json:"resource_type,omitempty"` + } `json:"permissions,omitempty"` + TokenName *string `json:"token_name,omitempty"` +} + +// ResourceTokenObjectPermissionsActions defines model for ResourceTokenObject.Permissions.Actions. +type ResourceTokenObjectPermissionsActions string + +// ResourceTokenObjectPermissionsResourceType defines model for ResourceTokenObject.Permissions.ResourceType. +type ResourceTokenObjectPermissionsResourceType string + +// ShowDatabasesResponse defines model for ShowDatabasesResponse. +type ShowDatabasesResponse struct { + Databases *[]string `json:"databases,omitempty"` +} + +// AcceptQueryHeader defines model for AcceptQueryHeader. +type AcceptQueryHeader string + +// ContentType defines model for ContentType. +type ContentType string + +// CompatibilityPrecisionParam The precision for unix timestamps in the line protocol batch. +// Use `ms` for milliseconds, `s` for seconds, `us` for microseconds, or `ns` for nanoseconds. +type CompatibilityPrecisionParam = PrecisionWriteCompatibility + +// Db defines model for db. +type Db = string + +// DbQueryParam defines model for dbQueryParam. +type DbQueryParam = string + +// DbWriteParam defines model for dbWriteParam. +type DbWriteParam = string + +// FormatRequired The format of data in the response body. +type FormatRequired = Format + +// PrecisionParam The precision for unix timestamps in the line protocol batch. +type PrecisionParam = PrecisionWrite + +// QuerySqlParam defines model for querySqlParam. +type QuerySqlParam = string + +// Unauthorized defines model for Unauthorized. +type Unauthorized = ErrorMessage + +// QueryRequestBody defines model for queryRequestBody. +type QueryRequestBody = QueryRequestObject + +// PostV2WriteTextBody defines parameters for PostV2Write. +type PostV2WriteTextBody = string + +// PostV2WriteParams defines parameters for PostV2Write. +type PostV2WriteParams struct { + // Db A database name. + // InfluxDB creates the database if it doesn't already exist, and then + // writes all points in the batch to the database. + Db string `form:"db" json:"db"` + AcceptPartial *AcceptPartial `form:"accept_partial,omitempty" json:"accept_partial,omitempty"` + + // Precision The precision for unix timestamps in the line protocol batch. + Precision CompatibilityPrecisionParam `form:"precision" json:"precision"` + + // ContentType The content type of the request payload. + ContentType *LineProtocol `json:"Content-Type,omitempty"` + + // ContentEncoding The compression applied to the line protocol in the request payload. + // To send a gzip payload, pass `Content-Encoding: gzip` header. + ContentEncoding *PostV2WriteParamsContentEncoding `json:"Content-Encoding,omitempty"` + + // ContentLength The size of the entity-body, in bytes, sent to InfluxDB. + ContentLength *int `json:"Content-Length,omitempty"` + + // Accept The content type that the client can understand. + // Writes only return a response body if they fail (partially or completely)--for example, + // due to a syntax problem or type mismatch. + Accept *PostV2WriteParamsAccept `json:"Accept,omitempty"` +} + +// PostV2WriteParamsContentEncoding defines parameters for PostV2Write. +type PostV2WriteParamsContentEncoding string + +// PostV2WriteParamsAccept defines parameters for PostV2Write. +type PostV2WriteParamsAccept string + +// DeleteConfigureDatabaseParams defines parameters for DeleteConfigureDatabase. +type DeleteConfigureDatabaseParams struct { + // Db The name of the database. + Db Db `form:"db" json:"db"` +} + +// GetConfigureDatabaseParams defines parameters for GetConfigureDatabase. +type GetConfigureDatabaseParams struct { + Format FormatRequired `form:"format" json:"format"` +} + +// DeleteConfigureLastCacheParams defines parameters for DeleteConfigureLastCache. +type DeleteConfigureLastCacheParams struct { + // Db The name of the database. + Db Db `form:"db" json:"db"` + Table string `form:"table" json:"table"` + Name string `form:"name" json:"name"` +} + +// PostInstallPluginPackagesJSONBody defines parameters for PostInstallPluginPackages. +type PostInstallPluginPackagesJSONBody struct { + // Packages A list of Python package names to install. + // Can include version specifiers (e.g., "scipy==1.9.0"). + Packages []string `json:"packages"` +} + +// PostInstallPluginPackagesParams defines parameters for PostInstallPluginPackages. +type PostInstallPluginPackagesParams struct { + // ContentType The format of the data in the request body. + ContentType *PostInstallPluginPackagesParamsContentType `json:"Content-Type,omitempty"` +} + +// PostInstallPluginPackagesParamsContentType defines parameters for PostInstallPluginPackages. +type PostInstallPluginPackagesParamsContentType string + +// PostInstallPluginRequirementsJSONBody defines parameters for PostInstallPluginRequirements. +type PostInstallPluginRequirementsJSONBody struct { + // RequirementsLocation The path to the requirements file containing Python packages to install. + // Can be a relative path (relative to the plugin directory) or an absolute path. + RequirementsLocation string `json:"requirements_location"` +} + +// PostInstallPluginRequirementsParams defines parameters for PostInstallPluginRequirements. +type PostInstallPluginRequirementsParams struct { + // ContentType The format of the data in the request body. + ContentType *PostInstallPluginRequirementsParamsContentType `json:"Content-Type,omitempty"` +} + +// PostInstallPluginRequirementsParamsContentType defines parameters for PostInstallPluginRequirements. +type PostInstallPluginRequirementsParamsContentType string + +// DeleteConfigureProcessingEngineTriggerParams defines parameters for DeleteConfigureProcessingEngineTrigger. +type DeleteConfigureProcessingEngineTriggerParams struct { + // Db The name of the database. + Db Db `form:"db" json:"db"` + TriggerName string `form:"trigger_name" json:"trigger_name"` + Force *bool `form:"force,omitempty" json:"force,omitempty"` +} + +// PostDisableProcessingEngineTriggerParams defines parameters for PostDisableProcessingEngineTrigger. +type PostDisableProcessingEngineTriggerParams struct { + // ContentType The format of the data in the request body. + ContentType *PostDisableProcessingEngineTriggerParamsContentType `json:"Content-Type,omitempty"` +} + +// PostDisableProcessingEngineTriggerParamsContentType defines parameters for PostDisableProcessingEngineTrigger. +type PostDisableProcessingEngineTriggerParamsContentType string + +// PostEnableProcessingEngineTriggerParams defines parameters for PostEnableProcessingEngineTrigger. +type PostEnableProcessingEngineTriggerParams struct { + // ContentType The format of the data in the request body. + ContentType *PostEnableProcessingEngineTriggerParamsContentType `json:"Content-Type,omitempty"` +} + +// PostEnableProcessingEngineTriggerParamsContentType defines parameters for PostEnableProcessingEngineTrigger. +type PostEnableProcessingEngineTriggerParamsContentType string + +// DeleteConfigureTableParams defines parameters for DeleteConfigureTable. +type DeleteConfigureTableParams struct { + // Db The name of the database. + Db Db `form:"db" json:"db"` + Table string `form:"table" json:"table"` +} + +// PostProcessingEnginePluginRequestJSONBody defines parameters for PostProcessingEnginePluginRequest. +type PostProcessingEnginePluginRequestJSONBody map[string]interface{} + +// PostProcessingEnginePluginRequestParams defines parameters for PostProcessingEnginePluginRequest. +type PostProcessingEnginePluginRequestParams struct { + // ContentType The format of the data in the request body. + ContentType *PostProcessingEnginePluginRequestParamsContentType `json:"Content-Type,omitempty"` +} + +// PostProcessingEnginePluginRequestParamsContentType defines parameters for PostProcessingEnginePluginRequest. +type PostProcessingEnginePluginRequestParamsContentType string + +// GetExecuteInfluxQLQueryParams defines parameters for GetExecuteInfluxQLQuery. +type GetExecuteInfluxQLQueryParams struct { + // Db The name of the database. + // + // If you provide a query that specifies the database, you can omit the 'db' parameter from your request. + Db *DbQueryParam `form:"db,omitempty" json:"db,omitempty"` + Q string `form:"q" json:"q"` + Format *string `form:"format,omitempty" json:"format,omitempty"` + + // Accept The content type that the client can understand. + Accept *GetExecuteInfluxQLQueryParamsAccept `json:"Accept,omitempty"` +} + +// GetExecuteInfluxQLQueryParamsAccept defines parameters for GetExecuteInfluxQLQuery. +type GetExecuteInfluxQLQueryParamsAccept string + +// PostExecuteQueryInfluxQLParams defines parameters for PostExecuteQueryInfluxQL. +type PostExecuteQueryInfluxQLParams struct { + // Accept The content type that the client can understand. + Accept *PostExecuteQueryInfluxQLParamsAccept `json:"Accept,omitempty"` + + // ContentType The format of the data in the request body. + ContentType *PostExecuteQueryInfluxQLParamsContentType `json:"Content-Type,omitempty"` +} + +// PostExecuteQueryInfluxQLParamsAccept defines parameters for PostExecuteQueryInfluxQL. +type PostExecuteQueryInfluxQLParamsAccept string + +// PostExecuteQueryInfluxQLParamsContentType defines parameters for PostExecuteQueryInfluxQL. +type PostExecuteQueryInfluxQLParamsContentType string + +// GetExecuteQuerySQLParams defines parameters for GetExecuteQuerySQL. +type GetExecuteQuerySQLParams struct { + // Db The name of the database. + Db Db `form:"db" json:"db"` + + // Q The query to execute. + Q QuerySqlParam `form:"q" json:"q"` + Format *Format `form:"format,omitempty" json:"format,omitempty"` + + // Accept The content type that the client can understand. + Accept *GetExecuteQuerySQLParamsAccept `json:"Accept,omitempty"` + + // ContentType The format of the data in the request body. + ContentType *GetExecuteQuerySQLParamsContentType `json:"Content-Type,omitempty"` +} + +// GetExecuteQuerySQLParamsAccept defines parameters for GetExecuteQuerySQL. +type GetExecuteQuerySQLParamsAccept string + +// GetExecuteQuerySQLParamsContentType defines parameters for GetExecuteQuerySQL. +type GetExecuteQuerySQLParamsContentType string + +// PostExecuteQuerySQLParams defines parameters for PostExecuteQuerySQL. +type PostExecuteQuerySQLParams struct { + // Accept The content type that the client can understand. + Accept *PostExecuteQuerySQLParamsAccept `json:"Accept,omitempty"` + + // ContentType The format of the data in the request body. + ContentType *PostExecuteQuerySQLParamsContentType `json:"Content-Type,omitempty"` +} + +// PostExecuteQuerySQLParamsAccept defines parameters for PostExecuteQuerySQL. +type PostExecuteQuerySQLParamsAccept string + +// PostExecuteQuerySQLParamsContentType defines parameters for PostExecuteQuerySQL. +type PostExecuteQuerySQLParamsContentType string + +// PostWriteLPTextBody defines parameters for PostWriteLP. +type PostWriteLPTextBody = string + +// PostWriteLPParams defines parameters for PostWriteLP. +type PostWriteLPParams struct { + // Db The name of the database. + // InfluxDB creates the database if it doesn't already exist, and then + // writes all points in the batch to the database. + Db DbWriteParam `form:"db" json:"db"` + AcceptPartial *AcceptPartial `form:"accept_partial,omitempty" json:"accept_partial,omitempty"` + + // Precision The precision for unix timestamps in the line protocol batch. + Precision PrecisionParam `form:"precision" json:"precision"` + NoSync *NoSync `form:"no_sync,omitempty" json:"no_sync,omitempty"` + + // ContentType The content type of the request payload. + ContentType *LineProtocol `json:"Content-Type,omitempty"` + + // Accept The content type that the client can understand. + // Writes only return a response body if they fail (partially or completely)--for example, + // due to a syntax problem or type mismatch. + Accept *PostWriteLPParamsAccept `json:"Accept,omitempty"` + + // ContentEncoding The compression applied to the line protocol in the request payload. + // To send a gzip payload, pass `Content-Encoding: gzip` header. + ContentEncoding *ContentEncoding `json:"Content-Encoding,omitempty"` + + // ContentLength The size of the entity-body, in bytes, sent to InfluxDB. + ContentLength *ContentLength `json:"Content-Length,omitempty"` +} + +// PostWriteLPParamsAccept defines parameters for PostWriteLP. +type PostWriteLPParamsAccept string + +// GetV1ExecuteQueryParams defines parameters for GetV1ExecuteQuery. +type GetV1ExecuteQueryParams struct { + // Chunked If true, the response is divided into chunks of size `chunk_size`. + Chunked *bool `form:"chunked,omitempty" json:"chunked,omitempty"` + + // ChunkSize The number of records that will go into a chunk. + // This parameter is only used if `chunked=true`. + ChunkSize *int `form:"chunk_size,omitempty" json:"chunk_size,omitempty"` + + // Db The database to query. If not provided, the InfluxQL query string must specify the database. + Db *string `form:"db,omitempty" json:"db,omitempty"` + + // Pretty If true, the JSON response is formatted in a human-readable format. + Pretty *bool `form:"pretty,omitempty" json:"pretty,omitempty"` + + // Q The InfluxQL query string. + Q string `form:"q" json:"q"` + + // Epoch Formats timestamps as [unix (epoch) timestamps](/influxdb3/enterprise/reference/glossary/#unix-timestamp) with the specified precision + // instead of [RFC3339 timestamps](/influxdb3/enterprise/reference/glossary/#rfc3339-timestamp) with nanosecond precision. + Epoch *EpochCompatibility `form:"epoch,omitempty" json:"epoch,omitempty"` + + // Accept The content type that the client can understand. + // + // If `text/csv` is specified, the `Content-type` response header is `application/csv` and the response is formatted as CSV. + // + // Returns an error if the format is invalid or non-UTF8. + Accept *GetV1ExecuteQueryParamsAccept `json:"Accept,omitempty"` +} + +// GetV1ExecuteQueryParamsAccept defines parameters for GetV1ExecuteQuery. +type GetV1ExecuteQueryParamsAccept string + +// PostExecuteV1QueryJSONBody defines parameters for PostExecuteV1Query. +type PostExecuteV1QueryJSONBody struct { + // ChunkSize The number of records that will go into a chunk. + // This parameter is only used if `chunked=true`. + ChunkSize *int `json:"chunk_size,omitempty"` + + // Chunked If true, the response is divided into chunks of size `chunk_size`. + Chunked *bool `json:"chunked,omitempty"` + + // Db The database to query. If not provided, the InfluxQL query string must specify the database. + Db *string `json:"db,omitempty"` + + // Epoch A unix timestamp precision. + // + // - `h` for hours + // - `m` for minutes + // - `s` for seconds + // - `ms` for milliseconds + // - `u` or `ยต` for microseconds + // - `ns` for nanoseconds + // + // Formats timestamps as [unix (epoch) timestamps](/influxdb3/enterprise/reference/glossary/#unix-timestamp) with the specified precision + // instead of [RFC3339 timestamps](/influxdb3/enterprise/reference/glossary/#rfc3339-timestamp) with nanosecond precision. + Epoch *PostExecuteV1QueryJSONBodyEpoch `json:"epoch,omitempty"` + + // Pretty If true, the JSON response is formatted in a human-readable format. + Pretty *bool `json:"pretty,omitempty"` + + // Q The InfluxQL query string. + Q string `json:"q"` +} + +// PostExecuteV1QueryParams defines parameters for PostExecuteV1Query. +type PostExecuteV1QueryParams struct { + // Accept The content type that the client can understand. + // + // If `text/csv` is specified, the `Content-type` response header is `application/csv` and the response is formatted as CSV. + // + // Returns an error if the format is invalid or non-UTF8. + Accept *PostExecuteV1QueryParamsAccept `json:"Accept,omitempty"` +} + +// PostExecuteV1QueryParamsAccept defines parameters for PostExecuteV1Query. +type PostExecuteV1QueryParamsAccept string + +// PostExecuteV1QueryJSONBodyEpoch defines parameters for PostExecuteV1Query. +type PostExecuteV1QueryJSONBodyEpoch string + +// PostV1WriteTextBody defines parameters for PostV1Write. +type PostV1WriteTextBody = string + +// PostV1WriteParams defines parameters for PostV1Write. +type PostV1WriteParams struct { + // Db The name of the database. + // InfluxDB creates the database if it doesn't already exist, and then + // writes all points in the batch to the database. + Db DbWriteParam `form:"db" json:"db"` + + // Precision The precision for unix timestamps in the line protocol batch. + Precision CompatibilityPrecisionParam `form:"precision" json:"precision"` + + // ContentType The content type of the request payload. + ContentType *LineProtocol `json:"Content-Type,omitempty"` + + // Accept The content type that the client can understand. + // Writes only return a response body if they fail (partially or completely)--for example, + // due to a syntax problem or type mismatch. + Accept *PostV1WriteParamsAccept `json:"Accept,omitempty"` + + // ContentEncoding The compression applied to the line protocol in the request payload. + // To send a gzip payload, pass `Content-Encoding: gzip` header. + ContentEncoding *ContentEncoding `json:"Content-Encoding,omitempty"` + + // ContentLength The size of the entity-body, in bytes, sent to InfluxDB. + ContentLength *ContentLength `json:"Content-Length,omitempty"` +} + +// PostV1WriteParamsAccept defines parameters for PostV1Write. +type PostV1WriteParamsAccept string + +// PostV2WriteTextRequestBody defines body for PostV2Write for text/plain ContentType. +type PostV2WriteTextRequestBody = PostV2WriteTextBody + +// PostConfigureDatabaseJSONRequestBody defines body for PostConfigureDatabase for application/json ContentType. +type PostConfigureDatabaseJSONRequestBody = CreateDatabaseRequest + +// PostConfigureDistinctCacheJSONRequestBody defines body for PostConfigureDistinctCache for application/json ContentType. +type PostConfigureDistinctCacheJSONRequestBody = DistinctCacheCreateRequest + +// PostConfigureLastCacheJSONRequestBody defines body for PostConfigureLastCache for application/json ContentType. +type PostConfigureLastCacheJSONRequestBody = LastCacheCreateRequest + +// PostInstallPluginPackagesJSONRequestBody defines body for PostInstallPluginPackages for application/json ContentType. +type PostInstallPluginPackagesJSONRequestBody PostInstallPluginPackagesJSONBody + +// PostInstallPluginRequirementsJSONRequestBody defines body for PostInstallPluginRequirements for application/json ContentType. +type PostInstallPluginRequirementsJSONRequestBody PostInstallPluginRequirementsJSONBody + +// PostConfigureProcessingEngineTriggerJSONRequestBody defines body for PostConfigureProcessingEngineTrigger for application/json ContentType. +type PostConfigureProcessingEngineTriggerJSONRequestBody = ProcessingEngineTriggerRequest + +// PostDisableProcessingEngineTriggerJSONRequestBody defines body for PostDisableProcessingEngineTrigger for application/json ContentType. +type PostDisableProcessingEngineTriggerJSONRequestBody = ProcessingEngineTriggerRequest + +// PostEnableProcessingEngineTriggerJSONRequestBody defines body for PostEnableProcessingEngineTrigger for application/json ContentType. +type PostEnableProcessingEngineTriggerJSONRequestBody = ProcessingEngineTriggerRequest + +// PostConfigureTableJSONRequestBody defines body for PostConfigureTable for application/json ContentType. +type PostConfigureTableJSONRequestBody = CreateTableRequest + +// PostProcessingEnginePluginRequestJSONRequestBody defines body for PostProcessingEnginePluginRequest for application/json ContentType. +type PostProcessingEnginePluginRequestJSONRequestBody PostProcessingEnginePluginRequestJSONBody + +// PostExecuteQueryInfluxQLJSONRequestBody defines body for PostExecuteQueryInfluxQL for application/json ContentType. +type PostExecuteQueryInfluxQLJSONRequestBody = QueryRequestObject + +// PostExecuteQuerySQLJSONRequestBody defines body for PostExecuteQuerySQL for application/json ContentType. +type PostExecuteQuerySQLJSONRequestBody = QueryRequestObject + +// PostWriteLPTextRequestBody defines body for PostWriteLP for text/plain ContentType. +type PostWriteLPTextRequestBody = PostWriteLPTextBody + +// PostExecuteV1QueryJSONRequestBody defines body for PostExecuteV1Query for application/json ContentType. +type PostExecuteV1QueryJSONRequestBody PostExecuteV1QueryJSONBody + +// PostV1WriteTextRequestBody defines body for PostV1Write for text/plain ContentType. +type PostV1WriteTextRequestBody = PostV1WriteTextBody diff --git a/examples/cloud/main.go b/examples/cloud/main.go new file mode 100644 index 0000000..5df6920 --- /dev/null +++ b/examples/cloud/main.go @@ -0,0 +1,76 @@ +package main + +import ( + "context" + "fmt" + "log" + "net/http" + "os" + + "github.com/google/uuid" + "github.com/komminarlabs/influxdb3-management-go/cloud" +) + +func main() { + // Get environment variables + baseURL := os.Getenv("INFLUXDB3_BASE_URL") + if baseURL == "" { + baseURL = "https://console.influxdata.com/api/v0" + } + + accountID := os.Getenv("INFLUXDB3_ACCOUNT_ID") + clusterID := os.Getenv("INFLUXDB3_CLUSTER_ID") + token := os.Getenv("INFLUXDB3_TOKEN") + + if accountID == "" || clusterID == "" || token == "" { + log.Fatal("Please set INFLUXDB3_ACCOUNT_ID, INFLUXDB3_CLUSTER_ID, and INFLUXDB3_TOKEN environment variables") + } + + // Create client + client, err := cloud.NewClientWithResponses(baseURL, cloud.WithRequestEditorFn(func(ctx context.Context, req *http.Request) error { + req.Header.Set("Accept", "application/json") + req.Header.Set("Authorization", "Bearer "+token) + return nil + }), cloud.WithHTTPClient(&http.Client{})) + if err != nil { + log.Fatalf("Failed to create client: %v", err) + } + + ctx := context.Background() + + // Convert string IDs to UuidV4 type + accountUUID, err := uuid.Parse(accountID) + if err != nil { + log.Fatalf("Invalid account ID format: %v", err) + } + + clusterUUID, err := uuid.Parse(clusterID) + if err != nil { + log.Fatalf("Invalid cluster ID format: %v", err) + } + + fmt.Println("๐ŸŒค๏ธ InfluxDB Cloud Dedicated Management API Example") + fmt.Println("==================================================") + + // Example 1: List databases + fmt.Println("\n๐Ÿ“‹ Listing databases...") + resp, err := client.GetClusterDatabasesWithResponse(ctx, accountUUID, clusterUUID, func(ctx context.Context, req *http.Request) error { + req.Header.Set("Authorization", "Bearer "+token) + return nil + }) + if err != nil { + log.Fatalf("Failed to list databases: %v", err) + } + + if resp.StatusCode() == 200 { + fmt.Printf("โœ… Successfully retrieved databases (status: %d)\n", resp.StatusCode()) + for _, db := range *resp.JSON200 { + fmt.Printf(" - %s\n", db.Name) + } + } else { + fmt.Printf("โš ๏ธ Request completed with status: %d\n", resp.StatusCode()) + } + + fmt.Println("\n๐ŸŽ‰ Cloud Dedicated API example completed!") + fmt.Println("\nFor more examples, see: https://github.com/komminarlabs/influxdb3-management-go/tree/main/examples") +} diff --git a/examples/core/main.go b/examples/core/main.go new file mode 100644 index 0000000..9910128 --- /dev/null +++ b/examples/core/main.go @@ -0,0 +1,107 @@ +package main + +import ( + "context" + "fmt" + "log" + "net/http" + "os" + "time" + + "github.com/komminarlabs/influxdb3-management-go/core" +) + +func main() { + // Get environment variables + baseURL := os.Getenv("INFLUXDB_BASE_URL") + if baseURL == "" { + baseURL = "http://localhost:8086" + } + + token := os.Getenv("INFLUXDB_TOKEN") + database := os.Getenv("INFLUXDB_DATABASE") + if database == "" { + database = "example_db" + } + + if token == "" { + log.Fatal("Please set INFLUXDB_TOKEN environment variable") + } + + // Create client + client, err := core.NewClient(baseURL) + if err != nil { + log.Fatalf("Failed to create client: %v", err) + } + + ctx := context.Background() + + fmt.Println("๐Ÿ—๏ธ InfluxDB Core API Example") + fmt.Println("=============================") + + // Example 1: Check health + fmt.Println("\nโค๏ธ Checking server health...") + healthResp, err := client.GetHealthV1(ctx, func(ctx context.Context, req *http.Request) error { + req.Header.Set("Authorization", "Bearer "+token) + return nil + }) + if err != nil { + log.Fatalf("Failed to check health: %v", err) + } + defer healthResp.Body.Close() + + if healthResp.StatusCode == 200 { + fmt.Printf("โœ… Server is healthy (status: %d)\n", healthResp.StatusCode) + } else { + fmt.Printf("โš ๏ธ Health check completed with status: %d\n", healthResp.StatusCode) + } + + // Example 2: Write some sample data + fmt.Println("\n๐Ÿ“ Writing sample data...") + lineProtocolData := fmt.Sprintf("temperature,location=room1 value=23.5 %d", time.Now().UnixNano()) + + writeParams := &core.PostV2WriteParams{ + Db: database, + Precision: core.PrecisionWriteCompatibilityNs, + } + + writeResp, err := client.PostV2WriteWithTextBody(ctx, writeParams, lineProtocolData, func(ctx context.Context, req *http.Request) error { + req.Header.Set("Authorization", "Bearer "+token) + req.Header.Set("Content-Type", "text/plain") + return nil + }) + if err != nil { + log.Printf("Failed to write data: %v", err) + } else { + defer writeResp.Body.Close() + if writeResp.StatusCode == 204 { + fmt.Printf("โœ… Data written successfully (status: %d)\n", writeResp.StatusCode) + } else { + fmt.Printf("โš ๏ธ Write completed with status: %d\n", writeResp.StatusCode) + } + } + + // Example 3: Configure database + fmt.Println("\nโš™๏ธ Configuring database...") + dbConfig := core.PostConfigureDatabaseJSONRequestBody{ + Db: database, + } + + configResp, err := client.PostConfigureDatabase(ctx, dbConfig, func(ctx context.Context, req *http.Request) error { + req.Header.Set("Authorization", "Bearer "+token) + return nil + }) + if err != nil { + log.Printf("Failed to configure database: %v", err) + } else { + defer configResp.Body.Close() + if configResp.StatusCode == 200 || configResp.StatusCode == 201 { + fmt.Printf("โœ… Database configured successfully (status: %d)\n", configResp.StatusCode) + } else { + fmt.Printf("โš ๏ธ Database configuration completed with status: %d\n", configResp.StatusCode) + } + } + + fmt.Println("\n๐ŸŽ‰ Core API example completed!") + fmt.Println("\nFor more examples, see: https://github.com/komminarlabs/influxdb3-management-go/tree/main/examples") +} diff --git a/examples/enterprise/main.go b/examples/enterprise/main.go new file mode 100644 index 0000000..6eeb8d1 --- /dev/null +++ b/examples/enterprise/main.go @@ -0,0 +1,131 @@ +package main + +import ( + "context" + "fmt" + "log" + "net/http" + "os" + "time" + + "github.com/komminarlabs/influxdb3-management-go/enterprise" +) + +func main() { + // Get environment variables + baseURL := os.Getenv("INFLUXDB_BASE_URL") + if baseURL == "" { + baseURL = "http://localhost:8086" + } + + token := os.Getenv("INFLUXDB_TOKEN") + database := os.Getenv("INFLUXDB_DATABASE") + if database == "" { + database = "example_db" + } + + if token == "" { + log.Fatal("Please set INFLUXDB_TOKEN environment variable") + } + + // Create client + client, err := enterprise.NewClient(baseURL) + if err != nil { + log.Fatalf("Failed to create client: %v", err) + } + + ctx := context.Background() + + fmt.Println("๐Ÿข InfluxDB Enterprise API Example") + fmt.Println("==================================") + + // Example 1: Check health + fmt.Println("\nโค๏ธ Checking server health...") + healthResp, err := client.GetHealthV1(ctx, func(ctx context.Context, req *http.Request) error { + req.Header.Set("Authorization", "Bearer "+token) + return nil + }) + if err != nil { + log.Fatalf("Failed to check health: %v", err) + } + defer healthResp.Body.Close() + + if healthResp.StatusCode == 200 { + fmt.Printf("โœ… Server is healthy (status: %d)\n", healthResp.StatusCode) + } else { + fmt.Printf("โš ๏ธ Health check completed with status: %d\n", healthResp.StatusCode) + } + + // Example 2: Write some sample data + fmt.Println("\n๐Ÿ“ Writing sample data...") + lineProtocolData := fmt.Sprintf("temperature,location=datacenter1 value=24.8 %d", time.Now().UnixNano()) + + writeParams := &enterprise.PostV2WriteParams{ + Db: database, + Precision: enterprise.PrecisionWriteCompatibilityNs, + } + + writeResp, err := client.PostV2WriteWithTextBody(ctx, writeParams, lineProtocolData, func(ctx context.Context, req *http.Request) error { + req.Header.Set("Authorization", "Bearer "+token) + req.Header.Set("Content-Type", "text/plain") + return nil + }) + if err != nil { + log.Printf("Failed to write data: %v", err) + } else { + defer writeResp.Body.Close() + if writeResp.StatusCode == 204 { + fmt.Printf("โœ… Data written successfully (status: %d)\n", writeResp.StatusCode) + } else { + fmt.Printf("โš ๏ธ Write completed with status: %d\n", writeResp.StatusCode) + } + } + + // Example 3: Configure database + fmt.Println("\nโš™๏ธ Configuring database...") + dbConfig := enterprise.PostConfigureDatabaseJSONRequestBody{ + Db: database, + } + + configResp, err := client.PostConfigureDatabase(ctx, dbConfig, func(ctx context.Context, req *http.Request) error { + req.Header.Set("Authorization", "Bearer "+token) + return nil + }) + if err != nil { + log.Printf("Failed to configure database: %v", err) + } else { + defer configResp.Body.Close() + if configResp.StatusCode == 200 || configResp.StatusCode == 201 { + fmt.Printf("โœ… Database configured successfully (status: %d)\n", configResp.StatusCode) + } else { + fmt.Printf("โš ๏ธ Database configuration completed with status: %d\n", configResp.StatusCode) + } + } + + // Example 4: Enterprise-specific - Configure processing engine trigger + fmt.Println("\n๐Ÿš€ Configuring processing engine trigger...") + triggerConfig := enterprise.PostConfigureProcessingEngineTriggerJSONRequestBody{ + Db: database, + TriggerName: "example-trigger", + PluginFilename: "example-plugin.py", + TriggerSpecification: "every:1m", // Every minute + } + + triggerResp, err := client.PostConfigureProcessingEngineTrigger(ctx, triggerConfig, func(ctx context.Context, req *http.Request) error { + req.Header.Set("Authorization", "Bearer "+token) + return nil + }) + if err != nil { + log.Printf("Failed to configure processing engine trigger: %v", err) + } else { + defer triggerResp.Body.Close() + if triggerResp.StatusCode == 200 || triggerResp.StatusCode == 201 { + fmt.Printf("โœ… Processing engine trigger configured successfully (status: %d)\n", triggerResp.StatusCode) + } else { + fmt.Printf("โš ๏ธ Processing engine trigger configuration completed with status: %d\n", triggerResp.StatusCode) + } + } + + fmt.Println("\n๐ŸŽ‰ Enterprise API example completed!") + fmt.Println("\nFor more examples, see: https://github.com/komminarlabs/influxdb3-management-go/tree/main/examples") +} diff --git a/examples/go.mod b/examples/go.mod index 313fead..ea6cf84 100644 --- a/examples/go.mod +++ b/examples/go.mod @@ -1,16 +1,15 @@ -module github.com/komminarlabs/influxdb3/examples +module github.com/komminarlabs/influxdb3-management-go/examples go 1.24.1 require ( - github.com/caarlos0/env/v11 v11.3.1 - github.com/hashicorp/go-retryablehttp v0.7.7 - github.com/komminarlabs/influxdb3 v0.1.2 + github.com/google/uuid v1.6.0 + github.com/komminarlabs/influxdb3-management-go v0.1.2 ) require ( github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/oapi-codegen/runtime v1.1.1 // indirect ) + +replace github.com/komminarlabs/influxdb3-management-go => ../ diff --git a/examples/go.sum b/examples/go.sum index 116b145..b5c9d8f 100644 --- a/examples/go.sum +++ b/examples/go.sum @@ -2,28 +2,12 @@ github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMz github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ= github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= -github.com/caarlos0/env/v11 v11.3.1 h1:cArPWC15hWmEt+gWk7YBi7lEXTXCvpaSdCiZE2X5mCA= -github.com/caarlos0/env/v11 v11.3.1/go.mod h1:qupehSf/Y0TUTsxKywqRt/vJjN5nz6vauiYEUUr8P4U= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= -github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= -github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= -github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= -github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU= -github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk= github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= -github.com/komminarlabs/influxdb3 v0.1.2 h1:jvEFshoh5Oy/WzSZW7RPec4xSITYdSSVV/FaqhYJMpg= -github.com/komminarlabs/influxdb3 v0.1.2/go.mod h1:U4OT7gSuEuPS3VWpvJjna8ucY+OUXCKSOBj7maZyZtY= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= -github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/oapi-codegen/runtime v1.1.1 h1:EXLHh0DXIJnWhdRPN2w4MXAzFyE4CskzhNLUmtpMYro= github.com/oapi-codegen/runtime v1.1.1/go.mod h1:SK9X900oXmPWilYR5/WKPzt3Kqxn/uS/+lbpREv+eCg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -33,7 +17,5 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/examples/main.go b/examples/main.go deleted file mode 100644 index c1d94a9..0000000 --- a/examples/main.go +++ /dev/null @@ -1,58 +0,0 @@ -package main - -import ( - "context" - "io" - "net/http" - "time" - - "github.com/caarlos0/env/v11" - "github.com/hashicorp/go-retryablehttp" - "github.com/komminarlabs/influxdb3" -) - -type InfluxdbConfig struct { - AccountId influxdb3.UuidV4 `env:"INFLUXDB_ACCOUNT_ID"` - BaseURL string `env:"INFLUXDB_BASE_URL"` - ClusterId influxdb3.UuidV4 `env:"INFLUXDB_CLUSTER_ID"` - Token string `env:"INFLUXDB_TOKEN"` -} - -func main() { - cfg := InfluxdbConfig{} - opts := env.Options{RequiredIfNoDef: true} - - err := env.ParseWithOptions(&cfg, opts) - if err != nil { - panic(err) - } - - retryClient := retryablehttp.NewClient() - retryClient.Backoff = retryablehttp.LinearJitterBackoff - retryClient.RetryWaitMin = 1 * time.Second - retryClient.RetryWaitMax = 5 * time.Second - retryClient.RetryMax = 3 - - client, err := influxdb3.NewClientWithResponses(cfg.BaseURL, influxdb3.WithRequestEditorFn(func(ctx context.Context, req *http.Request) error { - req.Header.Set("Accept", "application/json") - req.Header.Set("Authorization", "Bearer "+cfg.Token) - return nil - }), influxdb3.WithHTTPClient(retryClient.StandardClient())) - if err != nil { - panic(err) - } - - resp, err := client.GetClusterDatabases(context.Background(), cfg.AccountId, cfg.ClusterId) - if err != nil { - panic(err) - } - - if resp.StatusCode == http.StatusOK { - bodyBytes, err := io.ReadAll(resp.Body) - if err != nil { - panic(err) - } - bodyString := string(bodyBytes) - println(bodyString) - } -} diff --git a/generate.go b/generate.go index 8d6140b..d15e968 100644 --- a/generate.go +++ b/generate.go @@ -1,4 +1,13 @@ package influxdb3 -//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -generate types -o types.gen.go -package influxdb3 openapi.yml -//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -generate client -o client.gen.go -package influxdb3 openapi.yml +// InfluxDB Cloud Dedicated Management API +//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -generate types -o cloud/types.gen.go -package cloud specs/cloud/openapi.yml +//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -generate client -o cloud/client.gen.go -package cloud specs/cloud/openapi.yml + +// InfluxDB Core API +//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -generate types -o core/types.gen.go -package core specs/core/ref.yml +//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -generate client -o core/client.gen.go -package core specs/core/ref.yml + +// InfluxDB Enterprise API +//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -generate types -o enterprise/types.gen.go -package enterprise specs/enterprise/ref.yml +//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -generate client -o enterprise/client.gen.go -package enterprise specs/enterprise/ref.yml diff --git a/go.mod b/go.mod index 4ac0872..26f831c 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/komminarlabs/influxdb3 +module github.com/komminarlabs/influxdb3-management-go go 1.22.5 diff --git a/openapi.yml b/specs/cloud/openapi.yml similarity index 96% rename from openapi.yml rename to specs/cloud/openapi.yml index 74868b4..374a9ab 100644 --- a/openapi.yml +++ b/specs/cloud/openapi.yml @@ -40,6 +40,7 @@ tags: See how to [create a management token](/influxdb3/cloud-dedicated/admin/tokens/management/). By default, management tokens in InfluxDB 3 are short-lived tokens issued by an OAuth2 identity provider that grant a specific user administrative access to your InfluxDB cluster. However, for automation purposes, you can manually create management tokens that authenticate directly with your InfluxDB cluster and do not require human interaction with your identity provider. + - name: Database tokens description: Manage database read/write tokens for a cluster - name: Databases @@ -397,6 +398,26 @@ paths: post: operationId: CreateClusterDatabase summary: Create a database + description: | + Create a database for a cluster. + + The database name must be unique within the cluster. + + **Default maximum number of columns**: 250 + **Default maximum number of tables**: 500 + + The retention period is specified in nanoseconds. For example, to set a retention period of 1 hour, use `3600000000000`. + + InfluxDB Cloud Dedicated lets you define a [custom partitioning](/influxdb3/cloud-dedicated/admin/custom-partitions/) strategy for each database and table. + A _partition_ is a logical grouping of data stored in [Apache Parquet](https://parquet.apache.org/). + By default, data is partitioned by day, + but, depending on your schema and workload, customizing the partitioning + strategy can improve query performance. + + To use custom partitioning, you define a [partition template](/influxdb3/cloud-dedicated/admin/custom-partitions/partition-templates/). + If a table doesn't have a custom partition template, it inherits the database's template. + The partition template is set at the time of database creation and cannot be changed later. + For more information, see [Custom partitions](/influxdb3/cloud-dedicated/admin/custom-partitions/). tags: - Databases parameters: @@ -779,6 +800,18 @@ paths: post: operationId: CreateClusterDatabaseTable summary: Create a database table + description: | + Create a table. The database must already exist. With InfluxDB Cloud Dedicated, tables and measurements are synonymous. + + Typically, tables are created automatically on write using the measurement name + specified in line protocol written to InfluxDB. + However, to apply a [custom partition template](/influxdb3/cloud-dedicated/admin/custom-partitions/) + to a table, you must manually [create the table with custom partitioning](/influxdb3/cloud-dedicated/admin/tables/#create-a-table-with-custom-partitioning) before you write any data to it. + + Partitioning defaults to `%Y-%m-%d` (daily). + When a partition template is applied to a database, it becomes the default template + for all tables in that database, but can be overridden when creating a + table. tags: - Tables parameters: @@ -1185,6 +1218,14 @@ paths: get: operationId: GetDatabaseToken summary: Get a database token + description: | + Retrieve metadata details for a [database token](/influxdb3/cloud-dedicated/admin/tokens/database/). + + #### Store secure tokens in a secret store + + We recommend storing database tokens in a **secure secret store**. + + Token strings are viewable _only_ on token creation and aren't stored by InfluxDB; you can't recover a lost token. tags: - Database tokens parameters: @@ -1299,6 +1340,8 @@ paths: patch: operationId: UpdateDatabaseToken summary: Update a database token + description: | + Update the description and permissions of a [database token](/influxdb3/cloud-dedicated/admin/tokens/database/). tags: - Database tokens parameters: @@ -1317,7 +1360,6 @@ paths: - name: tokenId in: path description: The ID of the [database token](/influxdb3/cloud-dedicated/admin/tokens/database/) to update - required: true schema: $ref: '#/components/schemas/UuidV4' requestBody: @@ -1625,9 +1667,9 @@ components: description: | A template for [partitioning](/influxdb3/cloud-dedicated/admin/custom-partitions/) a cluster database. - Each template part is evaluated in sequence, concatinating the final - partition key from the output of each part, delimited by the partition - key delimiter `|`. + Each partition template part is evaluated in sequence. + The outputs from each part are concatenated with the + `|` delimiter to form the final partition key. For example, using the partition template below: diff --git a/specs/core/ref.yml b/specs/core/ref.yml new file mode 100644 index 0000000..3f4a738 --- /dev/null +++ b/specs/core/ref.yml @@ -0,0 +1,2075 @@ +openapi: 3.0.3 +info: + title: InfluxDB 3 Core API Service + description: | + The InfluxDB HTTP API for InfluxDB 3 Core provides a programmatic interface for + interacting with InfluxDB 3 Core databases and resources. + Use this API to: + + - Write data to InfluxDB 3 Core databases + - Query data using SQL or InfluxQL + - Process data using Processing engine plugins + - Manage databases, tables, and Processing engine triggers + - Perform administrative tasks and access system information + + The API includes endpoints under the following paths: + - `/api/v3`: InfluxDB 3 Core native endpoints + - `/`: Compatibility endpoints for InfluxDB v1 workloads and clients + - `/api/v2/write`: Compatibility endpoint for InfluxDB v2 workloads and clients + + + version: '' + license: + name: MIT + url: https://opensource.org/licenses/MIT + contact: + name: InfluxData + url: https://www.influxdata.com + email: support@influxdata.com +servers: + - url: https://{baseurl} + description: InfluxDB 3 Core API URL + variables: + baseurl: + enum: + - localhost:8181 + default: localhost:8181 + description: InfluxDB 3 Core URL +security: + - BearerAuth: [] +tags: + - name: Authentication + description: | + Authenticate to the InfluxDB 3 API using a bearer token. + + The InfluxDB 3 API uses tokens for authentication. + To authenticate, include the `Authorization` header in your request with the value `Bearer `. + The token must be a valid InfluxDB 3 admin token. + + #### Related guides + + - [Manage tokens](/influxdb3/core/admin/tokens/) + - [Authentication and authorization](/influxdb3/core/reference/internals/authentication/) + x-traitTag: true + - name: Cache data + description: | + Manage the in-memory cache. + + #### Distinct Value Cache + + The Distinct Value Cache (DVC) lets you cache distinct + values of one or more columns in a table, improving the performance of + queries that return distinct tag and field values. + + The DVC is an in-memory cache that stores distinct values for specific columns + in a table. When you create an DVC, you can specify what columns' distinct + values to cache, the maximum number of distinct value combinations to cache, and + the maximum age of cached values. A DVC is associated with a table, which can + have multiple DVCs. + + #### Last value cache + + The Last Value Cache (LVC) lets you cache the most recent + values for specific fields in a table, improving the performance of queries that + return the most recent value of a field for specific series or the last N values + of a field. + + The LVC is an in-memory cache that stores the last N number of values for + specific fields of series in a table. When you create an LVC, you can specify + what fields to cache, what tags to use to identify each series, and the + number of values to cache for each unique series. + An LVC is associated with a table, which can have multiple LVCs. + + #### Related guides + + - [Manage the Distinct Value Cache](/influxdb3/core/admin/distinct-value-cache/) + - [Manage the Last Value Cache](/influxdb3/core/admin/last-value-cache/) + - name: Compatibility endpoints + description: | + InfluxDB 3 provides compatibility endpoints for InfluxDB 1.x and InfluxDB 2.x workloads and clients. + + ### Write data using v1- or v2-compatible endpoints + + - [`/api/v2/write` endpoint](#operation/PostV2Write) + for InfluxDB v2 clients and when you bring existing InfluxDB v2 write workloads to InfluxDB 3. + - [`/write` endpoint](#operation/PostV1Write) for InfluxDB v1 clients and when you bring existing InfluxDB v1 write workloads to InfluxDB 3. + + For new workloads, use the [`/api/v3/write_lp` endpoint](#operation/PostWriteLP). + + All endpoints accept the same line protocol format. + + ### Query data + + Use the HTTP [`/query`](#operation/GetV1ExecuteQuery) endpoint for InfluxDB v1 clients and v1 query workloads using InfluxQL. + + For new workloads, use one of the following: + + - HTTP [`/api/v3/query_sql` endpoint](#operation/GetExecuteQuerySQL) for new query workloads using SQL. + - HTTP [`/api/v3/query_influxql` endpoint](#operation/GetExecuteInfluxQLQuery) for new query workloads using InfluxQL. + - Flight SQL and InfluxDB 3 _Flight+gRPC_ APIs for querying with SQL or InfluxQL. For more information about using Flight APIs, see [InfluxDB 3 client libraries](https://github.com/InfluxCommunity?q=influxdb3&type=public&language=&sort=). + + ### Server information + + Server information endpoints such as `/health` and `metrics` are compatible with InfluxDB 1.x and InfluxDB 2.x clients. + - name: Database + description: Manage databases + - description: | + Most InfluxDB API endpoints require parameters in the request--for example, specifying the database to use. + + ### Common parameters + + The following table shows common parameters used by many InfluxDB API endpoints. + Many endpoints may require other parameters in the query string or in the + request body that perform functions specific to those endpoints. + + | Query parameter | Value type | Description | + |:------------------------ |:--------------------- |:-------------------------------------------| + | `db` | string | The database name | + + InfluxDB HTTP API endpoints use standard HTTP request and response headers. + The following table shows common headers used by many InfluxDB API endpoints. + Some endpoints may use other headers that perform functions more specific to those endpoints--for example, + the write endpoints accept the `Content-Encoding` header to indicate that line protocol is compressed in the request body. + + | Header | Value type | Description | + |:------------------------ |:--------------------- |:-------------------------------------------| + | `Accept` | string | The content type that the client can understand. | + | `Authorization` | string | The authorization scheme and credential. | + | `Content-Length` | integer | The size of the entity-body, in bytes. | + | `Content-Type` | string | The format of the data in the request body. | + name: Headers and parameters + x-traitTag: true + - name: Processing engine + description: | + Manage Processing engine triggers, test plugins, and send requests to trigger On Request plugins. + + InfluxDB 3 Core provides the InfluxDB 3 processing engine, an embedded Python VM that can dynamically load and trigger Python plugins in response to events in your database. + Use Processing engine plugins and triggers to run code and perform tasks for different database events. + + To get started with the processing engine, see the [Processing engine and Python plugins](/influxdb3/core/processing-engine/) guide. + - name: Query data + description: Query data using SQL or InfluxQL + - name: Quick start + description: | + 1. [Create an admin token](#section/Authentication) to authorize API requests. + + ```bash + curl -X POST "http://localhost:8181/api/v3/configure/token/admin" + ``` + 2. [Check the status](#section/Server-information) of the InfluxDB server. + + ```bash + curl "http://localhost:8181/health" \ + --header "Authorization: Bearer ADMIN_TOKEN" + ``` + + 3. [Write data](#operation/PostWriteLP) to InfluxDB. + + ```bash + curl "http://localhost:8181/api/v3/write_lp?db=sensors&precision=auto" + --header "Authorization: Bearer ADMIN_TOKEN" \ + --data-raw "home,room=Kitchen temp=72.0 + home,room=Living\ room temp=71.5" + ``` + + If all data is written, the response is `204 No Content`. + + 4. [Query data](#operation/GetExecuteQuerySQL) from InfluxDB. + + ```bash + curl -G "http://localhost:8181/api/v3/query_sql" \ + --header "Authorization: Bearer ADMIN_TOKEN" \ + --data-urlencode "db=sensors" \ + --data-urlencode "q=SELECT * FROM home WHERE room='Living room'" \ + --data-urlencode "format=jsonl" + ``` + + Output: + + ```jsonl + {"room":"Living room","temp":71.5,"time":"2025-02-25T20:19:34.984098"} + ``` + + For more information about using InfluxDB 3 Core, see the [Get started](/influxdb3/core/get-started/) guide. + x-traitTag: true + - name: Server information + description: Retrieve server metrics, status, and version information + - name: Table + description: Manage table schemas and data + - name: Token + description: Manage tokens for authentication and authorization + - name: Write data + description: Write data to InfluxDB 3 +paths: + /write: + post: + operationId: PostV1Write + summary: Write line protocol (v1-compatible) + description: | + Writes line protocol to the specified database. + + This endpoint provides backward compatibility for InfluxDB 1.x write workloads using tools such as InfluxDB 1.x client libraries, the Telegraf `outputs.influxdb` output plugin, or third-party tools. + + Use this endpoint to send data in [line protocol](https://docs.influxdata.com/influxdb3/core/reference/syntax/line-protocol/) format to InfluxDB. + Use query parameters to specify options for writing data. + parameters: + - $ref: '#/components/parameters/dbWriteParam' + - $ref: '#/components/parameters/compatibilityPrecisionParam' + - name: Content-Type + in: header + description: | + The content type of the request payload. + schema: + $ref: '#/components/schemas/LineProtocol' + required: false + - name: Accept + in: header + description: | + The content type that the client can understand. + Writes only return a response body if they fail (partially or completely)--for example, + due to a syntax problem or type mismatch. + schema: + type: string + default: application/json + enum: + - application/json + required: false + - $ref: '#/components/parameters/ContentEncoding' + - $ref: '#/components/parameters/ContentLength' + requestBody: + $ref: '#/components/requestBodies/lineProtocolRequestBody' + responses: + '204': + description: Success ("No Content"). All data in the batch is written and queryable. + '400': + description: | + Bad request. Some (a _partial write_) or all of the data from the batch was rejected and not written. + If a partial write occurred, then some points from the batch are written and queryable. + + The response body: + - indicates if a partial write occurred or all data was rejected. + - contains details about the [rejected points](/influxdb3/core/write-data/troubleshoot/#troubleshoot-rejected-points), up to 100 points. + content: + application/json: + examples: + rejectedAllPoints: + summary: Rejected all points in the batch + value: | + { + "error": "write of line protocol failed", + "data": [ + { + "original_line": "dquote> home,room=Kitchen temp=hi", + "line_number": 2, + "error_message": "No fields were provided" + } + ] + } + partialWriteErrorWithRejectedPoints: + summary: Partial write rejected some points in the batch + value: | + { + "error": "partial write of line protocol occurred", + "data": [ + { + "original_line": "dquote> home,room=Kitchen temp=hi", + "line_number": 2, + "error_message": "No fields were provided" + } + ] + } + '401': + $ref: '#/components/responses/Unauthorized' + '403': + description: Access denied. + '413': + description: Request entity too large. + tags: + - Compatibility endpoints + - Write data + /api/v2/write: + post: + operationId: PostV2Write + summary: Write line protocol (v2-compatible) + description: | + Writes line protocol to the specified database. + + This endpoint provides backward compatibility for InfluxDB 2.x write workloads using tools such as InfluxDB 2.x client libraries, the Telegraf `outputs.influxdb_v2` output plugin, or third-party tools. + + Use this endpoint to send data in [line protocol](/influxdb3/core/reference/syntax/line-protocol/) format to InfluxDB. + Use query parameters to specify options for writing data. + parameters: + - name: Content-Type + in: header + description: | + The content type of the request payload. + schema: + $ref: '#/components/schemas/LineProtocol' + required: false + - description: | + The compression applied to the line protocol in the request payload. + To send a gzip payload, pass `Content-Encoding: gzip` header. + in: header + name: Content-Encoding + schema: + default: identity + description: | + Content coding. + Use `gzip` for compressed data or `identity` for unmodified, uncompressed data. + enum: + - gzip + - identity + type: string + - description: | + The size of the entity-body, in bytes, sent to InfluxDB. + in: header + name: Content-Length + schema: + description: The length in decimal number of octets. + type: integer + - description: | + The content type that the client can understand. + Writes only return a response body if they fail (partially or completely)--for example, + due to a syntax problem or type mismatch. + in: header + name: Accept + schema: + default: application/json + description: Error content type. + enum: + - application/json + type: string + - name: db + in: query + required: true + schema: + type: string + description: | + A database name. + InfluxDB creates the database if it doesn't already exist, and then + writes all points in the batch to the database. + - name: accept_partial + in: query + required: false + schema: + $ref: '#/components/schemas/AcceptPartial' + - $ref: '#/components/parameters/compatibilityPrecisionParam' + requestBody: + $ref: '#/components/requestBodies/lineProtocolRequestBody' + responses: + '204': + description: Success ("No Content"). All data in the batch is written and queryable. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '403': + description: Access denied. + '413': + description: Request entity too large. + tags: + - Compatibility endpoints + - Write data + /api/v3/write_lp: + post: + operationId: PostWriteLP + summary: Write line protocol + description: | + Writes line protocol to the specified database. + + Use this endpoint to send data in [line protocol](/influxdb3/core/reference/syntax/line-protocol/) format to InfluxDB. + Use query parameters to specify options for writing data. + parameters: + - $ref: '#/components/parameters/dbWriteParam' + - $ref: '#/components/parameters/accept_partial' + - $ref: '#/components/parameters/precisionParam' + - name: no_sync + in: query + schema: + $ref: '#/components/schemas/NoSync' + - name: Content-Type + in: header + description: | + The content type of the request payload. + schema: + $ref: '#/components/schemas/LineProtocol' + required: false + - name: Accept + in: header + description: | + The content type that the client can understand. + Writes only return a response body if they fail (partially or completely)--for example, + due to a syntax problem or type mismatch. + schema: + type: string + default: application/json + enum: + - application/json + required: false + - $ref: '#/components/parameters/ContentEncoding' + - $ref: '#/components/parameters/ContentLength' + requestBody: + $ref: '#/components/requestBodies/lineProtocolRequestBody' + responses: + '204': + description: Success ("No Content"). All data in the batch is written and queryable. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '403': + description: Access denied. + '413': + description: Request entity too large. + '422': + description: Unprocessable entity. + tags: + - Write data + /api/v3/query_sql: + get: + operationId: GetExecuteQuerySQL + summary: Execute SQL query + description: Executes an SQL query to retrieve data from the specified database. + parameters: + - $ref: '#/components/parameters/db' + - $ref: '#/components/parameters/querySqlParam' + - $ref: '#/components/parameters/format' + - $ref: '#/components/parameters/AcceptQueryHeader' + - $ref: '#/components/parameters/ContentType' + responses: + '200': + description: Success. The response body contains query results. + content: + application/json: + schema: + $ref: '#/components/schemas/QueryResponse' + example: + results: + - series: + - name: mytable + columns: + - time + - value + values: + - - '2024-02-02T12:00:00Z' + - 42 + text/csv: + schema: + type: string + application/vnd.apache.parquet: + schema: + type: string + application/jsonl: + schema: + type: string + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '403': + description: Access denied. + '404': + description: Database not found. + '405': + description: Method not allowed. + '422': + description: Unprocessable entity. + tags: + - Query data + post: + operationId: PostExecuteQuerySQL + summary: Execute SQL query + description: Executes an SQL query to retrieve data from the specified database. + parameters: + - $ref: '#/components/parameters/AcceptQueryHeader' + - $ref: '#/components/parameters/ContentType' + requestBody: + $ref: '#/components/requestBodies/queryRequestBody' + responses: + '200': + description: Success. The response body contains query results. + content: + application/json: + schema: + $ref: '#/components/schemas/QueryResponse' + text/csv: + schema: + type: string + application/vnd.apache.parquet: + schema: + type: string + application/jsonl: + schema: + type: string + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '403': + description: Access denied. + '404': + description: Database not found. + '405': + description: Method not allowed. + '422': + description: Unprocessable entity. + tags: + - Query data + /api/v3/query_influxql: + get: + operationId: GetExecuteInfluxQLQuery + summary: Execute InfluxQL query + description: Executes an InfluxQL query to retrieve data from the specified database. + parameters: + - $ref: '#/components/parameters/dbQueryParam' + - name: q + in: query + required: true + schema: + type: string + - name: format + in: query + required: false + schema: + type: string + - $ref: '#/components/parameters/AcceptQueryHeader' + responses: + '200': + description: Success. The response body contains query results. + content: + application/json: + schema: + $ref: '#/components/schemas/QueryResponse' + text/csv: + schema: + type: string + application/vnd.apache.parquet: + schema: + type: string + application/jsonl: + schema: + type: string + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '403': + description: Access denied. + '404': + description: Database not found. + '405': + description: Method not allowed. + '422': + description: Unprocessable entity. + tags: + - Query data + post: + operationId: PostExecuteQueryInfluxQL + summary: Execute InfluxQL query + description: Executes an InfluxQL query to retrieve data from the specified database. + parameters: + - $ref: '#/components/parameters/AcceptQueryHeader' + - $ref: '#/components/parameters/ContentType' + requestBody: + $ref: '#/components/requestBodies/queryRequestBody' + responses: + '200': + description: Success. The response body contains query results. + content: + application/json: + schema: + $ref: '#/components/schemas/QueryResponse' + text/csv: + schema: + type: string + application/vnd.apache.parquet: + schema: + type: string + application/jsonl: + schema: + type: string + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '403': + description: Access denied. + '404': + description: Database not found. + '405': + description: Method not allowed. + '422': + description: Unprocessable entity. + tags: + - Query data + /query: + get: + operationId: GetV1ExecuteQuery + summary: Execute InfluxQL query (v1-compatible) + description: | + Executes an InfluxQL query to retrieve data from the specified database. + + This endpoint is compatible with InfluxDB 1.x client libraries and third-party integrations such as Grafana. + Use query parameters to specify the database and the InfluxQL query. + parameters: + - name: Accept + in: header + schema: + type: string + default: application/json + enum: + - application/json + - application/csv + - text/csv + required: false + description: | + The content type that the client can understand. + + If `text/csv` is specified, the `Content-type` response header is `application/csv` and the response is formatted as CSV. + + Returns an error if the format is invalid or non-UTF8. + - in: query + name: chunked + description: | + If true, the response is divided into chunks of size `chunk_size`. + schema: + type: boolean + default: false + - in: query + name: chunk_size + description: | + The number of records that will go into a chunk. + This parameter is only used if `chunked=true`. + schema: + type: integer + default: 10000 + - in: query + name: db + description: The database to query. If not provided, the InfluxQL query string must specify the database. + schema: + type: string + format: InfluxQL + - in: query + name: pretty + description: | + If true, the JSON response is formatted in a human-readable format. + schema: + type: boolean + default: false + - in: query + name: q + description: The InfluxQL query string. + required: true + schema: + type: string + - name: epoch + description: | + Formats timestamps as [unix (epoch) timestamps](/influxdb3/core/reference/glossary/#unix-timestamp) with the specified precision + instead of [RFC3339 timestamps](/influxdb3/core/reference/glossary/#rfc3339-timestamp) with nanosecond precision. + in: query + schema: + $ref: '#/components/schemas/EpochCompatibility' + responses: + '200': + description: | + Success. The response body contains query results. + content: + application/json: + schema: + $ref: '#/components/schemas/QueryResponse' + application/csv: + schema: + type: string + headers: + Content-Type: + description: | + The content type of the response. + Default is `application/json`. + + If the `Accept` request header is `application/csv` or `text/csv`, the `Content-type` response header is `application/csv` + and the response is formatted as CSV. + schema: + type: string + default: application/json + enum: + - application/json + - application/csv + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '403': + description: Access denied. + '404': + description: Database not found. + '405': + description: Method not allowed. + '422': + description: Unprocessable entity. + tags: + - Query data + - Compatibility endpoints + post: + operationId: PostExecuteV1Query + summary: Execute InfluxQL query (v1-compatible) + description: Executes an InfluxQL query to retrieve data from the specified database. + requestBody: + content: + application/json: + schema: + type: object + properties: + db: + type: string + description: The database to query. If not provided, the InfluxQL query string must specify the database. + q: + description: The InfluxQL query string. + type: string + chunked: + description: | + If true, the response is divided into chunks of size `chunk_size`. + type: boolean + chunk_size: + description: | + The number of records that will go into a chunk. + This parameter is only used if `chunked=true`. + type: integer + default: 10000 + epoch: + description: | + A unix timestamp precision. + + - `h` for hours + - `m` for minutes + - `s` for seconds + - `ms` for milliseconds + - `u` or `ยต` for microseconds + - `ns` for nanoseconds + + Formats timestamps as [unix (epoch) timestamps](/influxdb3/core/reference/glossary/#unix-timestamp) with the specified precision + instead of [RFC3339 timestamps](/influxdb3/core/reference/glossary/#rfc3339-timestamp) with nanosecond precision. + enum: + - ns + - u + - ยต + - ms + - s + - m + - h + type: string + pretty: + description: | + If true, the JSON response is formatted in a human-readable format. + type: boolean + required: + - q + parameters: + - name: Accept + in: header + schema: + type: string + default: application/json + enum: + - application/json + - application/csv + - text/csv + required: false + description: | + The content type that the client can understand. + + If `text/csv` is specified, the `Content-type` response header is `application/csv` and the response is formatted as CSV. + + Returns an error if the format is invalid or non-UTF8. + responses: + '200': + description: | + Success. The response body contains query results. + content: + application/json: + schema: + $ref: '#/components/schemas/QueryResponse' + application/csv: + schema: + type: string + headers: + Content-Type: + description: | + The content type of the response. + Default is `application/json`. + + If the `Accept` request header is `application/csv` or `text/csv`, the `Content-type` response header is `application/csv` + and the response is formatted as CSV. + schema: + type: string + default: application/json + enum: + - application/json + - application/csv + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '403': + description: Access denied. + '404': + description: Database not found. + '405': + description: Method not allowed. + '422': + description: Unprocessable entity. + tags: + - Query data + - Compatibility endpoints + /health: + get: + operationId: GetHealth + summary: Health check + description: Checks the status of the service. + responses: + '200': + description: Service is running. + '500': + description: Service is unavailable. + tags: + - Server information + /api/v1/health: + get: + operationId: GetHealthV1 + summary: Health check (v1) + description: Checks the status of the service. + responses: + '200': + description: Service is running. + '500': + description: Service is unavailable. + tags: + - Server information + - Compatibility endpoints + /ping: + get: + operationId: GetPing + tags: + - Server information + summary: Ping the server + description: Returns version information for the server. + responses: + '200': + description: Success. The response body contains server information. + content: + application/json: + schema: + example: + version: 0.1.0 + revision: f3d3d3d + /metrics: + get: + operationId: GetMetrics + summary: Metrics + description: Retrieves Prometheus-compatible server metrics. + responses: + '200': + description: Success. The response body contains Prometheus-compatible server metrics. + tags: + - Server information + /api/v3/configure/database: + get: + operationId: GetConfigureDatabase + summary: List databases + description: Retrieves a list of databases. + parameters: + - $ref: '#/components/parameters/formatRequired' + responses: + '200': + description: Success. The response body contains the list of databases. + content: + application/json: + schema: + $ref: '#/components/schemas/ShowDatabasesResponse' + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Database not found. + tags: + - Database + post: + operationId: PostConfigureDatabase + summary: Create a database + description: Creates a new database in the system. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateDatabaseRequest' + responses: + '201': + description: Success. Database created. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '409': + description: Database already exists. + tags: + - Database + delete: + operationId: DeleteConfigureDatabase + summary: Delete a database + description: | + Soft deletes a database. + The database is scheduled for deletion and unavailable for querying. + parameters: + - $ref: '#/components/parameters/db' + responses: + '200': + description: Success. Database deleted. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Database not found. + tags: + - Database + /api/v3/configure/table: + post: + operationId: PostConfigureTable + summary: Create a table + description: Creates a new table within a database. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateTableRequest' + responses: + '201': + description: Success. The table has been created. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Database not found. + tags: + - Table + delete: + operationId: DeleteConfigureTable + summary: Delete a table + description: | + Soft deletes a table. + The table is scheduled for deletion and unavailable for querying. + parameters: + - $ref: '#/components/parameters/db' + - name: table + in: query + required: true + schema: + type: string + responses: + '200': + description: Success (no content). The table has been deleted. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Table not found. + tags: + - Table + /api/v3/configure/distinct_cache: + post: + operationId: PostConfigureDistinctCache + summary: Create distinct cache + description: Creates a distinct cache for a table. + tags: + - Cache data + - Table + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DistinctCacheCreateRequest' + responses: + '201': + description: Success. The distinct cache has been created. + '204': + description: Not created. A distinct cache with this configuration already exists. + '400': + description: | + Bad request. + + The server responds with status `400` if the request would overwrite an existing cache with a different configuration. + /api/v3/configure/last_cache: + post: + operationId: PostConfigureLastCache + summary: Create last cache + description: Creates a last cache for a table. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/LastCacheCreateRequest' + responses: + '201': + description: Success. Last cache created. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Cache not found. + '409': + description: Cache already exists. + tags: + - Cache data + - Table + delete: + operationId: DeleteConfigureLastCache + summary: Delete last cache + description: Deletes a last cache. + parameters: + - $ref: '#/components/parameters/db' + - name: table + in: query + required: true + schema: + type: string + - name: name + in: query + required: true + schema: + type: string + responses: + '200': + description: Success. The last cache has been deleted. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Cache not found. + tags: + - Cache data + - Table + /api/v3/configure/processing_engine_trigger: + post: + operationId: PostConfigureProcessingEngineTrigger + summary: Create processing engine trigger + description: | + Creates a processing engine trigger with the specified plugin file and trigger specification. + + ### Related guides + + - [Processing engine and Python plugins](/influxdb3/core/plugins/) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ProcessingEngineTriggerRequest' + examples: + schedule_cron: + summary: Schedule trigger using cron + description: | + In `"cron:CRON_EXPRESSION"`, `CRON_EXPRESSION` uses extended 6-field cron format. + The cron expression `0 0 6 * * 1-5` means the trigger will run at 6:00 AM every weekday (Monday to Friday). + value: + db: DATABASE_NAME + plugin_filename: schedule.py + trigger_name: schedule_cron_trigger + trigger_specification: cron:0 0 6 * * 1-5 + schedule_every: + summary: Schedule trigger using interval + description: | + In `"every:DURATION"`, `DURATION` specifies the interval between trigger executions. + The duration `1h` means the trigger will run every hour. + value: + db: mydb + plugin_filename: schedule.py + trigger_name: schedule_every_trigger + trigger_specification: every:1h + schedule_every_seconds: + summary: Schedule trigger using seconds interval + description: | + Example of scheduling a trigger to run every 30 seconds. + value: + db: mydb + plugin_filename: schedule.py + trigger_name: schedule_every_30s_trigger + trigger_specification: every:30s + schedule_every_minutes: + summary: Schedule trigger using minutes interval + description: | + Example of scheduling a trigger to run every 5 minutes. + value: + db: mydb + plugin_filename: schedule.py + trigger_name: schedule_every_5m_trigger + trigger_specification: every:5m + all_tables: + summary: All tables trigger example + description: | + Trigger that fires on write events to any table in the database. + value: + db: mydb + plugin_filename: all_tables.py + trigger_name: all_tables_trigger + trigger_specification: all_tables + table_specific: + summary: Table-specific trigger example + description: | + Trigger that fires on write events to a specific table. + value: + db: mydb + plugin_filename: table.py + trigger_name: table_trigger + trigger_specification: table:sensors + api_request: + summary: On-demand request trigger example + description: | + Creates an HTTP endpoint `/api/v3/engine/hello-world` for manual invocation. + value: + db: mydb + plugin_filename: request.py + trigger_name: hello_world_trigger + trigger_specification: path:hello-world + cron_friday_afternoon: + summary: Cron trigger for Friday afternoons + description: | + Example of a cron trigger that runs every Friday at 2:30 PM. + value: + db: reports + plugin_filename: weekly_report.py + trigger_name: friday_report_trigger + trigger_specification: cron:0 30 14 * * 5 + cron_monthly: + summary: Cron trigger for monthly execution + description: | + Example of a cron trigger that runs on the first day of every month at midnight. + value: + db: monthly_data + plugin_filename: monthly_cleanup.py + trigger_name: monthly_cleanup_trigger + trigger_specification: cron:0 0 0 1 * * + responses: + '200': + description: Success. Processing engine trigger created. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Trigger not found. + tags: + - Processing engine + delete: + operationId: DeleteConfigureProcessingEngineTrigger + summary: Delete processing engine trigger + description: Deletes a processing engine trigger. + parameters: + - $ref: '#/components/parameters/db' + - name: trigger_name + in: query + required: true + schema: + type: string + - name: force + in: query + required: false + schema: + type: boolean + default: false + responses: + '200': + description: Success. The processing engine trigger has been deleted. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Trigger not found. + tags: + - Processing engine + /api/v3/configure/processing_engine_trigger/disable: + post: + operationId: PostDisableProcessingEngineTrigger + summary: Disable processing engine trigger + description: Disables a processing engine trigger. + parameters: + - $ref: '#/components/parameters/ContentType' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ProcessingEngineTriggerRequest' + responses: + '200': + description: Success. The processing engine trigger has been disabled. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Trigger not found. + tags: + - Processing engine + /api/v3/configure/processing_engine_trigger/enable: + post: + operationId: PostEnableProcessingEngineTrigger + summary: Enable processing engine trigger + description: Enables a processing engine trigger. + parameters: + - $ref: '#/components/parameters/ContentType' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ProcessingEngineTriggerRequest' + responses: + '200': + description: Success. The processing engine trigger is enabled. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Trigger not found. + tags: + - Processing engine + /api/v3/configure/plugin_environment/install_packages: + post: + operationId: PostInstallPluginPackages + summary: Install plugin packages + description: | + Installs the specified Python packages into the processing engine plugin environment. + + This endpoint is synchronous and blocks until the packages are installed. + + ### Related guides + + - [Processing engine and Python plugins](/influxdb3/core/plugins/) + parameters: + - $ref: '#/components/parameters/ContentType' + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + packages: + type: array + items: + type: string + description: | + A list of Python package names to install. + Can include version specifiers (e.g., "scipy==1.9.0"). + example: + - influxdb3-python + - scipy + - pandas==1.5.0 + - requests + required: + - packages + example: + packages: + - influxdb3-python + - scipy + - pandas==1.5.0 + - requests + responses: + '200': + description: Success. The packages are installed. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + tags: + - Processing engine + /api/v3/configure/plugin_environment/install_requirements: + post: + operationId: PostInstallPluginRequirements + summary: Install plugin requirements + description: | + Installs requirements from a requirements file (also known as a "pip requirements file") into the processing engine plugin environment. + + This endpoint is synchronous and blocks until the requirements are installed. + + ### Related + + - [Processing engine and Python plugins](/influxdb3/core/plugins/) + - [Python requirements file format](https://pip.pypa.io/en/stable/reference/requirements-file-format/) + parameters: + - $ref: '#/components/parameters/ContentType' + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + requirements_location: + type: string + description: | + The path to the requirements file containing Python packages to install. + Can be a relative path (relative to the plugin directory) or an absolute path. + example: requirements.txt + required: + - requirements_location + example: + requirements_location: requirements.txt + responses: + '200': + description: Success. The requirements have been installed. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + tags: + - Processing engine + /api/v3/plugin_test/wal: + post: + operationId: PostTestWALPlugin + summary: Test WAL plugin + description: Executes a test of a write-ahead logging (WAL) plugin. + responses: + '200': + description: Success. The plugin test has been executed. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Plugin not enabled. + tags: + - Processing engine + /api/v3/plugin_test/schedule: + post: + operationId: PostTestSchedulingPlugin + summary: Test scheduling plugin + description: Executes a test of a scheduling plugin. + responses: + '200': + description: Success. The plugin test has been executed. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Plugin not enabled. + tags: + - Processing engine + /api/v3/engine/{plugin_path}: + parameters: + - name: plugin_path + description: | + The path configured in the request trigger specification "path:"` for the plugin. + + For example, if you define a trigger with the following: + + ```json + trigger-spec: "path:hello-world" + ``` + + then, the HTTP API exposes the following plugin endpoint: + + ``` + /api/v3/engine/hello-world + ``` + in: path + required: true + schema: + type: string + get: + operationId: GetProcessingEnginePluginRequest + summary: On Request processing engine plugin request + description: | + Executes the On Request processing engine plugin specified in ``. + The request can include request headers, query string parameters, and a request body, which InfluxDB passes to the plugin. + + An On Request plugin implements the following signature: + + ```python + def process_request(influxdb3_local, query_parameters, request_headers, request_body, args=None) + ``` + + The response depends on the plugin implementation. + responses: + '200': + description: Success. The plugin request has been executed. + '400': + description: Malformed request. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Plugin not found. + '500': + description: Processing failure. + tags: + - Processing engine + post: + operationId: PostProcessingEnginePluginRequest + summary: On Request processing engine plugin request + description: | + Executes the On Request processing engine plugin specified in ``. + The request can include request headers, query string parameters, and a request body, which InfluxDB passes to the plugin. + + An On Request plugin implements the following signature: + + ```python + def process_request(influxdb3_local, query_parameters, request_headers, request_body, args=None) + ``` + + The response depends on the plugin implementation. + parameters: + - $ref: '#/components/parameters/ContentType' + requestBody: + required: false + content: + application/json: + schema: + type: object + additionalProperties: true + responses: + '200': + description: Success. The plugin request has been executed. + '400': + description: Malformed request. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Plugin not found. + '500': + description: Processing failure. + tags: + - Processing engine + /api/v3/configure/token/admin: + post: + operationId: PostCreateAdminToken + summary: Create admin token + description: | + Creates an admin token. + An admin token is a special type of token that has full access to all resources in the system. + responses: + '201': + description: | + Success. The admin token has been created. + The response body contains the token string and metadata. + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTokenObject' + '401': + $ref: '#/components/responses/Unauthorized' + tags: + - Authentication + - Token + /api/v3/configure/token/admin/regenerate: + post: + operationId: PostRegenerateAdminToken + summary: Regenerate admin token + description: | + Regenerates an admin token and revokes the previous token with the same name. + parameters: [] + responses: + '201': + description: Success. The admin token has been regenerated. + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTokenObject' + '401': + $ref: '#/components/responses/Unauthorized' + tags: + - Authentication + - Token +components: + parameters: + AcceptQueryHeader: + name: Accept + in: header + schema: + type: string + default: application/json + enum: + - application/json + - application/jsonl + - application/vnd.apache.parquet + - text/csv + required: false + description: | + The content type that the client can understand. + ContentEncoding: + name: Content-Encoding + in: header + description: | + The compression applied to the line protocol in the request payload. + To send a gzip payload, pass `Content-Encoding: gzip` header. + schema: + $ref: '#/components/schemas/ContentEncoding' + required: false + ContentLength: + name: Content-Length + in: header + description: | + The size of the entity-body, in bytes, sent to InfluxDB. + schema: + $ref: '#/components/schemas/ContentLength' + ContentType: + name: Content-Type + description: | + The format of the data in the request body. + in: header + schema: + type: string + enum: + - application/json + required: false + db: + name: db + in: query + required: true + schema: + type: string + description: | + The name of the database. + dbWriteParam: + name: db + in: query + required: true + schema: + type: string + description: | + The name of the database. + InfluxDB creates the database if it doesn't already exist, and then + writes all points in the batch to the database. + dbQueryParam: + name: db + in: query + required: false + schema: + type: string + description: | + The name of the database. + + If you provide a query that specifies the database, you can omit the 'db' parameter from your request. + accept_partial: + name: accept_partial + in: query + required: false + schema: + $ref: '#/components/schemas/AcceptPartial' + compatibilityPrecisionParam: + name: precision + in: query + required: true + schema: + $ref: '#/components/schemas/PrecisionWriteCompatibility' + description: The precision for unix timestamps in the line protocol batch. + precisionParam: + name: precision + in: query + required: true + schema: + $ref: '#/components/schemas/PrecisionWrite' + description: The precision for unix timestamps in the line protocol batch. + querySqlParam: + name: q + in: query + required: true + schema: + type: string + format: SQL + description: | + The query to execute. + format: + name: format + in: query + required: false + schema: + $ref: '#/components/schemas/Format' + formatRequired: + name: format + in: query + required: true + schema: + $ref: '#/components/schemas/Format' + requestBodies: + lineProtocolRequestBody: + required: true + content: + text/plain: + schema: + type: string + examples: + line: + summary: Example line protocol + value: measurement,tag=value field=1 1234567890 + multiline: + summary: Example line protocol with UTF-8 characters + value: | + measurement,tag=value field=1 1234567890 + measurement,tag=value field=2 1234567900 + measurement,tag=value field=3 1234568000 + queryRequestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/QueryRequestObject' + schemas: + AdminTokenObject: + type: object + properties: + id: + type: integer + name: + type: string + token: + type: string + hash: + type: string + created_at: + type: string + format: date-time + expiry: + format: date-time + example: + id: 0 + name: _admin + token: apiv3_00xx0Xx0xx00XX0x0 + hash: 00xx0Xx0xx00XX0x0 + created_at: '2025-04-18T14:02:45.331Z' + expiry: null + ContentEncoding: + type: string + enum: + - gzip + - identity + description: | + Content coding. + Use `gzip` for compressed data or `identity` for unmodified, uncompressed data. + default: identity + LineProtocol: + type: string + enum: + - text/plain + - text/plain; charset=utf-8 + description: | + `text/plain` is the content type for line protocol. `UTF-8` is the default character set. + default: text/plain; charset=utf-8 + ContentLength: + type: integer + description: The length in decimal number of octets. + Database: + type: string + AcceptPartial: + type: boolean + default: true + description: Accept partial writes. + Format: + type: string + enum: + - json + - csv + - parquet + - jsonl + description: | + The format of data in the response body. + NoSync: + type: boolean + default: false + description: | + Acknowledges a successful write without waiting for WAL persistence. + + #### Related + + - [Use the HTTP API and client libraries to write data](/influxdb3/core/write-data/api-client-libraries/) + - [Data durability](/influxdb3/core/reference/internals/durability/) + PrecisionWriteCompatibility: + enum: + - ms + - s + - us + - ns + type: string + description: | + The precision for unix timestamps in the line protocol batch. + Use `ms` for milliseconds, `s` for seconds, `us` for microseconds, or `ns` for nanoseconds. + PrecisionWrite: + enum: + - auto + - millisecond + - second + - microsecond + - nanosecond + type: string + description: | + The precision for unix timestamps in the line protocol batch. + QueryRequestObject: + type: object + properties: + database: + description: | + The name of the database to query. + Required if the query (`query_str`) doesn't specify the database. + type: string + query_str: + description: The query to execute. + type: string + format: + description: The format of the query results. + type: string + enum: + - json + - csv + - parquet + - jsonl + - pretty + params: + description: | + Additional parameters for the query. + Use this field to pass query parameters. + type: object + additionalProperties: true + required: + - database + - query_str + example: + database: mydb + query_str: SELECT * FROM mytable + format: json + params: {} + CreateDatabaseRequest: + type: object + properties: + db: + type: string + required: + - db + CreateTableRequest: + type: object + properties: + db: + type: string + table: + type: string + tags: + type: array + items: + type: string + fields: + type: array + items: + type: object + properties: + name: + type: string + type: + type: string + enum: + - utf8 + - int64 + - uint64 + - float64 + - bool + required: + - name + - type + required: + - db + - table + - tags + DistinctCacheCreateRequest: + type: object + properties: + db: + type: string + table: + type: string + name: + type: string + description: Optional cache name. + columns: + type: array + items: + type: string + max_cardinality: + type: integer + description: Optional maximum cardinality. + max_age: + type: integer + description: Optional maximum age in seconds. + required: + - db + - table + - columns + example: + db: mydb + table: mytable + columns: + - tag1 + - tag2 + max_cardinality: 1000 + max_age: 3600 + LastCacheCreateRequest: + type: object + properties: + db: + type: string + table: + type: string + name: + type: string + description: Optional cache name. + key_columns: + type: array + items: + type: string + description: Optional list of key columns. + value_columns: + type: array + items: + type: string + description: Optional list of value columns. + count: + type: integer + description: Optional count. + ttl: + type: integer + description: Optional time-to-live in seconds. + required: + - db + - table + example: + db: mydb + table: mytable + key_columns: + - tag1 + value_columns: + - field1 + count: 100 + ttl: 3600 + ProcessingEngineTriggerRequest: + type: object + properties: + db: + type: string + plugin_filename: + type: string + description: | + The path and filename of the plugin to execute--for example, + `schedule.py` or `endpoints/report.py`. + The path can be absolute or relative to the `--plugins-dir` directory configured when starting InfluxDB 3. + + The plugin file must implement the trigger interface associated with the trigger's specification (`trigger_spec`). + trigger_name: + type: string + trigger_specification: + type: string + description: | + Specifies when and how the processing engine trigger should be invoked. + + ## Supported trigger specifications: + + ### Cron-based scheduling + Format: `cron:CRON_EXPRESSION` + + Uses extended (6-field) cron format (second minute hour day_of_month month day_of_week): + ``` + โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ second (0-59) + โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ minute (0-59) + โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ hour (0-23) + โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ day of month (1-31) + โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ month (1-12) + โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ day of week (0-6, Sunday=0) + โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ + * * * * * * + ``` + Examples: + - `cron:0 0 6 * * 1-5` - Every weekday at 6:00 AM + - `cron:0 30 14 * * 5` - Every Friday at 2:30 PM + - `cron:0 0 0 1 * *` - First day of every month at midnight + + ### Interval-based scheduling + Format: `every:DURATION` + + Supported durations: `s` (seconds), `m` (minutes), `h` (hours), `d` (days): + - `every:30s` - Every 30 seconds + - `every:5m` - Every 5 minutes + - `every:1h` - Every hour + - `every:1d` - Every day + + ### Table-based triggers + - `all_tables` - Triggers on write events to any table in the database + - `table:TABLE_NAME` - Triggers on write events to a specific table + + ### On-demand triggers + Format: `path:ENDPOINT_NAME` + + Creates an HTTP endpoint `/api/v3/engine/ENDPOINT_NAME` for manual invocation: + - `path:hello-world` - Creates endpoint `/api/v3/engine/hello-world` + - `path:data-export` - Creates endpoint `/api/v3/engine/data-export` + pattern: ^(cron:[0-9 *,/-]+|every:[0-9]+[smhd]|all_tables|table:[a-zA-Z_][a-zA-Z0-9_]*|path:[a-zA-Z0-9_-]+)$ + example: cron:0 0 6 * * 1-5 + trigger_arguments: + type: object + additionalProperties: true + description: Optional arguments passed to the plugin. + disabled: + type: boolean + default: false + description: Whether the trigger is disabled. + required: + - db + - plugin_filename + - trigger_name + - trigger_specification + ShowDatabasesResponse: + type: object + properties: + databases: + type: array + items: + type: string + QueryResponse: + type: object + properties: + results: + type: array + items: + type: object + example: + results: + - series: + - name: mytable + columns: + - time + - value + values: + - - '2024-02-02T12:00:00Z' + - 42 + ErrorMessage: + type: object + properties: + error: + type: string + data: + type: object + nullable: true + LineProtocolError: + properties: + code: + description: Code is the machine-readable error code. + enum: + - internal error + - not found + - conflict + - invalid + - empty value + - unavailable + readOnly: true + type: string + err: + description: Stack of errors that occurred during processing of the request. Useful for debugging. + readOnly: true + type: string + line: + description: First line in the request body that contains malformed data. + format: int32 + readOnly: true + type: integer + message: + description: Human-readable message. + readOnly: true + type: string + op: + description: Describes the logical code operation when the error occurred. Useful for debugging. + readOnly: true + type: string + required: + - code + EpochCompatibility: + description: | + A unix timestamp precision. + - `h` for hours + - `m` for minutes + - `s` for seconds + - `ms` for milliseconds + - `u` or `ยต` for microseconds + - `ns` for nanoseconds + enum: + - ns + - u + - ยต + - ms + - s + - m + - h + type: string + responses: + Unauthorized: + description: Unauthorized access. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + BadRequest: + description: | + Request failed. Possible reasons: + + - Invalid database name + - Malformed request body + - Invalid timestamp precision + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + Forbidden: + description: Access denied. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + NotFound: + description: Resource not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + securitySchemes: + BearerAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: | + A Bearer token for authentication. + + Provide the scheme and the API token in the `Authorization` header--for example: + + ```bash + curl http://localhost:8181/api/v3/query_influxql \ + --header "Authorization: Bearer API_TOKEN" + ``` +x-tagGroups: + - name: Using the InfluxDB HTTP API + tags: + - Quick start + - Authentication + - Cache data + - Common parameters + - Response codes + - Compatibility endpoints + - Database + - Processing engine + - Server information + - Table + - Token + - Query data + - Write data diff --git a/specs/enterprise/ref.yml b/specs/enterprise/ref.yml new file mode 100644 index 0000000..9f1a7fc --- /dev/null +++ b/specs/enterprise/ref.yml @@ -0,0 +1,2136 @@ +openapi: 3.0.3 +info: + title: InfluxDB 3 Enterprise API Service + description: | + The InfluxDB HTTP API for InfluxDB 3 Enterprise provides a programmatic interface for + interacting with InfluxDB 3 Enterprise databases and resources. + Use this API to: + + - Write data to InfluxDB 3 Enterprise databases + - Query data using SQL or InfluxQL + - Process data using Processing engine plugins + - Manage databases, tables, and Processing engine triggers + - Perform administrative tasks and access system information + + The API includes endpoints under the following paths: + - `/api/v3`: InfluxDB 3 Enterprise native endpoints + - `/`: Compatibility endpoints for InfluxDB v1 workloads and clients + - `/api/v2/write`: Compatibility endpoint for InfluxDB v2 workloads and clients + + + version: '' + license: + name: MIT + url: https://opensource.org/licenses/MIT + contact: + name: InfluxData + url: https://www.influxdata.com + email: support@influxdata.com +servers: + - url: https://{baseurl} + description: InfluxDB 3 Enterprise API URL + variables: + baseurl: + enum: + - localhost:8181 + default: localhost:8181 + description: InfluxDB 3 Enterprise URL +security: + - BearerAuth: [] +tags: + - name: Authentication + description: | + Authenticate to the InfluxDB 3 API using a bearer token. + + The InfluxDB 3 API uses tokens for authentication. + To authenticate, include the `Authorization` header in your request with the value `Bearer `. + The token must be a valid InfluxDB 3 admin token or a resource token with the required permissions for the requested operation. + + #### Related guides + + - [Manage tokens](/influxdb3/enterprise/admin/tokens/) + - [Authentication and authorization](/influxdb3/enterprise/reference/internals/authentication/) + x-traitTag: true + - name: Cache data + description: | + Manage the in-memory cache. + + #### Distinct Value Cache + + The Distinct Value Cache (DVC) lets you cache distinct + values of one or more columns in a table, improving the performance of + queries that return distinct tag and field values. + + The DVC is an in-memory cache that stores distinct values for specific columns + in a table. When you create an DVC, you can specify what columns' distinct + values to cache, the maximum number of distinct value combinations to cache, and + the maximum age of cached values. A DVC is associated with a table, which can + have multiple DVCs. + + #### Last value cache + + The Last Value Cache (LVC) lets you cache the most recent + values for specific fields in a table, improving the performance of queries that + return the most recent value of a field for specific series or the last N values + of a field. + + The LVC is an in-memory cache that stores the last N number of values for + specific fields of series in a table. When you create an LVC, you can specify + what fields to cache, what tags to use to identify each series, and the + number of values to cache for each unique series. + An LVC is associated with a table, which can have multiple LVCs. + + #### Related guides + + - [Manage the Distinct Value Cache](/influxdb3/enterprise/admin/distinct-value-cache/) + - [Manage the Last Value Cache](/influxdb3/enterprise/admin/last-value-cache/) + - name: Compatibility endpoints + description: | + InfluxDB 3 provides compatibility endpoints for InfluxDB 1.x and InfluxDB 2.x workloads and clients. + + ### Write data using v1- or v2-compatible endpoints + + - [`/api/v2/write` endpoint](#operation/PostV2Write) + for InfluxDB v2 clients and when you bring existing InfluxDB v2 write workloads to InfluxDB 3. + - [`/write` endpoint](#operation/PostV1Write) for InfluxDB v1 clients and when you bring existing InfluxDB v1 write workloads to InfluxDB 3. + + For new workloads, use the [`/api/v3/write_lp` endpoint](#operation/PostWriteLP). + + All endpoints accept the same line protocol format. + + ### Query data + + Use the HTTP [`/query`](#operation/GetV1ExecuteQuery) endpoint for InfluxDB v1 clients and v1 query workloads using InfluxQL. + + For new workloads, use one of the following: + + - HTTP [`/api/v3/query_sql` endpoint](#operation/GetExecuteQuerySQL) for new query workloads using SQL. + - HTTP [`/api/v3/query_influxql` endpoint](#operation/GetExecuteInfluxQLQuery) for new query workloads using InfluxQL. + - Flight SQL and InfluxDB 3 _Flight+gRPC_ APIs for querying with SQL or InfluxQL. For more information about using Flight APIs, see [InfluxDB 3 client libraries](https://github.com/InfluxCommunity?q=influxdb3&type=public&language=&sort=). + + ### Server information + + Server information endpoints such as `/health` and `metrics` are compatible with InfluxDB 1.x and InfluxDB 2.x clients. + - name: Database + description: Manage databases + - description: | + Most InfluxDB API endpoints require parameters in the request--for example, specifying the database to use. + + ### Common parameters + + The following table shows common parameters used by many InfluxDB API endpoints. + Many endpoints may require other parameters in the query string or in the + request body that perform functions specific to those endpoints. + + | Query parameter | Value type | Description | + |:------------------------ |:--------------------- |:-------------------------------------------| + | `db` | string | The database name | + + InfluxDB HTTP API endpoints use standard HTTP request and response headers. + The following table shows common headers used by many InfluxDB API endpoints. + Some endpoints may use other headers that perform functions more specific to those endpoints--for example, + the write endpoints accept the `Content-Encoding` header to indicate that line protocol is compressed in the request body. + + | Header | Value type | Description | + |:------------------------ |:--------------------- |:-------------------------------------------| + | `Accept` | string | The content type that the client can understand. | + | `Authorization` | string | The authorization scheme and credential. | + | `Content-Length` | integer | The size of the entity-body, in bytes. | + | `Content-Type` | string | The format of the data in the request body. | + name: Headers and parameters + x-traitTag: true + - name: Processing engine + description: | + Manage Processing engine triggers, test plugins, and send requests to trigger On Request plugins. + + InfluxDB 3 Enterprise provides the InfluxDB 3 processing engine, an embedded Python VM that can dynamically load and trigger Python plugins in response to events in your database. + Use Processing engine plugins and triggers to run code and perform tasks for different database events. + + To get started with the processing engine, see the [Processing engine and Python plugins](/influxdb3/enterprise/processing-engine/) guide. + - name: Query data + description: Query data using SQL or InfluxQL + - name: Quick start + description: | + 1. [Create an admin token](#section/Authentication) to authorize API requests. + + ```bash + curl -X POST "http://localhost:8181/api/v3/configure/token/admin" + ``` + 2. [Check the status](#section/Server-information) of the InfluxDB server. + + ```bash + curl "http://localhost:8181/health" \ + --header "Authorization: Bearer ADMIN_TOKEN" + ``` + + 3. [Write data](#operation/PostWriteLP) to InfluxDB. + + ```bash + curl "http://localhost:8181/api/v3/write_lp?db=sensors&precision=auto" + --header "Authorization: Bearer ADMIN_TOKEN" \ + --data-raw "home,room=Kitchen temp=72.0 + home,room=Living\ room temp=71.5" + ``` + + If all data is written, the response is `204 No Content`. + + 4. [Query data](#operation/GetExecuteQuerySQL) from InfluxDB. + + ```bash + curl -G "http://localhost:8181/api/v3/query_sql" \ + --header "Authorization: Bearer ADMIN_TOKEN" \ + --data-urlencode "db=sensors" \ + --data-urlencode "q=SELECT * FROM home WHERE room='Living room'" \ + --data-urlencode "format=jsonl" + ``` + + Output: + + ```jsonl + {"room":"Living room","temp":71.5,"time":"2025-02-25T20:19:34.984098"} + ``` + + For more information about using InfluxDB 3 Enterprise, see the [Get started](/influxdb3/enterprise/get-started/) guide. + x-traitTag: true + - name: Server information + description: Retrieve server metrics, status, and version information + - name: Table + description: Manage table schemas and data + - name: Token + description: Manage tokens for authentication and authorization + - name: Write data + description: Write data to InfluxDB 3 +paths: + /write: + post: + operationId: PostV1Write + summary: Write line protocol (v1-compatible) + description: | + Writes line protocol to the specified database. + + This endpoint provides backward compatibility for InfluxDB 1.x write workloads using tools such as InfluxDB 1.x client libraries, the Telegraf `outputs.influxdb` output plugin, or third-party tools. + + Use this endpoint to send data in [line protocol](https://docs.influxdata.com/influxdb3/enterprise/reference/syntax/line-protocol/) format to InfluxDB. + Use query parameters to specify options for writing data. + parameters: + - $ref: '#/components/parameters/dbWriteParam' + - $ref: '#/components/parameters/compatibilityPrecisionParam' + - name: Content-Type + in: header + description: | + The content type of the request payload. + schema: + $ref: '#/components/schemas/LineProtocol' + required: false + - name: Accept + in: header + description: | + The content type that the client can understand. + Writes only return a response body if they fail (partially or completely)--for example, + due to a syntax problem or type mismatch. + schema: + type: string + default: application/json + enum: + - application/json + required: false + - $ref: '#/components/parameters/ContentEncoding' + - $ref: '#/components/parameters/ContentLength' + requestBody: + $ref: '#/components/requestBodies/lineProtocolRequestBody' + responses: + '204': + description: Success ("No Content"). All data in the batch is written and queryable. + '400': + description: | + Bad request. Some (a _partial write_) or all of the data from the batch was rejected and not written. + If a partial write occurred, then some points from the batch are written and queryable. + + The response body: + - indicates if a partial write occurred or all data was rejected. + - contains details about the [rejected points](/influxdb3/enterprise/write-data/troubleshoot/#troubleshoot-rejected-points), up to 100 points. + content: + application/json: + examples: + rejectedAllPoints: + summary: Rejected all points in the batch + value: | + { + "error": "write of line protocol failed", + "data": [ + { + "original_line": "dquote> home,room=Kitchen temp=hi", + "line_number": 2, + "error_message": "No fields were provided" + } + ] + } + partialWriteErrorWithRejectedPoints: + summary: Partial write rejected some points in the batch + value: | + { + "error": "partial write of line protocol occurred", + "data": [ + { + "original_line": "dquote> home,room=Kitchen temp=hi", + "line_number": 2, + "error_message": "No fields were provided" + } + ] + } + '401': + $ref: '#/components/responses/Unauthorized' + '403': + description: Access denied. + '413': + description: Request entity too large. + tags: + - Compatibility endpoints + - Write data + /api/v2/write: + post: + operationId: PostV2Write + summary: Write line protocol (v2-compatible) + description: | + Writes line protocol to the specified database. + + This endpoint provides backward compatibility for InfluxDB 2.x write workloads using tools such as InfluxDB 2.x client libraries, the Telegraf `outputs.influxdb_v2` output plugin, or third-party tools. + + Use this endpoint to send data in [line protocol](/influxdb3/enterprise/reference/syntax/line-protocol/) format to InfluxDB. + Use query parameters to specify options for writing data. + parameters: + - name: Content-Type + in: header + description: | + The content type of the request payload. + schema: + $ref: '#/components/schemas/LineProtocol' + required: false + - description: | + The compression applied to the line protocol in the request payload. + To send a gzip payload, pass `Content-Encoding: gzip` header. + in: header + name: Content-Encoding + schema: + default: identity + description: | + Content coding. + Use `gzip` for compressed data or `identity` for unmodified, uncompressed data. + enum: + - gzip + - identity + type: string + - description: | + The size of the entity-body, in bytes, sent to InfluxDB. + in: header + name: Content-Length + schema: + description: The length in decimal number of octets. + type: integer + - description: | + The content type that the client can understand. + Writes only return a response body if they fail (partially or completely)--for example, + due to a syntax problem or type mismatch. + in: header + name: Accept + schema: + default: application/json + description: Error content type. + enum: + - application/json + type: string + - name: db + in: query + required: true + schema: + type: string + description: | + A database name. + InfluxDB creates the database if it doesn't already exist, and then + writes all points in the batch to the database. + - name: accept_partial + in: query + required: false + schema: + $ref: '#/components/schemas/AcceptPartial' + - $ref: '#/components/parameters/compatibilityPrecisionParam' + requestBody: + $ref: '#/components/requestBodies/lineProtocolRequestBody' + responses: + '204': + description: Success ("No Content"). All data in the batch is written and queryable. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '403': + description: Access denied. + '413': + description: Request entity too large. + tags: + - Compatibility endpoints + - Write data + /api/v3/write_lp: + post: + operationId: PostWriteLP + summary: Write line protocol + description: | + Writes line protocol to the specified database. + + Use this endpoint to send data in [line protocol](/influxdb3/enterprise/reference/syntax/line-protocol/) format to InfluxDB. + Use query parameters to specify options for writing data. + parameters: + - $ref: '#/components/parameters/dbWriteParam' + - $ref: '#/components/parameters/accept_partial' + - $ref: '#/components/parameters/precisionParam' + - name: no_sync + in: query + schema: + $ref: '#/components/schemas/NoSync' + - name: Content-Type + in: header + description: | + The content type of the request payload. + schema: + $ref: '#/components/schemas/LineProtocol' + required: false + - name: Accept + in: header + description: | + The content type that the client can understand. + Writes only return a response body if they fail (partially or completely)--for example, + due to a syntax problem or type mismatch. + schema: + type: string + default: application/json + enum: + - application/json + required: false + - $ref: '#/components/parameters/ContentEncoding' + - $ref: '#/components/parameters/ContentLength' + requestBody: + $ref: '#/components/requestBodies/lineProtocolRequestBody' + responses: + '204': + description: Success ("No Content"). All data in the batch is written and queryable. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '403': + description: Access denied. + '413': + description: Request entity too large. + '422': + description: Unprocessable entity. + tags: + - Write data + /api/v3/query_sql: + get: + operationId: GetExecuteQuerySQL + summary: Execute SQL query + description: Executes an SQL query to retrieve data from the specified database. + parameters: + - $ref: '#/components/parameters/db' + - $ref: '#/components/parameters/querySqlParam' + - $ref: '#/components/parameters/format' + - $ref: '#/components/parameters/AcceptQueryHeader' + - $ref: '#/components/parameters/ContentType' + responses: + '200': + description: Success. The response body contains query results. + content: + application/json: + schema: + $ref: '#/components/schemas/QueryResponse' + example: + results: + - series: + - name: mytable + columns: + - time + - value + values: + - - '2024-02-02T12:00:00Z' + - 42 + text/csv: + schema: + type: string + application/vnd.apache.parquet: + schema: + type: string + application/jsonl: + schema: + type: string + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '403': + description: Access denied. + '404': + description: Database not found. + '405': + description: Method not allowed. + '422': + description: Unprocessable entity. + tags: + - Query data + post: + operationId: PostExecuteQuerySQL + summary: Execute SQL query + description: Executes an SQL query to retrieve data from the specified database. + parameters: + - $ref: '#/components/parameters/AcceptQueryHeader' + - $ref: '#/components/parameters/ContentType' + requestBody: + $ref: '#/components/requestBodies/queryRequestBody' + responses: + '200': + description: Success. The response body contains query results. + content: + application/json: + schema: + $ref: '#/components/schemas/QueryResponse' + text/csv: + schema: + type: string + application/vnd.apache.parquet: + schema: + type: string + application/jsonl: + schema: + type: string + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '403': + description: Access denied. + '404': + description: Database not found. + '405': + description: Method not allowed. + '422': + description: Unprocessable entity. + tags: + - Query data + /api/v3/query_influxql: + get: + operationId: GetExecuteInfluxQLQuery + summary: Execute InfluxQL query + description: Executes an InfluxQL query to retrieve data from the specified database. + parameters: + - $ref: '#/components/parameters/dbQueryParam' + - name: q + in: query + required: true + schema: + type: string + - name: format + in: query + required: false + schema: + type: string + - $ref: '#/components/parameters/AcceptQueryHeader' + responses: + '200': + description: Success. The response body contains query results. + content: + application/json: + schema: + $ref: '#/components/schemas/QueryResponse' + text/csv: + schema: + type: string + application/vnd.apache.parquet: + schema: + type: string + application/jsonl: + schema: + type: string + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '403': + description: Access denied. + '404': + description: Database not found. + '405': + description: Method not allowed. + '422': + description: Unprocessable entity. + tags: + - Query data + post: + operationId: PostExecuteQueryInfluxQL + summary: Execute InfluxQL query + description: Executes an InfluxQL query to retrieve data from the specified database. + parameters: + - $ref: '#/components/parameters/AcceptQueryHeader' + - $ref: '#/components/parameters/ContentType' + requestBody: + $ref: '#/components/requestBodies/queryRequestBody' + responses: + '200': + description: Success. The response body contains query results. + content: + application/json: + schema: + $ref: '#/components/schemas/QueryResponse' + text/csv: + schema: + type: string + application/vnd.apache.parquet: + schema: + type: string + application/jsonl: + schema: + type: string + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '403': + description: Access denied. + '404': + description: Database not found. + '405': + description: Method not allowed. + '422': + description: Unprocessable entity. + tags: + - Query data + /query: + get: + operationId: GetV1ExecuteQuery + summary: Execute InfluxQL query (v1-compatible) + description: | + Executes an InfluxQL query to retrieve data from the specified database. + + This endpoint is compatible with InfluxDB 1.x client libraries and third-party integrations such as Grafana. + Use query parameters to specify the database and the InfluxQL query. + parameters: + - name: Accept + in: header + schema: + type: string + default: application/json + enum: + - application/json + - application/csv + - text/csv + required: false + description: | + The content type that the client can understand. + + If `text/csv` is specified, the `Content-type` response header is `application/csv` and the response is formatted as CSV. + + Returns an error if the format is invalid or non-UTF8. + - in: query + name: chunked + description: | + If true, the response is divided into chunks of size `chunk_size`. + schema: + type: boolean + default: false + - in: query + name: chunk_size + description: | + The number of records that will go into a chunk. + This parameter is only used if `chunked=true`. + schema: + type: integer + default: 10000 + - in: query + name: db + description: The database to query. If not provided, the InfluxQL query string must specify the database. + schema: + type: string + format: InfluxQL + - in: query + name: pretty + description: | + If true, the JSON response is formatted in a human-readable format. + schema: + type: boolean + default: false + - in: query + name: q + description: The InfluxQL query string. + required: true + schema: + type: string + - name: epoch + description: | + Formats timestamps as [unix (epoch) timestamps](/influxdb3/enterprise/reference/glossary/#unix-timestamp) with the specified precision + instead of [RFC3339 timestamps](/influxdb3/enterprise/reference/glossary/#rfc3339-timestamp) with nanosecond precision. + in: query + schema: + $ref: '#/components/schemas/EpochCompatibility' + responses: + '200': + description: | + Success. The response body contains query results. + content: + application/json: + schema: + $ref: '#/components/schemas/QueryResponse' + application/csv: + schema: + type: string + headers: + Content-Type: + description: | + The content type of the response. + Default is `application/json`. + + If the `Accept` request header is `application/csv` or `text/csv`, the `Content-type` response header is `application/csv` + and the response is formatted as CSV. + schema: + type: string + default: application/json + enum: + - application/json + - application/csv + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '403': + description: Access denied. + '404': + description: Database not found. + '405': + description: Method not allowed. + '422': + description: Unprocessable entity. + tags: + - Query data + - Compatibility endpoints + post: + operationId: PostExecuteV1Query + summary: Execute InfluxQL query (v1-compatible) + description: Executes an InfluxQL query to retrieve data from the specified database. + requestBody: + content: + application/json: + schema: + type: object + properties: + db: + type: string + description: The database to query. If not provided, the InfluxQL query string must specify the database. + q: + description: The InfluxQL query string. + type: string + chunked: + description: | + If true, the response is divided into chunks of size `chunk_size`. + type: boolean + chunk_size: + description: | + The number of records that will go into a chunk. + This parameter is only used if `chunked=true`. + type: integer + default: 10000 + epoch: + description: | + A unix timestamp precision. + + - `h` for hours + - `m` for minutes + - `s` for seconds + - `ms` for milliseconds + - `u` or `ยต` for microseconds + - `ns` for nanoseconds + + Formats timestamps as [unix (epoch) timestamps](/influxdb3/enterprise/reference/glossary/#unix-timestamp) with the specified precision + instead of [RFC3339 timestamps](/influxdb3/enterprise/reference/glossary/#rfc3339-timestamp) with nanosecond precision. + enum: + - ns + - u + - ยต + - ms + - s + - m + - h + type: string + pretty: + description: | + If true, the JSON response is formatted in a human-readable format. + type: boolean + required: + - q + parameters: + - name: Accept + in: header + schema: + type: string + default: application/json + enum: + - application/json + - application/csv + - text/csv + required: false + description: | + The content type that the client can understand. + + If `text/csv` is specified, the `Content-type` response header is `application/csv` and the response is formatted as CSV. + + Returns an error if the format is invalid or non-UTF8. + responses: + '200': + description: | + Success. The response body contains query results. + content: + application/json: + schema: + $ref: '#/components/schemas/QueryResponse' + application/csv: + schema: + type: string + headers: + Content-Type: + description: | + The content type of the response. + Default is `application/json`. + + If the `Accept` request header is `application/csv` or `text/csv`, the `Content-type` response header is `application/csv` + and the response is formatted as CSV. + schema: + type: string + default: application/json + enum: + - application/json + - application/csv + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '403': + description: Access denied. + '404': + description: Database not found. + '405': + description: Method not allowed. + '422': + description: Unprocessable entity. + tags: + - Query data + - Compatibility endpoints + /health: + get: + operationId: GetHealth + summary: Health check + description: Checks the status of the service. + responses: + '200': + description: Service is running. + '500': + description: Service is unavailable. + tags: + - Server information + /api/v1/health: + get: + operationId: GetHealthV1 + summary: Health check (v1) + description: Checks the status of the service. + responses: + '200': + description: Service is running. + '500': + description: Service is unavailable. + tags: + - Server information + - Compatibility endpoints + /ping: + get: + operationId: GetPing + tags: + - Server information + summary: Ping the server + description: Returns version information for the server. + responses: + '200': + description: Success. The response body contains server information. + content: + application/json: + schema: + example: + version: 0.1.0 + revision: f3d3d3d + /metrics: + get: + operationId: GetMetrics + summary: Metrics + description: Retrieves Prometheus-compatible server metrics. + responses: + '200': + description: Success. The response body contains Prometheus-compatible server metrics. + tags: + - Server information + /api/v3/configure/database: + get: + operationId: GetConfigureDatabase + summary: List databases + description: Retrieves a list of databases. + parameters: + - $ref: '#/components/parameters/formatRequired' + responses: + '200': + description: Success. The response body contains the list of databases. + content: + application/json: + schema: + $ref: '#/components/schemas/ShowDatabasesResponse' + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Database not found. + tags: + - Database + post: + operationId: PostConfigureDatabase + summary: Create a database + description: Creates a new database in the system. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateDatabaseRequest' + responses: + '201': + description: Success. Database created. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '409': + description: Database already exists. + tags: + - Database + delete: + operationId: DeleteConfigureDatabase + summary: Delete a database + description: | + Soft deletes a database. + The database is scheduled for deletion and unavailable for querying. + parameters: + - $ref: '#/components/parameters/db' + responses: + '200': + description: Success. Database deleted. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Database not found. + tags: + - Database + /api/v3/configure/table: + post: + operationId: PostConfigureTable + summary: Create a table + description: Creates a new table within a database. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateTableRequest' + responses: + '201': + description: Success. The table has been created. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Database not found. + tags: + - Table + delete: + operationId: DeleteConfigureTable + summary: Delete a table + description: | + Soft deletes a table. + The table is scheduled for deletion and unavailable for querying. + parameters: + - $ref: '#/components/parameters/db' + - name: table + in: query + required: true + schema: + type: string + responses: + '200': + description: Success (no content). The table has been deleted. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Table not found. + tags: + - Table + /api/v3/configure/distinct_cache: + post: + operationId: PostConfigureDistinctCache + summary: Create distinct cache + description: Creates a distinct cache for a table. + tags: + - Cache data + - Table + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DistinctCacheCreateRequest' + responses: + '201': + description: Success. The distinct cache has been created. + '204': + description: Not created. A distinct cache with this configuration already exists. + '400': + description: | + Bad request. + + The server responds with status `400` if the request would overwrite an existing cache with a different configuration. + /api/v3/configure/last_cache: + post: + operationId: PostConfigureLastCache + summary: Create last cache + description: Creates a last cache for a table. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/LastCacheCreateRequest' + responses: + '201': + description: Success. Last cache created. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Cache not found. + '409': + description: Cache already exists. + tags: + - Cache data + - Table + delete: + operationId: DeleteConfigureLastCache + summary: Delete last cache + description: Deletes a last cache. + parameters: + - $ref: '#/components/parameters/db' + - name: table + in: query + required: true + schema: + type: string + - name: name + in: query + required: true + schema: + type: string + responses: + '200': + description: Success. The last cache has been deleted. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Cache not found. + tags: + - Cache data + - Table + /api/v3/configure/processing_engine_trigger: + post: + operationId: PostConfigureProcessingEngineTrigger + summary: Create processing engine trigger + description: | + Creates a processing engine trigger with the specified plugin file and trigger specification. + + ### Related guides + + - [Processing engine and Python plugins](/influxdb3/enterprise/plugins/) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ProcessingEngineTriggerRequest' + examples: + schedule_cron: + summary: Schedule trigger using cron + description: | + In `"cron:CRON_EXPRESSION"`, `CRON_EXPRESSION` uses extended 6-field cron format. + The cron expression `0 0 6 * * 1-5` means the trigger will run at 6:00 AM every weekday (Monday to Friday). + value: + db: DATABASE_NAME + plugin_filename: schedule.py + trigger_name: schedule_cron_trigger + trigger_specification: cron:0 0 6 * * 1-5 + schedule_every: + summary: Schedule trigger using interval + description: | + In `"every:DURATION"`, `DURATION` specifies the interval between trigger executions. + The duration `1h` means the trigger will run every hour. + value: + db: mydb + plugin_filename: schedule.py + trigger_name: schedule_every_trigger + trigger_specification: every:1h + schedule_every_seconds: + summary: Schedule trigger using seconds interval + description: | + Example of scheduling a trigger to run every 30 seconds. + value: + db: mydb + plugin_filename: schedule.py + trigger_name: schedule_every_30s_trigger + trigger_specification: every:30s + schedule_every_minutes: + summary: Schedule trigger using minutes interval + description: | + Example of scheduling a trigger to run every 5 minutes. + value: + db: mydb + plugin_filename: schedule.py + trigger_name: schedule_every_5m_trigger + trigger_specification: every:5m + all_tables: + summary: All tables trigger example + description: | + Trigger that fires on write events to any table in the database. + value: + db: mydb + plugin_filename: all_tables.py + trigger_name: all_tables_trigger + trigger_specification: all_tables + table_specific: + summary: Table-specific trigger example + description: | + Trigger that fires on write events to a specific table. + value: + db: mydb + plugin_filename: table.py + trigger_name: table_trigger + trigger_specification: table:sensors + api_request: + summary: On-demand request trigger example + description: | + Creates an HTTP endpoint `/api/v3/engine/hello-world` for manual invocation. + value: + db: mydb + plugin_filename: request.py + trigger_name: hello_world_trigger + trigger_specification: path:hello-world + cron_friday_afternoon: + summary: Cron trigger for Friday afternoons + description: | + Example of a cron trigger that runs every Friday at 2:30 PM. + value: + db: reports + plugin_filename: weekly_report.py + trigger_name: friday_report_trigger + trigger_specification: cron:0 30 14 * * 5 + cron_monthly: + summary: Cron trigger for monthly execution + description: | + Example of a cron trigger that runs on the first day of every month at midnight. + value: + db: monthly_data + plugin_filename: monthly_cleanup.py + trigger_name: monthly_cleanup_trigger + trigger_specification: cron:0 0 0 1 * * + responses: + '200': + description: Success. Processing engine trigger created. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Trigger not found. + tags: + - Processing engine + delete: + operationId: DeleteConfigureProcessingEngineTrigger + summary: Delete processing engine trigger + description: Deletes a processing engine trigger. + parameters: + - $ref: '#/components/parameters/db' + - name: trigger_name + in: query + required: true + schema: + type: string + - name: force + in: query + required: false + schema: + type: boolean + default: false + responses: + '200': + description: Success. The processing engine trigger has been deleted. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Trigger not found. + tags: + - Processing engine + /api/v3/configure/processing_engine_trigger/disable: + post: + operationId: PostDisableProcessingEngineTrigger + summary: Disable processing engine trigger + description: Disables a processing engine trigger. + parameters: + - $ref: '#/components/parameters/ContentType' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ProcessingEngineTriggerRequest' + responses: + '200': + description: Success. The processing engine trigger has been disabled. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Trigger not found. + tags: + - Processing engine + /api/v3/configure/processing_engine_trigger/enable: + post: + operationId: PostEnableProcessingEngineTrigger + summary: Enable processing engine trigger + description: Enables a processing engine trigger. + parameters: + - $ref: '#/components/parameters/ContentType' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ProcessingEngineTriggerRequest' + responses: + '200': + description: Success. The processing engine trigger is enabled. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Trigger not found. + tags: + - Processing engine + /api/v3/configure/plugin_environment/install_packages: + post: + operationId: PostInstallPluginPackages + summary: Install plugin packages + description: | + Installs the specified Python packages into the processing engine plugin environment. + + This endpoint is synchronous and blocks until the packages are installed. + + ### Related guides + + - [Processing engine and Python plugins](/influxdb3/enterprise/plugins/) + parameters: + - $ref: '#/components/parameters/ContentType' + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + packages: + type: array + items: + type: string + description: | + A list of Python package names to install. + Can include version specifiers (e.g., "scipy==1.9.0"). + example: + - influxdb3-python + - scipy + - pandas==1.5.0 + - requests + required: + - packages + example: + packages: + - influxdb3-python + - scipy + - pandas==1.5.0 + - requests + responses: + '200': + description: Success. The packages are installed. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + tags: + - Processing engine + /api/v3/configure/plugin_environment/install_requirements: + post: + operationId: PostInstallPluginRequirements + summary: Install plugin requirements + description: | + Installs requirements from a requirements file (also known as a "pip requirements file") into the processing engine plugin environment. + + This endpoint is synchronous and blocks until the requirements are installed. + + ### Related + + - [Processing engine and Python plugins](/influxdb3/enterprise/plugins/) + - [Python requirements file format](https://pip.pypa.io/en/stable/reference/requirements-file-format/) + parameters: + - $ref: '#/components/parameters/ContentType' + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + requirements_location: + type: string + description: | + The path to the requirements file containing Python packages to install. + Can be a relative path (relative to the plugin directory) or an absolute path. + example: requirements.txt + required: + - requirements_location + example: + requirements_location: requirements.txt + responses: + '200': + description: Success. The requirements have been installed. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + tags: + - Processing engine + /api/v3/plugin_test/wal: + post: + operationId: PostTestWALPlugin + summary: Test WAL plugin + description: Executes a test of a write-ahead logging (WAL) plugin. + responses: + '200': + description: Success. The plugin test has been executed. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Plugin not enabled. + tags: + - Processing engine + /api/v3/plugin_test/schedule: + post: + operationId: PostTestSchedulingPlugin + summary: Test scheduling plugin + description: Executes a test of a scheduling plugin. + responses: + '200': + description: Success. The plugin test has been executed. + '400': + description: Bad request. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Plugin not enabled. + tags: + - Processing engine + /api/v3/engine/{plugin_path}: + parameters: + - name: plugin_path + description: | + The path configured in the request trigger specification "path:"` for the plugin. + + For example, if you define a trigger with the following: + + ```json + trigger-spec: "path:hello-world" + ``` + + then, the HTTP API exposes the following plugin endpoint: + + ``` + /api/v3/engine/hello-world + ``` + in: path + required: true + schema: + type: string + get: + operationId: GetProcessingEnginePluginRequest + summary: On Request processing engine plugin request + description: | + Executes the On Request processing engine plugin specified in ``. + The request can include request headers, query string parameters, and a request body, which InfluxDB passes to the plugin. + + An On Request plugin implements the following signature: + + ```python + def process_request(influxdb3_local, query_parameters, request_headers, request_body, args=None) + ``` + + The response depends on the plugin implementation. + responses: + '200': + description: Success. The plugin request has been executed. + '400': + description: Malformed request. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Plugin not found. + '500': + description: Processing failure. + tags: + - Processing engine + post: + operationId: PostProcessingEnginePluginRequest + summary: On Request processing engine plugin request + description: | + Executes the On Request processing engine plugin specified in ``. + The request can include request headers, query string parameters, and a request body, which InfluxDB passes to the plugin. + + An On Request plugin implements the following signature: + + ```python + def process_request(influxdb3_local, query_parameters, request_headers, request_body, args=None) + ``` + + The response depends on the plugin implementation. + parameters: + - $ref: '#/components/parameters/ContentType' + requestBody: + required: false + content: + application/json: + schema: + type: object + additionalProperties: true + responses: + '200': + description: Success. The plugin request has been executed. + '400': + description: Malformed request. + '401': + $ref: '#/components/responses/Unauthorized' + '404': + description: Plugin not found. + '500': + description: Processing failure. + tags: + - Processing engine + /api/v3/configure/enterprise/token: + post: + operationId: PostCreateResourceToken + summary: Create a resource token + description: | + Creates a resource (fine-grained permissions) token. + A resource token is a token that has access to specific resources in the system. + + This endpoint is only available in InfluxDB 3 Enterprise. + responses: + '201': + description: | + Success. The resource token has been created. + The response body contains the token string and metadata. + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceTokenObject' + '401': + $ref: '#/components/responses/Unauthorized' + tags: + - Authentication + - Token + /api/v3/configure/token/admin: + post: + operationId: PostCreateAdminToken + summary: Create admin token + description: | + Creates an admin token. + An admin token is a special type of token that has full access to all resources in the system. + responses: + '201': + description: | + Success. The admin token has been created. + The response body contains the token string and metadata. + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTokenObject' + '401': + $ref: '#/components/responses/Unauthorized' + tags: + - Authentication + - Token + /api/v3/configure/token/admin/regenerate: + post: + operationId: PostRegenerateAdminToken + summary: Regenerate admin token + description: | + Regenerates an admin token and revokes the previous token with the same name. + parameters: [] + responses: + '201': + description: Success. The admin token has been regenerated. + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTokenObject' + '401': + $ref: '#/components/responses/Unauthorized' + tags: + - Authentication + - Token +components: + parameters: + AcceptQueryHeader: + name: Accept + in: header + schema: + type: string + default: application/json + enum: + - application/json + - application/jsonl + - application/vnd.apache.parquet + - text/csv + required: false + description: | + The content type that the client can understand. + ContentEncoding: + name: Content-Encoding + in: header + description: | + The compression applied to the line protocol in the request payload. + To send a gzip payload, pass `Content-Encoding: gzip` header. + schema: + $ref: '#/components/schemas/ContentEncoding' + required: false + ContentLength: + name: Content-Length + in: header + description: | + The size of the entity-body, in bytes, sent to InfluxDB. + schema: + $ref: '#/components/schemas/ContentLength' + ContentType: + name: Content-Type + description: | + The format of the data in the request body. + in: header + schema: + type: string + enum: + - application/json + required: false + db: + name: db + in: query + required: true + schema: + type: string + description: | + The name of the database. + dbWriteParam: + name: db + in: query + required: true + schema: + type: string + description: | + The name of the database. + InfluxDB creates the database if it doesn't already exist, and then + writes all points in the batch to the database. + dbQueryParam: + name: db + in: query + required: false + schema: + type: string + description: | + The name of the database. + + If you provide a query that specifies the database, you can omit the 'db' parameter from your request. + accept_partial: + name: accept_partial + in: query + required: false + schema: + $ref: '#/components/schemas/AcceptPartial' + compatibilityPrecisionParam: + name: precision + in: query + required: true + schema: + $ref: '#/components/schemas/PrecisionWriteCompatibility' + description: The precision for unix timestamps in the line protocol batch. + precisionParam: + name: precision + in: query + required: true + schema: + $ref: '#/components/schemas/PrecisionWrite' + description: The precision for unix timestamps in the line protocol batch. + querySqlParam: + name: q + in: query + required: true + schema: + type: string + format: SQL + description: | + The query to execute. + format: + name: format + in: query + required: false + schema: + $ref: '#/components/schemas/Format' + formatRequired: + name: format + in: query + required: true + schema: + $ref: '#/components/schemas/Format' + requestBodies: + lineProtocolRequestBody: + required: true + content: + text/plain: + schema: + type: string + examples: + line: + summary: Example line protocol + value: measurement,tag=value field=1 1234567890 + multiline: + summary: Example line protocol with UTF-8 characters + value: | + measurement,tag=value field=1 1234567890 + measurement,tag=value field=2 1234567900 + measurement,tag=value field=3 1234568000 + queryRequestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/QueryRequestObject' + schemas: + AdminTokenObject: + type: object + properties: + id: + type: integer + name: + type: string + token: + type: string + hash: + type: string + created_at: + type: string + format: date-time + expiry: + format: date-time + example: + id: 0 + name: _admin + token: apiv3_00xx0Xx0xx00XX0x0 + hash: 00xx0Xx0xx00XX0x0 + created_at: '2025-04-18T14:02:45.331Z' + expiry: null + ResourceTokenObject: + type: object + properties: + token_name: + type: string + permissions: + type: array + items: + type: object + properties: + resource_type: + type: string + enum: + - system + - db + resource_identifier: + type: array + items: + type: string + actions: + type: array + items: + type: string + enum: + - read + - write + expiry_secs: + type: integer + description: The expiration time in seconds. + example: + token_name: All system information + permissions: + - resource_type: system + resource_identifier: + - '*' + actions: + - read + expiry_secs: 300000 + ContentEncoding: + type: string + enum: + - gzip + - identity + description: | + Content coding. + Use `gzip` for compressed data or `identity` for unmodified, uncompressed data. + default: identity + LineProtocol: + type: string + enum: + - text/plain + - text/plain; charset=utf-8 + description: | + `text/plain` is the content type for line protocol. `UTF-8` is the default character set. + default: text/plain; charset=utf-8 + ContentLength: + type: integer + description: The length in decimal number of octets. + Database: + type: string + AcceptPartial: + type: boolean + default: true + description: Accept partial writes. + Format: + type: string + enum: + - json + - csv + - parquet + - jsonl + description: | + The format of data in the response body. + NoSync: + type: boolean + default: false + description: | + Acknowledges a successful write without waiting for WAL persistence. + + #### Related + + - [Use the HTTP API and client libraries to write data](/influxdb3/enterprise/write-data/api-client-libraries/) + - [Data durability](/influxdb3/enterprise/reference/internals/durability/) + PrecisionWriteCompatibility: + enum: + - ms + - s + - us + - ns + type: string + description: | + The precision for unix timestamps in the line protocol batch. + Use `ms` for milliseconds, `s` for seconds, `us` for microseconds, or `ns` for nanoseconds. + PrecisionWrite: + enum: + - auto + - millisecond + - second + - microsecond + - nanosecond + type: string + description: | + The precision for unix timestamps in the line protocol batch. + QueryRequestObject: + type: object + properties: + database: + description: | + The name of the database to query. + Required if the query (`query_str`) doesn't specify the database. + type: string + query_str: + description: The query to execute. + type: string + format: + description: The format of the query results. + type: string + enum: + - json + - csv + - parquet + - jsonl + - pretty + params: + description: | + Additional parameters for the query. + Use this field to pass query parameters. + type: object + additionalProperties: true + required: + - database + - query_str + example: + database: mydb + query_str: SELECT * FROM mytable + format: json + params: {} + CreateDatabaseRequest: + type: object + properties: + db: + type: string + required: + - db + CreateTableRequest: + type: object + properties: + db: + type: string + table: + type: string + tags: + type: array + items: + type: string + fields: + type: array + items: + type: object + properties: + name: + type: string + type: + type: string + enum: + - utf8 + - int64 + - uint64 + - float64 + - bool + required: + - name + - type + required: + - db + - table + - tags + DistinctCacheCreateRequest: + type: object + properties: + db: + type: string + table: + type: string + name: + type: string + description: Optional cache name. + columns: + type: array + items: + type: string + max_cardinality: + type: integer + description: Optional maximum cardinality. + max_age: + type: integer + description: Optional maximum age in seconds. + required: + - db + - table + - columns + example: + db: mydb + table: mytable + columns: + - tag1 + - tag2 + max_cardinality: 1000 + max_age: 3600 + LastCacheCreateRequest: + type: object + properties: + db: + type: string + table: + type: string + name: + type: string + description: Optional cache name. + key_columns: + type: array + items: + type: string + description: Optional list of key columns. + value_columns: + type: array + items: + type: string + description: Optional list of value columns. + count: + type: integer + description: Optional count. + ttl: + type: integer + description: Optional time-to-live in seconds. + required: + - db + - table + example: + db: mydb + table: mytable + key_columns: + - tag1 + value_columns: + - field1 + count: 100 + ttl: 3600 + ProcessingEngineTriggerRequest: + type: object + properties: + db: + type: string + plugin_filename: + type: string + description: | + The path and filename of the plugin to execute--for example, + `schedule.py` or `endpoints/report.py`. + The path can be absolute or relative to the `--plugins-dir` directory configured when starting InfluxDB 3. + + The plugin file must implement the trigger interface associated with the trigger's specification (`trigger_spec`). + trigger_name: + type: string + trigger_specification: + type: string + description: | + Specifies when and how the processing engine trigger should be invoked. + + ## Supported trigger specifications: + + ### Cron-based scheduling + Format: `cron:CRON_EXPRESSION` + + Uses extended (6-field) cron format (second minute hour day_of_month month day_of_week): + ``` + โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ second (0-59) + โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ minute (0-59) + โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ hour (0-23) + โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ day of month (1-31) + โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ month (1-12) + โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ day of week (0-6, Sunday=0) + โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ + * * * * * * + ``` + Examples: + - `cron:0 0 6 * * 1-5` - Every weekday at 6:00 AM + - `cron:0 30 14 * * 5` - Every Friday at 2:30 PM + - `cron:0 0 0 1 * *` - First day of every month at midnight + + ### Interval-based scheduling + Format: `every:DURATION` + + Supported durations: `s` (seconds), `m` (minutes), `h` (hours), `d` (days): + - `every:30s` - Every 30 seconds + - `every:5m` - Every 5 minutes + - `every:1h` - Every hour + - `every:1d` - Every day + + ### Table-based triggers + - `all_tables` - Triggers on write events to any table in the database + - `table:TABLE_NAME` - Triggers on write events to a specific table + + ### On-demand triggers + Format: `path:ENDPOINT_NAME` + + Creates an HTTP endpoint `/api/v3/engine/ENDPOINT_NAME` for manual invocation: + - `path:hello-world` - Creates endpoint `/api/v3/engine/hello-world` + - `path:data-export` - Creates endpoint `/api/v3/engine/data-export` + pattern: ^(cron:[0-9 *,/-]+|every:[0-9]+[smhd]|all_tables|table:[a-zA-Z_][a-zA-Z0-9_]*|path:[a-zA-Z0-9_-]+)$ + example: cron:0 0 6 * * 1-5 + trigger_arguments: + type: object + additionalProperties: true + description: Optional arguments passed to the plugin. + disabled: + type: boolean + default: false + description: Whether the trigger is disabled. + required: + - db + - plugin_filename + - trigger_name + - trigger_specification + ShowDatabasesResponse: + type: object + properties: + databases: + type: array + items: + type: string + QueryResponse: + type: object + properties: + results: + type: array + items: + type: object + example: + results: + - series: + - name: mytable + columns: + - time + - value + values: + - - '2024-02-02T12:00:00Z' + - 42 + ErrorMessage: + type: object + properties: + error: + type: string + data: + type: object + nullable: true + LineProtocolError: + properties: + code: + description: Code is the machine-readable error code. + enum: + - internal error + - not found + - conflict + - invalid + - empty value + - unavailable + readOnly: true + type: string + err: + description: Stack of errors that occurred during processing of the request. Useful for debugging. + readOnly: true + type: string + line: + description: First line in the request body that contains malformed data. + format: int32 + readOnly: true + type: integer + message: + description: Human-readable message. + readOnly: true + type: string + op: + description: Describes the logical code operation when the error occurred. Useful for debugging. + readOnly: true + type: string + required: + - code + EpochCompatibility: + description: | + A unix timestamp precision. + - `h` for hours + - `m` for minutes + - `s` for seconds + - `ms` for milliseconds + - `u` or `ยต` for microseconds + - `ns` for nanoseconds + enum: + - ns + - u + - ยต + - ms + - s + - m + - h + type: string + responses: + Unauthorized: + description: Unauthorized access. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + BadRequest: + description: | + Request failed. Possible reasons: + + - Invalid database name + - Malformed request body + - Invalid timestamp precision + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + Forbidden: + description: Access denied. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + NotFound: + description: Resource not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + securitySchemes: + BearerAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: | + A Bearer token for authentication. + + Provide the scheme and the API token in the `Authorization` header--for example: + + ```bash + curl http://localhost:8181/api/v3/query_influxql \ + --header "Authorization: Bearer API_TOKEN" + ``` +x-tagGroups: + - name: Using the InfluxDB HTTP API + tags: + - Quick start + - Authentication + - Cache data + - Common parameters + - Response codes + - Compatibility endpoints + - Database + - Processing engine + - Server information + - Table + - Token + - Query data + - Write data