client

package
v0.0.0-...-54d1e7e Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2014 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

A client for the Kubernetes cluster management API There are three fundamental objects

Pod - A co-scheduled set of running containers
ReplicationController - A manager for replicating Pods
Service - A discoverable load balancer

Copyright 2014 Google Inc. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeLabelQuery

func DecodeLabelQuery(labelQuery string) map[string]string

func EncodeLabelQuery

func EncodeLabelQuery(labelQuery map[string]string) string

Types

type AuthInfo

type AuthInfo struct {
	User     string
	Password string
}

AuthInfo is used to store authorization information

type Client

type Client struct {
	Host string
	Auth *AuthInfo
	// contains filtered or unexported fields
}

Client is the actual implementation of a Kubernetes client. Host is the http://... base for the URL

func (Client) CreatePod

func (client Client) CreatePod(pod api.Pod) (api.Pod, error)

CreatePod takes the representation of a pod. Returns the server's representation of the pod, and an error, if it occurs

func (Client) CreateReplicationController

func (client Client) CreateReplicationController(controller api.ReplicationController) (api.ReplicationController, error)

CreateReplicationController creates a new replication controller

func (Client) CreateService

func (client Client) CreateService(svc api.Service) (api.Service, error)

CreateReplicationController creates a new replication controller

func (Client) DeletePod

func (client Client) DeletePod(name string) error

DeletePod takes the name of the pod, and returns an error if one occurs

func (Client) DeleteReplicationController

func (client Client) DeleteReplicationController(name string) error

func (Client) DeleteService

func (client Client) DeleteService(name string) error

func (Client) GetPod

func (client Client) GetPod(name string) (api.Pod, error)

GetPod takes the name of the pod, and returns the corresponding Pod object, and an error if it occurs

func (Client) GetReplicationController

func (client Client) GetReplicationController(name string) (api.ReplicationController, error)

GetReplicationController returns information about a particular replication controller

func (Client) GetService

func (client Client) GetService(name string) (api.Service, error)

GetReplicationController returns information about a particular replication controller

func (Client) ListPods

func (client Client) ListPods(labelQuery map[string]string) (api.PodList, error)

ListPods takes a label query, and returns the list of pods that match that query

func (Client) UpdatePod

func (client Client) UpdatePod(pod api.Pod) (api.Pod, error)

UpdatePod takes the representation of a pod to update. Returns the server's representation of the pod, and an error, if it occurs

func (Client) UpdateReplicationController

func (client Client) UpdateReplicationController(controller api.ReplicationController) (api.ReplicationController, error)

UpdateReplicationController updates an existing replication controller

func (Client) UpdateService

func (client Client) UpdateService(svc api.Service) (api.Service, error)

UpdateReplicationController updates an existing replication controller

type ClientInterface

type ClientInterface interface {
	ListPods(labelQuery map[string]string) (api.PodList, error)
	GetPod(name string) (api.Pod, error)
	DeletePod(name string) error
	CreatePod(api.Pod) (api.Pod, error)
	UpdatePod(api.Pod) (api.Pod, error)

	GetReplicationController(name string) (api.ReplicationController, error)
	CreateReplicationController(api.ReplicationController) (api.ReplicationController, error)
	UpdateReplicationController(api.ReplicationController) (api.ReplicationController, error)
	DeleteReplicationController(string) error

	GetService(name string) (api.Service, error)
	CreateService(api.Service) (api.Service, error)
	UpdateService(api.Service) (api.Service, error)
	DeleteService(string) error
}

ClientInterface holds the methods for clients of Kubenetes, an interface to allow mock testing

type ContainerInfo

type ContainerInfo interface {
	GetContainerInfo(host, name string) (interface{}, error)
}

type FakeContainerInfo

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

Useful for testing.

func (*FakeContainerInfo) GetContainerInfo

func (c *FakeContainerInfo) GetContainerInfo(host, name string) (interface{}, error)

type HTTPContainerInfo

type HTTPContainerInfo struct {
	Client *http.Client
	Port   uint
}

func (*HTTPContainerInfo) GetContainerInfo

func (c *HTTPContainerInfo) GetContainerInfo(host, name string) (interface{}, error)

Jump to

Keyboard shortcuts

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