fix(api): Update HTTP API landing page in Dedicated

- Adds a custom short title field in OpenAPI info.
- Uses the new field for nav menu item names.
- Adds identifiers to avoid duplicate name warnings.
- Cleans up variation in frontmatter.
pull/5432/head
Jason Stirnaman 2024-04-16 16:29:27 -05:00
parent e8e16641e4
commit 3d08263f38
12 changed files with 27 additions and 10 deletions

View File

@ -1,4 +1,5 @@
title: InfluxDB Cloud Dedicated Management API
x-influxdata-short-title: Management API
summary: |
The Management API for InfluxDB Cloud Dedicated provides a programmatic interface for managing an InfluxDB Cloud Dedicated instance.
description: |

View File

@ -1,4 +1,5 @@
title: InfluxDB v1 HTTP API for InfluxDB Cloud Dedicated
x-influxdata-short-title: v1 Compatibility API
summary: The InfluxDB v1 HTTP API provides v1 compatibility for writing and querying data in an InfluxDB v3 Cloud Dedicated database.
description: |
The InfluxDB 1.x `/write` and `/query` endpoints work with InfluxDB 1.x client libraries and third-party integrations like Grafana and others.

View File

@ -1,4 +1,5 @@
title: InfluxDB v2 HTTP API for InfluxDB Cloud Dedicated
x-influxdata-short-title: v2 API
summary: The InfluxDB v2 HTTP API for InfluxDB Cloud Dedicated provides a v2-compatible programmatic interface for writing data stored in an InfluxDB Cloud Dedicated database.
description: |

View File

@ -1,4 +1,5 @@
title: InfluxDB v1 HTTP API for InfluxDB Cloud Serverless
x-influxdata-short-title: v1 Compatibility API
summary: The InfluxDB v1 HTTP API provides v1 compatibility for writing and querying data in an InfluxDB v3 Cloud Serverless bucket.
description: |
The InfluxDB 1.x `/write` and `/query` endpoints work with InfluxDB 1.x client libraries and third-party integrations like Grafana and others.

View File

@ -1,4 +1,5 @@
title: InfluxDB Cloud Serverless API Service
x-influxdata-short-title: v2 API
summary: |
The InfluxDB v2 HTTP API for InfluxDB Cloud Serverless provides a programmatic interface for writing data stored in an InfluxDB Cloud Serverless bucket.
description: |

View File

@ -1,4 +1,5 @@
title: InfluxDB v1 HTTP API for InfluxDB Cloud
x-influxdata-short-title: v1 Compatibility API
summary: The InfluxDB v1 compatibility API provides a programmatic interface for interactions with InfluxDB Cloud using InfluxDB v1-compatible endpoints.
description: |
The InfluxDB 1.x compatibility /write and /query endpoints work with InfluxDB 1.x client libraries and third-party integrations like Grafana and others.

View File

@ -1,4 +1,5 @@
title: InfluxDB Cloud API Service
x-influxdata-short-title: v2 API
summary: The InfluxDB v2 HTTP API provides a programmatic interface for all interactions with InfluxDB v2.
description: |
The InfluxDB v2 HTTP API provides a programmatic interface for all interactions with InfluxDB v2. Access the InfluxDB API using `/api/v2/` and InfluxDB v1-compatible endpoints.

View File

@ -1,4 +1,5 @@
title: InfluxDB v1 HTTP API for InfluxDB Clustered
x-influxdata-short-title: v1 Compatibility API
summary: The InfluxDB v1 HTTP API provides v1 compatibility for writing and querying data in an InfluxDB v3 Clustered database.
description: |
The InfluxDB 1.x `/write` and `/query` endpoints work with InfluxDB 1.x client libraries and third-party integrations like Grafana and others.

View File

@ -1,4 +1,5 @@
title: InfluxDB Clustered API Service
x-influxdata-short-title: v2 API
summary: The InfluxDB v2 HTTP API for InfluxDB Clustered provides a v2-compatible programmatic interface for writing data stored in an InfluxDB Clustered database.
description: |
The InfluxDB v2 HTTP API lets you use `/api/v2` endpoints for managing retention policy mappings and writing data stored in an InfluxDB v3 instance.

View File

@ -47,13 +47,11 @@ function generateHtml {
menu="influxdb_$(echo $product | sed 's/\./_/g;s/-/_/g;')"
# Extract the API name--for example, "management" from "management@v2".
apiName=$(echo $api | sed 's/@.*//g;')
# Convert it to title case--for example, "Management".
apiTitle=$(echo $apiName \
| awk '{print toupper(substr($1,1,1)) tolower(substr($1,2))}')
# Extract the API version--for example, "v0" from "management@v0".
version=$(echo $api | sed 's/.*@//g;')
# Use the title and summary defined in the product API's info.yml file.
title=$(yq '.title' $product/$apiName/content/info.yml)
menuTitle=$(yq '.x-influxdata-short-title' $product/$apiName/content/info.yml)
description=$(yq '.summary' $product/$apiName/content/info.yml)
# Define the file name for the Redoc HTML output.
specbundle=redoc-static_index.html
@ -80,16 +78,19 @@ function generateHtml {
--templateOptions.product="$product" \
--templateOptions.productName="$productName"
if [[ $version == "v1" ]]; then
if [[ $apiName == "v1-compatibility" ]]; then
frontmatter="---
title: $title
description: $description
layout: api
menu:
$menu:
parent: $version compatibility
name: View $version compatibility API
parent: InfluxDB HTTP API
name: $menuTitle
identifier: api-reference-$apiName
weight: 304
aliases:
- /influxdb/$product/api/v1/
---
"
elif [[ $version == "0" ]]; then
@ -102,7 +103,8 @@ weight: 102
menu:
$menu:
parent: InfluxDB HTTP API
name: Management API
name: $menuTitle
identifier: api-reference-$apiName
---
"
elif [[ $isDefault == true ]]; then
@ -113,7 +115,8 @@ layout: api
menu:
$menu:
parent: InfluxDB HTTP API
name: $apiTitle API
name: $menuTitle
identifier: api-reference-$apiName
weight: 102
aliases:
- /influxdb/$product/api/
@ -127,7 +130,8 @@ layout: api
menu:
$menu:
parent: InfluxDB HTTP API
name: $apiTitle API
name: $menuTitle
identifier: api-reference-$apiName
weight: 102
---
"
@ -156,6 +160,8 @@ weight: 102
fi
}
# Use a combination of directory names and configuration files to build the API documentation.
# Each directory represents a product, and each product directory contains a configuration file that defines APIs and their spec file locations.
function build {
# Get the list of products from directory names
products="$(ls -d -- */ | grep -v 'node_modules' | grep -v 'openapi')"

View File

@ -1,4 +1,5 @@
title: InfluxDB OSS API Service
x-influxdata-short-title: v2 API
summary: The InfluxDB v2 HTTP API provides a programmatic interface for all interactions with an InfluxDB v2 instance.
description: |
The InfluxDB v2 HTTP API provides a programmatic interface for all interactions with an InfluxDB v2 instance. Access the InfluxDB API using `/api/v2/` and InfluxDB v1-compatible endpoints.

View File

@ -1,7 +1,8 @@
title: InfluxDB v1 HTTP API for InfluxDB v2 OSS
x-influxdata-short-title: v1 Compatibility API
summary: The InfluxDB v1 compatibility API provides a programmatic interface for interactions with InfluxDB v2 using InfluxDB v1-compatible endpoints.
description: |
The InfluxDB 1.x compatibility /write and /query endpoints work with InfluxDB 1.x client libraries and third-party integrations like Grafana and others.
The InfluxDB 1.x compatibility `/write` and `/query` endpoints work with InfluxDB 1.x client libraries and third-party integrations like Grafana and others.
This documentation is generated from the
[InfluxDB OpenAPI specification](https://raw.githubusercontent.com/influxdata/openapi/master/contracts/swaggerV1Compat.yml).