consul/proto/private/pbstorage/raft.proto

120 lines
3.5 KiB
Protocol Buffer
Raw Permalink Normal View History

// Copyright (c) HashiCorp, Inc.
[COMPLIANCE] License changes (#18443) * Adding explicit MPL license for sub-package This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository. * Adding explicit MPL license for sub-package This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository. * Updating the license from MPL to Business Source License Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at <Blog URL>, FAQ at www.hashicorp.com/licensing-faq, and details of the license at www.hashicorp.com/bsl. * add missing license headers * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 --------- Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
2023-08-11 13:12:13 +00:00
// SPDX-License-Identifier: BUSL-1.1
2023-04-04 16:30:06 +00:00
syntax = "proto3";
// This package contains types used by the Raft storage backend that lives in
// the internal/storage/raft Go package.
package hashicorp.consul.internal.storage.raft;
import "annotations/ratelimit/ratelimit.proto";
import "google/protobuf/empty.proto";
import "pbresource/resource.proto";
// Forwarding service is used for forwarding write and consistent read
// operations to the Raft leader. It is served on Consul's multiplexed
// server port, which is the same port used for regular Raft traffic.
service ForwardingService {
// Write handles a forwarded write operation.
rpc Write(WriteRequest) returns (WriteResponse) {
option (hashicorp.consul.internal.ratelimit.spec) = {
operation_type: OPERATION_TYPE_EXEMPT,
operation_category: OPERATION_CATEGORY_RESOURCE
};
}
// Delete handles a forwarded delete operation.
rpc Delete(DeleteRequest) returns (google.protobuf.Empty) {
option (hashicorp.consul.internal.ratelimit.spec) = {
operation_type: OPERATION_TYPE_EXEMPT,
operation_category: OPERATION_CATEGORY_RESOURCE
};
}
// Read handles a forwarded read operation.
rpc Read(ReadRequest) returns (ReadResponse) {
option (hashicorp.consul.internal.ratelimit.spec) = {
operation_type: OPERATION_TYPE_EXEMPT,
operation_category: OPERATION_CATEGORY_RESOURCE
};
}
// List handles a forwarded list operation.
rpc List(ListRequest) returns (ListResponse) {
option (hashicorp.consul.internal.ratelimit.spec) = {
operation_type: OPERATION_TYPE_EXEMPT,
operation_category: OPERATION_CATEGORY_RESOURCE
};
}
}
// LogType describes the type of operation being written to the Raft log.
enum LogType {
LOG_TYPE_UNSPECIFIED = 0;
LOG_TYPE_WRITE = 1;
LOG_TYPE_DELETE = 2;
}
// Log is protobuf-encoded and written to the Raft log.
message Log {
LogType type = 1;
oneof request {
WriteRequest write = 2;
DeleteRequest delete = 3;
}
}
// LogResponse contains the FSM's response to applying a log.
message LogResponse {
oneof response {
WriteResponse write = 1;
google.protobuf.Empty delete = 2;
}
}
// WriteRequest contains the parameters for a write operation.
message WriteRequest {
hashicorp.consul.resource.Resource resource = 1;
}
// WriteResponse contains the results of a write operation.
message WriteResponse {
hashicorp.consul.resource.Resource resource = 1;
}
// DeleteRequest contains the parameters for a write operation.
message DeleteRequest {
hashicorp.consul.resource.ID id = 1;
string version = 2;
}
// ReadRequest contains the parameters for a consistent read operation.
message ReadRequest {
hashicorp.consul.resource.ID id = 1;
}
// ReadResponse contains the results of a consistent read operation.
message ReadResponse {
hashicorp.consul.resource.Resource resource = 1;
}
// ListRequest contains the parameters for a consistent list operation.
message ListRequest {
hashicorp.consul.resource.Type type = 1;
hashicorp.consul.resource.Tenancy tenancy = 2;
string name_prefix = 3;
}
// ListResponse contains the results of a consistent list operation.
message ListResponse {
repeated hashicorp.consul.resource.Resource resources = 1;
}
// GroupVersionMismatchErrorDetails contains the error details that will be
// returned when the leader encounters a storage.GroupVersionMismatchError.
message GroupVersionMismatchErrorDetails {
hashicorp.consul.resource.Type requested_type = 1;
hashicorp.consul.resource.Resource stored = 2;
}