All Downloads are FREE. Search and download functionalities are using the official Maven repository.

banyandb.v1.banyandb-property.proto Maven / Gradle / Ivy

There is a newer version: 0.8.0-rc0
Show newest version
// 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";

option java_package = "org.apache.skywalking.banyandb.property.v1";

package banyandb.property.v1;

import "google/protobuf/timestamp.proto";
import "validate/validate.proto";
import "banyandb/v1/banyandb-common.proto";
import "banyandb/v1/banyandb-model.proto";

// Metadata is for multi-tenant use
message Metadata {
  // container is created when it receives the first property
  common.v1.Metadata container = 1;
  // id identifies a property
  string id = 2;
}


// Property stores the user defined data
message Property {
  // metadata is the identity of a property
  Metadata metadata = 1;
  // tag stores the content of a property
  repeated model.v1.Tag tags = 2;
  // 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;
}

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;
  int64 lease_id = 3;
}

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;
}

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);
  rpc Delete(DeleteRequest) returns (DeleteResponse);
  rpc Get(GetRequest) returns (GetResponse);
  rpc List(ListRequest) returns (ListResponse);
  rpc KeepAlive(KeepAliveRequest) returns (KeepAliveResponse);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy