Artifact Manager python API

ArtMan Client

Abstracts the management of artifact storage.

from piperci.artman import artman_client
piperci.artman.artman_client.check_artifact_exists(*, artman_url, sri_urlsafe=None, task_id=None)

Checks artman to see if an SRI has already been uploaded. :param artman_url: The artman endpoint as a string :param task_id: The task_id to query for as a string :param sri_urlsafe: the SRI hash to query for as a string. Must be URL-safe. :return: True if artifacts exist for the query, False if they don’t.

piperci.artman.artman_client.check_artifact_status(*, artman_url, artifact_id)

Checks the status of an artifact :param artman_url: Artman endpoint as a string :param artifact_id: Artifact ID to query for :return:

piperci.artman.artman_client.get_artifact(*, artman_url, sri_urlsafe=None, artifact_id=None, task_id=None, thread_id=None, query_filter=None)

Gets metadata about an artifact. Only one of [sri_urlsafe, artifact_id, task_id] may be passed. :param artman_url: Artman endpoint as a string :param sri_urlsafe: URL-safe SRI of the artifact as a string :param artifact_id: ID of the artifact :param task_id: TaskID to query for :param thread_id: ThreadID to query for :param query_filter: A lambda expression to filter the results :return: List of artifact objects

piperci.artman.artman_client.post_artifact(*, task_id, uri, type='artifact', caller, artman_url, sri)

Create a new artifact in ArtMan with the given parameters. :param task_id: The ID of the task to tie the artifact to. :param storage_uri: The URI that the artifact is located at :param type: The type. This is usually artifact. :param caller: The creator of the artifact record :param artman_url: The URL to reach artman :param sri: The SRI hash of the artifact :return: JSON response from ArtMan if the artifact doesn’t exist. If the artifact does exist then we throw an exception.