client-go: k8s.io/client-go/scale Index | Files | Directories

package scale

import "k8s.io/client-go/scale"

Package scale provides a polymorphic scale client capable of fetching and updating Scale for any resource which implements the `scale` subresource, as long as that subresource operates on a version of scale convertable to autoscaling.Scale.

Index

Package Files

client.go doc.go interfaces.go util.go

type PreferredResourceMapper Uses

type PreferredResourceMapper interface {
    // ResourceFor takes a partial resource and returns the preferred resource.
    ResourceFor(resource schema.GroupVersionResource) (preferredResource schema.GroupVersionResource, err error)
}

PreferredResourceMapper determines the preferred version of a resource to scale

type ScaleConverter Uses

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

ScaleConverter knows how to convert between external scale versions.

func NewScaleConverter Uses

func NewScaleConverter() *ScaleConverter

NewScaleConverter creates a new ScaleConverter for converting between Scales in autoscaling/v1 and extensions/v1beta1.

func (*ScaleConverter) Codecs Uses

func (c *ScaleConverter) Codecs() serializer.CodecFactory

func (*ScaleConverter) ConvertToVersion Uses

func (c *ScaleConverter) ConvertToVersion(in runtime.Object, outVersion schema.GroupVersion) (runtime.Object, error)

ConvertToVersion converts the given *external* input object to the given output *external* output group-version.

func (*ScaleConverter) ScaleVersions Uses

func (c *ScaleConverter) ScaleVersions() []schema.GroupVersion

func (*ScaleConverter) Scheme Uses

func (c *ScaleConverter) Scheme() *runtime.Scheme

Scheme returns the scheme used by this scale converter.

type ScaleInterface Uses

type ScaleInterface interface {
    // Get fetches the scale of the given scalable resource.
    Get(resource schema.GroupResource, name string) (*autoscalingapi.Scale, error)

    // Update updates the scale of the the given scalable resource.
    Update(resource schema.GroupResource, scale *autoscalingapi.Scale) (*autoscalingapi.Scale, error)
}

ScaleInterface can fetch and update scales for resources in a particular namespace which implement the scale subresource.

type ScaleKindResolver Uses

type ScaleKindResolver interface {
    // ScaleForResource returns the GroupVersionKind of the
    // scale subresource for the given GroupVersionResource.
    ScaleForResource(resource schema.GroupVersionResource) (scaleVersion schema.GroupVersionKind, err error)
}

ScaleKindResolver knows about the relationship between resources and the GroupVersionKind of their scale subresources.

func NewDiscoveryScaleKindResolver Uses

func NewDiscoveryScaleKindResolver(client discovery.ServerResourcesInterface) ScaleKindResolver

NewDiscoveryScaleKindResolver creates a new ScaleKindResolver which uses information from the given disovery client to resolve the correct Scale GroupVersionKind for different resources.

type ScalesGetter Uses

type ScalesGetter interface {
    Scales(namespace string) ScaleInterface
}

ScalesGetter can produce a ScaleInterface for a particular namespace.

func New Uses

func New(baseClient restclient.Interface, mapper PreferredResourceMapper, resolver dynamic.APIPathResolverFunc, scaleKindResolver ScaleKindResolver) ScalesGetter

New creates a new ScalesGetter using the given client to make requests. The GroupVersion on the client is ignored.

func NewForConfig Uses

func NewForConfig(cfg *restclient.Config, mapper PreferredResourceMapper, resolver dynamic.APIPathResolverFunc, scaleKindResolver ScaleKindResolver) (ScalesGetter, error)

NewForConfig creates a new ScalesGetter which resolves kinds to resources using the given RESTMapper, and API paths using the given dynamic.APIPathResolverFunc.

Directories

PathSynopsis
fakePackage fake provides a fake client interface to arbitrary Kubernetes APIs that exposes common high level operations and exposes common metadata.
schemePackage scheme contains a runtime.Scheme to be used for serializing and deserializing different versions of Scale, and for converting in between them.
scheme/appsintPackage appsint contains the necessary scaffolding of the internal version of extensions as required by conversion logic.
scheme/appsv1beta1
scheme/appsv1beta2
scheme/autoscalingv1
scheme/extensionsintPackage extensionsint contains the necessary scaffolding of the internal version of extensions as required by conversion logic.
scheme/extensionsv1beta1

Package scale imports 19 packages (graph) and is imported by 139 packages. Updated 2018-08-07. Refresh now. Tools for package owners.