Documentation ¶
Overview ¶
The clusters controller package provides controller functions for the /cluster and /clusters endpoints in the api V1.
Index ¶
- func ClusterByFilter() gin.HandlerFunc
- func ClusterExistsById() gin.HandlerFunc
- func ClusterGetById() gin.HandlerFunc
- func ClusterGetByWorkspace() gin.HandlerFunc
- func ComplianceReports() gin.HandlerFunc
- func ComplianceReportsGlobal() gin.HandlerFunc
- func CreateCluster() gin.HandlerFunc
- func DummyView() gin.HandlerFunc
- func GetControlPlanesMetadata() gin.HandlerFunc
- func GetKubeconfig() gin.HandlerFunc
- func GetMetadata() gin.HandlerFunc
- func GetSelf() gin.HandlerFunc
- func GlobalVulnerabilityReportsViewById() gin.HandlerFunc
- func PolicyreportSummaryView() gin.HandlerFunc
- func PolicyreportsView() gin.HandlerFunc
- func RegisterHeartbeat() gin.HandlerFunc
- func UpdateMetadata() gin.HandlerFunc
- func VulnerabilityReportsGlobal() gin.HandlerFunc
- func VulnerabilityReportsView() gin.HandlerFunc
- func VulnerabilityReportsViewById() gin.HandlerFunc
- func VulnerabilityreportSummaryView() gin.HandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClusterByFilter ¶
func ClusterByFilter() gin.HandlerFunc
Get a []apicontracts.Cluster by a apicontracts.Filter object provided in the body. Will only provide clusters the identity is authorized to view
@Summary Get clusters by filter @Schemes @Description Get clusters by filter @Tags clusters @Accept application/json @Produce application/json @Success 200 {object} apicontracts.PaginatedResult[apicontracts.Cluster] @Failure 403 {object} rorerror.RorError @Failure 401 {object} rorerror.RorError @Failure 500 {object} rorerror.RorError @Router /v1/clusters/filter [post] @Param filter body apicontracts.Filter true "Filter" @Security ApiKey || AccessToken
func ClusterExistsById ¶
func ClusterExistsById() gin.HandlerFunc
Check if clusterid exists. Identity must be authenticated
@Summary ClusterId exists @Schemes @Description Check if clusterId exists @Tags clusters @Accept application/json @Produce application/json @Param id path string true "id" @Success 200 {bool} bool @Failure 403 {string} Forbidden @Failure 401 {string} Unauthorized @Failure 500 {string} Failure message @Router /v1/cluster/{clusterid}/exists [get] @Router /v1/clusters/{clusterid}/exists [get] @Security ApiKey || AccessToken
func ClusterGetById ¶
func ClusterGetById() gin.HandlerFunc
Get a apicontracts.Cluster by its clusterid. Identity must be authorized to view the requested cluster
@Summary Get a cluster @Schemes @Description Get a cluster by id @Tags clusters @Accept application/json @Produce application/json @Param id path string true "id" @Success 200 {object} apicontracts.Cluster @Failure 403 {string} Forbidden @Failure 401 {string} Unauthorized @Failure 500 {string} Failure message @Router /v1/cluster/{clusterid} [get] @Router /v1/clusters/{clusterid} [get] @Security ApiKey || AccessToken
func ClusterGetByWorkspace ¶
func ClusterGetByWorkspace() gin.HandlerFunc
Get a []apicontracts.Cluster by a workspaceName . Will only provide clusters the identity is authorized to view
@Summary Get clusters by workspace @Schemes @Description Get clusters by workspace @Tags clusters @Accept application/json @Produce application/json @Success 200 {array} apicontracts.Cluster @Failure 403 {string} Forbidden @Failure 401 {string} Unauthorized @Failure 500 {string} Failure message @Router /v1/clusters/workspace/{workspaceName}/filter [get] @Param filter body apicontracts.Filter true "Filter" @Param workspaceName path string true "workspaceName" @Security ApiKey || AccessToken
func ComplianceReports ¶
func ComplianceReports() gin.HandlerFunc
View for compliance reports
@Summary Compliance reports view @Schemes @Description A structured presentation of compliance reports @Tags clusters @Accept application/json @Produce application/json @Param clusterid path string true "clusterid" @Success 200 {array} viewsmodels.ComplianceReport @Failure 403 {string} Forbidden @Failure 401 {string} Unauthorized @Failure 500 {string} Failure message @Router /v1/clusters/:clusterid/views/compliancereports [get] @Security ApiKey || AccessToken
func ComplianceReportsGlobal ¶
func ComplianceReportsGlobal() gin.HandlerFunc
ComplianceReportsGlobal godoc
@Summary Get compliance reports summary per cluster @Schemes @Description Shows a summary of trivy compliance reports per cluster categorized by amount failed or passed. @Tags clusters @Accept application/json @Produce application/json @Success 200 {object} []viewsmodels.ComplianceReport @Failure 403 {string} Forbidden @Failure 401 {string} Unauthorized @Failure 500 {string} Failure message @Router /v1/clusters/views/compliancereports [get] @Security ApiKey || AccessToken
func CreateCluster ¶
func CreateCluster() gin.HandlerFunc
Create a cluster
@Summary Create a cluster @Schemes @Description Create a cluster @Tags clusters @Accept application/json @Produce application/json @Param credentials body apicontracts.Cluster true "Credentials" @Success 200 {string} ClusterId @Failure 403 {string} Forbidden @Failure 401 {string} Unauthorized @Failure 500 {string} Failure message @Router /v1/clusters [post] @Security ApiKey || AccessToken
func DummyView ¶
func DummyView() gin.HandlerFunc
Placeholder for views not yet implemented
@Summary This is a dummy view @Schemes @Description Just a dummy view @Tags clusters @Accept application/json @Produce application/json @Param id path string true "id" @Success 200 {string} This is not the view you are looking for @Failure 403 {string} Forbidden @Failure 401 {string} Unauthorized @Failure 500 {string} Failure message @Router /v1/clusters/{clusterid}/views/ingresses [get] @Router /v1/clusters/{clusterid}/views/nodes [get] @Router /v1/clusters/{clusterid}/views/applications [get] @Router /v1/clusters/views/errorlist [get] @Router /v1/clusters/views/clusterlist [get] @Security ApiKey || AccessToken
func GetControlPlanesMetadata ¶
func GetControlPlanesMetadata() gin.HandlerFunc
Get a list of control planes metadata for clusters.
@Summary get control planes metadata @Schemes @Description Get cluster control planes metadata @Tags clusters @Accept application/json @Produce application/json @Success 200 {array} apicontracts.ClusterControlPlaneMetadata @Failure 403 {string} Forbidden @Failure 401 {string} Unauthorized @Failure 500 {string} Failure message @Router /v1/clusters/controlPlanesMetadata [get] @Security ApiKey || AccessToken
func GetKubeconfig ¶
func GetKubeconfig() gin.HandlerFunc
Get a kubeconfig by clusterid. Identity must be authorized to view the requested cluster
@Summary Get kubeconfig for clusterId @Schemes @Description Get a kubeconfig by clusterId @Tags clusters @Accept application/json @Produce application/json @Param id path string true "id" @Param credentials body apicontracts.KubeconfigCredentials true "Credentials" @Success 200 {object} apicontracts.ClusterKubeconfig @Failure 403 {string} Forbidden @Failure 401 {string} Unauthorized @Failure 500 {string} Failure message @Router /v1/clusters/{clusterid}/login [post] @Security ApiKey || AccessToken
func GetMetadata ¶
func GetMetadata() gin.HandlerFunc
Get a list of metadata for clusters. TODO Verify: Will only provide clusters the identity is authorized to view TODO: Update swagger TODO: Check if this is used
@Summary get metadata @Schemes @Description Get cluster metadata @Tags clusters @Accept application/json @Produce application/json @Param id path string true "id" @Success 200 {bool} bool @Failure 403 {string} Forbidden @Failure 401 {string} Unauthorized @Failure 500 {string} Failure message @Router /v1/clusters/{clusterid}/metadata [get] @Security ApiKey || AccessToken
func GetSelf ¶
func GetSelf() gin.HandlerFunc
@Success 200 {string} Get data for the cluster @Failure 403 {string} Forbidden @Failure 401 {string} Unauthorized @Failure 500 {string} Failure message @Router /v1/clusters/self [get] @Security ApiKey || AccessToken
func GlobalVulnerabilityReportsViewById ¶
func GlobalVulnerabilityReportsViewById() gin.HandlerFunc
View for vulnerability reports by CVE ID
@Summary Vulnerability reports view by CVE ID @Schemes @Description A structured presentation of vulnerability reports by CVE ID @Accept application/json @Produce application/json @Query cveid {string} @Success 200 {string} This is not the view you are looking for @Failure 403 {string} Forbidden @Failure 401 {string} Unauthorized @Failure 500 {string} Failure message @Router /v1/clusters/views/vulnerabilityreports/byid [get] @Security ApiKey || AccessToken
func PolicyreportSummaryView ¶
func PolicyreportSummaryView() gin.HandlerFunc
View for policy reports
@Summary Policy report view @Schemes @Description A structured presentation of policyreports @Tags clusters @Accept application/json @Produce application/json @Param type query viewsmodels.PolicyreportGlobalQueryType true "type" @Success 200 {string} This is not the view you are looking for @Failure 403 {string} Forbidden @Failure 401 {string} Unauthorized @Failure 500 {string} Failure message @Router /v1/clusters/{clusterid}/views/policyreports [get] @Security ApiKey || AccessToken
func PolicyreportsView ¶
func PolicyreportsView() gin.HandlerFunc
View for policy reports
@Summary Policy report view @Schemes @Description A structured presentation of policyreports @Tags clusters @Accept application/json @Produce application/json @Param id path string true "id" @Success 200 {string} This is not the view you are looking for @Failure 403 {string} Forbidden @Failure 401 {string} Unauthorized @Failure 500 {string} Failure message @Router /v1/clusters/{clusterid}/views/policyreports [get] @Security ApiKey || AccessToken
func RegisterHeartbeat ¶
func RegisterHeartbeat() gin.HandlerFunc
Register a cluster hearbeat report, the hearbeat is in the payload. Parameter clusterid must match authorized clusterid
@Summary Register cluster heartbeat @Schemes @Description Registers a cluster heartbeat report @Tags clusters @Accept application/json @Produce application/json @Success 200 {bool} bool @Failure 403 {string} Forbidden @Failure 401 {string} Unauthorized @Failure 500 {string} Failure message @Router /v1/cluster/heartbeat [post] @Router /v1/clusters/heartbeat [post] @Param heartbeat body apicontracts.Cluster true "Heartbeat" @Security ApiKey || AccessToken
func UpdateMetadata ¶
func UpdateMetadata() gin.HandlerFunc
Update metadata for a cluster. Will only provide clusters the identity is authorized to view
@Summary Update metadata @Schemes @Description Update cluster metadata @Tags clusters @Accept application/json @Produce application/json @Param id path string true "id" @Success 200 {bool} bool @Failure 403 {string} Forbidden @Failure 401 {string} Unauthorized @Failure 500 {string} Failure message @Router /v1/cluster/{clusterid}/metadata [patch] @Router /v1/clusters/{clusterid}/metadata [patch] @Security ApiKey || AccessToken
func VulnerabilityReportsGlobal ¶
func VulnerabilityReportsGlobal() gin.HandlerFunc
VulnerabilityReportsGlobal godoc
@Summary Get vulnerability reports summary per cluster @Schemes @Description Shows a summary of trivy vulnerability reports per cluster categorized by amount of critical/high/medium/low vulnerabilities. @Tags clusters @Accept application/json @Produce application/json @Success 200 {object} []viewsmodels.VulnerabilityReportsView @Failure 403 {string} Forbidden @Failure 401 {string} Unauthorized @Failure 500 {string} Failure message @Router /v1/clusters/views/vulnerabilityreports [get] @Security ApiKey || AccessToken
func VulnerabilityReportsView ¶
func VulnerabilityReportsView() gin.HandlerFunc
View for vulnerability reports
@Summary Vulnerability reports view @Schemes @Description A structured presentation of vulnerability reports @Tags clusters @Accept application/json @Produce application/json @Param id path string true "id" @Success 200 {string} This is not the view you are looking for @Failure 403 {string} Forbidden @Failure 401 {string} Unauthorized @Failure 500 {string} Failure message @Router /v1/clusters/{clusterid}/views/vulnerabilityreports [get] @Security ApiKey || AccessToken
func VulnerabilityReportsViewById ¶
func VulnerabilityReportsViewById() gin.HandlerFunc
View for vulnerability reports
@Summary Vulnerability reports view @Schemes @Description A structured presentation of vulnerability reports @Tags clusters @Accept application/json @Produce application/json @Param cveid path string true "cveid" @Success 200 {string} This is not the view you are looking for @Failure 403 {string} Forbidden @Failure 401 {string} Unauthorized @Failure 500 {string} Failure message @Router /v1/clusters/views/vulnerabilityreports/byid/:cveid [get] @Security ApiKey || AccessToken
func VulnerabilityreportSummaryView ¶
func VulnerabilityreportSummaryView() gin.HandlerFunc
View for policy reports
@Summary Policy report view @Schemes @Description A structured presentation of policyreports @Tags clusters @Accept application/json @Produce application/json @Param type query viewsmodels.PolicyreportGlobalQueryType true "type" @Success 200 {string} This is not the view you are looking for @Failure 403 {string} Forbidden @Failure 401 {string} Unauthorized @Failure 500 {string} Failure message @Router /v1/clusters/{clusterid}/views/policyreports [get] @Security ApiKey || AccessToken
Types ¶
This section is empty.