From e7a4460864d3a120ef12a4f77c18c9e1000f378d Mon Sep 17 00:00:00 2001
From: Francisco Mendonca <francisco.mendonca@hesge.ch>
Date: Thu, 12 Sep 2024 10:33:04 +0200
Subject: [PATCH] shell script boilerplate

---
 lab-os-cli.md | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++
 lab-os-cli.sh | 30 ++++++++++++++++++++++++
 2 files changed, 95 insertions(+)
 create mode 100644 lab-os-cli.md
 create mode 100644 lab-os-cli.sh

diff --git a/lab-os-cli.md b/lab-os-cli.md
new file mode 100644
index 0000000..1f0fb81
--- /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 0000000..f5b37c4
--- /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
+
-- 
GitLab