diagnostics

package
v0.0.0-...-11f2a26 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bundle

type Bundle struct {
	File string `json:"file_name"`
	Size int64  `json:"file_size"`
}

Bundle represents a diagnostics bundle.

type BundleCreate

type BundleCreate struct {
	Nodes []string `json:"nodes"`
}

BundleCreate is the json request used to create a diagnostics bundle.

type BundleCreateResponseJSONStruct

type BundleCreateResponseJSONStruct struct {
	Status string `json:"status"`
	Extra  struct {
		BundleName string `json:"bundle_name"`
	}
}

BundleCreateResponseJSONStruct is the response from /system/health/v1/report/diagnostics/create.

type BundleGenericResponseJSONStruct

type BundleGenericResponseJSONStruct struct {
	Status string `json:"status"`
}

BundleGenericResponseJSONStruct is the generic response from /system/health/v1/report/diagnostics endppoints.

type BundleReportStatus

type BundleReportStatus struct {
	// job related fields
	Running               bool     `json:"is_running"`
	Status                string   `json:"status"`
	Errors                []string `json:"errors"`
	LastBundlePath        string   `json:"last_bundle_dir"`
	JobStarted            string   `json:"job_started"`
	JobEnded              string   `json:"job_ended"`
	JobDuration           string   `json:"job_duration"`
	JobProgressPercentage float32  `json:"job_progress_percentage"`

	// config related fields
	DiagnosticBundlesBaseDir                 string `json:"diagnostics_bundle_dir"`
	DiagnosticsJobTimeoutMin                 int    `json:"diagnostics_job_timeout_min"`
	DiagnosticsUnitsLogsSinceHours           string `json:"journald_logs_since_hours"`
	DiagnosticsJobGetSingleURLTimeoutMinutes int    `json:"diagnostics_job_get_since_url_timeout_min"`
	CommandExecTimeoutSec                    int    `json:"command_exec_timeout_sec"`

	// metrics related
	DiskUsedPercent float64 `json:"diagnostics_partition_disk_usage_percent"`
}

BundleReportStatus is the response from /system/health/v1/report/diagnostics/status/all.

type Client

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

Client is a diagnostics client for DC/OS.

func NewClient

func NewClient(baseClient *httpclient.Client) *Client

NewClient creates a new diagnostics client.

func (*Client) Cancel

Cancel cancel a running job creating a bundle.

func (*Client) Create

func (c *Client) Create(nodes []string) (*BundleCreateResponseJSONStruct, error)

Create requests a bundle creation for given nodes on the cluster.

func (*Client) Delete

func (c *Client) Delete(bundle string) (*BundleGenericResponseJSONStruct, error)

Delete deletes a diagnostics bundle in the cluster.

func (*Client) Get

func (c *Client) Get(bundle string) (*http.Response, error)

Get returns a given diagnostic bundle.

func (*Client) List

func (c *Client) List() (map[string][]Bundle, error)

List returns all the diagnostics bundles.

func (*Client) Status

func (c *Client) Status() (map[string]BundleReportStatus, error)

Status returns the status.

func (*Client) Units

func (c *Client) Units(node string) (*UnitsHealthResponseJSONStruct, error)

Units returns the units of a certain node.

type HealthResponseValues

type HealthResponseValues struct {
	UnitID     string `json:"id"`
	UnitHealth int    `json:"health"`
	UnitOutput string `json:"output"`
	UnitTitle  string `json:"description"`
	Help       string `json:"help"`
	PrettyName string `json:"name"`
}

HealthResponseValues is the response from

type UnitsHealthResponseJSONStruct

type UnitsHealthResponseJSONStruct struct {
	Array       []HealthResponseValues `json:"units"`
	Hostname    string                 `json:"hostname"`
	IPAddress   string                 `json:"ip"`
	DcosVersion string                 `json:"dcos_version"`
	Role        string                 `json:"node_role"`
	MesosID     string                 `json:"mesos_id"`
	TdtVersion  string                 `json:"dcos_diagnostics_version"`
}

UnitsHealthResponseJSONStruct is the response from /system/health/v1.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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