Documentation
¶
Overview ¶
Package compute provides handler functions for Azure compute resource tools.
Index ¶
- Constants
- func GetAKSVMSSInfoHandler(client *azureclient.AzureClient, cfg *config.ConfigData) tools.ResourceHandler
- func GetNodePoolsFromAKS(ctx context.Context, cluster *armcontainerservice.ManagedCluster, ...) ([]*armcontainerservice.ManagedClusterAgentPoolProfile, error)
- func GetOperationAccessLevel(operation string) string
- func GetVMSSIDFromNodePool(ctx context.Context, cluster *armcontainerservice.ManagedCluster, ...) (string, error)
- func GetVMSSInstancesFromNodePool(ctx context.Context, cluster *armcontainerservice.ManagedCluster, ...) ([]interface{}, error)
- func MapOperationToCommand(operation string, resourceType string) (string, error)
- func RegisterAKSVMSSInfoTool() mcp.Tool
- func RegisterAzComputeOperations(cfg *config.ConfigData) mcp.Tool
- func ValidateOperationAccess(operation string, cfg *config.ConfigData) error
- type ComputeOperationType
- type ComputeOperationsExecutor
- type ResourceType
Constants ¶
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
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
MapOperationToCommand maps an operation and resource type to its corresponding az command
func RegisterAKSVMSSInfoTool ¶
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