Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ Required arguments:

Optional arguments:
* chunk_size: default is 1
* insecure: skip TLS certificate validation. default is `False`

## Setup
Poetry needs to be installed before installing data simulator.
Expand Down
2 changes: 2 additions & 0 deletions datasimulator/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def parse_arguments():
submit_data_cmd.add_argument("--project", required=True)
submit_data_cmd.add_argument("--chunk_size", default=1)
submit_data_cmd.add_argument("--access_token_file", required=True)
submit_data_cmd.add_argument("--insecure", help="skip TLS certificate validation", action="store_true")

return parser.parse_args()

Expand Down Expand Up @@ -169,6 +170,7 @@ def main():
args.dir,
args.access_token_file,
int(args.chunk_size),
args.insecure,
)
logger.info("Done!")
return
Expand Down
5 changes: 4 additions & 1 deletion datasimulator/submit_data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
logger = get_logger("data-simulator submitting_data", log_level="info")


def submit_test_data(host, project, dir, access_token_file, max_chunk_size=1):
def submit_test_data(host, project, dir, access_token_file, max_chunk_size=1, insecure=False):
"""
Submit the test data. `project` is in the format of `program/project`
"""
Expand Down Expand Up @@ -43,6 +43,7 @@ def submit_test_data(host, project, dir, access_token_file, max_chunk_size=1):
"content-type": "application/json",
"Authorization": "bearer " + token,
},
verify=not insecure,
)

if response.status_code not in [200, 201]:
Expand Down Expand Up @@ -82,6 +83,7 @@ def submit_test_data(host, project, dir, access_token_file, max_chunk_size=1):
"content-type": "application/json",
"Authorization": "bearer " + token,
},
verify=not insecure,
)
if response.status_code not in [200, 201]:
logger.error(
Expand All @@ -105,6 +107,7 @@ def submit_test_data(host, project, dir, access_token_file, max_chunk_size=1):
"content-type": "application/json",
"Authorization": "bearer " + token,
},
verify=not insecure,
)
if response.status_code == 504:
chunk_size = chunk_size / 2
Expand Down