jerryshao commented on code in PR #14649:
URL: https://github.com/apache/gravitino/pull/14649#discussion_r4509110864


##########
docs/open-api/domains.yaml:
##########
@@ -0,0 +1,868 @@
+# 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.
+
+---
+
+paths:
+  # Domain authorization and DRAFT visibility are pending access-control 
integration.
+  /metalakes/{metalake}/domains:
+    parameters:
+      - $ref: "./openapi.yaml#/components/parameters/metalake"
+    get:
+      tags: [domain]
+      summary: List domains
+      operationId: listDomains
+      description: >-
+        List domains. Domain authorization and DRAFT visibility are pending 
access-control integration.
+      parameters:
+        - name: details
+          in: query
+          description: Return domain snapshots instead of names.
+          schema:
+            type: boolean
+            default: false
+      responses:
+        "200":
+          description: Successful domain operation.
+          content:
+            application/vnd.gravitino.v1+json:
+              schema:
+                oneOf:
+                  - $ref: "#/components/schemas/DomainNameListResponse"
+                  - $ref: "#/components/schemas/DomainListResponse"
+        "404":
+          description: The metalake, domain, parent or backing tag does not 
exist.
+          content:
+            application/json:
+              schema:
+                $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+        "409":
+          description: The metalake is not in use.
+          content:
+            application/json:
+              schema:
+                $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+        "5XX":
+          $ref: "#/components/responses/ServerErrorResponse"
+    post:
+      tags: [domain]
+      summary: Create a domain
+      operationId: createDomain
+      description: >-
+        Creates a DRAFT domain, its optional parent edge and an optional new 
backing tag atomically. A failure leaves no new domain or tag behind. Domain 
authorization is pending access-control integration.
+      requestBody:
+        required: true
+        content:
+          application/json:
+            schema:
+              $ref: "#/components/schemas/DomainCreateRequest"
+      responses:
+        "200":
+          description: Successful domain operation.
+          content:
+            application/vnd.gravitino.v1+json:
+              schema:
+                $ref: "#/components/schemas/DomainResponse"
+        "400":
+          $ref: "#/components/responses/BadRequestResponse"
+        "404":
+          description: The metalake, domain, parent or backing tag does not 
exist.
+          content:
+            application/json:
+              schema:
+                $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+        "409":
+          description: The metalake is disabled, the name or backing tag 
conflicts, the domain has subdomains, or a concurrent update could not complete.
+          content:
+            application/json:
+              schema:
+                $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+        "5XX":
+          $ref: "#/components/responses/ServerErrorResponse"
+
+  /metalakes/{metalake}/domains/{domain}:
+    parameters:
+      - $ref: "./openapi.yaml#/components/parameters/metalake"
+      - $ref: "#/components/parameters/domain"
+    get:
+      tags: [domain]
+      summary: Get a domain
+      operationId: getDomain
+      description: >-
+        Get a domain. Domain authorization and DRAFT visibility are pending 
access-control integration.
+      responses:
+        "200":
+          description: Successful domain operation.
+          content:
+            application/vnd.gravitino.v1+json:
+              schema:
+                $ref: "#/components/schemas/DomainResponse"
+        "404":
+          description: The metalake, domain, parent or backing tag does not 
exist.
+          content:
+            application/json:
+              schema:
+                $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+        "409":
+          description: The metalake is not in use.
+          content:
+            application/json:
+              schema:
+                $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+        "5XX":
+          $ref: "#/components/responses/ServerErrorResponse"
+    put:
+      tags: [domain]
+      summary: Alter a domain
+      operationId: alterDomain
+      description: >-
+        Alter a domain. Domain authorization and DRAFT visibility are pending 
access-control integration.
+      requestBody:
+        required: true
+        content:
+          application/json:
+            schema:
+              $ref: "#/components/schemas/DomainUpdatesRequest"
+      responses:
+        "200":
+          description: Successful domain operation.
+          content:
+            application/vnd.gravitino.v1+json:
+              schema:
+                $ref: "#/components/schemas/DomainResponse"
+        "400":
+          $ref: "#/components/responses/BadRequestResponse"
+        "404":
+          description: The metalake, domain, parent or backing tag does not 
exist.
+          content:
+            application/json:
+              schema:
+                $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+        "409":
+          description: The metalake is disabled, the name or backing tag 
conflicts, the domain has subdomains, or a concurrent update could not complete.
+          content:
+            application/json:
+              schema:
+                $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+        "5XX":
+          $ref: "#/components/responses/ServerErrorResponse"
+    patch:
+      tags: [domain]
+      summary: Publish or unpublish a domain
+      operationId: setDomainStatus
+      description: >-
+        Sets the domain status and returns its snapshot. Publishing requires a 
published parent; unpublishing requires no published subdomains. Setting the 
current status is a no-op. Domain authorization is pending access-control 
integration.
+      requestBody:
+        required: true
+        content:
+          application/json:
+            schema:
+              $ref: "#/components/schemas/DomainSetRequest"
+      responses:
+        "200":
+          description: Successful domain operation.
+          content:
+            application/vnd.gravitino.v1+json:
+              schema:
+                $ref: "#/components/schemas/DomainResponse"
+        "400":
+          $ref: "#/components/responses/BadRequestResponse"
+        "404":
+          description: The metalake, domain, parent or backing tag does not 
exist.
+          content:
+            application/json:
+              schema:
+                $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+        "409":
+          description: The metalake is disabled, the name or backing tag 
conflicts, the domain has subdomains, or a concurrent update could not complete.
+          content:
+            application/json:
+              schema:
+                $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+        "5XX":
+          $ref: "#/components/responses/ServerErrorResponse"
+    delete:
+      tags: [domain]
+      summary: Delete a domain
+      operationId: deleteDomain
+      description: >-
+        Deletes only the domain and its parent edge. The backing tag, its 
assignments and member
+        metadata objects remain unchanged; member objects do not prevent 
deletion. Deletion does
+        not cascade to subdomains: a domain with subdomains fails with HTTP 
409,
+        NonEmptyDomainException and error code 1005. Returns dropped=false if 
the domain is absent.
+        Domain authorization is pending access-control integration.
+      responses:
+        "200":
+          description: Successful domain operation.
+          content:
+            application/vnd.gravitino.v1+json:
+              schema:
+                $ref: "#/components/schemas/DomainDropResponse"
+        "404":
+          description: The metalake, domain, parent or backing tag does not 
exist.

Review Comment:
   @mchades Fixed in 26c3d472f8: the Domain endpoints now have 
endpoint-specific 404 descriptions. Deletion documents only a missing metalake 
as 404; a missing domain returns HTTP 200 with dropped=false. The 
list/get/subdomain descriptions and the remaining lifecycle endpoints were 
corrected as well. ./gradlew :docs:build passed. Could you please take another 
look? Thanks!



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to