外观
artifacts API
模块说明
text
Installation-owned, bounded binary artifacts over managed IPC.
Uploads and retention are explicit and never retried. Retain before submitting
an operation; keep the reference when admission is uncertain. remove is an
explicit request and the Host protects references still needed by operations.MAX_ARTIFACT_BYTES
python
MAX_ARTIFACT_BYTES = 8 * 1024 * 1024ARTIFACT_CHUNK_BYTES
python
ARTIFACT_CHUNK_BYTES = 48 * 1024ArtifactDescriptor
python
class ArtifactDescriptor(TypedDict)字段(包含继承字段):
ArtifactDescriptor.artifact_id
python
artifact_id: str必填;声明于 artifacts.ArtifactDescriptor。
ArtifactDescriptor.size
python
size: int必填;声明于 artifacts.ArtifactDescriptor。
ArtifactDescriptor.sha256
python
sha256: str必填;声明于 artifacts.ArtifactDescriptor。
ArtifactDescriptor.received
python
received: int必填;声明于 artifacts.ArtifactDescriptor。
ArtifactDescriptor.complete
python
complete: bool必填;声明于 artifacts.ArtifactDescriptor。
ArtifactUploadError
python
class ArtifactUploadError(ProtocolError)SDK 说明:
text
Upload response unresolved. offset is the last acknowledged byte count.ArtifactUploadError.__init__
python
def __init__(self, artifact_id, offset, phase)ArtifactUploadError.artifact_id
python
self.artifact_id公开实例属性,在 __init__ 中设置。
ArtifactUploadError.offset
python
self.offset公开实例属性,在 __init__ 中设置。
ArtifactUploadError.phase
python
self.phase公开实例属性,在 __init__ 中设置。
ArtifactRetentionUncertain
python
class ArtifactRetentionUncertain(ProtocolError)ArtifactRetentionUncertain.__init__
python
def __init__(self, artifact_id, idempotency_key)ArtifactRetentionUncertain.artifact_id
python
self.artifact_id公开实例属性,在 __init__ 中设置。
ArtifactRetentionUncertain.idempotency_key
python
self.idempotency_key公开实例属性,在 __init__ 中设置。
Artifacts
python
class ArtifactsArtifacts.__init__
python
def __init__(self, peer, session)Artifacts.upload
python
async def upload(self, content: bytes, *, timeout=10) -> ArtifactDescriptorSDK 说明:
text
Upload once in 48 KiB chunks; timeout bounds each IPC request.Artifacts.upload_file
python
async def upload_file(self, path, *, timeout=10) -> ArtifactDescriptorSDK 说明:
text
Read a local regular file with an 8 MiB bound, then upload it once.Artifacts.retain
python
async def retain(
self,
artifact_id: str,
idempotency_key: str,
*,
timeout = 10,
) -> ArtifactDescriptorSDK 说明:
text
Pin to a caller-chosen operation key before admission; never retry.Artifacts.read
python
async def read(self, artifact_id: str, *, timeout=10) -> bytesSDK 说明:
text
Read bounded chunks and verify immutable metadata, offsets and SHA-256.Artifacts.remove
python
async def remove(self, artifact_id: str, *, timeout=10)SDK 说明:
text
Explicit removal; Host may reject a reference retained by an operation.Artifacts.peer
python
self.peer公开实例属性,在 __init__ 中设置。
Artifacts.session
python
self.session公开实例属性,在 __init__ 中设置。