diff --git a/lab-os-cli.md b/lab-os-cli.md new file mode 100644 index 0000000000000000000000000000000000000000..1f0fb81a268eae906821602031c8f3ad2f74d05d --- /dev/null +++ b/lab-os-cli.md @@ -0,0 +1,65 @@ +# LAB OpenStack CLI Manager Manual + +## NAME +**lab-os-cli** - Script to manage OpenStack Virtual Machines + +## SYNOPSIS +`lab-os-cli` [**create**|**destroy**|**start**|**stop**|**snapshot**] + +## DESCRIPTION +`lab-os-cli` is a script designed to help manage OpenStack Virtual Machines with simple commands. + +## OPTIONS + +### **create** +Create a new virtual machine. This command returns a unique **ID** that can be used to manage the VM in subsequent commands. + +### **destroy ID** +Destroy an existing virtual machine using the provided **ID**. + +### **start ID** +Start a virtual machine using the provided **ID**. + +### **stop ID** +Stop a running virtual machine using the provided **ID**. + +### **snapshot ID** +Create a snapshot of the current state of the virtual machine using the provided **ID**. This command also returns a unique **ID** for the snapshot. + +## EXAMPLES + +### Create a new virtual machine: +```bash +lab-os-cli create +``` +This will return a unique ID for the newly created virtual machine. + +### Start a virtual machine: +```bash +lab-os-cli start <ID> +``` +This starts the virtual machine associated with the provided **ID**. + +### Stop a virtual machine: +```bash +lab-os-cli stop <ID> +``` +This stops the virtual machine associated with the provided **ID**. + +### Create a snapshot of a virtual machine: +```bash +lab-os-cli snapshot <ID> +``` +This creates a snapshot of the virtual machine associated with the provided **ID** and returns a unique **ID** for the snapshot. + +### Destroy a virtual machine: +```bash +lab-os-cli destroy <ID> +``` +This destroys the virtual machine associated with the provided **ID**. + +## AUTHOR +Written by Francisco Mendonca. + +## COPYRIGHT +This is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License. diff --git a/lab-os-cli.sh b/lab-os-cli.sh new file mode 100644 index 0000000000000000000000000000000000000000..f5b37c4f6322a44707b613f6fddc73b22322d0f3 --- /dev/null +++ b/lab-os-cli.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# Check if an argument is provided +if [ -z "$1" ]; then + echo "Usage: $0 <option>" + exit 1 +fi + +case "$1" in + create) + echo "Creating a new VM" + ;; + destroy) + echo "Destroying a VM" + ;; + start) + echo "Starting a VM" + ;; + stop) + echo "Stopping a VM" + ;; + snapshot) + echo "Creating a snapshot" + ;; + *) + echo "Invalid option" + exit 1 + ;; +esac +