-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
- Loading branch information
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"baseUrl": "https://test.datim.org/", | ||
"baseUrl": "https://sandbox.er.datim.org/", | ||
"sqlViewId": "rQZnEgCAhuI", | ||
"apiVersion": "30" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
[ | ||
{"name": "ER Expenditures FYOct", "id": "WUD8TApgOu1", "type": "ER"}, | ||
{"name": "Workplan Budgets FYOct", "id": "e8F8M6leZjj", "type": "ER"}, | ||
{"name": "MER Results", "id": "RwNpkAM7Hw7", "type": "MER"}, | ||
{"name": "MER Targets", "id": "TAjCBkG6hl6", "type": "MER"} | ||
] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import requests | ||
import os | ||
|
||
api = os.environ['DHIS_BASEURL'] + '/api/' | ||
credentials = (os.environ['DHIS_USERNAME'], os.environ['DHIS_PASSWORD']) | ||
|
||
res = requests.get(api + 'resources.json', auth=credentials) | ||
if res.json()['resources'][0]: | ||
print('Connected to DHIS2: ' + api) | ||
else: | ||
raise Exception("Cannot connect to DHIS2: " + api) | ||
|
||
def get(url, params): | ||
res = requests.get(api + url, auth=credentials, params=params) | ||
process_status_code(res, 'get') | ||
return res.json() | ||
|
||
def delete(url): | ||
res = requests.delete(api + url, auth=credentials) | ||
process_status_code(res, 'delete') | ||
|
||
|
||
def post(url, body): | ||
res = requests.post(api + url, auth=credentials, json=body) | ||
process_status_code(res, 'post') | ||
|
||
def formPost(url, data): | ||
headers = {'Content-Type': 'application/x-www-form-urlencoded'} | ||
res = requests.post(api + url, auth=credentials, data=data, headers=headers) | ||
process_status_code(res, 'post') | ||
|
||
def put(url, body): | ||
res = requests.put(api + url, auth=credentials, json=body) | ||
process_status_code(res, 'put') | ||
|
||
def process_status_code(response, method): | ||
if response.status_code in range(200,210): | ||
print(method + ' to url ' + response.url + ' successful') | ||
else: | ||
print(method + ' to url ' + response.url + ' failed') | ||
try: | ||
print(response.json()) | ||
except: | ||
print(response) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/python | ||
|
||
import api | ||
|
||
api.post('configuration/corsWhitelist', ["http://localhost:3000","http://localhost:3001","http://localhost:3002","http://localhost:3003","http://localhost:3004","http://localhost:3005"]) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#!/usr/bin/python | ||
|
||
import api | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/bash | ||
|
||
section(){ | ||
echo ---------------------------- | ||
echo $1 | ||
} | ||
|
||
section Users \> Adding test user accounts | ||
(cd users && ./persistUsers.py) | ||
|
||
section DataStore \> Opening data entry periods for dedupes | ||
(cd dataStore && ./dataStore.py) | ||
|
||
section Mechanisms \> Submit mechanisms to expected level | ||
(cd mechanisms && ./submitMechanisms.py) | ||
|
||
section CORS \> Whitelist localhost | ||
(cd cors && ./cors.py) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#!/usr/bin/python | ||
|
||
import api | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#!/usr/bin/python | ||
|
||
import api | ||
import json | ||
import os | ||
|