All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ui.static.topic.partitionCountChange.js Maven / Gradle / Ivy

There is a newer version: 0.8.0
Show newest version
$(document).ready(function () {
    $("#add-partitions-btn").click(partitionCountChange);
});

function partitionCountChange() {
    let button = $(this);
    let topicName = button.attr("data-topic-name");
    let clusterIdentifier = button.attr("data-cluster-identifier");
    showOpProgress("Adding topic partitions...");
    let newPartitions = getAssignmentsData(topicName);
    console.log("New partitions: " + JSON.stringify(newPartitions));
    console.log(newPartitions);
    $
        .ajax("api/management/add-topic-partitions?topicName=" + encodeURI(topicName) + "&clusterIdentifier=" + encodeURI(clusterIdentifier), {
            method: "POST",
            contentType: "application/json; charset=utf-8",
            data: JSON.stringify(newPartitions)
        })
        .done(function () {
            showOpSuccess("New partitions creation completed with success");
        })
        .fail(function (error) {
            let errorMsg = extractErrMsg(error);
            showOpError("Partitions creation failed: " + errorMsg);
        });
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy