apiserver: k8s.io/apiserver/pkg/endpoints Index | Files | Directories

package endpoints

import "k8s.io/apiserver/pkg/endpoints"

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

Index

Package Files

doc.go groupversion.go installer.go

Constants

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

func AddObjectParams Uses

func AddObjectParams(ws *restful.WebService, route *restful.RouteBuilder, obj interface{}) error

AddObjectParams converts a runtime.Object into a set of go-restful Param() definitions on the route. The object must be a pointer to a struct; only fields at the top level of the struct that are not themselves interfaces or structs are used; only fields with a json tag that is non empty (the standard Go JSON behavior for omitting a field) become query parameters. The name of the query parameter is the JSON field name. If a description struct tag is set on the field, that description is used on the query parameter. In essence, it converts a standard JSON top level object into a query param schema.

func GetArticleForNoun Uses

func GetArticleForNoun(noun string, padding string) string

GetArticleForNoun returns the article needed for the given noun.

func GetResourceKind Uses

func GetResourceKind(groupVersion schema.GroupVersion, storage rest.Storage, typer runtime.ObjectTyper) (schema.GroupVersionKind, error)

GetResourceKind returns the external group version kind registered for the given storage object. If the storage object is a subresource and has an override supplied for it, it returns the group version kind supplied in the override.

type APIGroupVersion Uses

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

    // RootScopedKinds are the root scoped kinds for the primary GroupVersion
    RootScopedKinds sets.String

    // 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
    Defaulter       runtime.ObjectDefaulter
    Linker          runtime.SelfLinker
    UnsafeConvertor runtime.ObjectConvertor

    EquivalentResourceRegistry runtime.EquivalentResourceRegistry

    // Authorizer determines whether a user is allowed to make a certain request. The Handler does a preliminary
    // authorization check using the request URI but it may be necessary to make additional checks, such as in
    // the create-on-update case
    Authorizer authorizer.Authorizer

    Admit admission.Interface

    MinRequestTimeout time.Duration

    // OpenAPIModels exposes the OpenAPI models to each individual handler.
    OpenAPIModels openapiproto.Models

    // The limit on the request body size that would be accepted and decoded in a write request.
    // 0 means no limit.
    MaxRequestBodyBytes int64
}

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 Uses

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 Uses

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

func (*APIInstaller) Install Uses

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

Install handlers for API resources.

type StorageMetricsOverride Uses

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

Directories

PathSynopsis
discovery
filtersPackage filters contains all the http handler chain filters which _are_ api related, i.e.
handlersPackage handlers contains HTTP handlers to implement the apiserver APIs.
handlers/fieldmanager
handlers/fieldmanager/internal
handlers/negotiationPackage negotiation contains media type negotiation logic.
handlers/responsewritersPackage responsewriters containers helpers to write responses in HTTP handlers.
metrics
openapi
openapi/testing
requestPackage request contains everything around extracting info from a http request object.
testing

Package endpoints imports 27 packages (graph) and is imported by 10 packages. Updated 2019-12-09. Refresh now. Tools for package owners.