bulkAction

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 43 Imported by: 2

Documentation

Index

Constants

View Source
const (
	AuthorizationError = "authError"
	Error              = "error"
	Skipped            = "skipped"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BulkApplicationForEnvironmentPayload

type BulkApplicationForEnvironmentPayload struct {
	AppIdIncludes    []int    `json:"appIdIncludes,omitempty"`
	AppIdExcludes    []int    `json:"appIdExcludes,omitempty"`
	EnvId            int      `json:"envId,omitempty"`
	EnvName          string   `json:"envName,omitempty"`
	AppNamesIncludes []string `json:"appNamesIncludes,omitempty"`
	AppNamesExcludes []string `json:"appNamesExcludes,omitempty"`
	UserId           int32    `json:"-"`
	InvalidateCache  bool     `json:"invalidateCache"`
}

type BulkApplicationForEnvironmentResponse

type BulkApplicationForEnvironmentResponse struct {
	BulkApplicationForEnvironmentPayload
	Response map[string]map[string]bool `json:"response"`
}

type BulkApplicationHibernateUnhibernateForEnvironmentResponse added in v0.6.26

type BulkApplicationHibernateUnhibernateForEnvironmentResponse struct {
	BulkApplicationForEnvironmentPayload
	Response []map[string]any `json:"response"`
}

type BulkUpdatePayload

type BulkUpdatePayload struct {
	Includes           *NameIncludesExcludes   `json:"includes"`
	Excludes           *NameIncludesExcludes   `json:"excludes"`
	EnvIds             []int                   `json:"envIds"`
	Global             bool                    `json:"global"`
	DeploymentTemplate *DeploymentTemplateTask `json:"deploymentTemplate"`
	ConfigMap          *CmAndSecretTask        `json:"configMap"`
	Secret             *CmAndSecretTask        `json:"secret"`
}

type BulkUpdateResponse

type BulkUpdateResponse struct {
	DeploymentTemplate *DeploymentTemplateBulkUpdateResponse `json:"deploymentTemplate"`
	ConfigMap          *CmAndSecretBulkUpdateResponse        `json:"configMap"`
	Secret             *CmAndSecretBulkUpdateResponse        `json:"secret"`
}

type BulkUpdateScript

type BulkUpdateScript struct {
	ApiVersion string             `json:"apiVersion" validate:"required"`
	Kind       string             `json:"kind" validate:"required"`
	Spec       *BulkUpdatePayload `json:"spec" validate:"required"`
}

type BulkUpdateSeeExampleResponse

type BulkUpdateSeeExampleResponse struct {
	Operation string            `json:"operation"`
	Script    *BulkUpdateScript `json:"script" validate:"required"`
	ReadMe    string            `json:"readme"`
}

type BulkUpdateService

type BulkUpdateService interface {
	FindBulkUpdateReadme(operation string) (response *BulkUpdateSeeExampleResponse, err error)
	GetBulkAppName(bulkUpdateRequest *BulkUpdatePayload) (*ImpactedObjectsResponse, error)
	ApplyJsonPatch(patch jsonpatch.Patch, target string) (string, error)
	BulkUpdateDeploymentTemplate(bulkUpdatePayload *BulkUpdatePayload) *DeploymentTemplateBulkUpdateResponse
	BulkUpdateConfigMap(bulkUpdatePayload *BulkUpdatePayload) *CmAndSecretBulkUpdateResponse
	BulkUpdateSecret(bulkUpdatePayload *BulkUpdatePayload) *CmAndSecretBulkUpdateResponse
	BulkUpdate(bulkUpdateRequest *BulkUpdatePayload) (bulkUpdateResponse *BulkUpdateResponse)

	BulkHibernate(request *BulkApplicationForEnvironmentPayload, ctx context.Context, w http.ResponseWriter, token string, checkAuthForBulkActions func(token string, appObject string, envObject string) bool) (*BulkApplicationHibernateUnhibernateForEnvironmentResponse, error)
	BulkUnHibernate(request *BulkApplicationForEnvironmentPayload, ctx context.Context, w http.ResponseWriter, token string, checkAuthForBulkActions func(token string, appObject string, envObject string) bool) (*BulkApplicationHibernateUnhibernateForEnvironmentResponse, error)
	BulkDeploy(request *BulkApplicationForEnvironmentPayload, token string, checkAuthBatch func(token string, appObject []string, envObject []string) (map[string]bool, map[string]bool)) (*BulkApplicationForEnvironmentResponse, error)
	BulkBuildTrigger(request *BulkApplicationForEnvironmentPayload, ctx context.Context, w http.ResponseWriter, token string, checkAuthForBulkActions func(token string, appObject string, envObject string) bool) (*BulkApplicationForEnvironmentResponse, error)

	GetBulkActionImpactedPipelinesAndWfs(dto *CdBulkActionRequestDto) ([]*pipelineConfig.Pipeline, []int, []int, error)
	PerformBulkActionOnCdPipelines(dto *CdBulkActionRequestDto, impactedPipelines []*pipelineConfig.Pipeline, ctx context.Context, dryRun bool, impactedAppWfIds []int, impactedCiPipelineIds []int) (*PipelineAndWfBulkActionResponseDto, error)
}

type BulkUpdateServiceImpl

type BulkUpdateServiceImpl struct {
	// contains filtered or unexported fields
}

func NewBulkUpdateServiceImpl

func NewBulkUpdateServiceImpl(bulkUpdateRepository bulkUpdate.BulkUpdateRepository,
	logger *zap.SugaredLogger,
	environmentRepository repository2.EnvironmentRepository,
	pipelineRepository pipelineConfig.PipelineRepository,
	appRepository app.AppRepository,
	deploymentTemplateHistoryService deploymentTemplate.DeploymentTemplateHistoryService,
	configMapHistoryService configMapAndSecret.ConfigMapHistoryService,
	pipelineBuilder pipeline.PipelineBuilder,
	enforcerUtil rbac.EnforcerUtil,
	ciHandler pipeline.CiHandler,
	ciPipelineRepository pipelineConfig.CiPipelineRepository,
	appWorkflowRepository appWorkflow.AppWorkflowRepository,
	appWorkflowService appWorkflow2.AppWorkflowService,
	scopedVariableManager variables.ScopedVariableManager,
	deployedAppMetricsService deployedAppMetrics.DeployedAppMetricsService,
	chartRefService chartRef.ChartRefService,
	deployedAppService deployedApp.DeployedAppService,
	cdPipelineEventPublishService out.CDPipelineEventPublishService) *BulkUpdateServiceImpl

func (BulkUpdateServiceImpl) ApplyJsonPatch

func (impl BulkUpdateServiceImpl) ApplyJsonPatch(patch jsonpatch.Patch, target string) (string, error)

func (BulkUpdateServiceImpl) BulkBuildTrigger

func (impl BulkUpdateServiceImpl) BulkBuildTrigger(request *BulkApplicationForEnvironmentPayload, ctx context.Context, w http.ResponseWriter, token string, checkAuthForBulkActions func(token string, appObject string, envObject string) bool) (*BulkApplicationForEnvironmentResponse, error)

func (BulkUpdateServiceImpl) BulkDeploy

func (impl BulkUpdateServiceImpl) BulkDeploy(request *BulkApplicationForEnvironmentPayload, token string, checkAuthBatch func(token string, appObject []string, envObject []string) (map[string]bool, map[string]bool)) (*BulkApplicationForEnvironmentResponse, error)

func (BulkUpdateServiceImpl) BulkHibernate

func (impl BulkUpdateServiceImpl) BulkHibernate(request *BulkApplicationForEnvironmentPayload, ctx context.Context, w http.ResponseWriter, token string, checkAuthForBulkActions func(token string, appObject string, envObject string) bool) (*BulkApplicationHibernateUnhibernateForEnvironmentResponse, error)

func (BulkUpdateServiceImpl) BulkUnHibernate

func (impl BulkUpdateServiceImpl) BulkUnHibernate(request *BulkApplicationForEnvironmentPayload, ctx context.Context, w http.ResponseWriter, token string, checkAuthForBulkActions func(token string, appObject string, envObject string) bool) (*BulkApplicationHibernateUnhibernateForEnvironmentResponse, error)

func (BulkUpdateServiceImpl) BulkUpdate

func (impl BulkUpdateServiceImpl) BulkUpdate(bulkUpdatePayload *BulkUpdatePayload) *BulkUpdateResponse

func (BulkUpdateServiceImpl) BulkUpdateConfigMap

func (impl BulkUpdateServiceImpl) BulkUpdateConfigMap(bulkUpdatePayload *BulkUpdatePayload) *CmAndSecretBulkUpdateResponse

func (BulkUpdateServiceImpl) BulkUpdateDeploymentTemplate

func (impl BulkUpdateServiceImpl) BulkUpdateDeploymentTemplate(bulkUpdatePayload *BulkUpdatePayload) *DeploymentTemplateBulkUpdateResponse

func (BulkUpdateServiceImpl) BulkUpdateSecret

func (impl BulkUpdateServiceImpl) BulkUpdateSecret(bulkUpdatePayload *BulkUpdatePayload) *CmAndSecretBulkUpdateResponse

func (BulkUpdateServiceImpl) FindBulkUpdateReadme

func (impl BulkUpdateServiceImpl) FindBulkUpdateReadme(operation string) (*BulkUpdateSeeExampleResponse, error)

func (BulkUpdateServiceImpl) GetBulkActionImpactedPipelinesAndWfs

func (impl BulkUpdateServiceImpl) GetBulkActionImpactedPipelinesAndWfs(dto *CdBulkActionRequestDto) ([]*pipelineConfig.Pipeline, []int, []int, error)

func (BulkUpdateServiceImpl) GetBulkAppName

func (impl BulkUpdateServiceImpl) GetBulkAppName(bulkUpdatePayload *BulkUpdatePayload) (*ImpactedObjectsResponse, error)

func (BulkUpdateServiceImpl) PerformBulkActionOnCdPipelines

func (impl BulkUpdateServiceImpl) PerformBulkActionOnCdPipelines(dto *CdBulkActionRequestDto, impactedPipelines []*pipelineConfig.Pipeline,
	ctx context.Context, dryRun bool, impactedAppWfIds []int, impactedCiPipelineIds []int) (*PipelineAndWfBulkActionResponseDto, error)

func (BulkUpdateServiceImpl) PerformBulkDeleteActionOnCdPipelines

func (impl BulkUpdateServiceImpl) PerformBulkDeleteActionOnCdPipelines(impactedPipelines []*pipelineConfig.Pipeline, ctx context.Context, dryRun bool, deleteAction int, deleteWfAndCiPipeline bool, impactedAppWfIds, impactedCiPipelineIds []int, userId int32) (*PipelineAndWfBulkActionResponseDto, error)

type CdBulkAction

type CdBulkAction int
const (
	CD_BULK_DELETE CdBulkAction = iota
)

type CdBulkActionRequestDto

type CdBulkActionRequestDto struct {
	Action                CdBulkAction `json:"action"`
	EnvIds                []int        `json:"envIds"`
	EnvNames              []string     `json:"envNames"`
	AppIds                []int        `json:"appIds"`
	AppNames              []string     `json:"appNames"`
	ProjectIds            []int        `json:"projectIds"`
	ProjectNames          []string     `json:"projectNames"`
	DeleteWfAndCiPipeline bool         `json:"deleteWfAndCiPipeline"`
	ForceDelete           bool         `json:"forceDelete"`
	NonCascadeDelete      bool         `json:"nonCascadeDelete"`
	UserId                int32        `json:"-"`
}

type CdBulkActionResponseDto

type CdBulkActionResponseDto struct {
	PipelineName    string `json:"pipelineName"`
	AppName         string `json:"appName"`
	EnvironmentName string `json:"environmentName"`
	DeletionResult  string `json:"deletionResult,omitempty"`
}

type CiBulkActionResponseDto

type CiBulkActionResponseDto struct {
	PipelineName   string `json:"pipelineName"`
	DeletionResult string `json:"deletionResult,omitempty"`
}

type CmAndSecretBulkUpdateResponse

type CmAndSecretBulkUpdateResponse struct {
	Message    []string                                  `json:"message"`
	Failure    []*CmAndSecretBulkUpdateResponseForOneApp `json:"failure"`
	Successful []*CmAndSecretBulkUpdateResponseForOneApp `json:"successful"`
}

type CmAndSecretBulkUpdateResponseForOneApp

type CmAndSecretBulkUpdateResponseForOneApp struct {
	AppId   int      `json:"appId"`
	AppName string   `json:"appName"`
	EnvId   int      `json:"envId"`
	Names   []string `json:"names"`
	Message string   `json:"message"`
}

type CmAndSecretImpactedObjectsResponseForOneApp

type CmAndSecretImpactedObjectsResponseForOneApp struct {
	AppId   int      `json:"appId"`
	AppName string   `json:"appName"`
	EnvId   int      `json:"envId"`
	Names   []string `json:"names"`
}

type CmAndSecretSpec

type CmAndSecretSpec struct {
	Names     []string `json:"names"`
	PatchJson string   `json:"patchJson"`
}

type CmAndSecretTask

type CmAndSecretTask struct {
	Spec *CmAndSecretSpec `json:"spec"`
}

type DeploymentTemplateBulkUpdateResponse

type DeploymentTemplateBulkUpdateResponse struct {
	Message    []string                                         `json:"message"`
	Failure    []*DeploymentTemplateBulkUpdateResponseForOneApp `json:"failure"`
	Successful []*DeploymentTemplateBulkUpdateResponseForOneApp `json:"successful"`
}

type DeploymentTemplateBulkUpdateResponseForOneApp

type DeploymentTemplateBulkUpdateResponseForOneApp struct {
	AppId   int    `json:"appId"`
	AppName string `json:"appName"`
	EnvId   int    `json:"envId"`
	Message string `json:"message"`
}

type DeploymentTemplateImpactedObjectsResponseForOneApp

type DeploymentTemplateImpactedObjectsResponseForOneApp struct {
	AppId   int    `json:"appId"`
	AppName string `json:"appName"`
	EnvId   int    `json:"envId"`
}

type DeploymentTemplateSpec

type DeploymentTemplateSpec struct {
	PatchJson string `json:"patchJson"`
}

type DeploymentTemplateTask

type DeploymentTemplateTask struct {
	Spec *DeploymentTemplateSpec `json:"spec"`
}

type ImpactedObjectsResponse

type ImpactedObjectsResponse struct {
	DeploymentTemplate []*DeploymentTemplateImpactedObjectsResponseForOneApp `json:"deploymentTemplate"`
	ConfigMap          []*CmAndSecretImpactedObjectsResponseForOneApp        `json:"configMap"`
	Secret             []*CmAndSecretImpactedObjectsResponseForOneApp        `json:"secret"`
}

type NameIncludesExcludes

type NameIncludesExcludes struct {
	Names []string `json:"names"`
}

type PipelineAndWfBulkActionResponseDto

type PipelineAndWfBulkActionResponseDto struct {
	CdPipelinesRespDtos []*CdBulkActionResponseDto `json:"cdPipelines"`
	CiPipelineRespDtos  []*CiBulkActionResponseDto `json:"ciPipelines"`
	AppWfRespDtos       []*WfBulkActionResponseDto `json:"appWorkflows"`
}

type WfBulkActionResponseDto

type WfBulkActionResponseDto struct {
	WorkflowId     int    `json:"workflowId"`
	DeletionResult string `json:"deletionResult,omitempty"`
}

Jump to

Keyboard shortcuts

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