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 2022/01/03 18:47:15 UTC

[GitHub] [iceberg] jackye1995 commented on a change in pull request #3770: Spec: Initial OpenAPI Spec for a Rest Catalog

jackye1995 commented on a change in pull request #3770:
URL: https://github.com/apache/iceberg/pull/3770#discussion_r774175669



##########
File path: rest_docs/rest-catalog-open-api.yaml
##########
@@ -0,0 +1,849 @@
+#
+# 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: 0.0.1
+  description:
+    Defines the specification for the first version of the REST Catalog API.
+    Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2.
+servers:
+  - url: "{scheme}://{host}/{basePath}"
+    description: Server URL when the port can be inferred from the scheme
+    variables:
+      scheme:
+        description: The scheme of the URI, either http or https.
+        default: https
+      host:
+        description: The host address for the specified server
+        default: localhost
+      basePath:
+        description: Optional prefix to be appended to all routes
+        default: ""
+  - url: "{scheme}://{host}:{port}/{basePath}"
+    description: Generic base server URL, with all parts configurable
+    variables:
+      scheme:
+        description: The scheme of the URI, either http or https.
+        default: https
+      host:
+        description: The host address for the specified server
+        default: localhost
+      port:
+        description: The port used when addressing the host
+        default: "443"
+      basePath:
+        description: Optional prefix to be appended to all routes
+        default: ""
+# 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 clients should first call this route to get catalog configuration
+        properties from the server to configure the catalog and its HTTP client.
+        Configuration from the server consists of two sets of key/value pairs.
+
+        - defaults -  properties that should be used as default configuration; applied before client configuration
+
+        - overrides - properties that should be used to override client configuration; applied after defaults and client configuration
+
+
+        Catalog configuration is constructed by setting the defaults, then client-
+        provided configuration, and finally overrides. The final property set is then
+        used to configure the catalog.
+
+
+        For example, a default configuration property might set the size of the
+        client pool, which can be replaced with a client-specific setting. An
+        override might be used to set the warehouse location, which is stored
+        on the server rather than in client configuration.
+
+
+        Common catalog configuration settings are documented at
+        https://iceberg.apache.org/configuration/#catalog-properties
+        "
+      responses:
+        200:
+          description: Server specified configuration values.
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/CatalogConfiguration'
+              example: {
+                "data": {
+                  "overrides": {
+                    "warehouse": "s3://bucket/warehouse/"
+                  },
+                  "defaults": {
+                    "clients": "4"
+                  }
+                }
+              }
+        401:
+          $ref: '#/components/responses/UnauthorizedResponse'
+
+  /v1/namespaces:
+    get:
+      tags:
+        - Catalog API
+      summary: List namespaces, optionally providing a parent namespace to list underneath
+      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 a namespace, ["a", "b"]. If `parent` is not
+        provided, all top-level namespaces should be listed.
+      operationId: listNamespaces
+      parameters:
+        - name: parent
+          in: query
+          description:
+            An optional namespace, underneath which to list namespaces.
+            If not provided or empty, all top-level namespaces should be listed.
+            If parent is a multipart namespace, the parts must be separated by the null byte.
+          required: false
+          allowEmptyValue: true
+          schema:
+            type: string
+          example: "accounting%00tax"
+      responses:
+        200:
+          description: OK
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/responses/ListNamespacesResponse'
+              examples:
+                NonEmptyResponse:
+                  $ref: '#/components/examples/ListNamespacesNonEmptyExample'
+                EmptyResponse:
+                  $ref: '#/components/examples/ListNamespacesEmptyExample'
+        401:
+          $ref: '#/components/responses/UnauthorizedResponse'
+        404:
+          description: Not Found - Namespace provided in the `parent` query parameter is not found.
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/responses/IcebergErrorResponse'
+              examples:
+                NoSuchNamespaceExample:
+                  $ref: '#/components/examples/NoSuchNamespaceError'
+
+    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.

Review comment:
       nit: `last_modified_time` with backquote




-- 
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