apiserver

package
v0.1.3-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// APIGroup is the base path for the HTTP API.
	APIGroup = "/api/v1alpha1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GreptimeDBCluster

type GreptimeDBCluster struct {
	// Name is the name of the GreptimeDBCluster.
	Name string `json:"name"`

	// Namespace is the namespace of the GreptimeDBCluster.
	Namespace string `json:"namespace"`

	// Spec is the spec of the GreptimeDBCluster.
	Spec *greptimev1alpha1.GreptimeDBClusterSpec `json:"spec,omitempty"`

	// Status is the status of the GreptimeDBCluster.
	Status *greptimev1alpha1.GreptimeDBClusterStatus `json:"status,omitempty"`

	// Topology is the deployment topology of the GreptimeDBCluster.
	Topology *GreptimeDBClusterTopology `json:"topology,omitempty"`
}

GreptimeDBCluster represents a GreptimeDBCluster resource that is returned by the API. This struct is used to serialize the GreptimeDBCluster resource into JSON.

type GreptimeDBClusterTopology

type GreptimeDBClusterTopology struct {
	// Meta represents the meta component of the GreptimeDBCluster.
	Meta []*Pod `json:"meta,omitempty"`

	// Datanode represents the datanode component of the GreptimeDBCluster.
	Datanode []*Pod `json:"datanode,omitempty"`

	// Frontend represents the frontend component of the GreptimeDBCluster.
	Frontend []*Pod `json:"frontend,omitempty"`

	// Flownode represents the flownode component of the GreptimeDBCluster.
	Flownode []*Pod `json:"flownode,omitempty"`
}

GreptimeDBClusterTopology represents the deployment topology of a GreptimeDBCluster.

type Options

type Options struct {
	// Port is the port that the API service will listen on.
	Port int32

	// EnablePodMetrics indicates whether to enable fetching PodMetrics from metrics-server.
	EnablePodMetrics bool
}

Options represents the options for the Server.

type Pod

type Pod struct {
	// Name is the name of the Pod.
	Name string `json:"name"`

	// Namespace is the namespace of the Pod.
	Namespace string `json:"namespace"`

	// IP is the IP address of the Pod.
	IP string `json:"ip"`

	// Node is the name of the node where the Pod is running.
	Node string `json:"node"`

	// Resource is the resources of all containers in the Pod.
	Resources []*Resource `json:"resources,omitempty"`

	// Status is the status of the Pod.
	Status string `json:"status"`

	// StartTime is the time when the Pod started.
	StartTime *metav1.Time `json:"startTime,omitempty"`
}

Pod is a simplified representation of a Kubernetes Pod.

type Resource added in v0.1.3

type Resource struct {
	// Name is the name of the container.
	Name string `json:"name"`

	// Request is the resource request of the container.
	Request corev1.ResourceList `json:"request,omitempty"`

	// Limit is the resource limit of the container.
	Limit corev1.ResourceList `json:"limit,omitempty"`

	// Usage is the resource usage of the container.
	Usage corev1.ResourceList `json:"usage,omitempty"`
}

Resource represents the resource of a container.

type Response

type Response struct {
	// Success indicates whether the request was successful.
	Success bool `json:"success"`

	// Code is the status code that defined by the Server.
	Code int `json:"code,omitempty"`

	// Message is additional message returned by the API.
	Message string `json:"message,omitempty"`

	// Data is the data returned by the API.
	Data interface{} `json:"data,omitempty"`
}

Response represents a response returned by the API.

type Server

type Server struct {
	client.Client
	// contains filtered or unexported fields
}

Server provides an HTTP API to interact with Greptime CRD resources.

func NewServer

func NewServer(mgr manager.Manager, opts *Options) (*Server, error)

NewServer creates a new Server with the given client and options.

func (*Server) Run

func (s *Server) Run() error

Run starts the HTTP service and listens on the specified port.

Jump to

Keyboard shortcuts

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