dynamic

package
v1.3.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2016 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package dynamic provides a client interface to arbitrary Kubernetes APIs that exposes common high level operations and exposes common metadata.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LegacyAPIPathResolverFunc

func LegacyAPIPathResolverFunc(groupVersion unversioned.GroupVersion) string

LegacyAPIPathResolverFunc can resolve paths properly with the legacy API.

func NewDiscoveryRESTMapper

func NewDiscoveryRESTMapper(resources []*unversioned.APIResourceList, versionFunc meta.VersionInterfacesFunc) (*meta.DefaultRESTMapper, error)

NewDiscoveryRESTMapper returns a RESTMapper based on discovery information.

func NewObjectTyper

func NewObjectTyper(resources []*unversioned.APIResourceList) (runtime.ObjectTyper, error)

NewObjectTyper constructs an ObjectTyper from discovery information.

func VersionInterfaces

func VersionInterfaces(unversioned.GroupVersion) (*meta.VersionInterfaces, error)

VersionInterfaces provides an object converter and metadata accessor appropriate for use with unstructured objects.

Types

type APIPathResolverFunc

type APIPathResolverFunc func(groupVersion unversioned.GroupVersion) string

APIPathResolverFunc knows how to convert a groupVersion to its API path.

type Client

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

Client is a Kubernetes client that allows you to access metadata and manipulate metadata of a Kubernetes API group.

func NewClient

func NewClient(conf *restclient.Config) (*Client, error)

NewClient returns a new client based on the passed in config. The codec is ignored, as the dynamic client uses it's own codec.

func (*Client) Resource

func (c *Client) Resource(resource *unversioned.APIResource, namespace string) *ResourceClient

Resource returns an API interface to the specified resource for this client's group and version. If resource is not a namespaced resource, then namespace is ignored.

type ClientPool

type ClientPool interface {
	// ClientForGroupVersion returns a client configured for the specified groupVersion.
	ClientForGroupVersion(groupVersion unversioned.GroupVersion) (*Client, error)
}

ClientPool manages a pool of dynamic clients.

func NewClientPool

func NewClientPool(config *restclient.Config, apiPathResolverFunc APIPathResolverFunc) ClientPool

NewClientPool returns a ClientPool from the specified config

type ObjectTyper

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

ObjectTyper provides an ObjectTyper implmentation for runtime.Unstructured object based on discovery information.

func (*ObjectTyper) ObjectKinds

func (ot *ObjectTyper) ObjectKinds(obj runtime.Object) ([]unversioned.GroupVersionKind, bool, error)

ObjectKinds returns a slice of one element with the group,version,kind of the provided object, or an error if the object is not *runtime.Unstructured or has no group,version,kind information.

func (*ObjectTyper) Recognizes

func (ot *ObjectTyper) Recognizes(gvk unversioned.GroupVersionKind) bool

Recognizes returns true if the provided group,version,kind was in the discovery information.

type ResourceClient

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

ResourceClient is an API interface to a specific resource under a dynamic client.

func (*ResourceClient) Create

Create creates the provided resource.

func (*ResourceClient) Delete

func (rc *ResourceClient) Delete(name string, opts *v1.DeleteOptions) error

Delete deletes the resource with the specified name.

func (*ResourceClient) DeleteCollection

func (rc *ResourceClient) DeleteCollection(deleteOptions *v1.DeleteOptions, listOptions runtime.Object) error

DeleteCollection deletes a collection of objects.

func (*ResourceClient) Get

func (rc *ResourceClient) Get(name string) (*runtime.Unstructured, error)

Get gets the resource with the specified name.

func (*ResourceClient) List

List returns a list of objects for this resource.

func (*ResourceClient) Patch

func (rc *ResourceClient) Patch(name string, pt api.PatchType, data []byte) (*runtime.Unstructured, error)

func (*ResourceClient) Update

Update updates the provided resource.

func (*ResourceClient) Watch

func (rc *ResourceClient) Watch(opts runtime.Object) (watch.Interface, error)

Watch returns a watch.Interface that watches the resource.

Jump to

Keyboard shortcuts

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