Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Lab-OS-CLI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LSDS
Teaching
Bachelor
Cloud-and-Deployment
Lab-OS-CLI
Commits
e7a44608
Commit
e7a44608
authored
8 months ago
by
francisc.mendonca
Browse files
Options
Downloads
Patches
Plain Diff
shell script boilerplate
parent
b38c0a46
Branches
main
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lab-os-cli.md
+65
-0
65 additions, 0 deletions
lab-os-cli.md
lab-os-cli.sh
+30
-0
30 additions, 0 deletions
lab-os-cli.sh
with
95 additions
and
0 deletions
lab-os-cli.md
0 → 100644
+
65
−
0
View file @
e7a44608
# 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.
This diff is collapsed.
Click to expand it.
lab-os-cli.sh
0 → 100644
+
30
−
0
View file @
e7a44608
#!/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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment