2023-03-09 19:40:23 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package hashicorp.consul.resource;
|
|
|
|
|
|
|
|
import "annotations/ratelimit/ratelimit.proto";
|
|
|
|
import "google/protobuf/any.proto";
|
|
|
|
|
|
|
|
message Type {
|
|
|
|
string group = 1;
|
|
|
|
string group_version = 2;
|
|
|
|
string kind = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message Tenancy {
|
|
|
|
string partition = 1;
|
|
|
|
string namespace = 2;
|
|
|
|
string peer_name = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ID {
|
|
|
|
string uid = 1;
|
|
|
|
string name = 2;
|
|
|
|
Type type = 3;
|
|
|
|
Tenancy tenancy = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
message Resource {
|
|
|
|
ID id = 1;
|
|
|
|
ID owner = 2;
|
|
|
|
string version = 3;
|
|
|
|
string generation = 4;
|
|
|
|
|
|
|
|
map<string, string> metadata = 5;
|
|
|
|
reserved 6; // status
|
|
|
|
|
|
|
|
google.protobuf.Any data = 7;
|
|
|
|
}
|
|
|
|
|
|
|
|
message WatchEvent {
|
|
|
|
enum Operation {
|
|
|
|
OPERATION_UNSPECIFIED = 0;
|
|
|
|
OPERATION_UPSERT = 1;
|
|
|
|
OPERATION_DELETE = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
Operation operation = 1;
|
|
|
|
Resource resource = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
service ResourceService {
|
|
|
|
rpc Read(ReadRequest) returns (ReadResponse) {
|
2023-03-20 15:24:29 +00:00
|
|
|
option (hashicorp.consul.internal.ratelimit.spec) = {
|
|
|
|
operation_type: OPERATION_TYPE_READ,
|
|
|
|
operation_category: OPERATION_CATEGORY_RESOURCE
|
|
|
|
};
|
2023-03-09 19:40:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
rpc Write(WriteRequest) returns (WriteResponse) {
|
2023-03-20 15:24:29 +00:00
|
|
|
option (hashicorp.consul.internal.ratelimit.spec) = {
|
|
|
|
operation_type: OPERATION_TYPE_WRITE,
|
|
|
|
operation_category: OPERATION_CATEGORY_RESOURCE
|
|
|
|
};
|
2023-03-09 19:40:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
rpc WriteStatus(WriteStatusRequest) returns (WriteStatusResponse) {
|
2023-03-20 15:24:29 +00:00
|
|
|
option (hashicorp.consul.internal.ratelimit.spec) = {
|
|
|
|
operation_type: OPERATION_TYPE_WRITE,
|
|
|
|
operation_category: OPERATION_CATEGORY_RESOURCE
|
|
|
|
};
|
2023-03-09 19:40:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
rpc List(ListRequest) returns (ListResponse) {
|
2023-03-20 15:24:29 +00:00
|
|
|
option (hashicorp.consul.internal.ratelimit.spec) = {
|
|
|
|
operation_type: OPERATION_TYPE_READ,
|
|
|
|
operation_category: OPERATION_CATEGORY_RESOURCE
|
|
|
|
};
|
2023-03-09 19:40:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
rpc Delete(DeleteRequest) returns (DeleteResponse) {
|
2023-03-20 15:24:29 +00:00
|
|
|
option (hashicorp.consul.internal.ratelimit.spec) = {
|
|
|
|
operation_type: OPERATION_TYPE_WRITE,
|
|
|
|
operation_category: OPERATION_CATEGORY_RESOURCE
|
|
|
|
};
|
2023-03-09 19:40:23 +00:00
|
|
|
}
|
|
|
|
|
2023-03-27 19:37:54 +00:00
|
|
|
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
|
|
|
|
rpc WatchList(WatchListRequest) returns (stream WatchEvent) {
|
2023-03-20 15:24:29 +00:00
|
|
|
option (hashicorp.consul.internal.ratelimit.spec) = {
|
|
|
|
operation_type: OPERATION_TYPE_READ,
|
|
|
|
operation_category: OPERATION_CATEGORY_RESOURCE
|
|
|
|
};
|
2023-03-09 19:40:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
enum Condition {
|
|
|
|
CONDITION_UNSPECIFIED = 0;
|
|
|
|
CONDITION_ACCEPTED = 1;
|
|
|
|
CONDITION_INVALID = 2;
|
|
|
|
CONDITION_PERSISTENT_FAILURE = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ReadRequest {
|
|
|
|
ID id = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ReadResponse {
|
|
|
|
Resource resource = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ListRequest {
|
|
|
|
Type type = 1;
|
|
|
|
Tenancy tenancy = 2;
|
|
|
|
string name_prefix = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ListResponse {
|
|
|
|
repeated Resource resources = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message WriteRequest {
|
|
|
|
Resource resource = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message WriteResponse {
|
|
|
|
Resource resource = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message WriteStatusResponse {
|
|
|
|
Resource resource = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message WriteStatusRequest {
|
|
|
|
ID id = 1;
|
|
|
|
string version = 2;
|
|
|
|
string key = 3;
|
|
|
|
Condition condition = 4;
|
|
|
|
string state = 5;
|
|
|
|
repeated string messages = 6;
|
|
|
|
}
|
|
|
|
|
|
|
|
message DeleteRequest {
|
|
|
|
ID id = 1;
|
|
|
|
string version = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message DeleteResponse {}
|
|
|
|
|
2023-03-27 19:37:54 +00:00
|
|
|
message WatchListRequest {
|
|
|
|
Type type = 1;
|
|
|
|
Tenancy tenancy = 2;
|
|
|
|
string name_prefix = 3;
|
2023-03-09 19:40:23 +00:00
|
|
|
}
|