forked from vishvananda/openstack-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
keypair.curl
executable file
·19 lines (16 loc) · 882 Bytes
/
keypair.curl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env bash
source helper.curl
KEYPAIRS=`curl -s "$ENDPOINT/os-keypairs" -X GET -H "Accept: application/json" -H "X-Auth-Token: $TOKEN"`
echo $KEYPAIRS | cut -d'"' -f12
echo $KEYPAIRS | cut -d'"' -f16
echo $KEYPAIRS | cut -d'"' -f26
echo $KEYPAIRS | cut -d'"' -f30
curl -s "$ENDPOINT/os-keypairs/test" -X DELETE -H "Accept: application/json" -H "X-Auth-Token: $TOKEN"
KEYPAIR=`curl -s "$ENDPOINT/os-keypairs" -X POST -H "Content-Type: application/json " -H "Accept: application/json" -H "X-Auth-Token: $TOKEN" -d '{"keypair": {"name": "test"}}'`
echo -e `echo $KEYPAIR | cut -d'"' -f10` > test.pem
KEYPAIRS=`curl -s "$ENDPOINT/os-keypairs" -X GET -H "Accept: application/json" -H "X-Auth-Token: $TOKEN"`
echo $KEYPAIRS | cut -d'"' -f12
echo $KEYPAIRS | cut -d'"' -f16
echo $KEYPAIRS | cut -d'"' -f26
echo $KEYPAIRS | cut -d'"' -f30
# echo $KEYPAIRS | python -m json.tool