Artifact API
This page describes the ArtifactAPI class.
ArtifactAPI
Class that allows for interacting with artifacts via API.
Attributes:
Name | Type | Description |
---|---|---|
client |
object
|
client for sending requests to Typhoon Test Hub API |
download_artifact(artifact_id, file_name=None, destination='', no_progress_output=True, unzip_archive=False)
Download an existing artifact from Typhoon Test Hub.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
artifact_id |
int
|
Identifier of artifact |
required |
file_name |
str
|
Name of file after download ("save as" under file name); default value is the name of the downloaded file under which it was preserved by Typhoon Test Hub |
None
|
destination |
str
|
Directory where file is downloaded (and optionally extracted); default value is an empty string (file downloaded in working directory) |
''
|
no_progress_output |
bool
|
If True, no download progress logs are shown; default value is True |
True
|
unzip_archive |
bool
|
If True, downloaded artifact is treated as archive, and extracted via unzipping process; default value is True |
False
|
Returns:
Name | Type | Description |
---|---|---|
path |
str
|
Absolute path of downloaded file |
Raises:
Type | Description |
---|---|
APIException
|
Response status code not 200 |
upload_artifact(artifact_path, zip_dir=False, no_progress_output=True, execution_id=None, retention_until=None)
Upload a new artifact.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
artifact_path |
str
|
Path of artifact |
required |
zip_dir |
bool
|
If True, artifact_path should point to a directory which would be zipped and uploaded as a single artifact; If False, artifact_path should point to a file which should be uploaded as an artifact; default value is False |
False
|
no_progress_output |
bool
|
If True, no upload progress logs are shown; default value is True |
True
|
execution_id |
int
|
Identifier of the Execution to which the artifact should be assigned |
None
|
retention_until |
datetime
|
Timestamp until artifact should be preserved |
None
|
Returns:
Name | Type | Description |
---|---|---|
identifier |
int
|
Identifier of created artifact |
Raises:
Type | Description |
---|---|
APIException
|
Response status code not 201 |
InvalidPathException
|
Invalid artifact path provided |