Skip to main content
from gravixlayer import GravixLayer

client = GravixLayer()
runtime = client.runtime.create(template="python-3.12-base-small")

with open("./local-file.txt", "rb") as f:
    response = client.runtime.upload_file(
        runtime.runtime_id,
        file=f,
        path="/workspace/local-file.txt",
    )
print(response.message)

client.runtime.kill(runtime.runtime_id)

Parameters

ParameterTypeRequiredDescription
runtime_idstringYesRuntime identifier
fileBinaryIOYesFile object opened in binary mode
pathstringNoDestination path inside runtime

Response

FieldTypeDescription
messagestringConfirmation message
pathstringUploaded file path
sizeintegerFile size in bytes