mchades commented on code in PR #12627: URL: https://github.com/apache/gravitino/pull/12627#discussion_r4237298461
########## docs/open-api/semantic-models.yaml: ########## @@ -0,0 +1,1590 @@ +# 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: + + /metalakes/{metalake}/catalogs/{catalog}/schemas/{schema}/semantic-models: + parameters: + - $ref: "./openapi.yaml#/components/parameters/metalake" + - $ref: "./openapi.yaml#/components/parameters/catalog" + - $ref: "./openapi.yaml#/components/parameters/schema" + + get: + tags: + - semantic-model + summary: List Semantic Models + description: >- + Lists the Semantic Models in a schema. Semantic Models are supported only for relational + catalogs. Each returned identifier uses the full metalake.catalog.schema.name namespace. + operationId: listSemanticModels + responses: + "200": + $ref: "#/components/responses/SemanticModelListResponse" + "400": + $ref: "#/components/responses/SemanticModelBadRequestResponse" + "403": + $ref: "#/components/responses/SemanticModelForbiddenResponse" + "404": + $ref: "#/components/responses/SemanticModelParentNotFoundResponse" + "501": + $ref: "#/components/responses/SemanticModelUnsupportedCatalogResponse" + "5XX": + $ref: "./openapi.yaml#/components/responses/ServerErrorResponse" + + post: + tags: + - semantic-model + summary: Create a Semantic Model + description: >- + Creates a schema-scoped Semantic Model in a relational catalog. The complete definition is + validated before the model is stored, including source identifier shape. Source existence, + source columns, and source authorization checks are not yet implemented. + operationId: createSemanticModel + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/SemanticModelCreateRequest" + examples: + SemanticModelCreateRequest: + $ref: "#/components/examples/SemanticModelCreateRequest" + responses: + "200": + $ref: "#/components/responses/SemanticModelResponse" + "400": + $ref: "#/components/responses/SemanticModelBadRequestResponse" + "403": + $ref: "#/components/responses/SemanticModelForbiddenResponse" + "404": + $ref: "#/components/responses/SemanticModelParentNotFoundResponse" + "501": + $ref: "#/components/responses/SemanticModelUnsupportedCatalogResponse" + "409": + $ref: "#/components/responses/SemanticModelAlreadyExistsResponse" + "502": + $ref: "#/components/responses/SemanticModelConnectionFailedResponse" + "5XX": + $ref: "./openapi.yaml#/components/responses/ServerErrorResponse" + + /metalakes/{metalake}/catalogs/{catalog}/schemas/{schema}/semantic-models/ossie: + parameters: + - $ref: "./openapi.yaml#/components/parameters/metalake" + - $ref: "./openapi.yaml#/components/parameters/catalog" + - $ref: "./openapi.yaml#/components/parameters/schema" + + post: + tags: + - semantic-model + summary: Import an Apache Ossie Semantic Model + description: >- + Imports one standalone Apache Ossie document and creates the represented Semantic Model. + The request body is the raw JSON or YAML document, not a JSON-encoded string. Content-Type + selects the parser, and parsing does not fall back to another format. Review Comment: Documented that an omitted `Content-Type` defaults to YAML and that 415 applies only to an explicitly supplied, unsupported media type. Server behavior is unchanged. ########## docs/open-api/semantic-models.yaml: ########## @@ -0,0 +1,1590 @@ +# 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: + + /metalakes/{metalake}/catalogs/{catalog}/schemas/{schema}/semantic-models: + parameters: + - $ref: "./openapi.yaml#/components/parameters/metalake" + - $ref: "./openapi.yaml#/components/parameters/catalog" + - $ref: "./openapi.yaml#/components/parameters/schema" + + get: + tags: + - semantic-model + summary: List Semantic Models + description: >- + Lists the Semantic Models in a schema. Semantic Models are supported only for relational + catalogs. Each returned identifier uses the full metalake.catalog.schema.name namespace. + operationId: listSemanticModels + responses: + "200": + $ref: "#/components/responses/SemanticModelListResponse" + "400": + $ref: "#/components/responses/SemanticModelBadRequestResponse" + "403": + $ref: "#/components/responses/SemanticModelForbiddenResponse" + "404": + $ref: "#/components/responses/SemanticModelParentNotFoundResponse" + "501": + $ref: "#/components/responses/SemanticModelUnsupportedCatalogResponse" + "5XX": + $ref: "./openapi.yaml#/components/responses/ServerErrorResponse" + + post: + tags: + - semantic-model + summary: Create a Semantic Model + description: >- + Creates a schema-scoped Semantic Model in a relational catalog. The complete definition is + validated before the model is stored, including source identifier shape. Source existence, + source columns, and source authorization checks are not yet implemented. + operationId: createSemanticModel + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/SemanticModelCreateRequest" + examples: + SemanticModelCreateRequest: + $ref: "#/components/examples/SemanticModelCreateRequest" + responses: + "200": + $ref: "#/components/responses/SemanticModelResponse" + "400": + $ref: "#/components/responses/SemanticModelBadRequestResponse" + "403": + $ref: "#/components/responses/SemanticModelForbiddenResponse" + "404": + $ref: "#/components/responses/SemanticModelParentNotFoundResponse" + "501": + $ref: "#/components/responses/SemanticModelUnsupportedCatalogResponse" + "409": + $ref: "#/components/responses/SemanticModelAlreadyExistsResponse" + "502": + $ref: "#/components/responses/SemanticModelConnectionFailedResponse" + "5XX": + $ref: "./openapi.yaml#/components/responses/ServerErrorResponse" + + /metalakes/{metalake}/catalogs/{catalog}/schemas/{schema}/semantic-models/ossie: + parameters: + - $ref: "./openapi.yaml#/components/parameters/metalake" + - $ref: "./openapi.yaml#/components/parameters/catalog" + - $ref: "./openapi.yaml#/components/parameters/schema" + + post: + tags: + - semantic-model + summary: Import an Apache Ossie Semantic Model + description: >- + Imports one standalone Apache Ossie document and creates the represented Semantic Model. + The request body is the raw JSON or YAML document, not a JSON-encoded string. Content-Type + selects the parser, and parsing does not fall back to another format. + operationId: importOssieDocument + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/OssieSemanticModelDocument" + examples: + OssieSemanticModelDocument: + $ref: "#/components/examples/OssieSemanticModelDocument" + application/yaml: + schema: + $ref: "#/components/schemas/OssieSemanticModelDocument" + examples: + OssieSemanticModelDocument: + $ref: "#/components/examples/OssieSemanticModelDocument" + application/x-yaml: + schema: + $ref: "#/components/schemas/OssieSemanticModelDocument" + examples: + OssieSemanticModelDocument: + $ref: "#/components/examples/OssieSemanticModelDocument" + text/yaml: + schema: + $ref: "#/components/schemas/OssieSemanticModelDocument" + examples: + OssieSemanticModelDocument: + $ref: "#/components/examples/OssieSemanticModelDocument" + responses: + "200": + $ref: "#/components/responses/SemanticModelResponse" + "400": + $ref: "#/components/responses/SemanticModelBadRequestResponse" + "403": + $ref: "#/components/responses/SemanticModelForbiddenResponse" + "404": + $ref: "#/components/responses/SemanticModelParentNotFoundResponse" + "501": Review Comment: Reordered the affected response maps numerically, placing `501` after the 4xx entries and before `502` where present. -- 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]
