pipelineschedules

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package pipelineschedules implements MCP tools for GitLab pipeline schedule operations.

The package wraps the GitLab Pipeline schedules API:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionSpecs

func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec

ActionSpecs returns canonical specs for pipeline schedule actions.

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.

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)"`
	Inputs       []InputObject        `json:"inputs,omitempty"        jsonschema:"Pipeline inputs to seed on the schedule; each entry has name and value"`
}

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 when creating a schedule variable,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 when editing a schedule variable,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 InputObject added in v2.3.0

type InputObject struct {
	Name    string `json:"name"             jsonschema:"Pipeline input name (must match a defined input on the target pipeline)"`
	Value   any    `json:"value,omitempty"  jsonschema:"Pipeline input value; type depends on the input definition"`
	Destroy *bool  `json:"destroy,omitempty" jsonschema:"Set true to delete this input from the schedule (only honored on update)"`
}

InputObject mirrors gl.PipelineInput, the pipeline inputs embedded on a pipeline schedule payload and accepted on create/edit.

type LastPipelineOutput added in v2.3.0

type LastPipelineOutput struct {
	ID     int64  `json:"id"`
	SHA    string `json:"sha"`
	Ref    string `json:"ref"`
	Status string `json:"status"`
}

LastPipelineOutput is a documented reference subset per doc/api/pipeline_schedules.md. It mirrors gl.LastPipeline (the last pipeline run by a schedule, returned only on the single-schedule get operation), limited to the fields the official API documents for the `last_pipeline` reference: id, sha, ref, status. The SDK's web_url field is intentionally omitted because the documented response does not include it.

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"`
	OrderBy   string               `json:"order_by,omitempty" jsonschema:"Column to order keyset-paginated results by (e.g. id)"`
	Sort      string               `json:"sort,omitempty"     jsonschema:"Sort order for keyset pagination: asc or desc"`
	toolutil.PaginationInput
	toolutil.KeysetPaginationInput
}

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"`
	OrderBy    string               `json:"order_by,omitempty" jsonschema:"Column to order results by (e.g. id)"`
	Sort       string               `json:"sort,omitempty"     jsonschema:"Sort direction for triggered pipelines: asc or desc (default asc)"`
	toolutil.PaginationInput
	toolutil.KeysetPaginationInput
}

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"`
	Owner        *OwnerOutput        `json:"owner,omitempty"`
	LastPipeline *LastPipelineOutput `json:"last_pipeline,omitempty"`
	Variables    []VariableObject    `json:"variables,omitempty"`
	Inputs       []InputObject       `json:"inputs,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 OwnerOutput added in v2.3.0

type OwnerOutput struct {
	ID        int64  `json:"id"`
	Username  string `json:"username"`
	Name      string `json:"name"`
	State     string `json:"state"`
	AvatarURL string `json:"avatar_url"`
	WebURL    string `json:"web_url"`
}

OwnerOutput is a documented reference subset per doc/api/pipeline_schedules.md. It mirrors gl.User (the owner object embedded on a pipeline schedule) limited to the user-reference fields the official API documents for the `owner` reference: id, username, name, state, avatar_url, web_url. The full gl.User shape carries many unrelated account fields that the documented response does not include.

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"`
	ProjectID int    `json:"project_id"`
	Ref       string `json:"ref"`
	SHA       string `json:"sha"`
	Status    string `json:"status"`
	Source    string `json:"source"`
	WebURL    string `json:"web_url"`
	CreatedAt string `json:"created_at,omitempty"`
	UpdatedAt string `json:"updated_at,omitempty"`
}

TriggeredPipelineOutput is a documented reference subset per doc/api/pipeline_schedules.md. It represents a pipeline triggered by a schedule, limited to the fields the official "List all pipelines triggered by a pipeline schedule" response documents: id, iid, project_id, status, source, ref, sha, web_url, created_at, updated_at.

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"`
	Inputs       []InputObject        `` /* 132-byte string literal not displayed */
}

UpdateInput contains parameters for editing a pipeline schedule.

type VariableObject added in v2.3.0

type VariableObject struct {
	Key          string `json:"key"`
	Value        string `json:"value"`
	VariableType string `json:"variable_type"`
	Raw          bool   `json:"raw,omitempty"`
}

VariableObject is a documented reference subset per doc/api/pipeline_schedules.md. It mirrors gl.PipelineVariable, the variables embedded on a pipeline schedule payload (key, value, variable_type), plus the documented `raw` boolean that gl.PipelineVariable does not expose. The `raw` field is surfaced via a raw REST superset fetch (see rawScheduleAPI) rather than the SDK wrapper, and is omitted when the instance does not report it.

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