public void createIndexAndMapping(String indexName, List<ElasticsearchFieldInfo> fieldInfos) throws Exception {
        ElasticsearchIndexMappingInfo mappingInfo = getMappingInfo(fieldInfos);
        final String url = esConfig.getOneHttpUrl() + "/" + indexName;
        ElasticsearchCreateIndexResponse response = HttpUtils.request(esConfig.getRestClient(), url, HttpMethod.PUT,
                GSON.toJsonTree(mappingInfo).getAsJsonObject().toString(), getHttpHeaders(),
                ElasticsearchCreateIndexResponse.class);
        LOG.info("create {}:{}", indexName, response.getIndex());
    }
Create index and mapping by REST API.

@param indexName Index name of creating
@param fieldInfos Field infos
@throws Exception The exception may throws
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/resource/sink/es/ElasticsearchApi.java