pipelineschedules

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package pipelineschedules implements MCP tool handlers for GitLab pipeline schedule operations including list, get, create, update, delete, run, and schedule variable management via the PipelineSchedules API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) error

Delete deletes resources for the pipelineschedules package.

func DeleteVariable

func DeleteVariable(ctx context.Context, client *gitlabclient.Client, input DeleteVariableInput) error

DeleteVariable deletes a pipeline schedule variable by key.

func FormatListMarkdown

func FormatListMarkdown(out ListOutput) string

FormatListMarkdown renders a paginated list of pipeline schedules as a Markdown table.

func FormatOutputMarkdown

func FormatOutputMarkdown(s Output) string

FormatOutputMarkdown renders a single pipeline schedule as Markdown.

func FormatTriggeredPipelinesMarkdown

func FormatTriggeredPipelinesMarkdown(out TriggeredPipelinesListOutput) string

FormatTriggeredPipelinesMarkdown renders a list of triggered pipelines as Markdown.

func FormatVariableMarkdown

func FormatVariableMarkdown(v VariableOutput) string

FormatVariableMarkdown renders a pipeline schedule variable as Markdown.

func RegisterTools

func RegisterTools(server *mcp.Server, client *gitlab.Client)

RegisterTools registers the six pipeline schedule management tools with the MCP server.

Types

type CreateInput

type CreateInput struct {
	ProjectID    toolutil.StringOrInt `json:"project_id"              jsonschema:"Project ID or URL-encoded path,required"`
	Description  string               `json:"description"             jsonschema:"Schedule description,required"`
	Ref          string               `json:"ref"                     jsonschema:"Branch or tag to run the pipeline on,required"`
	Cron         string               `json:"cron"                    jsonschema:"Cron expression (e.g. 0 1 * * *),required"`
	CronTimezone string               `json:"cron_timezone,omitempty" jsonschema:"Cron timezone (e.g. UTC or America/New_York)"`
	Active       *bool                `json:"active,omitempty"        jsonschema:"Whether the schedule is active (default: true)"`
}

CreateInput contains parameters for creating a pipeline schedule.

type CreateVariableInput

type CreateVariableInput struct {
	ProjectID    toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	ScheduleID   int                  `json:"schedule_id" jsonschema:"Pipeline schedule ID,required"`
	Key          string               `json:"key" jsonschema:"Variable key,required"`
	Value        string               `json:"value" jsonschema:"Variable value,required"`
	VariableType string               `json:"variable_type,omitempty" jsonschema:"Variable type: env_var (default) or file"`
}

CreateVariableInput defines parameters for creating a pipeline schedule variable.

type DeleteInput

type DeleteInput struct {
	ProjectID  toolutil.StringOrInt `json:"project_id"   jsonschema:"Project ID or URL-encoded path,required"`
	ScheduleID int                  `json:"schedule_id"  jsonschema:"Pipeline schedule ID,required"`
}

DeleteInput contains parameters for deleting a pipeline schedule.

type DeleteVariableInput

type DeleteVariableInput struct {
	ProjectID  toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	ScheduleID int                  `json:"schedule_id" jsonschema:"Pipeline schedule ID,required"`
	Key        string               `json:"key" jsonschema:"Variable key to delete,required"`
}

DeleteVariableInput defines parameters for deleting a pipeline schedule variable.

type EditVariableInput

type EditVariableInput struct {
	ProjectID    toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	ScheduleID   int                  `json:"schedule_id" jsonschema:"Pipeline schedule ID,required"`
	Key          string               `json:"key" jsonschema:"Variable key to edit,required"`
	Value        string               `json:"value" jsonschema:"New variable value,required"`
	VariableType string               `json:"variable_type,omitempty" jsonschema:"Variable type: env_var or file"`
}

EditVariableInput defines parameters for editing a pipeline schedule variable.

type GetInput

type GetInput struct {
	ProjectID  toolutil.StringOrInt `json:"project_id"   jsonschema:"Project ID or URL-encoded path,required"`
	ScheduleID int                  `json:"schedule_id"  jsonschema:"Pipeline schedule ID,required"`
}

GetInput contains parameters for retrieving a single pipeline schedule.

type ListInput

type ListInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id"       jsonschema:"Project ID or URL-encoded path,required"`
	Scope     string               `json:"scope,omitempty"  jsonschema:"Filter by scope: active or inactive"`
	toolutil.PaginationInput
}

ListInput contains parameters for listing pipeline schedules.

type ListOutput

type ListOutput struct {
	toolutil.HintableOutput
	Schedules  []Output                  `json:"schedules"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

ListOutput represents a paginated list of pipeline schedules.

func List

func List(ctx context.Context, client *gitlabclient.Client, input ListInput) (ListOutput, error)

List lists resources for the pipelineschedules package.

type ListTriggeredPipelinesInput

type ListTriggeredPipelinesInput struct {
	ProjectID  toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	ScheduleID int                  `json:"schedule_id" jsonschema:"Pipeline schedule ID,required"`
	Page       int64                `json:"page,omitempty" jsonschema:"Page number for pagination"`
	PerPage    int64                `json:"per_page,omitempty" jsonschema:"Items per page (max 100)"`
}

ListTriggeredPipelinesInput defines parameters for listing pipelines triggered by a schedule.

type Output

type Output struct {
	toolutil.HintableOutput
	ID           int    `json:"id"`
	Description  string `json:"description"`
	Ref          string `json:"ref"`
	Cron         string `json:"cron"`
	CronTimezone string `json:"cron_timezone"`
	NextRunAt    string `json:"next_run_at,omitempty"`
	Active       bool   `json:"active"`
	OwnerName    string `json:"owner_name,omitempty"`
	CreatedAt    string `json:"created_at,omitempty"`
	UpdatedAt    string `json:"updated_at,omitempty"`
}

Output represents a single pipeline schedule in MCP responses.

func Create

func Create(ctx context.Context, client *gitlabclient.Client, input CreateInput) (Output, error)

Create creates resources for the pipelineschedules package.

func Get

func Get(ctx context.Context, client *gitlabclient.Client, input GetInput) (Output, error)

Get retrieves resources for the pipelineschedules package.

func Run

func Run(ctx context.Context, client *gitlabclient.Client, input RunInput) (Output, error)

Run runs resources for the pipelineschedules package.

func TakeOwnership

func TakeOwnership(ctx context.Context, client *gitlabclient.Client, input TakeOwnershipInput) (Output, error)

TakeOwnership takes ownership of a pipeline schedule, making the current user the owner.

func Update

func Update(ctx context.Context, client *gitlabclient.Client, input UpdateInput) (Output, error)

Update updates resources for the pipelineschedules package.

type RunInput

type RunInput struct {
	ProjectID  toolutil.StringOrInt `json:"project_id"   jsonschema:"Project ID or URL-encoded path,required"`
	ScheduleID int                  `json:"schedule_id"  jsonschema:"Pipeline schedule ID,required"`
}

RunInput contains parameters for triggering a pipeline schedule.

type TakeOwnershipInput

type TakeOwnershipInput struct {
	ProjectID  toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	ScheduleID int                  `json:"schedule_id" jsonschema:"Pipeline schedule ID,required"`
}

TakeOwnershipInput defines parameters for taking ownership of a pipeline schedule.

type TriggeredPipelineOutput

type TriggeredPipelineOutput struct {
	ID     int    `json:"id"`
	IID    int    `json:"iid"`
	Ref    string `json:"ref"`
	SHA    string `json:"sha"`
	Status string `json:"status"`
	Source string `json:"source"`
	WebURL string `json:"web_url"`
}

TriggeredPipelineOutput represents a pipeline triggered by a schedule.

type TriggeredPipelinesListOutput

type TriggeredPipelinesListOutput struct {
	toolutil.HintableOutput
	Pipelines  []TriggeredPipelineOutput `json:"pipelines"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

TriggeredPipelinesListOutput represents the paginated result of pipelines triggered by a schedule.

func ListTriggeredPipelines

ListTriggeredPipelines lists all pipelines triggered by a specific schedule.

type UpdateInput

type UpdateInput struct {
	ProjectID    toolutil.StringOrInt `json:"project_id"              jsonschema:"Project ID or URL-encoded path,required"`
	ScheduleID   int                  `json:"schedule_id"             jsonschema:"Pipeline schedule ID,required"`
	Description  string               `json:"description,omitempty"   jsonschema:"Updated description"`
	Ref          string               `json:"ref,omitempty"           jsonschema:"Updated branch or tag"`
	Cron         string               `json:"cron,omitempty"          jsonschema:"Updated cron expression"`
	CronTimezone string               `json:"cron_timezone,omitempty" jsonschema:"Updated cron timezone"`
	Active       *bool                `json:"active,omitempty"        jsonschema:"Enable or disable the schedule"`
}

UpdateInput contains parameters for editing a pipeline schedule.

type VariableOutput

type VariableOutput struct {
	toolutil.HintableOutput
	Key          string `json:"key"`
	Value        string `json:"value"`
	VariableType string `json:"variable_type"`
}

VariableOutput represents a pipeline schedule variable.

func CreateVariable

func CreateVariable(ctx context.Context, client *gitlabclient.Client, input CreateVariableInput) (VariableOutput, error)

CreateVariable creates a new variable for a pipeline schedule.

func EditVariable

func EditVariable(ctx context.Context, client *gitlabclient.Client, input EditVariableInput) (VariableOutput, error)

EditVariable edits an existing pipeline schedule variable.

Jump to

Keyboard shortcuts

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