compute

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package compute provides handler functions for Azure compute resource tools.

Index

Constants

View Source
const (
	// VM operations - safe operations only
	OpVMShow            ComputeOperationType = "show"
	OpVMList            ComputeOperationType = "list"
	OpVMStart           ComputeOperationType = "start"
	OpVMStop            ComputeOperationType = "stop"
	OpVMRestart         ComputeOperationType = "restart"
	OpVMGetInstanceView ComputeOperationType = "get-instance-view"

	// VMSS operations - only safe operations for AKS-managed VMSS
	OpVMSSShow            ComputeOperationType = "show"
	OpVMSSList            ComputeOperationType = "list"
	OpVMSSRestart         ComputeOperationType = "restart"
	OpVMSSReimage         ComputeOperationType = "reimage"
	OpVMSSGetInstanceView ComputeOperationType = "get-instance-view"

	// Resource types
	ResourceTypeVM   ResourceType = "vm"
	ResourceTypeVMSS ResourceType = "vmss"
)

Variables

This section is empty.

Functions

func GetAKSVMSSInfoHandler

func GetAKSVMSSInfoHandler(client *azureclient.AzureClient, cfg *config.ConfigData) tools.ResourceHandler

GetAKSVMSSInfoHandler returns a handler for the get_aks_vmss_info command

func GetNodePoolsFromAKS

func GetNodePoolsFromAKS(
	ctx context.Context,
	cluster *armcontainerservice.ManagedCluster,
	client *azureclient.AzureClient,
) ([]*armcontainerservice.ManagedClusterAgentPoolProfile, error)

GetNodePoolsFromAKS extracts all node pools from an AKS cluster

func GetOperationAccessLevel added in v0.0.6

func GetOperationAccessLevel(operation string) string

GetOperationAccessLevel returns the required access level for an operation

func GetVMSSIDFromNodePool

func GetVMSSIDFromNodePool(
	ctx context.Context,
	cluster *armcontainerservice.ManagedCluster,
	nodePoolName string,
	client *azureclient.AzureClient,
) (string, error)

GetVMSSIDFromNodePool extracts the VMSS resource ID from a node pool

func GetVMSSInstancesFromNodePool

func GetVMSSInstancesFromNodePool(
	ctx context.Context,
	cluster *armcontainerservice.ManagedCluster,
	nodePoolName string,
	client *azureclient.AzureClient,
) ([]interface{}, error)

GetVMSSInstancesFromNodePool gets VM instances from a VMSS for a specific node pool

func MapOperationToCommand added in v0.0.6

func MapOperationToCommand(operation string, resourceType string) (string, error)

MapOperationToCommand maps an operation and resource type to its corresponding az command

func RegisterAKSVMSSInfoTool

func RegisterAKSVMSSInfoTool() mcp.Tool

RegisterAKSVMSSInfoTool registers the get_aks_vmss_info tool

func RegisterAzComputeOperations added in v0.0.6

func RegisterAzComputeOperations(cfg *config.ConfigData) mcp.Tool

RegisterAzComputeOperations registers the unified compute operations tool

func ValidateOperationAccess added in v0.0.6

func ValidateOperationAccess(operation string, cfg *config.ConfigData) error

ValidateOperationAccess checks if the operation is allowed for the given access level

Types

type ComputeOperationType added in v0.0.6

type ComputeOperationType string

ComputeOperationType defines the type of compute operation

type ComputeOperationsExecutor added in v0.0.6

type ComputeOperationsExecutor struct{}

ComputeOperationsExecutor handles execution of compute operations

func NewComputeOperationsExecutor added in v0.0.6

func NewComputeOperationsExecutor() *ComputeOperationsExecutor

NewComputeOperationsExecutor creates a new ComputeOperationsExecutor

func (*ComputeOperationsExecutor) Execute added in v0.0.6

func (e *ComputeOperationsExecutor) Execute(params map[string]interface{}, cfg *config.ConfigData) (string, error)

Execute handles the compute operations

type ResourceType added in v0.0.6

type ResourceType string

ResourceType defines the compute resource type

Jump to

Keyboard shortcuts

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