storage

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 57 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHandlers

func AddHandlers(h printers.PrintHandler)

AddHandlers adds print handlers for default TKE types dealing with internal versions. Refer kubernetes/pkg/printers/internalversion/printers.go:78

func ValidateExportObjectAndTenantID

func ValidateExportObjectAndTenantID(ctx context.Context, store *registry.Store, clusterName string, options metav1.ExportOptions) (runtime.Object, error)

ValidateExportObjectAndTenantID validate name and tenantID, if success return cluster

func ValidateGetObjectAndTenantID

func ValidateGetObjectAndTenantID(ctx context.Context, store *registry.Store, clusterName string, options *metav1.GetOptions) (runtime.Object, error)

ValidateGetObjectAndTenantID validate name and tenantID, if success return cluster

Types

type Action

type Action string

Action is the action that specified in URL

const (
	// Pods is an action that lists pods
	Pods Action = "pods"
	// Events is an action that lists events
	Events Action = "events"
)

type AddonREST

type AddonREST struct {
	rest.Storage
	// contains filtered or unexported fields
}

AddonREST implements the REST endpoint.

func (*AddonREST) Get

func (r *AddonREST) Get(ctx context.Context, clusterName string, options *metav1.GetOptions) (runtime.Object, error)

Get finds a resource in the storage by name and returns it.

func (*AddonREST) New

func (r *AddonREST) New() runtime.Object

New returns an empty object that can be used with Create after request data has been put into it.

type AddonTypeREST

type AddonTypeREST struct {
	rest.Storage
	// contains filtered or unexported fields
}

AddonTypeREST implements the REST endpoint.

func (*AddonTypeREST) Get

func (r *AddonTypeREST) Get(ctx context.Context, clusterName string, options *metav1.GetOptions) (runtime.Object, error)

Get finds a resource in the storage by name and returns it.

func (*AddonTypeREST) New

func (r *AddonTypeREST) New() runtime.Object

New returns an empty object that can be used with Create after request data has been put into it.

type ApplyREST

type ApplyREST struct {
	rest.Storage
	// contains filtered or unexported fields
}

ApplyREST implement bucket call interface for cluster.

func (*ApplyREST) Connect

func (r *ApplyREST) Connect(ctx context.Context, clusterName string, opts runtime.Object, _ rest.Responder) (http.Handler, error)

Connect returns an http.Handler that will handle the request/response for a given API invocation.

func (*ApplyREST) ConnectMethods

func (r *ApplyREST) ConnectMethods() []string

ConnectMethods returns the list of HTTP methods handled by Connect

func (*ApplyREST) New

func (r *ApplyREST) New() runtime.Object

New returns an empty object that can be used with Create after request data has been put into it. This object must be a pointer type for use with Codec.DecodeInto([]byte, runtime.Object)

func (*ApplyREST) NewConnectOptions

func (r *ApplyREST) NewConnectOptions() (runtime.Object, bool, string)

NewConnectOptions returns an empty options object that will be used to pass options to the Connect method.

func (*ApplyREST) ProducesMIMETypes

func (r *ApplyREST) ProducesMIMETypes(_ string) []string

ProducesMIMETypes returns a list of the MIME types the specified HTTP verb (GET, POST, DELETE, PATCH) can respond with.

func (*ApplyREST) ProducesObject

func (r *ApplyREST) ProducesObject(_ string) interface{}

ProducesObject returns an object the specified HTTP verb respond with. It will overwrite storage object if it is not nil. Only the type of the return object matters, the value will be ignored.

type CSIREST

type CSIREST struct {
	rest.Storage
	// contains filtered or unexported fields
}

CSIREST implements proxy CSI request to cluster of user.

func (*CSIREST) Connect

func (r *CSIREST) Connect(ctx context.Context, clusterName string, opts runtime.Object, responder rest.Responder) (http.Handler, error)

Connect returns a handler for the kube-apiserver proxy

func (*CSIREST) ConnectMethods

func (r *CSIREST) ConnectMethods() []string

ConnectMethods returns the list of HTTP methods that can be proxied

func (*CSIREST) New

func (r *CSIREST) New() runtime.Object

New creates a new CSI proxy options object

func (*CSIREST) NewConnectOptions

func (r *CSIREST) NewConnectOptions() (runtime.Object, bool, string)

NewConnectOptions returns versioned resource that represents proxy parameters

type CronHPAREST

type CronHPAREST struct {
	rest.Storage
	// contains filtered or unexported fields
}

CronHPAREST implements proxy CronHPA request to cluster of user.

func (*CronHPAREST) Connect

func (r *CronHPAREST) Connect(ctx context.Context, clusterName string, opts runtime.Object, responder rest.Responder) (http.Handler, error)

Connect returns a handler for the kube-apiserver proxy

func (*CronHPAREST) ConnectMethods

func (r *CronHPAREST) ConnectMethods() []string

ConnectMethods returns the list of HTTP methods that can be proxied

func (*CronHPAREST) New

func (r *CronHPAREST) New() runtime.Object

New creates a new CronHPA proxy options object

func (*CronHPAREST) NewConnectOptions

func (r *CronHPAREST) NewConnectOptions() (runtime.Object, bool, string)

NewConnectOptions returns versioned resource that represents proxy parameters

type DrainREST

type DrainREST struct {
	rest.Storage
	// contains filtered or unexported fields
}

DrainREST implements list versions of cluster

func (*DrainREST) Connect

func (r *DrainREST) Connect(ctx context.Context, clusterName string, opts runtime.Object, responder rest.Responder) (http.Handler, error)

Connect returns a handler for the helm-api proxy

func (*DrainREST) ConnectMethods

func (r *DrainREST) ConnectMethods() []string

ConnectMethods returns the list of HTTP methods that can be proxied

func (*DrainREST) New

func (r *DrainREST) New() runtime.Object

New creates a new helm proxy options object

func (*DrainREST) NewConnectOptions

func (r *DrainREST) NewConnectOptions() (runtime.Object, bool, string)

NewConnectOptions returns versioned resource that represents proxy parameters

type FinalizeREST

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

FinalizeREST implements the REST endpoint for finalizing a cluster.

func (*FinalizeREST) Export

func (r *FinalizeREST) Export(ctx context.Context, name string, options metav1.ExportOptions) (runtime.Object, error)

Export an object. Fields that are not user specified are stripped out Returns the stripped object.

func (*FinalizeREST) Get

func (r *FinalizeREST) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error)

Get retrieves the status finalizers subset of an object.

func (*FinalizeREST) New

func (r *FinalizeREST) New() runtime.Object

New returns an empty object that can be used with Create and Update after request data has been put into it.

func (*FinalizeREST) Update

func (r *FinalizeREST) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error)

Update alters the status finalizers subset of an object.

type HelmREST

type HelmREST struct {
	rest.Storage
	// contains filtered or unexported fields
}

HelmREST implements proxy helm api request to cluster of user.

func (*HelmREST) Connect

func (r *HelmREST) Connect(ctx context.Context, clusterName string, opts runtime.Object, responder rest.Responder) (http.Handler, error)

Connect returns a handler for the helm-api proxy

func (*HelmREST) ConnectMethods

func (r *HelmREST) ConnectMethods() []string

ConnectMethods returns the list of HTTP methods that can be proxied

func (*HelmREST) New

func (r *HelmREST) New() runtime.Object

New creates a new helm proxy options object

func (*HelmREST) NewConnectOptions

func (r *HelmREST) NewConnectOptions() (runtime.Object, bool, string)

NewConnectOptions returns versioned resource that represents proxy parameters

type LBCFAction

type LBCFAction string

LBCFAction defines the type of action

const (
	// LBCFDriverProxyAction sends request to driver via kube-apiserver
	LBCFDriverProxyAction LBCFAction = "driverProxy"
)
const (
	// LBCFEvents defines the action of lbcf events
	LBCFEvents LBCFAction = "events"
)
const (
	// LBCFGetBackendGroup defines the action of backend groups
	LBCFGetBackendGroup LBCFAction = "backendgroups"
)
const (
	// LBCFGetBackendRecords defines the action of backend records
	LBCFGetBackendRecords LBCFAction = "backendrecords"
)

type LBCFBackendGroupREST

type LBCFBackendGroupREST struct {
	rest.Storage
	// contains filtered or unexported fields
}

LBCFBackendGroupREST implements proxy LBCF BackendGroup request to cluster of user.

func (*LBCFBackendGroupREST) Connect

func (r *LBCFBackendGroupREST) Connect(ctx context.Context, clusterName string, opts runtime.Object, responder rest.Responder) (http.Handler, error)

Connect returns a handler for the kube-apiserver proxy

func (*LBCFBackendGroupREST) ConnectMethods

func (r *LBCFBackendGroupREST) ConnectMethods() []string

ConnectMethods returns the list of HTTP methods that can be proxied

func (*LBCFBackendGroupREST) New

New creates a new LBCF proxy options object

func (*LBCFBackendGroupREST) NewConnectOptions

func (r *LBCFBackendGroupREST) NewConnectOptions() (runtime.Object, bool, string)

NewConnectOptions returns versioned resource that represents proxy parameters

type LBCFBackendRecordREST

type LBCFBackendRecordREST struct {
	rest.Storage
	// contains filtered or unexported fields
}

LBCFBackendRecordREST implements proxy LBCF LoadBalancer request to cluster of user.

func (*LBCFBackendRecordREST) Connect

func (r *LBCFBackendRecordREST) Connect(ctx context.Context, clusterName string, opts runtime.Object, responder rest.Responder) (http.Handler, error)

Connect returns a handler for the kube-apiserver proxy

func (*LBCFBackendRecordREST) ConnectMethods

func (r *LBCFBackendRecordREST) ConnectMethods() []string

ConnectMethods returns the list of HTTP methods that can be proxied

func (*LBCFBackendRecordREST) New

New creates a new LBCF proxy options object

func (*LBCFBackendRecordREST) NewConnectOptions

func (r *LBCFBackendRecordREST) NewConnectOptions() (runtime.Object, bool, string)

NewConnectOptions returns versioned resource that represents proxy parameters

type LBCFDriverREST

type LBCFDriverREST struct {
	rest.Storage
	// contains filtered or unexported fields
}

LBCFDriverREST implements proxy LBCF LoadBalancerDriver request to cluster of user.

func (*LBCFDriverREST) Connect

func (r *LBCFDriverREST) Connect(ctx context.Context, clusterName string, opts runtime.Object, responder rest.Responder) (http.Handler, error)

Connect returns a handler for the kube-apiserver proxy

func (*LBCFDriverREST) ConnectMethods

func (r *LBCFDriverREST) ConnectMethods() []string

ConnectMethods returns the list of HTTP methods that can be proxied

func (*LBCFDriverREST) New

func (r *LBCFDriverREST) New() runtime.Object

New creates a new LBCF driver proxy options object

func (*LBCFDriverREST) NewConnectOptions

func (r *LBCFDriverREST) NewConnectOptions() (runtime.Object, bool, string)

NewConnectOptions returns versioned resource that represents proxy parameters

type LBCFLoadBalancerREST

type LBCFLoadBalancerREST struct {
	rest.Storage
	// contains filtered or unexported fields
}

LBCFLoadBalancerREST implements proxy LBCF LoadBalancer request to cluster of user.

func (*LBCFLoadBalancerREST) Connect

func (r *LBCFLoadBalancerREST) Connect(ctx context.Context, clusterName string, opts runtime.Object, responder rest.Responder) (http.Handler, error)

Connect returns a handler for the kube-apiserver proxy

func (*LBCFLoadBalancerREST) ConnectMethods

func (r *LBCFLoadBalancerREST) ConnectMethods() []string

ConnectMethods returns the list of HTTP methods that can be proxied

func (*LBCFLoadBalancerREST) New

New creates a new LBCF LoadBalancer proxy options object

func (*LBCFLoadBalancerREST) NewConnectOptions

func (r *LBCFLoadBalancerREST) NewConnectOptions() (runtime.Object, bool, string)

NewConnectOptions returns versioned resource that represents proxy parameters

type LogCollectorREST

type LogCollectorREST struct {
	rest.Storage
	// contains filtered or unexported fields
}

LogCollectorREST implements proxy LogCollector request to cluster of user.

func (*LogCollectorREST) Connect

func (r *LogCollectorREST) Connect(ctx context.Context, clusterName string, opts runtime.Object, responder rest.Responder) (http.Handler, error)

Connect returns a handler for the kube-apiserver proxy

func (*LogCollectorREST) ConnectMethods

func (r *LogCollectorREST) ConnectMethods() []string

ConnectMethods returns the list of HTTP methods that can be proxied

func (*LogCollectorREST) New

func (r *LogCollectorREST) New() runtime.Object

New creates a new LogCollector proxy options object

func (*LogCollectorREST) NewConnectOptions

func (r *LogCollectorREST) NewConnectOptions() (runtime.Object, bool, string)

NewConnectOptions returns versioned resource that represents proxy parameters

type PVCRREST

type PVCRREST struct {
	rest.Storage
	// contains filtered or unexported fields
}

PVCRREST implements proxy PVCR request to cluster of user.

func (*PVCRREST) Connect

func (r *PVCRREST) Connect(ctx context.Context, clusterName string, opts runtime.Object, responder rest.Responder) (http.Handler, error)

Connect returns a handler for the kube-apiserver proxy

func (*PVCRREST) ConnectMethods

func (r *PVCRREST) ConnectMethods() []string

ConnectMethods returns the list of HTTP methods that can be proxied

func (*PVCRREST) New

func (r *PVCRREST) New() runtime.Object

New creates a new PVCR proxy options object

func (*PVCRREST) NewConnectOptions

func (r *PVCRREST) NewConnectOptions() (runtime.Object, bool, string)

NewConnectOptions returns versioned resource that represents proxy parameters

type ProxyREST

type ProxyREST struct {
	rest.Storage
	// contains filtered or unexported fields
}

ProxyREST implements proxy native api request to cluster of user.

func (*ProxyREST) Connect

func (r *ProxyREST) Connect(ctx context.Context, clusterName string, opts runtime.Object, responder rest.Responder) (http.Handler, error)

Connect returns a handler for the native api proxy

func (*ProxyREST) ConnectMethods

func (r *ProxyREST) ConnectMethods() []string

ConnectMethods returns the list of HTTP methods that can be proxied

func (*ProxyREST) New

func (r *ProxyREST) New() runtime.Object

New creates a new helm proxy options object

func (*ProxyREST) NewConnectOptions

func (r *ProxyREST) NewConnectOptions() (runtime.Object, bool, string)

NewConnectOptions returns versioned resource that represents proxy parameters

type REST

type REST struct {
	*registry.Store
	// contains filtered or unexported fields
}

REST implements a RESTStorage for clusters against etcd.

func (*REST) Delete

func (r *REST) Delete(ctx context.Context, name string, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions) (runtime.Object, bool, error)

Delete enforces life-cycle rules for cluster termination

func (*REST) DeleteCollection

func (r *REST) DeleteCollection(ctx context.Context, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions, listOptions *metainternal.ListOptions) (runtime.Object, error)

DeleteCollection selects all resources in the storage matching given 'listOptions' and deletes them.

func (*REST) Export

func (r *REST) Export(ctx context.Context, clusterName string, options metav1.ExportOptions) (runtime.Object, error)

Export an object. Fields that are not user specified are stripped out Returns the stripped object.

func (*REST) Get

func (r *REST) Get(ctx context.Context, clusterName string, options *metav1.GetOptions) (runtime.Object, error)

Get finds a resource in the storage by name and returns it.

func (*REST) List

func (r *REST) List(ctx context.Context, options *metainternal.ListOptions) (runtime.Object, error)

List selects resources in the storage which match to the selector. 'options' can be nil.

func (*REST) ShortNames

func (r *REST) ShortNames() []string

ShortNames implements the ShortNamesProvider interface. Returns a list of short names for a resource.

func (*REST) Update

func (r *REST) Update(ctx context.Context, clusterName string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error)

Update finds a resource in the storage and updates it.

type StatusREST

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

StatusREST implements the REST endpoint for changing the status of a replication controller.

func (*StatusREST) Export

func (r *StatusREST) Export(ctx context.Context, name string, options metav1.ExportOptions) (runtime.Object, error)

Export an object. Fields that are not user specified are stripped out Returns the stripped object.

func (*StatusREST) Get

func (r *StatusREST) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error)

Get retrieves the object from the storage. It is required to support Patch.

func (*StatusREST) New

func (r *StatusREST) New() runtime.Object

New returns an empty object that can be used with Create and Update after request data has been put into it.

func (*StatusREST) Update

func (r *StatusREST) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error)

Update alters the status subset of an object.

type Storage

type Storage struct {
	Cluster           *REST
	Status            *StatusREST
	Finalize          *FinalizeREST
	Apply             *ApplyREST
	Helm              *HelmREST
	TappController    *TappControllerREST
	CSI               *CSIREST
	PVCR              *PVCRREST
	LogCollector      *LogCollectorREST
	CronHPA           *CronHPAREST
	Addon             *AddonREST
	AddonType         *AddonTypeREST
	LBCFDriver        *LBCFDriverREST
	LBCFLoadBalancer  *LBCFLoadBalancerREST
	LBCFBackendGroup  *LBCFBackendGroupREST
	LBCFBackendRecord *LBCFBackendRecordREST
	Drain             *DrainREST
	Proxy             *ProxyREST
}

Storage includes storage for clusters and all sub resources.

func NewStorage

func NewStorage(optsGetter genericregistry.RESTOptionsGetter, platformClient platforminternalclient.PlatformInterface, host string, privilegedUsername string) *Storage

NewStorage returns a Storage object that will work against clusters.

type TappControllerREST

type TappControllerREST struct {
	rest.Storage
	// contains filtered or unexported fields
}

TappControllerREST implements proxy tapp controller request to cluster of user.

func (*TappControllerREST) Connect

func (r *TappControllerREST) Connect(ctx context.Context, clusterName string, opts runtime.Object, responder rest.Responder) (http.Handler, error)

Connect returns a handler for the kube-apiserver proxy

func (*TappControllerREST) ConnectMethods

func (r *TappControllerREST) ConnectMethods() []string

ConnectMethods returns the list of HTTP methods that can be proxied

func (*TappControllerREST) New

New creates a new tapp proxy options object

func (*TappControllerREST) NewConnectOptions

func (r *TappControllerREST) NewConnectOptions() (runtime.Object, bool, string)

NewConnectOptions returns versioned resource that represents proxy parameters

Jump to

Keyboard shortcuts

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