You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ha...@apache.org on 2024/12/30 08:03:24 UTC
(skywalking-banyandb) branch property created (now 7c3b4816)
This is an automated email from the ASF dual-hosted git repository.
hanahmily pushed a change to branch property
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git
at 7c3b4816 Update API
This branch includes the following new commits:
new 7c3b4816 Update API
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(skywalking-banyandb) 01/01: Update API
Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hanahmily pushed a commit to branch property
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git
commit 7c3b4816cbee5b6db6762b38c5a4f177189170cb
Author: Gao Hongtao <ha...@gmail.com>
AuthorDate: Mon Dec 30 08:03:04 2024 +0000
Update API
Signed-off-by: Gao Hongtao <ha...@gmail.com>
---
api/proto/banyandb/property/v1/property.proto | 7 --
api/proto/banyandb/property/v1/rpc.proto | 57 ++++++++--------
docs/api-reference.md | 94 +++++----------------------
3 files changed, 43 insertions(+), 115 deletions(-)
diff --git a/api/proto/banyandb/property/v1/property.proto b/api/proto/banyandb/property/v1/property.proto
index ad124a4b..6e6b5d86 100644
--- a/api/proto/banyandb/property/v1/property.proto
+++ b/api/proto/banyandb/property/v1/property.proto
@@ -43,11 +43,4 @@ message Property {
repeated model.v1.Tag tags = 2 [(validate.rules).repeated.min_items = 1];
// updated_at indicates when the property is updated
google.protobuf.Timestamp updated_at = 3;
- // readonly. lease_id is the ID of the lease that attached to key.
- int64 lease_id = 4;
- // ttl indicates the time to live of the property.
- // It's a string in the format of "1h", "2m", "3s", "1500ms".
- // It defaults to 0s, which means the property never expires.
- // The minimum allowed ttl is 1s.
- string ttl = 5;
}
diff --git a/api/proto/banyandb/property/v1/rpc.proto b/api/proto/banyandb/property/v1/rpc.proto
index 06a5d35a..97d19e6e 100644
--- a/api/proto/banyandb/property/v1/rpc.proto
+++ b/api/proto/banyandb/property/v1/rpc.proto
@@ -20,6 +20,9 @@ syntax = "proto3";
package banyandb.property.v1;
import "banyandb/common/v1/common.proto";
+import "banyandb/common/v1/trace.proto";
+import "banyandb/model/v1/common.proto";
+import "banyandb/model/v1/query.proto";
import "banyandb/property/v1/property.proto";
import "google/api/annotations.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
@@ -58,31 +61,30 @@ message DeleteResponse {
uint32 tags_num = 2;
}
-message GetRequest {
- banyandb.property.v1.Metadata metadata = 1 [(validate.rules).message.required = true];
- repeated string tags = 2;
-}
-
-message GetResponse {
- banyandb.property.v1.Property property = 1;
+// QueryRequest is the request contract for query.
+message QueryRequest {
+ // groups indicate where the data points are stored.
+ repeated string groups = 1 [(validate.rules).repeated.min_items = 1];
+ // container is created when it receives the first property
+ string container = 2 [(validate.rules).string.min_len = 1];
+ // ids is the identities of properties
+ repeated string ids = 3;
+ // criteria is used to filter properties based on tags
+ model.v1.Criteria criteria = 4;
+ // tag_projection can be used to select tags of the data points in the response
+ repeated string tag_projection = 5;
+ // trace is used to enable trace for the query
+ bool trace = 6;
}
-message ListRequest {
- banyandb.common.v1.Metadata container = 1 [(validate.rules).message.required = true];
- repeated string ids = 2;
- repeated string tags = 3;
+// QueryResponse is the response for a query to the Query module.
+message QueryResponse {
+ // properties are the actual data returned
+ repeated banyandb.property.v1.Property properties = 1;
+ // trace contains the trace information of the query when trace is enabled
+ common.v1.Trace trace = 2;
}
-message ListResponse {
- repeated banyandb.property.v1.Property property = 1;
-}
-
-message KeepAliveRequest {
- int64 lease_id = 1;
-}
-
-message KeepAliveResponse {}
-
service PropertyService {
// Apply creates a property if it's absent, or update a existed one based on a strategy.
rpc Apply(ApplyRequest) returns (ApplyResponse) {
@@ -96,17 +98,10 @@ service PropertyService {
option (google.api.http) = {delete: "/v1/property/{metadata.container.group}/{metadata.container.name}/{metadata.id}/{tags}"};
}
- rpc Get(GetRequest) returns (GetResponse) {
- option (google.api.http) = {get: "/v1/property/{metadata.container.group}/{metadata.container.name}/{metadata.id}/{tags}"};
- }
-
- rpc List(ListRequest) returns (ListResponse) {
+ rpc Query(QueryRequest) returns (QueryResponse) {
option (google.api.http) = {
- get: "/v1/property/lists/{container.group}/{container.name}/{ids}/{tags}"
- additional_bindings: {get: "/v1/property/lists/{container.group}"}
+ post: "/v1/property/query"
+ body: "*"
};
}
- rpc KeepAlive(KeepAliveRequest) returns (KeepAliveResponse) {
- option (google.api.http) = {put: "/v1/property/lease/{lease_id}"};
- }
}
diff --git a/docs/api-reference.md b/docs/api-reference.md
index 96d84f35..8b70b191 100644
--- a/docs/api-reference.md
+++ b/docs/api-reference.md
@@ -196,12 +196,8 @@
- [ApplyResponse](#banyandb-property-v1-ApplyResponse)
- [DeleteRequest](#banyandb-property-v1-DeleteRequest)
- [DeleteResponse](#banyandb-property-v1-DeleteResponse)
- - [GetRequest](#banyandb-property-v1-GetRequest)
- - [GetResponse](#banyandb-property-v1-GetResponse)
- - [KeepAliveRequest](#banyandb-property-v1-KeepAliveRequest)
- - [KeepAliveResponse](#banyandb-property-v1-KeepAliveResponse)
- - [ListRequest](#banyandb-property-v1-ListRequest)
- - [ListResponse](#banyandb-property-v1-ListResponse)
+ - [QueryRequest](#banyandb-property-v1-QueryRequest)
+ - [QueryResponse](#banyandb-property-v1-QueryResponse)
- [ApplyRequest.Strategy](#banyandb-property-v1-ApplyRequest-Strategy)
@@ -2805,8 +2801,6 @@ Property stores the user defined data
| metadata | [Metadata](#banyandb-property-v1-Metadata) | | metadata is the identity of a property |
| tags | [banyandb.model.v1.Tag](#banyandb-model-v1-Tag) | repeated | tag stores the content of a property |
| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | updated_at indicates when the property is updated |
-| lease_id | [int64](#int64) | | readonly. lease_id is the ID of the lease that attached to key. |
-| ttl | [string](#string) | | ttl indicates the time to live of the property. It's a string in the format of "1h", "2m", "3s", "1500ms". It defaults to 0s, which means the property never expires. The minimum allowed ttl is 1s. |
@@ -2894,88 +2888,36 @@ Property stores the user defined data
-<a name="banyandb-property-v1-GetRequest"></a>
-
-### GetRequest
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| metadata | [Metadata](#banyandb-property-v1-Metadata) | | |
-| tags | [string](#string) | repeated | |
-
-
-
-
-
-
-<a name="banyandb-property-v1-GetResponse"></a>
-
-### GetResponse
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| property | [Property](#banyandb-property-v1-Property) | | |
-
-
-
-
-
-
-<a name="banyandb-property-v1-KeepAliveRequest"></a>
-
-### KeepAliveRequest
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| lease_id | [int64](#int64) | | |
-
-
-
-
-
-
-<a name="banyandb-property-v1-KeepAliveResponse"></a>
-
-### KeepAliveResponse
-
-
-
-
-
-
-
-<a name="banyandb-property-v1-ListRequest"></a>
-
-### ListRequest
+<a name="banyandb-property-v1-QueryRequest"></a>
+### QueryRequest
+QueryRequest is the request contract for query.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| container | [banyandb.common.v1.Metadata](#banyandb-common-v1-Metadata) | | |
-| ids | [string](#string) | repeated | |
-| tags | [string](#string) | repeated | |
-
+| groups | [string](#string) | repeated | groups indicate where the data points are stored. |
+| container | [string](#string) | | container is created when it receives the first property |
+| ids | [string](#string) | repeated | ids is the identities of properties |
+| criteria | [banyandb.model.v1.Criteria](#banyandb-model-v1-Criteria) | | criteria is used to filter properties based on tags |
+| tag_projection | [string](#string) | repeated | tag_projection can be used to select tags of the data points in the response |
+| trace | [bool](#bool) | | trace is used to enable trace for the query |
-<a name="banyandb-property-v1-ListResponse"></a>
-### ListResponse
+<a name="banyandb-property-v1-QueryResponse"></a>
+### QueryResponse
+QueryResponse is the response for a query to the Query module.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| property | [Property](#banyandb-property-v1-Property) | repeated | |
+| properties | [Property](#banyandb-property-v1-Property) | repeated | properties are the actual data returned |
+| trace | [banyandb.common.v1.Trace](#banyandb-common-v1-Trace) | | trace contains the trace information of the query when trace is enabled |
@@ -3010,9 +2952,7 @@ Property stores the user defined data
| ----------- | ------------ | ------------- | ------------|
| Apply | [ApplyRequest](#banyandb-property-v1-ApplyRequest) | [ApplyResponse](#banyandb-property-v1-ApplyResponse) | Apply creates a property if it's absent, or update a existed one based on a strategy. |
| Delete | [DeleteRequest](#banyandb-property-v1-DeleteRequest) | [DeleteResponse](#banyandb-property-v1-DeleteResponse) | |
-| Get | [GetRequest](#banyandb-property-v1-GetRequest) | [GetResponse](#banyandb-property-v1-GetResponse) | |
-| List | [ListRequest](#banyandb-property-v1-ListRequest) | [ListResponse](#banyandb-property-v1-ListResponse) | |
-| KeepAlive | [KeepAliveRequest](#banyandb-property-v1-KeepAliveRequest) | [KeepAliveResponse](#banyandb-property-v1-KeepAliveResponse) | |
+| Query | [QueryRequest](#banyandb-property-v1-QueryRequest) | [QueryResponse](#banyandb-property-v1-QueryResponse) | |