From d067d7048c33bca9eddc46d6cd50803e01d188c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Eckerstr=C3=B6m?= Date: Mon, 24 Nov 2025 13:57:10 +0100 Subject: [PATCH] Rename instance resize command to resize-disk Close #4 --- AGENTS.md | 2 +- README.md | 4 ++-- cmd/command_test.go | 2 +- cmd/instance_resize.go | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index dc16a5a..129c184 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -60,7 +60,7 @@ cloudamqp instance delete --id #### Resize Instance Disk ```bash -cloudamqp instance resize --id --disk-size= [--allow-downtime] +cloudamqp instance resize-disk --id --disk-size= [--allow-downtime] ``` - Required: disk-size (in GB) - Optional: allow-downtime flag diff --git a/README.md b/README.md index 686a4f3..bde3c84 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ A command line interface for the CloudAMQP API that provides complete management - **Simple Configuration**: Plain text API key storage in `~/.cloudamqprc` - **Flag-Based Commands**: Clean command structure with `--id` flags for instance operations - **Copy Settings**: Clone configuration from existing instances (metrics, firewall, alarms, etc.) -- **Wait for Ready**: Optional `--wait` flag for long-running operations (create, resize, upgrades) +- **Wait for Ready**: Optional `--wait` flag for long-running operations (create, resize-disk, upgrades) - **User-Friendly**: Clear help messages, examples, and safety confirmations - **Error Handling**: Proper API error extraction and display @@ -118,7 +118,7 @@ cloudamqp instance get --id 1234 cloudamqp instance update --id 1234 --name=new-name --plan=rabbit-1 # Resize instance disk -cloudamqp instance resize --id 1234 --disk-size=100 --allow-downtime +cloudamqp instance resize-disk --id 1234 --disk-size=100 --allow-downtime # Delete instance (with confirmation) cloudamqp instance delete --id 1234 diff --git a/cmd/command_test.go b/cmd/command_test.go index 39dad85..6b4f795 100644 --- a/cmd/command_test.go +++ b/cmd/command_test.go @@ -35,7 +35,7 @@ func TestInstanceCommand(t *testing.T) { assert.Contains(t, commandNames, "get --id ") assert.Contains(t, commandNames, "update --id ") assert.Contains(t, commandNames, "delete --id ") - assert.Contains(t, commandNames, "resize --id ") + assert.Contains(t, commandNames, "resize-disk --id ") } func TestVPCCommand(t *testing.T) { diff --git a/cmd/instance_resize.go b/cmd/instance_resize.go index abbc385..437d995 100644 --- a/cmd/instance_resize.go +++ b/cmd/instance_resize.go @@ -15,7 +15,7 @@ var ( ) var instanceResizeCmd = &cobra.Command{ - Use: "resize --id ", + Use: "resize-disk --id ", Short: "Resize instance disk", Long: `Resize the disk size of an instance. Default behavior is to expand the disk without any downtime. Currently limited to instances in Amazon Web Services (AWS) and Google Compute Engine (GCE). @@ -25,8 +25,8 @@ Note: This action is asynchronous. The request will return almost immediately. T Note: Due to restrictions from cloud providers, it's only possible to resize the disk every 8 hours unless --allow-downtime is set. Available disk sizes: 0, 25, 50, 100, 250, 500, 1000, 2000 GB`, - Example: ` cloudamqp instance resize --id 1234 --disk-size=100 - cloudamqp instance resize --id 1234 --disk-size=250 --allow-downtime`, + Example: ` cloudamqp instance resize-disk --id 1234 --disk-size=100 + cloudamqp instance resize-disk --id 1234 --disk-size=250 --allow-downtime`, Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { var err error