chClient

package
v3.5.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2018 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrUnableToLogin -- unable to login
	ErrUnableToLogin chkitErrors.Err = "unable to login"
	// ErrUnableToRefreshToken -- unable to refresh token
	// nolint:gas
	ErrUnableToRefreshToken chkitErrors.Err = "unable to refresh token"
	// ErrWrongPasswordLoginCombination -- wrong login-password combination
	ErrWrongPasswordLoginCombination chkitErrors.Err = "wrong login-password combination"
	// ErrUserNotExist -- user doesn't not exist
	ErrUserNotExist  chkitErrors.Err = "user doesn't not exist"
	ErrInternalError chkitErrors.Err = "internal server error"
)
View Source
const (
	ErrContainerAlreadyExists chkitErrors.Err = "container already exists in deployment"
	ErrContainerDoesNotExist  chkitErrors.Err = "container does not exist"
)
View Source
const (
	ErrYouDoNotHaveAccessToResource chkitErrors.Err = "you don't have access to resource"
	ErrResourceNotExists            chkitErrors.Err = "resource not exists"
	ErrFatalError                   chkitErrors.Err = "fatal error"
)
View Source
const (
	ErrUnableToRunAllSolutionComponents chkitErrors.Err = "unable to run all solution components"
	ErrSolutionNotExists                chkitErrors.Err = "solution not exists\n"
)
View Source
const (
	// ErrUnableToInitClient -- unable to init client
	ErrUnableToInitClient chkitErrors.Err = "unable to init client"
)

Variables

This section is empty.

Functions

func HandleErrorRetry

func HandleErrorRetry(client *Client, err error) (bool, error)

func WithCommonAPI

func WithCommonAPI(config model.Config) (*kubeClient.Client, error)

WithCommonAPI -- creates kube-client for production api

func WithMock

func WithMock(config model.Config) (*kubeClient.Client, error)

WithMock -- creates kube-client with mock API

func WithTestAPI

func WithTestAPI(config model.Config) (*kubeClient.Client, error)

WithTestAPI -- creates kube-client for test api

Types

type Client

type Client struct {
	model.Config
	// contains filtered or unexported fields
}

Client -- chkit core client

func (*Client) Auth

func (client *Client) Auth() error

Auth -- refreshes tokens, on invalid token uses Login method to get new tokens

func (*Client) CreateConfigMap

func (client *Client) CreateConfigMap(ns string, cm configmap.ConfigMap) error

func (*Client) CreateDeployment

func (client *Client) CreateDeployment(ns string, depl deployment.Deployment) error

func (*Client) CreateDeploymentContainer

func (client *Client) CreateDeploymentContainer(ns, deplName string, cont container.Container) error

func (*Client) CreateIngress

func (client *Client) CreateIngress(ns string, ingr ingress.Ingress) error

func (*Client) CreateService

func (client *Client) CreateService(ns string, serv service.Service) error

func (*Client) DeleteAccess

func (client *Client) DeleteAccess(ns, username string) error

func (*Client) DeleteConfigmap

func (client *Client) DeleteConfigmap(namespace, cm string) error

func (*Client) DeleteDeployment

func (client *Client) DeleteDeployment(namespace, deplName string) error

func (*Client) DeleteDeploymentContainer

func (client *Client) DeleteDeploymentContainer(ns, deplName, cont string) error

func (*Client) DeleteDeploymentVersion

func (client *Client) DeleteDeploymentVersion(namespace, deployment string, version semver.Version) error

func (*Client) DeleteIngress

func (client *Client) DeleteIngress(ns, name string) error

func (*Client) DeleteNamespace

func (client *Client) DeleteNamespace(ID string) error

func (*Client) DeletePod

func (client *Client) DeletePod(namespace, pod string) error

func (*Client) DeleteService

func (client *Client) DeleteService(namespace, service string) error

func (*Client) DeleteSolution

func (client *Client) DeleteSolution(namespace, solutionName string) error

func (*Client) DeleteVolume

func (client *Client) DeleteVolume(namespaceID, volumeName string) error

func (*Client) Extend

func (client *Client) Extend() error

Extend -- refreshes tokens, invalidates old

func (*Client) GetAccess

func (client *Client) GetAccess(nsName string) (access.AccessList, error)

func (*Client) GetConfigmap

func (client *Client) GetConfigmap(namespace, cmName string) (configmap.ConfigMap, error)

func (*Client) GetConfigmapList

func (client *Client) GetConfigmapList(namespace string) (configmap.ConfigMapList, error)

func (*Client) GetDeployment

func (client *Client) GetDeployment(namespace, deplName string) (deployment.Deployment, error)

func (*Client) GetDeploymentDiffBetweenVersions

func (client *Client) GetDeploymentDiffBetweenVersions(namespace, deployment string, leftVersion, rightVersion semver.Version) (string, error)

func (*Client) GetDeploymentDiffWithPreviousVersion

func (client *Client) GetDeploymentDiffWithPreviousVersion(namespace, deployment string, version semver.Version) (string, error)

func (*Client) GetDeploymentList

func (client *Client) GetDeploymentList(namespace string) (deployment.DeploymentList, error)

func (*Client) GetDeploymentPodList

func (client *Client) GetDeploymentPodList(ns, deploy string) (pod.PodList, error)

func (*Client) GetDeploymentVersions

func (client *Client) GetDeploymentVersions(namespaceID, deploymentName string) (deployment.DeploymentList, error)

func (*Client) GetIngress

func (client *Client) GetIngress(ns, domain string) (ingress.Ingress, error)

func (*Client) GetIngressList

func (client *Client) GetIngressList(ns string) (ingress.IngressList, error)

func (*Client) GetNamespace

func (client *Client) GetNamespace(ID string) (namespace.Namespace, error)

GetNamespace -- returns info of namespace with given label. Returns:

  • ErrNamespaceNotExists
  • ErrWrongPasswordLoginCombination
  • ErrUserNotExist

func (*Client) GetNamespaceList

func (client *Client) GetNamespaceList() (namespace.NamespaceList, error)

func (*Client) GetPod

func (client *Client) GetPod(ns, podname string) (pod.Pod, error)

func (*Client) GetPodList

func (client *Client) GetPodList(ns string) (pod.PodList, error)

func (*Client) GetPodLogs

func (client *Client) GetPodLogs(params client.GetPodLogsParams) (io.ReadCloser, error)

func (*Client) GetProfile

func (client *Client) GetProfile() (user.User, error)

func (*Client) GetRunningSolution

func (client *Client) GetRunningSolution(namespace, solutionName string) (solution.Solution, error)

func (*Client) GetRunningSolutionsList

func (client *Client) GetRunningSolutionsList(namespace string) (solution.SolutionsList, error)

func (*Client) GetService

func (client *Client) GetService(namespace, serviceName string) (service.Service, error)

func (*Client) GetServiceList

func (client *Client) GetServiceList(namespace string) (service.ServiceList, error)

func (*Client) GetSolutionDeployments

func (client *Client) GetSolutionDeployments(namespace, solutionName string) (deployment.DeploymentList, error)

func (*Client) GetSolutionServices

func (client *Client) GetSolutionServices(namespace, solutionName string) (service.ServiceList, error)

func (*Client) GetSolutionsTemplatesEnvs

func (client *Client) GetSolutionsTemplatesEnvs(template, branch string) (solution.SolutionEnv, error)

func (*Client) GetSolutionsTemplatesList

func (client *Client) GetSolutionsTemplatesList() (solution.TemplatesList, error)

func (*Client) GetVolume

func (client *Client) GetVolume(namespaceID, volumeName string) (volume.Volume, error)

func (*Client) GetVolumeList

func (client *Client) GetVolumeList(namespaceID string) (volume.VolumeList, error)

func (*Client) Init

func (client *Client) Init(setup KubeAPIclientSetup) error

func (*Client) IsInitialized

func (client *Client) IsInitialized() bool

func (*Client) Login

func (client *Client) Login() error

Login -- client login method. Updates tokens

func (*Client) ReInit

func (client *Client) ReInit() error

func (*Client) RenameNamespace

func (client *Client) RenameNamespace(ID, newName string) error

func (*Client) ReplaceConfigmap

func (client *Client) ReplaceConfigmap(namespaceID string, cm configmap.ConfigMap) error

func (*Client) ReplaceDeployment

func (client *Client) ReplaceDeployment(ns string, newDepl deployment.Deployment) error

func (*Client) ReplaceDeploymentContainer

func (client *Client) ReplaceDeploymentContainer(ns, deplName string, cont container.Container) error

func (*Client) ReplaceIngress

func (client *Client) ReplaceIngress(ns string, ingr ingress.Ingress) error

func (*Client) ReplaceService

func (client *Client) ReplaceService(ns string, serv service.Service) error

func (*Client) RunDeploymentVersion

func (client *Client) RunDeploymentVersion(namespace, deployment string, version semver.Version) error

func (*Client) RunSolution

func (client *Client) RunSolution(sol solution.Solution) error

func (*Client) SetAccess

func (client *Client) SetAccess(ns, username string, acc model.AccessLevel) error

func (*Client) SetContainerImage

func (client *Client) SetContainerImage(ns, depl string, image kubeModels.UpdateImage) error

func (*Client) SetReplicas

func (client *Client) SetReplicas(ns, depl string, n uint64) error

type GetPodLogsParams

type GetPodLogsParams = client.GetPodLogsParams

type KubeAPIclientSetup

type KubeAPIclientSetup func(model.Config) (*kubeClient.Client, error)

KubeAPIclientSetup -- creates new kube-client with provided config

Jump to

Keyboard shortcuts

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