-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnova.sh
executable file
·59 lines (51 loc) · 2.87 KB
/
nova.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#wrapper for nova client to prompt for required values
# --os_username OS_USERNAME
# Defaults to env[OS_USERNAME].
# --os_password OS_PASSWORD
# Defaults to env[OS_PASSWORD].
# --os_tenant_name OS_TENANT_NAME
# Defaults to env[OS_TENANT_NAME].
# --os_auth_url OS_AUTH_URL
# Defaults to env[OS_AUTH_URL].
# --os_region_name OS_REGION_NAME
# Defaults to env[OS_REGION_NAME].
# --service_type SERVICE_TYPE
# Defaults to compute for most actions
# --service_name SERVICE_NAME
# Defaults to env[NOVA_SERVICE_NAME]
# --volume_service_name VOLUME_SERVICE_NAME
# Defaults to env[NOVA_VOLUME_SERVICE_NAME]
# --endpoint_type ENDPOINT_TYPE
# Defaults to env[NOVA_ENDPOINT_TYPE] or publicURL.
# --os_compute_api_version OS_COMPUTE_API_VERSION
args=("$@")
read -p "Username: " username
#read -p "Password: " password
read -p "API Key: " apikey
read -p "DDI : " ostenant
read -p "US or UK Account?: " authurl
#(Case statement for UK/US accounts... https://identity.api.rackspacecloud.com/v2.0/ or https://lon.identity.api.rackspacecloud.com/v2.0/)
case "$authurl" in
US) authurl="https://identity.api.rackspacecloud.com/v2.0/"
;;
us) authurl="https://identity.api.rackspacecloud.com/v2.0/"
;;
UK) authurl="https://lon.identity.api.rackspacecloud.com/v2.0/"
;;
uk) authurl="https://lon.identity.api.rackspacecloud.com/v2.0/"
;;
esac
read -p "Datacenter: " datacenter
#read -p "Service Type (Compute by default): " servicetype
#read -p "Service Name(?): " servicename cloudserversopenstack
#read -p "Volume Service Name(?): " volumeservicename
#read -p "Endpoint Type(?): " endpointtype
#read -p "API Version: (2, 1.1) " apiversion
#Using Password
#echo -e "\nThe full nova-client command you are executing is: "
#echo -e "nova --os_username $username --os_password $password --os_tenant_name $ostenant --os_auth_url $authurl --os_region_name $datacenter --service_type compute --service_name cloudServersOpenStack --os_compute_api_version 2 $args \n"
#nova --os_username $username --os_password $password --os_tenant_name $ostenant --os_auth_url $authurl --os_region_name $datacenter --service_type compute --service_name cloudServersOpenStack --os_compute_api_version 2 $args
#Using API Key (deprecated function)
echo -e "\nThe full nova-client command you are executing is: "
echo -e "nova --os_username $username --apikey $apikey --os_tenant_name $ostenant --os_auth_url $authurl --os_region_name $datacenter --service_type compute --service_name cloudServersOpenStack --os_compute_api_version 2 $args \n"
nova --os_username $username --apikey $apikey --os_tenant_name $ostenant --os_auth_url $authurl --os_region_name $datacenter --service_type compute --service_name cloudServersOpenStack --os_compute_api_version 2 $args