endpoints

package
v1.6.0-alpha.1 Latest Latest
Warning

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

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

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIVersionHandler

func APIVersionHandler(s runtime.NegotiatedSerializer, getAPIVersionsFunc func(req *restful.Request) *metav1.APIVersions) restful.RouteFunction

APIVersionHandler returns a handler which will list the provided versions as available.

func AddApiWebService

func AddApiWebService(s runtime.NegotiatedSerializer, container *restful.Container, apiPrefix string, getAPIVersionsFunc func(req *restful.Request) *metav1.APIVersions)

AddApiWebService adds a service to return the supported api versions at the legacy /api.

func AddSupportedResourcesWebService

func AddSupportedResourcesWebService(s runtime.NegotiatedSerializer, ws *restful.WebService, groupVersion schema.GroupVersion, lister handlers.APIResourceLister)

Adds a service to return the supported resources, E.g., a such web service will be registered at /apis/extensions/v1.

func NewApisWebService

func NewApisWebService(s runtime.NegotiatedSerializer, apiPrefix string, f func(req *restful.Request) []metav1.APIGroup) *restful.WebService

NewApisWebService returns a webservice serving the available api version under /apis.

func NewGroupWebService

func NewGroupWebService(s runtime.NegotiatedSerializer, path string, group metav1.APIGroup) *restful.WebService

NewGroupWebService returns a webservice serving the supported versions, preferred version, and name of a group. E.g., such a web service will be registered at /apis/extensions.

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
	Linker    runtime.SelfLinker

	Admit   admission.Interface
	Context request.RequestContextMapper

	MinRequestTimeout time.Duration

	// SubresourceGroupVersionKind contains the GroupVersionKind overrides for each subresource that is
	// accessible from this API group version. The GroupVersionKind is that of the external version of
	// the subresource. The key of this map should be the path of the subresource. The keys here should
	// match the keys in the Storage map above for subresources.
	SubresourceGroupVersionKind map[string]schema.GroupVersionKind

	// ResourceLister is an interface that knows how to list resources
	// for this API Group.
	ResourceLister handlers.APIResourceLister
}

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.

func (*APIGroupVersion) UpdateREST

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

UpdateREST registers the REST handlers for this APIGroupVersion to an existing web service in the restful Container. It will use the prefix (root/version) to find the existing web service. If a web service does not exist within the container to support the prefix this method will return an error.

type APIInstaller

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

func (*APIInstaller) Install

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

Installs handlers for API resources.

func (*APIInstaller) NewWebService

func (a *APIInstaller) NewWebService() *restful.WebService

NewWebService creates a new restful webservice with the api installer's prefix and version.

Directories

Path Synopsis
Package filters contains all the http handler chain filters which _are_ api related, i.e.
Package filters contains all the http handler chain filters which _are_ api related, i.e.
Package handlers contains HTTP handlers to implement the apiserver APIs.
Package handlers contains HTTP handlers to implement the apiserver APIs.
responsewriters
Package responsewriters containers helpers to write responses in HTTP handlers.
Package responsewriters containers helpers to write responses in HTTP handlers.

Jump to

Keyboard shortcuts

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