Skip to main content
Version: Dev

Protocol Documentation

Table of Contents​

Top

klio_admin.proto​

DeleteBackupRequest​

DeleteBackupRequest is the request to delete a backup from the server.

FieldTypeLabelDescription
backup_namestringThe name of the backup to delete.
tiersTierrepeatedThe storage tiers from which to delete the backup. At least one tier must be specified.
cluster_namestringThe name of the cluster that owns the backup.

DeleteBackupResponse​

DeleteBackupResponse is the response to a backup deletion request.

FailedBackup​

FieldTypeLabelDescription
cluster_namestring
last_attempt_timegoogle.protobuf.Timestamp

FailedWAL​

FieldTypeLabelDescription
cluster_namestring
wal_namestring
sequenceuint64
last_attempt_timegoogle.protobuf.Timestamp

ListBackupsRequest​

ListBackupsResult​

FieldTypeLabelDescription
backup_manifestsbytesJSON-serialized array of backup manifests. Each manifest contains fields like: - id: string - cluster_name: string - timestamp: RFC3339 string - size_bytes: number See klioclient.BackupManifest for the canonical structure. We use JSON bytes here to avoid duplicating the internal type definition and conversion logic, as this is a local admin API.

QueueListFailedBackupsRequest​

FieldTypeLabelDescription
cluster_namestringoptional

QueueListFailedBackupsResponse​

FieldTypeLabelDescription
backupsFailedBackuprepeated

QueueListFailedWALsRequest​

FieldTypeLabelDescription
cluster_namestringoptional

QueueListFailedWALsResponse​

FieldTypeLabelDescription
walsFailedWALrepeated

QueueRetryBackupsRequest​

FieldTypeLabelDescription
cluster_namestringoptional

QueueRetryResponse​

QueueRetryWALsRequest​

FieldTypeLabelDescription
cluster_namestringoptional
wal_namesstringrepeated

QueueStatusRequest​

QueueStatusResponse​

FieldTypeLabelDescription
pending_backupsuint64Number of backup synchronization tasks pending in the queue
pending_walsuint64Number of WAL relay tasks pending in the queue

RefreshRequest​

RefreshResult​

Tier​

Tier represents a storage tier in the backup system.

NameNumberDescription
TIER_UNSPECIFIED0TIER_UNSPECIFIED is the default value and should not be used.
TIER_11TIER_1 represents the local cache storage.
TIER_22TIER_2 represents the object storage.

Admin​

Method NameRequest TypeResponse TypeDescription
RefreshRefreshRequestRefreshResultInvoked to refresh the policies and the cache of the Kopia server
ListBackupsListBackupsRequestListBackupsResultList every backup on the server
QueueListFailedBackupsQueueListFailedBackupsRequestQueueListFailedBackupsResponseList backups failed to be processed from the queue
QueueListFailedWALsQueueListFailedWALsRequestQueueListFailedWALsResponseList WAL files failed to be processed from the queue
QueueRetryWALsQueueRetryWALsRequestQueueRetryResponseRetry WAL files that failed to be processed from the queue
QueueRetryBackupsQueueRetryBackupsRequestQueueRetryResponseRetry Backups that failed to be processed from the queue
QueueStatusQueueStatusRequestQueueStatusResponseGet the status of the task queue (pending backups and WALs)
DeleteBackupDeleteBackupRequestDeleteBackupResponseDelete a backup from the server

Top

klio_wal.proto​

CloseBackupRequest​

This is sent to the WAL server every time a backup has been completed.

FieldTypeLabelDescription
cluster_namestringThe name of the cluster.
backup_namestringThe name of the backup.
timelineint32The backup timeline
start_walstringthe first WAL required to restore this backup.
end_walstringThe last WAL required to restore this backup.
segment_sizeuint64The size of a WAL segment. Needed to generate the sequence of WAL files between the start and the end.
send_to_tier2boolRequire this backup to be sent to tier2.
tier2_retention_policystringWhen present, set the tier2 retention policy to the specified JSON-serialized policy.
tier2_compression_policystringWhen present, set the tier2 compression policy to the specified JSON-serialized policy.

CloseBackupResult​

This is sent by the WAL server in response to a CloseBackupRequest message.

FieldTypeLabelDescription
tier2_scheduleboolTrue when the backup has been scheduled to be synchronized to tier2 storage
missing_wal_filesstringrepeatedList of WAL files needed by this backup but still not uploaded to tier1

ClusterMetadata​

The following messages are written in the cluster metadata file

FieldTypeLabelDescription
system_idstringThe system ID of the current cluster
gapsWALGaprepeatedThe gaps we are aware of in the collected WALs.

GetMetadataRequest​

FieldTypeLabelDescription
cluster_namestring

GetRequest​

FieldTypeLabelDescription
cluster_namestring
wal_namestring

GetResult​

FieldTypeLabelDescription
wal_blockbytes
segment_sizeuint64

PutRequest​

FieldTypeLabelDescription
cluster_namestring
wal_namestring
wal_blockbytes
segment_sizeuint64
wal_start_lsnuint64
send_to_tier2bool

PutResult​

FieldTypeLabelDescription
write_lsnuint64
flush_lsnuint64

RequestWALStartRequest​

FieldTypeLabelDescription
cluster_namestringThis is the cluster name
system_idstringThis is the system ID
current_wal_namestringThis is the current WAL name that is being written by PostgreSQL. If empty, the start WAL name will be found by looking at the stored WAL files.

RequestWALStartResult​

FieldTypeLabelDescription
wal_namestringThe WAL file where the client is expected to start streaming.

ResetWALStreamRequest​

FieldTypeLabelDescription
cluster_namestringThis is the cluster name
system_idstringThis is the system ID
current_wal_namestringThis is the current WAL name that is being written by PostgreSQL. If empty, the start WAL name will be found by looking at the stored WAL files.

ResetWALStreamResult​

FieldTypeLabelDescription
wal_namestringThe WAL file where the client is expected to start streaming.

StartWALFile​

The following messages are used to write a WAL file in the Klio WAL Storage area

FieldTypeLabelDescription
klio_versionuint64
file_lengthuint64

WALGap​

WALGap is a know gap in the WAL collection process. This is usually caused by an invocation of the reset-lsn Klio feature.

FieldTypeLabelDescription
tsgoogle.protobuf.TimestampWhen this gap was detected and created.
startstringWhen the gap started.
endstringWhen the gap ends.

WAL​

Method NameRequest TypeResponse TypeDescription
PutPutRequest streamPutResult stream
GetGetRequestGetResult stream
GetMetadataGetMetadataRequestClusterMetadata
RequestWALStartRequestWALStartRequestRequestWALStartResult
ResetWALStreamResetWALStreamRequestResetWALStreamResult
CloseBackupCloseBackupRequestCloseBackupResult

Scalar Value Types​

.proto TypeNotesC++JavaPythonGoC#PHPRuby
doubledoubledoublefloatfloat64doublefloatFloat
floatfloatfloatfloatfloat32floatfloatFloat
int32Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.int32intintint32intintegerBignum or Fixnum (as required)
int64Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.int64longint/longint64longinteger/stringBignum
uint32Uses variable-length encoding.uint32intint/longuint32uintintegerBignum or Fixnum (as required)
uint64Uses variable-length encoding.uint64longint/longuint64ulonginteger/stringBignum or Fixnum (as required)
sint32Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.int32intintint32intintegerBignum or Fixnum (as required)
sint64Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.int64longint/longint64longinteger/stringBignum
fixed32Always four bytes. More efficient than uint32 if values are often greater than 2^28.uint32intintuint32uintintegerBignum or Fixnum (as required)
fixed64Always eight bytes. More efficient than uint64 if values are often greater than 2^56.uint64longint/longuint64ulonginteger/stringBignum
sfixed32Always four bytes.int32intintint32intintegerBignum or Fixnum (as required)
sfixed64Always eight bytes.int64longint/longint64longinteger/stringBignum
boolboolbooleanbooleanboolboolbooleanTrueClass/FalseClass
stringA string must always contain UTF-8 encoded or 7-bit ASCII text.stringStringstr/unicodestringstringstringString (UTF-8)
bytesMay contain any arbitrary sequence of bytes.stringByteStringstr[]byteByteStringstringString (ASCII-8BIT)