v1alpha1

package
v0.9.3-beta.1 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2019 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseClusterForTenant

func CloseClusterForTenant(cluster *api.ClusterSource, tenant string) error

CloseClusterForTenant close worker cluster for the tenant. It is dangerous since all pvc data will lost.

func ContinueWorkflowRun

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

ContinueWorkflowRun updates the workflowrun overall status to Running.

func CreateAdminTenant

func CreateAdminTenant() error

CreateAdminTenant creates cyclone admin tenant and initialize the tenant: - Create namespace - Create PVC - Load and create stage templates

func CreateIntegration

func CreateIntegration(ctx context.Context, tenant string, in *api.Integration) (*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 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 'cyclone.io/stage-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, project, tenant 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, project, tenant string, wft *v1alpha1.WorkflowTrigger) (*v1alpha1.WorkflowTrigger, error)

CreateWorkflowTrigger ...

func DeleteIntegration

func DeleteIntegration(ctx context.Context, tenant, name string) 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 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, project, workflow, tenant string) error

DeleteWorkflow ...

func DeleteWorkflowRun

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

DeleteWorkflowRun ...

func DeleteWorkflowTrigger

func DeleteWorkflowTrigger(ctx context.Context, project, workflowtrigger, tenant 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, container string) error

GetContainerLogStream gets real-time log of container within stage.

func GetContainerLogs

func GetContainerLogs(ctx context.Context, project, workflow, workflowrun, tenant, stage, container string, download bool) ([]byte, 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) (*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 GetResource

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

GetResource ...

func GetStage

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

GetStage ...

func GetTemplate

func GetTemplate(ctx context.Context, tenant, template string, includePublic bool) (*v1alpha1.Stage, 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 GetWokerClusters

func GetWokerClusters(tenant string) ([]api.Integration, error)

GetWokerClusters gets all clusters which are use to perform workload

func GetWorkflow

func GetWorkflow(ctx context.Context, project, workflow, tenant 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, project, workflowtrigger, tenant string) (*v1alpha1.WorkflowTrigger, error)

GetWorkflowTrigger ...

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 LabelCustomizedTemplate

func LabelCustomizedTemplate(stage *v1alpha1.Stage)

LabelCustomizedTemplate gives a label to indicate that this is a customized template

func LabelStageTemplate

func LabelStageTemplate(stage *v1alpha1.Stage)

LabelStageTemplate gives a label to indicate that this stage is a stage template

func ListIntegrations

func ListIntegrations(ctx context.Context, tenant string, pagination *types.Pagination) (*types.ListResponse, error)

ListIntegrations get integrations the given tenant has access to. - ctx Context of the reqeust - tenant Tenant - pagination Pagination with page and limit.

func ListProjects

func ListProjects(ctx context.Context, tenant string, pagination *types.Pagination) (*types.ListResponse, error)

ListProjects list projects the given tenant has access to. - ctx Context of the reqeust - tenant Tenant - pagination Pagination with page and limit.

func ListResources

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

ListResources ...

func ListStages

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

ListStages ...

func ListTemplates

func ListTemplates(ctx context.Context, tenant string, includePublic bool, pagination *types.Pagination) (*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 - pagination Pagination with page and limit.

func ListTenants

func ListTenants(ctx context.Context, pagination *types.Pagination) (*types.ListResponse, error)

ListTenants list all tenants' information

func ListWorkflowRuns

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

ListWorkflowRuns ...

func ListWorkflowTriggers

func ListWorkflowTriggers(ctx context.Context, project, tenant string, pagination *types.Pagination) (*types.ListResponse, error)

ListWorkflowTriggers ...

func ListWorkflows

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

ListWorkflows ...

func NamespaceToTenant

func NamespaceToTenant(namespace *core_v1.Namespace) (*api.Tenant, error)

NamespaceToTenant trans namespace to tenant

func OpenClusterForTenant

func OpenClusterForTenant(cluster *api.ClusterSource, tenantName string) error

OpenClusterForTenant opens cluster to run workload.

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, project, workflow, workflowrun, tenant, stage, container string) error

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

func SecretToIntegration

func SecretToIntegration(secret *core_v1.Secret) (*api.Integration, error)

SecretToIntegration translates secret to integration

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 UpdateAnnotations

func UpdateAnnotations(oldm, newm map[string]string) map[string]string

UpdateAnnotations updates alias and description annotations

func UpdateIntegration

func UpdateIntegration(ctx context.Context, tenant, name string, 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 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, project, workflow, tenant 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, project, workflowtrigger, tenant string, wft *v1alpha1.WorkflowTrigger) (*v1alpha1.WorkflowTrigger, error)

UpdateWorkflowTrigger ...

func WorkflowRunModifier

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

WorkflowRunModifier is a modifier of create cyclone workflowrun resources. It will add workflow labels for workflowrun.

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

Jump to

Keyboard shortcuts

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