2023-03-28 22:48:58 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
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;
|
2023-04-11 18:23:14 +00:00
|
|
|
map<string, Status> status = 6;
|
2023-03-09 19:40:23 +00:00
|
|
|
|
|
|
|
google.protobuf.Any data = 7;
|
|
|
|
}
|
|
|
|
|
2023-04-11 18:23:14 +00:00
|
|
|
message Status {
|
|
|
|
string observed_generation = 1;
|
|
|
|
repeated Condition conditions = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message Condition {
|
|
|
|
enum State {
|
|
|
|
// buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX
|
|
|
|
STATE_UNKNOWN = 0;
|
|
|
|
STATE_TRUE = 1;
|
|
|
|
STATE_FALSE = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
string type = 1;
|
|
|
|
State state = 2;
|
|
|
|
string reason = 3;
|
|
|
|
string message = 4;
|
|
|
|
Reference resource = 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
message Reference {
|
|
|
|
Type type = 1;
|
|
|
|
Tenancy tenancy = 2;
|
|
|
|
string name = 3;
|
|
|
|
string section = 4;
|
|
|
|
}
|
|
|
|
|
2023-03-09 19:40:23 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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 WriteStatusRequest {
|
|
|
|
ID id = 1;
|
|
|
|
string version = 2;
|
|
|
|
string key = 3;
|
2023-04-11 18:23:14 +00:00
|
|
|
Status status = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
message WriteStatusResponse {
|
|
|
|
Resource resource = 1;
|
2023-03-09 19:40:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
}
|