ivcap_client.artifact

Module Contents

Classes

Artifact

This class represents an artifact record

ArtifactIter

Helper class that provides a standard way to create an ABC using

Functions

check_file_already_uploaded(→ Optional[str])

mark_file_already_uploaded(id, file_path)

_upload_marker(file_path)

md5sum(filename[, blocksize])

class ivcap_client.artifact.Artifact(ivcap: ivcap_client.ivcap.IVCAP, **kwargs)[source]

This class represents an artifact record stored at a particular IVCAP deployment

property urn: str
property status: ivcap_client.models.artifact_status_rt.ArtifactStatusRT
property metadata: Iterator[ivcap_client.aspect.Aspect]
id: str
status: ivcap_client.models.artifact_status_rt_status.ArtifactStatusRTStatus
name: Optional[str]
size: Optional[int]
mime_type: Optional[str]
created_at: Optional[datetime.datetime.datetime]
last_modified_at: Optional[datetime.datetime.datetime]
etag: Optional[str]
policy: Optional[ivcap_client.ivcap.URN]
account: Optional[ivcap_client.ivcap.URN]
classmethod _from_list_item(item: ivcap_client.models.artifact_list_item.ArtifactListItem, ivcap: ivcap_client.ivcap.IVCAP)[source]
__update__(**kwargs)[source]
refresh() Artifact[source]
add_metadata(aspect: Dict[str, any], *, schema: Optional[str] = None, policy: Optional[ivcap_client.ivcap.URN] = None) Artifact[source]

Add a metadata ‘aspect’ to this artifact. The ‘schema’ of the aspect, if not defined is expected to found in the ‘aspect’ under the ‘$schema’ key.

Parameters:
  • aspect (dict) – The aspect to be attached

  • schema (Optional[str], optional) – Schema of the aspect. Defaults to ‘aspect[“$schema”]’.

  • policy – Optional[URN]: Set specific policy controlling access (’urn:ivcap:policy:…’).

Returns:

To enable chaining

Return type:

self

__repr__()[source]

Return repr(self).

class ivcap_client.artifact.ArtifactIter(ivcap: ivcap_client.ivcap.IVCAP, **kwargs)[source]

Bases: ivcap_client.utils.BaseIter[Artifact, ivcap_client.models.artifact_list_item.ArtifactListItem]

Helper class that provides a standard way to create an ABC using inheritance.

_next_el(el) Artifact[source]
_get_list() List[ivcap_client.models.artifact_list_item.ArtifactListItem][source]
ivcap_client.artifact.check_file_already_uploaded(file_path: str) Optional[str][source]
ivcap_client.artifact.mark_file_already_uploaded(id: str, file_path: str)[source]
ivcap_client.artifact._upload_marker(file_path: str)[source]
ivcap_client.artifact.md5sum(filename, blocksize=65536)[source]