class RebuildAPI extends API {

    private static final Logger LOG = Log.logger(RebuildAPI.class);

    @PUT
    @Timed
    @Path("vertexlabels/{name}")
    @Status(Status.ACCEPTED)
    @Produces(APPLICATION_JSON_WITH_CHARSET)
    @RolesAllowed({"admin", "$owner=$graph $action=index_write"})
    @RedirectFilter.RedirectMasterRole
    public Map<String, Id> vertexLabelRebuild(@Context GraphManager manager,
                                              @PathParam("graph") String graph,
                                              @PathParam("name") String name) {
        LOG.debug("Graph [{}] rebuild vertex label: {}", graph, name);

        HugeGraph g = graph(manager, graph);
        return ImmutableMap.of("task_id",
                               g.schema().vertexLabel(name).rebuildIndex());
    }

    @PUT
    @Timed
    @Path("edgelabels/{name}")
    @Status(Status.ACCEPTED)
    @Produces(APPLICATION_JSON_WITH_CHARSET)
    @RolesAllowed({"admin", "$owner=$graph $action=index_write"})
    @RedirectFilter.RedirectMasterRole
    public Map<String, Id> edgeLabelRebuild(@Context GraphManager manager,
                                            @PathParam("graph") String graph,
                                            @PathParam("name") String name) {<FILL_FUNCTION_BODY>}

    @PUT
    @Timed
    @Path("indexlabels/{name}")
    @Status(Status.ACCEPTED)
    @Produces(APPLICATION_JSON_WITH_CHARSET)
    @RolesAllowed({"admin", "$owner=$graph $action=index_write"})
    @RedirectFilter.RedirectMasterRole
    public Map<String, Id> indexLabelRebuild(@Context GraphManager manager,
                                             @PathParam("graph") String graph,
                                             @PathParam("name") String name) {
        LOG.debug("Graph [{}] rebuild index label: {}", graph, name);

        HugeGraph g = graph(manager, graph);
        return ImmutableMap.of("task_id",
                               g.schema().indexLabel(name).rebuild());
    }
}

        LOG.debug("Graph [{}] rebuild edge label: {}", graph, name);

        HugeGraph g = graph(manager, graph);
        return ImmutableMap.of("task_id",
                               g.schema().edgeLabel(name).rebuildIndex());
    
<methods>public non-sealed void <init>() ,public static boolean checkAndParseAction(java.lang.String) ,public static R commit(org.apache.hugegraph.HugeGraph, Callable<R>) ,public static void commit(org.apache.hugegraph.HugeGraph, java.lang.Runnable) ,public static org.apache.hugegraph.HugeGraph graph(org.apache.hugegraph.core.GraphManager, java.lang.String) ,public static org.apache.hugegraph.HugeGraph graph4admin(org.apache.hugegraph.core.GraphManager, java.lang.String) ,public static java.lang.Object[] properties(Map<java.lang.String,java.lang.Object>) <variables>public static final java.lang.String ACTION_APPEND,public static final java.lang.String ACTION_CLEAR,public static final java.lang.String ACTION_ELIMINATE,public static final java.lang.String APPLICATION_JSON,public static final java.lang.String APPLICATION_JSON_WITH_CHARSET,public static final java.lang.String APPLICATION_TEXT_WITH_CHARSET,public static final java.lang.String CHARSET,private static final Meter EXPECTED_ERROR_METER,private static final Meter ILLEGAL_ARG_ERROR_METER,public static final java.lang.String JSON,protected static final Logger LOG,private static final Meter SUCCEED_METER,public static final java.lang.String TEXT_PLAIN,private static final Meter UNKNOWN_ERROR_METER