Skip to content

Commit e4b3562

Browse files
author
Sandeep parmar
committed
little correction
1 parent 20ceedc commit e4b3562

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

snippets/curl/get_nb_images.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ parseArguments()
6767
fi
6868
}
6969

70+
uriencode()
71+
{
72+
jq -nr --arg v "$1" '$v|@uri';
73+
}
7074
###############main############
7175

7276
parseArguments "$@"
@@ -88,6 +92,7 @@ param1="filter=policyType eq 'Standard'"
8892
### To use filter page[limit] in URI, The key 'page[limit]' must be url encoded already. ###
8993
### Curl --data-urlencode encodes only the content part of the data of the form 'name=content' ###
9094
param2="$(uriencode 'page[limit]')=10" #op: page%5Blimit%5D=10
95+
echo $param2
9196

9297
##############jobs##############
9398

snippets/curl/get_nb_jobs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ uriencode()
7777
parseArguments "$@"
7878

7979
basepath="https://$master_server:$port/netbackup"
80-
content_header='content-type:application/json;charset=utf-8'
80+
content_header='content-type:application/json'
8181

8282
##############login#############
8383

@@ -99,7 +99,7 @@ param2="$(uriencode 'page[limit]')=10" #op: page%5Blimit%5D=10
9999
auth_header="authorization:$jwt"
100100
uri="$basepath/admin/jobs"
101101

102-
curl --verbose --insecure --request GET --get $uri -H $content_header -H $auth_header \
102+
curl --insecure --request GET --globoff --get $uri -H $content_header -H $auth_header \
103103
--data-urlencode "$param1" \
104104
--data-urlencode "$param2" \
105105
| \

0 commit comments

Comments
 (0)