storage

package
v1.9.0-industry.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 60 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Scheme is the default instance of runtime.Scheme to which types in the TKE API are already registered.
	Scheme = runtime.NewScheme()
	// Codecs provides access to encoding and decoding for the scheme
	Codecs = serializer.NewCodecFactory(Scheme)
)

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 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 APIResourcesREST added in v1.8.0

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

APIResourcesREST implement bucket call interface for cluster.

func (*APIResourcesREST) Get added in v1.8.0

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

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

func (*APIResourcesREST) New added in v1.8.0

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

func (*APIResourcesREST) NewGetOptions added in v1.8.0

func (r *APIResourcesREST) NewGetOptions() (runtime.Object, bool, string)

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 CustomResourceHandler added in v1.9.0

type CustomResourceHandler struct {
	LoopbackClientConfig *rest.Config
}

func (*CustomResourceHandler) ServeHTTP added in v1.9.0

ServeHTTP is a proxy for unregister custom resource

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) 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 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, _ 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) 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) 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
	TappController *TappControllerREST
	CSI            *CSIREST
	CronHPA        *CronHPAREST
	Addon          *AddonREST
	AddonType      *AddonTypeREST
	Drain          *DrainREST
	Proxy          *ProxyREST
	APIResources   *APIResourcesREST
}

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