v1alpha1

package
v1.0.3-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2020 License: Apache-2.0 Imports: 59 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GCImageName is name of the GC image in config
	GCImageName = "gc"
	// GCDefaultImage is the default image used for GC pod
	GCDefaultImage = "alpine:3.8"
)
View Source
const (
	// TemplateTypeBuiltin represents the type of builtin templates.
	TemplateTypeBuiltin = "builtin"

	// TemplateTypeCustom represents the type of custom templates.
	TemplateTypeCustom = "custom"
)

Variables

This section is empty.

Functions

func AllResources

func AllResources(ctx context.Context, label string, query *types.QueryParams) (*types.ListResponse, error)

AllResources lists all resources matched the provided label from all projects and tenants.

func AllStages

func AllStages(ctx context.Context, label string, query *types.QueryParams) (*types.ListResponse, error)

AllStages lists all stages matched the provided label from all projects and tenants.

func AllWorkflowRuns

func AllWorkflowRuns(ctx context.Context, label string, query *types.QueryParams) (*types.ListResponse, error)

AllWorkflowRuns lists all workflowruns matched the provided label from all projects and tenants.

func AllWorkflowTriggers

func AllWorkflowTriggers(ctx context.Context, label string, query *types.QueryParams) (*types.ListResponse, error)

AllWorkflowTriggers lists all workflow triggers matched the provided label from all projects and tenants.

func AllWorkflows

func AllWorkflows(ctx context.Context, label string, query *types.QueryParams) (*types.ListResponse, error)

AllWorkflows lists all workflows matched the provided label from all projects and tenants.

func Cleanup added in v0.9.6

func Cleanup(ctx context.Context, tenant string, request v1alpha1.StorageCleanup) error

Cleanup cleans up given storage paths.

func CloseCluster added in v0.9.6

func CloseCluster(ctx context.Context, tenant, name string) error

CloseCluster closes cluster type integration that used to execute workflow

func CreateDefaultTenant added in v0.9.6

func CreateDefaultTenant() error

CreateDefaultTenant creates cyclone default tenant and initialize the tenant: - Create namespace - Create PVC

func CreateIntegration

func CreateIntegration(ctx context.Context, tenant string, isPublic bool, in *api.Integration, dryRun bool) (*api.Integration, error)

CreateIntegration creates an integration to store external system info for the tenant.

func CreateProject

func CreateProject(ctx context.Context, tenant string, project *v1alpha1.Project) (*v1alpha1.Project, error)

CreateProject creates a project for the tenant.

func CreateResource

func CreateResource(ctx context.Context, project, tenant string, rsc *v1alpha1.Resource) (*v1alpha1.Resource, error)

CreateResource ...

func CreateResourceType added in v0.9.6

func CreateResourceType(ctx context.Context, tenant string, resource *v1alpha1.Resource) (*v1alpha1.Resource, error)

CreateResourceType ...

func CreateStage

func CreateStage(ctx context.Context, project, tenant string, stg *v1alpha1.Stage) (*v1alpha1.Stage, error)

CreateStage ...

func CreateTemplate

func CreateTemplate(ctx context.Context, tenant string, stage *v1alpha1.Stage) (*v1alpha1.Stage, error)

CreateTemplate creates a stage template for the tenant. 'stage' describe the template to create. Stage templates are special stages, with 'stage.cyclone.dev/template' label. If created successfully, return the create template.

func CreateTenant

func CreateTenant(ctx context.Context, tenant *api.Tenant) (*api.Tenant, error)

CreateTenant creates a cyclone tenant

func CreateWorkflow

func CreateWorkflow(ctx context.Context, tenant, project string, wf *v1alpha1.Workflow) (*v1alpha1.Workflow, error)

CreateWorkflow ...

func CreateWorkflowRun

func CreateWorkflowRun(ctx context.Context, project, workflow, tenant string, wfr *v1alpha1.WorkflowRun) (*v1alpha1.WorkflowRun, error)

CreateWorkflowRun ...

func CreateWorkflowTrigger

func CreateWorkflowTrigger(ctx context.Context, tenant, project, workflow string, wft *v1alpha1.WorkflowTrigger) (*v1alpha1.WorkflowTrigger, error)

CreateWorkflowTrigger ...

func DeleteIntegration

func DeleteIntegration(ctx context.Context, tenant, name string, isPublic bool) error

DeleteIntegration deletes a integration with the given tenant and name.

func DeleteProject

func DeleteProject(ctx context.Context, tenant, project string) error

DeleteProject deletes a project with the given tenant and project name.

func DeleteResource

func DeleteResource(ctx context.Context, project, resource, tenant string) error

DeleteResource ...

func DeleteResourceType added in v0.9.6

func DeleteResourceType(ctx context.Context, tenant string, resourceType string) error

DeleteResourceType ...

func DeleteStage

func DeleteStage(ctx context.Context, project, stage, tenant string) error

DeleteStage ...

func DeleteTemplate

func DeleteTemplate(ctx context.Context, tenant, template string) error

DeleteTemplate deletes a stage template with the given tenant and template name.

func DeleteTenant

func DeleteTenant(ctx context.Context, name string) error

DeleteTenant deletes a tenant

func DeleteWorkflow

func DeleteWorkflow(ctx context.Context, tenant, project, workflow string) error

DeleteWorkflow ...

func DeleteWorkflowRun

func DeleteWorkflowRun(ctx context.Context, project, workflow, workflowrun, tenant string) error

DeleteWorkflowRun ...

func DeleteWorkflowTrigger

func DeleteWorkflowTrigger(ctx context.Context, tenant, project, workflow, workflowtrigger string) error

DeleteWorkflowTrigger ...

func GenerateNameModifier

func GenerateNameModifier(tenant, project, wf string, object interface{}) error

GenerateNameModifier is a modifier of create cyclone CRD resources. It will give the resource a name if it is empty.

func GetContainerLogStream

func GetContainerLogStream(ctx context.Context, project, workflow, workflowrun, tenant, stage, qt string) error

GetContainerLogStream gets real-time logs of a certain stage.

func GetContainerLogs

func GetContainerLogs(ctx context.Context, project, workflow, workflowrun, tenant, stage, container string, download bool) (io.ReadCloser, map[string]string, error)

GetContainerLogs handles the request to get container logs, only supports finished stage records.

func GetIntegration

func GetIntegration(ctx context.Context, tenant, name string, isPublic bool) (*api.Integration, error)

GetIntegration gets an integration with the given name under given tenant.

func GetProject

func GetProject(ctx context.Context, tenant, name string) (*v1alpha1.Project, error)

GetProject gets a project with the given project name under given tenant.

func GetProjectStatistics

func GetProjectStatistics(ctx context.Context, tenant, project, start, end string) (*api.Statistic, error)

GetProjectStatistics handles the request to get a project's statistics.

func GetResource

func GetResource(ctx context.Context, project, resource, tenant string) (*v1alpha1.Resource, error)

GetResource ...

func GetResourceType added in v0.9.6

func GetResourceType(ctx context.Context, tenant, resourceType string) (*v1alpha1.Resource, error)

GetResourceType ...

func GetStage

func GetStage(ctx context.Context, project, stage, tenant string) (*v1alpha1.Stage, error)

GetStage ...

func GetStorageUsage added in v0.9.6

func GetStorageUsage(ctx context.Context, tenant string) (*v1alpha1.StorageUsage, error)

GetStorageUsage gets storage usage of the tenant

func GetTemplate

func GetTemplate(ctx context.Context, tenant, template string, includePublic bool) (stage *v1alpha1.Stage, err error)

GetTemplate gets a stage template with the given template name under given tenant.

func GetTenant

func GetTenant(ctx context.Context, name string) (*api.Tenant, error)

GetTenant gets information for a specific tenant

func GetWFStatistics

func GetWFStatistics(ctx context.Context, tenant, project, workflow string, start, end string) (*api.Statistic, error)

GetWFStatistics handles the request to get a workflow's statistics.

func GetWorkflow

func GetWorkflow(ctx context.Context, tenant, project, workflow string) (*v1alpha1.Workflow, error)

GetWorkflow ...

func GetWorkflowRun

func GetWorkflowRun(ctx context.Context, project, workflow, workflowrun, tenant string) (*v1alpha1.WorkflowRun, error)

GetWorkflowRun ...

func GetWorkflowTrigger

func GetWorkflowTrigger(ctx context.Context, tenant, project, workflow, workflowtrigger string) (*v1alpha1.WorkflowTrigger, error)

GetWorkflowTrigger ...

func HandleWebhook

func HandleWebhook(ctx context.Context, tenant, eventType, integration string) (api.WebhookResponse, error)

HandleWebhook handles webhooks from integrated systems.

func HandleWorkflowRunNotification added in v0.9.6

func HandleWorkflowRunNotification(ctx context.Context, wfr *v1alpha1.WorkflowRun) (interface{}, error)

HandleWorkflowRunNotification handles workflowrun finished notification from workflow engine.

func HealthCheck

func HealthCheck(ctx context.Context) (v1alpha1.HealthStatus, error)

HealthCheck checks the health status of Cyclone server.

func InjectProjectLabelModifier

func InjectProjectLabelModifier(tenant, project, wf string, object interface{}) error

InjectProjectLabelModifier is a modifier of create cyclone CRD resources. It will add project labels for the resource.

func InjectProjectOwnerRefModifier added in v0.9.6

func InjectProjectOwnerRefModifier(tenant, project, wf string, object interface{}) error

InjectProjectOwnerRefModifier is a modifier of creating cyclone CRD resources. It will add project owner reference for the resource.

func InjectWorkflowLabelModifier added in v0.9.6

func InjectWorkflowLabelModifier(tenant, project, wf string, object interface{}) error

InjectWorkflowLabelModifier is a modifier of create cyclone CRD resources. It will add workflow labels for the resource.

func InjectWorkflowOwnerRefModifier added in v0.9.6

func InjectWorkflowOwnerRefModifier(tenant, project, wf string, object interface{}) error

InjectWorkflowOwnerRefModifier is a modifier of creating cyclone CRD resources. It will add workflow owner reference for the resource.

func ListExecutionContexts added in v0.9.7

func ListExecutionContexts(ctx context.Context, tenant string) (*types.ListResponse, error)

ListExecutionContexts list execution contexts of a tenant

func ListIntegrations

func ListIntegrations(ctx context.Context, tenant string, includePublic bool, query *types.QueryParams) (*types.ListResponse, error)

ListIntegrations get integrations for the given tenant.

func ListProjects

func ListProjects(ctx context.Context, tenant string, query *types.QueryParams) (*types.ListResponse, error)

ListProjects list projects the given tenant has access to. - ctx Context of the reqeust - tenant Tenant - query Query params includes start, limit and filter.

func ListResourceTypes added in v0.9.6

func ListResourceTypes(ctx context.Context, tenant string, operation string) (*types.ListResponse, error)

ListResourceTypes ...

func ListResources

func ListResources(ctx context.Context, project, tenant string, query *types.QueryParams) (*types.ListResponse, error)

ListResources ...

func ListSCMBranches added in v0.9.6

func ListSCMBranches(ctx context.Context, tenant, integrationName, repo string) (*types.ListResponse, error)

ListSCMBranches lists branches for specified repo of integrated SCM under given tenant.

func ListSCMDockerfiles added in v0.9.6

func ListSCMDockerfiles(ctx context.Context, tenant, integrationName, repo string) (*types.ListResponse, error)

ListSCMDockerfiles lists Dockerfiles for specified repo of integrated SCM under given tenant.

func ListSCMPullRequests added in v0.9.7

func ListSCMPullRequests(ctx context.Context, tenant, integrationName, repo, state string) (*types.ListResponse, error)

ListSCMPullRequests lists pull request for specified repo of integrated SCM under given tenant.

func ListSCMRepos added in v0.9.6

func ListSCMRepos(ctx context.Context, tenant, integrationName string) (*types.ListResponse, error)

ListSCMRepos lists repos for integrated SCM under given tenant.

func ListSCMTags added in v0.9.6

func ListSCMTags(ctx context.Context, tenant, integrationName, repo string) (*types.ListResponse, error)

ListSCMTags lists tags for specified repo of integrated SCM under given tenant.

func ListStages

func ListStages(ctx context.Context, project, tenant string, query *types.QueryParams) (*types.ListResponse, error)

ListStages ...

func ListTemplates

func ListTemplates(ctx context.Context, tenant string, includePublic bool, query *types.QueryParams) (*types.ListResponse, error)

ListTemplates get templates the given tenant has access to. - ctx Context of the reqeust - tenant Tenant - includePublic Whether to include system level stage templates, default to true - query Query params includes start, limit and filter.

func ListTenants

func ListTenants(ctx context.Context, query *types.QueryParams) (*types.ListResponse, error)

ListTenants list all tenants' information

func ListWorkflowRuns

func ListWorkflowRuns(ctx context.Context, project, workflow, tenant string, query *types.QueryParams) (*types.ListResponse, error)

ListWorkflowRuns ...

func ListWorkflowTriggers

func ListWorkflowTriggers(ctx context.Context, tenant, project, workflow string, query *types.QueryParams) (*types.ListResponse, error)

ListWorkflowTriggers ...

func ListWorkflows

func ListWorkflows(ctx context.Context, tenant, project string, query *types.QueryParams) (*types.ListResponse, error)

ListWorkflows ...

func ListWorkingPods

func ListWorkingPods(ctx context.Context, tenant string, query *types.QueryParams) (*types.ListResponse, error)

ListWorkingPods lists all pods of workflowruns.

func OpenCluster added in v0.9.6

func OpenCluster(ctx context.Context, tenant, name string) error

OpenCluster opens cluster type integration to execute workflow

func PauseWorkflowRun

func PauseWorkflowRun(ctx context.Context, project, workflow, workflowrun, tenant string) (*v1alpha1.WorkflowRun, error)

PauseWorkflowRun updates the workflowrun overall status to Waiting.

func ReceiveContainerLogStream

func ReceiveContainerLogStream(ctx context.Context, workflowrun, namespace, stage, container string) error

ReceiveContainerLogStream receives real-time log of container within workflowrun stage.

func ReportStorageUsage

func ReportStorageUsage(ctx context.Context, namespace string, request v1alpha1.StorageUsage) error

ReportStorageUsage reports storage usage of a namespace.

func ResumeWorkflowRun added in v0.9.6

func ResumeWorkflowRun(ctx context.Context, project, workflow, workflowrun, tenant string) (*v1alpha1.WorkflowRun, error)

ResumeWorkflowRun updates the workflowrun overall status to Running.

func RetrieveRepoRootURL added in v1.0.0

func RetrieveRepoRootURL(url, username, password string) (string, error)

RetrieveRepoRootURL retrieve svn repository root-url by command:

'svn info --show-item repos-root-url --username {user} --password {password} --non-interactive --trust-server-cert-failures unknown-ca,cn-mismatch,expired,not-yet-valid,other --no-auth-cache {remote-svn-address}'

func RetrieveRepoUUID added in v1.0.0

func RetrieveRepoUUID(url, username, password string) (string, error)

RetrieveRepoUUID retrieve svn repository uuid by command:

'svn info --show-item repos-uuid --username {user} --password {password} --non-interactive --trust-server-cert-failures unknown-ca,cn-mismatch,expired,not-yet-valid,other --no-auth-cache {remote-svn-address}'

func StartPVCWatcher added in v1.0.0

func StartPVCWatcher(ctx context.Context, tenant, name string) error

StartPVCWatcher is used for cluster type integration, it will create a pvc watcher deployment to watch pvc usages.

func StopPVCWatcher added in v1.0.0

func StopPVCWatcher(ctx context.Context, tenant, name string) error

StopPVCWatcher is used for cluster type integration, it will delete the pvc watcher deployment.

func StopWorkflowRun added in v0.9.6

func StopWorkflowRun(ctx context.Context, project, workflow, workflowrun, tenant string) (*v1alpha1.WorkflowRun, error)

StopWorkflowRun stops a WorkflowRun.

func TenantModifier

func TenantModifier(tenant, project, wf string, object interface{}) error

TenantModifier is a modifier of create cyclone tenant. This modifier will give some default value for tenant if it is nil.

func UpdateIntegration

func UpdateIntegration(ctx context.Context, tenant, name string, isPublic bool, in *api.Integration) (*api.Integration, error)

UpdateIntegration updates an integration with the given tenant name and integration name. If updated successfully, return the updated integration.

func UpdateProject

func UpdateProject(ctx context.Context, tenant, pName string, project *v1alpha1.Project) (*v1alpha1.Project, error)

UpdateProject updates a project with the given tenant name and project name. If updated successfully, return the updated project.

func UpdateResource

func UpdateResource(ctx context.Context, project, resource, tenant string, rsc *v1alpha1.Resource) (*v1alpha1.Resource, error)

UpdateResource ...

func UpdateResourceType added in v0.9.6

func UpdateResourceType(ctx context.Context, tenant string, resourceType string, resource *v1alpha1.Resource) (*v1alpha1.Resource, error)

UpdateResourceType ...

func UpdateStage

func UpdateStage(ctx context.Context, project, stage, tenant string, stg *v1alpha1.Stage) (*v1alpha1.Stage, error)

UpdateStage ...

func UpdateTemplate

func UpdateTemplate(ctx context.Context, tenant, template string, stage *v1alpha1.Stage) (*v1alpha1.Stage, error)

UpdateTemplate updates a stage templates with the given tenant name and template name. If updated successfully, return the updated template.

func UpdateTenant

func UpdateTenant(ctx context.Context, name string, newTenant *api.Tenant) (*api.Tenant, error)

UpdateTenant updates information for a specific tenant

func UpdateWorkflow

func UpdateWorkflow(ctx context.Context, tenant, project, workflow string, wf *v1alpha1.Workflow) (*v1alpha1.Workflow, error)

UpdateWorkflow ...

func UpdateWorkflowRun

func UpdateWorkflowRun(ctx context.Context, project, workflow, workflowrun, tenant string, wfr *v1alpha1.WorkflowRun) (*v1alpha1.WorkflowRun, error)

UpdateWorkflowRun ...

func UpdateWorkflowTrigger

func UpdateWorkflowTrigger(ctx context.Context, tenant, project, workflow, workflowtrigger string, wft *v1alpha1.WorkflowTrigger) (*v1alpha1.WorkflowTrigger, error)

UpdateWorkflowTrigger ...

func WorkflowTrggerSVNModifier added in v1.0.0

func WorkflowTrggerSVNModifier(tenant, project, wf string, object interface{}) error

WorkflowTrggerSVNModifier is a modifier of SVN post commit workflowTrigger. It will add rootURL and SVN repo UUID to workflowTrigger.

Types

type CreationModifier

type CreationModifier func(tenant, project, wf string, object interface{}) error

CreationModifier is used in creating cyclone resources. It's used to modify cyclone resources.

type GetMetadata

type GetMetadata func(string, string) (meta_v1.ObjectMeta, error)

GetMetadata gets metadata of a type of k8s resources

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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