Compare commits

...

10 Commits

Author SHA1 Message Date
401f3a4032 chore: build windows packages on release (#491) 2023-04-05 13:12:36 -04:00
02a094a4b1 chore: update openapi (#488) 2023-04-03 16:20:33 -04:00
88517ea782 chore: version bump sys to support riscv (#483)
* chore: version bump sys to support riscv

* chore: go mod tidy
2023-04-03 13:08:41 -04:00
4046d9974d fix: typo in alias of bucket update command (#485) 2023-04-03 09:44:57 -04:00
625273adf9 feat: Add new replication field to better show queue sync progress (#480)
* chore: update openapi

* feat: update replication field names to match influx changes

* feat: add new field to show replication queue sync progress

* chore: update to master openapi
2023-03-10 09:13:35 -05:00
1164ca57ff chore: use fpm for packaging (#476)
* chore: remove goreleaser configuration and scripts

* chore: replace goreleaser with fpm

goreleaser handled signing and uploading packages. So, that
functionality had to be implemented here as well.
2023-03-01 17:26:34 -05:00
48e8f5b752 chore: update to go 1.19.6 (#479) 2023-03-01 15:30:51 -06:00
4ce9053ddb fix: updated api for deleting secrets so "influx secret delete" command works again (#469)
* fix: updated api for deleting secrets

* fix: reversed code comments update
2023-01-09 08:35:09 -05:00
ae62da0b32 chore: update to go 1.19 (#465) (#467)
* chore: upgrade go releaser to v1.13.1 (#464)

* chore: update goreleaser and actually use go 1.19

* chore: format for go 1.19

Co-authored-by: Brandon Pfeifer <bpfeifer@influxdata.com>

Co-authored-by: Brandon Pfeifer <bpfeifer@influxdata.com>
2023-01-03 16:16:12 -05:00
5546ab6ea7 chore: upgrade go releaser to v1.13.1 (#464) 2022-12-28 13:13:07 -05:00
55 changed files with 1771 additions and 1492 deletions

View File

@ -26,13 +26,20 @@ executors:
resource_class: windows.medium
shell: bash.exe -eo pipefail
release_filter: &release_filter
filters:
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+(-(rc|alpha|beta)[0-9]+)?$/
branches:
ignore: /.*/
workflows:
version: 2
build-and-test:
jobs:
- lint
- check-openapi
- build-all
- test-race:
name: test-linux-amd64
- test-build:
@ -70,6 +77,24 @@ workflows:
arch: amd64
requires:
- test-build-amd64-windows
- build:
name: build-<< matrix.os >>-<< matrix.arch >>
matrix:
parameters:
os: [ linux, darwin, windows ]
arch: [ amd64, arm64 ]
exclude:
- os: darwin
arch: arm64
- os: windows
arch: arm64
- build-packages:
sign: false
requires:
- build-darwin-amd64
- build-linux-amd64
- build-linux-arm64
- build-windows-amd64
release-nightly:
triggers:
- schedule:
@ -119,6 +144,24 @@ workflows:
arch: amd64
requires:
- test-build-amd64-windows
- build:
name: build-<< matrix.os >>-<< matrix.arch >>
matrix:
parameters:
os: [ linux, darwin, windows ]
arch: [ amd64, arm64 ]
exclude:
- os: darwin
arch: arm64
- os: windows
arch: arm64
- build-packages:
sign: true
requires:
- build-darwin-amd64
- build-linux-amd64
- build-linux-arm64
- build-windows-amd64
- release:
is-nightly: true
requires:
@ -129,39 +172,20 @@ workflows:
- test-linux-arm64
- test-mac
- test-windows
- build-packages
release-tag:
jobs:
- changelog:
filters:
branches:
ignore: /.*/
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+(-(rc|alpha|beta)[0-9]+)?$/
<<: *release_filter
- lint:
filters:
branches:
ignore: /.*/
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+(-(rc|alpha|beta)[0-9]+)?$/
<<: *release_filter
- check-openapi:
filters:
branches:
ignore: /.*/
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+(-(rc|alpha|beta)[0-9]+)?$/
<<: *release_filter
- test-race:
name: test-linux-amd64
filters:
branches:
ignore: /.*/
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+(-(rc|alpha|beta)[0-9]+)?$/
<<: *release_filter
- test-build:
filters:
branches:
ignore: /.*/
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+(-(rc|alpha|beta)[0-9]+)?$/
<<: *release_filter
matrix:
parameters:
os: [ linux, darwin, windows ]
@ -176,47 +200,51 @@ workflows:
- os: linux
arch: amd64
- test-prebuilt:
<<: *release_filter
name: test-linux-arm64
filters:
branches:
ignore: /.*/
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+(-(rc|alpha|beta)[0-9]+)?$/
executor: linux-arm64
os: linux
arch: arm64
requires:
- test-build-arm64-linux
- test-prebuilt:
<<: *release_filter
name: test-mac
filters:
branches:
ignore: /.*/
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+(-(rc|alpha|beta)[0-9]+)?$/
executor: mac
os: darwin
arch: amd64
requires:
- test-build-amd64-darwin
- test-prebuilt:
<<: *release_filter
name: test-windows
filters:
branches:
ignore: /.*/
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+(-(rc|alpha|beta)[0-9]+)?$/
executor: windows
os: windows
arch: amd64
requires:
- test-build-amd64-windows
- build:
<<: *release_filter
name: build-<< matrix.os >>-<< matrix.arch >>
matrix:
parameters:
os: [ linux, darwin, windows ]
arch: [ amd64, arm64 ]
exclude:
- os: darwin
arch: arm64
- os: windows
arch: arm64
- build-packages:
<<: *release_filter
sign: true
requires:
- build-darwin-amd64
- build-linux-amd64
- build-linux-arm64
- build-windows-amd64
- release:
filters:
branches:
ignore: /.*/
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+(-(rc|alpha|beta)[0-9]+)?$/
<<: *release_filter
is-nightly: false
requires:
- changelog
@ -226,6 +254,7 @@ workflows:
- test-linux-arm64
- test-mac
- test-windows
- build-packages
commands:
setup:
@ -247,11 +276,6 @@ commands:
echo 'export PATH=${GOPATH}/bin:${PATH}' >> $BASH_ENV
mkdir -p ${HOME}/.cache
echo 'export GOCACHE=${HOME}/.cache' >> $BASH_ENV
install-goreleaser:
steps:
- run:
name: Install goreleaser
command: ./scripts/ci/download-goreleaser.sh -b ${GOPATH}/bin v0.165.0
jobs:
lint:
@ -289,23 +313,6 @@ jobs:
command: git submodule update --init --recursive
- run: make checkopenapi
build-all:
executor: linux-amd64
steps:
- checkout
- setup
- install-goreleaser
- run:
name: Make a pseudo-tag for the snapshot build
command: |
latest_tag=$(git describe --tags --abbrev=0)
git tag ${latest_tag}+SNAPSHOT.$(git rev-parse --short HEAD)
- run:
name: Cross-build all targets
command: IS_SNAPSHOT=1 goreleaser release --rm-dist --skip-publish --skip-sign --skip-validate
- store_artifacts:
path: dist
release:
parameters:
is-nightly:
@ -315,38 +322,25 @@ jobs:
- checkout
- attach_workspace:
at: .
- setup
- run:
name: Import GPG key
command: |
echo -e "$GPG_PRIVATE_KEY" > private.key
gpg --batch --import private.key
- install-goreleaser
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update -y
sudo apt-get install -y awscli gnupg
gpg --import --batch \<<<"${GPG_PRIVATE_KEY//$'\\n'/$'\n'}"
- when:
condition: << parameters.is-nightly >>
steps:
- run:
name: Make a pseudo-tag for the nightly build
command: |
latest_tag=$(git describe --tags --abbrev=0)
git tag ${latest_tag}+nightly.$(date +%Y.%m.%d)
- run:
name: Publish nightly snapshot release
command: IS_NIGHTLY=1 goreleaser release --rm-dist
command: .circleci/scripts/upload-artifacts nightly
- unless:
condition: << parameters.is-nightly >>
steps:
- run:
name: Publish tagged release
command: goreleaser release --rm-dist
- run:
command: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get install awscli
.circleci/scripts/upload-latest-artifacts
command: .circleci/scripts/upload-artifacts release
- store_artifacts:
path: dist
path: packages
test-build:
executor: cross-builder
@ -403,6 +397,68 @@ jobs:
- store_test_results:
path: ./test-results
build:
executor: cross-builder
parameters:
os:
type: string
arch:
type: string
steps:
- checkout
- run:
name: Build Binaries
command: |
GOOS=<<parameters.os>> GOARCH=<<parameters.arch>> make
- store_artifacts:
path: bin
- persist_to_workspace:
root: .
paths: bin
build-packages:
docker:
- image: ubuntu:latest
resource_class: small
parameters:
sign:
type: boolean
steps:
- attach_workspace:
at: /tmp/workspace
- checkout
- run:
name: Build Packages
command: |
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install --yes \
build-essential \
git \
gnupg \
rpm \
ruby-dev
gem install fpm
if [[ "<< parameters.sign >>" == "true" ]]
then
gpg --import --batch \<<<"${GPG_PRIVATE_KEY//$'\\n'/$'\n'}"
export SIGN_PACKAGES=1
fi
mkdir -p packages
OS=darwin ARCH=amd64 scripts/ci/build-packages /tmp/workspace/bin/darwin/amd64/influx "${PWD}/packages"
OS=linux ARCH=amd64 scripts/ci/build-packages /tmp/workspace/bin/linux/amd64/influx "${PWD}/packages"
OS=linux ARCH=arm64 scripts/ci/build-packages /tmp/workspace/bin/linux/arm64/influx "${PWD}/packages"
OS=windows ARCH=amd64 scripts/ci/build-packages /tmp/workspace/bin/windows/amd64/influx "${PWD}/packages"
- store_artifacts:
path: packages/
- persist_to_workspace:
root: .
paths:
- packages
changelog:
docker:
- image: quay.io/influxdb/changelogger:a20523cf8594eb93920e74d0189d6602a76a6146

View File

@ -0,0 +1,52 @@
#!/bin/bash
set -o errexit \
-o nounset \
-o pipefail
# Determine if "${CIRCLE_TAG}" matches the semantic version regex. Otherwise,
# assume that "${CIRCLE_TAG}" is not intended to tag a release. The regex is
# permissive of what occurs after the semantic version. This allows for
# alphas, betas, and release candidates.
if [[ "${CIRCLE_TAG:-}" =~ ^v[0-9]+.[0-9]+.[0-9]+ ]]
then
VERSION_REGEX="${CIRCLE_TAG/#v/}"
else
# When "${CIRCLE_TAG}" cannot be used to construct the package version,
# use "${CIRCLE_SHA1}". Since "${CIRCLE_SHA1}" can start with an alpha
# (non-numeric) character, prefix it with "2.x-".
VERSION_REGEX="2.x[-_]${CIRCLE_SHA1:0:8}"
fi
REGEX='^packages/influxdb2-client[-_]'"${VERSION_REGEX}"'(.*)'
for target in packages/*
do
if [[ "${target}" =~ ${REGEX} ]]
then
# After renaming the artifact to the "latest/nightly" version, append
# the artifact to the `invalidations` file. Since `dl.influxdata.com`
# contains many 100GBs, this should only invalidate artifacts
# that have changed.
case ${1} in
nightly)
mv -v "${target}" "packages/influxdb2-client-nightly${BASH_REMATCH[1]}"
printf '/platform/nightlies/influxdb2-client-nightly%s\n' "${BASH_REMATCH[1]}" >>invalidations
;;
release)
cp -v "${target}" "packages/influxdb2-client-latest${BASH_REMATCH[1]}"
printf '/influxdb/releases/influxdb2-client-latest%s\n' "${BASH_REMATCH[1]}" >>invalidations
;;
esac
fi
done
case ${1} in
nightly)
aws s3 sync packages s3://dl.influxdata.com/platform/nightlies
;;
release)
aws s3 sync packages s3://dl.influxdata.com/influxdb/releases
;;
esac
aws cloudfront create-invalidation --distribution-id "${AWS_DISTRIBUTION_ID}" --paths $(<invalidations)

View File

@ -1,26 +0,0 @@
#!/bin/bash
set -o errexit \
-o nounset \
-o pipefail
REGEX='^dist/influxdb2-client-([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+)(.*)'
for target in dist/*
do
# `dist` contains more than just the packages. This will match
# only the artifacts with a "package" filename.
if [[ "${target}" =~ ${REGEX} ]]
then
mv -v "${target}" "dist/influxdb2-client-latest${BASH_REMATCH[2]}"
# After renaming the artifact to the "lastest" version, append the
# artifact to the `invalidations` file. Since `dl.influxdata.com`
# contains many 100GBs, this should only invalidate artifacts
# that have changed.
printf '/influxdb/releases/influxdb2-client-latest%s\n' "${BASH_REMATCH[2]}" >>invalidations
fi
done
aws s3 sync dist 's3://dl.influxdata.com/influxdb/releases/'
aws cloudfront create-invalidation --distribution-id "${AWS_DISTRIBUTION_ID}" --paths $(<invalidations)

View File

@ -1,93 +0,0 @@
project_name: influx-cli
# Do not make github release or generate a changelog
release:
disable: true
changelog:
skip: true
builds:
- id: influx
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64
ignore:
- goos: darwin
goarch: arm64
- goos: windows
goarch: arm64
main: ./cmd/influx
env:
- CGO_ENABLED=0
flags:
- -tags={{if eq .Os "windows"}}timetzdata{{end}}
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}}
binary: influx
nfpms:
- id: influx-cli
package_name: influxdb2-cli
formats:
- deb
- rpm
bindir: /usr/bin
conflicts:
- influxdb
overrides:
deb:
replaces:
# Tells the deb system that it's ok for this package to overwrite files from versions of the `influxdb2`
# package prior to 2.1.0. Needed to support installing `influxdb2-cli` next to `influxdb2` without upgrading
# the server.
- influxdb2 (<< 2.1.0)
file_name_template: influxdb2-client-{{if index .Env "IS_SNAPSHOT"}}SNAPSHOT{{else if index .Env "IS_NIGHTLY"}}nightly{{else}}{{.Version}}{{end}}-{{ .Arch }}
rpm:
conflicts:
# Tells the rpm system that this package can't be installed alongside versions of the `influxdb2` package
# prior to 2.1.0. This is as good as we can do for rpm; there's no equivalent to deb's "replaces" metadata.
- influxdb2 < 2.1.0
replacements:
amd64: x86_64
arm64: aarch64
armhf: armv7hl
file_name_template: influxdb2-client-{{if index .Env "IS_SNAPSHOT"}}SNAPSHOT{{else if index .Env "IS_NIGHTLY"}}nightly{{else}}{{.Version}}{{end}}.{{ .Arch }}
vendor: InfluxData
homepage: https://influxdata.com
maintainer: support@influxdata.com
description: CLI for managing resources in InfluxDB v2
license: MIT
archives:
- id: influx-cli
format: tar.gz
format_overrides:
- goos: windows
format: zip
wrap_in_directory: true
name_template: influxdb2-client-{{if index .Env "IS_SNAPSHOT"}}SNAPSHOT{{else if index .Env "IS_NIGHTLY"}}nightly{{else}}{{.Version}}{{end}}-{{ .Os }}-{{ .Arch }}
files:
- LICENSE
- README.md
checksum:
name_template: influxdb2-client-{{if index .Env "IS_SNAPSHOT"}}SNAPSHOT{{else if index .Env "IS_NIGHTLY"}}nightly{{else}}{{.Version}}{{end}}.sha256
algorithm: sha256
signs:
- signature: "${artifact}.asc"
cmd: gpg
args: [ --passphrase, "{{.Env.PASSPHRASE}}", --pinentry-mode=loopback, --batch, --armor, --detach-sign, "${artifact}"]
artifacts: all
blobs:
- provider: s3
bucket: dl.influxdata.com
region: us-east-1
folder: '{{if index .Env "IS_NIGHTLY"}}platform/nightlies/{{else}}influxdb/releases/{{end}}'
extra_files:
- glob: ./changelog_artifacts/CHANGELOG*.md

View File

@ -1,9 +1,19 @@
# TOP is the directory where Makefile lives (i.e. top-level project).
# This must be before any includes.
TOP := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
include $(TOP)/support.mk
### Environment setup
export GOPATH=$(shell go env GOPATH)
export GOOS=$(shell go env GOOS)
export GOARCH=$(shell go env GOARCH)
export GOVERSION=$(shell go list -m -f '{{.GoVersion}}')
ifeq ($(GOOS),windows)
GOTAGS += timetzdata,
endif
LDFLAGS := $(LDFLAGS) -X main.date=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
ifdef VERSION
@ -20,7 +30,7 @@ ifneq ($(GCFLAGS),)
GCFLAGS := -gcflags "$(GCFLAGS)"
endif
export GO_BUILD=go build $(GCFLAGS) -ldflags "$(LDFLAGS)"
export GO_BUILD=go build $(call with-param,-tags ,$(GOTAGS)) $(GCFLAGS) -ldflags "$(LDFLAGS)"
# SOURCES are the files that affect building the main binary.
SOURCES := $(shell find . -name '*.go' -not -name '*_test.go') go.mod go.sum
@ -45,11 +55,11 @@ fmt: $(FMT_FILES)
# Format imports.
go run github.com/daixiang0/gci -w $^
bin/$(GOOS)/influx: $(SOURCES)
bin/$(GOOS)/$(GOARCH)/influx: $(SOURCES)
CGO_ENABLED=0 $(GO_BUILD) -o $@ ./cmd/$(shell basename "$@")
.DEFAULT_GOAL := influx
influx: bin/$(GOOS)/influx
influx: bin/$(GOOS)/$(GOARCH)/influx
clean:
$(RM) -r bin

View File

@ -24,14 +24,21 @@ var (
_ _context.Context
)
type AuthorizationsApi interface {
type AuthorizationsAPITokensApi interface {
/*
* DeleteAuthorizationsID Delete an authorization
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param authID The ID of the authorization to delete.
* @return ApiDeleteAuthorizationsIDRequest
*/
* DeleteAuthorizationsID Delete an authorization
* Deletes an authorization.
Use the endpoint to delete an API token.
If you want to disable an API token instead of delete it,
[update the authorization's status to `inactive`](#operation/PatchAuthorizationsID).
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param authID An authorization ID. Specifies the authorization to delete.
* @return ApiDeleteAuthorizationsIDRequest
*/
DeleteAuthorizationsID(ctx _context.Context, authID string) ApiDeleteAuthorizationsIDRequest
/*
@ -48,21 +55,24 @@ type AuthorizationsApi interface {
/*
* GetAuthorizations List authorizations
* Retrieves a list of authorizations.
* Lists authorizations.
To limit which authorizations are returned, pass query parameters in your request.
If no query parameters are passed, InfluxDB returns all authorizations.
#### InfluxDB OSS
#### InfluxDB Cloud
- Returns
[API token]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#token) values in authorizations.
- If the request uses an _[operator token](https://docs.influxdata.com/influxdb/latest/security/tokens/#operator-token)_,
InfluxDB OSS returns authorizations for all organizations in the instance.
- InfluxDB Cloud doesn't expose [API token]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#token)
values in `GET /api/v2/authorizations` responses;
returns `token: redacted` for all authorizations.
#### Required permissions
- InfluxDB OSS requires an _[operator token](https://docs.influxdata.com/influxdb/latest/security/tokens/#operator-token)_.
To retrieve an authorization, the request must use an API token that has the
following permissions:
- `read-authorizations`
- `read-user` for the user that the authorization is scoped to
#### Related guides
@ -88,11 +98,27 @@ type AuthorizationsApi interface {
GetAuthorizationsExecuteWithHttpInfo(r ApiGetAuthorizationsRequest) (Authorizations, *_nethttp.Response, error)
/*
* GetAuthorizationsID Retrieve an authorization
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param authID The ID of the authorization to get.
* @return ApiGetAuthorizationsIDRequest
*/
* GetAuthorizationsID Retrieve an authorization
* Retrieves an authorization.
Use this endpoint to retrieve information about an API token, including
the token's permissions and the user that the token is scoped to.
#### InfluxDB OSS
- InfluxDB OSS returns
[API token]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#token) values in authorizations.
- If the request uses an _[operator token](https://docs.influxdata.com/influxdb/latest/security/tokens/#operator-token)_,
InfluxDB OSS returns authorizations for all organizations in the instance.
#### Related guides
- [View tokens]({{% INFLUXDB_DOCS_URL %}}/security/tokens/view-tokens/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param authID An authorization ID. Specifies the authorization to retrieve.
* @return ApiGetAuthorizationsIDRequest
*/
GetAuthorizationsID(ctx _context.Context, authID string) ApiGetAuthorizationsIDRequest
/*
@ -110,11 +136,16 @@ type AuthorizationsApi interface {
GetAuthorizationsIDExecuteWithHttpInfo(r ApiGetAuthorizationsIDRequest) (Authorization, *_nethttp.Response, error)
/*
* PatchAuthorizationsID Update an authorization to be active or inactive
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param authID The ID of the authorization to update.
* @return ApiPatchAuthorizationsIDRequest
*/
* PatchAuthorizationsID Update an API token to be active or inactive
* Updates an authorization.
Use this endpoint to set an API token's status to be _active_ or _inactive_.
InfluxDB rejects requests that use inactive API tokens.
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param authID An authorization ID. Specifies the authorization to update.
* @return ApiPatchAuthorizationsIDRequest
*/
PatchAuthorizationsID(ctx _context.Context, authID string) ApiPatchAuthorizationsIDRequest
/*
@ -133,27 +164,29 @@ type AuthorizationsApi interface {
/*
* PostAuthorizations Create an authorization
* Creates an authorization.
* Creates an authorization and returns the authorization with the
generated API [token]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#token).
Use this endpoint to create an authorization, which generates an API token
with permissions to `read` or `write` to a specific resource or `type` of resource.
The response contains the new authorization with the generated API token.
The API token is the authorization's `token` property value.
Keep the following in mind when creating and updating authorizations:
To follow best practices for secure API token generation and retrieval,
InfluxDB enforces access restrictions on API tokens.
- To apply a permission to a specific resource, specify the resource `id` field.
- To apply a permission to all resources with the type, omit the resource `id`.
- To scope an authorization to a specific user, provide the `userID` property.
- InfluxDB allows access to the API token value immediately after the authorization is created.
- You cant change access (read/write) permissions for an API token after its created.
- Tokens stop working when the user who created the token is deleted.
#### Limitations
We recommend the following for managing your tokens:
- In InfluxDB OSS, API tokens are visible to the user who created the authorization and to any
user with an _[operator token]({{% INFLUXDB_DOCS_URL %}}/security/tokens/#operator-token)_.
- Even if an API token has `read-authorizations` permission, the
token can't be used to view its authorization details.
- Tokens stop working when the user who created the token is deleted.
- Create a generic user to create and manage tokens for writing data.
- Store your tokens in a secure password vault for future access.
We recommend creating a generic user to create and manage tokens for writing data.
#### Required permissions
- `write-authorizations`
- `write-user` for the user that the authorization is scoped to
#### Related guides
@ -179,12 +212,12 @@ type AuthorizationsApi interface {
PostAuthorizationsExecuteWithHttpInfo(r ApiPostAuthorizationsRequest) (Authorization, *_nethttp.Response, error)
}
// AuthorizationsApiService AuthorizationsApi service
type AuthorizationsApiService service
// AuthorizationsAPITokensApiService AuthorizationsAPITokensApi service
type AuthorizationsAPITokensApiService service
type ApiDeleteAuthorizationsIDRequest struct {
ctx _context.Context
ApiService AuthorizationsApi
ApiService AuthorizationsAPITokensApi
authID string
zapTraceSpan *string
}
@ -214,12 +247,19 @@ func (r ApiDeleteAuthorizationsIDRequest) ExecuteWithHttpInfo() (*_nethttp.Respo
}
/*
* DeleteAuthorizationsID Delete an authorization
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param authID The ID of the authorization to delete.
* @return ApiDeleteAuthorizationsIDRequest
*/
func (a *AuthorizationsApiService) DeleteAuthorizationsID(ctx _context.Context, authID string) ApiDeleteAuthorizationsIDRequest {
- DeleteAuthorizationsID Delete an authorization
- Deletes an authorization.
Use the endpoint to delete an API token.
If you want to disable an API token instead of delete it,
[update the authorization's status to `inactive`](#operation/PatchAuthorizationsID).
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param authID An authorization ID. Specifies the authorization to delete.
- @return ApiDeleteAuthorizationsIDRequest
*/
func (a *AuthorizationsAPITokensApiService) DeleteAuthorizationsID(ctx _context.Context, authID string) ApiDeleteAuthorizationsIDRequest {
return ApiDeleteAuthorizationsIDRequest{
ApiService: a,
ctx: ctx,
@ -230,7 +270,7 @@ func (a *AuthorizationsApiService) DeleteAuthorizationsID(ctx _context.Context,
/*
* Execute executes the request
*/
func (a *AuthorizationsApiService) DeleteAuthorizationsIDExecute(r ApiDeleteAuthorizationsIDRequest) error {
func (a *AuthorizationsAPITokensApiService) DeleteAuthorizationsIDExecute(r ApiDeleteAuthorizationsIDRequest) error {
_, err := a.DeleteAuthorizationsIDExecuteWithHttpInfo(r)
return err
}
@ -240,7 +280,7 @@ func (a *AuthorizationsApiService) DeleteAuthorizationsIDExecute(r ApiDeleteAuth
* returned HTTP response as it will have already been read and closed; access to the response body content should be
* achieved through the returned response model if applicable.
*/
func (a *AuthorizationsApiService) DeleteAuthorizationsIDExecuteWithHttpInfo(r ApiDeleteAuthorizationsIDRequest) (*_nethttp.Response, error) {
func (a *AuthorizationsAPITokensApiService) DeleteAuthorizationsIDExecuteWithHttpInfo(r ApiDeleteAuthorizationsIDRequest) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodDelete
localVarPostBody interface{}
@ -249,7 +289,7 @@ func (a *AuthorizationsApiService) DeleteAuthorizationsIDExecuteWithHttpInfo(r A
localVarFileBytes []byte
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthorizationsApiService.DeleteAuthorizationsID")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthorizationsAPITokensApiService.DeleteAuthorizationsID")
if err != nil {
return nil, GenericOpenAPIError{error: err.Error()}
}
@ -310,6 +350,39 @@ func (a *AuthorizationsApiService) DeleteAuthorizationsIDExecuteWithHttpInfo(r A
}
newErr.body = localVarBody
newErr.error = localVarHTTPResponse.Status
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = _fmt.Sprintf("%s: %s", newErr.Error(), err.Error())
return localVarHTTPResponse, newErr
}
v.SetMessage(_fmt.Sprintf("%s: %s", newErr.Error(), v.GetMessage()))
newErr.model = &v
return localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v UnauthorizedRequestError
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = _fmt.Sprintf("%s: %s", newErr.Error(), err.Error())
return localVarHTTPResponse, newErr
}
v.SetMessage(_fmt.Sprintf("%s: %s", newErr.Error(), v.GetMessage()))
newErr.model = &v
return localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = _fmt.Sprintf("%s: %s", newErr.Error(), err.Error())
return localVarHTTPResponse, newErr
}
v.SetMessage(_fmt.Sprintf("%s: %s", newErr.Error(), v.GetMessage()))
newErr.model = &v
return localVarHTTPResponse, newErr
}
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
@ -326,12 +399,13 @@ func (a *AuthorizationsApiService) DeleteAuthorizationsIDExecuteWithHttpInfo(r A
type ApiGetAuthorizationsRequest struct {
ctx _context.Context
ApiService AuthorizationsApi
ApiService AuthorizationsAPITokensApi
zapTraceSpan *string
userID *string
user *string
orgID *string
org *string
token *string
}
func (r ApiGetAuthorizationsRequest) ZapTraceSpan(zapTraceSpan string) ApiGetAuthorizationsRequest {
@ -374,6 +448,14 @@ func (r ApiGetAuthorizationsRequest) GetOrg() *string {
return r.org
}
func (r ApiGetAuthorizationsRequest) Token(token string) ApiGetAuthorizationsRequest {
r.token = &token
return r
}
func (r ApiGetAuthorizationsRequest) GetToken() *string {
return r.token
}
func (r ApiGetAuthorizationsRequest) Execute() (Authorizations, error) {
return r.ApiService.GetAuthorizationsExecute(r)
}
@ -383,31 +465,34 @@ func (r ApiGetAuthorizationsRequest) ExecuteWithHttpInfo() (Authorizations, *_ne
}
/*
* GetAuthorizations List authorizations
* Retrieves a list of authorizations.
- GetAuthorizations List authorizations
- Lists authorizations.
To limit which authorizations are returned, pass query parameters in your request.
If no query parameters are passed, InfluxDB returns all authorizations.
#### InfluxDB OSS
#### InfluxDB Cloud
- Returns
[API token]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#token) values in authorizations.
- If the request uses an _[operator token](https://docs.influxdata.com/influxdb/latest/security/tokens/#operator-token)_,
InfluxDB OSS returns authorizations for all organizations in the instance.
- InfluxDB Cloud doesn't expose [API token]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#token)
values in `GET /api/v2/authorizations` responses;
returns `token: redacted` for all authorizations.
#### Required permissions
- InfluxDB OSS requires an _[operator token](https://docs.influxdata.com/influxdb/latest/security/tokens/#operator-token)_.
To retrieve an authorization, the request must use an API token that has the
following permissions:
- `read-authorizations`
- `read-user` for the user that the authorization is scoped to
#### Related guides
- [View tokens]({{% INFLUXDB_DOCS_URL %}}/security/tokens/view-tokens/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiGetAuthorizationsRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @return ApiGetAuthorizationsRequest
*/
func (a *AuthorizationsApiService) GetAuthorizations(ctx _context.Context) ApiGetAuthorizationsRequest {
func (a *AuthorizationsAPITokensApiService) GetAuthorizations(ctx _context.Context) ApiGetAuthorizationsRequest {
return ApiGetAuthorizationsRequest{
ApiService: a,
ctx: ctx,
@ -418,7 +503,7 @@ func (a *AuthorizationsApiService) GetAuthorizations(ctx _context.Context) ApiGe
* Execute executes the request
* @return Authorizations
*/
func (a *AuthorizationsApiService) GetAuthorizationsExecute(r ApiGetAuthorizationsRequest) (Authorizations, error) {
func (a *AuthorizationsAPITokensApiService) GetAuthorizationsExecute(r ApiGetAuthorizationsRequest) (Authorizations, error) {
returnVal, _, err := a.GetAuthorizationsExecuteWithHttpInfo(r)
return returnVal, err
}
@ -429,7 +514,7 @@ func (a *AuthorizationsApiService) GetAuthorizationsExecute(r ApiGetAuthorizatio
* achieved through the returned response model if applicable.
* @return Authorizations
*/
func (a *AuthorizationsApiService) GetAuthorizationsExecuteWithHttpInfo(r ApiGetAuthorizationsRequest) (Authorizations, *_nethttp.Response, error) {
func (a *AuthorizationsAPITokensApiService) GetAuthorizationsExecuteWithHttpInfo(r ApiGetAuthorizationsRequest) (Authorizations, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
@ -439,7 +524,7 @@ func (a *AuthorizationsApiService) GetAuthorizationsExecuteWithHttpInfo(r ApiGet
localVarReturnValue Authorizations
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthorizationsApiService.GetAuthorizations")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthorizationsAPITokensApiService.GetAuthorizations")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -462,6 +547,9 @@ func (a *AuthorizationsApiService) GetAuthorizationsExecuteWithHttpInfo(r ApiGet
if r.org != nil {
localVarQueryParams.Add("org", parameterToString(*r.org, ""))
}
if r.token != nil {
localVarQueryParams.Add("token", parameterToString(*r.token, ""))
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
@ -568,7 +656,7 @@ func (a *AuthorizationsApiService) GetAuthorizationsExecuteWithHttpInfo(r ApiGet
type ApiGetAuthorizationsIDRequest struct {
ctx _context.Context
ApiService AuthorizationsApi
ApiService AuthorizationsAPITokensApi
authID string
zapTraceSpan *string
}
@ -598,12 +686,28 @@ func (r ApiGetAuthorizationsIDRequest) ExecuteWithHttpInfo() (Authorization, *_n
}
/*
* GetAuthorizationsID Retrieve an authorization
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param authID The ID of the authorization to get.
* @return ApiGetAuthorizationsIDRequest
*/
func (a *AuthorizationsApiService) GetAuthorizationsID(ctx _context.Context, authID string) ApiGetAuthorizationsIDRequest {
- GetAuthorizationsID Retrieve an authorization
- Retrieves an authorization.
Use this endpoint to retrieve information about an API token, including
the token's permissions and the user that the token is scoped to.
#### InfluxDB OSS
- InfluxDB OSS returns
[API token]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#token) values in authorizations.
- If the request uses an _[operator token](https://docs.influxdata.com/influxdb/latest/security/tokens/#operator-token)_,
InfluxDB OSS returns authorizations for all organizations in the instance.
#### Related guides
- [View tokens]({{% INFLUXDB_DOCS_URL %}}/security/tokens/view-tokens/)
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param authID An authorization ID. Specifies the authorization to retrieve.
- @return ApiGetAuthorizationsIDRequest
*/
func (a *AuthorizationsAPITokensApiService) GetAuthorizationsID(ctx _context.Context, authID string) ApiGetAuthorizationsIDRequest {
return ApiGetAuthorizationsIDRequest{
ApiService: a,
ctx: ctx,
@ -615,7 +719,7 @@ func (a *AuthorizationsApiService) GetAuthorizationsID(ctx _context.Context, aut
* Execute executes the request
* @return Authorization
*/
func (a *AuthorizationsApiService) GetAuthorizationsIDExecute(r ApiGetAuthorizationsIDRequest) (Authorization, error) {
func (a *AuthorizationsAPITokensApiService) GetAuthorizationsIDExecute(r ApiGetAuthorizationsIDRequest) (Authorization, error) {
returnVal, _, err := a.GetAuthorizationsIDExecuteWithHttpInfo(r)
return returnVal, err
}
@ -626,7 +730,7 @@ func (a *AuthorizationsApiService) GetAuthorizationsIDExecute(r ApiGetAuthorizat
* achieved through the returned response model if applicable.
* @return Authorization
*/
func (a *AuthorizationsApiService) GetAuthorizationsIDExecuteWithHttpInfo(r ApiGetAuthorizationsIDRequest) (Authorization, *_nethttp.Response, error) {
func (a *AuthorizationsAPITokensApiService) GetAuthorizationsIDExecuteWithHttpInfo(r ApiGetAuthorizationsIDRequest) (Authorization, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
@ -636,7 +740,7 @@ func (a *AuthorizationsApiService) GetAuthorizationsIDExecuteWithHttpInfo(r ApiG
localVarReturnValue Authorization
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthorizationsApiService.GetAuthorizationsID")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthorizationsAPITokensApiService.GetAuthorizationsID")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -697,6 +801,39 @@ func (a *AuthorizationsApiService) GetAuthorizationsIDExecuteWithHttpInfo(r ApiG
}
newErr.body = localVarBody
newErr.error = localVarHTTPResponse.Status
if localVarHTTPResponse.StatusCode == 400 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = _fmt.Sprintf("%s: %s", newErr.Error(), err.Error())
return localVarReturnValue, localVarHTTPResponse, newErr
}
v.SetMessage(_fmt.Sprintf("%s: %s", newErr.Error(), v.GetMessage()))
newErr.model = &v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v UnauthorizedRequestError
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = _fmt.Sprintf("%s: %s", newErr.Error(), err.Error())
return localVarReturnValue, localVarHTTPResponse, newErr
}
v.SetMessage(_fmt.Sprintf("%s: %s", newErr.Error(), v.GetMessage()))
newErr.model = &v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = _fmt.Sprintf("%s: %s", newErr.Error(), err.Error())
return localVarReturnValue, localVarHTTPResponse, newErr
}
v.SetMessage(_fmt.Sprintf("%s: %s", newErr.Error(), v.GetMessage()))
newErr.model = &v
return localVarReturnValue, localVarHTTPResponse, newErr
}
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
@ -732,7 +869,7 @@ func (a *AuthorizationsApiService) GetAuthorizationsIDExecuteWithHttpInfo(r ApiG
type ApiPatchAuthorizationsIDRequest struct {
ctx _context.Context
ApiService AuthorizationsApi
ApiService AuthorizationsAPITokensApi
authID string
authorizationUpdateRequest *AuthorizationUpdateRequest
zapTraceSpan *string
@ -771,12 +908,17 @@ func (r ApiPatchAuthorizationsIDRequest) ExecuteWithHttpInfo() (Authorization, *
}
/*
* PatchAuthorizationsID Update an authorization to be active or inactive
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param authID The ID of the authorization to update.
* @return ApiPatchAuthorizationsIDRequest
*/
func (a *AuthorizationsApiService) PatchAuthorizationsID(ctx _context.Context, authID string) ApiPatchAuthorizationsIDRequest {
- PatchAuthorizationsID Update an API token to be active or inactive
- Updates an authorization.
Use this endpoint to set an API token's status to be _active_ or _inactive_.
InfluxDB rejects requests that use inactive API tokens.
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param authID An authorization ID. Specifies the authorization to update.
- @return ApiPatchAuthorizationsIDRequest
*/
func (a *AuthorizationsAPITokensApiService) PatchAuthorizationsID(ctx _context.Context, authID string) ApiPatchAuthorizationsIDRequest {
return ApiPatchAuthorizationsIDRequest{
ApiService: a,
ctx: ctx,
@ -788,7 +930,7 @@ func (a *AuthorizationsApiService) PatchAuthorizationsID(ctx _context.Context, a
* Execute executes the request
* @return Authorization
*/
func (a *AuthorizationsApiService) PatchAuthorizationsIDExecute(r ApiPatchAuthorizationsIDRequest) (Authorization, error) {
func (a *AuthorizationsAPITokensApiService) PatchAuthorizationsIDExecute(r ApiPatchAuthorizationsIDRequest) (Authorization, error) {
returnVal, _, err := a.PatchAuthorizationsIDExecuteWithHttpInfo(r)
return returnVal, err
}
@ -799,7 +941,7 @@ func (a *AuthorizationsApiService) PatchAuthorizationsIDExecute(r ApiPatchAuthor
* achieved through the returned response model if applicable.
* @return Authorization
*/
func (a *AuthorizationsApiService) PatchAuthorizationsIDExecuteWithHttpInfo(r ApiPatchAuthorizationsIDRequest) (Authorization, *_nethttp.Response, error) {
func (a *AuthorizationsAPITokensApiService) PatchAuthorizationsIDExecuteWithHttpInfo(r ApiPatchAuthorizationsIDRequest) (Authorization, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPatch
localVarPostBody interface{}
@ -809,7 +951,7 @@ func (a *AuthorizationsApiService) PatchAuthorizationsIDExecuteWithHttpInfo(r Ap
localVarReturnValue Authorization
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthorizationsApiService.PatchAuthorizationsID")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthorizationsAPITokensApiService.PatchAuthorizationsID")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}
@ -910,7 +1052,7 @@ func (a *AuthorizationsApiService) PatchAuthorizationsIDExecuteWithHttpInfo(r Ap
type ApiPostAuthorizationsRequest struct {
ctx _context.Context
ApiService AuthorizationsApi
ApiService AuthorizationsAPITokensApi
authorizationPostRequest *AuthorizationPostRequest
zapTraceSpan *string
}
@ -940,37 +1082,40 @@ func (r ApiPostAuthorizationsRequest) ExecuteWithHttpInfo() (Authorization, *_ne
}
/*
* PostAuthorizations Create an authorization
* Creates an authorization.
- PostAuthorizations Create an authorization
- Creates an authorization and returns the authorization with the
generated API [token]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#token).
Use this endpoint to create an authorization, which generates an API token
with permissions to `read` or `write` to a specific resource or `type` of resource.
The response contains the new authorization with the generated API token.
The API token is the authorization's `token` property value.
Keep the following in mind when creating and updating authorizations:
To follow best practices for secure API token generation and retrieval,
InfluxDB enforces access restrictions on API tokens.
- To apply a permission to a specific resource, specify the resource `id` field.
- To apply a permission to all resources with the type, omit the resource `id`.
- To scope an authorization to a specific user, provide the `userID` property.
- InfluxDB allows access to the API token value immediately after the authorization is created.
- You cant change access (read/write) permissions for an API token after its created.
- Tokens stop working when the user who created the token is deleted.
#### Limitations
We recommend the following for managing your tokens:
- In InfluxDB OSS, API tokens are visible to the user who created the authorization and to any
user with an _[operator token]({{% INFLUXDB_DOCS_URL %}}/security/tokens/#operator-token)_.
- Even if an API token has `read-authorizations` permission, the
token can't be used to view its authorization details.
- Tokens stop working when the user who created the token is deleted.
- Create a generic user to create and manage tokens for writing data.
- Store your tokens in a secure password vault for future access.
We recommend creating a generic user to create and manage tokens for writing data.
#### Required permissions
- `write-authorizations`
- `write-user` for the user that the authorization is scoped to
#### Related guides
- [Create a token]({{% INFLUXDB_DOCS_URL %}}/security/tokens/create-token/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiPostAuthorizationsRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @return ApiPostAuthorizationsRequest
*/
func (a *AuthorizationsApiService) PostAuthorizations(ctx _context.Context) ApiPostAuthorizationsRequest {
func (a *AuthorizationsAPITokensApiService) PostAuthorizations(ctx _context.Context) ApiPostAuthorizationsRequest {
return ApiPostAuthorizationsRequest{
ApiService: a,
ctx: ctx,
@ -981,7 +1126,7 @@ func (a *AuthorizationsApiService) PostAuthorizations(ctx _context.Context) ApiP
* Execute executes the request
* @return Authorization
*/
func (a *AuthorizationsApiService) PostAuthorizationsExecute(r ApiPostAuthorizationsRequest) (Authorization, error) {
func (a *AuthorizationsAPITokensApiService) PostAuthorizationsExecute(r ApiPostAuthorizationsRequest) (Authorization, error) {
returnVal, _, err := a.PostAuthorizationsExecuteWithHttpInfo(r)
return returnVal, err
}
@ -992,7 +1137,7 @@ func (a *AuthorizationsApiService) PostAuthorizationsExecute(r ApiPostAuthorizat
* achieved through the returned response model if applicable.
* @return Authorization
*/
func (a *AuthorizationsApiService) PostAuthorizationsExecuteWithHttpInfo(r ApiPostAuthorizationsRequest) (Authorization, *_nethttp.Response, error) {
func (a *AuthorizationsAPITokensApiService) PostAuthorizationsExecuteWithHttpInfo(r ApiPostAuthorizationsRequest) (Authorization, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
localVarPostBody interface{}
@ -1002,7 +1147,7 @@ func (a *AuthorizationsApiService) PostAuthorizationsExecuteWithHttpInfo(r ApiPo
localVarReturnValue Authorization
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthorizationsApiService.PostAuthorizations")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthorizationsAPITokensApiService.PostAuthorizations")
if err != nil {
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
}

View File

@ -122,13 +122,14 @@ func (r ApiGetBackupKVRequest) ExecuteWithHttpInfo() (*_nethttp.Response, *_neth
}
/*
* GetBackupKV Download snapshot of metadata stored in the server's embedded KV store. Don't use with InfluxDB versions greater than InfluxDB 2.1.x.
* Retrieves a snapshot of metadata stored in the server's embedded KV store.
- GetBackupKV Download snapshot of metadata stored in the server's embedded KV store. Don't use with InfluxDB versions greater than InfluxDB 2.1.x.
- Retrieves a snapshot of metadata stored in the server's embedded KV store.
InfluxDB versions greater than 2.1.x don't include metadata stored in embedded SQL;
avoid using this endpoint with versions greater than 2.1.x.
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiGetBackupKVRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @return ApiGetBackupKVRequest
*/
func (a *BackupApiService) GetBackupKV(ctx _context.Context) ApiGetBackupKVRequest {
return ApiGetBackupKVRequest{

View File

@ -96,7 +96,7 @@ type BucketSchemasApi interface {
/*
* GetMeasurementSchemas List measurement schemas of a bucket
* Retrieves a list of _explicit_
* Lists _explicit_
[schemas]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#schema)
(`"schemaType": "explicit"`) for a bucket.
@ -175,9 +175,9 @@ type ApiCreateMeasurementSchemaRequest struct {
ctx _context.Context
ApiService BucketSchemasApi
bucketID string
measurementSchemaCreateRequest *MeasurementSchemaCreateRequest
org *string
orgID *string
measurementSchemaCreateRequest *MeasurementSchemaCreateRequest
}
func (r ApiCreateMeasurementSchemaRequest) BucketID(bucketID string) ApiCreateMeasurementSchemaRequest {
@ -188,6 +188,14 @@ func (r ApiCreateMeasurementSchemaRequest) GetBucketID() string {
return r.bucketID
}
func (r ApiCreateMeasurementSchemaRequest) MeasurementSchemaCreateRequest(measurementSchemaCreateRequest MeasurementSchemaCreateRequest) ApiCreateMeasurementSchemaRequest {
r.measurementSchemaCreateRequest = &measurementSchemaCreateRequest
return r
}
func (r ApiCreateMeasurementSchemaRequest) GetMeasurementSchemaCreateRequest() *MeasurementSchemaCreateRequest {
return r.measurementSchemaCreateRequest
}
func (r ApiCreateMeasurementSchemaRequest) Org(org string) ApiCreateMeasurementSchemaRequest {
r.org = &org
return r
@ -204,14 +212,6 @@ func (r ApiCreateMeasurementSchemaRequest) GetOrgID() *string {
return r.orgID
}
func (r ApiCreateMeasurementSchemaRequest) MeasurementSchemaCreateRequest(measurementSchemaCreateRequest MeasurementSchemaCreateRequest) ApiCreateMeasurementSchemaRequest {
r.measurementSchemaCreateRequest = &measurementSchemaCreateRequest
return r
}
func (r ApiCreateMeasurementSchemaRequest) GetMeasurementSchemaCreateRequest() *MeasurementSchemaCreateRequest {
return r.measurementSchemaCreateRequest
}
func (r ApiCreateMeasurementSchemaRequest) Execute() (MeasurementSchema, error) {
return r.ApiService.CreateMeasurementSchemaExecute(r)
}
@ -221,8 +221,9 @@ func (r ApiCreateMeasurementSchemaRequest) ExecuteWithHttpInfo() (MeasurementSch
}
/*
* CreateMeasurementSchema Create a measurement schema for a bucket
* Creates an _explict_ measurement [schema]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#schema)
- CreateMeasurementSchema Create a measurement schema for a bucket
- Creates an _explict_ measurement [schema]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#schema)
for a bucket.
_Explicit_ schemas are used to enforce column names, tags, fields, and data
@ -243,9 +244,9 @@ schemas.
- [Manage bucket schemas]({{% INFLUXDB_DOCS_URL %}}/organizations/buckets/bucket-schema/).
- [Create a bucket with an explicit schema]({{% INFLUXDB_DOCS_URL %}}/organizations/buckets/create-bucket/#create-a-bucket-with-an-explicit-schema)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param bucketID A bucket ID. Adds a schema for the specified bucket.
* @return ApiCreateMeasurementSchemaRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param bucketID A bucket ID. Adds a schema for the specified bucket.
- @return ApiCreateMeasurementSchemaRequest
*/
func (a *BucketSchemasApiService) CreateMeasurementSchema(ctx _context.Context, bucketID string) ApiCreateMeasurementSchemaRequest {
return ApiCreateMeasurementSchemaRequest{
@ -291,6 +292,9 @@ func (a *BucketSchemasApiService) CreateMeasurementSchemaExecuteWithHttpInfo(r A
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
if r.measurementSchemaCreateRequest == nil {
return localVarReturnValue, nil, reportError("measurementSchemaCreateRequest is required and must be specified")
}
if r.org != nil {
localVarQueryParams.Add("org", parameterToString(*r.org, ""))
@ -443,13 +447,13 @@ func (r ApiGetMeasurementSchemaRequest) ExecuteWithHttpInfo() (MeasurementSchema
}
/*
* GetMeasurementSchema Retrieve a measurement schema
* Retrieves an explicit measurement [schema]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#schema).
* GetMeasurementSchema Retrieve a measurement schema
* Retrieves an explicit measurement [schema]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#schema).
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param bucketID A bucket ID. Retrieves schemas for the specified bucket.
* @param measurementID The measurement schema ID. Specifies the measurement schema to retrieve.
* @return ApiGetMeasurementSchemaRequest
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param bucketID A bucket ID. Retrieves schemas for the specified bucket.
* @param measurementID The measurement schema ID. Specifies the measurement schema to retrieve.
* @return ApiGetMeasurementSchemaRequest
*/
func (a *BucketSchemasApiService) GetMeasurementSchema(ctx _context.Context, bucketID string, measurementID string) ApiGetMeasurementSchemaRequest {
return ApiGetMeasurementSchemaRequest{
@ -636,8 +640,9 @@ func (r ApiGetMeasurementSchemasRequest) ExecuteWithHttpInfo() (MeasurementSchem
}
/*
* GetMeasurementSchemas List measurement schemas of a bucket
* Retrieves a list of _explicit_
- GetMeasurementSchemas List measurement schemas of a bucket
- Lists _explicit_
[schemas]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#schema)
(`"schemaType": "explicit"`) for a bucket.
@ -651,9 +656,9 @@ that conforms to your data.
- [Using bucket schemas](https://www.influxdata.com/blog/new-bucket-schema-option-protect-from-unwanted-schema-changes/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param bucketID A bucket ID. Lists measurement schemas for the specified bucket.
* @return ApiGetMeasurementSchemasRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param bucketID A bucket ID. Lists measurement schemas for the specified bucket.
- @return ApiGetMeasurementSchemasRequest
*/
func (a *BucketSchemasApiService) GetMeasurementSchemas(ctx _context.Context, bucketID string) ApiGetMeasurementSchemasRequest {
return ApiGetMeasurementSchemasRequest{
@ -807,9 +812,9 @@ type ApiUpdateMeasurementSchemaRequest struct {
ApiService BucketSchemasApi
bucketID string
measurementID string
measurementSchemaUpdateRequest *MeasurementSchemaUpdateRequest
org *string
orgID *string
measurementSchemaUpdateRequest *MeasurementSchemaUpdateRequest
}
func (r ApiUpdateMeasurementSchemaRequest) BucketID(bucketID string) ApiUpdateMeasurementSchemaRequest {
@ -828,6 +833,14 @@ func (r ApiUpdateMeasurementSchemaRequest) GetMeasurementID() string {
return r.measurementID
}
func (r ApiUpdateMeasurementSchemaRequest) MeasurementSchemaUpdateRequest(measurementSchemaUpdateRequest MeasurementSchemaUpdateRequest) ApiUpdateMeasurementSchemaRequest {
r.measurementSchemaUpdateRequest = &measurementSchemaUpdateRequest
return r
}
func (r ApiUpdateMeasurementSchemaRequest) GetMeasurementSchemaUpdateRequest() *MeasurementSchemaUpdateRequest {
return r.measurementSchemaUpdateRequest
}
func (r ApiUpdateMeasurementSchemaRequest) Org(org string) ApiUpdateMeasurementSchemaRequest {
r.org = &org
return r
@ -844,14 +857,6 @@ func (r ApiUpdateMeasurementSchemaRequest) GetOrgID() *string {
return r.orgID
}
func (r ApiUpdateMeasurementSchemaRequest) MeasurementSchemaUpdateRequest(measurementSchemaUpdateRequest MeasurementSchemaUpdateRequest) ApiUpdateMeasurementSchemaRequest {
r.measurementSchemaUpdateRequest = &measurementSchemaUpdateRequest
return r
}
func (r ApiUpdateMeasurementSchemaRequest) GetMeasurementSchemaUpdateRequest() *MeasurementSchemaUpdateRequest {
return r.measurementSchemaUpdateRequest
}
func (r ApiUpdateMeasurementSchemaRequest) Execute() (MeasurementSchema, error) {
return r.ApiService.UpdateMeasurementSchemaExecute(r)
}
@ -861,8 +866,8 @@ func (r ApiUpdateMeasurementSchemaRequest) ExecuteWithHttpInfo() (MeasurementSch
}
/*
* UpdateMeasurementSchema Update a measurement schema
* Updates a measurement [schema]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#schema).
- UpdateMeasurementSchema Update a measurement schema
- Updates a measurement [schema]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#schema).
Use this endpoint to update the fields (`name`, `type`, and `dataType`) of a
measurement schema.
@ -876,10 +881,10 @@ measurement schema.
- [Manage bucket schemas]({{% INFLUXDB_DOCS_URL %}}/organizations/buckets/bucket-schema/).
- [Using bucket schemas](https://www.influxdata.com/blog/new-bucket-schema-option-protect-from-unwanted-schema-changes/).
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param bucketID A bucket ID. Specifies the bucket to retrieve schemas for.
* @param measurementID A measurement schema ID. Retrieves the specified measurement schema.
* @return ApiUpdateMeasurementSchemaRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param bucketID A bucket ID. Specifies the bucket to retrieve schemas for.
- @param measurementID A measurement schema ID. Retrieves the specified measurement schema.
- @return ApiUpdateMeasurementSchemaRequest
*/
func (a *BucketSchemasApiService) UpdateMeasurementSchema(ctx _context.Context, bucketID string, measurementID string) ApiUpdateMeasurementSchemaRequest {
return ApiUpdateMeasurementSchemaRequest{
@ -927,6 +932,9 @@ func (a *BucketSchemasApiService) UpdateMeasurementSchemaExecuteWithHttpInfo(r A
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
if r.measurementSchemaUpdateRequest == nil {
return localVarReturnValue, nil, reportError("measurementSchemaUpdateRequest is required and must be specified")
}
if r.org != nil {
localVarQueryParams.Add("org", parameterToString(*r.org, ""))

View File

@ -71,7 +71,7 @@ type BucketsApi interface {
/*
* GetBuckets List buckets
* Retrieves a list of [buckets]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#bucket).
* Lists [buckets]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#bucket).
InfluxDB retrieves buckets owned by the
[organization]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#organization)
@ -81,10 +81,6 @@ type BucketsApi interface {
If no query parameters are passed, InfluxDB returns all buckets up to the
default `limit`.
#### InfluxDB Cloud
- Doesn't use `org` or `orgID` parameters.
#### InfluxDB OSS
- If you use an _[operator token]({{% INFLUXDB_DOCS_URL %}}/security/tokens/#operator-token)_
@ -271,16 +267,16 @@ func (r ApiDeleteBucketsIDRequest) ExecuteWithHttpInfo() (*_nethttp.Response, er
}
/*
* DeleteBucketsID Delete a bucket
* Deletes a bucket and all associated records.
- DeleteBucketsID Delete a bucket
- Deletes a bucket and all associated records.
#### InfluxDB Cloud
- Does the following when you send a delete request:
1. Validates the request and queues the delete.
2. Returns an HTTP `204` status code if queued; _error_ otherwise.
3. Handles the delete asynchronously.
1. Validates the request and queues the delete.
2. Returns an HTTP `204` status code if queued; _error_ otherwise.
3. Handles the delete asynchronously.
#### InfluxDB OSS
@ -295,9 +291,9 @@ and then responds with success or failure.
- [Delete a bucket]({{% INFLUXDB_DOCS_URL %}}/organizations/buckets/delete-bucket/#delete-a-bucket-in-the-influxdb-ui)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param bucketID Bucket ID. The ID of the bucket to delete.
* @return ApiDeleteBucketsIDRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param bucketID Bucket ID. The ID of the bucket to delete.
- @return ApiDeleteBucketsIDRequest
*/
func (a *BucketsApiService) DeleteBucketsID(ctx _context.Context, bucketID string) ApiDeleteBucketsIDRequest {
return ApiDeleteBucketsIDRequest{
@ -523,8 +519,8 @@ func (r ApiGetBucketsRequest) ExecuteWithHttpInfo() (Buckets, *_nethttp.Response
}
/*
* GetBuckets List buckets
* Retrieves a list of [buckets]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#bucket).
- GetBuckets List buckets
- Lists [buckets]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#bucket).
InfluxDB retrieves buckets owned by the
[organization]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#organization)
@ -534,17 +530,13 @@ To limit which buckets are returned, pass query parameters in your request.
If no query parameters are passed, InfluxDB returns all buckets up to the
default `limit`.
#### InfluxDB Cloud
- Doesn't use `org` or `orgID` parameters.
#### InfluxDB OSS
- If you use an _[operator token]({{% INFLUXDB_DOCS_URL %}}/security/tokens/#operator-token)_
to authenticate your request, InfluxDB retrieves resources for _all
organizations_ in the instance.
To retrieve resources for only a specific organization, use the
`org` parameter or the `orgID` parameter to specify the organization.
- If you use an _[operator token]({{% INFLUXDB_DOCS_URL %}}/security/tokens/#operator-token)_
to authenticate your request, InfluxDB retrieves resources for _all
organizations_ in the instance.
To retrieve resources for only a specific organization, use the
`org` parameter or the `orgID` parameter to specify the organization.
#### Required permissions
@ -557,8 +549,8 @@ default `limit`.
- [Manage buckets]({{% INFLUXDB_DOCS_URL %}}/organizations/buckets/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiGetBucketsRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @return ApiGetBucketsRequest
*/
func (a *BucketsApiService) GetBuckets(ctx _context.Context) ApiGetBucketsRequest {
return ApiGetBucketsRequest{
@ -749,14 +741,14 @@ func (r ApiGetBucketsIDRequest) ExecuteWithHttpInfo() (Bucket, *_nethttp.Respons
}
/*
* GetBucketsID Retrieve a bucket
* Retrieves a bucket.
- GetBucketsID Retrieve a bucket
- Retrieves a bucket.
Use this endpoint to retrieve information for a specific bucket.
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param bucketID The ID of the bucket to retrieve.
* @return ApiGetBucketsIDRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param bucketID The ID of the bucket to retrieve.
- @return ApiGetBucketsIDRequest
*/
func (a *BucketsApiService) GetBucketsID(ctx _context.Context, bucketID string) ApiGetBucketsIDRequest {
return ApiGetBucketsIDRequest{
@ -948,8 +940,8 @@ func (r ApiPatchBucketsIDRequest) ExecuteWithHttpInfo() (Bucket, *_nethttp.Respo
}
/*
* PatchBucketsID Update a bucket
* Updates a bucket.
- PatchBucketsID Update a bucket
- Updates a bucket.
Use this endpoint to update properties
(`name`, `description`, and `retentionRules`) of a bucket.
@ -967,9 +959,9 @@ provide `retentionRules`, InfluxDB responds with an HTTP `403` status code.
- [Update a bucket]({{% INFLUXDB_DOCS_URL %}}/organizations/buckets/update-bucket/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param bucketID The bucket ID.
* @return ApiPatchBucketsIDRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param bucketID The bucket ID.
- @return ApiPatchBucketsIDRequest
*/
func (a *BucketsApiService) PatchBucketsID(ctx _context.Context, bucketID string) ApiPatchBucketsIDRequest {
return ApiPatchBucketsIDRequest{
@ -1179,8 +1171,9 @@ func (r ApiPostBucketsRequest) ExecuteWithHttpInfo() (Bucket, *_nethttp.Response
}
/*
* PostBuckets Create a bucket
* Creates a [bucket]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#bucket)
- PostBuckets Create a bucket
- Creates a [bucket]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#bucket)
and returns the bucket resource.
The default data
[retention period]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#retention-period)
@ -1205,8 +1198,8 @@ For additional information regarding InfluxDB Cloud offerings, see
- [Create a bucket]({{% INFLUXDB_DOCS_URL %}}/organizations/buckets/create-bucket/)
- [Create bucket CLI reference]({{% INFLUXDB_DOCS_URL %}}/reference/cli/influx/bucket/create)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiPostBucketsRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @return ApiPostBucketsRequest
*/
func (a *BucketsApiService) PostBuckets(ctx _context.Context) ApiPostBucketsRequest {
return ApiPostBucketsRequest{

View File

@ -82,8 +82,8 @@ func (r ApiGetConfigRequest) ExecuteWithHttpInfo() (Config, *_nethttp.Response,
}
/*
* GetConfig Retrieve runtime configuration
* Returns the active runtime configuration of the InfluxDB instance.
- GetConfig Retrieve runtime configuration
- Returns the active runtime configuration of the InfluxDB instance.
In InfluxDB v2.2+, use this endpoint to view your active runtime configuration,
including flags and environment variables.
@ -92,8 +92,8 @@ including flags and environment variables.
- [View your runtime server configuration]({{% INFLUXDB_DOCS_URL %}}/reference/config-options/#view-your-runtime-server-configuration)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiGetConfigRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @return ApiGetConfigRequest
*/
func (a *ConfigApiService) GetConfig(ctx _context.Context) ApiGetConfigRequest {
return ApiGetConfigRequest{

View File

@ -27,11 +27,17 @@ var (
type DBRPsApi interface {
/*
* DeleteDBRPID Delete a database retention policy
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param dbrpID The database retention policy mapping
* @return ApiDeleteDBRPIDRequest
*/
* DeleteDBRPID Delete a database retention policy
* Deletes the specified database retention policy (DBRP) mapping.
#### Related guide
- [Database and retention policy mapping]({{% INFLUXDB_DOCS_URL %}}/reference/api/influxdb-1x/dbrp/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param dbrpID A DBRP mapping ID. Only returns the specified DBRP mapping.
* @return ApiDeleteDBRPIDRequest
*/
DeleteDBRPID(ctx _context.Context, dbrpID string) ApiDeleteDBRPIDRequest
/*
@ -47,10 +53,16 @@ type DBRPsApi interface {
DeleteDBRPIDExecuteWithHttpInfo(r ApiDeleteDBRPIDRequest) (*_nethttp.Response, error)
/*
* GetDBRPs List database retention policy mappings
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiGetDBRPsRequest
*/
* GetDBRPs List database retention policy mappings
* Lists database retention policy (DBRP) mappings.
#### Related guide
- [Database and retention policy mapping]({{% INFLUXDB_DOCS_URL %}}/reference/api/influxdb-1x/dbrp/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiGetDBRPsRequest
*/
GetDBRPs(ctx _context.Context) ApiGetDBRPsRequest
/*
@ -68,11 +80,17 @@ type DBRPsApi interface {
GetDBRPsExecuteWithHttpInfo(r ApiGetDBRPsRequest) (DBRPs, *_nethttp.Response, error)
/*
* GetDBRPsID Retrieve a database retention policy mapping
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param dbrpID The database retention policy mapping ID
* @return ApiGetDBRPsIDRequest
*/
* GetDBRPsID Retrieve a database retention policy mapping
* Retrieves the specified retention policy (DBRP) mapping.
#### Related guide
- [Database and retention policy mapping]({{% INFLUXDB_DOCS_URL %}}/reference/api/influxdb-1x/dbrp/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param dbrpID A DBRP mapping ID. Specifies the DBRP mapping.
* @return ApiGetDBRPsIDRequest
*/
GetDBRPsID(ctx _context.Context, dbrpID string) ApiGetDBRPsIDRequest
/*
@ -92,7 +110,7 @@ type DBRPsApi interface {
/*
* PatchDBRPID Update a database retention policy mapping
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param dbrpID The database retention policy mapping.
* @param dbrpID A DBRP mapping ID. Specifies the DBRP mapping.
* @return ApiPatchDBRPIDRequest
*/
PatchDBRPID(ctx _context.Context, dbrpID string) ApiPatchDBRPIDRequest
@ -112,10 +130,21 @@ type DBRPsApi interface {
PatchDBRPIDExecuteWithHttpInfo(r ApiPatchDBRPIDRequest) (DBRPGet, *_nethttp.Response, error)
/*
* PostDBRP Add a database retention policy mapping
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiPostDBRPRequest
*/
* PostDBRP Add a database retention policy mapping
* Creates a database retention policy (DBRP) mapping and returns the mapping.
Use this endpoint to add InfluxDB 1.x API compatibility to your
InfluxDB Cloud or InfluxDB OSS 2.x buckets. Your buckets must contain a
DBRP mapping in order to query and write using the InfluxDB 1.x API.
object.
#### Related guide
- [Database and retention policy mapping]({{% INFLUXDB_DOCS_URL %}}/reference/api/influxdb-1x/dbrp/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiPostDBRPRequest
*/
PostDBRP(ctx _context.Context) ApiPostDBRPRequest
/*
@ -186,11 +215,17 @@ func (r ApiDeleteDBRPIDRequest) ExecuteWithHttpInfo() (*_nethttp.Response, error
}
/*
* DeleteDBRPID Delete a database retention policy
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param dbrpID The database retention policy mapping
* @return ApiDeleteDBRPIDRequest
*/
- DeleteDBRPID Delete a database retention policy
- Deletes the specified database retention policy (DBRP) mapping.
#### Related guide
- [Database and retention policy mapping]({{% INFLUXDB_DOCS_URL %}}/reference/api/influxdb-1x/dbrp/)
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param dbrpID A DBRP mapping ID. Only returns the specified DBRP mapping.
- @return ApiDeleteDBRPIDRequest
*/
func (a *DBRPsApiService) DeleteDBRPID(ctx _context.Context, dbrpID string) ApiDeleteDBRPIDRequest {
return ApiDeleteDBRPIDRequest{
ApiService: a,
@ -299,6 +334,17 @@ func (a *DBRPsApiService) DeleteDBRPIDExecuteWithHttpInfo(r ApiDeleteDBRPIDReque
newErr.model = &v
return localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v UnauthorizedRequestError
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = _fmt.Sprintf("%s: %s", newErr.Error(), err.Error())
return localVarHTTPResponse, newErr
}
v.SetMessage(_fmt.Sprintf("%s: %s", newErr.Error(), v.GetMessage()))
newErr.model = &v
return localVarHTTPResponse, newErr
}
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
@ -399,10 +445,16 @@ func (r ApiGetDBRPsRequest) ExecuteWithHttpInfo() (DBRPs, *_nethttp.Response, er
}
/*
* GetDBRPs List database retention policy mappings
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiGetDBRPsRequest
*/
- GetDBRPs List database retention policy mappings
- Lists database retention policy (DBRP) mappings.
#### Related guide
- [Database and retention policy mapping]({{% INFLUXDB_DOCS_URL %}}/reference/api/influxdb-1x/dbrp/)
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @return ApiGetDBRPsRequest
*/
func (a *DBRPsApiService) GetDBRPs(ctx _context.Context) ApiGetDBRPsRequest {
return ApiGetDBRPsRequest{
ApiService: a,
@ -527,6 +579,17 @@ func (a *DBRPsApiService) GetDBRPsExecuteWithHttpInfo(r ApiGetDBRPsRequest) (DBR
newErr.model = &v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v UnauthorizedRequestError
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = _fmt.Sprintf("%s: %s", newErr.Error(), err.Error())
return localVarReturnValue, localVarHTTPResponse, newErr
}
v.SetMessage(_fmt.Sprintf("%s: %s", newErr.Error(), v.GetMessage()))
newErr.model = &v
return localVarReturnValue, localVarHTTPResponse, newErr
}
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
@ -610,11 +673,17 @@ func (r ApiGetDBRPsIDRequest) ExecuteWithHttpInfo() (DBRPGet, *_nethttp.Response
}
/*
* GetDBRPsID Retrieve a database retention policy mapping
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param dbrpID The database retention policy mapping ID
* @return ApiGetDBRPsIDRequest
*/
- GetDBRPsID Retrieve a database retention policy mapping
- Retrieves the specified retention policy (DBRP) mapping.
#### Related guide
- [Database and retention policy mapping]({{% INFLUXDB_DOCS_URL %}}/reference/api/influxdb-1x/dbrp/)
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param dbrpID A DBRP mapping ID. Specifies the DBRP mapping.
- @return ApiGetDBRPsIDRequest
*/
func (a *DBRPsApiService) GetDBRPsID(ctx _context.Context, dbrpID string) ApiGetDBRPsIDRequest {
return ApiGetDBRPsIDRequest{
ApiService: a,
@ -726,6 +795,17 @@ func (a *DBRPsApiService) GetDBRPsIDExecuteWithHttpInfo(r ApiGetDBRPsIDRequest)
newErr.model = &v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v UnauthorizedRequestError
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = _fmt.Sprintf("%s: %s", newErr.Error(), err.Error())
return localVarReturnValue, localVarHTTPResponse, newErr
}
v.SetMessage(_fmt.Sprintf("%s: %s", newErr.Error(), v.GetMessage()))
newErr.model = &v
return localVarReturnValue, localVarHTTPResponse, newErr
}
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
@ -820,7 +900,7 @@ func (r ApiPatchDBRPIDRequest) ExecuteWithHttpInfo() (DBRPGet, *_nethttp.Respons
/*
* PatchDBRPID Update a database retention policy mapping
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param dbrpID The database retention policy mapping.
* @param dbrpID A DBRP mapping ID. Specifies the DBRP mapping.
* @return ApiPatchDBRPIDRequest
*/
func (a *DBRPsApiService) PatchDBRPID(ctx _context.Context, dbrpID string) ApiPatchDBRPIDRequest {
@ -939,8 +1019,8 @@ func (a *DBRPsApiService) PatchDBRPIDExecuteWithHttpInfo(r ApiPatchDBRPIDRequest
newErr.model = &v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
if localVarHTTPResponse.StatusCode == 401 {
var v UnauthorizedRequestError
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = _fmt.Sprintf("%s: %s", newErr.Error(), err.Error())
@ -1015,10 +1095,21 @@ func (r ApiPostDBRPRequest) ExecuteWithHttpInfo() (DBRP, *_nethttp.Response, err
}
/*
* PostDBRP Add a database retention policy mapping
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiPostDBRPRequest
*/
- PostDBRP Add a database retention policy mapping
- Creates a database retention policy (DBRP) mapping and returns the mapping.
Use this endpoint to add InfluxDB 1.x API compatibility to your
InfluxDB Cloud or InfluxDB OSS 2.x buckets. Your buckets must contain a
DBRP mapping in order to query and write using the InfluxDB 1.x API.
object.
#### Related guide
- [Database and retention policy mapping]({{% INFLUXDB_DOCS_URL %}}/reference/api/influxdb-1x/dbrp/)
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @return ApiPostDBRPRequest
*/
func (a *DBRPsApiService) PostDBRP(ctx _context.Context) ApiPostDBRPRequest {
return ApiPostDBRPRequest{
ApiService: a,
@ -1127,6 +1218,17 @@ func (a *DBRPsApiService) PostDBRPExecuteWithHttpInfo(r ApiPostDBRPRequest) (DBR
newErr.model = &v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v UnauthorizedRequestError
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = _fmt.Sprintf("%s: %s", newErr.Error(), err.Error())
return localVarReturnValue, localVarHTTPResponse, newErr
}
v.SetMessage(_fmt.Sprintf("%s: %s", newErr.Error(), v.GetMessage()))
newErr.model = &v
return localVarReturnValue, localVarHTTPResponse, newErr
}
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {

View File

@ -157,8 +157,8 @@ func (r ApiPostDeleteRequest) ExecuteWithHttpInfo() (*_nethttp.Response, error)
}
/*
* PostDelete Delete data
* Deletes data from a bucket.
- PostDelete Delete data
- Deletes data from a bucket.
Use this endpoint to delete points from a bucket in a specified time range.
@ -166,9 +166,9 @@ Use this endpoint to delete points from a bucket in a specified time range.
- Does the following when you send a delete request:
1. Validates the request and queues the delete.
2. If queued, responds with _success_ (HTTP `2xx` status code); _error_ otherwise.
3. Handles the delete asynchronously and reaches eventual consistency.
1. Validates the request and queues the delete.
2. If queued, responds with _success_ (HTTP `2xx` status code); _error_ otherwise.
3. Handles the delete asynchronously and reaches eventual consistency.
To ensure that InfluxDB Cloud handles writes and deletes in the order you request them,
wait for a success response (HTTP `2xx` status code) before you send the next request.
@ -178,8 +178,8 @@ when you receive the response.
#### InfluxDB OSS
- Validates the request, handles the delete synchronously,
and then responds with success or failure.
- Validates the request, handles the delete synchronously,
and then responds with success or failure.
#### Required permissions
@ -194,13 +194,16 @@ For more information, see [limits and adjustable quotas](https://docs.influxdata
#### Related guides
- [Delete data]({{% INFLUXDB_DOCS_URL %}}/write-data/delete-data/)
- Learn how to use [delete predicate syntax]({{% INFLUXDB_DOCS_URL %}}/reference/syntax/delete-predicate/).
- Learn how InfluxDB handles [deleted tags](https://docs.influxdata.com/flux/v0.x/stdlib/influxdata/influxdb/schema/measurementtagkeys/)
and [deleted fields](https://docs.influxdata.com/flux/v0.x/stdlib/influxdata/influxdb/schema/measurementfieldkeys/).
- [Delete data]({{% INFLUXDB_DOCS_URL %}}/write-data/delete-data/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiPostDeleteRequest
- Learn how to use [delete predicate syntax]({{% INFLUXDB_DOCS_URL %}}/reference/syntax/delete-predicate/).
- Learn how InfluxDB handles [deleted tags](https://docs.influxdata.com/flux/v0.x/stdlib/influxdata/influxdb/schema/measurementtagkeys/)
and [deleted fields](https://docs.influxdata.com/flux/v0.x/stdlib/influxdata/influxdb/schema/measurementfieldkeys/).
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @return ApiPostDeleteRequest
*/
func (a *DeleteApiService) PostDelete(ctx _context.Context) ApiPostDeleteRequest {
return ApiPostDeleteRequest{

View File

@ -16,7 +16,6 @@ import (
_io "io"
_nethttp "net/http"
_neturl "net/url"
"reflect"
"strings"
)
@ -28,12 +27,23 @@ var (
type InvokableScriptsApi interface {
/*
* DeleteScriptsID Delete a script
* Deletes a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) and all associated records.
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param scriptID A script ID. Deletes the specified script.
* @return ApiDeleteScriptsIDRequest
*/
* DeleteScriptsID Delete a script
* Deletes a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) and all associated records.
#### Limitations
- You can delete only one script per request.
- If the script ID you provide doesn't exist for the organization, InfluxDB
responds with an HTTP `204` status code.
#### Related Guides
- [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param scriptID A script ID. Deletes the specified script.
* @return ApiDeleteScriptsIDRequest
*/
DeleteScriptsID(ctx _context.Context, scriptID string) ApiDeleteScriptsIDRequest
/*
@ -50,7 +60,7 @@ type InvokableScriptsApi interface {
/*
* GetScripts List scripts
* Retrieves a list of [scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/).
* Lists [scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/).
#### Related guides
@ -76,13 +86,17 @@ type InvokableScriptsApi interface {
GetScriptsExecuteWithHttpInfo(r ApiGetScriptsRequest) (Scripts, *_nethttp.Response, error)
/*
* GetScriptsID Retrieve a script
* Retrieves a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/).
* GetScriptsID Retrieve a script
* Retrieves a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/).
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param scriptID A script ID. Retrieves the specified script.
* @return ApiGetScriptsIDRequest
*/
#### Related Guides
- [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param scriptID A script ID. Retrieves the specified script.
* @return ApiGetScriptsIDRequest
*/
GetScriptsID(ctx _context.Context, scriptID string) ApiGetScriptsIDRequest
/*
@ -101,9 +115,21 @@ type InvokableScriptsApi interface {
/*
* PatchScriptsID Update a script
* Updates a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) and returns the script.
* Updates an invokable script.
Use this endpoint to update the properties (`name`, `description`, and `script`) of an invokable script.
Use this endpoint to modify values for script properties (`description` and `script`).
To update a script, pass an object that contains the updated key-value pairs.
#### Limitations
- If you send an empty request body, the script will neither update nor
store an empty script, but InfluxDB will respond with an HTTP `200` status
code.
#### Related Guides
- [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param scriptID A script ID. Updates the specified script.
@ -204,12 +230,23 @@ func (r ApiDeleteScriptsIDRequest) ExecuteWithHttpInfo() (*_nethttp.Response, er
}
/*
* DeleteScriptsID Delete a script
* Deletes a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) and all associated records.
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param scriptID A script ID. Deletes the specified script.
* @return ApiDeleteScriptsIDRequest
*/
- DeleteScriptsID Delete a script
- Deletes a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) and all associated records.
#### Limitations
- You can delete only one script per request.
- If the script ID you provide doesn't exist for the organization, InfluxDB
responds with an HTTP `204` status code.
#### Related Guides
- [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/)
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param scriptID A script ID. Deletes the specified script.
- @return ApiDeleteScriptsIDRequest
*/
func (a *InvokableScriptsApiService) DeleteScriptsID(ctx _context.Context, scriptID string) ApiDeleteScriptsIDRequest {
return ApiDeleteScriptsIDRequest{
ApiService: a,
@ -324,13 +361,11 @@ func (a *InvokableScriptsApiService) DeleteScriptsIDExecuteWithHttpInfo(r ApiDel
}
type ApiGetScriptsRequest struct {
ctx _context.Context
ApiService InvokableScriptsApi
offset *int32
limit *int32
name *string
labelNames *[]string
labelContains *string
ctx _context.Context
ApiService InvokableScriptsApi
offset *int32
limit *int32
name *string
}
func (r ApiGetScriptsRequest) Offset(offset int32) ApiGetScriptsRequest {
@ -357,22 +392,6 @@ func (r ApiGetScriptsRequest) GetName() *string {
return r.name
}
func (r ApiGetScriptsRequest) LabelNames(labelNames []string) ApiGetScriptsRequest {
r.labelNames = &labelNames
return r
}
func (r ApiGetScriptsRequest) GetLabelNames() *[]string {
return r.labelNames
}
func (r ApiGetScriptsRequest) LabelContains(labelContains string) ApiGetScriptsRequest {
r.labelContains = &labelContains
return r
}
func (r ApiGetScriptsRequest) GetLabelContains() *string {
return r.labelContains
}
func (r ApiGetScriptsRequest) Execute() (Scripts, error) {
return r.ApiService.GetScriptsExecute(r)
}
@ -382,15 +401,15 @@ func (r ApiGetScriptsRequest) ExecuteWithHttpInfo() (Scripts, *_nethttp.Response
}
/*
* GetScripts List scripts
* Retrieves a list of [scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/).
- GetScripts List scripts
- Lists [scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/).
#### Related guides
- [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiGetScriptsRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @return ApiGetScriptsRequest
*/
func (a *InvokableScriptsApiService) GetScripts(ctx _context.Context) ApiGetScriptsRequest {
return ApiGetScriptsRequest{
@ -444,20 +463,6 @@ func (a *InvokableScriptsApiService) GetScriptsExecuteWithHttpInfo(r ApiGetScrip
if r.name != nil {
localVarQueryParams.Add("name", parameterToString(*r.name, ""))
}
if r.labelNames != nil {
t := *r.labelNames
if reflect.TypeOf(t).Kind() == reflect.Slice {
s := reflect.ValueOf(t)
for i := 0; i < s.Len(); i++ {
localVarQueryParams.Add("labelNames", parameterToString(s.Index(i), "multi"))
}
} else {
localVarQueryParams.Add("labelNames", parameterToString(t, "multi"))
}
}
if r.labelContains != nil {
localVarQueryParams.Add("labelContains", parameterToString(*r.labelContains, ""))
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
@ -582,13 +587,17 @@ func (r ApiGetScriptsIDRequest) ExecuteWithHttpInfo() (Script, *_nethttp.Respons
}
/*
* GetScriptsID Retrieve a script
* Retrieves a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/).
- GetScriptsID Retrieve a script
- Retrieves a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/).
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param scriptID A script ID. Retrieves the specified script.
* @return ApiGetScriptsIDRequest
*/
#### Related Guides
- [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/)
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param scriptID A script ID. Retrieves the specified script.
- @return ApiGetScriptsIDRequest
*/
func (a *InvokableScriptsApiService) GetScriptsID(ctx _context.Context, scriptID string) ApiGetScriptsIDRequest {
return ApiGetScriptsIDRequest{
ApiService: a,
@ -691,6 +700,17 @@ func (a *InvokableScriptsApiService) GetScriptsIDExecuteWithHttpInfo(r ApiGetScr
newErr.model = &v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = _fmt.Sprintf("%s: %s", newErr.Error(), err.Error())
return localVarReturnValue, localVarHTTPResponse, newErr
}
v.SetMessage(_fmt.Sprintf("%s: %s", newErr.Error(), v.GetMessage()))
newErr.model = &v
return localVarReturnValue, localVarHTTPResponse, newErr
}
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
@ -756,14 +776,26 @@ func (r ApiPatchScriptsIDRequest) ExecuteWithHttpInfo() (Script, *_nethttp.Respo
}
/*
* PatchScriptsID Update a script
* Updates a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) and returns the script.
- PatchScriptsID Update a script
- Updates an invokable script.
Use this endpoint to update the properties (`name`, `description`, and `script`) of an invokable script.
Use this endpoint to modify values for script properties (`description` and `script`).
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param scriptID A script ID. Updates the specified script.
* @return ApiPatchScriptsIDRequest
To update a script, pass an object that contains the updated key-value pairs.
#### Limitations
- If you send an empty request body, the script will neither update nor
store an empty script, but InfluxDB will respond with an HTTP `200` status
code.
#### Related Guides
- [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/)
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param scriptID A script ID. Updates the specified script.
- @return ApiPatchScriptsIDRequest
*/
func (a *InvokableScriptsApiService) PatchScriptsID(ctx _context.Context, scriptID string) ApiPatchScriptsIDRequest {
return ApiPatchScriptsIDRequest{
@ -872,6 +904,17 @@ func (a *InvokableScriptsApiService) PatchScriptsIDExecuteWithHttpInfo(r ApiPatc
newErr.model = &v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = _fmt.Sprintf("%s: %s", newErr.Error(), err.Error())
return localVarReturnValue, localVarHTTPResponse, newErr
}
v.SetMessage(_fmt.Sprintf("%s: %s", newErr.Error(), v.GetMessage()))
newErr.model = &v
return localVarReturnValue, localVarHTTPResponse, newErr
}
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
@ -928,8 +971,9 @@ func (r ApiPostScriptsRequest) ExecuteWithHttpInfo() (Script, *_nethttp.Response
}
/*
* PostScripts Create a script
* Creates an [invokable script](https://docs.influxdata.com/resources/videos/api-invokable-scripts/)
- PostScripts Create a script
- Creates an [invokable script](https://docs.influxdata.com/resources/videos/api-invokable-scripts/)
and returns the script.
#### Related guides
@ -937,8 +981,8 @@ and returns the script.
- [Invokable scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/)
- [Creating custom InfluxDB endpoints](https://docs.influxdata.com/resources/videos/api-invokable-scripts/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiPostScriptsRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @return ApiPostScriptsRequest
*/
func (a *InvokableScriptsApiService) PostScripts(ctx _context.Context) ApiPostScriptsRequest {
return ApiPostScriptsRequest{

View File

@ -904,8 +904,8 @@ func (r ApiPostLegacyAuthorizationsRequest) ExecuteWithHttpInfo() (Authorization
}
/*
* PostLegacyAuthorizations Create a legacy authorization
* Creates a legacy authorization and returns the legacy authorization.
- PostLegacyAuthorizations Create a legacy authorization
- Creates a legacy authorization and returns the legacy authorization.
#### Required permissions
@ -913,8 +913,8 @@ func (r ApiPostLegacyAuthorizationsRequest) ExecuteWithHttpInfo() (Authorization
*`USER_ID`* is the ID of the user that you want to scope the authorization to.
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiPostLegacyAuthorizationsRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @return ApiPostLegacyAuthorizationsRequest
*/
func (a *LegacyAuthorizationsApiService) PostLegacyAuthorizations(ctx _context.Context) ApiPostLegacyAuthorizationsRequest {
return ApiPostLegacyAuthorizationsRequest{

View File

@ -76,13 +76,14 @@ type OrganizationsApi interface {
* DeleteOrgsIDMembersID Remove a member from an organization
* Removes a member from an organization.
Use this endpoint to remove a user's member privileges from a bucket. This
removes the user's `read` and `write` permissions from the organization.
Use this endpoint to remove a user's member privileges for an organization.
Removing member privileges removes the user's `read` and `write` permissions
from the organization.
#### InfluxDB Cloud
- Doesn't use `owner` and `member` roles.
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
#### Limitations
@ -129,7 +130,7 @@ type OrganizationsApi interface {
#### InfluxDB Cloud
- Doesn't use `owner` and `member` roles.
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
#### Limitations
@ -144,7 +145,7 @@ type OrganizationsApi interface {
remove an owner from.
#### Related endpoints
- [Authorizations](#tag/Authorizations)
- [Authorizations](#tag/Authorizations-(API-tokens))
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param userID The ID of the user to remove.
@ -167,7 +168,7 @@ type OrganizationsApi interface {
/*
* GetOrgs List organizations
* Retrieves a list of [organizations]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#organization/).
* Lists [organizations]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#organization/).
To limit which organizations are returned, pass query parameters in your request.
If no query parameters are passed, InfluxDB returns all organizations up to the default `limit`.
@ -231,7 +232,7 @@ type OrganizationsApi interface {
/*
* GetOrgsIDMembers List all members of an organization
* Retrieves a list of all users that belong to an organization.
* Lists all users that belong to an organization.
InfluxDB [users]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#user) have
permission to access InfluxDB.
@ -242,7 +243,7 @@ type OrganizationsApi interface {
#### InfluxDB Cloud
- Doesn't use `owner` and `member` roles.
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
#### Limitations
@ -283,12 +284,12 @@ type OrganizationsApi interface {
/*
* GetOrgsIDOwners List all owners of an organization
* Retrieves a list of all owners of an organization.
* Lists all owners of an organization.
#### InfluxDB Cloud
- Doesn't use `owner` and `member` roles.
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
#### Required permissions
@ -404,7 +405,7 @@ type OrganizationsApi interface {
#### InfluxDB Cloud
- Doesn't use `owner` and `member` roles.
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
#### Limitations
@ -451,7 +452,7 @@ type OrganizationsApi interface {
#### InfluxDB Cloud
- Doesn't use `owner` and `member` roles.
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
#### Required permissions
@ -461,7 +462,7 @@ type OrganizationsApi interface {
#### Related endpoints
- [Authorizations](#tag/Authorizations)
- [Authorizations](#tag/Authorizations-(API-tokens))
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param orgID The ID of the organization that you want to add an owner for.
@ -519,8 +520,8 @@ func (r ApiDeleteOrgsIDRequest) ExecuteWithHttpInfo() (*_nethttp.Response, error
}
/*
* DeleteOrgsID Delete an organization
* Deletes an organization.
- DeleteOrgsID Delete an organization
- Deletes an organization.
Deleting an organization from InfluxDB Cloud can't be undone.
Once deleted, all data associated with the organization is removed.
@ -529,9 +530,9 @@ Once deleted, all data associated with the organization is removed.
- Does the following when you send a delete request:
1. Validates the request and queues the delete.
2. Returns an HTTP `204` status code if queued; _error_ otherwise.
3. Handles the delete asynchronously.
1. Validates the request and queues the delete.
2. Returns an HTTP `204` status code if queued; _error_ otherwise.
3. Handles the delete asynchronously.
#### InfluxDB OSS
@ -546,9 +547,9 @@ and then responds with success or failure.
- [Delete organizations]({{% INFLUXDB_DOCS_URL %}}/organizations/delete-orgs/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param orgID The ID of the organization to delete.
* @return ApiDeleteOrgsIDRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param orgID The ID of the organization to delete.
- @return ApiDeleteOrgsIDRequest
*/
func (a *OrganizationsApiService) DeleteOrgsID(ctx _context.Context, orgID string) ApiDeleteOrgsIDRequest {
return ApiDeleteOrgsIDRequest{
@ -718,16 +719,17 @@ func (r ApiDeleteOrgsIDMembersIDRequest) ExecuteWithHttpInfo() (*_nethttp.Respon
}
/*
* DeleteOrgsIDMembersID Remove a member from an organization
* Removes a member from an organization.
- DeleteOrgsIDMembersID Remove a member from an organization
- Removes a member from an organization.
Use this endpoint to remove a user's member privileges from a bucket. This
removes the user's `read` and `write` permissions from the organization.
Use this endpoint to remove a user's member privileges for an organization.
Removing member privileges removes the user's `read` and `write` permissions
from the organization.
#### InfluxDB Cloud
- Doesn't use `owner` and `member` roles.
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
- Doesn't use `owner` and `member` roles.
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
#### Limitations
@ -745,10 +747,10 @@ owner from.
- [Manage members]({{% INFLUXDB_DOCS_URL %}}/organizations/members/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param userID The ID of the user to remove.
* @param orgID The ID of the organization to remove a user from.
* @return ApiDeleteOrgsIDMembersIDRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param userID The ID of the user to remove.
- @param orgID The ID of the organization to remove a user from.
- @return ApiDeleteOrgsIDMembersIDRequest
*/
func (a *OrganizationsApiService) DeleteOrgsIDMembersID(ctx _context.Context, userID string, orgID string) ApiDeleteOrgsIDMembersIDRequest {
return ApiDeleteOrgsIDMembersIDRequest{
@ -909,16 +911,17 @@ func (r ApiDeleteOrgsIDOwnersIDRequest) ExecuteWithHttpInfo() (*_nethttp.Respons
}
/*
* DeleteOrgsIDOwnersID Remove an owner from an organization
* Removes an [owner]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#owner) from
- DeleteOrgsIDOwnersID Remove an owner from an organization
- Removes an [owner]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#owner) from
the organization.
Organization owners have permission to delete organizations and remove user and member
permissions from the organization.
#### InfluxDB Cloud
- Doesn't use `owner` and `member` roles.
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
- Doesn't use `owner` and `member` roles.
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
#### Limitations
@ -933,12 +936,12 @@ permissions from the organization.
remove an owner from.
#### Related endpoints
- [Authorizations](#tag/Authorizations)
- [Authorizations](#tag/Authorizations-(API-tokens))
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param userID The ID of the user to remove.
* @param orgID The ID of the organization to remove an owner from.
* @return ApiDeleteOrgsIDOwnersIDRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param userID The ID of the user to remove.
- @param orgID The ID of the organization to remove an owner from.
- @return ApiDeleteOrgsIDOwnersIDRequest
*/
func (a *OrganizationsApiService) DeleteOrgsIDOwnersID(ctx _context.Context, userID string, orgID string) ApiDeleteOrgsIDOwnersIDRequest {
return ApiDeleteOrgsIDOwnersIDRequest{
@ -1135,8 +1138,8 @@ func (r ApiGetOrgsRequest) ExecuteWithHttpInfo() (Organizations, *_nethttp.Respo
}
/*
* GetOrgs List organizations
* Retrieves a list of [organizations]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#organization/).
- GetOrgs List organizations
- Lists [organizations]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#organization/).
To limit which organizations are returned, pass query parameters in your request.
If no query parameters are passed, InfluxDB returns all organizations up to the default `limit`.
@ -1149,8 +1152,8 @@ If no query parameters are passed, InfluxDB returns all organizations up to the
- [View organizations]({{% INFLUXDB_DOCS_URL %}}/organizations/view-orgs/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiGetOrgsRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @return ApiGetOrgsRequest
*/
func (a *OrganizationsApiService) GetOrgs(ctx _context.Context) ApiGetOrgsRequest {
return ApiGetOrgsRequest{
@ -1371,8 +1374,8 @@ func (r ApiGetOrgsIDRequest) ExecuteWithHttpInfo() (Organization, *_nethttp.Resp
}
/*
* GetOrgsID Retrieve an organization
* Retrieves an organization.
- GetOrgsID Retrieve an organization
- Retrieves an organization.
Use this endpoint to retrieve information for a specific organization.
@ -1380,9 +1383,9 @@ Use this endpoint to retrieve information for a specific organization.
- [View organizations]({{% INFLUXDB_DOCS_URL %}}/organizations/view-orgs/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param orgID The ID of the organization to retrieve.
* @return ApiGetOrgsIDRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param orgID The ID of the organization to retrieve.
- @return ApiGetOrgsIDRequest
*/
func (a *OrganizationsApiService) GetOrgsID(ctx _context.Context, orgID string) ApiGetOrgsIDRequest {
return ApiGetOrgsIDRequest{
@ -1565,8 +1568,8 @@ func (r ApiGetOrgsIDMembersRequest) ExecuteWithHttpInfo() (ResourceMembers, *_ne
}
/*
* GetOrgsIDMembers List all members of an organization
* Retrieves a list of all users that belong to an organization.
- GetOrgsIDMembers List all members of an organization
- Lists all users that belong to an organization.
InfluxDB [users]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#user) have
permission to access InfluxDB.
@ -1576,8 +1579,8 @@ within the organization.
#### InfluxDB Cloud
- Doesn't use `owner` and `member` roles.
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
- Doesn't use `owner` and `member` roles.
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
#### Limitations
@ -1596,9 +1599,9 @@ members for.
- [Manage users]({{% INFLUXDB_DOCS_URL %}}/users/)
- [Manage members]({{% INFLUXDB_DOCS_URL %}}/organizations/members/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param orgID The ID of the organization to retrieve users for.
* @return ApiGetOrgsIDMembersRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param orgID The ID of the organization to retrieve users for.
- @return ApiGetOrgsIDMembersRequest
*/
func (a *OrganizationsApiService) GetOrgsIDMembers(ctx _context.Context, orgID string) ApiGetOrgsIDMembersRequest {
return ApiGetOrgsIDMembersRequest{
@ -1781,13 +1784,13 @@ func (r ApiGetOrgsIDOwnersRequest) ExecuteWithHttpInfo() (ResourceOwners, *_neth
}
/*
* GetOrgsIDOwners List all owners of an organization
* Retrieves a list of all owners of an organization.
- GetOrgsIDOwners List all owners of an organization
- Lists all owners of an organization.
#### InfluxDB Cloud
- Doesn't use `owner` and `member` roles.
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
- Doesn't use `owner` and `member` roles.
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
#### Required permissions
@ -1796,9 +1799,9 @@ func (r ApiGetOrgsIDOwnersRequest) ExecuteWithHttpInfo() (ResourceOwners, *_neth
*`INFLUX_ORG_ID`* is the ID of the organization that you want to retrieve a
list of owners from.
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param orgID The ID of the organization to list owners for.
* @return ApiGetOrgsIDOwnersRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param orgID The ID of the organization to list owners for.
- @return ApiGetOrgsIDOwnersRequest
*/
func (a *OrganizationsApiService) GetOrgsIDOwners(ctx _context.Context, orgID string) ApiGetOrgsIDOwnersRequest {
return ApiGetOrgsIDOwnersRequest{
@ -1979,8 +1982,8 @@ func (r ApiPatchOrgsIDRequest) ExecuteWithHttpInfo() (Organization, *_nethttp.Re
}
/*
* PatchOrgsID Update an organization
* Updates an organization.
- PatchOrgsID Update an organization
- Updates an organization.
Use this endpoint to update properties
(`name`, `description`) of an organization.
@ -2001,9 +2004,9 @@ in these resources as well.
- [Update an organization]({{% INFLUXDB_DOCS_URL %}}/organizations/update-org/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param orgID The ID of the organization to update.
* @return ApiPatchOrgsIDRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param orgID The ID of the organization to update.
- @return ApiPatchOrgsIDRequest
*/
func (a *OrganizationsApiService) PatchOrgsID(ctx _context.Context, orgID string) ApiPatchOrgsIDRequest {
return ApiPatchOrgsIDRequest{
@ -2180,8 +2183,9 @@ func (r ApiPostOrgsRequest) ExecuteWithHttpInfo() (Organization, *_nethttp.Respo
}
/*
* PostOrgs Create an organization
* Creates an [organization]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#organization)
- PostOrgs Create an organization
- Creates an [organization]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#organization)
and returns the newly created organization.
#### InfluxDB Cloud
@ -2192,8 +2196,8 @@ and returns the newly created organization.
- [Manage organizations]({{% INFLUXDB_DOCS_URL %}}/organizations)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiPostOrgsRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @return ApiPostOrgsRequest
*/
func (a *OrganizationsApiService) PostOrgs(ctx _context.Context) ApiPostOrgsRequest {
return ApiPostOrgsRequest{
@ -2377,8 +2381,8 @@ func (r ApiPostOrgsIDMembersRequest) ExecuteWithHttpInfo() (ResourceMember, *_ne
}
/*
* PostOrgsIDMembers Add a member to an organization
* Add a user to an organization.
- PostOrgsIDMembers Add a member to an organization
- Add a user to an organization.
InfluxDB [users]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#user) have
permission to access InfluxDB.
@ -2387,8 +2391,8 @@ permission to access InfluxDB.
within the organization.
#### InfluxDB Cloud
- Doesn't use `owner` and `member` roles.
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
- Doesn't use `owner` and `member` roles.
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
#### Limitations
@ -2406,9 +2410,9 @@ within the organization.
- [Manage users]({{% INFLUXDB_DOCS_URL %}}/users/)
- [Manage members]({{% INFLUXDB_DOCS_URL %}}/organizations/members/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param orgID The ID of the organization.
* @return ApiPostOrgsIDMembersRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param orgID The ID of the organization.
- @return ApiPostOrgsIDMembersRequest
*/
func (a *OrganizationsApiService) PostOrgsIDMembers(ctx _context.Context, orgID string) ApiPostOrgsIDMembersRequest {
return ApiPostOrgsIDMembersRequest{
@ -2594,15 +2598,15 @@ func (r ApiPostOrgsIDOwnersRequest) ExecuteWithHttpInfo() (ResourceOwner, *_neth
}
/*
* PostOrgsIDOwners Add an owner to an organization
* Adds an owner to an organization.
- PostOrgsIDOwners Add an owner to an organization
- Adds an owner to an organization.
Use this endpoint to assign the organization `owner` role to a user.
#### InfluxDB Cloud
- Doesn't use `owner` and `member` roles.
Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
- Doesn't use `owner` and `member` roles.
Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.
#### Required permissions
@ -2612,11 +2616,11 @@ Use this endpoint to assign the organization `owner` role to a user.
#### Related endpoints
- [Authorizations](#tag/Authorizations)
- [Authorizations](#tag/Authorizations-(API-tokens))
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param orgID The ID of the organization that you want to add an owner for.
* @return ApiPostOrgsIDOwnersRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param orgID The ID of the organization that you want to add an owner for.
- @return ApiPostOrgsIDOwnersRequest
*/
func (a *OrganizationsApiService) PostOrgsIDOwners(ctx _context.Context, orgID string) ApiPostOrgsIDOwnersRequest {
return ApiPostOrgsIDOwnersRequest{

View File

@ -106,8 +106,8 @@ func (r ApiGetPingRequest) ExecuteWithHttpInfo() (*_nethttp.Response, error) {
}
/*
* GetPing Get the status of the instance
* Retrieves the status and InfluxDB version of the instance.
- GetPing Get the status of the instance
- Retrieves the status and InfluxDB version of the instance.
Use this endpoint to monitor uptime for the InfluxDB instance. The response
returns a HTTP `204` status code to inform you the instance is available.
@ -120,8 +120,8 @@ returns a HTTP `204` status code to inform you the instance is available.
- [Influx ping]({{% INFLUXDB_DOCS_URL %}}/reference/cli/influx/ping/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiGetPingRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @return ApiGetPingRequest
*/
func (a *PingApiService) GetPing(ctx _context.Context) ApiGetPingRequest {
return ApiGetPingRequest{
@ -229,8 +229,8 @@ func (r ApiHeadPingRequest) ExecuteWithHttpInfo() (*_nethttp.Response, error) {
}
/*
* HeadPing Get the status of the instance
* Returns the status and InfluxDB version of the instance.
- HeadPing Get the status of the instance
- Returns the status and InfluxDB version of the instance.
Use this endpoint to monitor uptime for the InfluxDB instance. The response
returns a HTTP `204` status code to inform you the instance is available.
@ -243,8 +243,8 @@ returns a HTTP `204` status code to inform you the instance is available.
- [Influx ping]({{% INFLUXDB_DOCS_URL %}}/reference/cli/influx/ping/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiHeadPingRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @return ApiHeadPingRequest
*/
func (a *PingApiService) HeadPing(ctx _context.Context) ApiHeadPingRequest {
return ApiHeadPingRequest{

View File

@ -26,6 +26,27 @@ var (
type SecretsApi interface {
/*
* DeleteOrgsIDSecretsID Delete a secret from an organization
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param orgID The organization ID.
* @param secretID The secret ID.
* @return ApiDeleteOrgsIDSecretsIDRequest
*/
DeleteOrgsIDSecretsID(ctx _context.Context, orgID string, secretID string) ApiDeleteOrgsIDSecretsIDRequest
/*
* DeleteOrgsIDSecretsIDExecute executes the request
*/
DeleteOrgsIDSecretsIDExecute(r ApiDeleteOrgsIDSecretsIDRequest) error
/*
* DeleteOrgsIDSecretsIDExecuteWithHttpInfo executes the request with HTTP response info returned. The response body is not
* available on the returned HTTP response as it will have already been read and closed; access to the response body
* content should be achieved through the returned response model if applicable.
*/
DeleteOrgsIDSecretsIDExecuteWithHttpInfo(r ApiDeleteOrgsIDSecretsIDRequest) (*_nethttp.Response, error)
/*
* GetOrgsIDSecrets List all secret keys for an organization
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@ -92,6 +113,160 @@ type SecretsApi interface {
// SecretsApiService SecretsApi service
type SecretsApiService service
type ApiDeleteOrgsIDSecretsIDRequest struct {
ctx _context.Context
ApiService SecretsApi
orgID string
secretID string
zapTraceSpan *string
}
func (r ApiDeleteOrgsIDSecretsIDRequest) OrgID(orgID string) ApiDeleteOrgsIDSecretsIDRequest {
r.orgID = orgID
return r
}
func (r ApiDeleteOrgsIDSecretsIDRequest) GetOrgID() string {
return r.orgID
}
func (r ApiDeleteOrgsIDSecretsIDRequest) SecretID(secretID string) ApiDeleteOrgsIDSecretsIDRequest {
r.secretID = secretID
return r
}
func (r ApiDeleteOrgsIDSecretsIDRequest) GetSecretID() string {
return r.secretID
}
func (r ApiDeleteOrgsIDSecretsIDRequest) ZapTraceSpan(zapTraceSpan string) ApiDeleteOrgsIDSecretsIDRequest {
r.zapTraceSpan = &zapTraceSpan
return r
}
func (r ApiDeleteOrgsIDSecretsIDRequest) GetZapTraceSpan() *string {
return r.zapTraceSpan
}
func (r ApiDeleteOrgsIDSecretsIDRequest) Execute() error {
return r.ApiService.DeleteOrgsIDSecretsIDExecute(r)
}
func (r ApiDeleteOrgsIDSecretsIDRequest) ExecuteWithHttpInfo() (*_nethttp.Response, error) {
return r.ApiService.DeleteOrgsIDSecretsIDExecuteWithHttpInfo(r)
}
/*
* DeleteOrgsIDSecretsID Delete a secret from an organization
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param orgID The organization ID.
* @param secretID The secret ID.
* @return ApiDeleteOrgsIDSecretsIDRequest
*/
func (a *SecretsApiService) DeleteOrgsIDSecretsID(ctx _context.Context, orgID string, secretID string) ApiDeleteOrgsIDSecretsIDRequest {
return ApiDeleteOrgsIDSecretsIDRequest{
ApiService: a,
ctx: ctx,
orgID: orgID,
secretID: secretID,
}
}
/*
* Execute executes the request
*/
func (a *SecretsApiService) DeleteOrgsIDSecretsIDExecute(r ApiDeleteOrgsIDSecretsIDRequest) error {
_, err := a.DeleteOrgsIDSecretsIDExecuteWithHttpInfo(r)
return err
}
/*
* ExecuteWithHttpInfo executes the request with HTTP response info returned. The response body is not available on the
* returned HTTP response as it will have already been read and closed; access to the response body content should be
* achieved through the returned response model if applicable.
*/
func (a *SecretsApiService) DeleteOrgsIDSecretsIDExecuteWithHttpInfo(r ApiDeleteOrgsIDSecretsIDRequest) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodDelete
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SecretsApiService.DeleteOrgsIDSecretsID")
if err != nil {
return nil, GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/v2/orgs/{orgID}/secrets/{secretID}"
localVarPath = strings.Replace(localVarPath, "{"+"orgID"+"}", _neturl.PathEscape(parameterToString(r.orgID, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"secretID"+"}", _neturl.PathEscape(parameterToString(r.secretID, "")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.zapTraceSpan != nil {
localVarHeaderParams["Zap-Trace-Span"] = parameterToString(*r.zapTraceSpan, "")
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
newErr := GenericOpenAPIError{
buildHeader: localVarHTTPResponse.Header.Get("X-Influxdb-Build"),
}
if localVarHTTPResponse.StatusCode >= 300 {
body, err := GunzipIfNeeded(localVarHTTPResponse)
if err != nil {
body.Close()
newErr.error = err.Error()
return localVarHTTPResponse, newErr
}
localVarBody, err := _io.ReadAll(body)
body.Close()
if err != nil {
newErr.error = err.Error()
return localVarHTTPResponse, newErr
}
newErr.body = localVarBody
newErr.error = localVarHTTPResponse.Status
var v Error
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = _fmt.Sprintf("%s: %s", newErr.Error(), err.Error())
return localVarHTTPResponse, newErr
}
v.SetMessage(_fmt.Sprintf("%s: %s", newErr.Error(), v.GetMessage()))
newErr.model = &v
return localVarHTTPResponse, newErr
}
return localVarHTTPResponse, nil
}
type ApiGetOrgsIDSecretsRequest struct {
ctx _context.Context
ApiService SecretsApi

View File

@ -39,7 +39,7 @@ type SigninApi interface {
If authentication is successful, InfluxDB creates a new session for the user
and then returns the session cookie in the `Set-Cookie` response header.
User sessions exist only in memory.
InfluxDB stores user sessions in memory only.
They expire within ten minutes and during restarts of the InfluxDB instance.
#### User sessions with authorizations
@ -97,8 +97,9 @@ func (r ApiPostSigninRequest) ExecuteWithHttpInfo() (*_nethttp.Response, error)
}
/*
* PostSignin Create a user session.
* Authenticates [Basic authentication credentials](#section/Authentication/BasicAuthentication)
- PostSignin Create a user session.
- Authenticates [Basic authentication credentials](#section/Authentication/BasicAuthentication)
for a [user]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#user),
and then, if successful, generates a user session.
@ -110,22 +111,22 @@ syntax and more information.
If authentication is successful, InfluxDB creates a new session for the user
and then returns the session cookie in the `Set-Cookie` response header.
User sessions exist only in memory.
InfluxDB stores user sessions in memory only.
They expire within ten minutes and during restarts of the InfluxDB instance.
#### User sessions with authorizations
- In InfluxDB Cloud, a user session inherits all the user's permissions for
the organization.
- In InfluxDB OSS, a user session inherits all the user's permissions for all
the organizations that the user belongs to.
- In InfluxDB Cloud, a user session inherits all the user's permissions for
the organization.
- In InfluxDB OSS, a user session inherits all the user's permissions for all
the organizations that the user belongs to.
#### Related endpoints
- [Signout](#tag/Signout)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiPostSigninRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @return ApiPostSigninRequest
*/
func (a *SigninApiService) PostSignin(ctx _context.Context) ApiPostSigninRequest {
return ApiPostSigninRequest{

View File

@ -499,17 +499,17 @@ func (r ApiDeleteTasksIDRequest) ExecuteWithHttpInfo() (*_nethttp.Response, erro
}
/*
* DeleteTasksID Delete a task
* Deletes a [task]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task) and associated records.
- DeleteTasksID Delete a task
- Deletes a [task]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task) and associated records.
Use this endpoint to delete a task and all associated records (task runs, logs, and labels).
Once the task is deleted, InfluxDB cancels all scheduled runs of the task.
If you want to disable a task instead of delete it, [update the task status to `inactive`](#operation/PatchTasksID).
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param taskID A [task]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task) ID. Specifies the task to delete.
* @return ApiDeleteTasksIDRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param taskID A [task]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task) ID. Specifies the task to delete.
- @return ApiDeleteTasksIDRequest
*/
func (a *TasksApiService) DeleteTasksID(ctx _context.Context, taskID string) ApiDeleteTasksIDRequest {
return ApiDeleteTasksIDRequest{
@ -668,8 +668,8 @@ func (r ApiDeleteTasksIDRunsIDRequest) ExecuteWithHttpInfo() (*_nethttp.Response
}
/*
* DeleteTasksIDRunsID Cancel a running task
* Cancels a running [task]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task).
- DeleteTasksIDRunsID Cancel a running task
- Cancels a running [task]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task).
Use this endpoint with InfluxDB OSS to cancel a running task.
@ -677,10 +677,10 @@ Use this endpoint with InfluxDB OSS to cancel a running task.
- Doesn't support this operation.
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param taskID The ID of the task to cancel.
* @param runID The ID of the task run to cancel.
* @return ApiDeleteTasksIDRunsIDRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param taskID The ID of the task to cancel.
- @param runID The ID of the task run to cancel.
- @return ApiDeleteTasksIDRunsIDRequest
*/
func (a *TasksApiService) DeleteTasksIDRunsID(ctx _context.Context, taskID string, runID string) ApiDeleteTasksIDRunsIDRequest {
return ApiDeleteTasksIDRunsIDRequest{
@ -933,14 +933,14 @@ func (r ApiGetTasksRequest) ExecuteWithHttpInfo() (Tasks, *_nethttp.Response, er
}
/*
* GetTasks List all tasks
* Retrieves a list of [tasks]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task).
- GetTasks List all tasks
- Retrieves a list of [tasks]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task).
To limit which tasks are returned, pass query parameters in your request.
If no query parameters are passed, InfluxDB returns all tasks up to the default `limit`.
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiGetTasksRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @return ApiGetTasksRequest
*/
func (a *TasksApiService) GetTasks(ctx _context.Context) ApiGetTasksRequest {
return ApiGetTasksRequest{
@ -1143,12 +1143,12 @@ func (r ApiGetTasksIDRequest) ExecuteWithHttpInfo() (Task, *_nethttp.Response, e
}
/*
* GetTasksID Retrieve a task
* Retrieves a [task]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task).
* GetTasksID Retrieve a task
* Retrieves a [task]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task).
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param taskID A [task]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task) ID. Specifies the task to retrieve.
* @return ApiGetTasksIDRequest
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param taskID A [task]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task) ID. Specifies the task to retrieve.
* @return ApiGetTasksIDRequest
*/
func (a *TasksApiService) GetTasksID(ctx _context.Context, taskID string) ApiGetTasksIDRequest {
return ApiGetTasksIDRequest{
@ -1320,8 +1320,8 @@ func (r ApiGetTasksIDLogsRequest) ExecuteWithHttpInfo() (Logs, *_nethttp.Respons
}
/*
* GetTasksIDLogs Retrieve all logs for a task
* Retrieves a list of all logs for a [task]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task).
- GetTasksIDLogs Retrieve all logs for a task
- Retrieves a list of all logs for a [task]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task).
When an InfluxDB task runs, a “run” record is created in the task’s history.
Logs associated with each run provide relevant log messages, timestamps, and the exit status of the run attempt.
@ -1329,9 +1329,9 @@ Logs associated with each run provide relevant log messages, timestamps, and the
Use this endpoint to retrieve only the log events for a task,
without additional task metadata.
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param taskID The task ID.
* @return ApiGetTasksIDLogsRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param taskID The task ID.
- @return ApiGetTasksIDLogsRequest
*/
func (a *TasksApiService) GetTasksIDLogs(ctx _context.Context, taskID string) ApiGetTasksIDLogsRequest {
return ApiGetTasksIDLogsRequest{
@ -1539,15 +1539,15 @@ func (r ApiGetTasksIDRunsRequest) ExecuteWithHttpInfo() (Runs, *_nethttp.Respons
}
/*
* GetTasksIDRuns List runs for a task
* Retrieves a list of runs for a [task]({{% INFLUXDB_DOCS_URL %}}/process-data/).
- GetTasksIDRuns List runs for a task
- Retrieves a list of runs for a [task]({{% INFLUXDB_DOCS_URL %}}/process-data/).
To limit which task runs are returned, pass query parameters in your request.
If no query parameters are passed, InfluxDB returns all task runs up to the default `limit`.
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param taskID The ID of the task to get runs for. Only returns runs for this task.
* @return ApiGetTasksIDRunsRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param taskID The ID of the task to get runs for. Only returns runs for this task.
- @return ApiGetTasksIDRunsRequest
*/
func (a *TasksApiService) GetTasksIDRuns(ctx _context.Context, taskID string) ApiGetTasksIDRunsRequest {
return ApiGetTasksIDRunsRequest{
@ -1740,15 +1740,15 @@ func (r ApiGetTasksIDRunsIDRequest) ExecuteWithHttpInfo() (Run, *_nethttp.Respon
}
/*
* GetTasksIDRunsID Retrieve a run for a task.
* Retrieves a specific run for a [task]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task).
- GetTasksIDRunsID Retrieve a run for a task.
- Retrieves a specific run for a [task]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task).
Use this endpoint to retrieve detail and logs for a specific task run.
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param taskID The ID of the task to retrieve runs for.
* @param runID The ID of the run to retrieve.
* @return ApiGetTasksIDRunsIDRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param taskID The ID of the task to retrieve runs for.
- @param runID The ID of the run to retrieve.
- @return ApiGetTasksIDRunsIDRequest
*/
func (a *TasksApiService) GetTasksIDRunsID(ctx _context.Context, taskID string, runID string) ApiGetTasksIDRunsIDRequest {
return ApiGetTasksIDRunsIDRequest{
@ -1931,16 +1931,17 @@ func (r ApiGetTasksIDRunsIDLogsRequest) ExecuteWithHttpInfo() (Logs, *_nethttp.R
}
/*
* GetTasksIDRunsIDLogs Retrieve all logs for a run
* Retrieves all logs for a task run.
- GetTasksIDRunsIDLogs Retrieve all logs for a run
- Retrieves all logs for a task run.
A log is a list of run events with `runID`, `time`, and `message` properties.
Use this endpoint to help analyze task performance and troubleshoot failed task runs.
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param taskID The ID of the task to get logs for.
* @param runID The ID of the run to get logs for.
* @return ApiGetTasksIDRunsIDLogsRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param taskID The ID of the task to get logs for.
- @param runID The ID of the run to get logs for.
- @return ApiGetTasksIDRunsIDLogsRequest
*/
func (a *TasksApiService) GetTasksIDRunsIDLogs(ctx _context.Context, taskID string, runID string) ApiGetTasksIDRunsIDLogsRequest {
return ApiGetTasksIDRunsIDLogsRequest{
@ -2123,8 +2124,9 @@ func (r ApiPatchTasksIDRequest) ExecuteWithHttpInfo() (Task, *_nethttp.Response,
}
/*
* PatchTasksID Update a task
* Updates a [task]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task),
- PatchTasksID Update a task
- Updates a [task]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task),
and then cancels all scheduled runs of the task.
Use this endpoint to set, modify, or clear task properties--for example: `cron`, `name`, `flux`, `status`.
@ -2142,16 +2144,16 @@ _`"status": "inactive"`_ cancels scheduled runs and prevents manual runs of the
```json
{
"flux": "option task = {name: \"CPU Total 1 Hour New\", every: 1h}\
from(bucket: \"telegraf\")
|> range(start: -1h)
|> filter(fn: (r) => (r._measurement == \"cpu\"))
|> filter(fn: (r) =>\n\t\t(r._field == \"usage_system\"))
|> filter(fn: (r) => (r.cpu == \"cpu-total\"))
|> aggregateWindow(every: 1h, fn: max)
|> to(bucket: \"cpu_usage_user_total_1h\", org: \"INFLUX_ORG\")",
"status": "active",
"description": "This task downsamples CPU data every hour"
"flux": "option task = {name: \"CPU Total 1 Hour New\", every: 1h}\
from(bucket: \"telegraf\")
|> range(start: -1h)
|> filter(fn: (r) => (r._measurement == \"cpu\"))
|> filter(fn: (r) =>\n\t\t(r._field == \"usage_system\"))
|> filter(fn: (r) => (r.cpu == \"cpu-total\"))
|> aggregateWindow(every: 1h, fn: max)
|> to(bucket: \"cpu_usage_user_total_1h\", org: \"INFLUX_ORG\")",
"status": "active",
"description": "This task downsamples CPU data every hour"
}
```
@ -2162,26 +2164,26 @@ _`"status": "inactive"`_ cancels scheduled runs and prevents manual runs of the
```json
{
"name": "CPU Total 1 Hour New",
"description": "This task downsamples CPU data every hour",
"every": "1h",
"scriptID": "SCRIPT_ID",
"scriptParameters":
{
"rangeStart": "-1h",
"bucket": "telegraf",
"filterField": "cpu-total"
}
}
"name": "CPU Total 1 Hour New",
"description": "This task downsamples CPU data every hour",
"every": "1h",
"scriptID": "SCRIPT_ID",
"scriptParameters":
{
"rangeStart": "-1h",
"bucket": "telegraf",
"filterField": "cpu-total"
}
}
```
#### Limitations:
- You can't use `flux` and `scriptID` for the same task.
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param taskID A [task]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task) ID. Specifies the task to update.
* @return ApiPatchTasksIDRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param taskID A [task]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task) ID. Specifies the task to update.
- @return ApiPatchTasksIDRequest
*/
func (a *TasksApiService) PatchTasksID(ctx _context.Context, taskID string) ApiPatchTasksIDRequest {
return ApiPatchTasksIDRequest{
@ -2358,8 +2360,8 @@ func (r ApiPostTasksRequest) ExecuteWithHttpInfo() (Task, *_nethttp.Response, er
}
/*
* PostTasks Create a task
* Creates a [task]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task) and returns the task.
- PostTasks Create a task
- Creates a [task]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task) and returns the task.
Use this endpoint to create a scheduled task that runs a Flux script.
@ -2371,16 +2373,16 @@ Use this endpoint to create a scheduled task that runs a Flux script.
```json
{
"flux": "option task = {name: \"CPU Total 1 Hour New\", every: 1h}\
from(bucket: \"telegraf\")
|> range(start: -1h)
|> filter(fn: (r) => (r._measurement == \"cpu\"))
|> filter(fn: (r) =>\n\t\t(r._field == \"usage_system\"))
|> filter(fn: (r) => (r.cpu == \"cpu-total\"))
|> aggregateWindow(every: 1h, fn: max)
|> to(bucket: \"cpu_usage_user_total_1h\", org: \"INFLUX_ORG\")",
"status": "active",
"description": "This task downsamples CPU data every hour"
"flux": "option task = {name: \"CPU Total 1 Hour New\", every: 1h}\
from(bucket: \"telegraf\")
|> range(start: -1h)
|> filter(fn: (r) => (r._measurement == \"cpu\"))
|> filter(fn: (r) =>\n\t\t(r._field == \"usage_system\"))
|> filter(fn: (r) => (r.cpu == \"cpu-total\"))
|> aggregateWindow(every: 1h, fn: max)
|> to(bucket: \"cpu_usage_user_total_1h\", org: \"INFLUX_ORG\")",
"status": "active",
"description": "This task downsamples CPU data every hour"
}
```
@ -2391,17 +2393,17 @@ Use this endpoint to create a scheduled task that runs a Flux script.
```json
{
"name": "CPU Total 1 Hour New",
"description": "This task downsamples CPU data every hour",
"every": "1h",
"scriptID": "SCRIPT_ID",
"scriptParameters":
{
"rangeStart": "-1h",
"bucket": "telegraf",
"filterField": "cpu-total"
}
}
"name": "CPU Total 1 Hour New",
"description": "This task downsamples CPU data every hour",
"every": "1h",
"scriptID": "SCRIPT_ID",
"scriptParameters":
{
"rangeStart": "-1h",
"bucket": "telegraf",
"filterField": "cpu-total"
}
}
```
#### Limitations:
@ -2415,8 +2417,8 @@ Use this endpoint to create a scheduled task that runs a Flux script.
- [Common tasks]({{% INFLUXDB_DOCS_URL %}}/process-data/common-tasks/)
- [Task configuration options]({{% INFLUXDB_DOCS_URL %}}/process-data/task-options/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiPostTasksRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @return ApiPostTasksRequest
*/
func (a *TasksApiService) PostTasks(ctx _context.Context) ApiPostTasksRequest {
return ApiPostTasksRequest{
@ -2611,8 +2613,8 @@ func (r ApiPostTasksIDRunsRequest) ExecuteWithHttpInfo() (Run, *_nethttp.Respons
}
/*
* PostTasksIDRuns Start a task run, overriding the schedule
* Schedules a task run to start immediately, ignoring scheduled runs.
- PostTasksIDRuns Start a task run, overriding the schedule
- Schedules a task run to start immediately, ignoring scheduled runs.
Use this endpoint to manually start a task run.
Scheduled runs will continue to run as scheduled.
@ -2621,9 +2623,9 @@ This may result in concurrently running tasks.
To _retry_ a previous run (and avoid creating a new run),
use the [`POST /api/v2/tasks/{taskID}/runs/{runID}/retry` endpoint](#operation/PostTasksIDRunsIDRetry).
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param taskID
* @return ApiPostTasksIDRunsRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param taskID
- @return ApiPostTasksIDRunsRequest
*/
func (a *TasksApiService) PostTasksIDRuns(ctx _context.Context, taskID string) ApiPostTasksIDRunsRequest {
return ApiPostTasksIDRunsRequest{
@ -2815,8 +2817,9 @@ func (r ApiPostTasksIDRunsIDRetryRequest) ExecuteWithHttpInfo() (Run, *_nethttp.
}
/*
* PostTasksIDRunsIDRetry Retry a task run
* Queues a [task]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task) run to
- PostTasksIDRunsIDRetry Retry a task run
- Queues a [task]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task) run to
retry and returns the scheduled run.
To manually start a _new_ task run, use the
@ -2826,10 +2829,10 @@ To manually start a _new_ task run, use the
- The task must be _active_ (`status: "active"`).
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param taskID A [task]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task) ID. Specifies the task to retry.
* @param runID A [task]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task) run ID. Specifies the task run to retry. To find a task run ID, use the [`GET /api/v2/tasks/{taskID}/runs` endpoint](#operation/GetTasksIDRuns) to list task runs.
* @return ApiPostTasksIDRunsIDRetryRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param taskID A [task]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task) ID. Specifies the task to retry.
- @param runID A [task]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task) run ID. Specifies the task run to retry. To find a task run ID, use the [`GET /api/v2/tasks/{taskID}/runs` endpoint](#operation/GetTasksIDRuns) to list task runs.
- @return ApiPostTasksIDRunsIDRetryRequest
*/
func (a *TasksApiService) PostTasksIDRunsIDRetry(ctx _context.Context, taskID string, runID string) ApiPostTasksIDRunsIDRetryRequest {
return ApiPostTasksIDRunsIDRetryRequest{

View File

@ -62,7 +62,7 @@ type UsersApi interface {
/*
* GetUsers List users
* Retrieves a list of [users]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#user).
* Lists [users]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#user).
Default limit is `20`.
To limit which users are returned, pass query parameters in your request.
@ -76,6 +76,10 @@ type UsersApi interface {
*`USER_ID`* is the ID of the user that you want to retrieve.
#### Related guides
- [View users](https://docs.influxdata.com/influxdb/latest/users/view-users/).
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiGetUsersRequest
*/
@ -174,8 +178,8 @@ type UsersApi interface {
This endpoint represents the first two steps in a four-step process to allow a user
to authenticate with a username and password, and then access data in an organization:
1. Create a user: send a `POST` request to `POST /api/v2/users`. `name` is required.
2. Extract the user ID (`id`) value from the API response for _step 1_.
1. Create a user: send a `POST` request to `POST /api/v2/users`. The `name` property is required.
2. Extract the user ID (`id` property) value from the API response for _step 1_.
3. Create an authorization (and API token) for the user: send a `POST` request to [`POST /api/v2/authorizations`](#operation/PostAuthorizations), passing the user ID (`id`) from _step 2_.
4. Create a password for the user: send a `POST` request to [`POST /api/v2/users/USER_ID/password`](#operation/PostUsersIDPassword), passing the user ID from _step 2_.
@ -313,8 +317,8 @@ func (r ApiDeleteUsersIDRequest) ExecuteWithHttpInfo() (*_nethttp.Response, erro
}
/*
* DeleteUsersID Delete a user
* Deletes a [user]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#user).
- DeleteUsersID Delete a user
- Deletes a [user]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#user).
#### Required permissions
@ -328,9 +332,9 @@ func (r ApiDeleteUsersIDRequest) ExecuteWithHttpInfo() (*_nethttp.Response, erro
- [Manage users]({{% INFLUXDB_DOCS_URL %}}/organizations/users/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param userID A user ID. Specifies the [user]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#user) to delete.
* @return ApiDeleteUsersIDRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param userID A user ID. Specifies the [user]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#user) to delete.
- @return ApiDeleteUsersIDRequest
*/
func (a *UsersApiService) DeleteUsersID(ctx _context.Context, userID string) ApiDeleteUsersIDRequest {
return ApiDeleteUsersIDRequest{
@ -527,8 +531,9 @@ func (r ApiGetUsersRequest) ExecuteWithHttpInfo() (Users, *_nethttp.Response, er
}
/*
* GetUsers List users
* Retrieves a list of [users]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#user).
- GetUsers List users
- Lists [users]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#user).
Default limit is `20`.
To limit which users are returned, pass query parameters in your request.
@ -542,8 +547,12 @@ To limit which users are returned, pass query parameters in your request.
*`USER_ID`* is the ID of the user that you want to retrieve.
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiGetUsersRequest
#### Related guides
- [View users](https://docs.influxdata.com/influxdb/latest/users/view-users/).
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @return ApiGetUsersRequest
*/
func (a *UsersApiService) GetUsers(ctx _context.Context) ApiGetUsersRequest {
return ApiGetUsersRequest{
@ -739,16 +748,16 @@ func (r ApiGetUsersIDRequest) ExecuteWithHttpInfo() (UserResponse, *_nethttp.Res
}
/*
* GetUsersID Retrieve a user
* Retrieves a [user]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#user).
- GetUsersID Retrieve a user
- Retrieves a [user]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#user).
#### Related guides
- [Manage users]({{% INFLUXDB_DOCS_URL %}}/organizations/users/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param userID A user ID. Retrieves the specified [user]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#user).
* @return ApiGetUsersIDRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param userID A user ID. Retrieves the specified [user]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#user).
- @return ApiGetUsersIDRequest
*/
func (a *UsersApiService) GetUsersID(ctx _context.Context, userID string) ApiGetUsersIDRequest {
return ApiGetUsersIDRequest{
@ -918,8 +927,8 @@ func (r ApiPatchUsersIDRequest) ExecuteWithHttpInfo() (UserResponse, *_nethttp.R
}
/*
* PatchUsersID Update a user
* Updates a [user]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#user) and returns the user.
- PatchUsersID Update a user
- Updates a [user]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#user) and returns the user.
#### Required permissions
@ -933,9 +942,9 @@ func (r ApiPatchUsersIDRequest) ExecuteWithHttpInfo() (UserResponse, *_nethttp.R
- [Manage users]({{% INFLUXDB_DOCS_URL %}}/organizations/users/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param userID A user ID. Specifies the [user]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#user) to update.
* @return ApiPatchUsersIDRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param userID A user ID. Specifies the [user]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#user) to update.
- @return ApiPatchUsersIDRequest
*/
func (a *UsersApiService) PatchUsersID(ctx _context.Context, userID string) ApiPatchUsersIDRequest {
return ApiPatchUsersIDRequest{
@ -1112,8 +1121,9 @@ func (r ApiPostUsersRequest) ExecuteWithHttpInfo() (UserResponse, *_nethttp.Resp
}
/*
* PostUsers Create a user
* Creates a [user]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#user) that can access InfluxDB.
- PostUsers Create a user
- Creates a [user]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#user) that can access InfluxDB.
Returns the user.
Use this endpoint to create a user that can sign in to start a user session
@ -1126,10 +1136,10 @@ through one of the following interfaces:
This endpoint represents the first two steps in a four-step process to allow a user
to authenticate with a username and password, and then access data in an organization:
1. Create a user: send a `POST` request to `POST /api/v2/users`. `name` is required.
2. Extract the user ID (`id`) value from the API response for _step 1_.
3. Create an authorization (and API token) for the user: send a `POST` request to [`POST /api/v2/authorizations`](#operation/PostAuthorizations), passing the user ID (`id`) from _step 2_.
4. Create a password for the user: send a `POST` request to [`POST /api/v2/users/USER_ID/password`](#operation/PostUsersIDPassword), passing the user ID from _step 2_.
1. Create a user: send a `POST` request to `POST /api/v2/users`. The `name` property is required.
2. Extract the user ID (`id` property) value from the API response for _step 1_.
3. Create an authorization (and API token) for the user: send a `POST` request to [`POST /api/v2/authorizations`](#operation/PostAuthorizations), passing the user ID (`id`) from _step 2_.
4. Create a password for the user: send a `POST` request to [`POST /api/v2/users/USER_ID/password`](#operation/PostUsersIDPassword), passing the user ID from _step 2_.
#### Required permissions
@ -1142,8 +1152,8 @@ to authenticate with a username and password, and then access data in an organiz
- [Create a user](https://docs.influxdata.com/influxdb/latest/users/create-user/)
- [Create an API token scoped to a user](https://docs.influxdata.com/influxdb/latest/security/tokens/create-token/#create-a-token-scoped-to-a-user)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiPostUsersRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @return ApiPostUsersRequest
*/
func (a *UsersApiService) PostUsers(ctx _context.Context) ApiPostUsersRequest {
return ApiPostUsersRequest{
@ -1338,22 +1348,22 @@ func (r ApiPostUsersIDPasswordRequest) ExecuteWithHttpInfo() (*_nethttp.Response
}
/*
* PostUsersIDPassword Update a password
* Updates a user password.
- PostUsersIDPassword Update a password
- Updates a user password.
#### InfluxDB Cloud
- Doesn't allow you to manage user passwords through the API.
Use the InfluxDB Cloud user interface (UI) to update a password.
- Doesn't allow you to manage user passwords through the API.
Use the InfluxDB Cloud user interface (UI) to update a password.
#### Related guides
- [InfluxDB Cloud - Change your password](https://docs.influxdata.com/influxdb/cloud/account-management/change-password/)
- [InfluxDB OSS - Change your password](https://docs.influxdata.com/influxdb/latest/users/change-password/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param userID The ID of the user to set the password for.
* @return ApiPostUsersIDPasswordRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param userID The ID of the user to set the password for.
- @return ApiPostUsersIDPasswordRequest
*/
func (a *UsersApiService) PostUsersIDPassword(ctx _context.Context, userID string) ApiPostUsersIDPasswordRequest {
return ApiPostUsersIDPasswordRequest{
@ -1517,8 +1527,8 @@ func (r ApiPutUsersIDPasswordRequest) ExecuteWithHttpInfo() (*_nethttp.Response,
}
/*
* PutUsersIDPassword Update a password
* Updates a user password.
- PutUsersIDPassword Update a password
- Updates a user password.
Use this endpoint to let a user authenticate with
[Basic authentication credentials](#section/Authentication/BasicAuthentication)
@ -1526,17 +1536,17 @@ and set a new password.
#### InfluxDB Cloud
- Doesn't allow you to manage user passwords through the API.
Use the InfluxDB Cloud user interface (UI) to update a password.
- Doesn't allow you to manage user passwords through the API.
Use the InfluxDB Cloud user interface (UI) to update a password.
#### Related guides
- [InfluxDB Cloud - Change your password](https://docs.influxdata.com/influxdb/cloud/account-management/change-password/)
- [InfluxDB OSS - Change your password](https://docs.influxdata.com/influxdb/latest/users/change-password/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param userID The ID of the user to set the password for.
* @return ApiPutUsersIDPasswordRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param userID The ID of the user to set the password for.
- @return ApiPutUsersIDPasswordRequest
*/
func (a *UsersApiService) PutUsersIDPassword(ctx _context.Context, userID string) ApiPutUsersIDPasswordRequest {
return ApiPutUsersIDPasswordRequest{

View File

@ -193,8 +193,8 @@ func (r ApiPostWriteRequest) ExecuteWithHttpInfo() (*_nethttp.Response, error) {
}
/*
* PostWrite Write data
* Writes data to a bucket.
- PostWrite Write data
- Writes data to a bucket.
Use this endpoint to send data in [line protocol]({{% INFLUXDB_DOCS_URL %}}/reference/syntax/line-protocol/) format to InfluxDB.
@ -202,27 +202,29 @@ Use this endpoint to send data in [line protocol]({{% INFLUXDB_DOCS_URL %}}/refe
- Does the following when you send a write request:
1. Validates the request and queues the write.
2. If queued, responds with _success_ (HTTP `2xx` status code); _error_ otherwise.
3. Handles the delete asynchronously and reaches eventual consistency.
1. Validates the request and queues the write.
To ensure that InfluxDB Cloud handles writes and deletes in the order you request them,
wait for a success response (HTTP `2xx` status code) before you send the next request.
2. If queued, responds with _success_ (HTTP `2xx` status code); _error_ otherwise.
Because writes and deletes are asynchronous, your change might not yet be readable
when you receive the response.
3. Handles the delete asynchronously and reaches eventual consistency.
To ensure that InfluxDB Cloud handles writes and deletes in the order you request them,
wait for a success response (HTTP `2xx` status code) before you send the next request.
Because writes and deletes are asynchronous, your change might not yet be readable
when you receive the response.
#### InfluxDB OSS
- Validates the request and handles the write synchronously.
- If all points were written successfully, responds with HTTP `2xx` status code;
otherwise, returns the first line that failed.
- Validates the request and handles the write synchronously.
- If all points were written successfully, responds with HTTP `2xx` status code;
otherwise, returns the first line that failed.
#### Required permissions
- `write-buckets` or `write-bucket BUCKET_ID`.
*`BUCKET_ID`* is the ID of the destination bucket.
*`BUCKET_ID`* is the ID of the destination bucket.
#### Rate limits (with InfluxDB Cloud)
@ -235,8 +237,8 @@ For more information, see [limits and adjustable quotas](https://docs.influxdata
- [Optimize writes to InfluxDB]({{% INFLUXDB_DOCS_URL %}}/write-data/best-practices/optimize-writes/)
- [Troubleshoot issues writing data]({{% INFLUXDB_DOCS_URL %}}/write-data/troubleshoot/)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return ApiPostWriteRequest
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @return ApiPostWriteRequest
*/
func (a *WriteApiService) PostWrite(ctx _context.Context) ApiPostWriteRequest {
return ApiPostWriteRequest{

View File

@ -46,7 +46,7 @@ type APIClient struct {
// API Services
AuthorizationsApi AuthorizationsApi
AuthorizationsAPITokensApi AuthorizationsAPITokensApi
BackupApi BackupApi
@ -123,7 +123,7 @@ func NewAPIClient(cfg *Configuration) *APIClient {
c.common.client = c
// API Services
c.AuthorizationsApi = (*AuthorizationsApiService)(&c.common)
c.AuthorizationsAPITokensApi = (*AuthorizationsAPITokensApiService)(&c.common)
c.BackupApi = (*BackupApiService)(&c.common)
c.BucketSchemasApi = (*BucketSchemasApiService)(&c.common)
c.BucketsApi = (*BucketsApiService)(&c.common)

View File

@ -43,6 +43,8 @@ paths:
$ref: "./openapi/src/common/paths/orgs_orgID_secrets.yml"
/api/v2/orgs/{orgID}/secrets/{delete}:
$ref: "./openapi/src/common/paths/orgs_orgID_secrets_delete.yml"
/api/v2/orgs/{orgID}/secrets/{secretID}:
$ref: "./openapi/src/common/paths/orgs_orgID_secrets_secretID.yml"
/api/v2/buckets/{bucketID}/schema/measurements:
$ref: "./openapi/src/cloud/paths/measurements.yml"
/api/v2/buckets/{bucketID}/schema/measurements/{measurementID}:

View File

@ -17,7 +17,7 @@ import (
// Authorization struct for Authorization
type Authorization struct {
// Status of the token. If `inactive`, requests using the token will be rejected.
// Status of the token. If `inactive`, InfluxDB rejects requests that use the token.
Status *string `json:"status,omitempty" yaml:"status,omitempty"`
// A description of the token.
Description *string `json:"description,omitempty" yaml:"description,omitempty"`

View File

@ -16,15 +16,15 @@ import (
// AuthorizationPostRequest struct for AuthorizationPostRequest
type AuthorizationPostRequest struct {
// Status of the token. If `inactive`, requests using the token will be rejected.
// Status of the token. If `inactive`, InfluxDB rejects requests that use the token.
Status *string `json:"status,omitempty" yaml:"status,omitempty"`
// A description of the token.
Description *string `json:"description,omitempty" yaml:"description,omitempty"`
// The ID of the organization that owns the authorization.
// An organization ID. Specifies the organization that owns the authorization.
OrgID string `json:"orgID" yaml:"orgID"`
// The ID of the user that the authorization is scoped to.
// A user ID. Specifies the user that the authorization is scoped to. When a user authenticates with username and password, InfluxDB generates a _user session_ with all the permissions specified by all the user's authorizations.
UserID *string `json:"userID,omitempty" yaml:"userID,omitempty"`
// A list of permissions for an authorization. An authorization must have at least one permission.
// A list of permissions for an authorization. In the list, provide at least one `permission` object. In a `permission`, the `resource.type` property grants access to all resources of the specified type. To grant access to only a specific resource, specify the `resource.id` property.
Permissions []Permission `json:"permissions" yaml:"permissions"`
}

View File

@ -16,11 +16,11 @@ import (
// AuthorizationPostRequestAllOf struct for AuthorizationPostRequestAllOf
type AuthorizationPostRequestAllOf struct {
// The ID of the organization that owns the authorization.
// An organization ID. Specifies the organization that owns the authorization.
OrgID *string `json:"orgID,omitempty" yaml:"orgID,omitempty"`
// The ID of the user that the authorization is scoped to.
// A user ID. Specifies the user that the authorization is scoped to. When a user authenticates with username and password, InfluxDB generates a _user session_ with all the permissions specified by all the user's authorizations.
UserID *string `json:"userID,omitempty" yaml:"userID,omitempty"`
// A list of permissions for an authorization. An authorization must have at least one permission.
// A list of permissions for an authorization. In the list, provide at least one `permission` object. In a `permission`, the `resource.type` property grants access to all resources of the specified type. To grant access to only a specific resource, specify the `resource.id` property.
Permissions *[]Permission `json:"permissions,omitempty" yaml:"permissions,omitempty"`
}

View File

@ -16,7 +16,7 @@ import (
// AuthorizationUpdateRequest struct for AuthorizationUpdateRequest
type AuthorizationUpdateRequest struct {
// Status of the token. If `inactive`, requests using the token will be rejected.
// Status of the token. If `inactive`, InfluxDB rejects requests that use the token.
Status *string `json:"status,omitempty" yaml:"status,omitempty"`
// A description of the token.
Description *string `json:"description,omitempty" yaml:"description,omitempty"`

View File

@ -16,17 +16,17 @@ import (
// DBRP struct for DBRP
type DBRP struct {
// The ID of the DBRP mapping.
// The resource ID that InfluxDB uses to uniquely identify the database retention policy (DBRP) mapping.
Id string `json:"id" yaml:"id"`
// The ID of the organization.
// An organization ID. Identifies the [organization]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#organization) that owns the mapping.
OrgID string `json:"orgID" yaml:"orgID"`
// The ID of the bucket used as the target for the translation.
// A bucket ID. Identifies the bucket used as the target for the translation.
BucketID string `json:"bucketID" yaml:"bucketID"`
// InfluxDB v1 database
// A database name. Identifies the InfluxDB v1 database.
Database string `json:"database" yaml:"database"`
// InfluxDB v1 retention policy
// A [retention policy](https://docs.influxdata.com/influxdb/v1.8/concepts/glossary/#retention-policy-rp) name. Identifies the InfluxDB v1 retention policy mapping.
RetentionPolicy string `json:"retention_policy" yaml:"retention_policy"`
// Mapping represents the default retention policy for the database specified.
// If set to `true`, this DBRP mapping is the default retention policy for the database (specified by the `database` property's value).
Default bool `json:"default" yaml:"default"`
// Indicates an autogenerated, virtual mapping based on the bucket name. Currently only available in OSS.
Virtual *bool `json:"virtual,omitempty" yaml:"virtual,omitempty"`

View File

@ -16,17 +16,17 @@ import (
// DBRPCreate struct for DBRPCreate
type DBRPCreate struct {
// The ID of the organization.
OrgID *string `json:"orgID,omitempty" yaml:"orgID,omitempty"`
// The name of the organization that owns this mapping.
// An organization name. Identifies the [organization]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#organization) that owns the mapping.
Org *string `json:"org,omitempty" yaml:"org,omitempty"`
// The ID of the bucket used as the target for the translation.
// An organization ID. Identifies the [organization]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#organization) that owns the mapping.
OrgID *string `json:"orgID,omitempty" yaml:"orgID,omitempty"`
// A bucket ID. Identifies the bucket used as the target for the translation.
BucketID string `json:"bucketID" yaml:"bucketID"`
// InfluxDB v1 database
// A database name. Identifies the InfluxDB v1 database.
Database string `json:"database" yaml:"database"`
// InfluxDB v1 retention policy
// A [retention policy](https://docs.influxdata.com/influxdb/v1.8/concepts/glossary/#retention-policy-rp) name. Identifies the InfluxDB v1 retention policy mapping.
RetentionPolicy string `json:"retention_policy" yaml:"retention_policy"`
// Mapping represents the default retention policy for the database specified.
// Set to `true` to use this DBRP mapping as the default retention policy for the database (specified by the `database` property's value).
Default *bool `json:"default,omitempty" yaml:"default,omitempty"`
}
@ -50,38 +50,6 @@ func NewDBRPCreateWithDefaults() *DBRPCreate {
return &this
}
// GetOrgID returns the OrgID field value if set, zero value otherwise.
func (o *DBRPCreate) GetOrgID() string {
if o == nil || o.OrgID == nil {
var ret string
return ret
}
return *o.OrgID
}
// GetOrgIDOk returns a tuple with the OrgID field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DBRPCreate) GetOrgIDOk() (*string, bool) {
if o == nil || o.OrgID == nil {
return nil, false
}
return o.OrgID, true
}
// HasOrgID returns a boolean if a field has been set.
func (o *DBRPCreate) HasOrgID() bool {
if o != nil && o.OrgID != nil {
return true
}
return false
}
// SetOrgID gets a reference to the given string and assigns it to the OrgID field.
func (o *DBRPCreate) SetOrgID(v string) {
o.OrgID = &v
}
// GetOrg returns the Org field value if set, zero value otherwise.
func (o *DBRPCreate) GetOrg() string {
if o == nil || o.Org == nil {
@ -114,6 +82,38 @@ func (o *DBRPCreate) SetOrg(v string) {
o.Org = &v
}
// GetOrgID returns the OrgID field value if set, zero value otherwise.
func (o *DBRPCreate) GetOrgID() string {
if o == nil || o.OrgID == nil {
var ret string
return ret
}
return *o.OrgID
}
// GetOrgIDOk returns a tuple with the OrgID field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DBRPCreate) GetOrgIDOk() (*string, bool) {
if o == nil || o.OrgID == nil {
return nil, false
}
return o.OrgID, true
}
// HasOrgID returns a boolean if a field has been set.
func (o *DBRPCreate) HasOrgID() bool {
if o != nil && o.OrgID != nil {
return true
}
return false
}
// SetOrgID gets a reference to the given string and assigns it to the OrgID field.
func (o *DBRPCreate) SetOrgID(v string) {
o.OrgID = &v
}
// GetBucketID returns the BucketID field value
func (o *DBRPCreate) GetBucketID() string {
if o == nil {
@ -220,12 +220,12 @@ func (o *DBRPCreate) SetDefault(v bool) {
func (o DBRPCreate) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.OrgID != nil {
toSerialize["orgID"] = o.OrgID
}
if o.Org != nil {
toSerialize["org"] = o.Org
}
if o.OrgID != nil {
toSerialize["orgID"] = o.OrgID
}
if true {
toSerialize["bucketID"] = o.BucketID
}

View File

@ -16,9 +16,10 @@ import (
// DBRPUpdate struct for DBRPUpdate
type DBRPUpdate struct {
// InfluxDB v1 retention policy
// A [retention policy](https://docs.influxdata.com/influxdb/v1.8/concepts/glossary/#retention-policy-rp) name. Identifies the InfluxDB v1 retention policy mapping.
RetentionPolicy *string `json:"retention_policy,omitempty" yaml:"retention_policy,omitempty"`
Default *bool `json:"default,omitempty" yaml:"default,omitempty"`
// Set to `true` to use this DBRP mapping as the default retention policy for the database (specified by the `database` property's value). To remove the default mapping, set to `false`.
Default *bool `json:"default,omitempty" yaml:"default,omitempty"`
}
// NewDBRPUpdate instantiates a new DBRPUpdate object

View File

@ -21,6 +21,7 @@ type ErrorCode string
// List of ErrorCode
const (
ERRORCODE_INTERNAL_ERROR ErrorCode = "internal error"
ERRORCODE_NOT_IMPLEMENTED ErrorCode = "not implemented"
ERRORCODE_NOT_FOUND ErrorCode = "not found"
ERRORCODE_CONFLICT ErrorCode = "conflict"
ERRORCODE_INVALID ErrorCode = "invalid"
@ -36,7 +37,7 @@ const (
)
func ErrorCodeValues() []ErrorCode {
return []ErrorCode{"internal error", "not found", "conflict", "invalid", "unprocessable entity", "empty value", "unavailable", "forbidden", "too many requests", "unauthorized", "method not allowed", "request too large", "unsupported media type"}
return []ErrorCode{"internal error", "not implemented", "not found", "conflict", "invalid", "unprocessable entity", "empty value", "unavailable", "forbidden", "too many requests", "unauthorized", "method not allowed", "request too large", "unsupported media type"}
}
func (v *ErrorCode) UnmarshalJSON(src []byte) error {
@ -46,7 +47,7 @@ func (v *ErrorCode) UnmarshalJSON(src []byte) error {
return err
}
enumTypeValue := ErrorCode(value)
for _, existing := range []ErrorCode{"internal error", "not found", "conflict", "invalid", "unprocessable entity", "empty value", "unavailable", "forbidden", "too many requests", "unauthorized", "method not allowed", "request too large", "unsupported media type"} {
for _, existing := range []ErrorCode{"internal error", "not implemented", "not found", "conflict", "invalid", "unprocessable entity", "empty value", "unavailable", "forbidden", "too many requests", "unauthorized", "method not allowed", "request too large", "unsupported media type"} {
if existing == enumTypeValue {
*v = enumTypeValue
return nil

View File

@ -16,17 +16,17 @@ import (
// LegacyAuthorizationPostRequest struct for LegacyAuthorizationPostRequest
type LegacyAuthorizationPostRequest struct {
// Status of the token. If `inactive`, requests using the token will be rejected.
// Status of the token. If `inactive`, InfluxDB rejects requests that use the token.
Status *string `json:"status,omitempty" yaml:"status,omitempty"`
// A description of the token.
Description *string `json:"description,omitempty" yaml:"description,omitempty"`
// The ID of the organization that the authorization is scoped to.
// The organization ID. Identifies the organization that the authorization is scoped to.
OrgID string `json:"orgID" yaml:"orgID"`
// The ID of the user that the authorization is scoped to.
// The user ID. Identifies the user that the authorization is scoped to.
UserID *string `json:"userID,omitempty" yaml:"userID,omitempty"`
// A name that you provide for the authorization.
// The name that you provide for the authorization.
Token *string `json:"token,omitempty" yaml:"token,omitempty"`
// A list of permissions that provide `read` and `write` access to organization resources. An authorization must contain at least one permission.
// The list of permissions that provide `read` and `write` access to organization resources. An authorization must contain at least one permission.
Permissions []Permission `json:"permissions" yaml:"permissions"`
}

View File

@ -16,13 +16,13 @@ import (
// LegacyAuthorizationPostRequestAllOf struct for LegacyAuthorizationPostRequestAllOf
type LegacyAuthorizationPostRequestAllOf struct {
// The ID of the organization that the authorization is scoped to.
// The organization ID. Identifies the organization that the authorization is scoped to.
OrgID *string `json:"orgID,omitempty" yaml:"orgID,omitempty"`
// The ID of the user that the authorization is scoped to.
// The user ID. Identifies the user that the authorization is scoped to.
UserID *string `json:"userID,omitempty" yaml:"userID,omitempty"`
// A name that you provide for the authorization.
// The name that you provide for the authorization.
Token *string `json:"token,omitempty" yaml:"token,omitempty"`
// A list of permissions that provide `read` and `write` access to organization resources. An authorization must contain at least one permission.
// The list of permissions that provide `read` and `write` access to organization resources. An authorization must contain at least one permission.
Permissions *[]Permission `json:"permissions,omitempty" yaml:"permissions,omitempty"`
}

View File

@ -17,13 +17,15 @@ import (
// Organization struct for Organization
type Organization struct {
Links *OrganizationLinks `json:"links,omitempty" yaml:"links,omitempty"`
Id *string `json:"id,omitempty" yaml:"id,omitempty"`
Name string `json:"name" yaml:"name"`
Description *string `json:"description,omitempty" yaml:"description,omitempty"`
CreatedAt *time.Time `json:"createdAt,omitempty" yaml:"createdAt,omitempty"`
UpdatedAt *time.Time `json:"updatedAt,omitempty" yaml:"updatedAt,omitempty"`
// If inactive the organization is inactive.
Links *OrganizationLinks `json:"links,omitempty" yaml:"links,omitempty"`
Id *string `json:"id,omitempty" yaml:"id,omitempty"`
Name string `json:"name" yaml:"name"`
// Discloses whether the organization uses TSM or IOx.
DefaultStorageType *string `json:"defaultStorageType,omitempty" yaml:"defaultStorageType,omitempty"`
Description *string `json:"description,omitempty" yaml:"description,omitempty"`
CreatedAt *time.Time `json:"createdAt,omitempty" yaml:"createdAt,omitempty"`
UpdatedAt *time.Time `json:"updatedAt,omitempty" yaml:"updatedAt,omitempty"`
// If inactive, the organization is inactive.
Status *string `json:"status,omitempty" yaml:"status,omitempty"`
}
@ -137,6 +139,38 @@ func (o *Organization) SetName(v string) {
o.Name = v
}
// GetDefaultStorageType returns the DefaultStorageType field value if set, zero value otherwise.
func (o *Organization) GetDefaultStorageType() string {
if o == nil || o.DefaultStorageType == nil {
var ret string
return ret
}
return *o.DefaultStorageType
}
// GetDefaultStorageTypeOk returns a tuple with the DefaultStorageType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Organization) GetDefaultStorageTypeOk() (*string, bool) {
if o == nil || o.DefaultStorageType == nil {
return nil, false
}
return o.DefaultStorageType, true
}
// HasDefaultStorageType returns a boolean if a field has been set.
func (o *Organization) HasDefaultStorageType() bool {
if o != nil && o.DefaultStorageType != nil {
return true
}
return false
}
// SetDefaultStorageType gets a reference to the given string and assigns it to the DefaultStorageType field.
func (o *Organization) SetDefaultStorageType(v string) {
o.DefaultStorageType = &v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *Organization) GetDescription() string {
if o == nil || o.Description == nil {
@ -276,6 +310,9 @@ func (o Organization) MarshalJSON() ([]byte, error) {
if true {
toSerialize["name"] = o.Name
}
if o.DefaultStorageType != nil {
toSerialize["defaultStorageType"] = o.DefaultStorageType
}
if o.Description != nil {
toSerialize["description"] = o.Description
}

View File

@ -16,15 +16,15 @@ import (
// PermissionResource struct for PermissionResource
type PermissionResource struct {
// The type of resource. In a `permission`, applies the permission to all resources of this type.
// A resource type. Identifies the API resource's type (or _kind_).
Type string `json:"type" yaml:"type"`
// The ID of a specific resource. In a `permission`, applies the permission to only the resource with this ID.
// A resource ID. Identifies a specific resource.
Id *string `json:"id,omitempty" yaml:"id,omitempty"`
// Optional: A name for the resource. Not all resource types have a name field.
// The name of the resource. _Note: not all resource types have a `name` property_.
Name *string `json:"name,omitempty" yaml:"name,omitempty"`
// The ID of the organization that owns the resource. In a `permission`, applies the permission to all resources of `type` owned by this organization.
// An organization ID. Identifies the organization that owns the resource.
OrgID *string `json:"orgID,omitempty" yaml:"orgID,omitempty"`
// Optional: The name of the organization with `orgID`.
// An organization name. The organization that owns the resource.
Org *string `json:"org,omitempty" yaml:"org,omitempty"`
}

View File

@ -16,26 +16,27 @@ import (
// Replication struct for Replication
type Replication struct {
Id string `json:"id" yaml:"id"`
Name string `json:"name" yaml:"name"`
Description *string `json:"description,omitempty" yaml:"description,omitempty"`
OrgID string `json:"orgID" yaml:"orgID"`
RemoteID string `json:"remoteID" yaml:"remoteID"`
LocalBucketID string `json:"localBucketID" yaml:"localBucketID"`
RemoteBucketID *string `json:"remoteBucketID,omitempty" yaml:"remoteBucketID,omitempty"`
RemoteBucketName *string `json:"remoteBucketName,omitempty" yaml:"remoteBucketName,omitempty"`
MaxQueueSizeBytes int64 `json:"maxQueueSizeBytes" yaml:"maxQueueSizeBytes"`
CurrentQueueSizeBytes int64 `json:"currentQueueSizeBytes" yaml:"currentQueueSizeBytes"`
LatestResponseCode *int32 `json:"latestResponseCode,omitempty" yaml:"latestResponseCode,omitempty"`
LatestErrorMessage *string `json:"latestErrorMessage,omitempty" yaml:"latestErrorMessage,omitempty"`
DropNonRetryableData *bool `json:"dropNonRetryableData,omitempty" yaml:"dropNonRetryableData,omitempty"`
Id string `json:"id" yaml:"id"`
Name string `json:"name" yaml:"name"`
Description *string `json:"description,omitempty" yaml:"description,omitempty"`
OrgID string `json:"orgID" yaml:"orgID"`
RemoteID string `json:"remoteID" yaml:"remoteID"`
LocalBucketID string `json:"localBucketID" yaml:"localBucketID"`
RemoteBucketID *string `json:"remoteBucketID,omitempty" yaml:"remoteBucketID,omitempty"`
RemoteBucketName *string `json:"remoteBucketName,omitempty" yaml:"remoteBucketName,omitempty"`
MaxQueueSizeBytes int64 `json:"maxQueueSizeBytes" yaml:"maxQueueSizeBytes"`
CurrentQueueSizeBytes *int64 `json:"currentQueueSizeBytes,omitempty" yaml:"currentQueueSizeBytes,omitempty"`
RemainingBytesToBeSynced *int64 `json:"remainingBytesToBeSynced,omitempty" yaml:"remainingBytesToBeSynced,omitempty"`
LatestResponseCode *int32 `json:"latestResponseCode,omitempty" yaml:"latestResponseCode,omitempty"`
LatestErrorMessage *string `json:"latestErrorMessage,omitempty" yaml:"latestErrorMessage,omitempty"`
DropNonRetryableData *bool `json:"dropNonRetryableData,omitempty" yaml:"dropNonRetryableData,omitempty"`
}
// NewReplication instantiates a new Replication object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewReplication(id string, name string, orgID string, remoteID string, localBucketID string, maxQueueSizeBytes int64, currentQueueSizeBytes int64) *Replication {
func NewReplication(id string, name string, orgID string, remoteID string, localBucketID string, maxQueueSizeBytes int64) *Replication {
this := Replication{}
this.Id = id
this.Name = name
@ -43,7 +44,6 @@ func NewReplication(id string, name string, orgID string, remoteID string, local
this.RemoteID = remoteID
this.LocalBucketID = localBucketID
this.MaxQueueSizeBytes = maxQueueSizeBytes
this.CurrentQueueSizeBytes = currentQueueSizeBytes
return &this
}
@ -295,28 +295,68 @@ func (o *Replication) SetMaxQueueSizeBytes(v int64) {
o.MaxQueueSizeBytes = v
}
// GetCurrentQueueSizeBytes returns the CurrentQueueSizeBytes field value
// GetCurrentQueueSizeBytes returns the CurrentQueueSizeBytes field value if set, zero value otherwise.
func (o *Replication) GetCurrentQueueSizeBytes() int64 {
if o == nil {
if o == nil || o.CurrentQueueSizeBytes == nil {
var ret int64
return ret
}
return o.CurrentQueueSizeBytes
return *o.CurrentQueueSizeBytes
}
// GetCurrentQueueSizeBytesOk returns a tuple with the CurrentQueueSizeBytes field value
// GetCurrentQueueSizeBytesOk returns a tuple with the CurrentQueueSizeBytes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Replication) GetCurrentQueueSizeBytesOk() (*int64, bool) {
if o == nil {
if o == nil || o.CurrentQueueSizeBytes == nil {
return nil, false
}
return &o.CurrentQueueSizeBytes, true
return o.CurrentQueueSizeBytes, true
}
// SetCurrentQueueSizeBytes sets field value
// HasCurrentQueueSizeBytes returns a boolean if a field has been set.
func (o *Replication) HasCurrentQueueSizeBytes() bool {
if o != nil && o.CurrentQueueSizeBytes != nil {
return true
}
return false
}
// SetCurrentQueueSizeBytes gets a reference to the given int64 and assigns it to the CurrentQueueSizeBytes field.
func (o *Replication) SetCurrentQueueSizeBytes(v int64) {
o.CurrentQueueSizeBytes = v
o.CurrentQueueSizeBytes = &v
}
// GetRemainingBytesToBeSynced returns the RemainingBytesToBeSynced field value if set, zero value otherwise.
func (o *Replication) GetRemainingBytesToBeSynced() int64 {
if o == nil || o.RemainingBytesToBeSynced == nil {
var ret int64
return ret
}
return *o.RemainingBytesToBeSynced
}
// GetRemainingBytesToBeSyncedOk returns a tuple with the RemainingBytesToBeSynced field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Replication) GetRemainingBytesToBeSyncedOk() (*int64, bool) {
if o == nil || o.RemainingBytesToBeSynced == nil {
return nil, false
}
return o.RemainingBytesToBeSynced, true
}
// HasRemainingBytesToBeSynced returns a boolean if a field has been set.
func (o *Replication) HasRemainingBytesToBeSynced() bool {
if o != nil && o.RemainingBytesToBeSynced != nil {
return true
}
return false
}
// SetRemainingBytesToBeSynced gets a reference to the given int64 and assigns it to the RemainingBytesToBeSynced field.
func (o *Replication) SetRemainingBytesToBeSynced(v int64) {
o.RemainingBytesToBeSynced = &v
}
// GetLatestResponseCode returns the LatestResponseCode field value if set, zero value otherwise.
@ -444,9 +484,12 @@ func (o Replication) MarshalJSON() ([]byte, error) {
if true {
toSerialize["maxQueueSizeBytes"] = o.MaxQueueSizeBytes
}
if true {
if o.CurrentQueueSizeBytes != nil {
toSerialize["currentQueueSizeBytes"] = o.CurrentQueueSizeBytes
}
if o.RemainingBytesToBeSynced != nil {
toSerialize["remainingBytesToBeSynced"] = o.RemainingBytesToBeSynced
}
if o.LatestResponseCode != nil {
toSerialize["latestResponseCode"] = o.LatestResponseCode
}

View File

@ -19,7 +19,7 @@ type RetentionRule struct {
Type *string `json:"type,omitempty" yaml:"type,omitempty"`
// The duration in seconds for how long data will be kept in the database. The default duration is 2592000 (30 days). 0 represents infinite retention.
EverySeconds int64 `json:"everySeconds" yaml:"everySeconds"`
// The shard group duration. The duration or interval (in seconds) that each shard group covers. #### InfluxDB Cloud - Does not use `shardGroupDurationsSeconds`. #### InfluxDB OSS - Default value depends on the [bucket retention period]({{% INFLUXDB_DOCS_URL %}}/v2.3/reference/internals/shards/#shard-group-duration).
// The shard group duration. The duration or interval (in seconds) that each shard group covers. #### InfluxDB Cloud - Does not use `shardGroupDurationsSeconds`. #### InfluxDB OSS - Default value depends on the [bucket retention period]({{% INFLUXDB_DOCS_URL %}}/reference/internals/shards/#shard-group-duration).
ShardGroupDurationSeconds *int64 `json:"shardGroupDurationSeconds,omitempty" yaml:"shardGroupDurationSeconds,omitempty"`
}

View File

@ -28,8 +28,6 @@ type Script struct {
Url *string `json:"url,omitempty" yaml:"url,omitempty"`
CreatedAt *time.Time `json:"createdAt,omitempty" yaml:"createdAt,omitempty"`
UpdatedAt *time.Time `json:"updatedAt,omitempty" yaml:"updatedAt,omitempty"`
// The list of label names associated with the script.
Labels *[]string `json:"labels,omitempty" yaml:"labels,omitempty"`
}
// NewScript instantiates a new Script object
@ -316,38 +314,6 @@ func (o *Script) SetUpdatedAt(v time.Time) {
o.UpdatedAt = &v
}
// GetLabels returns the Labels field value if set, zero value otherwise.
func (o *Script) GetLabels() []string {
if o == nil || o.Labels == nil {
var ret []string
return ret
}
return *o.Labels
}
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Script) GetLabelsOk() (*[]string, bool) {
if o == nil || o.Labels == nil {
return nil, false
}
return o.Labels, true
}
// HasLabels returns a boolean if a field has been set.
func (o *Script) HasLabels() bool {
if o != nil && o.Labels != nil {
return true
}
return false
}
// SetLabels gets a reference to the given []string and assigns it to the Labels field.
func (o *Script) SetLabels(v []string) {
o.Labels = &v
}
func (o Script) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Id != nil {
@ -377,9 +343,6 @@ func (o Script) MarshalJSON() ([]byte, error) {
if o.UpdatedAt != nil {
toSerialize["updatedAt"] = o.UpdatedAt
}
if o.Labels != nil {
toSerialize["labels"] = o.Labels
}
return json.Marshal(toSerialize)
}

View File

@ -16,9 +16,9 @@ import (
// ScriptUpdateRequest struct for ScriptUpdateRequest
type ScriptUpdateRequest struct {
Name *string `json:"name,omitempty" yaml:"name,omitempty"`
// A description of the script.
Description *string `json:"description,omitempty" yaml:"description,omitempty"`
// script is script to be executed
// The script to execute.
Script *string `json:"script,omitempty" yaml:"script,omitempty"`
}
@ -39,38 +39,6 @@ func NewScriptUpdateRequestWithDefaults() *ScriptUpdateRequest {
return &this
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *ScriptUpdateRequest) GetName() string {
if o == nil || o.Name == nil {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ScriptUpdateRequest) GetNameOk() (*string, bool) {
if o == nil || o.Name == nil {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *ScriptUpdateRequest) HasName() bool {
if o != nil && o.Name != nil {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *ScriptUpdateRequest) SetName(v string) {
o.Name = &v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *ScriptUpdateRequest) GetDescription() string {
if o == nil || o.Description == nil {
@ -137,9 +105,6 @@ func (o *ScriptUpdateRequest) SetScript(v string) {
func (o ScriptUpdateRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Name != nil {
toSerialize["name"] = o.Name
}
if o.Description != nil {
toSerialize["description"] = o.Description
}

View File

@ -18,8 +18,6 @@ import (
type User struct {
// The user ID.
Id *string `json:"id,omitempty" yaml:"id,omitempty"`
// The OAuth ID.
OauthID *string `json:"oauthID,omitempty" yaml:"oauthID,omitempty"`
// The user name.
Name string `json:"name" yaml:"name"`
// If `inactive`, the user is inactive. Default is `active`.
@ -80,38 +78,6 @@ func (o *User) SetId(v string) {
o.Id = &v
}
// GetOauthID returns the OauthID field value if set, zero value otherwise.
func (o *User) GetOauthID() string {
if o == nil || o.OauthID == nil {
var ret string
return ret
}
return *o.OauthID
}
// GetOauthIDOk returns a tuple with the OauthID field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *User) GetOauthIDOk() (*string, bool) {
if o == nil || o.OauthID == nil {
return nil, false
}
return o.OauthID, true
}
// HasOauthID returns a boolean if a field has been set.
func (o *User) HasOauthID() bool {
if o != nil && o.OauthID != nil {
return true
}
return false
}
// SetOauthID gets a reference to the given string and assigns it to the OauthID field.
func (o *User) SetOauthID(v string) {
o.OauthID = &v
}
// GetName returns the Name field value
func (o *User) GetName() string {
if o == nil {
@ -173,9 +139,6 @@ func (o User) MarshalJSON() ([]byte, error) {
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.OauthID != nil {
toSerialize["oauthID"] = o.OauthID
}
if true {
toSerialize["name"] = o.Name
}

View File

@ -12,7 +12,7 @@ import (
type Client struct {
clients.CLI
api.AuthorizationsApi
api.AuthorizationsAPITokensApi
api.UsersApi
api.OrganizationsApi
api.ResourcesApi

View File

@ -241,7 +241,7 @@ func (c Client) printReplication(opts printReplicationOpts) error {
}
headers := []string{"ID", "Name", "Org ID", "Remote ID", "Local Bucket ID", "Remote Bucket ID", "Remote Bucket Name",
"Current Queue Bytes", "Max Queue Bytes", "Latest Status Code", "Drop Non-Retryable Data"}
"Remaining Bytes to be Synced", "Current Queue Bytes on Disk", "Max Queue Bytes", "Latest Status Code", "Drop Non-Retryable Data"}
if opts.deleted {
headers = append(headers, "Deleted")
}
@ -258,17 +258,18 @@ func (c Client) printReplication(opts printReplicationOpts) error {
bucketID = ""
}
row := map[string]interface{}{
"ID": r.GetId(),
"Name": r.GetName(),
"Org ID": r.GetOrgID(),
"Remote ID": r.GetRemoteID(),
"Local Bucket ID": r.GetLocalBucketID(),
"Remote Bucket ID": bucketID,
"Remote Bucket Name": r.GetRemoteBucketName(),
"Current Queue Bytes": r.GetCurrentQueueSizeBytes(),
"Max Queue Bytes": r.GetMaxQueueSizeBytes(),
"Latest Status Code": r.GetLatestResponseCode(),
"Drop Non-Retryable Data": r.GetDropNonRetryableData(),
"ID": r.GetId(),
"Name": r.GetName(),
"Org ID": r.GetOrgID(),
"Remote ID": r.GetRemoteID(),
"Local Bucket ID": r.GetLocalBucketID(),
"Remote Bucket ID": bucketID,
"Remote Bucket Name": r.GetRemoteBucketName(),
"Remaining Bytes to be Synced": r.GetRemainingBytesToBeSynced(),
"Current Queue Bytes on Disk": r.GetCurrentQueueSizeBytes(),
"Max Queue Bytes": r.GetMaxQueueSizeBytes(),
"Latest Status Code": r.GetLatestResponseCode(),
"Drop Non-Retryable Data": r.GetDropNonRetryableData(),
}
if opts.deleted {
row["Deleted"] = true

View File

@ -139,7 +139,6 @@ func (c Client) Update(ctx context.Context, params *UpdateParams) error {
}
req := api.ScriptUpdateRequest{
Name: &params.Name,
Description: &params.Description,
Script: &params.Script,
}

View File

@ -36,11 +36,10 @@ func (c Client) Delete(ctx context.Context, params *DeleteParams) error {
return err
}
// PostOrgsIDSecrets is used to remove secrets from an organization.
// DeleteOrgsIDSecretsID is used to remove a secret from an organization.
// The name is generated from the operationId in the
// orgs_orgsID_secrets_delete.yml path.
err = c.PostOrgsIDSecrets(ctx, orgID).
SecretKeys(api.SecretKeys{Secrets: &[]string{params.Key}}).
// orgs_orgsID_secrets_secretID.yml path.
err = c.DeleteOrgsIDSecretsID(ctx, orgID, params.Key).
Execute()
if err != nil {
return fmt.Errorf("failed to delete secret with key %q: %w", params.Key, err)

View File

@ -140,11 +140,11 @@ func TestSecret_Delete(t *testing.T) {
},
defaultOrgName: defaultOrgName,
registerExpectations: func(t *testing.T, secretApi *mock.MockSecretsApi) {
req := api.ApiPostOrgsIDSecretsRequest{ApiService: secretApi}.
req := api.ApiDeleteOrgsIDSecretsIDRequest{ApiService: secretApi}.
OrgID(id).
SecretKeys(api.SecretKeys{Secrets: &[]string{"key1"}})
secretApi.EXPECT().PostOrgsIDSecrets(gomock.Any(), gomock.Eq(id)).Return(req)
secretApi.EXPECT().PostOrgsIDSecretsExecute(gomock.Eq(req)).Return(nil)
SecretID("key1")
secretApi.EXPECT().DeleteOrgsIDSecretsID(gomock.Any(), gomock.Eq(id), gomock.Eq("key1")).Return(req)
secretApi.EXPECT().DeleteOrgsIDSecretsIDExecute(gomock.Eq(req)).Return(nil)
},
expectMatcher: printHeader + fakeKey + "\t" + id + "\ttrue\n",
},
@ -159,11 +159,11 @@ func TestSecret_Delete(t *testing.T) {
},
defaultOrgName: defaultOrgName,
registerExpectations: func(t *testing.T, secretApi *mock.MockSecretsApi) {
req := api.ApiPostOrgsIDSecretsRequest{ApiService: secretApi}.
req := api.ApiDeleteOrgsIDSecretsIDRequest{ApiService: secretApi}.
OrgID(id).
SecretKeys(api.SecretKeys{Secrets: &[]string{""}})
secretApi.EXPECT().PostOrgsIDSecrets(gomock.Any(), gomock.Eq(id)).Return(req)
secretApi.EXPECT().PostOrgsIDSecretsExecute(gomock.Eq(req)).Return(nil)
SecretID("")
secretApi.EXPECT().DeleteOrgsIDSecretsID(gomock.Any(), gomock.Eq(id), gomock.Eq("")).Return(req)
secretApi.EXPECT().DeleteOrgsIDSecretsIDExecute(gomock.Eq(req)).Return(nil)
},
expectMatcher: printHeader + "\t" + id + "\ttrue\n",
},

View File

@ -133,11 +133,11 @@ func newCreateCommand() cli.Command {
api := getAPI(ctx)
client := auth.Client{
CLI: getCLI(ctx),
AuthorizationsApi: api.AuthorizationsApi,
UsersApi: api.UsersApi,
OrganizationsApi: api.OrganizationsApi,
ResourcesApi: api.ResourcesApi,
CLI: getCLI(ctx),
AuthorizationsAPITokensApi: api.AuthorizationsAPITokensApi,
UsersApi: api.UsersApi,
OrganizationsApi: api.OrganizationsApi,
ResourcesApi: api.ResourcesApi,
}
return client.Create(getContext(ctx), &params)
},
@ -160,10 +160,10 @@ func newDeleteCommand() cli.Command {
Action: func(ctx *cli.Context) error {
api := getAPI(ctx)
client := auth.Client{
CLI: getCLI(ctx),
AuthorizationsApi: api.AuthorizationsApi,
UsersApi: api.UsersApi,
OrganizationsApi: api.OrganizationsApi,
CLI: getCLI(ctx),
AuthorizationsAPITokensApi: api.AuthorizationsAPITokensApi,
UsersApi: api.UsersApi,
OrganizationsApi: api.OrganizationsApi,
}
return client.Remove(getContext(ctx), ctx.String("id"))
},
@ -202,10 +202,10 @@ func newListCommand() cli.Command {
}
api := getAPI(ctx)
client := auth.Client{
CLI: getCLI(ctx),
AuthorizationsApi: api.AuthorizationsApi,
UsersApi: api.UsersApi,
OrganizationsApi: api.OrganizationsApi,
CLI: getCLI(ctx),
AuthorizationsAPITokensApi: api.AuthorizationsAPITokensApi,
UsersApi: api.UsersApi,
OrganizationsApi: api.OrganizationsApi,
}
return client.List(getContext(ctx), &params)
},
@ -227,10 +227,10 @@ func newSetActiveCommand() cli.Command {
Action: func(ctx *cli.Context) error {
api := getAPI(ctx)
client := auth.Client{
CLI: getCLI(ctx),
AuthorizationsApi: api.AuthorizationsApi,
UsersApi: api.UsersApi,
OrganizationsApi: api.OrganizationsApi,
CLI: getCLI(ctx),
AuthorizationsAPITokensApi: api.AuthorizationsAPITokensApi,
UsersApi: api.UsersApi,
OrganizationsApi: api.OrganizationsApi,
}
return client.SetActive(getContext(ctx), ctx.String("id"), true)
},
@ -252,10 +252,10 @@ func newSetInactiveCommand() cli.Command {
Action: func(ctx *cli.Context) error {
api := getAPI(ctx)
client := auth.Client{
CLI: getCLI(ctx),
AuthorizationsApi: api.AuthorizationsApi,
UsersApi: api.UsersApi,
OrganizationsApi: api.OrganizationsApi,
CLI: getCLI(ctx),
AuthorizationsAPITokensApi: api.AuthorizationsAPITokensApi,
UsersApi: api.UsersApi,
OrganizationsApi: api.OrganizationsApi,
}
return client.SetActive(getContext(ctx), ctx.String("id"), false)
},

View File

@ -164,7 +164,7 @@ func newBucketUpdateCmd() cli.Command {
return cli.Command{
Name: "update",
Usage: "Update bucket",
Aliases: []string{"find", "ls"},
Aliases: []string{"set"},
Before: middleware.WithBeforeFns(withCli(), withApi(true), middleware.NoArgs),
Flags: append(
commonFlags(),

2
go.mod
View File

@ -54,7 +54,7 @@ require (
github.com/stretchr/objx v0.1.1 // indirect
golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e // indirect
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
)

4
go.sum
View File

@ -148,8 +148,8 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 h1:CBpWXWQpIRjzmkkA+M7q9Fqnwd2mZr3AFqexg8YTfoM=

View File

@ -36,6 +36,49 @@ func (m *MockSecretsApi) EXPECT() *MockSecretsApiMockRecorder {
return m.recorder
}
// DeleteOrgsIDSecretsID mocks base method.
func (m *MockSecretsApi) DeleteOrgsIDSecretsID(arg0 context.Context, arg1, arg2 string) api.ApiDeleteOrgsIDSecretsIDRequest {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DeleteOrgsIDSecretsID", arg0, arg1, arg2)
ret0, _ := ret[0].(api.ApiDeleteOrgsIDSecretsIDRequest)
return ret0
}
// DeleteOrgsIDSecretsID indicates an expected call of DeleteOrgsIDSecretsID.
func (mr *MockSecretsApiMockRecorder) DeleteOrgsIDSecretsID(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteOrgsIDSecretsID", reflect.TypeOf((*MockSecretsApi)(nil).DeleteOrgsIDSecretsID), arg0, arg1, arg2)
}
// DeleteOrgsIDSecretsIDExecute mocks base method.
func (m *MockSecretsApi) DeleteOrgsIDSecretsIDExecute(arg0 api.ApiDeleteOrgsIDSecretsIDRequest) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DeleteOrgsIDSecretsIDExecute", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// DeleteOrgsIDSecretsIDExecute indicates an expected call of DeleteOrgsIDSecretsIDExecute.
func (mr *MockSecretsApiMockRecorder) DeleteOrgsIDSecretsIDExecute(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteOrgsIDSecretsIDExecute", reflect.TypeOf((*MockSecretsApi)(nil).DeleteOrgsIDSecretsIDExecute), arg0)
}
// DeleteOrgsIDSecretsIDExecuteWithHttpInfo mocks base method.
func (m *MockSecretsApi) DeleteOrgsIDSecretsIDExecuteWithHttpInfo(arg0 api.ApiDeleteOrgsIDSecretsIDRequest) (*http.Response, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DeleteOrgsIDSecretsIDExecuteWithHttpInfo", arg0)
ret0, _ := ret[0].(*http.Response)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// DeleteOrgsIDSecretsIDExecuteWithHttpInfo indicates an expected call of DeleteOrgsIDSecretsIDExecuteWithHttpInfo.
func (mr *MockSecretsApiMockRecorder) DeleteOrgsIDSecretsIDExecuteWithHttpInfo(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteOrgsIDSecretsIDExecuteWithHttpInfo", reflect.TypeOf((*MockSecretsApi)(nil).DeleteOrgsIDSecretsIDExecuteWithHttpInfo), arg0)
}
// GetOrgsIDSecrets mocks base method.
func (m *MockSecretsApi) GetOrgsIDSecrets(arg0 context.Context, arg1 string) api.ApiGetOrgsIDSecretsRequest {
m.ctrl.T.Helper()

161
scripts/ci/build-packages Executable file
View File

@ -0,0 +1,161 @@
#!/bin/bash
set -o errexit \
-o nounset \
-o pipefail
PKG_BIN_PATH="${1}"
PKG_OUT_PATH="${2}"
# Determine if "${CIRCLE_TAG}" matches the semantic version regex. Otherwise,
# assume that "${CIRCLE_TAG}" is not intended to tag a release. The regex is
# permissive of what occurs after the semantic version. This allows for
# alphas, betas, and release candidates.
if [[ "${CIRCLE_TAG:-}" =~ ^v[0-9]+.[0-9]+.[0-9]+ ]]
then
VERSION="${CIRCLE_TAG/#v/}"
RELEASE=1
else
# When "${CIRCLE_TAG}" cannot be used to construct the package version,
# use "${CIRCLE_SHA1}". Since "${CIRCLE_SHA1}" can start with an alpha
# (non-numeric) character, prefix it with "2.x-".
VERSION="2.x-${CIRCLE_SHA1:0:8}"
fi
build_archive()
{
local workspace="$(mktemp -d)"
cp LICENSE README.md "${PKG_BIN_PATH}" "${workspace}"
pushd "${workspace}"
if [[ ${OS} != windows ]]
then
local target="${PKG_OUT_PATH}/influxdb2-client-${VERSION}_${OS}_${ARCH}.tar.gz"
tar -czf "${target}" .
else
local target="${PKG_OUT_PATH}/influxdb2-client-${VERSION}_${OS}_${ARCH}.zip"
zip -r "${target}" .
fi
# generate signature and checksums
generate_signature "${target}"
generate_checksums "${target}"
popd
}
build_package_linux()
{
local workspace="$(mktemp -d)"
pushd "${workspace}"
mkdir -p fs/usr/bin
# copies binaries into package file system
cp "${PKG_BIN_PATH}" fs/usr/bin
fpm_wrapper deb
fpm_wrapper rpm
popd
}
fpm_wrapper()
{
# "${ARCH}" matches Debian architecture names. Therefore, when building an
# RPM, it needs to be converted into a Redhat architecture name. Currently,
# influxdb-cli only supports "x86_64" and "aarch64".
if [[ "${1}" == rpm ]]
then
case ${ARCH} in
amd64)
ARCH=x86_64
;;
arm64)
ARCH=aarch64
esac
fi
case ${1} in
rpm)
REPLACES='influxdb < 2.1.0'
;;
deb)
REPLACES='influxdb (<< 2.1.0)'
;;
esac
fpm \
--log error \
`# package description` \
--name influxdb2-client \
--vendor InfluxData \
--description 'CLI for managing resources in InfluxDB v2' \
--url https://influxdata.com \
--maintainer support@influxdb.com \
--license MIT \
--replaces "${REPLACES}" \
`# package configuration` \
--input-type dir \
--output-type "${1}" \
--architecture "${ARCH}" \
--version "${VERSION}" \
--iteration 1 \
`# package options` \
--chdir fs/ \
--package "${PKG_OUT_PATH}/"
# `goreleaser` removed the "package revision" from the package filename.
# Since the automation is based on the packages created by `goreleaser`,
# this will also remove the "package revision" to
# maintain compatibility.
case ${1} in
deb)
mv "${PKG_OUT_PATH}/influxdb2-client_${VERSION}-1_${ARCH}.deb" \
"${PKG_OUT_PATH}/influxdb2-client-${VERSION}-${ARCH}.deb"
# generate signature and checksums
generate_signature "${PKG_OUT_PATH}/influxdb2-client-${VERSION}-${ARCH}.deb"
generate_checksums "${PKG_OUT_PATH}/influxdb2-client-${VERSION}-${ARCH}.deb"
;;
rpm)
mv "${PKG_OUT_PATH}/influxdb2-client-${VERSION//-/_}-1.${ARCH}.rpm" \
"${PKG_OUT_PATH}/influxdb2-client-${VERSION//-/_}.${ARCH}.rpm"
# generate signature and checksums
generate_checksums "${PKG_OUT_PATH}/influxdb2-client-${VERSION//-/_}.${ARCH}.rpm"
generate_signature "${PKG_OUT_PATH}/influxdb2-client-${VERSION//-/_}.${ARCH}.rpm"
;;
esac
}
generate_signature()
{
if [[ ( "${SIGN_PACKAGES:-}" ) ]]
then
gpg --passphrase "${PASSPHRASE}" --pinentry-mode=loopback --batch --armor --detach-sign "${1}"
fi
}
generate_checksums()
{
md5sum "${1}" >"${1}.md5"
sha256sum "${1}" >"${1}.sha256"
}
case ${OS} in
linux)
build_archive
build_package_linux
;;
darwin)
build_archive
;;
windows)
build_archive
;;
esac

View File

@ -1,406 +0,0 @@
#!/bin/sh
set -e
################################ NOTE ################################
# To avoid piping a `curl` call into `sh`, this was downloaded from: #
# https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh #
# on May 21, 2021. The only modification made was to append `-<tag>` #
# to the name of the generated binary. #
######################################################################
# Code generated by godownloader on 2019-12-25T12:47:14Z. DO NOT EDIT.
#
usage() {
this=$1
cat <<EOF
$this: download go binaries for goreleaser/goreleaser
Usage: $this [-b] bindir [-d] [tag]
-b sets bindir or installation directory, Defaults to ./bin
-d turns on debug logging
[tag] is a tag from
https://github.com/goreleaser/goreleaser/releases
If tag is missing, then the latest will be used.
Generated by godownloader
https://github.com/goreleaser/godownloader
EOF
exit 2
}
parse_args() {
#BINDIR is ./bin unless set be ENV
# over-ridden by flag below
BINDIR=${BINDIR:-./bin}
while getopts "b:dh?x" arg; do
case "$arg" in
b) BINDIR="$OPTARG" ;;
d) log_set_priority 10 ;;
h | \?) usage "$0" ;;
x) set -x ;;
esac
done
shift $((OPTIND - 1))
TAG=$1
}
# this function wraps all the destructive operations
# if a curl|bash cuts off the end of the script due to
# network, either nothing will happen or will syntax error
# out preventing half-done work
execute() {
tmpdir=$(mktemp -d)
log_debug "downloading files into ${tmpdir}"
http_download "${tmpdir}/${TARBALL}" "${TARBALL_URL}"
http_download "${tmpdir}/${CHECKSUM}" "${CHECKSUM_URL}"
hash_sha256_verify "${tmpdir}/${TARBALL}" "${tmpdir}/${CHECKSUM}"
srcdir="${tmpdir}"
(cd "${tmpdir}" && untar "${TARBALL}")
test ! -d "${BINDIR}" && install -d "${BINDIR}"
for binexe in $BINARIES; do
if [ "$OS" = "windows" ]; then
binexe="${binexe}.exe"
fi
install "${srcdir}/${binexe}" "${BINDIR}/${binexe}"
log_info "installed ${BINDIR}/${binexe}"
done
rm -rf "${tmpdir}"
}
get_binaries() {
case "$PLATFORM" in
darwin/386) BINARIES="goreleaser" ;;
darwin/amd64) BINARIES="goreleaser" ;;
darwin/arm64) BINARIES="goreleaser" ;;
darwin/armv6) BINARIES="goreleaser" ;;
linux/386) BINARIES="goreleaser" ;;
linux/amd64) BINARIES="goreleaser" ;;
linux/arm64) BINARIES="goreleaser" ;;
linux/armv6) BINARIES="goreleaser" ;;
windows/386) BINARIES="goreleaser" ;;
windows/amd64) BINARIES="goreleaser" ;;
windows/arm64) BINARIES="goreleaser" ;;
windows/armv6) BINARIES="goreleaser" ;;
*)
log_crit "platform $PLATFORM is not supported. Make sure this script is up-to-date and file request at https://github.com/${PREFIX}/issues/new"
exit 1
;;
esac
}
tag_to_version() {
if [ -z "${TAG}" ]; then
log_info "checking GitHub for latest tag"
else
log_info "checking GitHub for tag '${TAG}'"
fi
REALTAG=$(github_release "$OWNER/$REPO" "${TAG}") && true
if test -z "$REALTAG"; then
log_crit "unable to find '${TAG}' - use 'latest' or see https://github.com/${PREFIX}/releases for details"
exit 1
fi
# if version starts with 'v', remove it
TAG="$REALTAG"
VERSION=${TAG#v}
}
adjust_format() {
# change format (tar.gz or zip) based on OS
case ${OS} in
windows) FORMAT=zip ;;
esac
true
}
adjust_os() {
# adjust archive name based on OS
case ${OS} in
386) OS=i386 ;;
amd64) OS=x86_64 ;;
darwin) OS=Darwin ;;
linux) OS=Linux ;;
windows) OS=Windows ;;
esac
true
}
adjust_arch() {
# adjust archive name based on ARCH
case ${ARCH} in
386) ARCH=i386 ;;
amd64) ARCH=x86_64 ;;
darwin) ARCH=Darwin ;;
linux) ARCH=Linux ;;
windows) ARCH=Windows ;;
esac
true
}
cat /dev/null <<EOF
------------------------------------------------------------------------
https://github.com/client9/shlib - portable posix shell functions
Public domain - http://unlicense.org
https://github.com/client9/shlib/blob/master/LICENSE.md
but credit (and pull requests) appreciated.
------------------------------------------------------------------------
EOF
is_command() {
command -v "$1" >/dev/null
}
echoerr() {
echo "$@" 1>&2
}
log_prefix() {
echo "$0"
}
_logp=6
log_set_priority() {
_logp="$1"
}
log_priority() {
if test -z "$1"; then
echo "$_logp"
return
fi
[ "$1" -le "$_logp" ]
}
log_tag() {
case $1 in
0) echo "emerg" ;;
1) echo "alert" ;;
2) echo "crit" ;;
3) echo "err" ;;
4) echo "warning" ;;
5) echo "notice" ;;
6) echo "info" ;;
7) echo "debug" ;;
*) echo "$1" ;;
esac
}
log_debug() {
log_priority 7 || return 0
echoerr "$(log_prefix)" "$(log_tag 7)" "$@"
}
log_info() {
log_priority 6 || return 0
echoerr "$(log_prefix)" "$(log_tag 6)" "$@"
}
log_err() {
log_priority 3 || return 0
echoerr "$(log_prefix)" "$(log_tag 3)" "$@"
}
log_crit() {
log_priority 2 || return 0
echoerr "$(log_prefix)" "$(log_tag 2)" "$@"
}
uname_os() {
os=$(uname -s | tr '[:upper:]' '[:lower:]')
case "$os" in
cygwin_nt*) os="windows" ;;
mingw*) os="windows" ;;
msys_nt*) os="windows" ;;
esac
echo "$os"
}
uname_arch() {
arch=$(uname -m)
case $arch in
x86_64) arch="amd64" ;;
x86) arch="386" ;;
i686) arch="386" ;;
i386) arch="386" ;;
aarch64) arch="arm64" ;;
armv5*) arch="armv5" ;;
armv6*) arch="armv6" ;;
armv7*) arch="armv7" ;;
esac
echo ${arch}
}
uname_os_check() {
os=$(uname_os)
case "$os" in
darwin) return 0 ;;
dragonfly) return 0 ;;
freebsd) return 0 ;;
linux) return 0 ;;
android) return 0 ;;
nacl) return 0 ;;
netbsd) return 0 ;;
openbsd) return 0 ;;
plan9) return 0 ;;
solaris) return 0 ;;
windows) return 0 ;;
esac
log_crit "uname_os_check '$(uname -s)' got converted to '$os' which is not a GOOS value. Please file bug at https://github.com/client9/shlib"
return 1
}
uname_arch_check() {
arch=$(uname_arch)
case "$arch" in
386) return 0 ;;
amd64) return 0 ;;
arm64) return 0 ;;
armv5) return 0 ;;
armv6) return 0 ;;
armv7) return 0 ;;
ppc64) return 0 ;;
ppc64le) return 0 ;;
mips) return 0 ;;
mipsle) return 0 ;;
mips64) return 0 ;;
mips64le) return 0 ;;
s390x) return 0 ;;
amd64p32) return 0 ;;
esac
log_crit "uname_arch_check '$(uname -m)' got converted to '$arch' which is not a GOARCH value. Please file bug report at https://github.com/client9/shlib"
return 1
}
untar() {
tarball=$1
case "${tarball}" in
*.tar.gz | *.tgz) tar --no-same-owner -xzf "${tarball}" ;;
*.tar) tar --no-same-owner -xf "${tarball}" ;;
*.zip) unzip "${tarball}" ;;
*)
log_err "untar unknown archive format for ${tarball}"
return 1
;;
esac
}
http_download_curl() {
local_file=$1
source_url=$2
header=$3
if [ -z "$header" ]; then
code=$(curl -w '%{http_code}' -sL -o "$local_file" "$source_url")
else
code=$(curl -w '%{http_code}' -sL -H "$header" -o "$local_file" "$source_url")
fi
if [ "$code" != "200" ]; then
log_debug "http_download_curl received HTTP status $code"
return 1
fi
return 0
}
http_download_wget() {
local_file=$1
source_url=$2
header=$3
if [ -z "$header" ]; then
wget -q -O "$local_file" "$source_url"
else
wget -q --header "$header" -O "$local_file" "$source_url"
fi
}
http_download() {
log_debug "http_download $2"
if is_command curl; then
http_download_curl "$@"
return
elif is_command wget; then
http_download_wget "$@"
return
fi
log_crit "http_download unable to find wget or curl"
return 1
}
http_copy() {
tmp=$(mktemp)
http_download "${tmp}" "$1" "$2" || return 1
body=$(cat "$tmp")
rm -f "${tmp}"
echo "$body"
}
github_release() {
owner_repo=$1
version=$2
test -z "$version" && version="latest"
giturl="https://github.com/${owner_repo}/releases/${version}"
json=$(http_copy "$giturl" "Accept:application/json")
test -z "$json" && return 1
version=$(echo "$json" | tr -s '\n' ' ' | sed 's/.*"tag_name":"//' | sed 's/".*//')
test -z "$version" && return 1
echo "$version"
}
hash_sha256() {
TARGET=${1:-/dev/stdin}
if is_command gsha256sum; then
hash=$(gsha256sum "$TARGET") || return 1
echo "$hash" | cut -d ' ' -f 1
elif is_command sha256sum; then
hash=$(sha256sum "$TARGET") || return 1
echo "$hash" | cut -d ' ' -f 1
elif is_command shasum; then
hash=$(shasum -a 256 "$TARGET" 2>/dev/null) || return 1
echo "$hash" | cut -d ' ' -f 1
elif is_command openssl; then
hash=$(openssl -dst openssl dgst -sha256 "$TARGET") || return 1
echo "$hash" | cut -d ' ' -f a
else
log_crit "hash_sha256 unable to find command to compute sha-256 hash"
return 1
fi
}
hash_sha256_verify() {
TARGET=$1
checksums=$2
if [ -z "$checksums" ]; then
log_err "hash_sha256_verify checksum file not specified in arg2"
return 1
fi
BASENAME=${TARGET##*/}
want=$(grep "${BASENAME}" "${checksums}" 2>/dev/null | tr '\t' ' ' | cut -d ' ' -f 1)
if [ -z "$want" ]; then
log_err "hash_sha256_verify unable to find checksum for '${TARGET}' in '${checksums}'"
return 1
fi
got=$(hash_sha256 "$TARGET")
if [ "$want" != "$got" ]; then
log_err "hash_sha256_verify checksum for '$TARGET' did not verify ${want} vs $got"
return 1
fi
}
cat /dev/null <<EOF
------------------------------------------------------------------------
End of functions from https://github.com/client9/shlib
------------------------------------------------------------------------
EOF
PROJECT_NAME="goreleaser"
OWNER=goreleaser
REPO="goreleaser"
BINARY=goreleaser
FORMAT=tar.gz
OS=$(uname_os)
ARCH=$(uname_arch)
PREFIX="$OWNER/$REPO"
# use in logging routines
log_prefix() {
echo "$PREFIX"
}
PLATFORM="${OS}/${ARCH}"
GITHUB_DOWNLOAD=https://github.com/${OWNER}/${REPO}/releases/download
uname_os_check "$OS"
uname_arch_check "$ARCH"
parse_args "$@"
get_binaries
tag_to_version
adjust_format
adjust_os
adjust_arch
log_info "found version: ${VERSION} for ${TAG}/${OS}/${ARCH}"
NAME=${PROJECT_NAME}_${OS}_${ARCH}
TARBALL=${NAME}.${FORMAT}
TARBALL_URL=${GITHUB_DOWNLOAD}/${TAG}/${TARBALL}
CHECKSUM=${PROJECT_NAME}_checksums.txt
CHECKSUM_URL=${GITHUB_DOWNLOAD}/${TAG}/${CHECKSUM}
execute

View File

@ -1,22 +1,22 @@
#!/usr/bin/env bash
set -eo pipefail
declare -r GO_VERSION=1.18.3
declare -r GO_VERSION=1.19.6
# Hashes are from the table at https://golang.org/dl/
function go_hash () {
case $1 in
linux_amd64)
echo 956f8507b302ab0bb747613695cdae10af99bbd39a90cae522b7c0302cc27245
echo e3410c676ced327aec928303fef11385702a5562fd19d9a1750d5a2979763c3d
;;
linux_arm64)
echo beacbe1441bee4d7978b900136d1d6a71d150f0a9bb77e9d50c822065623a35a
echo e4d63c933a68e5fad07cab9d12c5c1610ce4810832d47c44314c3246f511ac4f
;;
mac)
echo a23a24c5528671d444328a36a98056902f699a5a211b6ad5db29ca0c012e0085
echo 63386d51c69cef6c001ff0436832289635ba4a2649282451a18827e93507b444
;;
windows)
echo 9c46023f3ad0300fcfd1e62f2b6c2dfd9667b1f2f5c7a720b14b792af831f071
echo 8d84af29e46c38b1eec77f9310310517c9e394ac7489e1c7329a94b443b0388d
;;
esac
}

17
support.mk Normal file
View File

@ -0,0 +1,17 @@
# Add quotes to a string and escape any internal quotes.
# $(call with-quotes,alice bob) -> "alice bob"
# $(call with-quotes,) -> ""
# $(call with-quotes,Bobby "Drop Tables") -> "Bobby \"Drop Tables\""
define with-quotes
$(if $(1),"$(subst ",\",$(1))")
endef
# Generate a command line option in the form $(1)"$(2)", but only if $(2)
# is not empty.
# $(call with-param,-t=,) ->
# $(call with-param,-t=,Ralph Wiggum) -> -t="Ralph Wiggum"
# $(call with-param,-t=,Bobby "Drop Tables") -> -t="Bobby \"Drop Tables\""
define with-param
$(if $(2),$(1)$(call with-quotes,$(2)))
endef