Skip to content

Commit e0e1926

Browse files
authored
update swagger docs (treeverse#1366)
1 parent e307d37 commit e0e1926

File tree

1 file changed

+194
-115
lines changed

1 file changed

+194
-115
lines changed

docs/assets/js/swagger.yml

Lines changed: 194 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,17 @@ definitions:
127127
x-nullable: true
128128
type: string
129129

130+
ref:
131+
type: object
132+
required:
133+
- id
134+
- commit_id
135+
properties:
136+
id:
137+
type: string
138+
commit_id:
139+
type: string
140+
130141
diff:
131142
type: object
132143
properties:
@@ -138,8 +149,11 @@ definitions:
138149
path_type:
139150
type: string
140151
enum: [ common_prefix, object ]
141-
142-
revert_creation:
152+
diff_type: &DIFF_TYPE
153+
type: string
154+
enum: [two_dot, three_dot]
155+
default: three_dot
156+
reset_creation:
143157
type: object
144158
required:
145159
- type
@@ -168,6 +182,8 @@ definitions:
168182
creation_date:
169183
type: integer
170184
format: int64
185+
meta_range_id:
186+
type: string
171187
metadata:
172188
type: object
173189
additionalProperties:
@@ -206,6 +222,17 @@ definitions:
206222
source:
207223
type: string
208224

225+
tag_creation:
226+
type: object
227+
required:
228+
- id
229+
- ref
230+
properties:
231+
id:
232+
type: string
233+
ref:
234+
type: string
235+
209236
error:
210237
type: object
211238
properties:
@@ -362,68 +389,6 @@ definitions:
362389
type: boolean
363390
description: if true, export every commit or merge to branch
364391

365-
retention_policy:
366-
type: object
367-
required:
368-
- rules
369-
properties:
370-
rules:
371-
type: array
372-
items:
373-
$ref: "#/definitions/retention_policy_rule"
374-
description:
375-
type: string
376-
377-
retention_policy_with_creation_date:
378-
allOf:
379-
- $ref: "#/definitions/retention_policy"
380-
- type: object
381-
properties:
382-
creation_date:
383-
type: string
384-
format: date-time
385-
required:
386-
- creation_date
387-
388-
retention_policy_rule:
389-
type: object
390-
required:
391-
- status
392-
- filter
393-
properties:
394-
status:
395-
type: string
396-
enum: [ enabled, disabled ]
397-
filter:
398-
type: object
399-
properties:
400-
prefix:
401-
type: string
402-
expiration:
403-
type: object
404-
minProperties: 1
405-
properties:
406-
all:
407-
$ref: "#/definitions/time_period"
408-
uncommitted:
409-
$ref: "#/definitions/time_period"
410-
noncurrent:
411-
$ref: "#/definitions/time_period"
412-
413-
time_period:
414-
type: object
415-
description: |
416-
a number of days, which can be broken up into a sum of weeks
417-
and days
418-
properties:
419-
weeks:
420-
type: integer
421-
format: int32
422-
days:
423-
type: integer
424-
format: int32
425-
minProperties: 1
426-
427392
config:
428393
type: object
429394
properties:
@@ -1312,6 +1277,121 @@ paths:
13121277
schema:
13131278
$ref: "#/definitions/error"
13141279

1280+
/repositories/{repository}/tags:
1281+
parameters:
1282+
- in: path
1283+
name: repository
1284+
required: true
1285+
type: string
1286+
get:
1287+
tags:
1288+
- tags
1289+
operationId: listTags
1290+
summary: list tags
1291+
parameters:
1292+
- in: query
1293+
name: after
1294+
type: string
1295+
default: ""
1296+
- in: query
1297+
name: amount
1298+
type: integer
1299+
default: 100
1300+
responses:
1301+
200:
1302+
description: tag list
1303+
schema:
1304+
type: object
1305+
properties:
1306+
pagination:
1307+
$ref: "#/definitions/pagination"
1308+
results:
1309+
type: array
1310+
items:
1311+
$ref: "#/definitions/ref"
1312+
401:
1313+
$ref: "#/responses/Unauthorized"
1314+
default:
1315+
description: generic error response
1316+
schema:
1317+
$ref: "#/definitions/error"
1318+
post:
1319+
tags:
1320+
- tags
1321+
operationId: createTag
1322+
summary: create tag
1323+
parameters:
1324+
- in: body
1325+
name: tag
1326+
schema:
1327+
$ref: "#/definitions/tag_creation"
1328+
responses:
1329+
201:
1330+
description: tag
1331+
schema:
1332+
type: object
1333+
$ref: "#/definitions/ref"
1334+
400:
1335+
description: validation error
1336+
schema:
1337+
$ref: "#/definitions/error"
1338+
401:
1339+
$ref: "#/responses/Unauthorized"
1340+
default:
1341+
description: generic error response
1342+
schema:
1343+
$ref: "#/definitions/error"
1344+
1345+
/repositories/{repository}/tags/{tag}:
1346+
parameters:
1347+
- in: path
1348+
name: repository
1349+
required: true
1350+
type: string
1351+
- in: path
1352+
name: tag
1353+
required: true
1354+
type: string
1355+
get:
1356+
tags:
1357+
- tags
1358+
operationId: getTag
1359+
summary: get tag
1360+
responses:
1361+
200:
1362+
description: tag
1363+
schema:
1364+
type: object
1365+
$ref: "#/definitions/ref"
1366+
401:
1367+
$ref: "#/responses/Unauthorized"
1368+
404:
1369+
description: tag not found
1370+
schema:
1371+
$ref: "#/definitions/error"
1372+
default:
1373+
description: generic error response
1374+
schema:
1375+
$ref: "#/definitions/error"
1376+
delete:
1377+
tags:
1378+
- tags
1379+
operationId: deleteTag
1380+
summary: delete tag
1381+
responses:
1382+
204:
1383+
description: tag deleted successfully
1384+
401:
1385+
$ref: "#/responses/Unauthorized"
1386+
404:
1387+
description: branch not found
1388+
schema:
1389+
$ref: "#/definitions/error"
1390+
default:
1391+
description: generic error response
1392+
schema:
1393+
$ref: "#/definitions/error"
1394+
13151395
/repositories/{repository}/branches:
13161396
parameters:
13171397
- in: path
@@ -1343,7 +1423,7 @@ paths:
13431423
results:
13441424
type: array
13451425
items:
1346-
type: string
1426+
$ref: "#/definitions/ref"
13471427
401:
13481428
$ref: "#/responses/Unauthorized"
13491429
default:
@@ -1468,7 +1548,8 @@ paths:
14681548
200:
14691549
description: branch
14701550
schema:
1471-
type: string
1551+
type: object
1552+
$ref: "#/definitions/ref"
14721553
401:
14731554
$ref: "#/responses/Unauthorized"
14741555
404:
@@ -1500,17 +1581,55 @@ paths:
15001581
put:
15011582
tags:
15021583
- branches
1503-
operationId: revertBranch
1504-
summary: revert branch
1584+
operationId: resetBranch
1585+
summary: reset branch
1586+
parameters:
1587+
- in: body
1588+
name: reset
1589+
description: "reset parameters"
1590+
schema:
1591+
$ref: "#/definitions/reset_creation"
1592+
responses:
1593+
204:
1594+
description: reset successful
1595+
401:
1596+
$ref: "#/responses/Unauthorized"
1597+
404:
1598+
description: resource not found
1599+
schema:
1600+
$ref: "#/definitions/error"
1601+
default:
1602+
description: generic error response
1603+
schema:
1604+
$ref: "#/definitions/error"
1605+
1606+
/repositories/{repository}/branches/{branch}/revert:
1607+
parameters:
1608+
- in: path
1609+
name: repository
1610+
required: true
1611+
type: string
1612+
- in: path
1613+
name: branch
1614+
required: true
1615+
type: string
1616+
post:
1617+
tags:
1618+
- branches
1619+
operationId: revert
1620+
summary: revert
15051621
parameters:
15061622
- in: body
15071623
name: revert
1508-
description: "revert parameters"
15091624
schema:
1510-
$ref: "#/definitions/revert_creation"
1625+
type: object
1626+
properties:
1627+
ref:
1628+
type: string
1629+
description: the commit to revert, given by a ref
15111630
responses:
15121631
204:
1513-
description: reverted
1632+
description: revert successful
15141633
401:
15151634
$ref: "#/responses/Unauthorized"
15161635
404:
@@ -1642,6 +1761,10 @@ paths:
16421761
name: amount
16431762
type: integer
16441763
default: 100
1764+
- in: query
1765+
name: type
1766+
type: string
1767+
<<: *DIFF_TYPE
16451768
get:
16461769
tags:
16471770
- refs
@@ -2102,49 +2225,6 @@ paths:
21022225
schema:
21032226
$ref: "#/definitions/error"
21042227

2105-
/repositories/{repository}/retention:
2106-
parameters:
2107-
- in: path
2108-
name: repository
2109-
required: true
2110-
type: string
2111-
put:
2112-
tags:
2113-
- retention
2114-
operationId: updateRetentionPolicy
2115-
description: set retention policy for repository
2116-
parameters:
2117-
- in: body
2118-
name: policy
2119-
required: true
2120-
schema:
2121-
$ref: "#/definitions/retention_policy"
2122-
responses:
2123-
201:
2124-
description: policy attached successfully
2125-
401:
2126-
$ref: "#/responses/Unauthorized"
2127-
default:
2128-
description: generic error response
2129-
schema:
2130-
$ref: "#/definitions/error"
2131-
get:
2132-
operationId: getRetentionPolicy
2133-
tags:
2134-
- retention
2135-
description: get retention policy for repository
2136-
responses:
2137-
200:
2138-
description: retention policy
2139-
schema:
2140-
$ref: "#/definitions/retention_policy_with_creation_date"
2141-
401:
2142-
$ref: "#/responses/Unauthorized"
2143-
default:
2144-
description: generic error response
2145-
schema:
2146-
$ref: "#/definitions/error"
2147-
21482228
/healthcheck:
21492229
get:
21502230
operationId: healthCheck
@@ -2169,4 +2249,3 @@ paths:
21692249
$ref: "#/definitions/config"
21702250
401:
21712251
$ref: "#/responses/Unauthorized"
2172-

0 commit comments

Comments
 (0)