StartUpload
start_upload(public_api_client, file_name, artifact_type)
Expand source code
start_upload(public_api_client, file_name, artifact_type):"""Description-----------To initiate upload of artifacts in chunks.(must be used of file size is greater than 10 MB).Args----public_api_client: QDC api client object.file_name: Name of the artifact to be uploaded.artifact_type: Type of the artifact (TESTPACKAGE, TESTSCRIPT).Returns-------uuid: uuid of the uploaded artifact.None: In case of any failure.Usages------file_name = "C:\\Temp\\test.apk"artifact_type = ArtifactType.TESTPACKAGEuuid = start_upload(public_api_client, file_name, artifact_type)"""artifact_start_upload_response = post_artifacts_startupload.sync_detailed(client=public_api_client,filename=file_name,artifact_type=artifact_type)if artifact_start_upload_response.status_code == 200:print(f"start upload response: {artifact_start_upload_response.content.decode('utf-8')}")return artifact_start_upload_response.parsed.uuidelse:print(f"upload artifact failed with error code {artifact_start_upload_response.status_code} {artifact_start_upload_response.content.decode('utf-8')}")return None
Description
To initiate upload of artifacts in chunks. (must be used of file size is greater than 10 MB).
Arguments
public_api_client
: QDC api client object.file_name
: Name of the artifact to be uploaded.artifact_type
: Type of the artifact (TESTPACKAGE, TESTSCRIPT).
Returns
uuid
: uuid of the uploaded artifact.None
: In case of any failure.
Usages
file_name = "C:\\Temp\\test.apk"artifact_type = ArtifactType.TESTPACKAGEuuid = start_upload(public_api_client, file_name, artifact_type)