mchades commented on code in PR #12626:
URL: https://github.com/apache/gravitino/pull/12626#discussion_r4123049811
##########
server/src/main/java/org/apache/gravitino/server/web/rest/SemanticModelOperations.java:
##########
@@ -63,6 +72,44 @@ public SemanticModelOperations(SemanticModelDispatcher
dispatcher) {
this.dispatcher = dispatcher;
}
+ /**
+ * Lists Semantic Models in a schema.
+ *
+ * @param metalake The metalake name.
+ * @param catalog The catalog name.
+ * @param schema The schema name.
+ * @return A response containing Semantic Model identifiers.
+ */
+ @GET
+ @Produces("application/vnd.gravitino.v1+json")
+ @Timed(name = "list-semantic-model." + MetricNames.HTTP_PROCESS_DURATION,
absolute = true)
+ @ResponseMetered(name = "list-semantic-model", absolute = true)
+ public Response listSemanticModels(
+ @PathParam("metalake") String metalake,
+ @PathParam("catalog") String catalog,
+ @PathParam("schema") String schema) {
+ LOG.info(
+ "Received list Semantic Models request for schema: {}.{}.{}",
metalake, catalog, schema);
+ try {
+ return Utils.doAs(
+ httpRequest,
+ () -> {
+ Namespace namespace = NamespaceUtil.ofSemanticModel(metalake,
catalog, schema);
+ NameIdentifier[] identifiers =
dispatcher.listSemanticModels(namespace);
+ identifiers = identifiers == null ? new NameIdentifier[0] :
identifiers;
Review Comment:
Authorization filtering is outside the scope of this PR and is tracked in
#12594. After incorporating this PR, #13512 will add the schema-level list
check and filter the returned identifiers with
`FILTER_SEMANTIC_MODEL_AUTHORIZATION_EXPRESSION`.
--
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]