Documentation
¶
Index ¶
- Constants
- func AskConfirmation(prompt ...string) bool
- func AskSpecialConfirmation(requiredText string, s *styles.KillStyles) bool
- func CheckClusterImpactsHead(ctx context.Context, client *vers.Client, clusterID string) bool
- func CheckVMImpactsHead(vmID string) bool
- func CleanupAfterDeletion(deletedVMIDs []string) bool
- func ClearHead() error
- func ConfirmClusterDeletion(clusterName string, vmCount int, s *styles.KillStyles) bool
- func ConfirmClusterHeadImpact(ctx context.Context, client *vers.Client, clusterID string, ...) bool
- func ConfirmDeletion(itemType, itemName string, s *styles.KillStyles) bool
- func ConfirmVMHeadImpact(vmID string, s *styles.KillStyles) bool
- func GetClusterDeleteErrorSummary(result *vers.APIClusterDeleteResponse) string
- func GetCurrentHeadVM() (string, error)
- func GetVmAndNodeIP(ctx context.Context, client *vers.Client, vmID string) (vers.APIVmGetResponseData, string, error)
- func HandleDeletionResult(currentIndex, totalCount int, action, displayName string, ...) ([]string, error)
- func HandleVmDeleteErrors(result *vers.APIVmDeleteResponse, s *styles.KillStyles) bool
- func IsHostLocal(hostName string) bool
- func NoDataFound(message string, s *styles.KillStyles)
- func OperationCancelled(s *styles.KillStyles)
- func PrintDeletionSummary(results SummaryResults, s *styles.KillStyles)
- func ProgressCounter(current, total int, action, target string, s *styles.KillStyles)
- func SectionHeader(title string, s *styles.KillStyles)
- func SetHead(vmID string) error
- func SuccessMessage(message string, s *styles.KillStyles)
- type ClusterInfo
- type SummaryResults
- type VMInfo
- func CreateVMInfoFromGetResponse(vm vers.APIVmGetResponseData) *VMInfo
- func CreateVMInfoFromUpdateResponse(vm vers.APIVmUpdateResponseData) *VMInfo
- func GetCurrentHeadVMInfo(ctx context.Context, client *vers.Client) (*VMInfo, error)
- func ResolveVMIdentifier(ctx context.Context, client *vers.Client, identifier string) (*VMInfo, error)
- func SetHeadFromIdentifier(ctx context.Context, client *vers.Client, identifier string) (*VMInfo, error)
Constants ¶
const ( VersDir = ".vers" HeadFile = "HEAD" )
Variables ¶
This section is empty.
Functions ¶
func AskConfirmation ¶
AskConfirmation asks for a y/N confirmation with optional styling
func AskSpecialConfirmation ¶
func AskSpecialConfirmation(requiredText string, s *styles.KillStyles) bool
AskSpecialConfirmation asks for an exact text match confirmation
func CheckClusterImpactsHead ¶
CheckClusterImpactsHead checks if a specific cluster deletion will affect HEAD
func CheckVMImpactsHead ¶
CheckVMImpactsHead checks if a specific VM deletion will affect HEAD
func CleanupAfterDeletion ¶
CleanupAfterDeletion clears HEAD if any of the deleted VM IDs match current HEAD
func ConfirmClusterDeletion ¶
func ConfirmClusterDeletion(clusterName string, vmCount int, s *styles.KillStyles) bool
ConfirmClusterDeletion shows a cluster deletion warning with VM count
func ConfirmClusterHeadImpact ¶
func ConfirmClusterHeadImpact(ctx context.Context, client *vers.Client, clusterID string, s *styles.KillStyles) bool
ConfirmClusterHeadImpact checks and confirms HEAD impact for a single cluster deletion
func ConfirmDeletion ¶
func ConfirmDeletion(itemType, itemName string, s *styles.KillStyles) bool
ConfirmDeletion shows a deletion warning and asks for confirmation
func ConfirmVMHeadImpact ¶
func ConfirmVMHeadImpact(vmID string, s *styles.KillStyles) bool
ConfirmVMHeadImpact checks and confirms HEAD impact for a single VM deletion
func GetClusterDeleteErrorSummary ¶
func GetClusterDeleteErrorSummary(result *vers.APIClusterDeleteResponse) string
GetClusterDeleteErrorSummary returns a summary string of cluster deletion errors for use in bulk operations. Returns empty string if no errors.
func GetCurrentHeadVM ¶
GetCurrentHeadVM returns the VM ID from the current HEAD
func GetVmAndNodeIP ¶
func GetVmAndNodeIP(ctx context.Context, client *vers.Client, vmID string) (vers.APIVmGetResponseData, string, error)
GetVmAndNodeIP retrieves VM information and the node IP from headers in a single request. We use the lower-level client.Get() instead of client.API.Vm.Get() because Stainless doesn't expose response headers through the higher-level SDK methods.
func HandleDeletionResult ¶
func HandleDeletionResult(currentIndex, totalCount int, action, displayName string, deletionFunc func() ([]string, error), s *styles.KillStyles) ([]string, error)
HandleDeletionResult displays progress, performs deletion, and handles the result This is the common pattern used by both VM and cluster processors
func HandleVmDeleteErrors ¶
func HandleVmDeleteErrors(result *vers.APIVmDeleteResponse, s *styles.KillStyles) bool
HandleVmDeleteErrors processes VM deletion results and prints error messages Returns true if there were partial failures, false if completely successful
func IsHostLocal ¶
func NoDataFound ¶
func NoDataFound(message string, s *styles.KillStyles)
func PrintDeletionSummary ¶
func PrintDeletionSummary(results SummaryResults, s *styles.KillStyles)
PrintDeletionSummary prints results for multiple target deletions
func ProgressCounter ¶
func ProgressCounter(current, total int, action, target string, s *styles.KillStyles)
ProgressCounter formats and prints progress messages like 1/5 Doing something...
func SectionHeader ¶
func SectionHeader(title string, s *styles.KillStyles)
SectionHeader prints a formatted section header
func SuccessMessage ¶
func SuccessMessage(message string, s *styles.KillStyles)
SuccessMessage prints a standardized success message
Types ¶
type ClusterInfo ¶
ClusterInfo contains both ID and display name for a cluster
func CreateClusterInfoFromListResponse ¶
func CreateClusterInfoFromListResponse(cluster vers.APIClusterListResponseData) *ClusterInfo
CreateClusterInfoFromListResponse creates ClusterInfo from a List API response item
func ResolveClusterIdentifier ¶
func ResolveClusterIdentifier(ctx context.Context, client *vers.Client, identifier string) (*ClusterInfo, error)
ResolveClusterIdentifier takes a cluster ID or alias and returns the cluster ID and display info
type SummaryResults ¶
SummaryResults for deletion operations
type VMInfo ¶
VMInfo contains both ID and display name for a VM
func CreateVMInfoFromGetResponse ¶
func CreateVMInfoFromGetResponse(vm vers.APIVmGetResponseData) *VMInfo
CreateVMInfoFromGetResponse creates VMInfo from a Get API response
func CreateVMInfoFromUpdateResponse ¶
func CreateVMInfoFromUpdateResponse(vm vers.APIVmUpdateResponseData) *VMInfo
CreateVMInfoFromUpdateResponse creates VMInfo from an Update API response
func GetCurrentHeadVMInfo ¶
GetCurrentHeadVMInfo returns both the HEAD VM ID and its display information