instancevariables

package
v1.0.5 Latest Latest
Warning

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

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

Documentation

Overview

Package instancevariables implements GitLab instance-level CI/CD variable operations including list, get, create, update, and delete.

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 removes an instance-level CI/CD variable by key.

func FormatListMarkdown

func FormatListMarkdown(out ListOutput) string

FormatListMarkdown renders a paginated list of instance CI/CD variables as a Markdown table.

func FormatOutputMarkdown

func FormatOutputMarkdown(v Output) string

FormatOutputMarkdown renders a single instance CI/CD variable as Markdown.

func RegisterMeta

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

RegisterMeta registers the gitlab_instance_variable meta-tool.

func RegisterTools

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

RegisterTools registers the five instance CI/CD variable management tools with the MCP server.

Types

type CreateInput

type CreateInput struct {
	Key          string `json:"key"                        jsonschema:"Variable key name,required"`
	Value        string `json:"value"                      jsonschema:"Variable value"`
	Description  string `json:"description,omitempty"      jsonschema:"Variable description"`
	VariableType string `json:"variable_type,omitempty"    jsonschema:"Variable type: env_var or file"`
	Protected    *bool  `json:"protected,omitempty"        jsonschema:"Only expose in protected branches/tags"`
	Masked       *bool  `json:"masked,omitempty"           jsonschema:"Mask variable value in job logs"`
	Raw          *bool  `json:"raw,omitempty"              jsonschema:"Treat variable value as raw string"`
}

CreateInput holds parameters for creating an instance CI/CD variable.

type DeleteInput

type DeleteInput struct {
	Key string `json:"key" jsonschema:"Variable key name,required"`
}

DeleteInput holds parameters for deleting an instance CI/CD variable.

type GetInput

type GetInput struct {
	Key string `json:"key" jsonschema:"Variable key name,required"`
}

GetInput holds parameters for retrieving a single instance CI/CD variable.

type ListInput

type ListInput struct {
	toolutil.PaginationInput
}

ListInput holds parameters for listing instance CI/CD variables.

type ListOutput

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

ListOutput represents a paginated list of instance CI/CD variables.

func List

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

List retrieves a paginated list of instance-level CI/CD variables.

type Output

type Output struct {
	toolutil.HintableOutput
	Key          string `json:"key"`
	Value        string `json:"value"`
	VariableType string `json:"variable_type"`
	Protected    bool   `json:"protected"`
	Masked       bool   `json:"masked"`
	Raw          bool   `json:"raw"`
	Description  string `json:"description"`
}

Output represents a single instance CI/CD variable.

func Create

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

Create creates a new instance-level CI/CD variable.

func Get

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

Get retrieves a single instance-level CI/CD variable by key.

func Update

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

Update modifies an existing instance-level CI/CD variable.

type UpdateInput

type UpdateInput struct {
	Key          string `json:"key"                        jsonschema:"Variable key name,required"`
	Value        string `json:"value,omitempty"            jsonschema:"Updated variable value"`
	Description  string `json:"description,omitempty"      jsonschema:"Updated variable description"`
	VariableType string `json:"variable_type,omitempty"    jsonschema:"Variable type: env_var or file"`
	Protected    *bool  `json:"protected,omitempty"        jsonschema:"Only expose in protected branches/tags"`
	Masked       *bool  `json:"masked,omitempty"           jsonschema:"Mask variable value in job logs"`
	Raw          *bool  `json:"raw,omitempty"              jsonschema:"Treat variable value as raw string"`
}

UpdateInput holds parameters for updating an instance CI/CD variable.

Jump to

Keyboard shortcuts

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