2023-03-28 22:48:58 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2020-09-18 18:02:46 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
2022-07-13 16:03:27 +00:00
|
|
|
package hashicorp.consul.internal.service;
|
2020-09-18 18:02:46 +00:00
|
|
|
|
2023-02-17 21:14:46 +00:00
|
|
|
import "private/pbcommon/common.proto";
|
|
|
|
import "private/pbservice/healthcheck.proto";
|
|
|
|
import "private/pbservice/service.proto";
|
2020-09-18 18:02:46 +00:00
|
|
|
|
peering: initial sync (#12842)
- Add endpoints related to peering: read, list, generate token, initiate peering
- Update node/service/check table indexing to account for peers
- Foundational changes for pushing service updates to a peer
- Plumb peer name through Health.ServiceNodes path
see: ENT-1765, ENT-1280, ENT-1283, ENT-1283, ENT-1756, ENT-1739, ENT-1750, ENT-1679,
ENT-1709, ENT-1704, ENT-1690, ENT-1689, ENT-1702, ENT-1701, ENT-1683, ENT-1663,
ENT-1650, ENT-1678, ENT-1628, ENT-1658, ENT-1640, ENT-1637, ENT-1597, ENT-1634,
ENT-1613, ENT-1616, ENT-1617, ENT-1591, ENT-1588, ENT-1596, ENT-1572, ENT-1555
Co-authored-by: R.B. Boyer <rb@hashicorp.com>
Co-authored-by: freddygv <freddy@hashicorp.com>
Co-authored-by: Chris S. Kim <ckim@hashicorp.com>
Co-authored-by: Evan Culver <eculver@hashicorp.com>
Co-authored-by: Nitya Dhanushkodi <nitya@hashicorp.com>
2022-04-21 22:34:40 +00:00
|
|
|
// IndexedCheckServiceNodes is used to return multiple instances for a given service.
|
|
|
|
message IndexedCheckServiceNodes {
|
|
|
|
uint64 Index = 1;
|
|
|
|
repeated CheckServiceNode Nodes = 2;
|
|
|
|
}
|
|
|
|
|
2020-09-18 18:02:46 +00:00
|
|
|
// CheckServiceNode is used to provide the node, its service
|
|
|
|
// definition, as well as a HealthCheck that is associated.
|
|
|
|
message CheckServiceNode {
|
|
|
|
Node Node = 1;
|
|
|
|
NodeService Service = 2;
|
|
|
|
repeated HealthCheck Checks = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Node contains information about a node.
|
|
|
|
//
|
|
|
|
// mog annotation:
|
|
|
|
//
|
|
|
|
// target=github.com/hashicorp/consul/agent/structs.Node
|
|
|
|
// output=node.gen.go
|
|
|
|
// name=Structs
|
|
|
|
message Node {
|
2022-03-23 16:10:03 +00:00
|
|
|
// mog: func-to=NodeIDType func-from=string
|
|
|
|
string ID = 1;
|
2020-09-18 18:02:46 +00:00
|
|
|
|
|
|
|
string Node = 2;
|
2021-07-22 19:33:22 +00:00
|
|
|
string Partition = 8;
|
peering: initial sync (#12842)
- Add endpoints related to peering: read, list, generate token, initiate peering
- Update node/service/check table indexing to account for peers
- Foundational changes for pushing service updates to a peer
- Plumb peer name through Health.ServiceNodes path
see: ENT-1765, ENT-1280, ENT-1283, ENT-1283, ENT-1756, ENT-1739, ENT-1750, ENT-1679,
ENT-1709, ENT-1704, ENT-1690, ENT-1689, ENT-1702, ENT-1701, ENT-1683, ENT-1663,
ENT-1650, ENT-1678, ENT-1628, ENT-1658, ENT-1640, ENT-1637, ENT-1597, ENT-1634,
ENT-1613, ENT-1616, ENT-1617, ENT-1591, ENT-1588, ENT-1596, ENT-1572, ENT-1555
Co-authored-by: R.B. Boyer <rb@hashicorp.com>
Co-authored-by: freddygv <freddy@hashicorp.com>
Co-authored-by: Chris S. Kim <ckim@hashicorp.com>
Co-authored-by: Evan Culver <eculver@hashicorp.com>
Co-authored-by: Nitya Dhanushkodi <nitya@hashicorp.com>
2022-04-21 22:34:40 +00:00
|
|
|
string PeerName = 9;
|
2020-09-18 18:02:46 +00:00
|
|
|
string Address = 3;
|
|
|
|
string Datacenter = 4;
|
|
|
|
map<string, string> TaggedAddresses = 5;
|
|
|
|
map<string, string> Meta = 6;
|
|
|
|
|
|
|
|
// mog: func-to=RaftIndexToStructs func-from=NewRaftIndexFromStructs
|
2022-03-23 16:10:03 +00:00
|
|
|
common.RaftIndex RaftIndex = 7;
|
2023-03-10 14:36:15 +00:00
|
|
|
// Locality identifies where the node is running.
|
|
|
|
// mog: func-to=LocalityToStructs func-from=LocalityFromStructs
|
|
|
|
common.Locality Locality = 10;
|
2020-09-18 18:02:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NodeService is a service provided by a node
|
|
|
|
//
|
|
|
|
// mog annotation:
|
|
|
|
//
|
|
|
|
// target=github.com/hashicorp/consul/agent/structs.NodeService
|
|
|
|
// output=node.gen.go
|
|
|
|
// name=Structs
|
|
|
|
message NodeService {
|
|
|
|
// Kind is the kind of service this is. Different kinds of services may
|
|
|
|
// have differing validation, DNS behavior, etc. An empty kind will default
|
|
|
|
// to the Default kind. See ServiceKind for the full list of kinds.
|
2022-03-23 16:10:03 +00:00
|
|
|
// mog: func-to=structs.ServiceKind func-from=string
|
|
|
|
string Kind = 1;
|
2020-09-18 18:02:46 +00:00
|
|
|
|
|
|
|
string ID = 2;
|
|
|
|
string Service = 3;
|
|
|
|
repeated string Tags = 4;
|
|
|
|
string Address = 5;
|
|
|
|
// mog: func-to=MapStringServiceAddressToStructs func-from=NewMapStringServiceAddressFromStructs
|
2022-03-23 16:10:03 +00:00
|
|
|
map<string, ServiceAddress> TaggedAddresses = 15;
|
2020-09-18 18:02:46 +00:00
|
|
|
map<string, string> Meta = 6;
|
|
|
|
// mog: func-to=int func-from=int32
|
|
|
|
int32 Port = 7;
|
2021-05-05 16:51:40 +00:00
|
|
|
string SocketPath = 17;
|
2020-09-18 18:02:46 +00:00
|
|
|
|
|
|
|
// mog: func-to=WeightsPtrToStructs func-from=NewWeightsPtrFromStructs
|
|
|
|
Weights Weights = 8;
|
|
|
|
bool EnableTagOverride = 9;
|
|
|
|
|
|
|
|
// Proxy is the configuration set for Kind = connect-proxy. It is mandatory in
|
|
|
|
// that case and an error to be set for any other kind. This config is part of
|
|
|
|
// a proxy service definition and is distinct from but shares some fields with
|
|
|
|
// the Connect.Proxy which configures a managed proxy as part of the actual
|
|
|
|
// service's definition. This duplication is ugly but seemed better than the
|
|
|
|
// alternative which was to re-use the same struct fields for both cases even
|
|
|
|
// though the semantics are different and the non-shred fields make no sense
|
|
|
|
// in the other case. ProxyConfig may be a more natural name here, but it's
|
|
|
|
// confusing for the UX because one of the fields in ConnectProxyConfig is
|
|
|
|
// also called just "Config"
|
2022-03-23 16:10:03 +00:00
|
|
|
ConnectProxyConfig Proxy = 11;
|
2020-09-18 18:02:46 +00:00
|
|
|
|
|
|
|
// Connect are the Connect settings for a service. This is purposely NOT
|
|
|
|
// a pointer so that we never have to nil-check this.
|
2022-03-23 16:10:03 +00:00
|
|
|
ServiceConnect Connect = 12;
|
2020-09-18 18:02:46 +00:00
|
|
|
|
|
|
|
// LocallyRegisteredAsSidecar is private as it is only used by a local agent
|
|
|
|
// state to track if the service was registered from a nested sidecar_service
|
|
|
|
// block. We need to track that so we can know whether we need to deregister
|
|
|
|
// it automatically too if it's removed from the service definition or if the
|
|
|
|
// parent service is deregistered. Relying only on ID would cause us to
|
|
|
|
// deregister regular services if they happen to be registered using the same
|
|
|
|
// ID scheme as our sidecars do by default. We could use meta but that gets
|
|
|
|
// unpleasant because we can't use the consul- prefix from an agent (reserved
|
|
|
|
// for use internally but in practice that means within the state store or in
|
|
|
|
// responses only), and it leaks the detail publicly which people might rely
|
|
|
|
// on which is a bit unpleasant for something that is meant to be config-file
|
|
|
|
// syntax sugar. Note this is not translated to ServiceNode and friends and
|
|
|
|
// may not be set on a NodeService that isn't the one the agent registered and
|
|
|
|
// keeps in it's local state. We never want this rendered in JSON as it's
|
|
|
|
// internal only. Right now our agent endpoints return api structs which don't
|
|
|
|
// include it but this is a safety net incase we change that or there is
|
|
|
|
// somewhere this is used in API output.
|
|
|
|
bool LocallyRegisteredAsSidecar = 13;
|
|
|
|
|
|
|
|
// mog: func-to=EnterpriseMetaToStructs func-from=NewEnterpriseMetaFromStructs
|
2022-03-23 16:10:03 +00:00
|
|
|
common.EnterpriseMeta EnterpriseMeta = 16;
|
2020-09-18 18:02:46 +00:00
|
|
|
|
peering: initial sync (#12842)
- Add endpoints related to peering: read, list, generate token, initiate peering
- Update node/service/check table indexing to account for peers
- Foundational changes for pushing service updates to a peer
- Plumb peer name through Health.ServiceNodes path
see: ENT-1765, ENT-1280, ENT-1283, ENT-1283, ENT-1756, ENT-1739, ENT-1750, ENT-1679,
ENT-1709, ENT-1704, ENT-1690, ENT-1689, ENT-1702, ENT-1701, ENT-1683, ENT-1663,
ENT-1650, ENT-1678, ENT-1628, ENT-1658, ENT-1640, ENT-1637, ENT-1597, ENT-1634,
ENT-1613, ENT-1616, ENT-1617, ENT-1591, ENT-1588, ENT-1596, ENT-1572, ENT-1555
Co-authored-by: R.B. Boyer <rb@hashicorp.com>
Co-authored-by: freddygv <freddy@hashicorp.com>
Co-authored-by: Chris S. Kim <ckim@hashicorp.com>
Co-authored-by: Evan Culver <eculver@hashicorp.com>
Co-authored-by: Nitya Dhanushkodi <nitya@hashicorp.com>
2022-04-21 22:34:40 +00:00
|
|
|
string PeerName = 18;
|
|
|
|
|
2020-09-18 18:02:46 +00:00
|
|
|
// mog: func-to=RaftIndexToStructs func-from=NewRaftIndexFromStructs
|
2022-03-23 16:10:03 +00:00
|
|
|
common.RaftIndex RaftIndex = 14;
|
2023-03-10 14:36:15 +00:00
|
|
|
|
|
|
|
// Locality identifies where the service is running.
|
|
|
|
// mog: func-to=LocalityToStructs func-from=LocalityFromStructs
|
|
|
|
common.Locality Locality = 19;
|
2021-05-05 16:51:40 +00:00
|
|
|
}
|