package endpoints

import "k8s.io/kubernetes/staging/src/k8s.io/apiserver/pkg/endpoints"

Package endpoints contains the generic code that provides a RESTful Kubernetes-style API service.

Index

Constants

const (
	ROUTE_META_GVK    = "x-kubernetes-group-version-kind"
	ROUTE_META_ACTION = "x-kubernetes-action"
)

Types

type APIGroupVersion

type APIGroupVersion struct {
	Storage map[string]rest.Storage

	Root string

	// GroupVersion is the external group version
	GroupVersion schema.GroupVersion

	// OptionsExternalVersion controls the Kubernetes APIVersion used for common objects in the apiserver
	// schema like api.Status, api.DeleteOptions, and metav1.ListOptions. Other implementors may
	// define a version "v1beta1" but want to use the Kubernetes "v1" internal objects. If
	// empty, defaults to GroupVersion.
	OptionsExternalVersion *schema.GroupVersion
	// MetaGroupVersion defaults to "meta.k8s.io/v1" and is the scheme group version used to decode
	// common API implementations like ListOptions. Future changes will allow this to vary by group
	// version (for when the inevitable meta/v2 group emerges).
	MetaGroupVersion *schema.GroupVersion

	Mapper meta.RESTMapper

	// Serializer is used to determine how to convert responses from API methods into bytes to send over
	// the wire.
	Serializer     runtime.NegotiatedSerializer
	ParameterCodec runtime.ParameterCodec

	Typer           runtime.ObjectTyper
	Creater         runtime.ObjectCreater
	Convertor       runtime.ObjectConvertor
	Copier          runtime.ObjectCopier
	Defaulter       runtime.ObjectDefaulter
	Linker          runtime.SelfLinker
	UnsafeConvertor runtime.ObjectConvertor

	Admit   admission.Interface
	Context request.RequestContextMapper

	MinRequestTimeout time.Duration

	// EnableAPIResponseCompression indicates whether API Responses should support compression
	// if the client requests it via Accept-Encoding
	EnableAPIResponseCompression bool
}

APIGroupVersion is a helper for exposing rest.Storage objects as http.Handlers via go-restful It handles URLs of the form: /${storage_key}[/${object_name}] Where 'storage_key' points to a rest.Storage object stored in storage. This object should contain all parameterization necessary for running a particular API version

func (*APIGroupVersion) InstallREST

func (g *APIGroupVersion) InstallREST(container *restful.Container) error

InstallREST registers the REST handlers (storage, watch, proxy and redirect) into a restful Container. It is expected that the provided path root prefix will serve all operations. Root MUST NOT end in a slash.

type APIInstaller

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

func (*APIInstaller) Install

func (a *APIInstaller) Install() ([]metav1.APIResource, *restful.WebService, []error)

Install handlers for API resources.

type StorageMetricsOverride

type StorageMetricsOverride interface {
	// OverrideMetricsVerb gives a storage object an opportunity to override the verb reported to the metrics endpoint
	OverrideMetricsVerb(oldVerb string) (newVerb string)
}

An interface to see if one storage supports override its default verb for monitoring

Source Files

apiserver.go doc.go groupversion.go installer.go

Directories

PathSynopsis
staging/src/k8s.io/apiserver/pkg/endpoints/discovery
staging/src/k8s.io/apiserver/pkg/endpoints/filtersPackage filters contains all the http handler chain filters which _are_ api related, i.e.
staging/src/k8s.io/apiserver/pkg/endpoints/handlersPackage handlers contains HTTP handlers to implement the apiserver APIs.
staging/src/k8s.io/apiserver/pkg/endpoints/handlers/negotiationPackage negotation contains media type negotiation logic.
staging/src/k8s.io/apiserver/pkg/endpoints/handlers/responsewritersPackage responsewriters containers helpers to write responses in HTTP handlers.
staging/src/k8s.io/apiserver/pkg/endpoints/metrics
staging/src/k8s.io/apiserver/pkg/endpoints/openapi
staging/src/k8s.io/apiserver/pkg/endpoints/openapi/testing
staging/src/k8s.io/apiserver/pkg/endpoints/requestPackage request contains everything around extracting info from a http request object.
staging/src/k8s.io/apiserver/pkg/endpoints/testing
Version
v1.8.8
Published
Feb 4, 2018
Platform
linux/amd64
Imports
24 packages
Last checked
34 seconds ago

Tools for package owners.