api

package
v0.0.0-...-ada06ba Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotSupportedSecretType = errors.New("Not supported secret type")

ErrNotSupportedSecretType describe an error if the secret type is not supported

Functions

func AddClusterProfile

func AddClusterProfile(c *gin.Context)

AddClusterProfile handles /profiles/cluster/:type POST api endpoint. Saves ClusterProfileRequest data into the database. Saving failed if profile with the given name is already exists

func AddSecrets

func AddSecrets(c *gin.Context)

AddSecrets saves the given secret to vault

func AddUser

func AddUser(c *gin.Context)

AddUser adds a user to an organization, role=admin|member has to be in the body, otherwise member is the default role.

func CreateCluster

func CreateCluster(c *gin.Context)

CreateCluster creates a K8S cluster in the cloud

func CreateDeployment

func CreateDeployment(c *gin.Context)

CreateDeployment creates a Helm deployment

func CreateOrganization

func CreateOrganization(c *gin.Context)

CreateOrganization creates an organization for the calling user

func DeleteCluster

func DeleteCluster(c *gin.Context)

DeleteCluster deletes a K8S cluster from the cloud

func DeleteClusterProfile

func DeleteClusterProfile(c *gin.Context)

DeleteClusterProfile handles /cluster/profiles/:type/:name DELETE api endpoint. Deletes saved cluster profile. Deleting failed if the name is the default name.

func DeleteDeployment

func DeleteDeployment(c *gin.Context)

DeleteDeployment deletes a Helm deployment

func DeleteOrganization

func DeleteOrganization(c *gin.Context)

DeleteOrganization deletes an organizaion by id

func DeleteSecrets

func DeleteSecrets(c *gin.Context)

DeleteSecrets delete a secret with the given secret id

func FetchCluster

func FetchCluster(c *gin.Context)

FetchCluster fetch a K8S cluster in the cloud

func FetchClusters

func FetchClusters(c *gin.Context)

FetchClusters fetches all the K8S clusters from the cloud

func GetAllowedTypes

func GetAllowedTypes(secretType string) (interface{}, error)

GetAllowedTypes filters the allowed secret types if necessary

func GetApiEndpoint

func GetApiEndpoint(c *gin.Context)

GetApiEndpoint returns the Kubernetes Api endpoint

func GetCloudInfo

func GetCloudInfo(c *gin.Context)

GetCloudInfo sends back the supported locations/k8sVersions/machineTypes

func GetClusterConfig

func GetClusterConfig(c *gin.Context)

GetClusterConfig gets a cluster config

func GetClusterNodes

func GetClusterNodes(c *gin.Context)

GetClusterNodes Get node information

func GetClusterProfiles

func GetClusterProfiles(c *gin.Context)

GetClusterProfiles handles /profiles/cluster/:type GET api endpoint. Sends back the saved cluster profiles

func GetClusterStatus

func GetClusterStatus(c *gin.Context)

GetClusterStatus retrieves the cluster status

func GetCommonClusterFromRequest

func GetCommonClusterFromRequest(c *gin.Context) (cluster.CommonCluster, bool)

GetCommonClusterFromRequest just a simple getter to build commonCluster object this handles error messages directly

func GetCommonClusterNameFromRequest

func GetCommonClusterNameFromRequest(c *gin.Context) (string, bool)

GetCommonClusterNameFromRequest get cluster name from cluster request

func GetK8sConfig

func GetK8sConfig(c *gin.Context) ([]byte, bool)

GetK8sConfig returns the Kubernetes config

func GetOrganizations

func GetOrganizations(c *gin.Context)

GetOrganizations returns all organizations the user belongs to or a specific one from those by id

func GetSupportedClusterList

func GetSupportedClusterList(c *gin.Context)

GetSupportedClusterList sends back the supported cluster list

func GetSupportedFilters

func GetSupportedFilters(c *gin.Context)

GetSupportedFilters sends back the supported filter words

func GetTillerStatus

func GetTillerStatus(c *gin.Context)

GetTillerStatus checks if tiller ready to accept deployments

func GetUsers

func GetUsers(c *gin.Context)

GetUsers gets a user or lists all users from an organizaion depending on the presence of the id paramater

func HelmChart

func HelmChart(c *gin.Context)

HelmChart get helm chart details

func HelmCharts

func HelmCharts(c *gin.Context)

HelmCharts get available helm chart's list

func HelmDeploymentStatus

func HelmDeploymentStatus(c *gin.Context)

HelmDeploymentStatus checks the status of a deployment through the helm client API

func HelmReposAdd

func HelmReposAdd(c *gin.Context)

HelmReposAdd add a new helm repository

func HelmReposDelete

func HelmReposDelete(c *gin.Context)

HelmReposDelete delete the helm repository

func HelmReposGet

func HelmReposGet(c *gin.Context)

HelmReposGet listing helm repositories in the cluster

func HelmReposModify

func HelmReposModify(c *gin.Context)

HelmReposModify modify the helm repository

func HelmReposUpdate

func HelmReposUpdate(c *gin.Context)

HelmReposUpdate update the helm repo

func InitHelmOnCluster

func InitHelmOnCluster(c *gin.Context)

InitHelmOnCluster installs Helm on AKS cluster and configure the Helm client

func InstallSecretsToCluster

func InstallSecretsToCluster(c *gin.Context)

InstallSecretsToCluster add all secrets from a repo to a cluster's namespace

func IsValidSecretType

func IsValidSecretType(secretType string) error

IsValidSecretType checks the given secret type is supported

func ListAllowedSecretTypes

func ListAllowedSecretTypes(c *gin.Context)

ListAllowedSecretTypes returns the allowed secret types and the required keys

func ListDeployments

func ListDeployments(c *gin.Context)

ListDeployments lists a Helm deployment

func ListEndpoints

func ListEndpoints(c *gin.Context)

ListEndpoints lists service public endpoints

func ListSecrets

func ListSecrets(c *gin.Context)

ListSecrets returns the user all secrets, if the secret type is filled, then filtered if repo is set list the secrets for a given repo

func MetaHandler

func MetaHandler(router *gin.Engine, subpath string) gin.HandlerFunc

MetaHandler lists routes

func OrganizationMiddleware

func OrganizationMiddleware(c *gin.Context)

OrganizationMiddleware parses the organization id from the request, queries it from the database and saves it to the current context

func ParseField

func ParseField(c *gin.Context) map[string]interface{}

ParseField is to restrict other query TODO investigate to just pass the hasmap

func RedirectRoot

func RedirectRoot(c *gin.Context)

RedirectRoot sets redirect

func RemoveUser

func RemoveUser(c *gin.Context)

RemoveUser removes a user from an organization

func UpdateCluster

func UpdateCluster(c *gin.Context)

UpdateCluster updates a K8S cluster in the cloud (e.g. autoscale)

func UpdateClusterProfile

func UpdateClusterProfile(c *gin.Context)

UpdateClusterProfile handles /cluster/profiles/:type PUT api endpoint. Updates existing cluster profiles. Updating failed if the name is the default name.

func UpdateMonitoring

func UpdateMonitoring(c *gin.Context)

UpdateMonitoring updating prometheus

func UpgradeDeployment

func UpgradeDeployment(c *gin.Context)

UpgradeDeployment - Upgrades helm deployment, if --reuse-value is specified reuses the last release's value.

Types

type ChartQuery

type ChartQuery struct {
	Name    string `form:"name"`
	Repo    string `form:"repo"`
	Version string `form:"version"`
	Keyword string `form:"keyword"`
}

ChartQuery describes a query to get available helm chart's list

Jump to

Keyboard shortcuts

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