nodes

package
v2.11.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NodeTypeIngressController is the type of nodes representing KIC instances.
	NodeTypeIngressController = "ingress-controller"
	// NodeTypeKongProxy is the type of nodes representing kong gateway instances.
	NodeTypeKongProxy = "kong-proxy"
)

Variables

View Source
var KicNodeAPIPathPattern = "%s/kic/api/runtime_groups/%s/v1/kic-nodes"

KicNodeAPIPathPattern is the path pattern for KIC node operations.

Functions

This section is empty.

Types

type Client

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

Client is used for sending requests to Konnect Node API. It can be used to register Nodes in Konnect's Runtime Groups.

func NewClient

func NewClient(cfg adminapi.KonnectConfig) (*Client, error)

NewClient creates a Node API Konnect client.

func (*Client) CreateNode

func (c *Client) CreateNode(ctx context.Context, req *CreateNodeRequest) (*CreateNodeResponse, error)

func (*Client) DeleteNode

func (c *Client) DeleteNode(ctx context.Context, nodeID string) error

func (*Client) GetNode

func (c *Client) GetNode(ctx context.Context, nodeID string) (*NodeItem, error)

func (*Client) ListAllNodes

func (c *Client) ListAllNodes(ctx context.Context) ([]*NodeItem, error)

ListAllNodes call ListNodes() repeatedly to get all nodes in a runtime group.

func (*Client) UpdateNode

func (c *Client) UpdateNode(ctx context.Context, nodeID string, req *UpdateNodeRequest) (*UpdateNodeResponse, error)

type CompatibilityIssue

type CompatibilityIssue struct {
	Code              string          `json:"code"`
	Severity          string          `json:"severity"`
	Description       string          `json:"description"`
	Resolution        string          `json:"resolution"`
	AffectedResources []*KongResource `json:"affected_resources"`
}

type CompatibilityState

type CompatibilityState string
const (
	CompatibilityStateUnspecified     CompatibilityState = "COMPATIBILITY_STATE_UNSPECIFIED"
	CompatibilityStateFullyCompatible CompatibilityState = "COMPATIBILITY_STATE_FULLY_COMPATIBLE"
	CompatibilityStateInconpatible    CompatibilityState = "COMPATIBILITY_STATE_INCOMPATIBLE"
	CompatibilityStateUnknown         CompatibilityState = "COMPATIBILITY_STATE_UNKNOWN"
)

type CompatibilityStatus

type CompatibilityStatus struct {
	State  CompatibilityState    `json:"state"`
	Issues []*CompatibilityIssue `json:"issues,omitempty"`
}

type CreateNodeRequest

type CreateNodeRequest struct {
	ID                  string               `json:"id,omitempty"`
	Hostname            string               `json:"hostname"`
	Type                string               `json:"type"`
	LastPing            int64                `json:"last_ping"`
	Version             string               `json:"version"`
	CompatabilityStatus *CompatibilityStatus `json:"compatibility_status,omitempty"`
	Status              string               `json:"status,omitempty"`
	ConfigHash          string               `json:"config_hash,omitempty"`
}

type CreateNodeResponse

type CreateNodeResponse struct {
	Item *NodeItem `json:"item"`
}

type IngressControllerState

type IngressControllerState string
const (
	IngressControllerStateUnspecified                       IngressControllerState = "INGRESS_CONTROLLER_STATE_UNSPECIFIED"
	IngressControllerStateOperational                       IngressControllerState = "INGRESS_CONTROLLER_STATE_OPERATIONAL"
	IngressControllerStatePartialConfigFail                 IngressControllerState = "INGRESS_CONTROLLER_STATE_PARTIAL_CONFIG_FAIL"
	IngressControllerStateInoperable                        IngressControllerState = "INGRESS_CONTROLLER_STATE_INOPERABLE"
	IngressControllerStateOperationalKonnectOutOfSync       IngressControllerState = "INGRESS_CONTROLLER_STATE_OPERATIONAL_KONNECT_OUT_OF_SYNC"
	IngressControllerStatePartialConfigFailKonnectOutOfSync IngressControllerState = "INGRESS_CONTROLLER_STATE_PARTIAL_CONFIG_FAIL_KONNECT_OUT_OF_SYNC"
	IngressControllerStateInoperableKonnectOutOfSync        IngressControllerState = "INGRESS_CONTROLLER_STATE_INOPERABLE_KONNECT_OUT_OF_SYNC"
	IngressControllerStateUnknown                           IngressControllerState = "INGRESS_CONTROLLER_STATE_UNKNOWN"
)

type KongResource

type KongResource struct {
	ID   string `json:"id,omitempty"`
	Type string `json:"type,omitempty"`
}

type ListNodeResponse

type ListNodeResponse struct {
	Items []*NodeItem     `json:"items"`
	Page  *PaginationInfo `json:"page"`
}

type NodeItem

type NodeItem struct {
	ID                  string               `json:"id"`
	Version             string               `json:"version"`
	Hostname            string               `json:"hostname"`
	LastPing            int64                `json:"last_ping"`
	Type                string               `json:"type"`
	CreatedAt           int64                `json:"created_at"`
	UpdatedAt           int64                `json:"updated_at"`
	ConfigHash          string               `json:"config_hash"`
	CompatibilityStatus *CompatibilityStatus `json:"compatibility_status,omitempty"`
	Status              string               `json:"status,omitempty"`
}

type PaginationInfo

type PaginationInfo struct {
	TotalCount  int32 `json:"total_count,omitempty"`
	NextPageNum int32 `json:"next_page_num,omitempty"`
}

type UpdateNodeRequest

type UpdateNodeRequest struct {
	Hostname            string               `json:"hostname"`
	Type                string               `json:"type"`
	LastPing            int64                `json:"last_ping"`
	Version             string               `json:"version"`
	ConfigHash          string               `json:"config_hash,omitempty"`
	CompatabilityStatus *CompatibilityStatus `json:"compatibility_status,omitempty"`
	Status              string               `json:"status,omitempty"`
}

type UpdateNodeResponse

type UpdateNodeResponse struct {
	Item *NodeItem `json:"item"`
}

Jump to

Keyboard shortcuts

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