-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.http
60 lines (48 loc) · 1.98 KB
/
api.http
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
@endpoint_local = http://localhost:5000
@endpoint_azure = https://yourwebappnamehere.azurewebsites.net/
#####################################################
### Local
#####################################################
### Execute query using direct connection to local postgres
POST {{endpoint_local}}/api/query HTTP/1.1
Content-Type: application/json
{
"connectionString": "Host=localhost;Port=5432;Username=postgres;Password=password",
"query": "SELECT 1",
"count": 10
}
### Execute query using direct connection to Azure Database for PostgreSQL
POST {{endpoint_local}}/api/query HTTP/1.1
Content-Type: application/json
{
"connectionString": "Database=postgres;Host=yourinstancename.postgres.database.azure.com;Port=5432;Username=postgres@yourinstancename.postgres.database.azure.com;Ssl Mode=Require;Password=password",
"query": "SELECT 1",
"count": 10
}
### Execute query using pgbouncer (running locally in Docker)
POST {{endpoint_local}}/api/query HTTP/1.1
Content-Type: application/json
{
"connectionString": "Database=postgres;Host=localhost;Port=5439;Username=pgbouncer",
"query": "SELECT 1",
"count": 10
}
#####################################################
### Azure
#####################################################
### Execute query using direct connection to Azure Database for PostgreSQL
POST {{endpoint_azure}}/api/query HTTP/1.1
Content-Type: application/json
{
"connectionString": "Database=postgres;Host=yourinstancename.postgres.database.azure.com;Port=5432;Username=postgres@yourinstancename.postgres.database.azure.com;Ssl Mode=Require;Password=password",
"query": "SELECT 1",
"count": 10
}
### Execute query using pgbouncer (using pgbouncer running in App Service)
POST {{endpoint_azure}}/api/query HTTP/1.1
Content-Type: application/json
{
"connectionString": "Database=postgres;Host=pgbouncer;Port=5439;Username=pgbouncer",
"query": "SELECT 1",
"count": 10
}