httphelper

package
v1.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

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 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"`
}

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) 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)
	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) 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) 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