// Proto messages and service definition for the APIs related to creating and managing datasets. edition = "2023"; package datasets.v1; import "buf/validate/validate.proto"; import "datasets/v1/core.proto"; import "datasets/v1/dataset_type.proto"; import "datasets/v1/presentation.proto"; import "tilebox/v1/id.proto"; option features.field_presence = IMPLICIT; // CreateDatasetRequest is used to create a new dataset. message CreateDatasetRequest { // name of the dataset to create. string name = 1 [ (buf.validate.field).required = true, (buf.validate.field).string.min_len = 1, (buf.validate.field).string.max_len = 100 ]; // Message type of the dataset to create, including per-field source mappings, queryable metadata, and roles. DatasetType type = 2 [(buf.validate.field).required = true]; // short text summary of the dataset to create. string summary = 3 [(buf.validate.field).string.max_len = 50000]; // normalized snake case name of the dataset to create. string code_name = 4 [ (buf.validate.field).required = true, (buf.validate.field).string.min_len = 1, (buf.validate.field).string.max_len = 100, (buf.validate.field).string.pattern = "^[a-z][a-z0-9_]*$" ]; // optional description of the dataset, in markdown format string description = 5 [(buf.validate.field).string.max_len = 1000000]; // Optional metadata for catalog display and client-side discovery. DatasetPresentation presentation = 6; } // GetDatasetRequest is the request message for the GetDataset RPC method for fetching a single dataset message GetDatasetRequest { option (buf.validate.message).oneof = { fields: [ "slug", "id" ] required: true }; // slug of the dataset to be returned, e.g. "open_data.copernicus.sentinel1_sar" // it must contain at least one group and one dataset code name separated by a "." string slug = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z0-9_]+(?:\\.[a-zA-Z0-9_]+)*$"]; // or alternatively a dataset id tilebox.v1.ID id = 2; } // UpdateDatasetRequest updates a dataset, by updating all fields that are set to their new values. // If a field is not set, it will not be updated. message UpdateDatasetRequest { // id of the dataset to update. tilebox.v1.ID id = 1 [(buf.validate.field).required = true]; // updated name of the dataset. string name = 2 [ features.field_presence = EXPLICIT, (buf.validate.field).string.min_len = 1, (buf.validate.field).string.max_len = 100 ]; // Updated type of the dataset, including per-field source mappings, queryable metadata, and roles. DatasetType type = 3 [features.field_presence = EXPLICIT]; // updated summary of the dataset. string summary = 4 [ features.field_presence = EXPLICIT, (buf.validate.field).string.max_len = 50000 ]; // updated code name of the dataset. string code_name = 5 [ features.field_presence = EXPLICIT, (buf.validate.field).string.min_len = 1, (buf.validate.field).string.max_len = 100, (buf.validate.field).string.pattern = "^[a-z][a-z0-9_]*$" ]; // updated description of the dataset, in markdown format string description = 6 [ features.field_presence = EXPLICIT, (buf.validate.field).string.max_len = 1000000 ]; // Replaces the entire presentation when supplied. Omit to leave unchanged; send an empty message to clear it. DatasetPresentation presentation = 7 [features.field_presence = EXPLICIT]; } // DeleteDatasetRequest is used to delete a dataset message DeleteDatasetRequest { // id of the dataset to delete. tilebox.v1.ID id = 1 [(buf.validate.field).required = true]; } // DeleteDatasetResponse is the response to DeleteDatasetRequest message DeleteDatasetResponse { // whether the dataset has been trashed or not bool trashed = 1; } // ListDatasetsRequest is used to request a list of datasets message ListDatasetsRequest {} // A list of datasets and dataset groups message ListDatasetsResponse { // list of datasets a user has access to repeated Dataset datasets = 1; // list of dataset groups a user has access to repeated DatasetGroup groups = 2; // an optional message to be displayed to the user when they access a list of datasets string server_message = 3; // Number of datasets that the users organization is the owner of int64 owned_datasets = 4; // Maximum number of datasets that can be created and therefore owned by the organization. Nil means unlimited. int64 maximum_owned_datasets = 5 [features.field_presence = EXPLICIT]; } // DatasetsService is the CRUD service for Tilebox datasets. service DatasetService { rpc CreateDataset(CreateDatasetRequest) returns (Dataset) {} rpc GetDataset(GetDatasetRequest) returns (Dataset) {} rpc UpdateDataset(UpdateDatasetRequest) returns (Dataset) {} rpc DeleteDataset(DeleteDatasetRequest) returns (DeleteDatasetResponse) {} rpc ListDatasets(ListDatasetsRequest) returns (ListDatasetsResponse) {} }