client

package
v0.26.4 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2018 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Config
}

Client - rest client

func NewClient

func NewClient(config Config) (*Client, error)

NewClient -

func (*Client) AddIngress

func (client *Client) AddIngress(project, namespace string, ingress model.Ingress) error

AddIngress -- adds ingress to provided namespace

func (*Client) ChangePassword

func (client *Client) ChangePassword(currentPassword, newPassword string) (model.Tokens, error)

ChangePassword -- changes user password, returns access and refresh tokens

func (*Client) CheckToken

func (client *Client) CheckToken(token string) (model.CheckTokenResponse, error)

CheckToken -- consumes JWT token, user fingerprint If they're correct returns user access data: list of namespaces and list of volumes OR uninitialized structure AND error

func (*Client) CreateConfigMap added in v0.11.5

func (client *Client) CreateConfigMap(project, namespace, name string, data model.ConfigMapData) error

CreateConfigMap -- creates a ConfigMap in provided namespace.

func (*Client) CreateDeployment

func (client *Client) CreateDeployment(project, namespace string, deployment model.Deployment) error

CreateDeployment -- consumes a namespace, an user ID and a Role, returns nil if OK

func (*Client) CreateService

func (client *Client) CreateService(project, namespace string, service model.Service) (model.Service, error)

CreateService -- consumes a namespace name and a Service data, returns the created Service AND nil OR an uninitialized Service AND an error

func (*Client) DeleteConfigMap added in v0.11.5

func (client *Client) DeleteConfigMap(project, namespace, name string) error

DeleteConfigMap -- deletes ConfigMap by name in provided namespace

func (*Client) DeleteDeployment

func (client *Client) DeleteDeployment(project, namespace, deployment string) error

DeleteDeployment -- consumes a namespace, a deployment, an user role and an ID

func (*Client) DeleteDeploymentVersion added in v0.23.10

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

func (*Client) DeleteIngress

func (client *Client) DeleteIngress(project, namespace, domain string) error

DeleteIngress -- deletes ingress on provided domain

func (*Client) DeleteNamespace

func (client *Client) DeleteNamespace(project, namespace string) error

DeleteNamespace -- deletes provided namespace

func (*Client) DeleteNamespaceAccess

func (client *Client) DeleteNamespaceAccess(project, namespace, username string) error

DeleteNamespaceAccess -- deletes user access to namespace

func (*Client) DeletePod

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

DeletePod -- deletes pod in provided namespace

func (*Client) DeleteService

func (client *Client) DeleteService(project, namespace, serviceName string) error

DeleteService -- consumes a namespace, a servicce name, returns error in case of problem

func (*Client) DeleteSolution added in v0.22.0

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

GetSolution -- returns user running solutions

func (*Client) DeleteVolume

func (client *Client) DeleteVolume(project, namespace, volumeName string) error

DeleteVolume -- deletes Volume with provided volume name

func (*Client) ExtendToken

func (client *Client) ExtendToken(refreshToken string) (model.Tokens, error)

ExtendToken -- consumes refresh JWT token and user fingerprint If they're correct returns new extended access and refresh token OR void tokens AND error. Old access and refresh token become inactive.

func (*Client) GetConfigMap added in v0.11.5

func (client *Client) GetConfigMap(project, namespace, name string) (ret model.ConfigMap, err error)

GetConfigMap -- retrieves ConfigMap by name from provided namespace.

func (*Client) GetConfigMapList added in v0.11.5

func (client *Client) GetConfigMapList(project, namespace string) (ret []model.ConfigMap, err error)

GetConfigMapList -- returns all ConfigMap`s in namespace.

func (*Client) GetDeloymentVersionBetweenVersions added in v0.23.8

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

func (*Client) GetDeployment

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

GetDeployment -- consumes a namespace and a deployment names, returns a Deployment data OR uninitialized struct AND an error

func (*Client) GetDeploymentDiffWithPreviousVersion added in v0.23.8

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

func (*Client) GetDeploymentList

func (client *Client) GetDeploymentList(project, namespace string) (model.DeploymentsList, error)

GetDeploymentList -- consumes a namespace and a deployment names, returns a list of Deployments OR nil slice AND an error

func (*Client) GetDeploymentVersions added in v0.20.2

func (client *Client) GetDeploymentVersions(project, namespace, deplName string) (model.DeploymentsList, error)

Returns list of defferent deployment versions

func (*Client) GetIngress

func (client *Client) GetIngress(project, namespace, domain string) (model.Ingress, error)

GetIngressList -- returns ingress with specified domain.

func (*Client) GetIngressList

func (client *Client) GetIngressList(project, namespace string) (model.IngressesList, error)

GetIngressList -- returns list of ingresses.

func (*Client) GetNamespace

func (client *Client) GetNamespace(project, ns string) (model.Namespace, error)

GetNamespace return namespace by ID

func (*Client) GetNamespaceAccesses added in v0.14.1

func (client *Client) GetNamespaceAccesses(project, namespace string) ([]model.UserAccess, error)

func (*Client) GetNamespaceList

func (client *Client) GetNamespaceList(project string) (model.NamespacesList, error)

GetNamespaceList return namespace list. Can use query filters: owner

func (*Client) GetPod

func (client *Client) GetPod(project, namespace, pod string) (model.Pod, error)

GetPod -- gets a particular pod by name.

func (*Client) GetPodList

func (client *Client) GetPodList(project, namespace string) (model.PodsList, error)

GetPodList -- returns list of pods in provided namespace

func (*Client) GetPodLogs

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

func (*Client) GetProfileInfo

func (client *Client) GetProfileInfo() (model.User, error)

GetProfileInfo -- returns user info

func (*Client) GetService

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

GetService -- consume a namespace id and a service name returns a Service OR an uninitialized Service struct AND an error

func (*Client) GetServiceList

func (client *Client) GetServiceList(project, namespace string) (model.ServicesList, error)

GetServiceList -- consumes a namespace name returns a slice of Services OR a nil slice AND an error

func (*Client) GetSolution added in v0.22.0

func (client *Client) GetSolution(project, namespace, solutionName string) (model.UserSolution, error)

GetSolution -- returns user running solutions

func (*Client) GetSolutionDeployments added in v0.22.0

func (client *Client) GetSolutionDeployments(project, namespace, solutionName string) (model.DeploymentsList, error)

GetSolutionDeployments -- returns user solution deployments

func (*Client) GetSolutionServices added in v0.22.0

func (client *Client) GetSolutionServices(project, namespace, solutionName string) (model.ServicesList, error)

GetSolutionServices -- returns user solution deployments

func (*Client) GetSolutionsNamespaceList added in v0.23.2

func (client *Client) GetSolutionsNamespaceList(project, namespace string) (model.UserSolutionsList, error)

GetSolutionsList -- returns list of users running solutions in namespace

func (*Client) GetSolutionsTemplateEnv added in v0.22.0

func (client *Client) GetSolutionsTemplateEnv(templateName, branch string) (model.SolutionEnv, error)

GetSolutionsTemplateEnv -- returns list of public solution template envs

func (*Client) GetSolutionsTemplateResources added in v0.22.0

func (client *Client) GetSolutionsTemplateResources(templateName string) (model.SolutionResources, error)

GetSolutionsTemplateResources -- returns count of public solution template resources

func (*Client) GetSolutionsTemplatesList added in v0.22.0

func (client *Client) GetSolutionsTemplatesList() (model.AvailableSolutionsList, error)

GetSolutionsTemplatesList -- returns list of public solutions templates

func (*Client) GetVolume

func (client *Client) GetVolume(project, namespace, volumeName string) (model.Volume, error)

GetVolume -- return User Volume by name, consumes optional userID param

func (*Client) GetVolumeList

func (client *Client) GetVolumeList(project, namespace string) (model.VolumesList, error)

GetVolumeList -- get list of volumes, consumes optional user ID and filter parameters. Returns new_access_level as access if user role = user.

func (*Client) Login

func (client *Client) Login(login model.Login) (model.Tokens, error)

Login -- sign in with username and password

func (*Client) RenameNamespace

func (client *Client) RenameNamespace(project, namespace, newName string) error

RenameNamespace -- renames user namespace Consumes namespace name and new name.

func (*Client) ReplaceDeployment

func (client *Client) ReplaceDeployment(project, namespace string, deployment model.Deployment) error

ReplaceDeployment -- replaces deployment in provided namespace with new one

func (*Client) ResourceGetNamespace

func (client *Client) ResourceGetNamespace(project, namespace string) (model.Namespace, error)

ResourceGetNamespace -- consumes a namespace returns a namespace data OR an error

func (*Client) ResourceGetNamespaceList

func (client *Client) ResourceGetNamespaceList(project string, page, perPage uint64) (model.NamespacesList, error)

ResourceGetNamespaceList -- consumes a page number parameter, amount of namespaces per page and optional userID, returns a slice of Namespaces OR a nil slice AND an error

func (*Client) RunDeploymentVersion added in v0.20.2

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

Create pods from deployment with specific version

func (*Client) RunSolution added in v0.11.3

func (client *Client) RunSolution(solution model.UserSolution, project, namespace, branch string) (model.RunSolutionResponse, error)

RunSolution -- creates new solution

func (*Client) SetContainerImage

func (client *Client) SetContainerImage(project, namespace, deployment string, updateImage model.UpdateImage) error

SetContainerImage -- set or changes deployment container image Consumes namespace, deployment and container data

func (*Client) SetFingerprint

func (client *Client) SetFingerprint(fingerprint string)

SetFingerprint -- sets fingerprint

func (*Client) SetNamespaceAccess

func (client *Client) SetNamespaceAccess(project, namespace, username string, access model.UserGroupAccess) error

SetNamespaceAccess -- sets/changes access to namespace for provided user

func (*Client) SetReplicas

func (client *Client) SetReplicas(project, namespace, deployment string, replicas int) error

SetReplicas -- sets or changes deployment replicas

func (*Client) SetToken

func (client *Client) SetToken(token string)

SetToken -- sets access token

func (*Client) UpdateConfigMap added in v0.11.5

func (client *Client) UpdateConfigMap(project, namespace, name string, data model.ConfigMapData) error

UpdateConfigMap -- rewrites ConfigMap by name in provided namespace.

func (*Client) UpdateIngress

func (client *Client) UpdateIngress(project, namespace, domain string, ingress model.Ingress) error

UpdateIngress -- updates ingress on provided domain with new one

func (*Client) UpdateService

func (client *Client) UpdateService(project, namespace string, service model.Service) (model.Service, error)

UpdateService -- consumes a namespace, a service data, returns an ipdated Service OR an uninitialized Service AND an error

type Config

type Config struct {
	User     User
	RestAPI  rest.REST
	WSDialer *gorilla.Dialer
}

Config -- provides configuration for Client If APIurl or ResourceAddr is void, trys to get them from envvars

type GetPodLogsParams

type GetPodLogsParams struct {
	Namespace, Pod, Container string
	Previous, Follow          bool
	Tail                      int
}

type User

type User struct {
	Role string
}

User -

Jump to

Keyboard shortcuts

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