resource

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterResourceTools

func RegisterResourceTools(s *mcpserver.MCPServer, sc *server.ServerContext) error

RegisterResourceTools registers all resource management tools with the MCP server

Types

type ApplyResourceArgs

type ApplyResourceArgs struct {
	KubeContext string      `json:"kubeContext,omitempty"`
	Namespace   string      `json:"namespace"`
	Manifest    interface{} `json:"manifest"`
}

ApplyResourceArgs defines the arguments for kubectl apply operations

type CreateResourceArgs

type CreateResourceArgs struct {
	KubeContext string      `json:"kubeContext,omitempty"`
	Namespace   string      `json:"namespace"`
	Manifest    interface{} `json:"manifest"`
}

CreateResourceArgs defines the arguments for kubectl create operations

type DeleteResourceArgs

type DeleteResourceArgs struct {
	KubeContext  string `json:"kubeContext,omitempty"`
	Namespace    string `json:"namespace"`
	ResourceType string `json:"resourceType"`
	Name         string `json:"name"`
}

DeleteResourceArgs defines the arguments for kubectl delete operations

type DescribeResourceArgs

type DescribeResourceArgs struct {
	KubeContext  string `json:"kubeContext,omitempty"`
	Namespace    string `json:"namespace"`
	ResourceType string `json:"resourceType"`
	Name         string `json:"name"`
}

DescribeResourceArgs defines the arguments for kubectl describe operations

type GetResourceArgs

type GetResourceArgs struct {
	KubeContext  string `json:"kubeContext,omitempty"`
	Namespace    string `json:"namespace"`
	ResourceType string `json:"resourceType"`
	Name         string `json:"name"`
}

GetResourceArgs defines the arguments for kubectl get operations

type ListResourceArgs

type ListResourceArgs struct {
	KubeContext        string `json:"kubeContext,omitempty"`
	Namespace          string `json:"namespace"`
	ResourceType       string `json:"resourceType"`
	LabelSelector      string `json:"labelSelector,omitempty"`
	FieldSelector      string `json:"fieldSelector,omitempty"`
	AllNamespaces      bool   `json:"allNamespaces,omitempty"`
	FullOutput         bool   `json:"fullOutput,omitempty"`
	IncludeLabels      bool   `json:"includeLabels,omitempty"`
	IncludeAnnotations bool   `json:"includeAnnotations,omitempty"`
	Limit              int64  `json:"limit,omitempty"`
	Continue           string `json:"continue,omitempty"`
}

ListResourceArgs defines the arguments for kubectl list operations

type ListSummaryResponse added in v0.0.11

type ListSummaryResponse struct {
	Kind     string            `json:"kind"`
	Items    []ResourceSummary `json:"items"`
	Total    int               `json:"total"`
	Metadata map[string]string `json:"metadata,omitempty"`
}

ListSummaryResponse contains the summarized list of resources

func SummarizeResources added in v0.0.11

func SummarizeResources(objects []runtime.Object, includeLabels, includeAnnotations bool) *ListSummaryResponse

SummarizeResources converts a list of runtime.Objects to compact ResourceSummary objects

type PaginatedSummaryResponse added in v0.0.17

type PaginatedSummaryResponse struct {
	Kind            string                 `json:"kind"`
	Items           []ResourceSummary      `json:"items"`
	Continue        string                 `json:"continue,omitempty"`        // Token for next page
	RemainingItems  *int64                 `json:"remainingItems,omitempty"`  // Estimated remaining items (if available)
	ResourceVersion string                 `json:"resourceVersion,omitempty"` // Resource version for consistency
	TotalItems      int                    `json:"totalItems"`                // Number of items in this response
	Metadata        map[string]interface{} `json:"metadata,omitempty"`
}

PaginatedSummaryResponse contains a paginated list of summarized resources with metadata

func SummarizePaginatedResources added in v0.0.17

func SummarizePaginatedResources(objects []runtime.Object, includeLabels, includeAnnotations bool, continue_ string, resourceVersion string, remainingItems *int64) *PaginatedSummaryResponse

SummarizePaginatedResources converts a paginated list of runtime.Objects to compact ResourceSummary objects

type PatchResourceArgs

type PatchResourceArgs struct {
	KubeContext  string      `json:"kubeContext,omitempty"`
	Namespace    string      `json:"namespace"`
	ResourceType string      `json:"resourceType"`
	Name         string      `json:"name"`
	PatchType    string      `json:"patchType"`
	Patch        interface{} `json:"patch"`
}

PatchResourceArgs defines the arguments for kubectl patch operations

type ResourceSummary added in v0.0.11

type ResourceSummary struct {
	Name              string            `json:"name"`
	Namespace         string            `json:"namespace,omitempty"`
	Kind              string            `json:"kind"`
	APIVersion        string            `json:"apiVersion"`
	CreationTimestamp string            `json:"creationTimestamp"`
	Age               string            `json:"age"`
	Status            string            `json:"status,omitempty"`
	Ready             string            `json:"ready,omitempty"`
	Labels            map[string]string `json:"labels,omitempty"`
	Annotations       map[string]string `json:"annotations,omitempty"`
	// Additional fields specific to resource types
	Extra map[string]interface{} `json:"extra,omitempty"`
}

ResourceSummary represents a compact view of a Kubernetes resource

type ScaleResourceArgs

type ScaleResourceArgs struct {
	KubeContext  string `json:"kubeContext,omitempty"`
	Namespace    string `json:"namespace"`
	ResourceType string `json:"resourceType"`
	Name         string `json:"name"`
	Replicas     int32  `json:"replicas"`
}

ScaleResourceArgs defines the arguments for kubectl scale operations

Jump to

Keyboard shortcuts

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