addBroker
Move partitions to the specified brokers, according to the specified goals.
/add_broker
Usage and SDK Samples
curl -X POST \
-H "Authorization: Basic [[basicHash]]" \
-H "Accept: application/json,text/plain" \
"http://localhost/kafkacruisecontrol/add_broker?brokerid=&dryrun=true&throttle_added_broker=true&allow_capacity_estimation=true&goals=["RackAwareGoal","ReplicaCapacityGoal","ReplicaDistributionGoal"]&concurrent_partition_movements_per_broker=56&max_partition_movements_in_cluster=56&concurrent_leader_movements=56&broker_concurrent_leader_movements=56&json=true&skip_hard_goal_check=true&excluded_topics=__CruiseControl.%2A&kafka_assigner=true&use_ready_default_goals=true&verbose=true&exclude_recently_demoted_brokers=true&exclude_recently_removed_brokers=true&replica_movement_strategies=["PrioritizeLargeReplicaMovementStrategy","PostponeUrpReplicaMovementStrategy"]&execution_progress_check_interval_ms=789&stop_ongoing_execution=true&reason=reason_example&review_id=56&data_from=dataFrom_example&replication_throttle=789&get_response_schema=true&doAs=doAs_example&fast_mode=true"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.DefaultApi;
import java.io.File;
import java.util.*;
public class DefaultApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
// Create an instance of the API class
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 = ["RackAwareGoal","ReplicaCapacityGoal","ReplicaDistributionGoal"]; // 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 = __CruiseControl.%2A; // 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 = ["PrioritizeLargeReplicaMovementStrategy","PostponeUrpReplicaMovementStrategy"]; // 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 'package:openapi/api.dart';
final api_instance = DefaultApi();
final array[Integer] brokerid = new array[Integer](); // array[Integer] | List of target broker ids.
final Boolean dryrun = new Boolean(); // Boolean | Whether to dry-run the request or not.
final Boolean throttleAddedBroker = new Boolean(); // Boolean | Whether to throttle the added broker.
final Boolean allowCapacityEstimation = new Boolean(); // Boolean | Whether to allow capacity estimation when cruise-control is unable to obtain all per-broker capacity information.
final array[String] 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.
final Integer concurrentPartitionMovementsPerBroker = new Integer(); // Integer | The upper bound of ongoing replica movements going into/out of each broker.
final Integer maxPartitionMovementsInCluster = new Integer(); // Integer | Change upper bound of ongoing inter broker partition movements in cluster.
final Integer concurrentLeaderMovements = new Integer(); // Integer | The upper bound of cluster ongoing leadership movements.
final Integer brokerConcurrentLeaderMovements = new Integer(); // Integer | The upper bound of per broker ongoing leadership movements.
final Boolean json = new Boolean(); // Boolean | Whether to return in JSON format or not.
final Boolean skipHardGoalCheck = new Boolean(); // Boolean | Whether to allow hard goals be skipped in proposal generation.
final String excludedTopics = new String(); // String | Specify topic whose partition is excluded from replica movement.
final Boolean kafkaAssigner = new Boolean(); // Boolean | Whether to use Kafka assigner mode to generate proposals.
final Boolean useReadyDefaultGoals = new Boolean(); // Boolean | Whether to only use ready goals to generate proposal.
final Boolean verbose = new Boolean(); // Boolean | Return detailed state information.
final Boolean excludeRecentlyDemotedBrokers = new Boolean(); // Boolean | Whether to allow leader replicas to be moved to recently demoted brokers.
final Boolean excludeRecentlyRemovedBrokers = new Boolean(); // Boolean | Whether to allow replicas to be moved to recently removed broker.
final array[String] replicaMovementStrategies = new array[String](); // array[String] | Replica movement strategies to use.
final Long executionProgressCheckIntervalMs = new Long(); // Long | Execution progress check interval in milliseconds.
final Boolean stopOngoingExecution = new Boolean(); // Boolean | Whether to stop the ongoing execution (if any) and start executing the given request.
final String reason = new String(); // String | Reason for request.
final Integer reviewId = new Integer(); // Integer | Review id for 2-step verification.
final String dataFrom = new String(); // String | Whether to calculate proposal from available valid partitions or valid windows.
final Long replicationThrottle = new Long(); // Long | Upper bound on the bandwidth in bytes per second used to move replicas.
final Boolean getResponseSchema = new Boolean(); // Boolean | Whether to return JSON schema in response header or not.
final String doAs = new String(); // String | The user specified by a trusted proxy in that authentication model.
final Boolean fastMode = new Boolean(); // Boolean | True to compute proposals in fast mode, false otherwise
try {
final result = await 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(result);
} catch (e) {
print('Exception when calling DefaultApi->addBroker: $e\n');
}
import org.openapitools.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 = ["RackAwareGoal","ReplicaCapacityGoal","ReplicaDistributionGoal"]; // 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 = __CruiseControl.%2A; // 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 = ["PrioritizeLargeReplicaMovementStrategy","PostponeUrpReplicaMovementStrategy"]; // 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();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: basicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];
// Create an instance of the API class
DefaultApi *apiInstance = [[DefaultApi alloc] init];
array[Integer] *brokerid = ; // List of target broker ids. (default to null)
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 = ["RackAwareGoal","ReplicaCapacityGoal","ReplicaDistributionGoal"]; // List of goals used to generate proposal, the default goals will be used if this parameter is not specified. (optional) (default to null)
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) (default to null)
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 = __CruiseControl.%2A; // Specify topic whose partition is excluded from replica movement. (optional) (default to null)
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 = ["PrioritizeLargeReplicaMovementStrategy","PostponeUrpReplicaMovementStrategy"]; // Replica movement strategies to use. (optional) (default to null)
Long *executionProgressCheckIntervalMs = 789; // Execution progress check interval in milliseconds. (optional) (default to null)
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) (default to null)
Integer *reviewId = 56; // Review id for 2-step verification. (optional) (default to null)
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) (default to null)
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) (default to null)
Boolean *fastMode = true; // True to compute proposals in fast mode, false otherwise (optional) (default to true)
// 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 defaultClient = CruiseControlApi.ApiClient.instance;
// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';
// Create an instance of the API class
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': ["RackAwareGoal","ReplicaCapacityGoal","ReplicaDistributionGoal"], // {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': __CruiseControl.%2A, // {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': ["PrioritizeLargeReplicaMovementStrategy","PostponeUrpReplicaMovementStrategy"], // {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 Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class addBrokerExample
{
public void main()
{
// Configure HTTP basic authorization: basicAuth
Configuration.Default.Username = "YOUR_USERNAME";
Configuration.Default.Password = "YOUR_PASSWORD";
// Create an instance of the API class
var apiInstance = new DefaultApi();
var brokerid = new array[Integer](); // array[Integer] | List of target broker ids. (default to null)
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) (default to null)
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) (default to null)
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 = __CruiseControl.%2A; // String | Specify topic whose partition is excluded from replica movement. (optional) (default to null)
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) (default to null)
var executionProgressCheckIntervalMs = 789; // Long | Execution progress check interval in milliseconds. (optional) (default to null)
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) (default to null)
var reviewId = 56; // Integer | Review id for 2-step verification. (optional) (default to null)
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) (default to null)
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) (default to null)
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');
// Configure HTTP basic authorization: basicAuth
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\DefaultApi();
$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 = ["RackAwareGoal","ReplicaCapacityGoal","ReplicaDistributionGoal"]; // 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 = __CruiseControl.%2A; // 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 = ["PrioritizeLargeReplicaMovementStrategy","PostponeUrpReplicaMovementStrategy"]; // 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::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::DefaultApi;
# Configure HTTP basic authorization: basicAuth
$WWW::OPenAPIClient::Configuration::username = 'YOUR_USERNAME';
$WWW::OPenAPIClient::Configuration::password = 'YOUR_PASSWORD';
# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::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 = [["RackAwareGoal","ReplicaCapacityGoal","ReplicaDistributionGoal"]]; # 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 = __CruiseControl.%2A; # 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 = [["PrioritizeLargeReplicaMovementStrategy","PostponeUrpReplicaMovementStrategy"]]; # 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 openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
openapi_client.configuration.username = 'YOUR_USERNAME'
openapi_client.configuration.password = 'YOUR_PASSWORD'
# Create an instance of the API class
api_instance = openapi_client.DefaultApi()
brokerid = # array[Integer] | List of target broker ids. (default to null)
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 = ["RackAwareGoal","ReplicaCapacityGoal","ReplicaDistributionGoal"] # array[String] | List of goals used to generate proposal, the default goals will be used if this parameter is not specified. (optional) (default to null)
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) (default to null)
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 = __CruiseControl.%2A # String | Specify topic whose partition is excluded from replica movement. (optional) (default to null)
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 = ["PrioritizeLargeReplicaMovementStrategy","PostponeUrpReplicaMovementStrategy"] # array[String] | Replica movement strategies to use. (optional) (default to null)
executionProgressCheckIntervalMs = 789 # Long | Execution progress check interval in milliseconds. (optional) (default to null)
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) (default to null)
reviewId = 56 # Integer | Review id for 2-step verification. (optional) (default to null)
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) (default to null)
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) (default to null)
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)
extern crate DefaultApi;
pub fn main() {
let brokerid = ; // array[Integer]
let dryrun = true; // Boolean
let throttleAddedBroker = true; // Boolean
let allowCapacityEstimation = true; // Boolean
let goals = ["RackAwareGoal","ReplicaCapacityGoal","ReplicaDistributionGoal"]; // array[String]
let concurrentPartitionMovementsPerBroker = 56; // Integer
let maxPartitionMovementsInCluster = 56; // Integer
let concurrentLeaderMovements = 56; // Integer
let brokerConcurrentLeaderMovements = 56; // Integer
let json = true; // Boolean
let skipHardGoalCheck = true; // Boolean
let excludedTopics = __CruiseControl.%2A; // String
let kafkaAssigner = true; // Boolean
let useReadyDefaultGoals = true; // Boolean
let verbose = true; // Boolean
let excludeRecentlyDemotedBrokers = true; // Boolean
let excludeRecentlyRemovedBrokers = true; // Boolean
let replicaMovementStrategies = ["PrioritizeLargeReplicaMovementStrategy","PostponeUrpReplicaMovementStrategy"]; // array[String]
let executionProgressCheckIntervalMs = 789; // Long
let stopOngoingExecution = true; // Boolean
let reason = reason_example; // String
let reviewId = 56; // Integer
let dataFrom = dataFrom_example; // String
let replicationThrottle = 789; // Long
let getResponseSchema = true; // Boolean
let doAs = doAs_example; // String
let fastMode = true; // Boolean
let mut context = DefaultApi::Context::default();
let result = client.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, &context).wait();
println!("{:?}", result);
}
Scopes
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
|