addBroker
Move partitions to the specified brokers, according to the specified goals.
/add_broker
Usage and SDK Samples
curl -X POST\
-H "Accept: application/json,text/plain"\
"/{urlPrefix}/add_broker?brokerid=&dryrun=&throttle_added_broker=&allow_capacity_estimation=&goals=&concurrent_partition_movements_per_broker=&max_partition_movements_in_cluster=&concurrent_leader_movements=&broker_concurrent_leader_movements=&json=&skip_hard_goal_check=&excluded_topics=&kafka_assigner=&use_ready_default_goals=&verbose=&exclude_recently_demoted_brokers=&exclude_recently_removed_brokers=&replica_movement_strategies=&execution_progress_check_interval_ms=&stop_ongoing_execution=&reason=&review_id=&data_from=&replication_throttle=&get_response_schema=&doAs=&fast_mode="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DefaultApi;
import java.io.File;
import java.util.*;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
array[Integer] brokerid = ; // array[Integer] | List of target broker ids.
Boolean dryrun = true; // Boolean | Whether to dry-run the request or not.
Boolean throttleAddedBroker = true; // Boolean | Whether to throttle the added broker.
Boolean allowCapacityEstimation = true; // Boolean | Whether to allow capacity estimation when cruise-control is unable to obtain all per-broker capacity information.
array[String] goals = ; // array[String] | List of goals used to generate proposal, the default goals will be used if this parameter is not specified.
Integer concurrentPartitionMovementsPerBroker = 56; // Integer | The upper bound of ongoing replica movements going into/out of each broker.
Integer maxPartitionMovementsInCluster = 56; // Integer | Change upper bound of ongoing inter broker partition movements in cluster.
Integer concurrentLeaderMovements = 56; // Integer | The upper bound of cluster ongoing leadership movements.
Integer brokerConcurrentLeaderMovements = 56; // Integer | The upper bound of per broker ongoing leadership movements.
Boolean json = true; // Boolean | Whether to return in JSON format or not.
Boolean skipHardGoalCheck = true; // Boolean | Whether to allow hard goals be skipped in proposal generation.
String excludedTopics = excludedTopics_example; // String | Specify topic whose partition is excluded from replica movement.
Boolean kafkaAssigner = true; // Boolean | Whether to use Kafka assigner mode to generate proposals.
Boolean useReadyDefaultGoals = true; // Boolean | Whether to only use ready goals to generate proposal.
Boolean verbose = true; // Boolean | Return detailed state information.
Boolean excludeRecentlyDemotedBrokers = true; // Boolean | Whether to allow leader replicas to be moved to recently demoted brokers.
Boolean excludeRecentlyRemovedBrokers = true; // Boolean | Whether to allow replicas to be moved to recently removed broker.
array[String] replicaMovementStrategies = ; // array[String] | Replica movement strategies to use.
Long executionProgressCheckIntervalMs = 789; // Long | Execution progress check interval in milliseconds.
Boolean stopOngoingExecution = true; // Boolean | Whether to stop the ongoing execution (if any) and start executing the given request.
String reason = reason_example; // String | Reason for request.
Integer reviewId = 56; // Integer | Review id for 2-step verification.
String dataFrom = dataFrom_example; // String | Whether to calculate proposal from available valid partitions or valid windows.
Long replicationThrottle = 789; // Long | Upper bound on the bandwidth in bytes per second used to move replicas.
Boolean getResponseSchema = true; // Boolean | Whether to return JSON schema in response header or not.
String doAs = doAs_example; // String | The user specified by a trusted proxy in that authentication model.
Boolean fastMode = true; // Boolean | True to compute proposals in fast mode, false otherwise
try {
OptimizationResult result = apiInstance.addBroker(brokerid, dryrun, throttleAddedBroker, allowCapacityEstimation, goals, concurrentPartitionMovementsPerBroker, maxPartitionMovementsInCluster, concurrentLeaderMovements, brokerConcurrentLeaderMovements, json, skipHardGoalCheck, excludedTopics, kafkaAssigner, useReadyDefaultGoals, verbose, excludeRecentlyDemotedBrokers, excludeRecentlyRemovedBrokers, replicaMovementStrategies, executionProgressCheckIntervalMs, stopOngoingExecution, reason, reviewId, dataFrom, replicationThrottle, getResponseSchema, doAs, fastMode);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#addBroker");
e.printStackTrace();
}
}
}
import io.swagger.client.api.DefaultApi;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
array[Integer] brokerid = ; // array[Integer] | List of target broker ids.
Boolean dryrun = true; // Boolean | Whether to dry-run the request or not.
Boolean throttleAddedBroker = true; // Boolean | Whether to throttle the added broker.
Boolean allowCapacityEstimation = true; // Boolean | Whether to allow capacity estimation when cruise-control is unable to obtain all per-broker capacity information.
array[String] goals = ; // array[String] | List of goals used to generate proposal, the default goals will be used if this parameter is not specified.
Integer concurrentPartitionMovementsPerBroker = 56; // Integer | The upper bound of ongoing replica movements going into/out of each broker.
Integer maxPartitionMovementsInCluster = 56; // Integer | Change upper bound of ongoing inter broker partition movements in cluster.
Integer concurrentLeaderMovements = 56; // Integer | The upper bound of cluster ongoing leadership movements.
Integer brokerConcurrentLeaderMovements = 56; // Integer | The upper bound of per broker ongoing leadership movements.
Boolean json = true; // Boolean | Whether to return in JSON format or not.
Boolean skipHardGoalCheck = true; // Boolean | Whether to allow hard goals be skipped in proposal generation.
String excludedTopics = excludedTopics_example; // String | Specify topic whose partition is excluded from replica movement.
Boolean kafkaAssigner = true; // Boolean | Whether to use Kafka assigner mode to generate proposals.
Boolean useReadyDefaultGoals = true; // Boolean | Whether to only use ready goals to generate proposal.
Boolean verbose = true; // Boolean | Return detailed state information.
Boolean excludeRecentlyDemotedBrokers = true; // Boolean | Whether to allow leader replicas to be moved to recently demoted brokers.
Boolean excludeRecentlyRemovedBrokers = true; // Boolean | Whether to allow replicas to be moved to recently removed broker.
array[String] replicaMovementStrategies = ; // array[String] | Replica movement strategies to use.
Long executionProgressCheckIntervalMs = 789; // Long | Execution progress check interval in milliseconds.
Boolean stopOngoingExecution = true; // Boolean | Whether to stop the ongoing execution (if any) and start executing the given request.
String reason = reason_example; // String | Reason for request.
Integer reviewId = 56; // Integer | Review id for 2-step verification.
String dataFrom = dataFrom_example; // String | Whether to calculate proposal from available valid partitions or valid windows.
Long replicationThrottle = 789; // Long | Upper bound on the bandwidth in bytes per second used to move replicas.
Boolean getResponseSchema = true; // Boolean | Whether to return JSON schema in response header or not.
String doAs = doAs_example; // String | The user specified by a trusted proxy in that authentication model.
Boolean fastMode = true; // Boolean | True to compute proposals in fast mode, false otherwise
try {
OptimizationResult result = apiInstance.addBroker(brokerid, dryrun, throttleAddedBroker, allowCapacityEstimation, goals, concurrentPartitionMovementsPerBroker, maxPartitionMovementsInCluster, concurrentLeaderMovements, brokerConcurrentLeaderMovements, json, skipHardGoalCheck, excludedTopics, kafkaAssigner, useReadyDefaultGoals, verbose, excludeRecentlyDemotedBrokers, excludeRecentlyRemovedBrokers, replicaMovementStrategies, executionProgressCheckIntervalMs, stopOngoingExecution, reason, reviewId, dataFrom, replicationThrottle, getResponseSchema, doAs, fastMode);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#addBroker");
e.printStackTrace();
}
}
}
array[Integer] *brokerid = ; // List of target broker ids.
Boolean *dryrun = true; // Whether to dry-run the request or not. (optional) (default to true)
Boolean *throttleAddedBroker = true; // Whether to throttle the added broker. (optional) (default to true)
Boolean *allowCapacityEstimation = true; // Whether to allow capacity estimation when cruise-control is unable to obtain all per-broker capacity information. (optional) (default to true)
array[String] *goals = ; // List of goals used to generate proposal, the default goals will be used if this parameter is not specified. (optional)
Integer *concurrentPartitionMovementsPerBroker = 56; // The upper bound of ongoing replica movements going into/out of each broker. (optional) (default to 5)
Integer *maxPartitionMovementsInCluster = 56; // Change upper bound of ongoing inter broker partition movements in cluster. (optional)
Integer *concurrentLeaderMovements = 56; // The upper bound of cluster ongoing leadership movements. (optional) (default to 1000)
Integer *brokerConcurrentLeaderMovements = 56; // The upper bound of per broker ongoing leadership movements. (optional) (default to 250)
Boolean *json = true; // Whether to return in JSON format or not. (optional) (default to false)
Boolean *skipHardGoalCheck = true; // Whether to allow hard goals be skipped in proposal generation. (optional) (default to false)
String *excludedTopics = excludedTopics_example; // Specify topic whose partition is excluded from replica movement. (optional)
Boolean *kafkaAssigner = true; // Whether to use Kafka assigner mode to generate proposals. (optional) (default to false)
Boolean *useReadyDefaultGoals = true; // Whether to only use ready goals to generate proposal. (optional) (default to false)
Boolean *verbose = true; // Return detailed state information. (optional) (default to false)
Boolean *excludeRecentlyDemotedBrokers = true; // Whether to allow leader replicas to be moved to recently demoted brokers. (optional) (default to false)
Boolean *excludeRecentlyRemovedBrokers = true; // Whether to allow replicas to be moved to recently removed broker. (optional) (default to false)
array[String] *replicaMovementStrategies = ; // Replica movement strategies to use. (optional)
Long *executionProgressCheckIntervalMs = 789; // Execution progress check interval in milliseconds. (optional)
Boolean *stopOngoingExecution = true; // Whether to stop the ongoing execution (if any) and start executing the given request. (optional) (default to false)
String *reason = reason_example; // Reason for request. (optional)
Integer *reviewId = 56; // Review id for 2-step verification. (optional)
String *dataFrom = dataFrom_example; // Whether to calculate proposal from available valid partitions or valid windows. (optional) (default to VALID_WINDOWS)
Long *replicationThrottle = 789; // Upper bound on the bandwidth in bytes per second used to move replicas. (optional)
Boolean *getResponseSchema = true; // Whether to return JSON schema in response header or not. (optional) (default to false)
String *doAs = doAs_example; // The user specified by a trusted proxy in that authentication model. (optional)
Boolean *fastMode = true; // True to compute proposals in fast mode, false otherwise (optional) (default to true)
DefaultApi *apiInstance = [[DefaultApi alloc] init];
// Move partitions to the specified brokers, according to the specified goals.
[apiInstance addBrokerWith:brokerid
dryrun:dryrun
throttleAddedBroker:throttleAddedBroker
allowCapacityEstimation:allowCapacityEstimation
goals:goals
concurrentPartitionMovementsPerBroker:concurrentPartitionMovementsPerBroker
maxPartitionMovementsInCluster:maxPartitionMovementsInCluster
concurrentLeaderMovements:concurrentLeaderMovements
brokerConcurrentLeaderMovements:brokerConcurrentLeaderMovements
json:json
skipHardGoalCheck:skipHardGoalCheck
excludedTopics:excludedTopics
kafkaAssigner:kafkaAssigner
useReadyDefaultGoals:useReadyDefaultGoals
verbose:verbose
excludeRecentlyDemotedBrokers:excludeRecentlyDemotedBrokers
excludeRecentlyRemovedBrokers:excludeRecentlyRemovedBrokers
replicaMovementStrategies:replicaMovementStrategies
executionProgressCheckIntervalMs:executionProgressCheckIntervalMs
stopOngoingExecution:stopOngoingExecution
reason:reason
reviewId:reviewId
dataFrom:dataFrom
replicationThrottle:replicationThrottle
getResponseSchema:getResponseSchema
doAs:doAs
fastMode:fastMode
completionHandler: ^(OptimizationResult output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var CruiseControlApi = require('cruise_control_api');
var api = new CruiseControlApi.DefaultApi()
var brokerid = ; // {{array[Integer]}} List of target broker ids.
var opts = {
'dryrun': true, // {{Boolean}} Whether to dry-run the request or not.
'throttleAddedBroker': true, // {{Boolean}} Whether to throttle the added broker.
'allowCapacityEstimation': true, // {{Boolean}} Whether to allow capacity estimation when cruise-control is unable to obtain all per-broker capacity information.
'goals': , // {{array[String]}} List of goals used to generate proposal, the default goals will be used if this parameter is not specified.
'concurrentPartitionMovementsPerBroker': 56, // {{Integer}} The upper bound of ongoing replica movements going into/out of each broker.
'maxPartitionMovementsInCluster': 56, // {{Integer}} Change upper bound of ongoing inter broker partition movements in cluster.
'concurrentLeaderMovements': 56, // {{Integer}} The upper bound of cluster ongoing leadership movements.
'brokerConcurrentLeaderMovements': 56, // {{Integer}} The upper bound of per broker ongoing leadership movements.
'json': true, // {{Boolean}} Whether to return in JSON format or not.
'skipHardGoalCheck': true, // {{Boolean}} Whether to allow hard goals be skipped in proposal generation.
'excludedTopics': excludedTopics_example, // {{String}} Specify topic whose partition is excluded from replica movement.
'kafkaAssigner': true, // {{Boolean}} Whether to use Kafka assigner mode to generate proposals.
'useReadyDefaultGoals': true, // {{Boolean}} Whether to only use ready goals to generate proposal.
'verbose': true, // {{Boolean}} Return detailed state information.
'excludeRecentlyDemotedBrokers': true, // {{Boolean}} Whether to allow leader replicas to be moved to recently demoted brokers.
'excludeRecentlyRemovedBrokers': true, // {{Boolean}} Whether to allow replicas to be moved to recently removed broker.
'replicaMovementStrategies': , // {{array[String]}} Replica movement strategies to use.
'executionProgressCheckIntervalMs': 789, // {{Long}} Execution progress check interval in milliseconds.
'stopOngoingExecution': true, // {{Boolean}} Whether to stop the ongoing execution (if any) and start executing the given request.
'reason': reason_example, // {{String}} Reason for request.
'reviewId': 56, // {{Integer}} Review id for 2-step verification.
'dataFrom': dataFrom_example, // {{String}} Whether to calculate proposal from available valid partitions or valid windows.
'replicationThrottle': 789, // {{Long}} Upper bound on the bandwidth in bytes per second used to move replicas.
'getResponseSchema': true, // {{Boolean}} Whether to return JSON schema in response header or not.
'doAs': doAs_example, // {{String}} The user specified by a trusted proxy in that authentication model.
'fastMode': true // {{Boolean}} True to compute proposals in fast mode, false otherwise
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.addBroker(brokerid, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class addBrokerExample
{
public void main()
{
var apiInstance = new DefaultApi();
var brokerid = new array[Integer](); // array[Integer] | List of target broker ids.
var dryrun = true; // Boolean | Whether to dry-run the request or not. (optional) (default to true)
var throttleAddedBroker = true; // Boolean | Whether to throttle the added broker. (optional) (default to true)
var allowCapacityEstimation = true; // Boolean | Whether to allow capacity estimation when cruise-control is unable to obtain all per-broker capacity information. (optional) (default to true)
var goals = new array[String](); // array[String] | List of goals used to generate proposal, the default goals will be used if this parameter is not specified. (optional)
var concurrentPartitionMovementsPerBroker = 56; // Integer | The upper bound of ongoing replica movements going into/out of each broker. (optional) (default to 5)
var maxPartitionMovementsInCluster = 56; // Integer | Change upper bound of ongoing inter broker partition movements in cluster. (optional)
var concurrentLeaderMovements = 56; // Integer | The upper bound of cluster ongoing leadership movements. (optional) (default to 1000)
var brokerConcurrentLeaderMovements = 56; // Integer | The upper bound of per broker ongoing leadership movements. (optional) (default to 250)
var json = true; // Boolean | Whether to return in JSON format or not. (optional) (default to false)
var skipHardGoalCheck = true; // Boolean | Whether to allow hard goals be skipped in proposal generation. (optional) (default to false)
var excludedTopics = excludedTopics_example; // String | Specify topic whose partition is excluded from replica movement. (optional)
var kafkaAssigner = true; // Boolean | Whether to use Kafka assigner mode to generate proposals. (optional) (default to false)
var useReadyDefaultGoals = true; // Boolean | Whether to only use ready goals to generate proposal. (optional) (default to false)
var verbose = true; // Boolean | Return detailed state information. (optional) (default to false)
var excludeRecentlyDemotedBrokers = true; // Boolean | Whether to allow leader replicas to be moved to recently demoted brokers. (optional) (default to false)
var excludeRecentlyRemovedBrokers = true; // Boolean | Whether to allow replicas to be moved to recently removed broker. (optional) (default to false)
var replicaMovementStrategies = new array[String](); // array[String] | Replica movement strategies to use. (optional)
var executionProgressCheckIntervalMs = 789; // Long | Execution progress check interval in milliseconds. (optional)
var stopOngoingExecution = true; // Boolean | Whether to stop the ongoing execution (if any) and start executing the given request. (optional) (default to false)
var reason = reason_example; // String | Reason for request. (optional)
var reviewId = 56; // Integer | Review id for 2-step verification. (optional)
var dataFrom = dataFrom_example; // String | Whether to calculate proposal from available valid partitions or valid windows. (optional) (default to VALID_WINDOWS)
var replicationThrottle = 789; // Long | Upper bound on the bandwidth in bytes per second used to move replicas. (optional)
var getResponseSchema = true; // Boolean | Whether to return JSON schema in response header or not. (optional) (default to false)
var doAs = doAs_example; // String | The user specified by a trusted proxy in that authentication model. (optional)
var fastMode = true; // Boolean | True to compute proposals in fast mode, false otherwise (optional) (default to true)
try
{
// Move partitions to the specified brokers, according to the specified goals.
OptimizationResult result = apiInstance.addBroker(brokerid, dryrun, throttleAddedBroker, allowCapacityEstimation, goals, concurrentPartitionMovementsPerBroker, maxPartitionMovementsInCluster, concurrentLeaderMovements, brokerConcurrentLeaderMovements, json, skipHardGoalCheck, excludedTopics, kafkaAssigner, useReadyDefaultGoals, verbose, excludeRecentlyDemotedBrokers, excludeRecentlyRemovedBrokers, replicaMovementStrategies, executionProgressCheckIntervalMs, stopOngoingExecution, reason, reviewId, dataFrom, replicationThrottle, getResponseSchema, doAs, fastMode);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling DefaultApi.addBroker: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiDefaultApi();
$brokerid = ; // array[Integer] | List of target broker ids.
$dryrun = true; // Boolean | Whether to dry-run the request or not.
$throttleAddedBroker = true; // Boolean | Whether to throttle the added broker.
$allowCapacityEstimation = true; // Boolean | Whether to allow capacity estimation when cruise-control is unable to obtain all per-broker capacity information.
$goals = ; // array[String] | List of goals used to generate proposal, the default goals will be used if this parameter is not specified.
$concurrentPartitionMovementsPerBroker = 56; // Integer | The upper bound of ongoing replica movements going into/out of each broker.
$maxPartitionMovementsInCluster = 56; // Integer | Change upper bound of ongoing inter broker partition movements in cluster.
$concurrentLeaderMovements = 56; // Integer | The upper bound of cluster ongoing leadership movements.
$brokerConcurrentLeaderMovements = 56; // Integer | The upper bound of per broker ongoing leadership movements.
$json = true; // Boolean | Whether to return in JSON format or not.
$skipHardGoalCheck = true; // Boolean | Whether to allow hard goals be skipped in proposal generation.
$excludedTopics = excludedTopics_example; // String | Specify topic whose partition is excluded from replica movement.
$kafkaAssigner = true; // Boolean | Whether to use Kafka assigner mode to generate proposals.
$useReadyDefaultGoals = true; // Boolean | Whether to only use ready goals to generate proposal.
$verbose = true; // Boolean | Return detailed state information.
$excludeRecentlyDemotedBrokers = true; // Boolean | Whether to allow leader replicas to be moved to recently demoted brokers.
$excludeRecentlyRemovedBrokers = true; // Boolean | Whether to allow replicas to be moved to recently removed broker.
$replicaMovementStrategies = ; // array[String] | Replica movement strategies to use.
$executionProgressCheckIntervalMs = 789; // Long | Execution progress check interval in milliseconds.
$stopOngoingExecution = true; // Boolean | Whether to stop the ongoing execution (if any) and start executing the given request.
$reason = reason_example; // String | Reason for request.
$reviewId = 56; // Integer | Review id for 2-step verification.
$dataFrom = dataFrom_example; // String | Whether to calculate proposal from available valid partitions or valid windows.
$replicationThrottle = 789; // Long | Upper bound on the bandwidth in bytes per second used to move replicas.
$getResponseSchema = true; // Boolean | Whether to return JSON schema in response header or not.
$doAs = doAs_example; // String | The user specified by a trusted proxy in that authentication model.
$fastMode = true; // Boolean | True to compute proposals in fast mode, false otherwise
try {
$result = $api_instance->addBroker($brokerid, $dryrun, $throttleAddedBroker, $allowCapacityEstimation, $goals, $concurrentPartitionMovementsPerBroker, $maxPartitionMovementsInCluster, $concurrentLeaderMovements, $brokerConcurrentLeaderMovements, $json, $skipHardGoalCheck, $excludedTopics, $kafkaAssigner, $useReadyDefaultGoals, $verbose, $excludeRecentlyDemotedBrokers, $excludeRecentlyRemovedBrokers, $replicaMovementStrategies, $executionProgressCheckIntervalMs, $stopOngoingExecution, $reason, $reviewId, $dataFrom, $replicationThrottle, $getResponseSchema, $doAs, $fastMode);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->addBroker: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DefaultApi;
my $api_instance = WWW::SwaggerClient::DefaultApi->new();
my $brokerid = []; # array[Integer] | List of target broker ids.
my $dryrun = true; # Boolean | Whether to dry-run the request or not.
my $throttleAddedBroker = true; # Boolean | Whether to throttle the added broker.
my $allowCapacityEstimation = true; # Boolean | Whether to allow capacity estimation when cruise-control is unable to obtain all per-broker capacity information.
my $goals = []; # array[String] | List of goals used to generate proposal, the default goals will be used if this parameter is not specified.
my $concurrentPartitionMovementsPerBroker = 56; # Integer | The upper bound of ongoing replica movements going into/out of each broker.
my $maxPartitionMovementsInCluster = 56; # Integer | Change upper bound of ongoing inter broker partition movements in cluster.
my $concurrentLeaderMovements = 56; # Integer | The upper bound of cluster ongoing leadership movements.
my $brokerConcurrentLeaderMovements = 56; # Integer | The upper bound of per broker ongoing leadership movements.
my $json = true; # Boolean | Whether to return in JSON format or not.
my $skipHardGoalCheck = true; # Boolean | Whether to allow hard goals be skipped in proposal generation.
my $excludedTopics = excludedTopics_example; # String | Specify topic whose partition is excluded from replica movement.
my $kafkaAssigner = true; # Boolean | Whether to use Kafka assigner mode to generate proposals.
my $useReadyDefaultGoals = true; # Boolean | Whether to only use ready goals to generate proposal.
my $verbose = true; # Boolean | Return detailed state information.
my $excludeRecentlyDemotedBrokers = true; # Boolean | Whether to allow leader replicas to be moved to recently demoted brokers.
my $excludeRecentlyRemovedBrokers = true; # Boolean | Whether to allow replicas to be moved to recently removed broker.
my $replicaMovementStrategies = []; # array[String] | Replica movement strategies to use.
my $executionProgressCheckIntervalMs = 789; # Long | Execution progress check interval in milliseconds.
my $stopOngoingExecution = true; # Boolean | Whether to stop the ongoing execution (if any) and start executing the given request.
my $reason = reason_example; # String | Reason for request.
my $reviewId = 56; # Integer | Review id for 2-step verification.
my $dataFrom = dataFrom_example; # String | Whether to calculate proposal from available valid partitions or valid windows.
my $replicationThrottle = 789; # Long | Upper bound on the bandwidth in bytes per second used to move replicas.
my $getResponseSchema = true; # Boolean | Whether to return JSON schema in response header or not.
my $doAs = doAs_example; # String | The user specified by a trusted proxy in that authentication model.
my $fastMode = true; # Boolean | True to compute proposals in fast mode, false otherwise
eval {
my $result = $api_instance->addBroker(brokerid => $brokerid, dryrun => $dryrun, throttleAddedBroker => $throttleAddedBroker, allowCapacityEstimation => $allowCapacityEstimation, goals => $goals, concurrentPartitionMovementsPerBroker => $concurrentPartitionMovementsPerBroker, maxPartitionMovementsInCluster => $maxPartitionMovementsInCluster, concurrentLeaderMovements => $concurrentLeaderMovements, brokerConcurrentLeaderMovements => $brokerConcurrentLeaderMovements, json => $json, skipHardGoalCheck => $skipHardGoalCheck, excludedTopics => $excludedTopics, kafkaAssigner => $kafkaAssigner, useReadyDefaultGoals => $useReadyDefaultGoals, verbose => $verbose, excludeRecentlyDemotedBrokers => $excludeRecentlyDemotedBrokers, excludeRecentlyRemovedBrokers => $excludeRecentlyRemovedBrokers, replicaMovementStrategies => $replicaMovementStrategies, executionProgressCheckIntervalMs => $executionProgressCheckIntervalMs, stopOngoingExecution => $stopOngoingExecution, reason => $reason, reviewId => $reviewId, dataFrom => $dataFrom, replicationThrottle => $replicationThrottle, getResponseSchema => $getResponseSchema, doAs => $doAs, fastMode => $fastMode);
print Dumper($result);
};
if ($@) {
warn "Exception when calling DefaultApi->addBroker: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.DefaultApi()
brokerid = # array[Integer] | List of target broker ids.
dryrun = true # Boolean | Whether to dry-run the request or not. (optional) (default to true)
throttleAddedBroker = true # Boolean | Whether to throttle the added broker. (optional) (default to true)
allowCapacityEstimation = true # Boolean | Whether to allow capacity estimation when cruise-control is unable to obtain all per-broker capacity information. (optional) (default to true)
goals = # array[String] | List of goals used to generate proposal, the default goals will be used if this parameter is not specified. (optional)
concurrentPartitionMovementsPerBroker = 56 # Integer | The upper bound of ongoing replica movements going into/out of each broker. (optional) (default to 5)
maxPartitionMovementsInCluster = 56 # Integer | Change upper bound of ongoing inter broker partition movements in cluster. (optional)
concurrentLeaderMovements = 56 # Integer | The upper bound of cluster ongoing leadership movements. (optional) (default to 1000)
brokerConcurrentLeaderMovements = 56 # Integer | The upper bound of per broker ongoing leadership movements. (optional) (default to 250)
json = true # Boolean | Whether to return in JSON format or not. (optional) (default to false)
skipHardGoalCheck = true # Boolean | Whether to allow hard goals be skipped in proposal generation. (optional) (default to false)
excludedTopics = excludedTopics_example # String | Specify topic whose partition is excluded from replica movement. (optional)
kafkaAssigner = true # Boolean | Whether to use Kafka assigner mode to generate proposals. (optional) (default to false)
useReadyDefaultGoals = true # Boolean | Whether to only use ready goals to generate proposal. (optional) (default to false)
verbose = true # Boolean | Return detailed state information. (optional) (default to false)
excludeRecentlyDemotedBrokers = true # Boolean | Whether to allow leader replicas to be moved to recently demoted brokers. (optional) (default to false)
excludeRecentlyRemovedBrokers = true # Boolean | Whether to allow replicas to be moved to recently removed broker. (optional) (default to false)
replicaMovementStrategies = # array[String] | Replica movement strategies to use. (optional)
executionProgressCheckIntervalMs = 789 # Long | Execution progress check interval in milliseconds. (optional)
stopOngoingExecution = true # Boolean | Whether to stop the ongoing execution (if any) and start executing the given request. (optional) (default to false)
reason = reason_example # String | Reason for request. (optional)
reviewId = 56 # Integer | Review id for 2-step verification. (optional)
dataFrom = dataFrom_example # String | Whether to calculate proposal from available valid partitions or valid windows. (optional) (default to VALID_WINDOWS)
replicationThrottle = 789 # Long | Upper bound on the bandwidth in bytes per second used to move replicas. (optional)
getResponseSchema = true # Boolean | Whether to return JSON schema in response header or not. (optional) (default to false)
doAs = doAs_example # String | The user specified by a trusted proxy in that authentication model. (optional)
fastMode = true # Boolean | True to compute proposals in fast mode, false otherwise (optional) (default to true)
try:
# Move partitions to the specified brokers, according to the specified goals.
api_response = api_instance.add_broker(brokerid, dryrun=dryrun, throttleAddedBroker=throttleAddedBroker, allowCapacityEstimation=allowCapacityEstimation, goals=goals, concurrentPartitionMovementsPerBroker=concurrentPartitionMovementsPerBroker, maxPartitionMovementsInCluster=maxPartitionMovementsInCluster, concurrentLeaderMovements=concurrentLeaderMovements, brokerConcurrentLeaderMovements=brokerConcurrentLeaderMovements, json=json, skipHardGoalCheck=skipHardGoalCheck, excludedTopics=excludedTopics, kafkaAssigner=kafkaAssigner, useReadyDefaultGoals=useReadyDefaultGoals, verbose=verbose, excludeRecentlyDemotedBrokers=excludeRecentlyDemotedBrokers, excludeRecentlyRemovedBrokers=excludeRecentlyRemovedBrokers, replicaMovementStrategies=replicaMovementStrategies, executionProgressCheckIntervalMs=executionProgressCheckIntervalMs, stopOngoingExecution=stopOngoingExecution, reason=reason, reviewId=reviewId, dataFrom=dataFrom, replicationThrottle=replicationThrottle, getResponseSchema=getResponseSchema, doAs=doAs, fastMode=fastMode)
pprint(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->addBroker: %s\n" % e)
Parameters
Name | Description |
---|---|
brokerid* |
array[Integer]
List of target broker ids.
Required
|
dryrun |
Boolean
Whether to dry-run the request or not.
|
throttle_added_broker |
Boolean
Whether to throttle the added broker.
|
allow_capacity_estimation |
Boolean
Whether to allow capacity estimation when cruise-control is unable to obtain all per-broker capacity information.
|
goals |
array[String]
List of goals used to generate proposal, the default goals will be used if this parameter is not specified.
|
concurrent_partition_movements_per_broker |
Integer
(int32)
The upper bound of ongoing replica movements going into/out of each broker.
|
max_partition_movements_in_cluster |
Integer
(int32)
Change upper bound of ongoing inter broker partition movements in cluster.
|
concurrent_leader_movements |
Integer
(int32)
The upper bound of cluster ongoing leadership movements.
|
broker_concurrent_leader_movements |
Integer
(int32)
The upper bound of per broker ongoing leadership movements.
|
json |
Boolean
Whether to return in JSON format or not.
|
skip_hard_goal_check |
Boolean
Whether to allow hard goals be skipped in proposal generation.
|
excluded_topics |
String
Specify topic whose partition is excluded from replica movement.
|
kafka_assigner |
Boolean
Whether to use Kafka assigner mode to generate proposals.
|
use_ready_default_goals |
Boolean
Whether to only use ready goals to generate proposal.
|
verbose |
Boolean
Return detailed state information.
|
exclude_recently_demoted_brokers |
Boolean
Whether to allow leader replicas to be moved to recently demoted brokers.
|
exclude_recently_removed_brokers |
Boolean
Whether to allow replicas to be moved to recently removed broker.
|
replica_movement_strategies |
array[String]
Replica movement strategies to use.
|
execution_progress_check_interval_ms |
Long
(int64)
Execution progress check interval in milliseconds.
|
stop_ongoing_execution |
Boolean
Whether to stop the ongoing execution (if any) and start executing the given request.
|
reason |
String
Reason for request.
|
review_id |
Integer
(int32)
Review id for 2-step verification.
|
data_from |
String
Whether to calculate proposal from available valid partitions or valid windows.
|
replication_throttle |
Long
(int64)
Upper bound on the bandwidth in bytes per second used to move replicas.
|
get_response_schema |
Boolean
Whether to return JSON schema in response header or not.
|
doAs |
String
The user specified by a trusted proxy in that authentication model.
|
fast_mode |
Boolean
True to compute proposals in fast mode, false otherwise
|