client

package
v0.0.0-...-2643bdd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2019 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	CruiseControlClient
	// contains filtered or unexported fields
}

Client implements CruiseControlClient

func (*Client) AddBrokers

func (c *Client) AddBrokers(opts *types.AddBrokersRequest) (*types.ProposalsResponse, error)

AddBrokers will add the given brokers to the kafka cluster.

func (*Client) DemoteBrokers

func (c *Client) DemoteBrokers(opts *types.DemoteBrokersRequest) (*types.ProposalsResponse, error)

DemoteBrokers will remove any partition leadership from the given brokers.

func (*Client) FixOfflineReplicas

func (c *Client) FixOfflineReplicas(opts *types.FixOfflineReplicasRequest) (*types.ProposalsResponse, error)

FixOfflineReplicas will move all offline replicas from dead brokers/disks. This method requires Kafka > 2.x.

func (*Client) GetKafkaClusterState

GetKafkaClusterState queries the health of partitions on the cluster.

func (*Client) GetLoad

func (c *Client) GetLoad(opts *types.GetLoadRequest) (*types.GetLoadResponse, error)

GetLoad queries the kafka cluster load. Monitor state must be RUNNING for this method to succeed.

func (*Client) GetPartitionLoad

GetPartitionLoad queries the partition load sorted by the resource specified in the request parameters.

func (*Client) GetProposals

func (c *Client) GetProposals(opts *types.GetProposalsRequest) (*types.ProposalsResponse, error)

GetProposals returns the optimization proposals generated based on workload models for the provided time range.

func (*Client) GetState

func (c *Client) GetState(opts *types.GetStateRequest) (*types.GetStateResponse, error)

GetState queries the state of Cruise Control.

func (*Client) GetUserTasks

func (c *Client) GetUserTasks(opts *types.GetUserTasksRequest) (*types.GetUserTasksResponse, error)

GetUserTasks returns a list of all active and completed tasks in cruise control.

func (*Client) PauseSampling

func (c *Client) PauseSampling(opts *types.TriggerSamplingRequest) (*types.GenericResponse, error)

PauseSampling will pause an ongoing metrics sampling process

func (*Client) Rebalance

func (c *Client) Rebalance(opts *types.RebalanceRequest) (*types.ProposalsResponse, error)

Rebalance requests cruise control to rebalance the kafka cluster.

func (*Client) RemoveBrokers

func (c *Client) RemoveBrokers(opts *types.RemoveBrokersRequest) (*types.ProposalsResponse, error)

RemoveBrokers will remove the given brokers from the kafka cluster.

func (*Client) ResumeSampling

func (c *Client) ResumeSampling(opts *types.TriggerSamplingRequest) (*types.GenericResponse, error)

ResumeSampling will resume a paused metrics sampling process.

func (*Client) StopProposalExecution

func (c *Client) StopProposalExecution() (*types.GenericResponse, error)

StopProposalExecution will tell cruise control to stop an ongoing POST operation.

type CruiseControlClient

CruiseControlClient interface represents an object that carries out Cruise Control operations. This interface is intended for mocking. See individual method documentation from the Client struct for usage.

func New

New creates a new CruiseControlClient with the given options

type ServerError

type ServerError struct {
	ErrorMessage string `json:"errorMessage"`
	StackTrace   string `json:"stackTrace"`
	Version      int    `json:"version"`
}

ServerError implements error and represents a server-side exception from CruiseControl.

func (*ServerError) Error

func (s *ServerError) Error() string

Error returns the main error message from a ServerError.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL