Skip to content

Commit 4887aa5

Browse files
committed
fix(api): links and headings in local API refs.
- Fix broken links reported by the e2e link checker. - Add an e2e test for checking internal and external links in API reference docs. Low effort, big win.
1 parent b9de8b4 commit 4887aa5

File tree

9 files changed

+364
-485
lines changed

9 files changed

+364
-485
lines changed

api-docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ InfluxDB Cloud releases are frequent and not versioned, so the Cloud API spec is
237237
We regenerate API reference docs from `influxdata/openapi`
238238
**master** branch as features are released.
239239
240-
### InfluxDB OSS version
240+
### InfluxDB OSS v2 version
241241
242242
Given that
243243
`influxdata/openapi` **master** may contain OSS spec changes not implemented

api-docs/influxdb/cloud/v2/ref.yml

Lines changed: 48 additions & 55 deletions
Large diffs are not rendered by default.

api-docs/influxdb/v2/v2/ref.yml

Lines changed: 289 additions & 292 deletions
Large diffs are not rendered by default.

api-docs/influxdb3/cloud-dedicated/v2/ref.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2143,7 +2143,6 @@ x-tagGroups:
21432143
- Headers
21442144
- Pagination
21452145
- Response codes
2146-
- System information endpoints
21472146
- name: All endpoints
21482147
tags:
21492148
- Ping

api-docs/influxdb3/cloud-serverless/v2/ref.yml

Lines changed: 5 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ tags:
126126
|:------------------------ |:--------------------- |:-------------------------------------------|
127127
| `bucket` | string | The bucket name or ID ([find your bucket](/influxdb3/cloud-serverless/admin/buckets/view-buckets/). |
128128
| `bucketID` | string | The bucket ID ([find your bucket](/influxdb3/cloud-serverless/admin/buckets/view-buckets/). |
129-
| `org` | string | The organization name or ID ([find your organization](/influxdb3/cloud-serverless/organizations/view-orgs/). |
130-
| `orgID` | 16-byte string | The organization ID ([find your organization](/influxdb3/cloud-serverless/organizations/view-orgs/). |
129+
| `org` | string | The organization name or ID ([find your organization](/influxdb3/cloud-serverless/admin/organizations/view-orgs/). |
130+
| `orgID` | 16-byte string | The organization ID ([find your organization](/influxdb3/cloud-serverless/admin/organizations/view-orgs/). |
131131
name: Common parameters
132132
x-traitTag: true
133133
- name: Config
@@ -443,11 +443,6 @@ paths:
443443
Specifies an authorization by its `token` property value
444444
and returns the authorization.
445445
446-
#### InfluxDB OSS
447-
448-
- Doesn't support this parameter. InfluxDB OSS ignores the `token=` parameter,
449-
applies other parameters, and then returns the result.
450-
451446
#### Limitations
452447
453448
- The parameter is non-repeatable. If you specify more than one,
@@ -469,13 +464,6 @@ paths:
469464
If the response body is missing authorizations that you expect, check that the API
470465
token used in the request has `read-user` permission for the users (`userID` property value)
471466
in those authorizations.
472-
473-
#### InfluxDB OSS
474-
475-
- **Warning**: The response body contains authorizations with their
476-
[API token](/influxdb3/cloud-serverless/reference/glossary/#token) values in clear text.
477-
- If the request uses an _[operator token](/influxdb/latest/security/tokens/#operator-token)_,
478-
InfluxDB OSS returns authorizations for all organizations in the instance.
479467
'400':
480468
$ref: '#/components/responses/GeneralServerError'
481469
description: Invalid request
@@ -625,14 +613,6 @@ paths:
625613
626614
Use this endpoint to retrieve information about an API token, including
627615
the token's permissions and the user that the token is scoped to.
628-
629-
#### InfluxDB OSS
630-
631-
- InfluxDB OSS returns
632-
[API token](/influxdb3/cloud-serverless/reference/glossary/#token) values in authorizations.
633-
- If the request uses an _[operator token](/influxdb/latest/security/tokens/#operator-token)_,
634-
InfluxDB OSS returns authorizations for all organizations in the instance.
635-
636616
#### Related guides
637617
638618
- [View tokens](/influxdb3/cloud-serverless/security/tokens/view-tokens/)
@@ -740,14 +720,6 @@ paths:
740720
If no query parameters are passed, InfluxDB returns all buckets up to the
741721
default `limit`.
742722
743-
#### InfluxDB OSS
744-
745-
- If you use an _[operator token](/influxdb3/cloud-serverless/security/tokens/#operator-token)_
746-
to authenticate your request, InfluxDB retrieves resources for _all
747-
organizations_ in the instance.
748-
To retrieve resources for only a specific organization, use the
749-
`org` parameter or the `orgID` parameter to specify the organization.
750-
751723
#### Required permissions
752724
753725
| Action | Permission required |
@@ -863,13 +835,6 @@ paths:
863835
[retention period](/influxdb3/cloud-serverless/reference/glossary/#retention-period)
864836
is 30 days.
865837
866-
#### InfluxDB OSS
867-
868-
- A single InfluxDB OSS instance supports active writes or queries for
869-
approximately 20 buckets across all organizations at a given time.
870-
Reading or writing to more than 20 buckets at a time can adversely affect
871-
performance.
872-
873838
#### Limitations
874839
875840
- InfluxDB Cloud Free Plan allows users to create up to two buckets.
@@ -2855,10 +2820,6 @@ paths:
28552820
description: |
28562821
Bad request.
28572822
The response body contains detail about the error.
2858-
2859-
#### InfluxDB OSS
2860-
2861-
- Returns this error if the `org` parameter or `orgID` parameter doesn't match an organization.
28622823
'401':
28632824
$ref: '#/components/responses/AuthorizationError'
28642825
'404':
@@ -2910,7 +2871,7 @@ paths:
29102871
29112872
#### Related guides
29122873
2913-
- [View organizations](/influxdb3/cloud-serverless/organizations/view-orgs/)
2874+
- [View organizations](/influxdb3/cloud-serverless/admin/organizations/view-orgs/)
29142875
operationId: GetOrgs
29152876
parameters:
29162877
- $ref: '#/components/parameters/TraceSpan'
@@ -3075,11 +3036,6 @@ paths:
30753036
2. Returns an HTTP `204` status code if queued; _error_ otherwise.
30763037
3. Handles the delete asynchronously.
30773038
3078-
#### InfluxDB OSS
3079-
3080-
- Validates the request, handles the delete synchronously,
3081-
and then responds with success or failure.
3082-
30833039
#### Limitations
30843040
30853041
- Only one organization can be deleted per request.
@@ -3104,9 +3060,6 @@ paths:
31043060
31053061
#### InfluxDB Cloud
31063062
- The organization is queued for deletion.
3107-
3108-
#### InfluxDB OSS
3109-
- The organization is deleted.
31103063
'400':
31113064
$ref: '#/components/responses/BadRequestError'
31123065
'401':
@@ -3145,7 +3098,7 @@ paths:
31453098
31463099
#### Related guides
31473100
3148-
- [View organizations](/influxdb3/cloud-serverless/organizations/view-orgs/)
3101+
- [View organizations](/influxdb3/cloud-serverless/admin/organizations/view-orgs/)
31493102
operationId: GetOrgsID
31503103
parameters:
31513104
- $ref: '#/components/parameters/TraceSpan'
@@ -3909,10 +3862,6 @@ paths:
39093862
description: |
39103863
Bad request.
39113864
The response body contains detail about the error.
3912-
3913-
#### InfluxDB OSS
3914-
3915-
- Returns this error if the `org` parameter or `orgID` parameter doesn't match an organization.
39163865
'401':
39173866
$ref: '#/components/responses/AuthorizationError'
39183867
'404':
@@ -4894,10 +4843,6 @@ paths:
48944843
description: |
48954844
Bad request.
48964845
The response body contains detail about the error.
4897-
4898-
#### InfluxDB OSS
4899-
4900-
- Returns this error if an incorrect value is passed in the `org` parameter or `orgID` parameter.
49014846
'401':
49024847
$ref: '#/components/responses/AuthorizationError'
49034848
'500':
@@ -6234,10 +6179,6 @@ paths:
62346179
#### InfluxDB Cloud
62356180
62366181
- Always returns this error; doesn't support cancelling tasks.
6237-
6238-
#### InfluxDB OSS
6239-
6240-
- Doesn't return this error.
62416182
'500':
62426183
$ref: '#/components/responses/InternalServerError'
62436184
default:
@@ -8233,10 +8174,6 @@ components:
82338174
description: |
82348175
Bad request.
82358176
The response body contains detail about the error.
8236-
8237-
#### InfluxDB OSS
8238-
8239-
- Returns this error if an incorrect value is passed in the `org` parameter or `orgID` parameter.
82408177
GeneralServerError:
82418178
content:
82428179
application/json:
@@ -11681,10 +11618,6 @@ components:
1168111618
1168211619
- Doesn't use `shardGroupDurationsSeconds`.
1168311620
11684-
#### InfluxDB OSS
11685-
11686-
- Default value depends on the [bucket retention period](/influxdb3/cloud-serverless/reference/internals/shards/#shard-group-duration).
11687-
1168811621
#### Related guides
1168911622
1169011623
- InfluxDB [shards and shard groups](/influxdb3/cloud-serverless/reference/internals/shards/)
@@ -12132,10 +12065,6 @@ components:
1213212065
#### InfluxDB 3 Cloud Serverless
1213312066
1213412067
- `retentionRules` is required.
12135-
12136-
#### InfluxDB OSS
12137-
12138-
- `retentionRules` isn't required.
1213912068
items:
1214012069
$ref: '#/components/schemas/RetentionRule'
1214112070
type: array
@@ -13400,7 +13329,7 @@ components:
1340013329
The organization owns all resources created by the template.
1340113330
1340213331
To find your organization, see how to
13403-
[view organizations](/influxdb3/cloud-serverless/organizations/view-orgs/).
13332+
[view organizations](/influxdb3/cloud-serverless/admin/organizations/view-orgs/).
1340413333
type: string
1340513334
remotes:
1340613335
description: |
@@ -14817,9 +14746,6 @@ x-tagGroups:
1481714746
- Headers
1481814747
- Pagination
1481914748
- Response codes
14820-
- Data I/O endpoints
14821-
- Security and access endpoints
14822-
- System information endpoints
1482314749
- name: All endpoints
1482414750
tags:
1482514751
- Authorizations (API tokens)

api-docs/influxdb3/clustered/v2/ref.yml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -417,16 +417,6 @@ paths:
417417
'429':
418418
description: |
419419
Too many requests.
420-
421-
#### InfluxDB Cloud
422-
423-
- Returns this error if a **read** or **write** request exceeds your plan's [adjustable service quotas](/influxdb3/clustered/account-management/limits/#adjustable-service-quotas)
424-
or if a **delete** request exceeds the maximum [global limit](/influxdb3/clustered/account-management/limits/#global-limits).
425-
- For rate limits that reset automatically, returns a `Retry-After` header that describes when to try the write again.
426-
- For limits that can't reset (for example, **cardinality limit**), doesn't return a `Retry-After` header.
427-
428-
Rates (data-in (writes), queries (reads), and deletes) accrue within a fixed five-minute window.
429-
Once a rate limit is exceeded, InfluxDB returns an error response until the current five-minute window resets.
430420
headers:
431421
Retry-After:
432422
description: Non-negative decimal integer indicating seconds to wait before retrying the request.
@@ -578,12 +568,7 @@ paths:
578568
type: string
579569
'429':
580570
description: |
581-
#### InfluxDB Cloud:
582-
- returns this error if a **read** or **write** request exceeds your
583-
plan's [adjustable service quotas](/influxdb3/clustered/account-management/limits/#adjustable-service-quotas)
584-
or if a **delete** request exceeds the maximum
585-
[global limit](/influxdb3/clustered/account-management/limits/#global-limits)
586-
- returns `Retry-After` header that describes when to try the write again.
571+
Token is temporarily over quota. The Retry-After header describes when to try the write again.
587572
headers:
588573
Retry-After:
589574
description: A non-negative decimal integer indicating the seconds to delay after the response is received.
@@ -2134,7 +2119,6 @@ x-tagGroups:
21342119
- Headers
21352120
- Pagination
21362121
- Response codes
2137-
- System information endpoints
21382122
- name: All endpoints
21392123
tags:
21402124
- Ping

cypress/e2e/article-links.cy.js

Lines changed: 0 additions & 27 deletions
This file was deleted.

cypress/e2e/content/api-reference.cy.js

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,36 @@ describe('API reference content', () => {
3737
'/influxdb3/enterprise/api/',
3838
];
3939

40+
4041
subjects.forEach((subject) => {
4142
describe(subject, () => {
42-
it(`has API info`, function () {
43+
beforeEach(() => {
44+
// Intercept and modify the page HTML before it loads
45+
cy.intercept('GET', '**', (req) => {
46+
req.continue((res) => {
47+
if (res.headers['content-type']?.includes('text/html')) {
48+
// Modify the Kapa widget script attributes
49+
// Avoid socket errors from fpjs in tests by disabling fingerprinting
50+
res.body = res.body.replace(
51+
/data-user-analytics-fingerprint-enabled="true"/,
52+
'data-user-analytics-fingerprint-enabled="false"'
53+
);
54+
}
55+
});
56+
});
4357
cy.visit(subject);
58+
59+
4460
window.fcdsc = fakeGoogleTagManager;
4561
cy.stub(window.fcdsc, 'trackingOptIn').as('trackingOptIn');
4662
cy.stub(window.fcdsc, 'trackingOptOut').as('trackingOptOut');
63+
});
64+
it(`has API info`, function () {
65+
cy.get('script[data-user-analytics-fingerprint-enabled=false]').should('have.length', 1);
4766
cy.get('h1').first().should('have.length', 1);
4867
cy.get('[data-role$=description]').should('have.length', 1);
4968
});
5069
it('links back to the version home page', function () {
51-
cy.visit(`${subject}`);
52-
window.fcdsc = fakeGoogleTagManager;
53-
cy.stub(window.fcdsc, 'trackingOptIn').as('trackingOptIn');
54-
cy.stub(window.fcdsc, 'trackingOptOut').as('trackingOptOut');
5570
cy.get('a.back').contains('Docs')
5671
.should('have.length', 1)
5772
.click();
@@ -61,10 +76,6 @@ describe('API reference content', () => {
6176
cy.get('h1').should('have.length', 1);
6277
});
6378
it('contains valid internal links', function () {
64-
cy.visit(subject);
65-
window.fcdsc = fakeGoogleTagManager;
66-
cy.stub(window.fcdsc, 'trackingOptIn').as('trackingOptIn');
67-
cy.stub(window.fcdsc, 'trackingOptOut').as('trackingOptOut');
6879
// The following conditional test isn't the cypress way, but the doc might not have internal links.
6980
cy.get('body').then(($body) => {
7081
if ($body.find('p a[href^="/"]').length === 0) {
@@ -82,10 +93,6 @@ describe('API reference content', () => {
8293
});
8394
});
8495
it('contains valid external links', function () {
85-
cy.visit(subject);
86-
window.fcdsc = fakeGoogleTagManager;
87-
cy.stub(window.fcdsc, 'trackingOptIn').as('trackingOptIn');
88-
cy.stub(window.fcdsc, 'trackingOptOut').as('trackingOptOut');
8996
// The following conditional test isn't the cypress way, but the doc might not have external links.
9097
cy.get('body').then(($body) => {
9198
if ($body.find('p a[href^="http"]').length === 0) {
File renamed without changes.

0 commit comments

Comments
 (0)