client

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildConfigInterface

type BuildConfigInterface interface {
	ListBuildConfigs(ctx kapi.Context, labels labels.Selector) (*buildapi.BuildConfigList, error)
	GetBuildConfig(ctx kapi.Context, id string) (*buildapi.BuildConfig, error)
	CreateBuildConfig(ctx kapi.Context, config *buildapi.BuildConfig) (*buildapi.BuildConfig, error)
	UpdateBuildConfig(ctx kapi.Context, config *buildapi.BuildConfig) (*buildapi.BuildConfig, error)
	DeleteBuildConfig(ctx kapi.Context, id string) error
}

BuildConfigInterface exposes methods on BuildConfig resources

type BuildInterface

type BuildInterface interface {
	ListBuilds(ctx kapi.Context, labels labels.Selector) (*buildapi.BuildList, error)
	GetBuild(ctx kapi.Context, id string) (*buildapi.Build, error)
	CreateBuild(ctx kapi.Context, build *buildapi.Build) (*buildapi.Build, error)
	UpdateBuild(ctx kapi.Context, build *buildapi.Build) (*buildapi.Build, error)
	DeleteBuild(ctx kapi.Context, id string) error
	WatchBuilds(ctx kapi.Context, field, label labels.Selector, resourceVersion string) (watch.Interface, error)
}

BuildInterface exposes methods on Build resources.

type Client

type Client struct {
	*kclient.RESTClient
}

Client is an OpenShift client object

func New

func New(c *kclient.Config) (*Client, error)

New creates an OpenShift client for the given config. This client works with builds, deployments, templates, routes, and images. It allows operations such as list, get, update and delete on these objects. An error is returned if the provided configuration is not valid.

func NewOrDie

func NewOrDie(c *kclient.Config) *Client

NewOrDie creates an OpenShift client and panics if the provided API version is not recognized.

func (*Client) CreateBuild

func (c *Client) CreateBuild(ctx kapi.Context, build *buildapi.Build) (result *buildapi.Build, err error)

CreateBuild creates new build. Returns the server's representation of the build and error if one occurs.

func (*Client) CreateBuildConfig

func (c *Client) CreateBuildConfig(ctx kapi.Context, build *buildapi.BuildConfig) (result *buildapi.BuildConfig, err error)

CreateBuildConfig creates a new buildconfig. Returns the server's representation of the buildconfig and error if one occurs.

func (*Client) CreateDeployment

func (c *Client) CreateDeployment(ctx kapi.Context, deployment *deployapi.Deployment) (result *deployapi.Deployment, err error)

CreateDeployment creates a new deployment

func (*Client) CreateDeploymentConfig

func (c *Client) CreateDeploymentConfig(ctx kapi.Context, deploymentConfig *deployapi.DeploymentConfig) (result *deployapi.DeploymentConfig, err error)

CreateDeploymentConfig creates a new deploymentConfig

func (*Client) CreateImage

func (c *Client) CreateImage(ctx kapi.Context, image *imageapi.Image) (result *imageapi.Image, err error)

CreateImage creates a new image. Returns the server's representation of the image and error if one occurs.

func (*Client) CreateImageRepository

func (c *Client) CreateImageRepository(ctx kapi.Context, repo *imageapi.ImageRepository) (result *imageapi.ImageRepository, err error)

CreateImageRepository create a new imagerepository. Returns the server's representation of the imagerepository and error if one occurs.

func (*Client) CreateImageRepositoryMapping

func (c *Client) CreateImageRepositoryMapping(ctx kapi.Context, mapping *imageapi.ImageRepositoryMapping) error

CreateImageRepositoryMapping create a new imagerepository mapping on the server. Returns error if one occurs.

func (*Client) CreateOrUpdateUserIdentityMapping

func (c *Client) CreateOrUpdateUserIdentityMapping(mapping *api.UserIdentityMapping) (result *api.UserIdentityMapping, created bool, err error)

CreateOrUpdateUserIdentityMapping attempts to get or create a binding between a user and an identity. If user information is provided, the server will check whether it matches the expected value. At this time the server will only allow creation when the identity is new - future APIs may allow clients to bind additional identities to an account.

func (*Client) CreateRoute

func (c *Client) CreateRoute(ctx kapi.Context, route *routeapi.Route) (result *routeapi.Route, err error)

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

func (*Client) DeleteBuild

func (c *Client) DeleteBuild(ctx kapi.Context, id string) (err error)

DeleteBuild deletes a build, returns error if one occurs.

func (*Client) DeleteBuildConfig

func (c *Client) DeleteBuildConfig(ctx kapi.Context, id string) error

DeleteBuildConfig deletes a BuildConfig, returns error if one occurs.

func (*Client) DeleteDeployment

func (c *Client) DeleteDeployment(ctx kapi.Context, id string) error

DeleteDeployment deletes an existing replication deployment.

func (*Client) DeleteDeploymentConfig

func (c *Client) DeleteDeploymentConfig(ctx kapi.Context, id string) error

DeleteDeploymentConfig deletes an existing deploymentConfig.

func (*Client) DeleteRoute

func (c *Client) DeleteRoute(ctx kapi.Context, id string) error

DeleteRoute takes the name of the route, and returns an error if one occurs

func (*Client) GenerateDeploymentConfig

func (c *Client) GenerateDeploymentConfig(ctx kapi.Context, id string) (result *deployapi.DeploymentConfig, err error)

GenerateDeploymentConfig generates a new deploymentConfig for the given ID.

func (*Client) GetBuild

func (c *Client) GetBuild(ctx kapi.Context, id string) (result *buildapi.Build, err error)

GetBuild returns information about a particular build and error if one occurs.

func (*Client) GetBuildConfig

func (c *Client) GetBuildConfig(ctx kapi.Context, id string) (result *buildapi.BuildConfig, err error)

GetBuildConfig returns information about a particular buildconfig and error if one occurs.

func (*Client) GetDeployment

func (c *Client) GetDeployment(ctx kapi.Context, id string) (result *deployapi.Deployment, err error)

GetDeployment returns information about a particular deployment

func (*Client) GetDeploymentConfig

func (c *Client) GetDeploymentConfig(ctx kapi.Context, id string) (result *deployapi.DeploymentConfig, err error)

GetDeploymentConfig returns information about a particular deploymentConfig

func (*Client) GetImage

func (c *Client) GetImage(ctx kapi.Context, id string) (result *imageapi.Image, err error)

GetImage returns information about a particular image and error if one occurs.

func (*Client) GetImageRepository

func (c *Client) GetImageRepository(ctx kapi.Context, id string) (result *imageapi.ImageRepository, err error)

GetImageRepository returns information about a particular imagerepository and error if one occurs.

func (*Client) GetRoute

func (c *Client) GetRoute(ctx kapi.Context, id string) (result *routeapi.Route, err error)

GetRoute takes the name of the route, and returns the corresponding Route object, and an error if it occurs

func (*Client) GetUser

func (c *Client) GetUser(name string) (result *api.User, err error)

GetUser returns information about a particular user or an error

func (*Client) ListBuildConfigs

func (c *Client) ListBuildConfigs(ctx kapi.Context, selector labels.Selector) (result *buildapi.BuildConfigList, err error)

ListBuildConfigs returns a list of buildconfigs that match the selector.

func (*Client) ListBuilds

func (c *Client) ListBuilds(ctx kapi.Context, selector labels.Selector) (result *buildapi.BuildList, err error)

ListBuilds returns a list of builds that match the selector.

func (*Client) ListDeploymentConfigs

func (c *Client) ListDeploymentConfigs(ctx kapi.Context, selector labels.Selector) (result *deployapi.DeploymentConfigList, err error)

ListDeploymentConfigs takes a selector, and returns the list of deploymentConfigs that match that selector

func (*Client) ListDeployments

func (c *Client) ListDeployments(ctx kapi.Context, selector labels.Selector) (result *deployapi.DeploymentList, err error)

ListDeployments takes a selector, and returns the list of deployments that match that selector

func (*Client) ListImageRepositories

func (c *Client) ListImageRepositories(ctx kapi.Context, selector labels.Selector) (result *imageapi.ImageRepositoryList, err error)

ListImageRepositories returns a list of imagerepositories that match the selector.

func (*Client) ListImages

func (c *Client) ListImages(ctx kapi.Context, selector labels.Selector) (result *imageapi.ImageList, err error)

ListImages returns a list of images that match the selector.

func (*Client) ListRoutes

func (c *Client) ListRoutes(ctx kapi.Context, selector labels.Selector) (result *routeapi.RouteList, err error)

ListRoutes takes a selector, and returns the list of routes that match that selector

func (*Client) UpdateBuild

func (c *Client) UpdateBuild(ctx kapi.Context, build *buildapi.Build) (result *buildapi.Build, err error)

UpdateBuild updates the build on server. Returns the server's representation of the build and error if one occurs.

func (*Client) UpdateBuildConfig

func (c *Client) UpdateBuildConfig(ctx kapi.Context, build *buildapi.BuildConfig) (result *buildapi.BuildConfig, err error)

UpdateBuildConfig updates the buildconfig on server. Returns the server's representation of the buildconfig and error if one occurs.

func (*Client) UpdateDeployment

func (c *Client) UpdateDeployment(ctx kapi.Context, deployment *deployapi.Deployment) (result *deployapi.Deployment, err error)

UpdateDeployment updates an existing deployment

func (*Client) UpdateDeploymentConfig

func (c *Client) UpdateDeploymentConfig(ctx kapi.Context, deploymentConfig *deployapi.DeploymentConfig) (result *deployapi.DeploymentConfig, err error)

UpdateDeploymentConfig updates an existing deploymentConfig

func (*Client) UpdateImageRepository

func (c *Client) UpdateImageRepository(ctx kapi.Context, repo *imageapi.ImageRepository) (result *imageapi.ImageRepository, err error)

UpdateImageRepository updates the imagerepository on the server. Returns the server's representation of the imagerepository and error if one occurs.

func (*Client) UpdateRoute

func (c *Client) UpdateRoute(ctx kapi.Context, route *routeapi.Route) (result *routeapi.Route, err error)

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

func (*Client) WatchBuilds

func (c *Client) WatchBuilds(ctx kapi.Context, field, label labels.Selector, resourceVersion string) (watch.Interface, error)

func (*Client) WatchDeploymentConfigs

func (c *Client) WatchDeploymentConfigs(ctx kapi.Context, field, label labels.Selector, resourceVersion string) (watch.Interface, error)

func (*Client) WatchDeployments

func (c *Client) WatchDeployments(ctx kapi.Context, field, label labels.Selector, resourceVersion string) (watch.Interface, error)

WatchDeployments returns a watch.Interface that watches the requested deployments.

func (*Client) WatchImageRepositories

func (c *Client) WatchImageRepositories(ctx kapi.Context, field, label labels.Selector, resourceVersion string) (watch.Interface, error)

WatchImageRepositories returns a watch.Interface that watches the requested imagerepositories.

func (*Client) WatchRoutes

func (c *Client) WatchRoutes(ctx kapi.Context, label, field labels.Selector, resourceVersion string) (watch.Interface, error)

WatchRoutes returns a watch.Interface that watches the requested routes.

type DeploymentConfigInterface

type DeploymentConfigInterface interface {
	ListDeploymentConfigs(ctx kapi.Context, selector labels.Selector) (*deployapi.DeploymentConfigList, error)
	WatchDeploymentConfigs(ctx kapi.Context, field, label labels.Selector, resourceVersion string) (watch.Interface, error)
	GetDeploymentConfig(ctx kapi.Context, id string) (*deployapi.DeploymentConfig, error)
	CreateDeploymentConfig(ctx kapi.Context, config *deployapi.DeploymentConfig) (*deployapi.DeploymentConfig, error)
	UpdateDeploymentConfig(ctx kapi.Context, config *deployapi.DeploymentConfig) (*deployapi.DeploymentConfig, error)
	DeleteDeploymentConfig(ctx kapi.Context, id string) error
	GenerateDeploymentConfig(ctx kapi.Context, id string) (*deployapi.DeploymentConfig, error)
}

DeploymentConfigInterface contains methods for working with DeploymentConfigs

type DeploymentInterface

type DeploymentInterface interface {
	ListDeployments(ctx kapi.Context, selector labels.Selector) (*deployapi.DeploymentList, error)
	GetDeployment(ctx kapi.Context, id string) (*deployapi.Deployment, error)
	CreateDeployment(ctx kapi.Context, deployment *deployapi.Deployment) (*deployapi.Deployment, error)
	UpdateDeployment(ctx kapi.Context, deployment *deployapi.Deployment) (*deployapi.Deployment, error)
	DeleteDeployment(ctx kapi.Context, id string) error
	WatchDeployments(ctx kapi.Context, field, label labels.Selector, resourceVersion string) (watch.Interface, error)
}

DeploymentInterface contains methods for working with Deployments

type Fake

type Fake struct {
	// Fake by default keeps a simple list of the methods that have been called.
	Actions []FakeAction
}

Fake implements Interface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the method you want to test easier.

func (*Fake) CreateBuild

func (c *Fake) CreateBuild(ctx kapi.Context, build *buildapi.Build) (*buildapi.Build, error)

func (*Fake) CreateBuildConfig

func (c *Fake) CreateBuildConfig(ctx kapi.Context, config *buildapi.BuildConfig) (*buildapi.BuildConfig, error)

func (*Fake) CreateDeployment

func (c *Fake) CreateDeployment(ctx kapi.Context, deployment *deployapi.Deployment) (*deployapi.Deployment, error)

func (*Fake) CreateDeploymentConfig

func (c *Fake) CreateDeploymentConfig(ctx kapi.Context, config *deployapi.DeploymentConfig) (*deployapi.DeploymentConfig, error)

func (*Fake) CreateImage

func (c *Fake) CreateImage(ctx kapi.Context, image *imageapi.Image) (*imageapi.Image, error)

func (*Fake) CreateImageRepository

func (c *Fake) CreateImageRepository(ctx kapi.Context, repo *imageapi.ImageRepository) (*imageapi.ImageRepository, error)

func (*Fake) CreateImageRepositoryMapping

func (c *Fake) CreateImageRepositoryMapping(ctx kapi.Context, mapping *imageapi.ImageRepositoryMapping) error

func (*Fake) CreateOrUpdateUserIdentityMapping

func (c *Fake) CreateOrUpdateUserIdentityMapping(mapping *userapi.UserIdentityMapping) (*userapi.UserIdentityMapping, bool, error)

func (*Fake) CreateRoute

func (c *Fake) CreateRoute(ctx kapi.Context, route *routeapi.Route) (*routeapi.Route, error)

func (*Fake) DeleteBuild

func (c *Fake) DeleteBuild(ctx kapi.Context, id string) error

func (*Fake) DeleteBuildConfig

func (c *Fake) DeleteBuildConfig(ctx kapi.Context, id string) error

func (*Fake) DeleteDeployment

func (c *Fake) DeleteDeployment(ctx kapi.Context, id string) error

func (*Fake) DeleteDeploymentConfig

func (c *Fake) DeleteDeploymentConfig(ctx kapi.Context, id string) error

func (*Fake) DeleteRoute

func (c *Fake) DeleteRoute(ctx kapi.Context, id string) error

func (*Fake) GenerateDeploymentConfig

func (c *Fake) GenerateDeploymentConfig(ctx kapi.Context, id string) (*deployapi.DeploymentConfig, error)

func (*Fake) GetBuild

func (c *Fake) GetBuild(ctx kapi.Context, id string) (*buildapi.Build, error)

func (*Fake) GetBuildConfig

func (c *Fake) GetBuildConfig(ctx kapi.Context, id string) (*buildapi.BuildConfig, error)

func (*Fake) GetDeployment

func (c *Fake) GetDeployment(ctx kapi.Context, id string) (*deployapi.Deployment, error)

func (*Fake) GetDeploymentConfig

func (c *Fake) GetDeploymentConfig(ctx kapi.Context, id string) (*deployapi.DeploymentConfig, error)

func (*Fake) GetImage

func (c *Fake) GetImage(ctx kapi.Context, id string) (*imageapi.Image, error)

func (*Fake) GetImageRepository

func (c *Fake) GetImageRepository(ctx kapi.Context, id string) (*imageapi.ImageRepository, error)

func (*Fake) GetRoute

func (c *Fake) GetRoute(ctx kapi.Context, id string) (*routeapi.Route, error)

func (*Fake) GetUser

func (c *Fake) GetUser(id string) (*userapi.User, error)

func (*Fake) ListBuildConfigs

func (c *Fake) ListBuildConfigs(ctx kapi.Context, selector labels.Selector) (*buildapi.BuildConfigList, error)

func (*Fake) ListBuilds

func (c *Fake) ListBuilds(ctx kapi.Context, selector labels.Selector) (*buildapi.BuildList, error)

func (*Fake) ListDeploymentConfigs

func (c *Fake) ListDeploymentConfigs(ctx kapi.Context, selector labels.Selector) (*deployapi.DeploymentConfigList, error)

func (*Fake) ListDeployments

func (c *Fake) ListDeployments(ctx kapi.Context, selector labels.Selector) (*deployapi.DeploymentList, error)

func (*Fake) ListImageRepositories

func (c *Fake) ListImageRepositories(ctx kapi.Context, selector labels.Selector) (*imageapi.ImageRepositoryList, error)

func (*Fake) ListImages

func (c *Fake) ListImages(ctx kapi.Context, selector labels.Selector) (*imageapi.ImageList, error)

func (*Fake) ListRoutes

func (c *Fake) ListRoutes(ctx kapi.Context, selector labels.Selector) (*routeapi.RouteList, error)

func (*Fake) UpdateBuild

func (c *Fake) UpdateBuild(ctx kapi.Context, build *buildapi.Build) (*buildapi.Build, error)

func (*Fake) UpdateBuildConfig

func (c *Fake) UpdateBuildConfig(ctx kapi.Context, config *buildapi.BuildConfig) (*buildapi.BuildConfig, error)

func (*Fake) UpdateDeployment

func (c *Fake) UpdateDeployment(ctx kapi.Context, deployment *deployapi.Deployment) (*deployapi.Deployment, error)

func (*Fake) UpdateDeploymentConfig

func (c *Fake) UpdateDeploymentConfig(ctx kapi.Context, config *deployapi.DeploymentConfig) (*deployapi.DeploymentConfig, error)

func (*Fake) UpdateImageRepository

func (c *Fake) UpdateImageRepository(ctx kapi.Context, repo *imageapi.ImageRepository) (*imageapi.ImageRepository, error)

func (*Fake) UpdateRoute

func (c *Fake) UpdateRoute(ctx kapi.Context, route *routeapi.Route) (*routeapi.Route, error)

func (*Fake) WatchBuilds

func (c *Fake) WatchBuilds(ctx kapi.Context, field, label labels.Selector, resourceVersion string) (watch.Interface, error)

func (*Fake) WatchDeploymentConfigs

func (c *Fake) WatchDeploymentConfigs(ctx kapi.Context, field, label labels.Selector, resourceVersion string) (watch.Interface, error)

func (*Fake) WatchDeployments

func (c *Fake) WatchDeployments(ctx kapi.Context, field, label labels.Selector, resourceVersion string) (watch.Interface, error)

func (*Fake) WatchImageRepositories

func (c *Fake) WatchImageRepositories(ctx kapi.Context, field, label labels.Selector, resourceVersion string) (watch.Interface, error)

func (*Fake) WatchRoutes

func (c *Fake) WatchRoutes(ctx kapi.Context, field, label labels.Selector, resourceVersion string) (watch.Interface, error)

type FakeAction

type FakeAction struct {
	Action string
	Value  interface{}
	Ctx    kapi.Context
}

type ImageInterface

type ImageInterface interface {
	ListImages(ctx kapi.Context, labels labels.Selector) (*imageapi.ImageList, error)
	GetImage(ctx kapi.Context, id string) (*imageapi.Image, error)
	CreateImage(ctx kapi.Context, image *imageapi.Image) (*imageapi.Image, error)
}

ImageInterface exposes methods on Image resources.

type ImageRepositoryInterface

type ImageRepositoryInterface interface {
	ListImageRepositories(ctx kapi.Context, labels labels.Selector) (*imageapi.ImageRepositoryList, error)
	GetImageRepository(ctx kapi.Context, id string) (*imageapi.ImageRepository, error)
	WatchImageRepositories(ctx kapi.Context, field, label labels.Selector, resourceVersion string) (watch.Interface, error)
	CreateImageRepository(ctx kapi.Context, repo *imageapi.ImageRepository) (*imageapi.ImageRepository, error)
	UpdateImageRepository(ctx kapi.Context, repo *imageapi.ImageRepository) (*imageapi.ImageRepository, error)
}

ImageRepositoryInterface exposes methods on ImageRepository resources.

type ImageRepositoryMappingInterface

type ImageRepositoryMappingInterface interface {
	CreateImageRepositoryMapping(ctx kapi.Context, mapping *imageapi.ImageRepositoryMapping) error
}

ImageRepositoryMappingInterface exposes methods on ImageRepositoryMapping resources.

type RouteInterface

type RouteInterface interface {
	ListRoutes(ctx kapi.Context, selector labels.Selector) (*routeapi.RouteList, error)
	GetRoute(ctx kapi.Context, id string) (*routeapi.Route, error)
	CreateRoute(ctx kapi.Context, route *routeapi.Route) (*routeapi.Route, error)
	UpdateRoute(ctx kapi.Context, route *routeapi.Route) (*routeapi.Route, error)
	DeleteRoute(ctx kapi.Context, id string) error
	WatchRoutes(ctx kapi.Context, label, field labels.Selector, resourceVersion string) (watch.Interface, error)
}

RouteInterface exposes methods on Route resources

type UserIdentityMappingInterface

type UserIdentityMappingInterface interface {
	CreateOrUpdateUserIdentityMapping(*api.UserIdentityMapping) (*api.UserIdentityMapping, bool, error)
}

UserIdentityMappingInterface exposes methods on UserIdentityMapping resources.

type UserInterface

type UserInterface interface {
	GetUser(string) (*api.User, error)
}

UserInterface exposes methods on user resources.

Jump to

Keyboard shortcuts

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