Documentation ¶
Index ¶
- Variables
- func ByteCountBinary(b int64) string
- func FormatClusterName(w io.Writer, c *Cluster)
- func FormatDuration(t0, t1 strfmt.DateTime) string
- func FormatError(msg string) string
- func FormatPercent(p float32) string
- func FormatProgress(complete, failed float32) string
- func FormatTables(threshold int, tables []string, all bool) string
- func FormatTime(t strfmt.DateTime) string
- func FormatUploadProgress(size, uploaded, skipped, failed int64) string
- func MessageOf(err error) string
- func ParseByteCount(s string) (int64, error)
- func ParseDate(value string) (strfmt.DateTime, error)
- func ParseStartDate(value string) (strfmt.DateTime, error)
- func StatusCodeOf(err error) int
- func StringByteCount(b int64) string
- func TaskJoin(taskType string, taskID interface{}) string
- func TaskSplit(s string) (taskType string, taskID uuid.UUID, err error)
- type BackupListItems
- type BackupProgress
- type BackupTarget
- type Client
- func (c Client) BackupProgress(ctx context.Context, clusterID, taskID, runID string) (BackupProgress, error)
- func (c Client) ClusterStatus(ctx context.Context, clusterID string) (ClusterStatus, error)
- func (c Client) CreateCluster(ctx context.Context, cluster *Cluster) (string, error)
- func (c *Client) CreateTask(ctx context.Context, clusterID string, t *Task) (uuid.UUID, error)
- func (c Client) DeleteCluster(ctx context.Context, clusterID string) error
- func (c Client) DeleteClusterSecrets(ctx context.Context, clusterID string, cqlCreds, sslUserCert bool) error
- func (c Client) DeleteSnapshot(ctx context.Context, clusterID string, locations []string, snapshotTag string) error
- func (c *Client) DeleteTask(ctx context.Context, clusterID, taskType string, taskID uuid.UUID) error
- func (c *Client) GetBackupTarget(ctx context.Context, clusterID string, t *Task) (*BackupTarget, error)
- func (c Client) GetCluster(ctx context.Context, clusterID string) (*Cluster, error)
- func (c *Client) GetRepairTarget(ctx context.Context, clusterID string, t *Task) (*RepairTarget, error)
- func (c *Client) GetTask(ctx context.Context, clusterID, taskType string, taskID uuid.UUID) (*Task, error)
- func (c *Client) GetTaskHistory(ctx context.Context, clusterID, taskType string, taskID uuid.UUID, limit int64) (TaskRunSlice, error)
- func (c Client) ListBackupFiles(ctx context.Context, clusterID string, locations []string, allClusters bool, ...) ([]*models.BackupFilesInfo, error)
- func (c Client) ListBackups(ctx context.Context, clusterID string, locations []string, allClusters bool, ...) (BackupListItems, error)
- func (c Client) ListClusters(ctx context.Context) (ClusterSlice, error)
- func (c *Client) ListTasks(ctx context.Context, clusterID, taskType string, all bool, status string) (ExtendedTasks, error)
- func (c Client) RepairProgress(ctx context.Context, clusterID, taskID, runID string) (RepairProgress, error)
- func (c Client) SetRepairIntensity(ctx context.Context, clusterID string, intensity float64) error
- func (c *Client) StartTask(ctx context.Context, clusterID, taskType string, taskID uuid.UUID, cont bool) error
- func (c *Client) StopTask(ctx context.Context, clusterID, taskType string, taskID uuid.UUID, ...) error
- func (c Client) UpdateCluster(ctx context.Context, cluster *Cluster) error
- func (c *Client) UpdateTask(ctx context.Context, clusterID string, t *Task) error
- func (c Client) Version(ctx context.Context) (*models.Version, error)
- type Cluster
- type ClusterSlice
- type ClusterStatus
- type ErrorResponse
- type ExtendedTask
- type ExtendedTaskSlice
- type ExtendedTasks
- type RepairProgress
- type RepairTarget
- type RepairUnitProgress
- type Schedule
- type TableRenderer
- type Task
- type TaskRun
- type TaskRunSlice
Constants ¶
This section is empty.
Variables ¶
var DefaultTLSConfig = func() *tls.Config { return &tls.Config{ InsecureSkipVerify: true, } }
DefaultTLSConfig specifies default TLS configuration used when creating a new client.
Functions ¶
func ByteCountBinary ¶
ByteCountBinary returns string representation of the byte count with proper unit appended if withUnit is true.
func FormatClusterName ¶
FormatClusterName writes cluster name and id to the writer.
func FormatDuration ¶
FormatDuration creates and formats the duration between the supplied DateTime values.
func FormatError ¶
FormatError formats messages created by using multierror with errors wrapped with host IP so that each host error is in it's own line. It also adds "failed to" prefix if needed.
func FormatPercent ¶
FormatPercent simply creates a percent representation of the supplied value.
func FormatProgress ¶
FormatProgress creates complete vs. failed representation.
func FormatTables ¶
FormatTables returns tables listing if number of tables is lower than threshold. It prints (n tables) or (table_a, table_b, ...).
func FormatTime ¶
FormatTime formats the supplied DateTime in `02 Jan 06 15:04:05 MST` format.
func FormatUploadProgress ¶
FormatUploadProgress calculates percentage of success and failed uploads
func ParseByteCount ¶
ParseByteCount returns byte count parsed from input string. This is opposite of StringByteCount function.
func ParseStartDate ¶
ParseStartDate parses the supplied string as a strfmt.DateTime.
func StatusCodeOf ¶
StatusCodeOf returns HTTP status code carried by the error or it's cause. If not status can be found it returns 0.
func StringByteCount ¶
StringByteCount returns string representation of the byte count with proper unit.
Types ¶
type BackupListItems ¶
type BackupListItems = []*models.BackupListItem
BackupListItems is a []backup.ListItem representation.
type BackupProgress ¶
type BackupProgress = *models.TaskRunBackupProgress
BackupProgress contains shard progress info.
type BackupTarget ¶
type BackupTarget struct { models.BackupTarget ShowTables int }
BackupTarget is a representing results of dry running backup task.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides means to interact with Mermaid.
func (Client) BackupProgress ¶
func (c Client) BackupProgress(ctx context.Context, clusterID, taskID, runID string) (BackupProgress, error)
BackupProgress returns backup progress.
func (Client) ClusterStatus ¶
ClusterStatus returns health check progress.
func (Client) CreateCluster ¶
CreateCluster creates a new cluster.
func (*Client) CreateTask ¶
CreateTask creates a new task.
func (Client) DeleteCluster ¶
DeleteCluster removes cluster.
func (Client) DeleteClusterSecrets ¶
func (c Client) DeleteClusterSecrets(ctx context.Context, clusterID string, cqlCreds, sslUserCert bool) error
DeleteClusterSecrets removes cluster secrets.
func (Client) DeleteSnapshot ¶
func (c Client) DeleteSnapshot(ctx context.Context, clusterID string, locations []string, snapshotTag string) error
DeleteSnapshot deletes backup snapshot with all data associated with it.
func (*Client) DeleteTask ¶
func (c *Client) DeleteTask(ctx context.Context, clusterID, taskType string, taskID uuid.UUID) error
DeleteTask stops executing a task.
func (*Client) GetBackupTarget ¶
func (c *Client) GetBackupTarget(ctx context.Context, clusterID string, t *Task) (*BackupTarget, error)
GetBackupTarget fetches information about repair target.
func (Client) GetCluster ¶
GetCluster returns a cluster for a given ID.
func (*Client) GetRepairTarget ¶
func (c *Client) GetRepairTarget(ctx context.Context, clusterID string, t *Task) (*RepairTarget, error)
GetRepairTarget fetches information about repair target.
func (*Client) GetTask ¶
func (c *Client) GetTask(ctx context.Context, clusterID, taskType string, taskID uuid.UUID) (*Task, error)
GetTask returns a task of a given type and ID.
func (*Client) GetTaskHistory ¶
func (c *Client) GetTaskHistory(ctx context.Context, clusterID, taskType string, taskID uuid.UUID, limit int64) (TaskRunSlice, error)
GetTaskHistory returns a run history of task of a given type and task ID.
func (Client) ListBackupFiles ¶
func (c Client) ListBackupFiles(ctx context.Context, clusterID string, locations []string, allClusters bool, keyspace []string, snapshotTag string) ([]*models.BackupFilesInfo, error)
ListBackupFiles returns a listing of available backup files.
func (Client) ListBackups ¶
func (c Client) ListBackups(ctx context.Context, clusterID string, locations []string, allClusters bool, keyspace []string, minDate, maxDate strfmt.DateTime) (BackupListItems, error)
ListBackups returns listing of available backups.
func (Client) ListClusters ¶
func (c Client) ListClusters(ctx context.Context) (ClusterSlice, error)
ListClusters returns clusters.
func (*Client) ListTasks ¶
func (c *Client) ListTasks(ctx context.Context, clusterID, taskType string, all bool, status string) (ExtendedTasks, error)
ListTasks returns uled tasks within a clusterID, optionaly filtered by task type tp.
func (Client) RepairProgress ¶
func (c Client) RepairProgress(ctx context.Context, clusterID, taskID, runID string) (RepairProgress, error)
RepairProgress returns repair progress.
func (Client) SetRepairIntensity ¶
SetRepairIntensity updates ongoing repair intensity.
func (*Client) StartTask ¶
func (c *Client) StartTask(ctx context.Context, clusterID, taskType string, taskID uuid.UUID, cont bool) error
StartTask starts executing a task.
func (*Client) StopTask ¶
func (c *Client) StopTask(ctx context.Context, clusterID, taskType string, taskID uuid.UUID, disable bool) error
StopTask stops executing a task.
func (Client) UpdateCluster ¶
UpdateCluster updates cluster.
func (*Client) UpdateTask ¶
UpdateTask updates an existing task unit.
type ClusterSlice ¶
ClusterSlice is []*cluster.Cluster representation.
type ClusterStatus ¶
type ClusterStatus models.ClusterStatus
ClusterStatus contains cluster status info.
type ErrorResponse ¶
type ErrorResponse = models.ErrorResponse
ErrorResponse is returned in case of an error.
type ExtendedTask ¶
type ExtendedTask = models.ExtendedTask
ExtendedTask is a representation of scheduler.Task with additional fields from scheduler.Run.
type ExtendedTaskSlice ¶
type ExtendedTaskSlice = []*models.ExtendedTask
ExtendedTaskSlice is a representation of a slice of scheduler.Task with additional fields from scheduler.Run.
type ExtendedTasks ¶
type ExtendedTasks struct { ExtendedTaskSlice All bool }
ExtendedTasks is a representation of []*scheduler.Task with additional fields from scheduler.Run.
type RepairProgress ¶
type RepairProgress struct {
*models.TaskRunRepairProgress
}
RepairProgress contains shard progress info.
type RepairTarget ¶
type RepairTarget struct { models.RepairTarget ShowTables int }
RepairTarget is a representing results of dry running repair task.
type RepairUnitProgress ¶
type RepairUnitProgress = models.RepairProgressHostsItems0
RepairUnitProgress contains unit progress info.
type TableRenderer ¶
TableRenderer is the interface that components need to implement if they can render themselves as tables.
type TaskRunSlice ¶
type TaskRunSlice []*TaskRun
TaskRunSlice is a []*scheduler.TaskRun representation.