You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/12/06 15:26:27 UTC

[GitHub] [iceberg] nastra commented on a change in pull request #3561: [CORE] Specification for an HTTP REST catalog

nastra commented on a change in pull request #3561:
URL: https://github.com/apache/iceberg/pull/3561#discussion_r763083367



##########
File path: rest_docs/rest-catalog-open-api-v0.1.yaml
##########
@@ -0,0 +1,586 @@
+#
+# 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.3
+info:
+  title: Apache Iceberg REST Catalog API
+  license:
+    name: Apache 2.0
+    url: https://www.apache.org/licenses/LICENSE-2.0.html
+  version: 1.0.0
+  description:
+    Defines the specification for the first version of the REST Catalog API. Implementations should support both Iceberg table specs v1 and v2, with priority given to v2.
+# TODO - Add ServerVariable so user's can control the routes and ports etc and have mutli-env etc.
+servers:
+  - url: http://127.0.0.1:1080
+    description: URL Used for Mock-Server Unit Tests
+# All routes are currently configured using an Authorization header.
+security:
+  - BearerAuth: []
+paths:
+  /config:
+    get:
+      tags:
+        - Configuration API
+      summary: List all catalog configuration settings
+      operationId: getConfig
+      description:
+        All REST catalog clients will first call this route to get some configuration provided by the server.
+        This route will return any server specified default configuration values for the catalog, such as
+        configuration values used to setup the catalog for usage with Spark (e.g. vectorization-enabled).
+
+        Users should be able to override these values with client specified values.
+
+        The server might be able to request that the client use its value over a value that has been
+        configured in the client application. How and if it will do that is an open question, and thus
+        not currently specified in this documents schema.
+      responses:
+        default:
+          description: Server-Specific Configuration Values (or Overrides)
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/IcebergConfiguration'
+        "400":
+          description: Unknown Error
+        "401":
+          description: Unauthorized
+  /namespaces:
+    get:
+      tags:
+        - Catalog API
+      summary: List namespaces, optionally providing a parent namespace to list underneaath
+      description:
+        List all namespaces at a certain level, optionally starting from a given parent namespace.
+        For example, if table a.b.t exists, using 'SELECT NAMESPACE IN a' this would translate into
+        `GET /namespaces?parent=a` and must return Namepace.of("a","b").
+      operationId: listNamespaces
+      parameters:
+        - name: parent
+          in: query
+          description: Optional parent namespace under which to list namespaces. When empty, list top-level namespaces.
+          required: false
+          schema:
+            type: string
+          example: ?parent=accounting.tax
+      responses:
+        '200':
+          description: OK
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ListNamespacesResponse'
+        '401':
+          description: Unauthorized
+    post:
+      tags:
+        - Catalog API
+      summary: Create a namespace
+      description: Create a namespace, with an optional set of properties. The server might also add properties, such as last_modified_time etc.
+      operationId: createNamespace
+      requestBody:
+        content:
+          application/json:
+            schema:
+              $ref: '#/components/schemas/CreateNamespaceRequest'
+        required: true
+      responses:
+        '200':
+          description: OK
+        '401':
+          description: Unauthorized
+        '409':
+          description: Conflict (AlreadyExistsException)
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/NamespaceAlreadyExistsError'
+              example:
+                '{ error: { message: "Namespace already exists", type: "AlreadyExistsException", code: 40901 }'
+
+  /namespaces/{namespace}:
+    parameters:
+      - name: namespace
+        in: path
+        required: true
+        schema:
+          type: string
+    get:
+      tags:
+        - Catalog API
+      summary: Load the metadata properties for a namespace
+      operationId: loadNamespaceMetadata
+      description: Return all stored metadata properties for a given namespace
+      responses:
+        '200':
+          description: OK
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/GetNamespaceResponse'
+        '404':
+          description: Not Found (NoSuchNamespaceException)
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/NoSuchNamespaceError'
+              example:
+                '{ error: { message: "Namespace does not exist", type: "NoSuchNamespaceException", code: 40401 }'

Review comment:
       40401 -> 404?

##########
File path: rest_docs/rest-catalog-open-api-v0.1.yaml
##########
@@ -0,0 +1,586 @@
+#
+# 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.3
+info:
+  title: Apache Iceberg REST Catalog API
+  license:
+    name: Apache 2.0
+    url: https://www.apache.org/licenses/LICENSE-2.0.html
+  version: 1.0.0
+  description:
+    Defines the specification for the first version of the REST Catalog API. Implementations should support both Iceberg table specs v1 and v2, with priority given to v2.
+# TODO - Add ServerVariable so user's can control the routes and ports etc and have mutli-env etc.
+servers:
+  - url: http://127.0.0.1:1080
+    description: URL Used for Mock-Server Unit Tests
+# All routes are currently configured using an Authorization header.
+security:
+  - BearerAuth: []
+paths:
+  /config:
+    get:
+      tags:
+        - Configuration API
+      summary: List all catalog configuration settings
+      operationId: getConfig
+      description:
+        All REST catalog clients will first call this route to get some configuration provided by the server.
+        This route will return any server specified default configuration values for the catalog, such as
+        configuration values used to setup the catalog for usage with Spark (e.g. vectorization-enabled).
+
+        Users should be able to override these values with client specified values.
+
+        The server might be able to request that the client use its value over a value that has been
+        configured in the client application. How and if it will do that is an open question, and thus
+        not currently specified in this documents schema.
+      responses:
+        default:
+          description: Server-Specific Configuration Values (or Overrides)
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/IcebergConfiguration'
+        "400":
+          description: Unknown Error
+        "401":
+          description: Unauthorized
+  /namespaces:
+    get:
+      tags:
+        - Catalog API
+      summary: List namespaces, optionally providing a parent namespace to list underneaath
+      description:
+        List all namespaces at a certain level, optionally starting from a given parent namespace.
+        For example, if table a.b.t exists, using 'SELECT NAMESPACE IN a' this would translate into
+        `GET /namespaces?parent=a` and must return Namepace.of("a","b").
+      operationId: listNamespaces
+      parameters:
+        - name: parent
+          in: query
+          description: Optional parent namespace under which to list namespaces. When empty, list top-level namespaces.
+          required: false
+          schema:
+            type: string
+          example: ?parent=accounting.tax
+      responses:
+        '200':
+          description: OK
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ListNamespacesResponse'
+        '401':
+          description: Unauthorized
+    post:
+      tags:
+        - Catalog API
+      summary: Create a namespace
+      description: Create a namespace, with an optional set of properties. The server might also add properties, such as last_modified_time etc.
+      operationId: createNamespace
+      requestBody:
+        content:
+          application/json:
+            schema:
+              $ref: '#/components/schemas/CreateNamespaceRequest'
+        required: true
+      responses:
+        '200':
+          description: OK
+        '401':
+          description: Unauthorized
+        '409':
+          description: Conflict (AlreadyExistsException)
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/NamespaceAlreadyExistsError'
+              example:
+                '{ error: { message: "Namespace already exists", type: "AlreadyExistsException", code: 40901 }'
+
+  /namespaces/{namespace}:
+    parameters:
+      - name: namespace
+        in: path
+        required: true
+        schema:
+          type: string
+    get:
+      tags:
+        - Catalog API
+      summary: Load the metadata properties for a namespace
+      operationId: loadNamespaceMetadata
+      description: Return all stored metadata properties for a given namespace
+      responses:
+        '200':
+          description: OK
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/GetNamespaceResponse'
+        '404':
+          description: Not Found (NoSuchNamespaceException)
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/NoSuchNamespaceError'
+              example:
+                '{ error: { message: "Namespace does not exist", type: "NoSuchNamespaceException", code: 40401 }'
+    head:
+      tags:
+        - Catalog API
+      summary: Check if a namespace exists
+      operationId: namespaceExists
+      description: Check if a namespace exists.
+      responses:
+        '200':
+          description: OK
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/IcebergResponseObject'

Review comment:
       I believe a `HEAD` request must not return any content. You could indicate that the resource exists via HTTP status code 204 and use 404 if it doesn't exist

##########
File path: rest_docs/rest-catalog-open-api-v0.1.yaml
##########
@@ -0,0 +1,586 @@
+#
+# 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.3
+info:
+  title: Apache Iceberg REST Catalog API
+  license:
+    name: Apache 2.0
+    url: https://www.apache.org/licenses/LICENSE-2.0.html
+  version: 1.0.0
+  description:
+    Defines the specification for the first version of the REST Catalog API. Implementations should support both Iceberg table specs v1 and v2, with priority given to v2.
+# TODO - Add ServerVariable so user's can control the routes and ports etc and have mutli-env etc.
+servers:
+  - url: http://127.0.0.1:1080
+    description: URL Used for Mock-Server Unit Tests
+# All routes are currently configured using an Authorization header.
+security:
+  - BearerAuth: []
+paths:
+  /config:
+    get:
+      tags:
+        - Configuration API
+      summary: List all catalog configuration settings
+      operationId: getConfig
+      description:
+        All REST catalog clients will first call this route to get some configuration provided by the server.
+        This route will return any server specified default configuration values for the catalog, such as
+        configuration values used to setup the catalog for usage with Spark (e.g. vectorization-enabled).
+
+        Users should be able to override these values with client specified values.
+
+        The server might be able to request that the client use its value over a value that has been
+        configured in the client application. How and if it will do that is an open question, and thus
+        not currently specified in this documents schema.
+      responses:
+        default:
+          description: Server-Specific Configuration Values (or Overrides)
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/IcebergConfiguration'
+        "400":
+          description: Unknown Error
+        "401":
+          description: Unauthorized
+  /namespaces:
+    get:
+      tags:
+        - Catalog API
+      summary: List namespaces, optionally providing a parent namespace to list underneaath
+      description:
+        List all namespaces at a certain level, optionally starting from a given parent namespace.
+        For example, if table a.b.t exists, using 'SELECT NAMESPACE IN a' this would translate into
+        `GET /namespaces?parent=a` and must return Namepace.of("a","b").
+      operationId: listNamespaces
+      parameters:
+        - name: parent
+          in: query
+          description: Optional parent namespace under which to list namespaces. When empty, list top-level namespaces.
+          required: false
+          schema:
+            type: string
+          example: ?parent=accounting.tax
+      responses:
+        '200':
+          description: OK
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ListNamespacesResponse'
+        '401':
+          description: Unauthorized
+    post:
+      tags:
+        - Catalog API
+      summary: Create a namespace
+      description: Create a namespace, with an optional set of properties. The server might also add properties, such as last_modified_time etc.
+      operationId: createNamespace
+      requestBody:
+        content:
+          application/json:
+            schema:
+              $ref: '#/components/schemas/CreateNamespaceRequest'
+        required: true
+      responses:
+        '200':
+          description: OK
+        '401':
+          description: Unauthorized
+        '409':
+          description: Conflict (AlreadyExistsException)
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/NamespaceAlreadyExistsError'
+              example:
+                '{ error: { message: "Namespace already exists", type: "AlreadyExistsException", code: 40901 }'
+
+  /namespaces/{namespace}:
+    parameters:
+      - name: namespace
+        in: path
+        required: true
+        schema:
+          type: string
+    get:
+      tags:
+        - Catalog API
+      summary: Load the metadata properties for a namespace
+      operationId: loadNamespaceMetadata
+      description: Return all stored metadata properties for a given namespace
+      responses:
+        '200':
+          description: OK
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/GetNamespaceResponse'
+        '404':
+          description: Not Found (NoSuchNamespaceException)
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/NoSuchNamespaceError'
+              example:
+                '{ error: { message: "Namespace does not exist", type: "NoSuchNamespaceException", code: 40401 }'
+    head:
+      tags:
+        - Catalog API
+      summary: Check if a namespace exists
+      operationId: namespaceExists
+      description: Check if a namespace exists.
+      responses:
+        '200':
+          description: OK
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/IcebergResponseObject'
+              example: '{ "data": { "exists": false } }'
+        '401':
+          description: Unauthorized
+    delete:
+      tags:
+        - Catalog API
+      summary: Drop a namespace from the catalog. Namespace must be empty.
+      operationId: dropNamespace
+      responses:
+        '200':
+          description: OK
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/IcebergResponseObject'
+              example: '{ "data": { "dropped": true } }'

Review comment:
       will this return `dropped = false` when calling this endpoint again after the resource has been deleted?
   I think this endpoint is also missing a 404 status code if the resource doesn't exist, unless we want to return dropped=true/false depending on whether the resource was deleted or not.
   
   `DELETE` is supposed to be idempotent, but I think it's ok to actually return dropped=true/false as long as the resource was deleted on the first call and additional calls of this endpoint won't change the state on the server, but return dropped=false

##########
File path: rest_docs/rest-catalog-open-api-v0.1.yaml
##########
@@ -0,0 +1,586 @@
+#
+# 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.3
+info:
+  title: Apache Iceberg REST Catalog API
+  license:
+    name: Apache 2.0
+    url: https://www.apache.org/licenses/LICENSE-2.0.html
+  version: 1.0.0
+  description:
+    Defines the specification for the first version of the REST Catalog API. Implementations should support both Iceberg table specs v1 and v2, with priority given to v2.
+# TODO - Add ServerVariable so user's can control the routes and ports etc and have mutli-env etc.
+servers:
+  - url: http://127.0.0.1:1080
+    description: URL Used for Mock-Server Unit Tests
+# All routes are currently configured using an Authorization header.
+security:
+  - BearerAuth: []
+paths:
+  /config:
+    get:
+      tags:
+        - Configuration API
+      summary: List all catalog configuration settings
+      operationId: getConfig
+      description:
+        All REST catalog clients will first call this route to get some configuration provided by the server.
+        This route will return any server specified default configuration values for the catalog, such as
+        configuration values used to setup the catalog for usage with Spark (e.g. vectorization-enabled).
+
+        Users should be able to override these values with client specified values.
+
+        The server might be able to request that the client use its value over a value that has been
+        configured in the client application. How and if it will do that is an open question, and thus
+        not currently specified in this documents schema.
+      responses:
+        default:
+          description: Server-Specific Configuration Values (or Overrides)
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/IcebergConfiguration'
+        "400":
+          description: Unknown Error
+        "401":
+          description: Unauthorized
+  /namespaces:
+    get:
+      tags:
+        - Catalog API
+      summary: List namespaces, optionally providing a parent namespace to list underneaath
+      description:
+        List all namespaces at a certain level, optionally starting from a given parent namespace.
+        For example, if table a.b.t exists, using 'SELECT NAMESPACE IN a' this would translate into
+        `GET /namespaces?parent=a` and must return Namepace.of("a","b").
+      operationId: listNamespaces
+      parameters:
+        - name: parent
+          in: query
+          description: Optional parent namespace under which to list namespaces. When empty, list top-level namespaces.
+          required: false
+          schema:
+            type: string
+          example: ?parent=accounting.tax
+      responses:
+        '200':
+          description: OK
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ListNamespacesResponse'
+        '401':
+          description: Unauthorized
+    post:
+      tags:
+        - Catalog API
+      summary: Create a namespace
+      description: Create a namespace, with an optional set of properties. The server might also add properties, such as last_modified_time etc.
+      operationId: createNamespace
+      requestBody:
+        content:
+          application/json:
+            schema:
+              $ref: '#/components/schemas/CreateNamespaceRequest'
+        required: true
+      responses:
+        '200':
+          description: OK
+        '401':
+          description: Unauthorized
+        '409':
+          description: Conflict (AlreadyExistsException)
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/NamespaceAlreadyExistsError'
+              example:
+                '{ error: { message: "Namespace already exists", type: "AlreadyExistsException", code: 40901 }'

Review comment:
       code should probably be 409 instead of 40901

##########
File path: rest_docs/rest-catalog-open-api-v0.1.yaml
##########
@@ -0,0 +1,586 @@
+#
+# 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.3
+info:
+  title: Apache Iceberg REST Catalog API
+  license:
+    name: Apache 2.0
+    url: https://www.apache.org/licenses/LICENSE-2.0.html
+  version: 1.0.0
+  description:
+    Defines the specification for the first version of the REST Catalog API. Implementations should support both Iceberg table specs v1 and v2, with priority given to v2.
+# TODO - Add ServerVariable so user's can control the routes and ports etc and have mutli-env etc.
+servers:
+  - url: http://127.0.0.1:1080
+    description: URL Used for Mock-Server Unit Tests
+# All routes are currently configured using an Authorization header.
+security:
+  - BearerAuth: []
+paths:
+  /config:
+    get:
+      tags:
+        - Configuration API
+      summary: List all catalog configuration settings
+      operationId: getConfig
+      description:
+        All REST catalog clients will first call this route to get some configuration provided by the server.
+        This route will return any server specified default configuration values for the catalog, such as
+        configuration values used to setup the catalog for usage with Spark (e.g. vectorization-enabled).
+
+        Users should be able to override these values with client specified values.
+
+        The server might be able to request that the client use its value over a value that has been
+        configured in the client application. How and if it will do that is an open question, and thus
+        not currently specified in this documents schema.
+      responses:
+        default:
+          description: Server-Specific Configuration Values (or Overrides)
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/IcebergConfiguration'
+        "400":
+          description: Unknown Error
+        "401":
+          description: Unauthorized
+  /namespaces:
+    get:
+      tags:
+        - Catalog API
+      summary: List namespaces, optionally providing a parent namespace to list underneaath
+      description:
+        List all namespaces at a certain level, optionally starting from a given parent namespace.
+        For example, if table a.b.t exists, using 'SELECT NAMESPACE IN a' this would translate into
+        `GET /namespaces?parent=a` and must return Namepace.of("a","b").
+      operationId: listNamespaces
+      parameters:
+        - name: parent
+          in: query
+          description: Optional parent namespace under which to list namespaces. When empty, list top-level namespaces.
+          required: false
+          schema:
+            type: string
+          example: ?parent=accounting.tax
+      responses:
+        '200':
+          description: OK
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ListNamespacesResponse'
+        '401':
+          description: Unauthorized
+    post:
+      tags:
+        - Catalog API
+      summary: Create a namespace
+      description: Create a namespace, with an optional set of properties. The server might also add properties, such as last_modified_time etc.
+      operationId: createNamespace
+      requestBody:
+        content:
+          application/json:
+            schema:
+              $ref: '#/components/schemas/CreateNamespaceRequest'
+        required: true
+      responses:
+        '200':
+          description: OK
+        '401':
+          description: Unauthorized
+        '409':
+          description: Conflict (AlreadyExistsException)
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/NamespaceAlreadyExistsError'
+              example:
+                '{ error: { message: "Namespace already exists", type: "AlreadyExistsException", code: 40901 }'
+
+  /namespaces/{namespace}:
+    parameters:
+      - name: namespace
+        in: path
+        required: true
+        schema:
+          type: string
+    get:
+      tags:
+        - Catalog API
+      summary: Load the metadata properties for a namespace
+      operationId: loadNamespaceMetadata
+      description: Return all stored metadata properties for a given namespace
+      responses:
+        '200':
+          description: OK
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/GetNamespaceResponse'
+        '404':
+          description: Not Found (NoSuchNamespaceException)
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/NoSuchNamespaceError'
+              example:
+                '{ error: { message: "Namespace does not exist", type: "NoSuchNamespaceException", code: 40401 }'
+    head:
+      tags:
+        - Catalog API
+      summary: Check if a namespace exists
+      operationId: namespaceExists
+      description: Check if a namespace exists.
+      responses:
+        '200':
+          description: OK
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/IcebergResponseObject'
+              example: '{ "data": { "exists": false } }'
+        '401':
+          description: Unauthorized
+    delete:
+      tags:
+        - Catalog API
+      summary: Drop a namespace from the catalog. Namespace must be empty.

Review comment:
       `must be empty` -> `...must not be empty` or `... must be non-empty`

##########
File path: rest_docs/rest-catalog-open-api-v0.1.yaml
##########
@@ -0,0 +1,727 @@
+#
+# 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.3
+info:
+  title: Apache Iceberg REST Catalog API
+  license:
+    name: Apache 2.0
+    url: https://www.apache.org/licenses/LICENSE-2.0.html
+  version: 1.0.0
+  description:
+    Defines the specification for the first version of the REST Catalog API. Implementations should support both Iceberg table specs v1 and v2, with priority given to v2.
+servers:
+  - url: http://127.0.0.1:1080
+    description: URL Used for Mock-Server Unit Tests
+# All routes are currently configured using an Authorization header.
+security:
+  - BearerAuth: []
+paths:
+  /v1/config:
+    get:
+      tags:
+        - Configuration API
+      summary: List all catalog configuration settings
+      operationId: getConfig
+      description:
+        All REST catalogs will be initialized by calling this route. This route
+        will return at least the minimum necessary metadata to initialize the
+        catalog. Optionally, it can also include server-side specific overrides.
+        For example, it might also include information used to initialize this catalog
+        such as the details of the Http connection pooling, etc. This route might
+        also advertise information about operations that are not implemented
+        so that the catalog can eagerly throw or go about another way of performing
+        the desired action.
+      responses:
+        default:
+          description: Server-Specific Configuration Overrides
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/IcebergConfiguration'
+        "400":
+          description: Unknown Error
+        "401":
+          description: Unauthorized
+
+  /v1/namespaces/{namespace}/tables/{table}:
+    parameters:
+      - name: namespace
+        in: path
+        description: Namespace the table is in
+        required: true
+        schema:
+          type: string
+        examples:
+          singlepart_namespace:
+            value: "accounting"
+          multipart_namespace:
+            value: "accounting.tax"
+      - name: table
+        in: path
+        description: Name of the table to load
+        required: true
+        schema:
+          type: string
+        example: "sales"
+    get:
+      tags:
+        - Catalog API
+      summary: Load a given table from a given namespace
+      operationId: loadTable
+      responses:
+        '200':
+          description: OK
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/GetTableResponse'
+        '401':
+          description: Unauthorized
+        # Using 412, `Precondition Failed`, instead of 404, as 404 makes monitoring response codes from ELBs
+        #  very difficult - Hard to tell if clients or servers are misconfigured and calling non-existent routes
+        #  or missing routes versus expected error cases such as NoSuchTableException (expected meaning that
+        #  a person who is on call shouldn't be paged for this but 404 they might need to be).
+        '412':
+          description: NoSuchTableException
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/NoSuchTableError'
+    put:
+      tags:
+        - Catalog API
+      summary: Commit an in progress create (or replace) table transaction
+      operationId: commitTable
+      description: Commit a pending create (or replace) table transaction, e.g. for doCommit.
+      requestBody:
+        content:
+          application/json:
+            schema:
+              $ref: '#/components/schemas/CommitTableRequest'
+        required: true
+      responses:
+        '200':
+          description: OK
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/CommitTableResponse'
+        '401':
+          description: Unauthorized
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/IcebergResponseObject'
+    delete:
+      tags:
+        - Catalog API
+      summary: Drop a table from the catalog
+      operationId: dropTable
+      description: Remove a table from the catalog
+      parameters:
+        - name: purgeRequested
+          in: query
+          required: false
+          description: Whether the user requested to purge the underlying table's data and metadata
+          schema:
+            type: boolean
+            default: false
+      responses:
+        '200':
+          description: OK
+          content:
+            'application/json':
+              schema:
+                type: boolean
+                description: true if the table was dropped and false if the table did not exist
+    head:
+      tags:
+        - Catalog API
+      summary: Check if a table exists
+      operationId: tableExists
+      description:
+        Check if a table exists within a given namespace. Returns the standard response with `true` when found. Will return a TableNotFound error if not present.
+      parameters:
+        - name: namespace
+          in: path
+          required: true
+          schema:
+            type: string
+        - name: table
+          in: path
+          required: true
+          schema:
+            type: string
+      responses:
+        '200':
+          description: OK
+        '412':
+          description: Table Not Found
+  /v1/namespaces/{namespace}/tables:
+    parameters:
+      - name: namespace
+        description: Namespace under which to list tables.
+        in: path
+        required: true
+        schema:
+          type: string
+        examples:
+          singlepart_namespace:
+            value: "accounting"
+          multipart_namespace:
+            value: "accounting.tax"
+    get:
+      tags:
+        - Catalog API
+      summary: List all table identifiers underneath a given namespace
+      description: Return all table identifiers under this namespace
+      operationId: listTables
+      parameters:
+        - name: namespace
+          description: Namespace under which to list tables.
+          in: path
+          required: true
+          schema:
+            type: string
+          examples:
+            singlepart_namespace:
+              value: "accounting"
+            multipart_namespace:
+              value: "accounting.tax"
+        # TODO - There's a much more native way to handle pagination
+        - name: limit
+          description: number of values to return in one request
+          in: query
+          required: false
+          schema:
+            type: integer
+          example: 10
+        - name: offset
+          description: Place in the response to continue from if paginating
+          in: query
+          required: false
+          schema:
+            type: integer
+      responses:
+        '200':
+          description: OK
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ListTablesResponse'
+    post:
+      tags:
+        - Catalog API
+      summary: Create a table with the identifier given in the body
+      operationId: createTable
+      requestBody:
+        content:
+          application/json:
+            schema:
+              $ref: '#/components/schemas/CreateTableRequest'
+        required: true
+      responses:
+        '200':
+          description: OK
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/CreateTableResponse'
+    put:
+      tags:
+        - Catalog API
+      summary: Rename a table from its current name to a new name within the same catalog
+      description: Rename a table within the same catalog
+      operationId: renameTable
+      requestBody:
+        description: Current table identifier to rename and new table identifier to rename to
+        content:
+          application/json:
+            schema:
+              $ref: '#/components/schemas/RenameTableRequest'
+        required: true
+      responses:
+        '200':
+          description: OK
+        '401':
+          description: Unauthorized
+        # Not using 404 as 404 is very hard to monitor.
+        # There's no way to tell by monitoring returned response codes
+        # if a client made a valid request but the table didn't exist,
+        # or if a client or server has been misconfigured or some bug exists
+        # and the client is actually calling endpoints that the server doesn't
+        # have.
+        #
+        # We can consider a different response code to use than 412.
+        '412':
+          description: Table to rename from does not exist
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/NoSuchTableError'
+              example:
+                '{ error: { message: "Table does not exist", type: "NoSuchTableException", code: 41202 }'
+        '409':
+          description: The new table identifier, the to table rename to, already exists.
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/TableAlreadyExistsError'
+              example:
+                '{ error: { message: "Namespace already exists", type: "AlreadyExistsException", code: 40902 }'
+  /v1/namespaces/{namespace}/properties:
+    parameters:
+      - name: namespace
+        in: path
+        required: true
+        schema:
+          type: string
+    get:
+      tags:
+        - Catalog API
+      summary: Load the metadata properties for a namespace
+      operationId: loadNamespaceMetadata
+      description: Return all stored metadata properties for a given namespace
+      responses:
+        '200':
+          description: OK
+          content:
+            application:
+              schema:
+                $ref: '#/components/schemas/GetNamespaceResponse'
+        '417':
+          description: Namespace not found
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/NoSuchNamespaceError'
+              example:
+                '{ error: { message: "Namespace does not exist", type: "NoSuchNamespaceException", code: 41701 }'
+    put:

Review comment:
       +1 to either use POST or PUT. Also it seems weird to use PUT to actually delete properties. PUT is supposed to be idempotent




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org