client

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// High enough QPS to fit all expected use cases. QPS=0 is not set here, because
	// client code is overriding it.
	DefaultQPS = 1e6
	// High enough Burst to fit all expected use cases. Burst=0 is not set here, because
	// client code is overriding it.
	DefaultBurst = 1e6
	// Use kubernetes protobuf as content type by default
	DefaultContentType = "application/vnd.kubernetes.protobuf"
	// Default cluster/context/auth name to be set in clientcmd config
	DefaultCmdConfigName = "kubernetes"
)

Dashboard UI default values for client configs.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientManager added in v1.6.2

type ClientManager interface {
	Client(req *restful.Request) (*kubernetes.Clientset, error)
	Config(req *restful.Request) (*rest.Config, error)
	ClientCmdConfig(req *restful.Request) (clientcmd.ClientConfig, error)
	CSRFKey() string
	VerberClient(req *restful.Request) (ResourceVerber, error)
}

ClientManager is responsible for initializing and creating clients to communicate with kubernetes apiserver on demand

func NewClientManager added in v1.6.2

func NewClientManager(kubeConfigPath, apiserverHost string) ClientManager

NewClientManager creates client manager based on kubeConfigPath and apiserverHost parameters. If both are empty then in-cluster config is used.

type RESTClient added in v1.6.2

type RESTClient interface {
	Delete() *restclient.Request
	Put() *restclient.Request
	Get() *restclient.Request
}

RESTClient is an interface for REST operations used in this file.

type ResourceVerber added in v1.6.2

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

ResourceVerber is a struct responsible for doing common verb operations on resources, like DELETE, PUT, UPDATE.

func NewResourceVerber added in v1.6.2

func NewResourceVerber(client, extensionsClient, appsClient,
	batchClient, autoscalingClient, storageClient RESTClient) ResourceVerber

NewResourceVerber creates a new resource verber that uses the given client for performing operations.

func (*ResourceVerber) Delete added in v1.6.2

func (verber *ResourceVerber) Delete(kind string, namespaceSet bool, namespace string, name string) error

Delete deletes the resource of the given kind in the given namespace with the given name.

func (*ResourceVerber) Get added in v1.6.2

func (verber *ResourceVerber) Get(kind string, namespaceSet bool, namespace string, name string) (runtime.Object, error)

Get gets the resource of the given kind in the given namespace with the given name.

func (*ResourceVerber) Put added in v1.6.2

func (verber *ResourceVerber) Put(kind string, namespaceSet bool, namespace string, name string,
	object *runtime.Unknown) error

Put puts new resource version of the given kind in the given namespace with the given name.

Jump to

Keyboard shortcuts

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