Skip to content

Commit 8f655a1

Browse files
committed
CBG-4604 document missing run states
- update online/offline endpoints to discourage use
1 parent 580e727 commit 8f655a1

File tree

6 files changed

+30
-29
lines changed

6 files changed

+30
-29
lines changed

docs/api/components/schemas.yaml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2904,14 +2904,8 @@ Status:
29042904
description: The server unique identifier.
29052905
type: string
29062906
state:
2907-
description: Whether the database is online or offline.
2908-
type: string
2909-
enum:
2910-
- Online
2911-
- Offline
2912-
- Starting
2913-
- Stopping
2914-
- Resyncing
2907+
allOf: # use allOf to prevent DatabaseState from showing as the type in the display
2908+
- $ref: '#/DatabaseState'
29152909
replication_status:
29162910
type: array
29172911
items:
@@ -3017,14 +3011,8 @@ CollectionNames:
30173011
type: string
30183012
description: The Couchbase Server backing bucket for the database.
30193013
state:
3020-
description: The database state.
3021-
type: string
3022-
enum:
3023-
- Online
3024-
- Offline
3025-
- Starting
3026-
- Stopping
3027-
- Resyncing
3014+
allOf: # use allOf to prevent DatabaseState from showing as the type in the display
3015+
- $ref: '#/DatabaseState'
30283016
require_resync:
30293017
description: Indicates whether the database requires resync before it can be brought online.
30303018
type: boolean
@@ -3075,3 +3063,18 @@ doc_access_spans:
30753063
entries:
30763064
type: array
30773065
description: Start sequence to end sequence. If the channel is currently granted, the end sequence will be zero.
3066+
DatabaseState:
3067+
description: The state of the database.
3068+
type: string
3069+
enum:
3070+
- Online
3071+
- Offline
3072+
- Starting
3073+
- Stopping
3074+
- Resyncing
3075+
x-enumDescriptions:
3076+
Online: The database is online and available for use.
3077+
Offline: The database is offline, resync and other offline only endpoints are allowed.
3078+
Starting: The database is in the process of going online.
3079+
Stopping: The database is no longer accepting connections and is being taken offline or deleted.
3080+
Resyncing: The database is offline and performing a resync operation.

docs/api/paths/admin/db-.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,8 @@ get:
5757
type: number
5858
default: 0
5959
state:
60-
description: 'The database state. Change using the `/{db}/_offline` and `/{db}/_online` endpoints.'
61-
type: string
62-
enum:
63-
- Online
64-
- Offline
60+
allOf: # use allOf to prevent DatabaseState from showing as the type in the display
61+
- $ref: ../../components/schemas.yaml#/DatabaseState
6562
server_uuid:
6663
description: Unique server identifier.
6764
type: string

docs/api/paths/admin/db-_offline.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ parameters:
1010
post:
1111
summary: Take the database offline
1212
description: |-
13-
This will take the database offline meaning actions can be taken without disrupting current operations ungracefully or having the restart the Sync Gateway instance.
13+
If using persistent config, call [POST /{db}/_config](#operation/post_db-_config) with `{"offline": true}` to set the database to offline.
14+
15+
This will take the database offline on this node only. Actions can be taken without disrupting current operations ungracefully or having the restart the Sync Gateway instance.
1416
1517
This will not take the backing Couchbase Server bucket offline.
1618

docs/api/paths/admin/db-_online.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ parameters:
1010
post:
1111
summary: Bring the database online
1212
description: |-
13-
This will bring the database online so the Public and full Admin REST API requests can be served.
13+
This will bring the database online on this node only so the Public and full Admin REST API requests can be served.
14+
15+
If using persistent config, call [POST /{db}/_config](#operation/post_db-_config) with `{"offline": false}` to set the database to online.
1416
1517
Bringing a database online will:
1618
* Close the database connection to the backing Couchbase Server bucket.

docs/api/paths/admin/db-_resync.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ post:
3434
3535
Generally, a resync operation might be wanted when the sync function has been modified in such a way that the channel or access mappings for any existing documents would change as a result.
3636
37-
A resync operation cannot be run if the database is online. The database can be taken offline by calling the `POST /{db}/_offline` endpoint.
37+
A resync operation cannot be run if the database is online. The database can be taken offline by calling [POST /{db}/_config](#operation/post_db-_config) with `{"offline": true}` to set the database to offline.
3838
3939
The `requireUser()` and `requireRole()` calls in the sync function will always return `true`.
4040

docs/api/paths/public/db-.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,8 @@ get:
5252
type: number
5353
default: 0
5454
state:
55-
description: 'The database state. Change using the `/{db}/_offline` and `/{db}/_online` endpoints.'
56-
type: string
57-
enum:
58-
- Online
59-
- Offline
55+
allOf: # use allOf to prevent DatabaseState from showing as the type in the display
56+
- $ref: ../../components/schemas.yaml#/DatabaseState
6057
server_uuid:
6158
description: Unique server identifier.
6259
type: string

0 commit comments

Comments
 (0)