docs-v2/api-docs
Jason Stirnaman 6587ee1fdc
Document new API Invocable Scripts feature (was named-functions) (#3282)
* feat: add api-guides/guides and guides/api-invocable-scripts for the API-invocable scripts (managed functions) feature (##2547, #2233).

* feat: document API-invocable scripts. Add example for creating and invoking a script with POST. Unable to make GET work with query parameters.

* feat: moved API-invocable scripts under api-guide. Remove guides directory. Add docs for list and find. Add example for list. Add shortcuts and glossary links. Verified with team-compute that GET /invoke and python are not supported yet.

* feat: rename example function for simplicity since there's no GET for now.

* feat: add find_and_update example (#2547).

* feat: add update example. Clarify, expand invoke example. Add links. (#2547)

* Update content/influxdb/cloud/api-guide/api-invocable-scripts/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* fix: remove accidental commit of generated redoc-static.html

* feat: manual update to cloud swagger. Merges meta, auth, tags, and x-tagGroups from src/cloud.yml to aggregate contracts/ref/cloud.yml.

* fix: replace /functions with /scripts

* feat: get swaggers from contracts/ref. Still requires copy-paste of info, tags, and auth from contracts/cloud.yml and contracts/oss.yml

* feat: invocable scripts (#2547)

* Update content/influxdb/cloud/api-guide/api-invocable-scripts/_index.md

Co-authored-by: pierwill <19642016+pierwill@users.noreply.github.com>

* feat: new section for params (#2547).

* fix: swagger server url (#2547)

* Update content/influxdb/cloud/api-guide/api-invocable-scripts/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* feat: remove jq and function where there's no clear need.

Co-authored-by: pierwill <19642016+pierwill@users.noreply.github.com>
2021-10-25 08:30:31 -05:00
..
cloud Document new API Invocable Scripts feature (was named-functions) (#3282) 2021-10-25 08:30:31 -05:00
plugins Add InfluxDB 2.0.9 release notes and new influxd flux-log-enabled option (#3170) 2021-10-11 14:15:39 -07:00
v2.0 Document new API Invocable Scripts feature (was named-functions) (#3282) 2021-10-25 08:30:31 -05:00
.redocly.yaml Add InfluxDB 2.0.9 release notes and new influxd flux-log-enabled option (#3170) 2021-10-11 14:15:39 -07:00
README.md Add InfluxDB 2.0.9 release notes and new influxd flux-log-enabled option (#3170) 2021-10-11 14:15:39 -07:00
generate-api-docs.sh Add InfluxDB 2.0.9 release notes and new influxd flux-log-enabled option (#3170) 2021-10-11 14:15:39 -07:00
getswagger.sh Document new API Invocable Scripts feature (was named-functions) (#3282) 2021-10-25 08:30:31 -05:00
package.json Fix api docs dependencies (#3229) 2021-10-07 14:21:05 -05:00
template.hbs Install dependencies as project dependencies from NPM repo (#2476) 2021-05-24 12:11:01 -05:00
yarn.lock Add InfluxDB 2.0.9 release notes and new influxd flux-log-enabled option (#3170) 2021-10-11 14:15:39 -07:00

README.md

Generate InfluxDB API docs

InfluxDB uses Redoc, redoc-cli, and Redocly's OpenApi CLI to generate API documentation from the InfluxDB swagger.yml.

To minimize repo size, the generated API documentation HTML is gitignored, therefore not committed directly to the docs repo. The InfluxDB docs deployment process uses swagger files in the api-docs directory to generate version-specific API documentation.

Versioned swagger files

The structure versions swagger files using the following pattern:

  │     └── swagger.yml
  └── etc...

OpenAPI CLI configuration

.redoc.yaml sets linting and bundling options for openapi CLI. ./plugins contains custom OpenAPI CLI plugins composed of rules (for linting) and decorators (for bundle customization). api-docs/ ├── v2.0/ │ └── swagger.yml ├── v2.1/ │ └── swagger.yml ├── v2.2/ openapi CLI requires that modules use CommonJS require syntax for imports.

Generate API docs locally

Because the API documentation HTML is gitignored, you must manually generate it to view the API docs locally.

Verify that you have a working npx (it's included with Node.js). In your terminal, run:

npx --version

If npx returns errors, download and run a recent version of the Node.js installer for your OS.

In your terminal, from the root of the docs repo, run:

cd api-docs

# Generate the API docs
sh generate-api-docs.sh