Skip to content

Commit 14e576c

Browse files
authored
HTTP API: Endpoint for reserving/skipping globally unique IDs (#787)
1 parent 2ab47f2 commit 14e576c

File tree

2 files changed

+218
-0
lines changed

2 files changed

+218
-0
lines changed

site/content/3.12/develop/http-api/cluster.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,3 +1548,112 @@ paths:
15481548
tags:
15491549
- Cluster
15501550
```
1551+
1552+
## Miscellaneous
1553+
1554+
### Reserve globally unique IDs
1555+
1556+
<small>Introduced in: v3.12.5-3</small>
1557+
1558+
```openapi
1559+
paths:
1560+
/_admin/cluster/uniqId:
1561+
put:
1562+
operationId: reserveUniqueIDs
1563+
description: |
1564+
Reserve or skip globally unique identifiers that are used as automatically
1565+
generated document keys when using the `traditional` or `padded` key generators.
1566+
1567+
Either the `number` or the `minimum` query parameter needs to be specified.
1568+
1569+
{{</* warning */>}}
1570+
Only use this endpoint to resolve issues with the key generation,
1571+
in particular of cluster deployments created with v3.12.5-2 or older.
1572+
{{</* /warning */>}}
1573+
parameters:
1574+
- name: number
1575+
in: query
1576+
description: |
1577+
Reserve as many globally unique IDs as specified.
1578+
schema:
1579+
type: integer
1580+
minimum: 1
1581+
maximum: 1000000
1582+
- name: minimum
1583+
in: query
1584+
description: |
1585+
Make sure that globally unique IDs used in the future will always be
1586+
at least as large as the specified value.
1587+
1588+
Coordinators and DB-Servers will use these larger IDs only after a restart.
1589+
schema:
1590+
type: integer
1591+
responses:
1592+
'200':
1593+
description: |
1594+
Successfully reserved/skipped the globally unique IDs.
1595+
content:
1596+
application/json:
1597+
schema:
1598+
description: |
1599+
The range of the reserved/skipped IDs.
1600+
type: object
1601+
required:
1602+
- code
1603+
- error
1604+
- smallest
1605+
- largest
1606+
properties:
1607+
code:
1608+
description: |
1609+
The status code.
1610+
type: integer
1611+
example: 200
1612+
error:
1613+
description: |
1614+
Whether an error occurred. `false` in this case.
1615+
type: boolean
1616+
smallest:
1617+
description: |
1618+
The lower bound of the IDs that have been reserved (`number`)
1619+
respectively skipped (`minimum`).
1620+
type: string
1621+
largest:
1622+
description: |
1623+
The upper bound of the IDs that have been reserved (`number`)
1624+
respectively skipped (`minimum`).
1625+
type: string
1626+
'400':
1627+
description: |
1628+
Either the `number` or the `minimum` query parameter must be provided.
1629+
content:
1630+
application/json:
1631+
schema:
1632+
type: object
1633+
required:
1634+
- error
1635+
- code
1636+
- errorNum
1637+
- errorMessage
1638+
properties:
1639+
error:
1640+
description: |
1641+
A flag indicating that an error occurred.
1642+
type: boolean
1643+
example: true
1644+
code:
1645+
description: |
1646+
The HTTP response status code.
1647+
type: integer
1648+
example: 400
1649+
errorNum:
1650+
description: |
1651+
The ArangoDB error number for the error that occurred.
1652+
type: integer
1653+
errorMessage:
1654+
description: |
1655+
A descriptive error message.
1656+
type: string
1657+
tags:
1658+
- Cluster
1659+
```

site/content/3.13/develop/http-api/cluster.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,3 +1548,112 @@ paths:
15481548
tags:
15491549
- Cluster
15501550
```
1551+
1552+
## Miscellaneous
1553+
1554+
### Reserve globally unique IDs
1555+
1556+
<small>Introduced in: v3.12.5-3</small>
1557+
1558+
```openapi
1559+
paths:
1560+
/_admin/cluster/uniqId:
1561+
put:
1562+
operationId: reserveUniqueIDs
1563+
description: |
1564+
Reserve or skip globally unique identifiers that are used as automatically
1565+
generated document keys when using the `traditional` or `padded` key generators.
1566+
1567+
Either the `number` or the `minimum` query parameter needs to be specified.
1568+
1569+
{{</* warning */>}}
1570+
Only use this endpoint to resolve issues with the key generation,
1571+
in particular of cluster deployments created with v3.12.5-2 or older.
1572+
{{</* /warning */>}}
1573+
parameters:
1574+
- name: number
1575+
in: query
1576+
description: |
1577+
Reserve as many globally unique IDs as specified.
1578+
schema:
1579+
type: integer
1580+
minimum: 1
1581+
maximum: 1000000
1582+
- name: minimum
1583+
in: query
1584+
description: |
1585+
Make sure that globally unique IDs used in the future will always be
1586+
at least as large as the specified value.
1587+
1588+
Coordinators and DB-Servers will use these larger IDs only after a restart.
1589+
schema:
1590+
type: integer
1591+
responses:
1592+
'200':
1593+
description: |
1594+
Successfully reserved/skipped the globally unique IDs.
1595+
content:
1596+
application/json:
1597+
schema:
1598+
description: |
1599+
The range of the reserved/skipped IDs.
1600+
type: object
1601+
required:
1602+
- code
1603+
- error
1604+
- smallest
1605+
- largest
1606+
properties:
1607+
code:
1608+
description: |
1609+
The status code.
1610+
type: integer
1611+
example: 200
1612+
error:
1613+
description: |
1614+
Whether an error occurred. `false` in this case.
1615+
type: boolean
1616+
smallest:
1617+
description: |
1618+
The lower bound of the IDs that have been reserved (`number`)
1619+
respectively skipped (`minimum`).
1620+
type: string
1621+
largest:
1622+
description: |
1623+
The upper bound of the IDs that have been reserved (`number`)
1624+
respectively skipped (`minimum`).
1625+
type: string
1626+
'400':
1627+
description: |
1628+
Either the `number` or the `minimum` query parameter must be provided.
1629+
content:
1630+
application/json:
1631+
schema:
1632+
type: object
1633+
required:
1634+
- error
1635+
- code
1636+
- errorNum
1637+
- errorMessage
1638+
properties:
1639+
error:
1640+
description: |
1641+
A flag indicating that an error occurred.
1642+
type: boolean
1643+
example: true
1644+
code:
1645+
description: |
1646+
The HTTP response status code.
1647+
type: integer
1648+
example: 400
1649+
errorNum:
1650+
description: |
1651+
The ArangoDB error number for the error that occurred.
1652+
type: integer
1653+
errorMessage:
1654+
description: |
1655+
A descriptive error message.
1656+
type: string
1657+
tags:
1658+
- Cluster
1659+
```

0 commit comments

Comments
 (0)