api/proto/banyandb/property/v1/rpc.proto (86 lines of code) (raw):
// Licensed to Apache Software Foundation (ASF) under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Apache Software Foundation (ASF) licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
syntax = "proto3";
package banyandb.property.v1;
import "banyandb/common/v1/common.proto";
import "banyandb/property/v1/property.proto";
import "google/api/annotations.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
import "validate/validate.proto";
option go_package = "github.com/apache/skywalking-banyandb/api/proto/banyandb/property/v1";
option java_package = "org.apache.skywalking.banyandb.property.v1";
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {base_path: "/api"};
message ApplyRequest {
banyandb.property.v1.Property property = 1 [(validate.rules).message.required = true];
enum Strategy {
STRATEGY_UNSPECIFIED = 0;
STRATEGY_MERGE = 1;
STRATEGY_REPLACE = 2;
}
// strategy indicates how to update a property. It defaults to STRATEGY_MERGE
Strategy strategy = 2;
}
message ApplyResponse {
// created indicates whether the property existed.
// True: the property is absent. False: the property existed.
bool created = 1;
uint32 tags_num = 2;
}
message DeleteRequest {
banyandb.property.v1.Metadata metadata = 1 [(validate.rules).message.required = true];
repeated string tags = 2;
}
message DeleteResponse {
bool deleted = 1;
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;
}
message ListRequest {
banyandb.common.v1.Metadata container = 1 [(validate.rules).message.required = true];
repeated string ids = 2;
repeated string tags = 3;
}
message ListResponse {
repeated banyandb.property.v1.Property property = 1;
}
service PropertyService {
// Apply creates a property if it's absent, or update a existed one based on a strategy.
rpc Apply(ApplyRequest) returns (ApplyResponse) {
option (google.api.http) = {
put: "/v1/property/{property.metadata.container.group}/{property.metadata.container.name}/{property.metadata.id}"
body: "*"
};
}
rpc Delete(DeleteRequest) returns (DeleteResponse) {
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) {
option (google.api.http) = {
get: "/v1/property/lists/{container.group}/{container.name}/{ids}/{tags}"
additional_bindings {get: "/v1/property/lists/{container.group}"}
};
}
}