Skip to content
View as Markdown

ObjectStorage

Initialize ObjectStorage with S3-compatible credentials

Constructors

new ObjectStorage()

def initialize(endpoint_url:, aws_access_key_id:, aws_secret_access_key:, aws_session_token:, bucket_name:, region:)

Initialize ObjectStorage with S3-compatible credentials

Parameters:

  • endpoint_url String - The endpoint URL for the object storage service
  • aws_access_key_id String - The access key ID for the object storage service
  • aws_secret_access_key String - The secret access key for the object storage service
  • aws_session_token String - The session token for the object storage service
  • bucket_name String - The name of the bucket to use (defaults to “daytona-volume-builds”)
  • region String - AWS region (defaults to us-east-1)

Returns:

  • ObjectStorage - a new instance of ObjectStorage

Methods

bucket_name()

def bucket_name()

Returns:

  • String - The name of the S3 bucket used for object storage

s3_client()

def s3_client()

Returns:

  • Aws:S3:Client - The S3 client

upload()

def upload(path, organization_id, archive_base_path)

Uploads a file to the object storage service

Parameters:

  • path String - The path to the file to upload
  • organization_id String - The organization ID to use
  • archive_base_path String, nil - The base path to use for the archive

Returns:

  • String - The hash of the uploaded file

Raises:

  • Errno:ENOENT - If the path does not exist