Skip to main content
Version: 1.5.0

Data Structures

TTLParams

OORT has three queues for any data topic: urgent, bulk, and surplus. Data in the urgent queue stage is transmitted first, followed by data in the bulk queue stage, followed by data in the surplus queue stage.

The developer may set a file's Time-to-live (TTL) for each stage individually. For lower priority data it is possible to skip the urgent stage and add the data directly to bulk, or skip both the urgent and bulk stages and add directly to surplus.

Time-to-live (TTL) parameters for a sent item are described below.

See SendFileRequest for an example.

Members

Unless otherwise specified, all time values are in seconds.

NameTypeDescriptionDefault
urgentintTTL for urgent queue -- data here is transmitted first, and moved to bulk when TTL expires9000 (2.5 hours)
bulkintTTL for bulk queue -- data here is transmitted second, and moved to surplus when TTL expires43200 (12 hours)
surplusintTTL for surplus queue -- data here is transmitted third, and deleted when TTL expires172800 (48 hours)

Data in all three queues is transmitted First In First Out (FIFO). Below is a guideline for how to determine the appropriate TTL values for a given piece of data your payload is producing:

  1. Do you want this data type to skip the line and get downloaded ahead of the rest of your data? If no set urgent TTL to zero. If yes set urgent TTL to the number of seconds you want the skipping to be in effect.
  2. Does this data at some point become stale, i.e. substantially less valuable to you? If no, you don't need to set it, the default value will be applied. If yes, set bulk TTL to the number of seconds after which you consider it stale.
  3. Once this data becomes stale do you still want to try to download it if there’s remaining downlink budget for your payload? If yes set surplus TTL to the number of seconds you wish to continue trying before the data is deleted.

SendOptions

Options to apply to a send request

See SendFileRequest for an example.

Members

NameTypeDescriptionDefault
TTLParamsTTLParamstime-to-live parameterssee TTLParams
reliablebooleanwhether to send an item reliable, i.e., with retriestrue

SendFileRequest

A request to send a file via the Data Pipeline API

#include "SdkAPI.h"

ttl_params_t *ttl;
send_options_t *send_options;
send_file_request_t *request;

/* for TTL Params */
int urgent = 9000;
int bulk = 43200;
int surplus = 172800;
/* for SendOptions */
int reliable = 1;
/* for SendFileRequest */
/* NB: all the strings are owned by the reqeust object and will be freed
with it so they must be copied if they come from storage that cannot
be freed, like static strings or argv.
*/

char *dest = strdup("ground");
char *topic = strdup("logs");
char *filename = strdup("/file/to/send");

ttl = ttl_params_create(urgent, bulk, surplus);
send_options = send_options_create(ttl, reliable);
request = send_file_request_create(dest, filename, topic, send_options);

/* ... use request ... */

send_file_request_free(request); /* frees all child structures */

Members

NameTypeDescriptionDefault
destinationstringthe destination to send the file to-
filepathstringThe source file path. Must be absolute-
topicstringThe pipeline topic to send the file to-
optionsSendOptionsThe options to applysee SendOptions

SendFileResponse

The response received from a send file request.


send_file_response_t *response;

/* create apiClient_t *client, send_file_request *request */

response = SdkAPI_sendFile(client, request);

if (response != NULL) {
fprintf(stderr, "The file was sent with uuid %s\n", response->uuid);
send_file_response_free(response);
}

Members

NameTypeDescriptionDefault
UUIDstringthe unique identifier for the file transfer-

FileInfo

Information about the file and the transfer request.

See RetrieveFileRequest for an example.

Members

Times are unix epoch times (i.e., seconds since Jan 1, 1970)

NameTypeDescriptionDefault
idstringthe UUID for the file transfer-
pathstringthe original path this file was sent as-
sizeintegerthe original size of this file-
modifiedintegerthe time this file was most recently modfied-
createdintegerthe time this file was created-
crc32stringCRC-32 calculated for the file-

AvailableFilesResponse

Response to available files query

See RetrieveFileRequest for an example.

Members

NameTypeDescriptionDefault
filesFileInfo[]list of the available files-
overflowbooleantrue if there are mote files available than could be returned in a single call-

RetrieveFileRequest

Request to retrieve a file from the Data Pipeline API


available_files_response_t *avail;
file_info_t *finfo;
retrieve_file_request_t *request;

char *topic;

topic = strdup("mytopic");

avail = SdkAPI_queryAvailableFiles(client, topic);

char *destdir = "/destination/directory";

if (avail != NULL) {
listEntry_t *item;
fprintf(stderr, "Available files:\n");
/* provided helper macros */
list_ForEach(item, avail->files) {
file_info_t *finfo = (file_info_t *)item->data;
file_info_t *finfo2;
char *destpath;
size_t pathlen;
fprintf(stderr, "%s: %s\n", finfo->id, finfo->path);
pathlen = snprintf(NULL, 0, "%s/%s", destdir, basename(finfo->path));
destpath = (char *)malloc(pathlen + 1);
pathlen = snprintf(destpath, pathlen, "%s/%s", destdir, basename(finfo->path));
request = retrieve_file_request_create(strdup(finfo->id), destpath);
finfo2 = SdkAPI_retrieveFile(client, request);
fprintf(stderr, "retrieved %s\n", finfo2->id);
file_info_free(finfo2);
file_info_free(finfo);
retrieve_file_request_free(request);
}
available_files_response_free(avail);
}

Members

NameTypeDescriptionDefault
idstringthe UUID for the file transfer-
save_pathstringThe absolute path for the file to be saved to.-

ErrorResponse

Any error returned from the Data Pipeline API.

Members

NameTypeDescriptionDefault
statusintegerstatus code for the error-
messagestringThe error message-