Begin to hack on vm-create
This commit is contained in:
parent
36a1989a84
commit
fea145cf37
1 changed files with 44 additions and 0 deletions
44
vm-create
Normal file
44
vm-create
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
#!/bin/random
|
||||||
|
# This is a sample script / prototype to create VMs in Data Center
|
||||||
|
# Light
|
||||||
|
#
|
||||||
|
# Flow to register payment:
|
||||||
|
#
|
||||||
|
# - Connect to account.ungleich.ch with (username, password) for getting (name, realm, seed)
|
||||||
|
# - Connect to pay.ungleich.ch with (name, realm, token) { JSON }
|
||||||
|
# Json similar to:
|
||||||
|
#
|
||||||
|
# { type: "credit-card" cc number, name, verify, ... }
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Flow to add an ssh key:
|
||||||
|
# - Connect to account.ungleich.ch with (username, password) for getting (name, realm, seed)
|
||||||
|
# - Connect to infra.ungleich.ch/api using (name, realm, token) POST { json }
|
||||||
|
# { key: ... }
|
||||||
|
# Standard rest, registering it internally to a user
|
||||||
|
#
|
||||||
|
# Flow to create a VM:
|
||||||
|
#
|
||||||
|
# - Connect to account.ungleich.ch with (username, password) for getting (name, realm, seed)
|
||||||
|
# - Connect to infra.ungleich.ch/api using (name, realm, token) POST { json }
|
||||||
|
# - infra.ungleich.ch then connects to otp.ungleich.ch verifying the (name, realm, token)
|
||||||
|
# - infra.ungleich.ch checks that user has >= 1 ssh keys registered, otherwise gives error message
|
||||||
|
# - infra.ungleich.ch then connects to pay.ungleich.ch verifying that the user can "afford" the VM / books it
|
||||||
|
# infra passes (user, product, productvariant)
|
||||||
|
# --> infra needs to be able to derive a product from the parameters!
|
||||||
|
# --> if user is not able to afford, return error to the user
|
||||||
|
# -
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if [ $# -ne 2 ]; then
|
||||||
|
echo "$0: username password template ssdsizegb ramgb cpunum hddsizegb onlyipv6"
|
||||||
|
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
curl https://
|
Loading…
Reference in a new issue