mate_rest_client.artifacts module

Python API bindings for artifact endpoints in the MATE REST API.

class mate_rest_client.artifacts.Artifact(client: mate_rest_client.Client, info: ArtifactInformation)

Bases: mate_rest_client.common.APIModel

Represents an artifact retrieved from MATE.

property attributes: Dict[str, Any]

Return all unstructured attributes associated with this artifact.

property builds: Iterator[builds.Build]

Yield each build associated with this artifact.

Most artifacts are only associated with a single build but some, like bitcode artifacts, can be associated with multiple.

property compilations: Iterator[compilations.Compilation]

Yield each compilation associated with this artifact.

Most artifacts are only associated with a single compilation but some, like source artifacts, can be associated with multiple.

contents() bytes

Return the contents of this artifact, as bytes.

Return type

bytes

property has_object: bool

Return whether or not this artifact has any data currently associated with it.

property id_: str

Return the artifact’s unique ID.

property kind: mate_common.models.artifacts.ArtifactKind

Return the artifact’s kind.

refresh() None

Refresh the internal state of this artifact.

Return type

None

class mate_rest_client.artifacts.ArtifactRoutes(client: mate_rest_client.Client)

Bases: mate_rest_client.common.Routes

An adapter for interactions with artifact endpoints.

Parameters

client (mate_rest_client.Client) –

Return type

None

create(kind: mate_common.models.artifacts.ArtifactKind, *, filename: pathlib.Path, attributes: Dict[str, Any] = {}) mate_rest_client.artifacts.Artifact

Create a new artifact on the server and return it.

Parameters
Return type

mate_rest_client.artifacts.Artifact

get(id_: str) mate_rest_client.artifacts.Artifact

Return an artifact by ID, raising on any error.

Parameters

id_ (str) –

Return type

mate_rest_client.artifacts.Artifact

iter(**kwargs: Dict[str, Any]) Iterator[mate_rest_client.artifacts.Artifact]

Iterate over all artifacts currently known to MATE.

Any additional filters can be supplied via keyword arguments.

Parameters

kwargs (Dict[str, Any]) –

Return type

Iterator[mate_rest_client.artifacts.Artifact]

maybe_get(id_: str) Optional[mate_rest_client.artifacts.Artifact]

Return an artifact by ID, or None if the artifact does not exist.

Parameters

id_ (str) –

Return type

Optional[mate_rest_client.artifacts.Artifact]