private InternalCatalog getCatalog(String catalog) {
    Preconditions.checkNotNull(catalog, "lack required path variables: catalog");
    ServerCatalog internalCatalog = catalogManager.getServerCatalog(catalog);
    Preconditions.checkArgument(
        internalCatalog instanceof InternalCatalog, "The catalog is not an iceberg rest catalog");
    Set<TableFormat> tableFormats = CatalogUtil.tableFormats(internalCatalog.getMetadata());
    Preconditions.checkArgument(
        tableFormats.contains(TableFormat.ICEBERG)
            || tableFormats.contains(TableFormat.MIXED_ICEBERG),
        "The catalog is not an iceberg rest catalog");
    return (InternalCatalog) internalCatalog;
  }
POST PREFIX/v1/catalogs/{catalog}/namespaces/{namespace}/tables/{table}/metrics
amoro-ams/src/main/java/org/apache/amoro/server/RestCatalogService.java