Skip to content

Commit 7975b40

Browse files
[core] RestCatalog: add catalog api into rest open api yaml (#5317)
1 parent 9c07e10 commit 7975b40

File tree

1 file changed

+213
-0
lines changed

1 file changed

+213
-0
lines changed

paimon-open-api/rest-catalog-open-api.yaml

Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,140 @@ servers:
2828
- url: http://localhost:8080
2929
description: Server URL in Development environment
3030
paths:
31+
/v1/catalogs:
32+
post:
33+
tags:
34+
- Catalogs
35+
operationId: createCatalog
36+
summary: Create a catalog
37+
description: |
38+
Creates a new catalog instance.
39+
requestBody:
40+
content:
41+
application/json:
42+
schema:
43+
$ref: '#/components/schemas/CreateCatalogRequest'
44+
responses:
45+
'200':
46+
description: Success, no content
47+
"409":
48+
description: Resource has exist
49+
content:
50+
application/json:
51+
schema:
52+
$ref: '#/components/schemas/ErrorResponse'
53+
"500":
54+
description: Internal Server Error
55+
get:
56+
tags:
57+
- Catalogs
58+
parameters:
59+
- name: maxResults
60+
in: query
61+
description: |
62+
Maximum number of catalogs to return.
63+
- when set to a value greater than 0, the page length is the minimum of this value and a server configured value;
64+
- when set to 0 or less than 0, the page length is set to a server configured value;
65+
schema:
66+
type: integer
67+
format: int32
68+
maximum: 100
69+
required: false
70+
- name: pageToken
71+
in: query
72+
description: |
73+
Opaque pagination token to go to next page based on previous query.
74+
schema:
75+
type: string
76+
required: false
77+
operationId: listCatalogs
78+
summary: List catalogs
79+
description: |
80+
Lists the available catalogs.
81+
responses:
82+
'200':
83+
description: The catalog list was successfully retrieved.
84+
content:
85+
application/json:
86+
schema:
87+
$ref: '#/components/schemas/ListCatalogsResponse'
88+
'500':
89+
description: Internal Server Error
90+
/v1/catalogs/{catalog}:
91+
parameters:
92+
- name: name
93+
in: path
94+
description: The name of the catalog.
95+
required: true
96+
schema:
97+
type: string
98+
get:
99+
tags:
100+
- Catalogs
101+
operationId: getCatalog
102+
summary: Get a catalog
103+
description: |
104+
Gets the specified catalog.
105+
responses:
106+
'200':
107+
description: The catalog was successfully retrieved.
108+
content:
109+
application/json:
110+
schema:
111+
$ref: '#/components/schemas/GetCatalogResponse'
112+
'404':
113+
description: Resource not found
114+
content:
115+
application/json:
116+
schema:
117+
$ref: '#/components/schemas/ErrorResponse'
118+
'500':
119+
description: Internal Server Error
120+
patch:
121+
tags:
122+
- Catalogs
123+
operationId: alterCatalog
124+
summary: Alter a catalog
125+
description: |
126+
Alter the catalog that matches the supplied name.
127+
requestBody:
128+
content:
129+
application/json:
130+
schema:
131+
$ref: '#/components/schemas/AlterCatalogRequest'
132+
responses:
133+
'200':
134+
description: The catalog was successfully altered.
135+
content:
136+
application/json:
137+
schema:
138+
$ref: '#/components/schemas/AlterCatalogResponse'
139+
'404':
140+
description: Resource not found
141+
content:
142+
application/json:
143+
schema:
144+
$ref: '#/components/schemas/ErrorResponse'
145+
'500':
146+
description: Internal Server Error
147+
delete:
148+
tags:
149+
- Catalogs
150+
operationId: dropCatalog
151+
summary: Drop a catalog
152+
description: |
153+
Drop the catalog that matches the supplied name.
154+
responses:
155+
'200':
156+
description: Success, no content
157+
'404':
158+
description: Resource not found
159+
content:
160+
application/json:
161+
schema:
162+
$ref: '#/components/schemas/ErrorResponse'
163+
'500':
164+
description: Internal Server Error
31165
/v1/config:
32166
get:
33167
tags:
@@ -1040,6 +1174,85 @@ paths:
10401174
description: Internal Server Error
10411175
components:
10421176
schemas:
1177+
CreateCatalogRequest:
1178+
type: object
1179+
properties:
1180+
name:
1181+
description: Name of catalog.
1182+
type: string
1183+
options:
1184+
type: object
1185+
additionalProperties:
1186+
type: string
1187+
ListCatalogsResponse:
1188+
type: object
1189+
properties:
1190+
catalogs:
1191+
description: An array of catalog information objects.
1192+
type: array
1193+
items:
1194+
$ref: '#/components/schemas/GetCatalogResponse'
1195+
nextPageToken:
1196+
type: string
1197+
description: |
1198+
Opaque token to retrieve the next page of results. Absent if there are no more pages.
1199+
pageToken should be set to this value for the next request (for the next page of results).
1200+
GetCatalogResponse:
1201+
type: object
1202+
properties:
1203+
id:
1204+
description: Unique identifier for the catalog.
1205+
type: string
1206+
name:
1207+
description: Name of catalog.
1208+
type: string
1209+
options:
1210+
type: object
1211+
additionalProperties:
1212+
type: string
1213+
owner:
1214+
description: Username of current owner of catalog.
1215+
type: string
1216+
created_at:
1217+
description: Time at which this catalog was created, in epoch milliseconds.
1218+
type: integer
1219+
format: int64
1220+
created_by:
1221+
description: Username of catalog creator.
1222+
type: string
1223+
updated_at:
1224+
description: Time at which this catalog was last modified, in epoch milliseconds.
1225+
type: integer
1226+
format: int64
1227+
updated_by:
1228+
description: Username of user who last modified catalog.
1229+
type: string
1230+
AlterCatalogRequest:
1231+
type: object
1232+
properties:
1233+
removals:
1234+
type: array
1235+
items:
1236+
type: string
1237+
updates:
1238+
type: object
1239+
additionalProperties:
1240+
type: string
1241+
AlterCatalogResponse:
1242+
type: object
1243+
properties:
1244+
removed:
1245+
type: array
1246+
items:
1247+
type: string
1248+
updated:
1249+
type: array
1250+
items:
1251+
type: string
1252+
missing:
1253+
type: array
1254+
items:
1255+
type: string
10431256
CreateDatabaseRequest:
10441257
type: object
10451258
properties:

0 commit comments

Comments
 (0)