|
6 | 6 | # - Alternative: https://curl.se/windows/ |
7 | 7 | # |
8 | 8 | # (c) 2024 Oliver Glowa (glo03) / Arvato Systems GmbH |
9 | | -# |
| 9 | +# |
10 | 10 | # !!!! Works only with privat access token (PAT) !!!! |
11 | 11 |
|
12 | | -TS=`date` |
| 12 | +if [ -f ~/.restapi/my.conf ]; then |
| 13 | + source ~/.restapi/my.conf |
| 14 | +else |
| 15 | + echo -e "No personal config found in ~/.restapi/my.conf!" |
| 16 | + exit 11 |
| 17 | +fi |
13 | 18 |
|
14 | | -CONF_AUTH="Authorization: Bearer ${CONF_PAT_TEST}" |
| 19 | +CONF_BASE_URL=${MY_BASE_URL} |
| 20 | +CONF_AUTH="Authorization: Bearer ${MY_PAT}" |
15 | 21 |
|
16 | | -CONF_BASE_URL_TEST=https://nma-s-confluence-test.arvato-systems.de |
17 | | -CONF_BASE_URL_INTE=https://nma-s-confluence-mig.arvato-systems.de |
18 | | -CONF_BASE_URL=${CONF_BASE_URL_TEST} |
| 22 | +# Check |
| 23 | +if [ "${CONF_AUTH}" = "" ]; then |
| 24 | + echo -e "No PAT (personal access token) in environment defined!" |
| 25 | + exit 10 |
| 26 | +fi |
| 27 | + |
| 28 | +TS=`date` |
19 | 29 |
|
20 | 30 | CONF_RESTAPI_URL=${CONF_BASE_URL}/rest/api/content |
21 | 31 | DL_DIR=${TEMP} |
22 | 32 |
|
23 | 33 | REQP_LIGHT='&expand=space' |
24 | 34 | REQP_FULL='&expand=body.storage,version,space' |
25 | 35 |
|
26 | | -RESP_SINGLE='.id + " " + .space.key + " " + .title' |
27 | | -RESP_RESULTS='.results[]| .id + " " + .space.key + " " + .title' |
28 | | -RESP_BODY_SINGLE='.id + " " + .space.key + " " + .title,.body.storage.value' |
29 | | -RESP_BODY_RESULTS='.results[]| .id + " " + .space.key + " " + .title + "\n" + .body.storage.value' |
| 36 | +RESP_SINGLE='.id + " [" + .space.key + "] \"" + .title + "\""' |
| 37 | +RESP_RESULTS='.results[]| .id + " [" + .space.key + "] \"" + .title + "\""' |
| 38 | +RESP_BODY_SINGLE='.id + " [" + .space.key + "] \"" + .title + "\"",.body.storage.value' |
| 39 | +RESP_BODY_RESULTS='.results[]| .id + " [" + .space.key + "] \"" + .title + "\"\n" + .body.storage.value' |
30 | 40 |
|
31 | 41 |
|
32 | | -# Check |
33 | | -if [ "${CONF_AUTH}" = "" ]; then |
34 | | - echo -e "No PAT (personal access token) in environment defined!" |
35 | | - exit 10 |
36 | | -fi |
|
0 commit comments