This is an automated email from the ASF dual-hosted git repository.
lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git
The following commit(s) were added to refs/heads/master by this push:
new 7ef1d3310e [rest] Separate rest management api yaml (#5356)
7ef1d3310e is described below
commit 7ef1d3310e3fbc3f6fa8e609c84957aea6a5ea9e
Author: Jingsong Lee <[email protected]>
AuthorDate: Thu Mar 27 17:38:58 2025 +0800
[rest] Separate rest management api yaml (#5356)
---
paimon-open-api/rest-catalog-open-api.yaml | 239 +----------------
paimon-open-api/rest-management-api.yaml | 286 +++++++++++++++++++++
.../paimon/open/api/RESTCatalogController.java | 2 +-
3 files changed, 288 insertions(+), 239 deletions(-)
diff --git a/paimon-open-api/rest-catalog-open-api.yaml
b/paimon-open-api/rest-catalog-open-api.yaml
index 26b9f1234a..0ed243be17 100644
--- a/paimon-open-api/rest-catalog-open-api.yaml
+++ b/paimon-open-api/rest-catalog-open-api.yaml
@@ -18,7 +18,7 @@
---
openapi: 3.0.1
info:
- title: RESTCatalog API
+ title: REST Catalog API
description: This API exposes endpoints to RESTCatalog.
license:
name: Apache 2.0
@@ -28,164 +28,6 @@ servers:
- url: http://localhost:8080
description: Server URL in Development environment
paths:
- /v1/catalogs:
- post:
- tags:
- - Catalogs
- operationId: createCatalog
- summary: Create a catalog
- description: |
- Creates a new catalog instance.
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/CreateCatalogRequest'
- responses:
- "200":
- description: Success, no content
- "409":
- description: Resource has exist
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- "500":
- description: Internal Server Error
- get:
- tags:
- - Catalogs
- parameters:
- - name: maxResults
- in: query
- description: |
- Maximum number of catalogs to return.
- - when set to a value greater than 0, the page length is the
minimum of this value and a server configured value;
- - when set to 0 or less than 0, the page length is set to a server
configured value;
- schema:
- type: integer
- format: int32
- maximum: 100
- required: false
- - name: pageToken
- in: query
- description: |
- Opaque pagination token to go to next page based on previous query.
- schema:
- type: string
- required: false
- operationId: listCatalogs
- summary: List catalogs
- description: |
- Lists the available catalogs.
- responses:
- "200":
- description: The catalog list was successfully retrieved.
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListCatalogsResponse'
- "401":
- description: Unauthorized
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- "500":
- description: Internal Server Error
- /v1/catalogs/{catalog}:
- parameters:
- - name: catalog
- in: path
- description: The name of the catalog.
- required: true
- schema:
- type: string
- get:
- tags:
- - Catalogs
- operationId: getCatalog
- summary: Get a catalog
- description: |
- Gets the specified catalog.
- responses:
- "200":
- description: The catalog was successfully retrieved.
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/GetCatalogResponse'
- "401":
- description: Unauthorized
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- "404":
- description: Resource not found
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- "500":
- description: Internal Server Error
- patch:
- tags:
- - Catalogs
- operationId: alterCatalog
- summary: Alter a catalog
- description: |
- Alter the catalog that matches the supplied name.
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/AlterCatalogRequest'
- responses:
- "200":
- description: The catalog was successfully altered.
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/AlterCatalogResponse'
- "401":
- description: Unauthorized
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- "404":
- description: Resource not found
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- "500":
- description: Internal Server Error
- delete:
- tags:
- - Catalogs
- operationId: dropCatalog
- summary: Drop a catalog
- description: |
- Drop the catalog that matches the supplied name.
- responses:
- "200":
- description: Success, no content
- "401":
- description: Unauthorized
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- "404":
- description: Resource not found
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- "500":
- description: Internal Server Error
/v1/config:
get:
tags:
@@ -1436,85 +1278,6 @@ paths:
description: Internal Server Error
components:
schemas:
- CreateCatalogRequest:
- type: object
- properties:
- name:
- description: Name of catalog.
- type: string
- options:
- type: object
- additionalProperties:
- type: string
- ListCatalogsResponse:
- type: object
- properties:
- catalogs:
- description: An array of catalog information objects.
- type: array
- items:
- $ref: '#/components/schemas/GetCatalogResponse'
- nextPageToken:
- type: string
- description: |
- Opaque token to retrieve the next page of results. Absent if there
are no more pages.
- pageToken should be set to this value for the next request (for
the next page of results).
- GetCatalogResponse:
- type: object
- properties:
- id:
- description: Unique identifier for the catalog.
- type: string
- name:
- description: Name of catalog.
- type: string
- options:
- type: object
- additionalProperties:
- type: string
- owner:
- description: Username of current owner of catalog.
- type: string
- created_at:
- description: Time at which this catalog was created, in epoch
milliseconds.
- type: integer
- format: int64
- created_by:
- description: Username of catalog creator.
- type: string
- updated_at:
- description: Time at which this catalog was last modified, in epoch
milliseconds.
- type: integer
- format: int64
- updated_by:
- description: Username of user who last modified catalog.
- type: string
- AlterCatalogRequest:
- type: object
- properties:
- removals:
- type: array
- items:
- type: string
- updates:
- type: object
- additionalProperties:
- type: string
- AlterCatalogResponse:
- type: object
- properties:
- removed:
- type: array
- items:
- type: string
- updated:
- type: array
- items:
- type: string
- missing:
- type: array
- items:
- type: string
CreateDatabaseRequest:
type: object
properties:
diff --git a/paimon-open-api/rest-management-api.yaml
b/paimon-open-api/rest-management-api.yaml
new file mode 100644
index 0000000000..fa0a79e8b3
--- /dev/null
+++ b/paimon-open-api/rest-management-api.yaml
@@ -0,0 +1,286 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+---
+openapi: 3.0.1
+info:
+ title: REST Management API
+ description: This API exposes endpoints to REST management.
+ license:
+ name: Apache 2.0
+ url: https://www.apache.org/licenses/LICENSE-2.0.html
+ version: "1.0"
+servers:
+ - url: http://localhost:8080
+ description: Server URL in Development environment
+paths:
+ /v1/catalogs:
+ post:
+ tags:
+ - Catalogs
+ operationId: createCatalog
+ summary: Create a catalog
+ description: |
+ Creates a new catalog instance.
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CreateCatalogRequest'
+ responses:
+ "200":
+ description: Success, no content
+ "409":
+ description: Resource has exist
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ErrorResponse'
+ "500":
+ description: Internal Server Error
+ get:
+ tags:
+ - Catalogs
+ parameters:
+ - name: maxResults
+ in: query
+ description: |
+ Maximum number of catalogs to return.
+ - when set to a value greater than 0, the page length is the
minimum of this value and a server configured value;
+ - when set to 0 or less than 0, the page length is set to a server
configured value;
+ schema:
+ type: integer
+ format: int32
+ maximum: 100
+ required: false
+ - name: pageToken
+ in: query
+ description: |
+ Opaque pagination token to go to next page based on previous query.
+ schema:
+ type: string
+ required: false
+ operationId: listCatalogs
+ summary: List catalogs
+ description: |
+ Lists the available catalogs.
+ responses:
+ "200":
+ description: The catalog list was successfully retrieved.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ListCatalogsResponse'
+ "401":
+ description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ErrorResponse'
+ "500":
+ description: Internal Server Error
+ /v1/catalogs/{catalog}:
+ parameters:
+ - name: catalog
+ in: path
+ description: The name of the catalog.
+ required: true
+ schema:
+ type: string
+ get:
+ tags:
+ - Catalogs
+ operationId: getCatalog
+ summary: Get a catalog
+ description: |
+ Gets the specified catalog.
+ responses:
+ "200":
+ description: The catalog was successfully retrieved.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GetCatalogResponse'
+ "401":
+ description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ErrorResponse'
+ "404":
+ description: Resource not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ErrorResponse'
+ "500":
+ description: Internal Server Error
+ patch:
+ tags:
+ - Catalogs
+ operationId: alterCatalog
+ summary: Alter a catalog
+ description: |
+ Alter the catalog that matches the supplied name.
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/AlterCatalogRequest'
+ responses:
+ "200":
+ description: The catalog was successfully altered.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/AlterCatalogResponse'
+ "401":
+ description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ErrorResponse'
+ "404":
+ description: Resource not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ErrorResponse'
+ "500":
+ description: Internal Server Error
+ delete:
+ tags:
+ - Catalogs
+ operationId: dropCatalog
+ summary: Drop a catalog
+ description: |
+ Drop the catalog that matches the supplied name.
+ responses:
+ "200":
+ description: Success, no content
+ "401":
+ description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ErrorResponse'
+ "404":
+ description: Resource not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ErrorResponse'
+ "500":
+ description: Internal Server Error
+components:
+ schemas:
+ CreateCatalogRequest:
+ type: object
+ properties:
+ name:
+ description: Name of catalog.
+ type: string
+ options:
+ type: object
+ additionalProperties:
+ type: string
+ ListCatalogsResponse:
+ type: object
+ properties:
+ catalogs:
+ description: An array of catalog information objects.
+ type: array
+ items:
+ $ref: '#/components/schemas/GetCatalogResponse'
+ nextPageToken:
+ type: string
+ description: |
+ Opaque token to retrieve the next page of results. Absent if there
are no more pages.
+ pageToken should be set to this value for the next request (for
the next page of results).
+ GetCatalogResponse:
+ type: object
+ properties:
+ id:
+ description: Unique identifier for the catalog.
+ type: string
+ name:
+ description: Name of catalog.
+ type: string
+ options:
+ type: object
+ additionalProperties:
+ type: string
+ owner:
+ description: Username of current owner of catalog.
+ type: string
+ created_at:
+ description: Time at which this catalog was created, in epoch
milliseconds.
+ type: integer
+ format: int64
+ created_by:
+ description: Username of catalog creator.
+ type: string
+ updated_at:
+ description: Time at which this catalog was last modified, in epoch
milliseconds.
+ type: integer
+ format: int64
+ updated_by:
+ description: Username of user who last modified catalog.
+ type: string
+ AlterCatalogRequest:
+ type: object
+ properties:
+ removals:
+ type: array
+ items:
+ type: string
+ updates:
+ type: object
+ additionalProperties:
+ type: string
+ AlterCatalogResponse:
+ type: object
+ properties:
+ removed:
+ type: array
+ items:
+ type: string
+ updated:
+ type: array
+ items:
+ type: string
+ missing:
+ type: array
+ items:
+ type: string
+ ErrorResponse:
+ type: object
+ properties:
+ message:
+ type: string
+ resourceType:
+ type: string
+ enum: ["DATABASE", "TABLE", "COLUMN", "SNAPSHOT", "BRANCH", "TAG",
"VIEW", "DIALECT", "UNKNOWN"]
+ resourceName:
+ type: string
+ code:
+ type: integer
+ format: int32
+ securitySchemes:
+ BearerAuth:
+ type: http
+ scheme: bearer
diff --git
a/paimon-open-api/src/main/java/org/apache/paimon/open/api/RESTCatalogController.java
b/paimon-open-api/src/main/java/org/apache/paimon/open/api/RESTCatalogController.java
index 1fd2ac2fbf..7aac6c7d97 100644
---
a/paimon-open-api/src/main/java/org/apache/paimon/open/api/RESTCatalogController.java
+++
b/paimon-open-api/src/main/java/org/apache/paimon/open/api/RESTCatalogController.java
@@ -78,7 +78,7 @@ import java.util.UUID;
import static org.apache.paimon.rest.RESTCatalog.QUERY_PARAMETER_WAREHOUSE_KEY;
-/** RESTCatalog management APIs. */
+/** RESTCatalog open APIs. */
@CrossOrigin(origins = "http://localhost:8081")
@RestController
public class RESTCatalogController {