-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtest.sh
executable file
·53 lines (38 loc) · 1.22 KB
/
test.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
#!/bin/bash
# SET THE BEARER TOKEN FOR ALL OTHER COMMANDS
BEARER_TOKEN=<replace_me>
# SET VARIABLES
base_url=https://api.astra.datastax.com
base_api=/v2/streaming
tenant_name=llp-llp-testcreater
tenant_name_with_topics=test-llp
topic_name=blah
cluster_name=astradev-aws
for FILE in *;
do
if [[ "$FILE" != "test"* ]]
then
gsed "s#https://api.astra.datastax.com#$base_url#; s#/v2/streaming#$base_api#; s#testcreate#$tenant_name#; s#llp-test#$tenant_name_with_topics#; s#blah#$topic_name#; s#astradev-aws#$cluster_name#; s#$BEARER_TOKEN#$BEARER_TOKEN#;" $FILE > $FILE.tmp;
chmod 755 $FILE.tmp;
fi
done
echo -e "\nGet all clusters\n"
./get_clusters.sh.tmp | jq
echo -e "\nGet all providers\n"
./get_providers.sh.tmp | jq
echo -e "\nGet all tenants\n"
./get_tenants.sh.tmp | jq
echo -e "\nCheck tenant exists\n"
./check_tenant_exists.sh.tmp
echo -e "\nCreate tenant\n"
./create_tenant.sh.tmp | jq
echo -e "\nGet tenant limits\n"
./get_tenant_limits.sh.tmp | jq
echo -e "\nGet all tenants again, now that new tenant is created\n"
./get_tenants.sh.tmp | jq
echo -e "\nDelete tenant hard\n"
./delete_tenant_hard.sh.tmp
#echo -e "\nDelete tenant soft\n"
#./delete_tenant_soft.sh.tmp
# CLEAN UP tmp files
rm *.tmp;