alertmanagement

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package alertmanagement implements MCP tools for GitLab alert management operations.

The package wraps the GitLab Alert Management 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 alert metric image tools.

func DeleteMetricImage

func DeleteMetricImage(ctx context.Context, client *gitlabclient.Client, input DeleteMetricImageInput) error

DeleteMetricImage deletes a metric image for an alert.

func FormatImageMarkdown

func FormatImageMarkdown(img MetricImageItem) string

FormatImageMarkdown formats a single metric image as markdown.

func FormatListMarkdown

func FormatListMarkdown(out ListMetricImagesOutput) string

FormatListMarkdown formats metric images as markdown.

Types

type DeleteMetricImageInput

type DeleteMetricImageInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	AlertIID  int64                `json:"alert_iid" jsonschema:"Alert IID,required"`
	ImageID   int64                `json:"image_id" jsonschema:"Metric image ID,required"`
}

DeleteMetricImageInput contains parameters for deleting a metric image.

type ListMetricImagesInput

type ListMetricImagesInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	AlertIID  int64                `json:"alert_iid" jsonschema:"Alert IID,required"`
	// OrderBy names the column used to order keyset-paginated results.
	OrderBy string `json:"order_by,omitempty" jsonschema:"Column to order keyset-paginated results by (e.g. created_at, id)"`
	// Sort selects the sort direction for ordered results.
	Sort string `json:"sort,omitempty" jsonschema:"Sort direction (asc or desc)"`
	toolutil.PaginationInput
	toolutil.KeysetPaginationInput
}

ListMetricImagesInput contains parameters for listing alert metric images.

type ListMetricImagesOutput

type ListMetricImagesOutput struct {
	toolutil.HintableOutput
	Images     []MetricImageItem         `json:"images"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

ListMetricImagesOutput contains a list of metric images.

func ListMetricImages

func ListMetricImages(ctx context.Context, client *gitlabclient.Client, input ListMetricImagesInput) (ListMetricImagesOutput, error)

ListMetricImages retrieves metric images for an alert.

type MetricImageItem

type MetricImageItem struct {
	toolutil.HintableOutput
	ID        int64  `json:"id"`
	CreatedAt string `json:"created_at,omitempty"`
	Filename  string `json:"filename"`
	FilePath  string `json:"file_path"`
	URL       string `json:"url"`
	URLText   string `json:"url_text"`
}

MetricImageItem represents a single metric image.

func UpdateMetricImage

func UpdateMetricImage(ctx context.Context, client *gitlabclient.Client, input UpdateMetricImageInput) (MetricImageItem, error)

UpdateMetricImage updates a metric image for an alert.

func UploadMetricImage

func UploadMetricImage(ctx context.Context, client *gitlabclient.Client, input UploadMetricImageInput) (MetricImageItem, error)

UploadMetricImage uploads a metric image for an alert.

type UpdateMetricImageInput

type UpdateMetricImageInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	AlertIID  int64                `json:"alert_iid" jsonschema:"Alert IID,required"`
	ImageID   int64                `json:"image_id" jsonschema:"Metric image ID,required"`
	URL       *string              `json:"url" jsonschema:"URL to link the metric image to"`
	URLText   *string              `json:"url_text" jsonschema:"Text for the URL link"`
}

UpdateMetricImageInput contains parameters for updating a metric image.

type UploadMetricImageInput

type UploadMetricImageInput struct {
	ProjectID     toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	AlertIID      int64                `json:"alert_iid" jsonschema:"Alert IID,required"`
	FilePathLocal string               `` /* 196-byte string literal not displayed */
	ContentBase64 string               `` /* 134-byte string literal not displayed */
	Filename      string               `json:"filename" jsonschema:"Image filename,required"`
	URL           *string              `json:"url" jsonschema:"URL to link the metric image to"`
	URLText       *string              `json:"url_text" jsonschema:"Text for the URL link"`
}

UploadMetricImageInput contains parameters for uploading a metric image. Exactly one of FilePath or ContentBase64 must be provided.

Jump to

Keyboard shortcuts

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