From d0aa040f8f6977446ea7483194afa2445f10b7c1 Mon Sep 17 00:00:00 2001 From: ajantha-bhat Date: Tue, 16 Dec 2025 18:50:52 +0530 Subject: [PATCH] SPEC: Add REST endpoint for registering views --- open-api/rest-catalog-open-api.py | 5 +++ open-api/rest-catalog-open-api.yaml | 65 +++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) diff --git a/open-api/rest-catalog-open-api.py b/open-api/rest-catalog-open-api.py index fd8667e0f059..cb616c0b2cfb 100644 --- a/open-api/rest-catalog-open-api.py +++ b/open-api/rest-catalog-open-api.py @@ -561,6 +561,11 @@ class RegisterTableRequest(BaseModel): ) +class RegisterViewRequest(BaseModel): + name: str + metadata_location: str = Field(..., alias='metadata-location') + + class TokenType(BaseModel): __root__: Literal[ 'urn:ietf:params:oauth:token-type:access_token', diff --git a/open-api/rest-catalog-open-api.yaml b/open-api/rest-catalog-open-api.yaml index a438b8ae3b5c..75a226ae363a 100644 --- a/open-api/rest-catalog-open-api.yaml +++ b/open-api/rest-catalog-open-api.yaml @@ -1832,6 +1832,60 @@ paths: 5XX: $ref: '#/components/responses/ServerErrorResponse' + /v1/{prefix}/namespaces/{namespace}/register-view: + parameters: + - $ref: '#/components/parameters/prefix' + - $ref: '#/components/parameters/namespace' + + post: + tags: + - Catalog API + summary: Register a view in the catalog + parameters: + - $ref: '#/components/parameters/idempotency-key' + description: + Register a view in the given namespace using given metadata file location. + + operationId: registerView + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterViewRequest' + responses: + 200: + $ref: '#/components/responses/LoadViewResponse' + 400: + $ref: '#/components/responses/BadRequestErrorResponse' + 401: + $ref: '#/components/responses/UnauthorizedResponse' + 403: + $ref: '#/components/responses/ForbiddenResponse' + 404: + description: Not Found - The namespace specified does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/IcebergErrorResponse' + examples: + NamespaceNotFound: + $ref: '#/components/examples/NoSuchNamespaceError' + 409: + description: Conflict - The view already exists + content: + application/json: + schema: + $ref: '#/components/schemas/IcebergErrorResponse' + examples: + ViewAlreadyExists: + $ref: '#/components/examples/ViewAlreadyExistsError' + 419: + $ref: '#/components/responses/AuthenticationTimeoutResponse' + 503: + $ref: '#/components/responses/ServiceUnavailableResponse' + 5XX: + $ref: '#/components/responses/ServerErrorResponse' components: ####################################################### @@ -3687,6 +3741,17 @@ components: additionalProperties: type: string + RegisterViewRequest: + type: object + required: + - name + - metadata-location + properties: + name: + type: string + metadata-location: + type: string + TokenType: type: string enum: