Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches: [main]
pull_request:
types: [ opened, synchronize, reopened, labeled, unlabeled ]
merge_group:
branches: ["**"]

Expand Down
11 changes: 6 additions & 5 deletions apis/datasets/v1/collections.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ package datasets.v1;

import "datasets/v1/core.proto";
import "google/protobuf/go_features.proto";
import "tilebox/v1/id.proto";

option features.(pb.go).api_level = API_OPAQUE;
option features.field_presence = IMPLICIT;

// CreateCollectionRequest is used to create a new collection.
message CreateCollectionRequest {
ID dataset_id = 1; // The dataset id where the collection should be created.
tilebox.v1.ID dataset_id = 1; // The dataset id where the collection should be created.
string name = 2; // The name of the collection to create.
}

Expand All @@ -21,13 +22,13 @@ message GetCollectionByNameRequest {
string collection_name = 1; // The name of the collection to retrieve.
bool with_availability = 2; // If true, the response will include the availability interval.
bool with_count = 3; // If true, the response will include the number of entries.
ID dataset_id = 4; // The dataset id.
tilebox.v1.ID dataset_id = 4; // The dataset id.
}

// DeleteCollectionRequest contains the request parameters for deleting a single collection.
message DeleteCollectionRequest {
ID collection_id = 1; // The id of the collection to delete.
ID dataset_id = 2; // The dataset id.
tilebox.v1.ID collection_id = 1; // The id of the collection to delete.
tilebox.v1.ID dataset_id = 2; // The dataset id.
}

// DeleteCollectionResponse is the response to DeleteCollectionRequest.
Expand All @@ -36,7 +37,7 @@ message DeleteCollectionResponse {}
// ListCollectionsRequest contains the request parameters
// for retrieving a list of all available collections for a given dataset.
message ListCollectionsRequest {
ID dataset_id = 1; // The dataset id.
tilebox.v1.ID dataset_id = 1; // The dataset id.
bool with_availability = 2; // If true, the response will include the availability interval.
bool with_count = 3; // If true, the response will include the number of entries.
}
Expand Down
24 changes: 9 additions & 15 deletions apis/datasets/v1/core.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,11 @@ import "datasets/v1/dataset_type.proto";
import "google/protobuf/go_features.proto";
// https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp
import "google/protobuf/timestamp.proto";
import "tilebox/v1/id.proto";

option features.(pb.go).api_level = API_OPAQUE;
option features.field_presence = IMPLICIT;

/*
* General, multi purpose messages
*/
message ID {
bytes uuid = 1;
}

// A time interval
message TimeInterval {
google.protobuf.Timestamp start_time = 1; // Start time of the interval.
Expand All @@ -46,8 +40,8 @@ message TimeInterval {

// A datapoint interval
message DatapointInterval {
ID start_id = 1; // The id of the first data point in the interval.
ID end_id = 2; // The id of the last data point in the interval.
tilebox.v1.ID start_id = 1; // The id of the first data point in the interval.
tilebox.v1.ID end_id = 2; // The id of the last data point in the interval.

// We use exclusive for start and inclusive for end, because that way when both are false
// we have a half-open interval [start, end) which is the default behaviour we want to achieve.
Expand All @@ -74,7 +68,7 @@ message Pagination {
int64 limit = 1 [features.field_presence = EXPLICIT];
// Return entries starting after this entry.
// This is the id of the last entry returned in the previous page as the next parameter in each paginated query.
ID starting_after = 2 [features.field_presence = EXPLICIT];
tilebox.v1.ID starting_after = 2 [features.field_presence = EXPLICIT];
}

// Any is a message that can hold any other message as bytes.
Expand Down Expand Up @@ -128,7 +122,7 @@ message Datapoint {
message Collection {
string legacy_id = 1; // Here for backwards compatibility, to be removed in the future.
string name = 2;
ID id = 3;
tilebox.v1.ID id = 3;
}

// CollectionInfo contains information about the data available in a dataset collection
Expand All @@ -146,9 +140,9 @@ message CollectionInfos {
// Dataset contains information about a single dataset
message Dataset {
// dataset id
ID id = 1;
tilebox.v1.ID id = 1;
// the dataset group to which this dataset belongs
ID group_id = 2;
tilebox.v1.ID group_id = 2;
// the type of the dataset
AnnotatedType type = 3;
// normalized snake case name of the dataset, which can be used as a valid code identifier
Expand Down Expand Up @@ -190,9 +184,9 @@ enum Visibility {
// DatasetGroup represent a dataset group
message DatasetGroup {
// group id
ID id = 1;
tilebox.v1.ID id = 1;
// optional parent group id
ID parent_id = 2;
tilebox.v1.ID parent_id = 2;
// normalized snake case name of the dataset group, which can be used as a valid code identifier
string code_name = 3;
// display name of the group
Expand Down
7 changes: 4 additions & 3 deletions apis/datasets/v1/data_access.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package datasets.v1;
import "datasets/v1/core.proto";
import "datasets/v1/well_known_types.proto";
import "google/protobuf/go_features.proto";
import "tilebox/v1/id.proto";

option features.(pb.go).api_level = API_OPAQUE;
option features.field_presence = IMPLICIT;
Expand Down Expand Up @@ -38,8 +39,8 @@ message GetDatapointByIdRequest {

// QueryByIDRequest contains the request parameters for retrieving a single data point by its id.
message QueryByIDRequest {
repeated ID collection_ids = 1; // collection ids to query.
ID id = 2; // The id of the requested data point.
repeated tilebox.v1.ID collection_ids = 1; // collection ids to query.
tilebox.v1.ID id = 2; // The id of the requested data point.
bool skip_data = 3; // If true, only the datapoint metadata is returned.
}

Expand Down Expand Up @@ -78,7 +79,7 @@ message SpatialFilter {

// QueryRequest contains the request parameters for retrieving data from a Tilebox dataset.
message QueryRequest {
repeated ID collection_ids = 1; // collection ids to query.
repeated tilebox.v1.ID collection_ids = 1; // collection ids to query.
QueryFilters filters = 2; // Filters to apply to the query.

Pagination page = 3 [features.field_presence = EXPLICIT]; // The pagination parameters for this request.
Expand Down
11 changes: 6 additions & 5 deletions apis/datasets/v1/data_ingestion.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ package datasets.v1;

import "datasets/v1/core.proto";
import "google/protobuf/go_features.proto";
import "tilebox/v1/id.proto";

option features.(pb.go).api_level = API_OPAQUE;
option features.field_presence = IMPLICIT;

// Legacy ingest request
// IngestDatapointsRequest is used to ingest one or multiple datapoints into a collection.
message IngestDatapointsRequest {
ID collection_id = 1; // The collection to insert the datapoints into.
tilebox.v1.ID collection_id = 1; // The collection to insert the datapoints into.

Datapoints datapoints = 2;

Expand All @@ -26,7 +27,7 @@ message IngestDatapointsRequest {

// IngestRequest is used to ingest one or multiple datapoints into a collection.
message IngestRequest {
ID collection_id = 1; // The collection to insert the datapoints into.
tilebox.v1.ID collection_id = 1; // The collection to insert the datapoints into.

// The datapoints to insert. The values here are encoded protobuf messages. The type of the message is determined
// by the type of the dataset that the specified collection belongs to.
Expand All @@ -44,13 +45,13 @@ message IngestRequest {
message IngestResponse {
int64 num_created = 1; // The number of datapoints that were created.
int64 num_existing = 2; // The number of datapoints that were ignored because they already existed.
repeated ID datapoint_ids = 3; // The ids of the datapoints in the same order as the datapoints in the request.
repeated tilebox.v1.ID datapoint_ids = 3; // The ids of the datapoints in the same order as the datapoints in the request.
}

// DeleteRequest is used to delete multiple datapoints from a collection.
message DeleteRequest {
ID collection_id = 1;
repeated ID datapoint_ids = 2;
tilebox.v1.ID collection_id = 1;
repeated tilebox.v1.ID datapoint_ids = 2;
}

// DeleteResponse is used to indicate that multiple datapoints were deleted.
Expand Down
5 changes: 3 additions & 2 deletions apis/datasets/v1/dataset_type.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import "datasets/v1/well_known_types.proto";
import "google/protobuf/descriptor.proto";
import "google/protobuf/go_features.proto";
import "google/protobuf/timestamp.proto";
import "tilebox/v1/id.proto";

option features.(pb.go).api_level = API_OPAQUE;
option features.field_presence = IMPLICIT;
Expand Down Expand Up @@ -69,15 +70,15 @@ message AnnotatedType {
// message types that are Temporal Datasets.
message TemporalDatapoint {
google.protobuf.Timestamp time = 1; // The timestamp associated with ach data point.
UUID id = 2; // A universally unique identifier (UUID) that uniquely identifies each data point.
tilebox.v1.ID id = 2; // A universally unique identifier (UUID) that uniquely identifies each data point.
google.protobuf.Timestamp ingestion_time = 3; // The time the data point was ingested into the Tilebox API.
}

// SpatioTemporalDatapoint is a single datapoint in a spatiotemporal dataset. The message is a superset of all
// message types that are spatiotemporal Datasets.
message SpatioTemporalDatapoint {
google.protobuf.Timestamp time = 1; // The timestamp associated with each data point.
UUID id = 2; // A universally unique identifier (UUID) that uniquely identifies each data point.
tilebox.v1.ID id = 2; // A universally unique identifier (UUID) that uniquely identifies each data point.
google.protobuf.Timestamp ingestion_time = 3; // The time the data point was ingested into the Tilebox API.
Geometry geometry = 4; // The geometry associated with each data point.
}
9 changes: 5 additions & 4 deletions apis/datasets/v1/datasets.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package datasets.v1;
import "datasets/v1/core.proto";
import "datasets/v1/dataset_type.proto";
import "google/protobuf/go_features.proto";
import "tilebox/v1/id.proto";

option features.(pb.go).api_level = API_OPAQUE;
option features.field_presence = IMPLICIT;
Expand All @@ -28,13 +29,13 @@ message GetDatasetRequest {
// slug of the dataset to be returned, e.g. "open_data.copernicus.sentinel1_sar"
string slug = 1;
// or alternatively a dataset id
ID id = 2;
tilebox.v1.ID id = 2;
}

// UpdateDatasetRequest is used to update a dataset.
message UpdateDatasetRequest {
// id of the dataset to update.
ID id = 1;
tilebox.v1.ID id = 1;
// updated name of the dataset.
string name = 2;
// updated type of the dataset.
Expand Down Expand Up @@ -64,15 +65,15 @@ message Package {
// UpdateDatasetDescriptionRequest is used to update a dataset description
message UpdateDatasetDescriptionRequest {
// dataset id
ID id = 1;
tilebox.v1.ID id = 1;
// description of the dataset, in markdown format
string description = 2;
}

// DeleteDatasetRequest is used to delete a dataset
message DeleteDatasetRequest {
// id of the dataset to delete.
ID id = 1;
tilebox.v1.ID id = 1;
}

// DeleteDatasetResponse is the response to DeleteDatasetRequest
Expand Down
5 changes: 3 additions & 2 deletions apis/datasets/v1/timeseries.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ package datasets.v1;
import "datasets/v1/core.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/go_features.proto";
import "tilebox/v1/id.proto";

option features.(pb.go).api_level = API_OPAQUE;
option features.field_presence = IMPLICIT;

// TimeseriesDatasetChunk is a message that represents a chunk of a timeseries dataset.
// used by workflow tasks that are executed once for each datapoint in a timeseries dataset
message TimeseriesDatasetChunk {
ID dataset_id = 1;
ID collection_id = 2;
tilebox.v1.ID dataset_id = 1;
tilebox.v1.ID collection_id = 2;
TimeInterval time_interval = 3;
DatapointInterval datapoint_interval = 4;
int32 branch_factor = 5;
Expand Down
13 changes: 13 additions & 0 deletions apis/tilebox/v1/id.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
edition = "2023";

package tilebox.v1;

import "google/protobuf/go_features.proto";

option features.(pb.go).api_level = API_OPAQUE;
option features.field_presence = IMPLICIT;

// Bytes field (in message)
message ID {
bytes uuid = 1;
}
19 changes: 10 additions & 9 deletions apis/workflows/v1/automation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package workflows.v1;
import "google/protobuf/empty.proto";
import "google/protobuf/go_features.proto";
import "google/protobuf/timestamp.proto";
import "tilebox/v1/id.proto";
import "workflows/v1/core.proto";

option features.(pb.go).api_level = API_OPAQUE;
Expand All @@ -22,7 +23,7 @@ enum StorageType {

// Storage location is some kind of storage that can contain data files or objects and be used as a trigger source.
message StorageLocation {
UUID id = 1; // Unique identifier for the storage location
tilebox.v1.ID id = 1; // Unique identifier for the storage location
string location = 2; // A unique identifier for the storage location in the storage system
StorageType type = 3; // The type of the storage location, e.g. GCS, S3, FS
}
Expand All @@ -35,7 +36,7 @@ message StorageLocations {
// AutomationPrototype is a task prototype that can result in many submitted tasks. Task submissions are triggered by
// NRT triggers, such as bucket triggers or cron triggers.
message AutomationPrototype {
UUID id = 1; // Unique identifier for the trigger
tilebox.v1.ID id = 1; // Unique identifier for the trigger
string name = 2; // A human-readable name for the trigger
TaskSubmission prototype = 3; // The task submission to trigger

Expand All @@ -51,14 +52,14 @@ message Automations {
// StorageEventTrigger is a trigger that will trigger a task submission when an object matching the glob pattern is
// created in a storage location.
message StorageEventTrigger {
UUID id = 1; // Unique identifier for the trigger
tilebox.v1.ID id = 1; // Unique identifier for the trigger
StorageLocation storage_location = 2; // The storage location to watch for events
string glob_pattern = 3; // A glob pattern to match objects/files in the storage location
}

// CronTrigger is a trigger that will trigger a task submission on a schedule.
message CronTrigger {
UUID id = 1; // Unique identifier for the trigger
tilebox.v1.ID id = 1; // Unique identifier for the trigger
string schedule = 2; // A cron schedule for the trigger, e.g. "0 0 * * *" (every day at midnight)
}

Expand All @@ -79,7 +80,7 @@ enum StorageEventType {

// TriggeredStorageEvent contains the details of the concrete event that triggered a storage event trigger.
message TriggeredStorageEvent {
UUID storage_location_id = 1; // The storage location that triggered the task
tilebox.v1.ID storage_location_id = 1; // The storage location that triggered the task
StorageEventType type = 2; // The type of the storage event, e.g. created
// The object that triggered the task, e.g. a file name in a directory or object name in a bucket
string location = 3;
Expand All @@ -93,7 +94,7 @@ message TriggeredCronEvent {
// DeleteAutomationRequest requests the deletion of an automation.
message DeleteAutomationRequest {
// The ID of the automation to delete.
UUID automation_id = 1;
tilebox.v1.ID automation_id = 1;
// Whether to cancel all jobs that have been created by this automation.
bool cancel_jobs = 2;
}
Expand All @@ -105,16 +106,16 @@ service AutomationService {
// ListStorageLocations lists all the storage buckets that are available for use as bucket triggers.
rpc ListStorageLocations(google.protobuf.Empty) returns (StorageLocations);
// GetStorageLocation gets a storage location by its ID.
rpc GetStorageLocation(UUID) returns (StorageLocation);
rpc GetStorageLocation(tilebox.v1.ID) returns (StorageLocation);
// CreateStorageLocation creates a new storage bucket.
rpc CreateStorageLocation(StorageLocation) returns (StorageLocation);
// DeleteStorageLocation deletes a storage location.
rpc DeleteStorageLocation(UUID) returns (google.protobuf.Empty);
rpc DeleteStorageLocation(tilebox.v1.ID) returns (google.protobuf.Empty);

// ListAutomations lists all the automations that are currently registered in a namespace.
rpc ListAutomations(google.protobuf.Empty) returns (Automations);
// GetAutomation gets an automation by its ID.
rpc GetAutomation(UUID) returns (AutomationPrototype);
rpc GetAutomation(tilebox.v1.ID) returns (AutomationPrototype);
// CreateAutomation creates a new automation in a namespace.
rpc CreateAutomation(AutomationPrototype) returns (AutomationPrototype);
// UpdateAutomation updates an automation in a namespace.
Expand Down
Loading