kubeapi

package
v0.0.0-...-3f85c9d Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2020 License: Apache-2.0, Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLabelToDeployment

func AddLabelToDeployment(clientset *kubernetes.Clientset, origDeployment *v1.Deployment, key, value, namespace string) error

func AddLabelToPod

func AddLabelToPod(clientset *kubernetes.Clientset, origPod *v1.Pod, key, value, namespace string) error

func CreateConfigMap

func CreateConfigMap(clientset *kubernetes.Clientset, configMap *v1.ConfigMap, namespace string) error

CreateConfigMap creates a ConfigMap

func CreateDeployment

func CreateDeployment(clientset *kubernetes.Clientset, deployment *v1.Deployment, namespace string) error

CreateDeployment creates a deployment

func CreateDeploymentV1

func CreateDeploymentV1(clientset *kubernetes.Clientset, deployment *v1.Deployment, namespace string) error

CreateDeployment creates a deployment

func CreateJob

func CreateJob(clientset *kubernetes.Clientset, job *v1batch.Job, namespace string) (string, error)

CreateJob deletes a backup job

func CreatePVC

func CreatePVC(clientset *kubernetes.Clientset, pvc *v1.PersistentVolumeClaim, namespace string) error

CreatePVC creates a PVC

func CreatePod

func CreatePod(clientset *kubernetes.Clientset, svc *v1.Pod, namespace string) (*v1.Pod, error)

CreatePod creates a Pod

func CreateSecret

func CreateSecret(clientset *kubernetes.Clientset, secret *v1.Secret, namespace string) error

CreateSecret

func CreateService

func CreateService(clientset *kubernetes.Clientset, svc *v1.Service, namespace string) (*v1.Service, error)

CreateService creates a Service

func Createpgbackup

func Createpgbackup(client *rest.RESTClient, backup *crv1.Pgbackup, namespace string) error

Createpgbackup creates a pgbackup

func Createpgcluster

func Createpgcluster(client *rest.RESTClient, cluster *crv1.Pgcluster, namespace string) error

Createpgcluster creates a pgcluster

func Createpgpolicy

func Createpgpolicy(client *rest.RESTClient, policy *crv1.Pgpolicy, namespace string) error

Createpgpolicy creates a pgpolicy

func Createpgreplica

func Createpgreplica(client *rest.RESTClient, replica *crv1.Pgreplica, namespace string) error

Createpgreplica creates a pgreplica

func Createpgtask

func Createpgtask(client *rest.RESTClient, task *crv1.Pgtask, namespace string) error

Createpgtask creates a pgtask

func DeleteAllpgbackup

func DeleteAllpgbackup(client *rest.RESTClient, namespace string) error

Deletepgbackups deletes all pgbackups

func DeleteConfigMap

func DeleteConfigMap(clientset *kubernetes.Clientset, name, namespace string) error

DeleteConfigMap deletes a ConfigMap by name

func DeleteDeployment

func DeleteDeployment(clientset *kubernetes.Clientset, name, namespace string) error

DeleteDeployment deletes a deployment

func DeleteJob

func DeleteJob(clientset *kubernetes.Clientset, jobName, namespace string) error

DeleteJob deletes a job

func DeleteJobs

func DeleteJobs(clientset *kubernetes.Clientset, selector, namespace string) error

DeleteJobs deletes all jobs that match a selector

func DeletePVC

func DeletePVC(clientset *kubernetes.Clientset, name, namespace string) error

DeletePVC deletes a PVC by name

func DeletePVCs

func DeletePVCs(clientset *kubernetes.Clientset, selector, namespace string) error

DeletePVCs deletes all PVCs by selector

func DeletePod

func DeletePod(clientset *kubernetes.Clientset, name, namespace string) error

DeletePod deletes a Pod

func DeleteSecret

func DeleteSecret(clientset *kubernetes.Clientset, name, namespace string) error

DeleteSecret

func DeleteService

func DeleteService(clientset *kubernetes.Clientset, name, namespace string) error

DeleteService deletes a Service

func Deletepgbackup

func Deletepgbackup(client *rest.RESTClient, name, namespace string) error

Deletepgbackup deletes pgbackup by name

func Deletepgcluster

func Deletepgcluster(client *rest.RESTClient, name, namespace string) error

Deletepgcluster deletes pgcluster by name

func Deletepgpolicy

func Deletepgpolicy(client *rest.RESTClient, name, namespace string) error

Deletepgpolicy deletes pgpolicy by name

func Deletepgreplica

func Deletepgreplica(client *rest.RESTClient, name, namespace string) error

Deletepgreplica deletes pgreplica by name

func Deletepgtask

func Deletepgtask(client *rest.RESTClient, name, namespace string) error

Deletepgtask deletes pgtask by name

func Deletepgtasks

func Deletepgtasks(client *rest.RESTClient, selector, namespace string) error

Deletepgtasks deletes pgtask by selector

func ExecToPodThroughAPI

func ExecToPodThroughAPI(config *rest.Config, clientset *kubernetes.Clientset, command []string, containerName, podName, namespace string, stdin io.Reader) (string, string, error)

ExecToPodThroughAPI uninterractively exec to the pod with the command specified. :param string command: list of the str which specify the command. :param string pod_name: Pod name :param string namespace: namespace of the Pod. :param io.Reader stdin: Standerd Input if necessary, otherwise `nil` :return: string: Output of the command. (STDOUT)

string: Errors. (STDERR)
 error: If any error has occurred otherwise `nil`

func GetAllNodes

func GetAllNodes(clientset *kubernetes.Clientset) (*v1.NodeList, error)

GetNodes gets a list of all Nodes

func GetAllStorageClasses

func GetAllStorageClasses(clientset *kubernetes.Clientset) (*v1.StorageClassList, error)

GetStorageClasses gets a list of StorageClasses

func GetConfigMap

func GetConfigMap(clientset *kubernetes.Clientset, name, namespace string) (*v1.ConfigMap, bool)

GetConfigMap gets a ConfigMap by name

func GetDeployment

func GetDeployment(clientset *kubernetes.Clientset, name, namespace string) (*v1.Deployment, bool, error)

GetDeployment gets a deployment by name

func GetDeployments

func GetDeployments(clientset *kubernetes.Clientset, selector, namespace string) (*v1.DeploymentList, error)

GetDeployments gets a list of deployments using a label selector

func GetJob

func GetJob(clientset *kubernetes.Clientset, name, namespace string) (*v1batch.Job, bool)

GetJob gets a Job by name

func GetJobs

func GetJobs(clientset *kubernetes.Clientset, selector, namespace string) (*v1batch.JobList, error)

GetJobs gets a list of jobs using a label selector

func GetLogs

func GetLogs(client *kubernetes.Clientset, logOpts v1.PodLogOptions, out io.Writer, podName, ns string) error

func GetNamespace

func GetNamespace(clientset *kubernetes.Clientset, name string) (*v1.Namespace, bool, error)

GetNamespace gets a Namespace by name

func GetNamespaces

func GetNamespaces(clientset *kubernetes.Clientset) (*v1.NamespaceList, error)

GetNamespaces gets a list of Namespaces

func GetNodes

func GetNodes(clientset *kubernetes.Clientset, selector, namespace string) (*v1.NodeList, error)

GetNodes gets a list of Nodes by selector

func GetPVC

func GetPVC(clientset *kubernetes.Clientset, name, namespace string) (*v1.PersistentVolumeClaim, bool, error)

GetPVC gets a PVC by name returns pvc, found=bool, error

func GetPVCs

func GetPVCs(clientset *kubernetes.Clientset, selector, namespace string) (*v1.PersistentVolumeClaimList, error)

GetPVCs gets a list of PVC by selector

func GetPod

func GetPod(clientset *kubernetes.Clientset, name, namespace string) (*v1.Pod, bool, error)

GetPod gets a Pod by name

func GetPods

func GetPods(clientset *kubernetes.Clientset, selector, namespace string) (*v1.PodList, error)

GetPods gets a list of Pods by selector

func GetPodsWithBothSelectors

func GetPodsWithBothSelectors(clientset *kubernetes.Clientset, selector, fieldselector, namespace string) (*v1.PodList, error)

GetPodsWithBothSelectors gets a list of Pods by selector and field selector

func GetSecret

func GetSecret(clientset *kubernetes.Clientset, name, namespace string) (*v1.Secret, bool, error)

GetSecret gets a Secrets by name

func GetSecrets

func GetSecrets(clientset *kubernetes.Clientset, selector, namespace string) (*v1.SecretList, error)

GetSecrets gets a list of Secrets by selector

func GetService

func GetService(clientset *kubernetes.Clientset, name, namespace string) (*v1.Service, bool, error)

GetService gets a Service by name

func GetServices

func GetServices(clientset *kubernetes.Clientset, selector, namespace string) (*v1.ServiceList, error)

GetServices gets a list of Services by selector

func GetStorageClass

func GetStorageClass(clientset *kubernetes.Clientset, name string) (*v1.StorageClass, bool)

GetStorageClass gets a single StorageClasse

func GetStorageClasses

func GetStorageClasses(clientset *kubernetes.Clientset, selector string) (*v1.StorageClassList, error)

GetStorageClasses gets a list of StorageClasses using a selector

func Getpgbackup

func Getpgbackup(client *rest.RESTClient, backup *crv1.Pgbackup, name, namespace string) (bool, error)

Getpgbackup gets a pgbackups by name

func Getpgbackups

func Getpgbackups(client *rest.RESTClient, backupList *crv1.PgbackupList, namespace string) error

Getpgbackups gets a list of pgbackups

func Getpgcluster

func Getpgcluster(client *rest.RESTClient, cluster *crv1.Pgcluster, name, namespace string) (bool, error)

Getpgcluster gets a pgcluster by name

func Getpgclusters

func Getpgclusters(client *rest.RESTClient, clusterList *crv1.PgclusterList, namespace string) error

Getpgclusters gets a list of pgclusters

func GetpgclustersBySelector

func GetpgclustersBySelector(client *rest.RESTClient, clusterList *crv1.PgclusterList, selector, namespace string) error

GetpgclustersBySelector gets a list of pgclusters by selector

func Getpgpolicies

func Getpgpolicies(client *rest.RESTClient, policyList *crv1.PgpolicyList, namespace string) error

Getpgpolicies gets a list of pgpolicies

func Getpgpolicy

func Getpgpolicy(client *rest.RESTClient, policy *crv1.Pgpolicy, name, namespace string) (bool, error)

Getpgpolicy gets a pgpolicies by name

func Getpgreplica

func Getpgreplica(client *rest.RESTClient, replica *crv1.Pgreplica, name, namespace string) (bool, error)

Getpgreplica gets a pgreplica by name

func Getpgreplicas

func Getpgreplicas(client *rest.RESTClient, replicaList *crv1.PgreplicaList, namespace string) error

Getpgreplicas gets a list of pgreplicas

func GetpgreplicasBySelector

func GetpgreplicasBySelector(client *rest.RESTClient, replicaList *crv1.PgreplicaList, selector, namespace string) error

GetpgreplicasBySelector gets a list of pgreplicas by selector

func Getpgtask

func Getpgtask(client *rest.RESTClient, task *crv1.Pgtask, name, namespace string) (bool, error)

Getpgtask gets a pgtask by name

func Getpgtasks

func Getpgtasks(client *rest.RESTClient, taskList *crv1.PgtaskList, namespace string) error

Getpgtasks gets a list of pgtasks

func GetpgtasksBySelector

func GetpgtasksBySelector(client *rest.RESTClient, taskList *crv1.PgtaskList, selector, namespace string) error

GetpgtasksBySelector gets a list of pgtasks by selector

func IsJobComplete

func IsJobComplete(client *kubernetes.Clientset, namespace string, job *v1batch.Job, timeout time.Duration) error

func IsJobDeleted

func IsJobDeleted(client *kubernetes.Clientset, namespace string, job *v1batch.Job, timeout time.Duration) error

func ListConfigMap

func ListConfigMap(clientset *kubernetes.Clientset, label, namespace string) (*v1.ConfigMapList, bool)

ListConfigMap lists ConfigMaps with a given selector

func MergePatchDeployment

func MergePatchDeployment(clientset *kubernetes.Clientset, origDeployment *v1.Deployment, newname, namespace string) error

MergePatchDeployment patches a deployment for failover only at this point

func PatchDeployment

func PatchDeployment(clientset *kubernetes.Clientset, name, namespace, jsonpath, patchvalue string) error

PatchDeployment patches a deployment

func PatchReplicas

func PatchReplicas(clientset *kubernetes.Clientset, name, namespace, jsonpath string, patchvalue int) error

PatchDeployment patches a deployment

func UpdateDeployment

func UpdateDeployment(clientset *kubernetes.Clientset, deployment *v1.Deployment, namespace string) error

func UpdatePod

func UpdatePod(clientset *kubernetes.Clientset, pod *v1.Pod, namespace string) error

func UpdateService

func UpdateService(clientset *kubernetes.Clientset, svc *v1.Service, namespace string) error

func Updatepgbackup

func Updatepgbackup(client *rest.RESTClient, backup *crv1.Pgbackup, name, namespace string) error

func Updatepgcluster

func Updatepgcluster(client *rest.RESTClient, cluster *crv1.Pgcluster, name, namespace string) error

Updatepgcluster updates a pgcluster

func Updatepgreplica

func Updatepgreplica(client *rest.RESTClient, replica *crv1.Pgreplica, name, namespace string) error

Updatepgreplica updates a pgreplica

func Updatepgtask

func Updatepgtask(client *rest.RESTClient, task *crv1.Pgtask, name, namespace string) error

Updatepgtask updates a pgtask

Types

type IntThingSpec

type IntThingSpec struct {
	Op    string `json:"op"`
	Path  string `json:"path"`
	Value int    `json:"value"`
}

type ThingSpec

type ThingSpec struct {
	Op    string `json:"op"`
	Path  string `json:"path"`
	Value string `json:"value"`
}

Jump to

Keyboard shortcuts

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