Help us shape the future of Go! Take the 2026 Go Developer Survey

httphelper

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WgetNodeDrainEndpoint = "localhost:8080/api/v0/ops/node/drain"
)

Variables

This section is empty.

Functions

func AddManagementApiServerSecurity

func AddManagementApiServerSecurity(dc *api.CassandraDatacenter, pod *corev1.PodTemplateSpec) error

func BuildPodHostFromPod

func BuildPodHostFromPod(pod *corev1.Pod) (string, error)

func GetManagementApiProtocol

func GetManagementApiProtocol(dc *api.CassandraDatacenter) (string, error)

API for Node Management mAuth Config

func GetMgmtApiWgetAction added in v1.5.0

func GetMgmtApiWgetAction(dc *api.CassandraDatacenter, endpoint string) (*corev1.ExecAction, error)

func GetMgmtApiWgetPostAction added in v1.5.0

func GetMgmtApiWgetPostAction(dc *api.CassandraDatacenter, endpoint string, postData string) (*corev1.ExecAction, error)

func GetPodHost

func GetPodHost(podName, clusterName, dcName, namespace string) string

func ValidateManagementApiConfig

func ValidateManagementApiConfig(dc *api.CassandraDatacenter, client client.Client, ctx context.Context) []error

Types

type CassMetadataEndpoints

type CassMetadataEndpoints struct {
	Entity []EndpointState `json:"entity"`
}

type EndpointState

type EndpointState struct {
	HostID                 string `json:"HOST_ID"`
	IsAlive                string `json:"IS_ALIVE"`
	NativeTransportAddress string `json:"NATIVE_TRANSPORT_ADDRESS"`
	RpcAddress             string `json:"RPC_ADDRESS"`
	Status                 string `json:"STATUS"`
	Load                   string `json:"LOAD"`
}

func (*EndpointState) GetRpcAddress

func (x *EndpointState) GetRpcAddress() string

type HttpClient

type HttpClient interface {
	Do(req *http.Request) (*http.Response, error)
}

func BuildManagementApiHttpClient

func BuildManagementApiHttpClient(dc *api.CassandraDatacenter, client client.Client, ctx context.Context) (HttpClient, error)

type InsecureManagementApiSecurityProvider

type InsecureManagementApiSecurityProvider struct {
}

func (*InsecureManagementApiSecurityProvider) AddServerSecurity

func (provider *InsecureManagementApiSecurityProvider) AddServerSecurity(pod *corev1.PodTemplateSpec) error

func (*InsecureManagementApiSecurityProvider) BuildHttpClient

func (provider *InsecureManagementApiSecurityProvider) BuildHttpClient(client client.Client, ctx context.Context) (HttpClient, error)

func (*InsecureManagementApiSecurityProvider) BuildMgmtApiWgetAction added in v1.5.0

func (provider *InsecureManagementApiSecurityProvider) BuildMgmtApiWgetAction(endpoint string) *corev1.ExecAction

func (*InsecureManagementApiSecurityProvider) BuildMgmtApiWgetPostAction added in v1.5.0

func (provider *InsecureManagementApiSecurityProvider) BuildMgmtApiWgetPostAction(endpoint string, postData string) *corev1.ExecAction

func (*InsecureManagementApiSecurityProvider) GetProtocol

func (provider *InsecureManagementApiSecurityProvider) GetProtocol() string

func (*InsecureManagementApiSecurityProvider) ValidateConfig

func (provider *InsecureManagementApiSecurityProvider) ValidateConfig(client client.Client, ctx context.Context) []error

type ManagementApiSecurityProvider

type ManagementApiSecurityProvider interface {
	BuildHttpClient(client client.Client, ctx context.Context) (HttpClient, error)
	BuildMgmtApiWgetAction(endpoint string) *corev1.ExecAction
	BuildMgmtApiWgetPostAction(endpoint string, postData string) *corev1.ExecAction
	AddServerSecurity(pod *corev1.PodTemplateSpec) error
	GetProtocol() string
	ValidateConfig(client client.Client, ctx context.Context) []error
}

SPI for adding new mechanisms for securing the management API

type ManualManagementApiSecurityProvider

type ManualManagementApiSecurityProvider struct {
	Namespace string
	Config    *api.ManagementApiAuthManualConfig
}

func (*ManualManagementApiSecurityProvider) AddServerSecurity

func (provider *ManualManagementApiSecurityProvider) AddServerSecurity(pod *corev1.PodTemplateSpec) error

func (*ManualManagementApiSecurityProvider) BuildHttpClient

func (provider *ManualManagementApiSecurityProvider) BuildHttpClient(client client.Client, ctx context.Context) (HttpClient, error)

func (*ManualManagementApiSecurityProvider) BuildMgmtApiWgetAction added in v1.5.0

func (provider *ManualManagementApiSecurityProvider) BuildMgmtApiWgetAction(endpoint string) *corev1.ExecAction

func (*ManualManagementApiSecurityProvider) BuildMgmtApiWgetPostAction added in v1.5.0

func (provider *ManualManagementApiSecurityProvider) BuildMgmtApiWgetPostAction(endpoint string, postData string) *corev1.ExecAction

func (*ManualManagementApiSecurityProvider) GetProtocol

func (provider *ManualManagementApiSecurityProvider) GetProtocol() string

func (*ManualManagementApiSecurityProvider) ValidateConfig

func (provider *ManualManagementApiSecurityProvider) ValidateConfig(client client.Client, ctx context.Context) []error

type NoPodIPError added in v1.3.0

type NoPodIPError error

type NodeMgmtClient

type NodeMgmtClient struct {
	Client   HttpClient
	Log      logr.Logger
	Protocol string
}

func (*NodeMgmtClient) CallCreateRoleEndpoint

func (client *NodeMgmtClient) CallCreateRoleEndpoint(pod *corev1.Pod, username string, password string, superuser bool) error

Create a new superuser with the given username and password

func (*NodeMgmtClient) CallDecommissionNodeEndpoint added in v1.5.0

func (client *NodeMgmtClient) CallDecommissionNodeEndpoint(pod *corev1.Pod) error

func (*NodeMgmtClient) CallDrainEndpoint

func (client *NodeMgmtClient) CallDrainEndpoint(pod *corev1.Pod) error

func (*NodeMgmtClient) CallKeyspaceCleanupEndpoint

func (client *NodeMgmtClient) CallKeyspaceCleanupEndpoint(pod *corev1.Pod, jobs int, keyspaceName string, tables []string) error

func (*NodeMgmtClient) CallLifecycleStartEndpoint

func (client *NodeMgmtClient) CallLifecycleStartEndpoint(pod *corev1.Pod) error

func (*NodeMgmtClient) CallLifecycleStartEndpointWithReplaceIp

func (client *NodeMgmtClient) CallLifecycleStartEndpointWithReplaceIp(pod *corev1.Pod, replaceIp string) error

func (*NodeMgmtClient) CallMetadataEndpointsEndpoint

func (client *NodeMgmtClient) CallMetadataEndpointsEndpoint(pod *corev1.Pod) (CassMetadataEndpoints, error)

func (*NodeMgmtClient) CallProbeClusterEndpoint

func (client *NodeMgmtClient) CallProbeClusterEndpoint(pod *corev1.Pod, consistencyLevel string, rfPerDc int) error

func (*NodeMgmtClient) CallReloadSeedsEndpoint

func (client *NodeMgmtClient) CallReloadSeedsEndpoint(pod *corev1.Pod) error

Jump to

Keyboard shortcuts

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