-
Notifications
You must be signed in to change notification settings - Fork 1
/
show-target-org.sh
executable file
·61 lines (47 loc) · 1.83 KB
/
show-target-org.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
60
61
#! /bin/bash
gcloud config get project
export ORG=$X_ORG
echo ORG=$ORG
read -p "OK to proceed (Y/n)? " i
if [ "$i" != "Y" ]
then
echo aborted
exit 1
fi
echo; echo Proceeding...
export TOKEN=$(gcloud auth print-access-token)
echo; echo Apps ================================
apigeecli -t $TOKEN --org=$ORG apps list --expand | jq -r .app[].name
echo; echo Products ================================
apigeecli -t $TOKEN --org=$ORG products list | jq -r .apiProduct[].name
echo; echo Developers ================================
apigeecli -t $TOKEN --org=$ORG developers list | jq -r .developer[].email
echo; echo APIs ================================
apigeecli -t $TOKEN --org=$ORG apis list | jq -r .proxies[].name
echo; echo Shared Flows ================================
apigeecli -t $TOKEN --org=$ORG sharedflows list | jq -r .sharedFlows[].name
echo; echo ORG KVMS ================================
apigeecli -t $TOKEN --org=$ORG kvms list | jq -r .[]
echo; echo ENV KVMS ================================
for ENV in $(apigeecli -t $TOKEN --org=$ORG environments list | jq -r .[])
do
echo ENV KVMS: $ENV ================================
apigeecli -t $TOKEN --org=$ORG --env=$ENV kvms list | jq -r .[]
done
echo; echo PROXY KVMS ================================
PROXIES=$(apigeecli -t $TOKEN --org=$ORG apis list | jq -r .proxies[].name)
for PROXY in $PROXIES
do
KVMS=$(apigeecli -t $TOKEN --org=$ORG --proxy=$PROXY kvms list | jq -r .[])
if [ "$KVMS" != "" ]
then
echo PROXY KVMS: $PROXY ================================
echo $KVMS
fi
done
echo; echo TARGETSERVERS ================================
for ENV in $(apigeecli -t $TOKEN --org=$ORG environments list | jq -r .[])
do
echo ENV TARGETSERVERS: $ENV ================================
apigeecli -t $TOKEN --org=$ORG --env=$ENV targetservers list | jq -r .[]
done