clusteragents

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package clusteragents implements MCP tools for GitLab Kubernetes cluster agent operations.

The package wraps the GitLab Cluster agents 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 cluster agent tools.

func DeleteAgent

func DeleteAgent(ctx context.Context, client *gitlabclient.Client, input DeleteAgentInput) error

DeleteAgent deletes agent for the clusteragents package.

func DeleteAgentOutput

func DeleteAgentOutput(ctx context.Context, client *gitlabclient.Client, input DeleteAgentInput) (toolutil.DeleteOutput, error)

DeleteAgentOutput deletes a cluster agent and returns the canonical success message shape.

func FormatAgentMarkdown

func FormatAgentMarkdown(a AgentItem) string

FormatAgentMarkdown renders a single cluster agent summary.

func FormatAgentsListMarkdown

func FormatAgentsListMarkdown(out ListAgentsOutput) string

FormatAgentsListMarkdown renders cluster agents as a compact Markdown table.

func FormatTokenMarkdown

func FormatTokenMarkdown(t AgentTokenItem) string

FormatTokenMarkdown renders a single cluster agent token summary.

func FormatTokensListMarkdown

func FormatTokensListMarkdown(out ListAgentTokensOutput) string

FormatTokensListMarkdown renders cluster agent tokens as a compact Markdown table.

func RevokeAgentToken

func RevokeAgentToken(ctx context.Context, client *gitlabclient.Client, input RevokeAgentTokenInput) error

RevokeAgentToken revokes agent token for the clusteragents package.

func RevokeAgentTokenOutput

func RevokeAgentTokenOutput(ctx context.Context, client *gitlabclient.Client, input RevokeAgentTokenInput) (toolutil.DeleteOutput, error)

RevokeAgentTokenOutput revokes a cluster agent token and returns the canonical success message shape.

Types

type AgentItem

type AgentItem struct {
	toolutil.HintableOutput
	ID              int64  `json:"id"`
	Name            string `json:"name"`
	CreatedByUserID int64  `json:"created_by_user_id,omitempty"`
}

AgentItem holds agent item data for the clusteragents package.

func GetAgent

func GetAgent(ctx context.Context, client *gitlabclient.Client, input GetAgentInput) (AgentItem, error)

GetAgent retrieves agent for the clusteragents package.

func RegisterAgent

func RegisterAgent(ctx context.Context, client *gitlabclient.Client, input RegisterAgentInput) (AgentItem, error)

RegisterAgent coordinates register agent for the clusteragents package.

type AgentTokenItem

type AgentTokenItem struct {
	toolutil.HintableOutput
	ID          int64  `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	AgentID     int64  `json:"agent_id"`
	Status      string `json:"status"`
	Token       string `json:"token,omitempty"`
}

AgentTokenItem holds agent token item data for the clusteragents package.

func CreateAgentToken

func CreateAgentToken(ctx context.Context, client *gitlabclient.Client, input CreateAgentTokenInput) (AgentTokenItem, error)

CreateAgentToken creates agent token for the clusteragents package.

func GetAgentToken

func GetAgentToken(ctx context.Context, client *gitlabclient.Client, input GetAgentTokenInput) (AgentTokenItem, error)

GetAgentToken retrieves agent token for the clusteragents package.

type CreateAgentTokenInput

type CreateAgentTokenInput struct {
	ProjectID   toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	AgentID     int64                `json:"agent_id" jsonschema:"Agent ID,required"`
	Name        string               `json:"name" jsonschema:"Token name,required"`
	Description string               `json:"description" jsonschema:"Token description"`
}

CreateAgentTokenInput defines parameters for the create agent token operation.

type DeleteAgentInput

type DeleteAgentInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	AgentID   int64                `json:"agent_id" jsonschema:"Agent ID,required"`
}

DeleteAgentInput defines parameters for the delete agent operation.

type GetAgentInput

type GetAgentInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	AgentID   int64                `json:"agent_id" jsonschema:"Agent ID,required"`
}

GetAgentInput defines parameters for the get agent operation.

type GetAgentTokenInput

type GetAgentTokenInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	AgentID   int64                `json:"agent_id" jsonschema:"Agent ID,required"`
	TokenID   int64                `json:"token_id" jsonschema:"Token ID,required"`
}

GetAgentTokenInput defines parameters for the get agent token operation.

type ListAgentTokensInput

type ListAgentTokensInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	AgentID   int64                `json:"agent_id" jsonschema:"Agent ID,required"`
	Page      int64                `json:"page" jsonschema:"Page number for pagination"`
	PerPage   int64                `json:"per_page" jsonschema:"Number of items per page"`
}

ListAgentTokensInput defines parameters for the list agent tokens operation.

type ListAgentTokensOutput

type ListAgentTokensOutput struct {
	toolutil.HintableOutput
	Tokens     []AgentTokenItem          `json:"tokens"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

ListAgentTokensOutput represents the response from the list agent tokens operation.

func ListAgentTokens

func ListAgentTokens(ctx context.Context, client *gitlabclient.Client, input ListAgentTokensInput) (ListAgentTokensOutput, error)

ListAgentTokens lists agent tokens for the clusteragents package.

type ListAgentsInput

type ListAgentsInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	Page      int64                `json:"page" jsonschema:"Page number for pagination"`
	PerPage   int64                `json:"per_page" jsonschema:"Number of items per page"`
}

ListAgentsInput defines parameters for the list agents operation.

type ListAgentsOutput

type ListAgentsOutput struct {
	toolutil.HintableOutput
	Agents     []AgentItem               `json:"agents"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

ListAgentsOutput represents the response from the list agents operation.

func ListAgents

func ListAgents(ctx context.Context, client *gitlabclient.Client, input ListAgentsInput) (ListAgentsOutput, error)

ListAgents lists agents for the clusteragents package.

type RegisterAgentInput

type RegisterAgentInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	Name      string               `json:"name" jsonschema:"Agent name,required"`
}

RegisterAgentInput defines parameters for the register agent operation.

type RevokeAgentTokenInput

type RevokeAgentTokenInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	AgentID   int64                `json:"agent_id" jsonschema:"Agent ID,required"`
	TokenID   int64                `json:"token_id" jsonschema:"Token ID,required"`
}

RevokeAgentTokenInput defines parameters for the revoke agent token operation.

Jump to

Keyboard shortcuts

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