types

Public data types returned by Modal APIs.

BillingReportItem

Costs generated by a specific object during a specific time interval.

Attributes

object_idstr
descriptionstr
environment_namestr
interval_startdatetime
costDecimal
cost_by_resourcedict[str, Decimal]
tagsdict[str, str]

DictInfo

Information about a Dict object.

Attributes

namestr | None
created_atdatetime
created_bystr | None

EnvironmentBillingSummary

Attributes

startdatetime
enddatetime
metered_costDecimal
metered_cost_breakdowndict[str, Decimal]

FileEntry

A file or directory entry listed from a Modal volume.

Attributes

pathstr
typeFileEntryType
mtimeint
sizeint

FileEntryType

class FileEntryType(enum.IntEnum)

Type of a file entry listed from a Modal volume.

The possible values are:

  • UNSPECIFIED
  • FILE
  • DIRECTORY
  • SYMLINK
  • FIFO
  • SOCKET

FileInfo

Metadata for a file or directory entry in a Sandbox.

Attributes

namestr
pathstr
typeFileType
sizeint
modeint
permissionsstr
ownerstr
groupstr
modified_timefloat
symlink_targetstr | None

is_file

is_file(self)

Return True if this entry is a regular file.

is_dir

is_dir(self)

Return True if this entry is a directory.

is_symlink(self)

Return True if this entry is a symbolic link.

FileType

class FileType(enum.Enum)

Type of a filesystem entry.

The possible values are:

  • FILE
  • DIRECTORY
  • SYMLINK

FileWatchEvent

A filesystem change event reported by Sandbox.filesystem.watch().

paths contains the absolute path(s) affected by the event. For most event types it holds a single entry. Rename operations are reported as Modify events: when both the source and destination fall within the watched scope, paths holds [source, destination]; when only one side of the rename is visible, paths holds that single path.

Attributes

pathslist[str]
typeFileWatchEventType

FileWatchEventType

class FileWatchEventType(enum.Enum)

Type of a filesystem watch event reported by Sandbox.filesystem.watch().

The possible values are:

  • Unknown
  • Access
  • Create
  • Modify
  • Remove

FunctionAutoscalerSettings

Attributes

min_containersint | None
max_containersint | None
scaledown_windowint | None
buffer_containersint | None

FunctionStats

Simple data structure storing stats for a running function.

Attributes

backlogint
num_total_runnersint
num_running_inputsint
input_headroomint

InputInfo

Simple data structure storing information about a function input.

Attributes

input_idstr
function_call_idstr
task_idstr
statusInputStatus
function_namestr
module_namestr
childrenlist["InputInfo"]

InputStatus

class InputStatus(enum.IntEnum)

Enum representing status of a function input.

The possible values are:

  • PENDING
  • SUCCESS
  • FAILURE
  • INIT_FAILURE
  • TERMINATED
  • TIMEOUT

LogEntry

A log entry queried through a Modal object or App.

The object_id field identifies the object or App whose log manager produced the entry. The context_ids field contains progressively narrower IDs corresponding to the context in which the log entry was emitted. For example, for a function log entry, this will contain the function call ID, the input ID, and the container ID.

Attributes

messagestr
timestampdatetime
sourceLogSource
object_idstr
context_idslist[str]

ProxyTokenInfo

Metadata about a proxy token, not including the token secret.

Attributes

token_idstr
created_atdatetime
scopedbool

QueueInfo

Information about a Queue object.

Attributes

namestr | None
created_atdatetime
created_bystr | None

SandboxConnectCredentials

Simple data structure storing credentials for making HTTP connections to a sandbox.

Attributes

urlstr
tokenstr

SecretInfo

Information about a Secret object.

Attributes

namestr | None
created_atdatetime
created_bystr | None

ServerAutoscalerSettings

Attributes

target_concurrencyint | float | None
min_containersint | None
max_containersint | None
buffer_containersint | None
scaleup_windowint | None
scaledown_windowint | None

TokenData

A token ID / secret pair.

Attributes

token_idstr
token_secretstr

VolumeCreateOptions

Options used when creating a Volume.

Attributes

experimental_optionsNotRequired[dict[str, Any]]

VolumeInfo

Information about a Volume object.

Attributes

namestr | None
created_atdatetime
created_bystr | None

WorkspaceBillingSummary

Attributes

startdatetime
enddatetime
metered_costDecimal
metered_cost_breakdowndict[str, Decimal]
adjustmentsdict[str, Decimal]
billed_costDecimal

WorkspaceMemberInfo

Metadata about a Workspace member.

Attributes

namestr
emailstr
user_idstr
rolestr
joined_atdatetime
last_active_atOptional[datetime]

WorkspaceSettings

Current settings for the workspace.

Attributes

default_environmentstr
image_builder_versionstr