bean

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NOCHARTEXIST string = "NOCHARTEXIST"
)
View Source
const SUPERADMIN = "role:super-admin___"

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiError

type ApiError struct {
	Code              string      `json:"code,omitempty"`
	InternalMessage   string      `json:"internalMessage,omitempty"`
	UserMessage       interface{} `json:"userMessage,omitempty"`
	UserDetailMessage string      `json:"userDetailMessage,omitempty"`
}

type AppContainer

type AppContainer struct {
	AppId                   int                        `json:"appId"`
	AppName                 string                     `json:"appName"`
	AppEnvironmentContainer []*AppEnvironmentContainer `json:"environments"`
	DefaultEnv              AppEnvironmentContainer    `json:"-"`
}

type AppContainerResponse

type AppContainerResponse struct {
	AppContainers      []*AppContainer    `json:"appContainers"`
	AppCount           int                `json:"appCount"`
	DeploymentGroupDTO DeploymentGroupDTO `json:"deploymentGroup,omitempty"`
}

type AppDetailContainer

type AppDetailContainer struct {
	DeploymentDetailContainer `json:",inline"`
	InstanceDetail            []InstanceDetail                  `json:"instanceDetail"` //pod list with cpu, memory usage percent
	Environments              []Environment                     `json:"otherEnvironment,omitempty"`
	LinkOuts                  []LinkOuts                        `json:"linkOuts,omitempty"`
	ResourceTree              *application.ResourceTreeResponse `json:"resourceTree,omitempty"`
}

type AppEnvironmentContainer

type AppEnvironmentContainer struct {
	AppId                       int                       `json:"appId"`
	AppName                     string                    `json:"appName"`
	EnvironmentId               int                       `json:"environmentId"`
	EnvironmentName             string                    `json:"environmentName"`
	DeploymentCounter           int                       `json:"deploymentCounter,omitempty"`
	InstanceCounter             int                       `json:"instanceCounter,omitempty"`
	Status                      string                    `json:"status"`
	CdStageStatus               *string                   `json:"cdStageStatus"`
	PreStageStatus              *string                   `json:"preStageStatus"`
	PostStageStatus             *string                   `json:"postStageStatus"`
	LastDeployedTime            string                    `json:"lastDeployedTime,omitempty"`
	LastSuccessDeploymentDetail DeploymentDetailContainer `json:"-"`
	Default                     bool                      `json:"default,omitempty"`
	Deleted                     bool                      `json:"deleted"`
	MaterialInfo                json.RawMessage           `json:"materialInfo,omitempty"`
	DataSource                  string                    `json:"dataSource,omitempty"`
	MaterialInfoJson            string                    `json:"-"`
	PipelineId                  int                       `json:"-"`
	PipelineReleaseCounter      int                       `json:"-"`
	CiArtifactId                int                       `json:"ciArtifactId"`
}

type AppStageStatus

type AppStageStatus struct {
	Stage     int    `json:"stage"`
	StageName string `json:"stageName,omitempty"`
	Status    bool   `json:"status"`
	Required  bool   `json:"required"`
}

type CdWorkflowType

type CdWorkflowType string
const CD_WORKFLOW_TYPE_DEPLOY CdWorkflowType = "DEPLOY"
const CD_WORKFLOW_TYPE_POST CdWorkflowType = "POST"
const CD_WORKFLOW_TYPE_PRE CdWorkflowType = "PRE"

type CiMaterialDTO

type CiMaterialDTO struct {
	Name        string `json:"name"`
	SourceType  string `json:"type"`
	SourceValue string `json:"value"`
}

type ConfigMapAndSecretJson

type ConfigMapAndSecretJson struct {
	ConfigMapJson    ConfigMapJson    `json:"configMapJson"`
	ConfigSecretJson ConfigSecretJson `json:"configSecretJson"`
}

type ConfigMapJson

type ConfigMapJson struct {
	Enabled bool  `json:"enabled"`
	Maps    []Map `json:"maps"`
}

type ConfigMapRootJson

type ConfigMapRootJson struct {
	ConfigMapJson ConfigMapJson `json:"ConfigMaps"`
}

type ConfigSecretJson

type ConfigSecretJson struct {
	Enabled bool   `json:"enabled"`
	Secrets []*Map `json:"secrets"`
}

type ConfigSecretRootJson

type ConfigSecretRootJson struct {
	ConfigSecretJson ConfigSecretJson `json:"ConfigSecrets"`
}

type CreateVulnerabilityPolicyRequest

type CreateVulnerabilityPolicyRequest struct {
	// actions which can be taken on vulnerabilities
	Action    *VulnerabilityAction `json:"action,omitempty"`
	AppId     int                  `json:"appId,omitempty"`
	ClusterId int                  `json:"clusterId,omitempty"`
	CveId     string               `json:"cveId,omitempty"`
	EnvId     int                  `json:"envId,omitempty"`
	Severity  string               `json:"severity,omitempty"`
}

CreateVulnerabilityPolicyRequest defines model for CreateVulnerabilityPolicyRequest.

type CreateVulnerabilityPolicyResponse

type CreateVulnerabilityPolicyResponse struct {
	// Error object
	Error  *Error                       `json:"error,omitempty"`
	Result *IdVulnerabilityPolicyResult `json:"result,omitempty"`
}

CreateVulnerabilityPolicyResponse defines model for CreateVulnerabilityPolicyResponse.

type CvePolicy

type CvePolicy struct {
	// Embedded struct due to allOf(#/components/schemas/SeverityPolicy)
	SeverityPolicy

	// In case of CVE policy this is same as cve name else it is blank
	Name string `json:"name,omitempty"`
}

CvePolicy defines model for CvePolicy.

type DeletePolicyParams

type DeletePolicyParams struct {
	Id int `json:"id"`
}

DeletePolicyParams defines parameters for DeletePolicy.

type DeleteVulnerabilityPolicyResponse

type DeleteVulnerabilityPolicyResponse struct {
	// Error object
	Error  *Error                       `json:"error,omitempty"`
	Result *IdVulnerabilityPolicyResult `json:"result,omitempty"`
}

DeleteVulnerabilityPolicyResponse defines model for DeleteVulnerabilityPolicyResponse.

type DeploymentDetailContainer

type DeploymentDetailContainer struct {
	InstalledAppId                int    `json:"installedAppId,omitempty"`
	AppId                         int    `json:"appId,omitempty"`
	AppStoreInstalledAppVersionId int    `json:"appStoreInstalledAppVersionId,omitempty"`
	AppStoreChartName             string `json:"appStoreChartName,omitempty"`
	AppStoreChartId               int    `json:"appStoreChartId,omitempty"`
	AppStoreAppName               string `json:"appStoreAppName,omitempty"`
	AppStoreAppVersion            string `json:"appStoreAppVersion,omitempty"`
	AppName                       string `json:"appName"`
	EnvironmentId                 int    `json:"environmentId"`
	EnvironmentName               string `json:"environmentName"`
	Namespace                     string `json:"namespace,omitempty"`
	//PrometheusEndpoint            string          `json:"prometheusEndpoint,omitempty"`
	Status               string          `json:"status,omitempty"`
	StatusMessage        string          `json:"statusMessage,omitempty"`
	LastDeployedTime     string          `json:"lastDeployedTime,omitempty"`
	LastDeployedBy       string          `json:"lastDeployedBy,omitempty"`
	MaterialInfo         json.RawMessage `json:"materialInfo,omitempty"`
	ReleaseVersion       string          `json:"releaseVersion,omitempty"`
	Default              bool            `json:"default,omitempty"`
	DataSource           string          `json:"dataSource,omitempty"`
	LastDeployedPipeline string          `json:"lastDeployedPipeline,omitempty"`
	Deprecated           bool            `json:"deprecated"`
}

type DeploymentDetailStat

type DeploymentDetailStat struct {
	AppId         int           `json:"appId"`
	EnvironmentId int           `json:"environmentId"`
	NewPodStats   PodDetailStat `json:"newPodStats,omitempty"`
	OldPodStats   PodDetailStat `json:"oldPodStats,omitempty"`
}

type DeploymentGroupDTO

type DeploymentGroupDTO struct {
	Id             int             `json:"id"`
	Name           string          `json:"name"`
	AppCount       int             `json:"appCount"`
	NoOfApps       string          `json:"noOfApps"`
	EnvironmentId  int             `json:"environmentId"`
	CiPipelineId   int             `json:"ciPipelineId"`
	CiMaterialDTOs []CiMaterialDTO `json:"ciMaterialDTOs"`
}

type Environment

type Environment struct {
	EnvironmentId   int    `json:"environmentId"`
	EnvironmentName string `json:"environmentName"`
	AppMetrics      *bool  `json:"appMetrics"`
	InfraMetrics    *bool  `json:"infraMetrics"`
	Prod            bool   `json:"prod"`
}

type Error

type Error struct {
	// Error code
	Code int32 `json:"code"`

	// Error message
	Message string `json:"message"`
}

Error defines model for Error.

type FetchPolicyParams

type FetchPolicyParams struct {
	Level ResourceLevel `json:"level"`
	Id    int           `json:"id,omitempty"`
}

FetchPolicyParams defines parameters for FetchPolicy.

type GetVulnerabilityPolicyResponse

type GetVulnerabilityPolicyResponse struct {
	// Error object
	Error  *Error                        `json:"error,omitempty"`
	Result *GetVulnerabilityPolicyResult `json:"result,omitempty"`
}

GetVulnerabilityPolicyResponse defines model for GetVulnerabilityPolicyResponse.

type GetVulnerabilityPolicyResult

type GetVulnerabilityPolicyResult struct {
	// Resource Level can be one of global, cluster, environment, application
	Level    ResourceLevel          `json:"level"`
	Policies []*VulnerabilityPolicy `json:"policies"`
}

GetVulnerabilityPolicyResult defines model for GetVulnerabilityPolicyResult.

type IdVulnerabilityPolicyResult

type IdVulnerabilityPolicyResult struct {
	Id int `json:"id"`
}

IdVulnerabilityPolicyResult defines model for IdVulnerabilityPolicyResult.

type InstanceDetail

type InstanceDetail struct {
	PodName            string  `json:"podName,omitempty"`
	CpuUsage           float64 `json:"cpuUsage,omitempty"`
	MemoryUsage        int64   `json:"memoryUsage,omitempty"`
	CpuRequest         float64 `json:"cpuRequest,omitempty"`
	MemoryRequest      int64   `json:"memoryRequest,omitempty"`
	CpuUsagePercent    float64 `json:"cpuUsagePercent,omitempty"`
	MemoryUsagePercent float64 `json:"memoryUsagePercent,omitempty"`
}

type LinkOuts

type LinkOuts struct {
	Id            int    `json:"id"`
	AppId         int    `json:"appId,omitempty"`
	EnvironmentId int    `json:"environmentId,omitempty"`
	Name          string `json:"name"`
	AppName       string `json:"appName,omitempty"`
	EnvName       string `json:"envName,omitempty"`
	PodName       string `json:"podName,omitempty"`
	ContainerName string `json:"containerName,omitempty"`
	Link          string `json:"link,omitempty"`
	Description   string `json:"description,omitempty"`
}

type Map

type Map struct {
	Name         string          `json:"name"`
	Type         string          `json:"type"`
	External     bool            `json:"external"`
	MountPath    string          `json:"mountPath"`
	Data         json.RawMessage `json:"data,omitempty"`
	ExternalType string          `json:"externalType"`
	RoleARN      string          `json:"roleARN"`
	SecretData   json.RawMessage `json:"secretData,omitempty"`
}

type PodDetailStat

type PodDetailStat struct {
	PodCount           string  `json:"podCount,omitempty"`
	CpuUsagePercent    float64 `json:"cpuUsagePercent,omitempty"`
	MemoryUsagePercent float64 `json:"memoryUsagePercent,omitempty"`
}

type PolicyRequest

type PolicyRequest struct {
	Data []casbin.Policy
}

type PolicyType

type PolicyType int
const (
	POLICY_DIRECT PolicyType = 1
	POLICY_GROUP  PolicyType = 1
)

type ReleaseStatusUpdateRequest

type ReleaseStatusUpdateRequest struct {
	RequestId string             `json:"requestId"`
	NewStatus models.ChartStatus `json:"newStatus"`
}

type ResourceLevel

type ResourceLevel string

ResourceLevel defines model for ResourceLevel.

type ResourceUsage

type ResourceUsage struct {
	AppId         int     `json:"appId"` //app_id
	EnvironmentId int     `json:"environmentId"`
	CpuUsage      float64 `json:"cpuUsage,omitempty"`
	MemoryUsage   float64 `json:"memoryUsage,omitempty"`
}

type Response

type Response struct {
	Code   int         `json:"code,omitempty"`
	Status string      `json:"status,omitempty"`
	Result interface{} `json:"result,omitempty"`
	Errors []ApiError  `json:"errors,omitempty"`
}

global response body used across api

type Role

type Role struct {
	Id   int    `json:"id" validate:"number"`
	Role string `json:"role" validate:"required"`
}

type RoleData

type RoleData struct {
	Id          int    `json:"id" validate:"number"`
	Role        string `json:"role" validate:"required"`
	Entity      string `json:"entity"`
	Team        string `json:"team"`
	EntityName  string `json:"entityName"`
	Environment string `json:"environment"`
	Action      string `json:"action"`
}

type RoleFilter

type RoleFilter struct {
	Entity      string `json:"entity"`
	Team        string `json:"team"`
	EntityName  string `json:"entityName"`
	Environment string `json:"environment"`
	Action      string `json:"action"`
}

type RoleGroup

type RoleGroup struct {
	Id          int32        `json:"id" validate:"number"`
	Name        string       `json:"name,omitempty"`
	Description string       `json:"description,omitempty"`
	RoleFilters []RoleFilter `json:"roleFilters"`
	Status      string       `json:"status,omitempty"`
	UserId      int32        `json:"-"` // created or modified user id
}

type SSOLoginDto

type SSOLoginDto struct {
	Id     int32           `json:"id"`
	Name   string          `json:"name,omitempty"`
	Label  string          `json:"label,omitempty"`
	Url    string          `json:"url,omitempty"`
	Config json.RawMessage `json:"config,omitempty"`
	Active bool            `json:"active"`
	UserId int32           `json:"-"`
}

type SeverityPolicy

type SeverityPolicy struct {
	Id int `json:"id"`

	// Whether vulnerability is allowed or blocked and is it inherited or is it overriden
	Policy       *VulnerabilityPermission `json:"policy"`
	PolicyOrigin string                   `json:"policyOrigin"`
	Severity     string                   `json:"severity"`
}

SeverityPolicy defines model for SeverityPolicy.

type TriggerView

type TriggerView struct {
	CiPipelineId     int                             `json:"ciPipelineId"`
	CiPipelineName   string                          `json:"ciPipelineName"`
	CdPipelineId     int                             `json:"cdPipelineId"`
	CdPipelineName   string                          `json:"cdPipelineName"`
	Status           string                          `json:"status"`
	StatusMessage    string                          `json:"statusMessage,omitempty"`
	LastDeployedTime string                          `json:"lastDeployedTime,omitempty"`
	LastDeployedBy   string                          `json:"lastDeployedBy,omitempty"`
	MaterialInfo     json.RawMessage                 `json:"materialInfo,omitempty"`
	ReleaseVersion   string                          `json:"releaseVersion,omitempty"`
	DataSource       string                          `json:"dataSource,omitempty"`
	Conditions       []v1alpha1.ApplicationCondition `json:"conditions"`
	AppName          string                          `json:"appName"`
	EnvironmentName  string                          `json:"environmentName"`
}

type UpdatePolicyParams

type UpdatePolicyParams struct {
	Id     int    `json:"id"`
	Action string `json:"action"`
}

UpdatePolicyParams defines parameters for UpdatePolicy.

type UpdateVulnerabilityPolicyResponse

type UpdateVulnerabilityPolicyResponse struct {
	// Error object
	Error  *Error                       `json:"error,omitempty"`
	Result *IdVulnerabilityPolicyResult `json:"result,omitempty"`
}

UpdateVulnerabilityPolicyResponse defines model for UpdateVulnerabilityPolicyResponse.

type UserInfo

type UserInfo struct {
	Id          int32        `json:"id" validate:"number"`
	EmailId     string       `json:"email_id" validate:"required"`
	Roles       []string     `json:"roles,omitempty"`
	AccessToken string       `json:"access_token,omitempty"`
	Exist       bool         `json:"-"`
	UserId      int32        `json:"-"` // created or modified user id
	RoleFilters []RoleFilter `json:"roleFilters"`
	Status      string       `json:"status,omitempty"`
	Groups      []string     `json:"groups"`
	SuperAdmin  bool         `json:"superAdmin,notnull"`
}

type UserRole

type UserRole struct {
	Id      int32  `json:"id" validate:"number"`
	EmailId string `json:"email_id" validate:"email"`
	Role    string `json:"role"`
}

type ValuesOverrideRequest

type ValuesOverrideRequest struct {
	PipelineId         int                   `json:"pipelineId" validate:"required"`
	AppId              int                   `json:"appId" validate:"required"`
	CiArtifactId       int                   `json:"ciArtifactId" validate:"required"`
	AdditionalOverride json.RawMessage       `json:"additionalOverride"`
	TargetDbVersion    int                   `json:"targetDbVersion"`
	ForceTrigger       bool                  `json:"forceTrigger,notnull"`
	DeploymentTemplate string                `json:"strategy,omitempty"` // validate:"oneof=BLUE-GREEN ROLLING"`
	CdWorkflowType     CdWorkflowType        `json:"cdWorkflowType,notnull"`
	CdWorkflowId       int                   `json:"cdWorkflowId"`
	UserId             int32                 `json:"-"`
	DeploymentType     models.DeploymentType `json:"-"`
}

type VulnerabilityAction

type VulnerabilityAction string

VulnerabilityAction defines model for VulnerabilityAction.

type VulnerabilityPermission

type VulnerabilityPermission struct {
	// actions which can be taken on vulnerabilities
	Action      VulnerabilityAction `json:"action"`
	Inherited   bool                `json:"inherited"`
	IsOverriden bool                `json:"isOverriden"`
}

VulnerabilityPermission defines model for VulnerabilityPermission.

type VulnerabilityPolicy

type VulnerabilityPolicy struct {
	Cves []*CvePolicy `json:"cves"`

	// environment id in case of application
	EnvId int `json:"envId,omitempty"`

	// Is name of cluster or environment or application/environment
	Name       string            `json:"name,omitempty"`
	Severities []*SeverityPolicy `json:"severities"`
	AppId      int               `json:"-"`
	ClusterId  int               `json:"-"`
}

VulnerabilityPolicy defines model for VulnerabilityPolicy.

Jump to

Keyboard shortcuts

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