v1alpha2

package
v0.0.310 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const GroupName = "network.kubesphere.io"
View Source
const ScopeQueryUrl = "http://%s/api/topology/services"

Variables

View Source
var GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha2"}

Functions

func AddToContainer

func AddToContainer(c *restful.Container, weaveScopeHost string) error

Types

type APINode

type APINode struct {
	Node Node `json:"node"`
}

type APITopology

type APITopology struct {
	Nodes NodeSummaries `json:"nodes"`
}

type BadRequestError

type BadRequestError struct {
	Status int32 `json:"status"`
	Reason error `json:"reason"`
}

BadRequestError: the client request is incorrect

type BasicNodeSummary

type BasicNodeSummary struct {
	ID         string `json:"id"`
	Label      string `json:"label"`
	LabelMinor string `json:"labelMinor"`
	Rank       string `json:"rank"`
	Shape      string `json:"shape,omitempty"`
	Tag        string `json:"tag,omitempty"`
	Stack      bool   `json:"stack,omitempty"`
	Pseudo     bool   `json:"pseudo,omitempty"`
}

BasicNodeSummary is basic summary information about a Node, sufficient for rendering links to the node.

type Column

type Column struct {
	ID       string `json:"id"`
	Label    string `json:"label"`
	DataType string `json:"dataType"`
}

Column is the type for multi-column tables in the UI.

type Connection

type Connection struct {
	ID         string        `json:"id"`     // ID of this element in the UI.  Must be unique for a given ConnectionsSummary.
	NodeID     string        `json:"nodeId"` // ID of a node in the topology. Optional, must be set if linkable is true.
	Label      string        `json:"label"`
	LabelMinor string        `json:"labelMinor,omitempty"`
	Metadata   []MetadataRow `json:"metadata,omitempty"`
}

Connection is a row in the connections table.

type ConnectionsSummary

type ConnectionsSummary struct {
	ID          string       `json:"id"`
	TopologyID  string       `json:"topologyId"`
	Label       string       `json:"label"`
	Columns     []Column     `json:"columns"`
	Connections []Connection `json:"connections"`
}

ConnectionsSummary is the table of connection to/form a node

type Control

type Control struct {
	ID           string `json:"id"`
	Human        string `json:"human"`
	Icon         string `json:"icon"` // from https://fortawesome.github.io/Font-Awesome/cheatsheet/ please
	Confirmation string `json:"confirmation,omitempty"`
	Rank         int    `json:"rank"`
}

A Control basically describes an RPC

type ControlInstance

type ControlInstance struct {
	ProbeID string
	NodeID  string
	Control Control
}

ControlInstance contains a control description, and all the info needed to execute it.

type IDList

type IDList StringSet

IDList is a list of string IDs, which are always sorted and unique.

type MetadataRow

type MetadataRow struct {
	ID       string  `json:"id"`
	Label    string  `json:"label"`
	Value    string  `json:"value"`
	Priority float64 `json:"priority,omitempty"`
	Datatype string  `json:"dataType,omitempty"`
	Truncate int     `json:"truncate,omitempty"`
}

MetadataRow is a row for the metadata table.

type Metric

type Metric struct {
	Samples []Sample `json:"samples,omitempty"`
	Min     float64  `json:"min"`
	Max     float64  `json:"max"`
}

Metric is a list of timeseries data with some metadata. Clients must use the Add method to add values. Metrics are immutable.

type MetricRow

type MetricRow struct {
	ID         string
	Label      string
	Format     string
	Group      string
	Value      float64
	ValueEmpty bool
	Priority   float64
	URL        string
	Metric     *Metric
}

MetricRow is a tuple of data used to render a metric as a sparkline and accoutrements.

type NoContent

type NoContent struct {
	Status int32 `json:"status"`
	Reason error `json:"reason"`
}

NoContent: the response is empty

type Node

type Node struct {
	NodeSummary
	Controls    []ControlInstance    `json:"controls"`
	Children    []NodeSummaryGroup   `json:"children,omitempty"`
	Connections []ConnectionsSummary `json:"connections,omitempty"`
}

Node is the data type that's yielded to the JavaScript layer when we want deep information about an individual node.

type NodeResponse

type NodeResponse struct {
	APINode
}

type NodeSummaries

type NodeSummaries map[string]NodeSummary

type NodeSummary

type NodeSummary struct {
	BasicNodeSummary
	Metadata  []MetadataRow `json:"metadata,omitempty"`
	Parents   []Parent      `json:"parents,omitempty"`
	Metrics   []MetricRow   `json:"metrics,omitempty"`
	Tables    []Table       `json:"tables,omitempty"`
	Adjacency IDList        `json:"adjacency,omitempty"`
}

NodeSummary is summary information about a Node.

type NodeSummaryGroup

type NodeSummaryGroup struct {
	ID         string        `json:"id"`
	Label      string        `json:"label"`
	Nodes      []NodeSummary `json:"nodes"`
	TopologyID string        `json:"topologyId"`
	Columns    []Column      `json:"columns"`
}

NodeSummaryGroup is a topology-typed group of children for a Node.

type NotFoundError

type NotFoundError struct {
	Status int32 `json:"status"`
	Reason error `json:"reason"`
}

NotFoundError is the error message that is generated when server could not find what was requested

type Parent

type Parent struct {
	ID         string `json:"id"`
	Label      string `json:"label"`
	TopologyID string `json:"topologyId"`
}

Parent is the information needed to build a link to the parent of a Node.

type Row

type Row struct {
	ID      string            `json:"id"`
	Entries map[string]string `json:"entries"`
}

Row is the type that holds the table data for the UI. Entries map from column ID to cell value.

type Sample

type Sample struct {
	Timestamp time.Time `json:"date"`
	Value     float64   `json:"value"`
}

Sample is a single datapoint of a metric.

type StringSet

type StringSet []string

StringSet is a sorted set of unique strings. Clients must use the Add method to add strings.

type Table

type Table struct {
	ID              string   `json:"id"`
	Label           string   `json:"label"`
	Type            string   `json:"type"`
	Columns         []Column `json:"columns"`
	Rows            []Row    `json:"rows"`
	TruncationCount int      `json:"truncationCount,omitempty"`
}

Table is the type for a table in the UI.

type TopologyResponse

type TopologyResponse struct {
	APITopology
}

Jump to

Keyboard shortcuts

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