mermaidclient

package
v1.4.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTLSConfig = func() *tls.Config {
	return &tls.Config{
		InsecureSkipVerify: true,
	}
}

DefaultTLSConfig specifies default TLS configuration used when creating a new client.

Functions

func ByteCountBinary

func ByteCountBinary(b int64) string

ByteCountBinary returns string representation of the byte count with proper unit appended if withUnit is true.

func FormatClusterName

func FormatClusterName(w io.Writer, c *Cluster)

FormatClusterName writes cluster name and id to the writer.

func FormatDuration

func FormatDuration(t0, t1 strfmt.DateTime) string

FormatDuration creates and formats the duration between the supplied DateTime values.

func FormatError

func FormatError(msg string) string

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

func FormatPercent(p float32) string

FormatPercent simply creates a percent representation of the supplied value.

func FormatProgress

func FormatProgress(complete, failed float32) string

FormatProgress creates complete vs. failed representation.

func FormatTables

func FormatTables(threshold int, tables []string, all bool) string

FormatTables returns tables listing if number of tables is lower than threshold. It prints (n tables) or (table_a, table_b, ...).

func FormatTime

func FormatTime(t strfmt.DateTime) string

FormatTime formats the supplied DateTime in `02 Jan 06 15:04:05 MST` format.

func FormatUploadProgress

func FormatUploadProgress(size, uploaded, skipped, failed int64) string

FormatUploadProgress calculates percentage of success and failed uploads

func MessageOf

func MessageOf(err error) string

MessageOf returns error message embedded in returned error.

func ParseByteCount

func ParseByteCount(s string) (int64, error)

ParseByteCount returns byte count parsed from input string. This is opposite of StringByteCount function.

func ParseDate

func ParseDate(value string) (strfmt.DateTime, error)

ParseDate parses the supplied string as a strfmt.DateTime.

func ParseStartDate

func ParseStartDate(value string) (strfmt.DateTime, error)

ParseStartDate parses the supplied string as a strfmt.DateTime.

func StatusCodeOf

func StatusCodeOf(err error) int

StatusCodeOf returns HTTP status code carried by the error or it's cause. If not status can be found it returns 0.

func StringByteCount

func StringByteCount(b int64) string

StringByteCount returns string representation of the byte count with proper unit.

func TaskJoin

func TaskJoin(taskType string, taskID interface{}) string

TaskJoin creates a new type id string in the form `taskType/taskId`.

func TaskSplit

func TaskSplit(s string) (taskType string, taskID uuid.UUID, err error)

TaskSplit attempts to split a string into type and id.

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 NewClient

func NewClient(rawURL string, transport http.RoundTripper) (Client, error)

func (Client) BackupProgress

func (c Client) BackupProgress(ctx context.Context, clusterID, taskID, runID string) (BackupProgress, error)

BackupProgress returns backup progress.

func (Client) ClusterStatus

func (c Client) ClusterStatus(ctx context.Context, clusterID string) (ClusterStatus, error)

ClusterStatus returns health check progress.

func (Client) CreateCluster

func (c Client) CreateCluster(ctx context.Context, cluster *Cluster) (string, error)

CreateCluster creates a new cluster.

func (*Client) CreateTask

func (c *Client) CreateTask(ctx context.Context, clusterID string, t *Task) (uuid.UUID, error)

CreateTask creates a new task.

func (Client) DeleteCluster

func (c Client) DeleteCluster(ctx context.Context, clusterID string) error

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

func (c Client) GetCluster(ctx context.Context, clusterID string) (*Cluster, error)

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

func (c Client) SetRepairIntensity(ctx context.Context, clusterID string, intensity float64) error

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

func (c Client) UpdateCluster(ctx context.Context, cluster *Cluster) error

UpdateCluster updates cluster.

func (*Client) UpdateTask

func (c *Client) UpdateTask(ctx context.Context, clusterID string, t *Task) error

UpdateTask updates an existing task unit.

func (Client) Version

func (c Client) Version(ctx context.Context) (*models.Version, error)

Version returns server version.

type Cluster

type Cluster = models.Cluster

Cluster is cluster.Cluster representation.

type ClusterSlice

type ClusterSlice []*models.Cluster

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 Schedule

type Schedule = models.Schedule

Schedule is a scheduler.Schedule representation.

type TableRenderer

type TableRenderer interface {
	Render(io.Writer) error
}

TableRenderer is the interface that components need to implement if they can render themselves as tables.

type Task

type Task = models.Task

Task is a scheduler.Task representation.

type TaskRun

type TaskRun = models.TaskRun

TaskRun is a scheduler.TaskRun representation.

type TaskRunSlice

type TaskRunSlice []*TaskRun

TaskRunSlice is a []*scheduler.TaskRun representation.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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