-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcurlCommands.cmd
More file actions
96 lines (76 loc) · 3.68 KB
/
curlCommands.cmd
File metadata and controls
96 lines (76 loc) · 3.68 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
REM A script to invoke some sample curl commands on a Windows machine
REM against a running container image of the app-specific Gilhari microservice
REM gilhari_autoincrement_example:1.0.
REM
REM The responses are recorded in a log file (curl.log).
REM
REM Note that these curl commands use a default mapped port number of 80
REM even though the port number exposed by the app-specific
REM microservice may be different (e.g., 8081) inside the container shell.
REM
REM You may optionally specify a non-default port number as the first
REM command line argument to this script. For example, to specify a
REM port number of 8899, use the following command:
REM curlCommands 8899
IF %1.==. GOTO DefaultPort
SET port=%1
GOTO Proceed
:DefaultPort
SET port=80
GOTO Proceed
:Proceed
echo ** BEGIN OUTPUT ** > curl.log
echo. >> curl.log
echo Using PORT number %port% >> curl.log
echo. >> curl.log
echo ** Check the health of the Gilhari microservice >> curl.log
curl -X GET "http://localhost:%port%/gilhari/v1/health/check" >> curl.log
echo. >> curl.log
echo. >> curl.log
echo ** Delete all Employee2 objects to start fresh >> curl.log
curl -X DELETE "http://localhost:%port%/gilhari/v1/Employee2" >> curl.log
echo. >> curl.log
echo. >> curl.log
echo ** Insert one Employee2 object >> curl.log
curl -X POST "http://localhost:%port%/gilhari/v1/Employee2" -H "Content-Type: application/json" -d "{""entity"":{""name"":""John39"",""compensation"":54039,""exempt"":true,""DOB"":381484800390}}" >> curl.log
echo. >> curl.log
echo. >> curl.log
echo ** Query all Employee2 objects >> curl.log
curl -X GET "http://localhost:%port%/gilhari/v1/Employee2" -H "Content-Type: application/json" >> curl.log
echo. >> curl.log
echo. >> curl.log
echo ** Insert multiple (two) Employee2 objects >> curl.log
curl -X POST "http://localhost:%port%/gilhari/v1/Employee2" -H "Content-Type: application/json" -d "{""entity"":[{""name"":""Mike40"",""compensation"":54040,""exempt"":false,""DOB"":381484800400}, {""name"":""Mary41"",""compensation"":54041,""exempt"":true,""DOB"":381484800410}]}" >> curl.log
echo. >> curl.log
echo. >> curl.log
echo ** Query all Employee2 objects >> curl.log
curl -X GET "http://localhost:%port%/gilhari/v1/Employee2" -H "Content-Type: application/json" >> curl.log
echo. >> curl.log
echo. >> curl.log
echo ** Query non-exempted Employee2 objects >> curl.log
curl -X GET "http://localhost:%port%/gilhari/v1/Employee2?filter=exempt=0" -H "Content-Type: application/json" >> curl.log
echo. >> curl.log
echo. >> curl.log
echo ** Query the count of exempted Employee2 objects >> curl.log
curl -X GET "http://localhost:%port%/gilhari/v1/Employee2/getAggregate?attribute=id&aggregateType=COUNT&filter=exempt=1" -H "Content-Type: application/json" >> curl.log
echo. >> curl.log
echo. >> curl.log
echo ** Delete all exempted Employee2 objects >> curl.log
curl -X DELETE "http://localhost:%port%/gilhari/v1/Employee2?filter=exempt=1" >> curl.log
echo. >> curl.log
echo. >> curl.log
echo ** Query the count of exempted Employee2 objects >> curl.log
curl -X GET "http://localhost:%port%/gilhari/v1/Employee2/getAggregate?attribute=id&aggregateType=COUNT&filter=exempt=1" -H "Content-Type: application/json" >> curl.log
echo. >> curl.log
echo. >> curl.log
echo ** Delete all Employee2 objects >> curl.log
curl -X DELETE "http://localhost:%port%/gilhari/v1/Employee2" >> curl.log
echo. >> curl.log
echo. >> curl.log
echo ** Query the count of all Employee2 objects >> curl.log
curl -X GET "http://localhost:%port%/gilhari/v1/Employee2/getAggregate?attribute=id&aggregateType=COUNT" -H "Content-Type: application/json" >> curl.log
echo. >> curl.log
echo. >> curl.log
echo ** END OUTPUT ** >> curl.log
echo. >> curl.log
type curl.log