diff --git a/buf.gen.yaml b/buf.gen.yaml new file mode 100644 index 0000000..431e7a1 --- /dev/null +++ b/buf.gen.yaml @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: Apache-2.0 +# Remote plugins are pinned; keep their versions in step with +# google.golang.org/protobuf and google.golang.org/grpc in go.mod. +version: v2 +plugins: + - remote: buf.build/protocolbuffers/go:v1.36.12 + out: proto/gen + opt: paths=source_relative + - remote: buf.build/grpc/go:v1.6.2 + out: proto/gen + opt: paths=source_relative +inputs: + - directory: proto diff --git a/buf.yaml b/buf.yaml new file mode 100644 index 0000000..8b41178 --- /dev/null +++ b/buf.yaml @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: Apache-2.0 +version: v2 +modules: + - path: proto +lint: + use: + - STANDARD +breaking: + use: + - FILE diff --git a/docs/adr/0007-server-agent-grpc-mtls.md b/docs/adr/0007-server-agent-grpc-mtls.md index 51369fe..a3988cc 100644 --- a/docs/adr/0007-server-agent-grpc-mtls.md +++ b/docs/adr/0007-server-agent-grpc-mtls.md @@ -6,6 +6,7 @@ ## Entscheidung - Protokoll **gRPC** (Protobuf-Definitionen unter `proto/ddi/agent/v1`, Lint und Generierung mit `buf`). Generierter Go-Code wird eingecheckt, damit der Build ohne `buf` funktioniert; die CI prüft, dass er aktuell ist. +- Die Generatoren laufen als **versionsgepinnte buf-Remote-Plugins** (`buf.build/protocolbuffers/go`, `buf.build/grpc/go`), deren Versionen mit `google.golang.org/protobuf` bzw. `google.golang.org/grpc` in `go.mod` übereinstimmen. Damit braucht die Generierung keine lokal gebauten Plugin-Binaries (auf verwalteten Windows-Arbeitsplätzen blockieren Sicherheitsrichtlinien diese teilweise), und die Ergebnisse sind lokal und in der CI identisch. Voraussetzung ist Netzzugriff auf `buf.build` zur Generierungszeit, nicht zur Build-Zeit. - Der Agent verbindet sich **immer ausgehend** zum Server (eigener Port, Standard `8444/tcp`, getrennt von Web-UI/API auf `8443/tcp`). - Transport: **TLS 1.3** mit Client-Zertifikat (mTLS). Ausnahme ist nur der Enrollment-Aufruf, der ein einmaliges Token statt eines Zertifikats nutzt (siehe [0008](0008-interne-ca-enrollment.md)). Der Listener nutzt `VerifyClientCertIfGiven`; ein Interceptor erzwingt das Zertifikat für alle anderen Methoden. - **Bidirektionaler Stream** `Connect`: Der Agent meldet Health und Status, der Server sendet Kommandos (`apply revision N`, `renew certificate`, …). Keepalives erkennen tote Verbindungen. diff --git a/proto/ddi/agent/v1/agent.proto b/proto/ddi/agent/v1/agent.proto new file mode 100644 index 0000000..f57d89f --- /dev/null +++ b/proto/ddi/agent/v1/agent.proto @@ -0,0 +1,279 @@ +// SPDX-License-Identifier: Apache-2.0 + +syntax = "proto3"; + +package ddi.agent.v1; + +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "git.beugsiud.de/beug.k/DDI/proto/gen/ddi/agent/v1;agentv1"; + +// AgentService is implemented by the management server and called by agents. +// Agents always connect outbound (docs/adr/0007-server-agent-grpc-mtls.md). +// Every RPC except Enroll requires a client certificate issued by the +// server's internal CA (docs/adr/0008-interne-ca-enrollment.md). +service AgentService { + // Enroll exchanges a one-time token and a certificate signing request for a + // client certificate. It is the only RPC allowed without client certificate. + rpc Enroll(EnrollRequest) returns (EnrollResponse); + + // RenewCertificate issues a new client certificate for a freshly generated + // key. Allowed with a certificate that expired at most 30 days ago. + rpc RenewCertificate(RenewCertificateRequest) returns (RenewCertificateResponse); + + // Connect is the long-lived control stream. The agent sends Hello first, + // then heartbeats and command acknowledgements; the server answers with + // Welcome and pushes commands. + rpc Connect(stream ConnectRequest) returns (stream ConnectResponse); + + // GetDesiredState returns the revision the agent should run. Used for + // auto_pull and as fallback when the Connect stream is unavailable. + rpc GetDesiredState(GetDesiredStateRequest) returns (GetDesiredStateResponse); + + // FetchBundle downloads the signed configuration bundle of a revision + // (docs/adr/0009-signierte-config-bundles.md). + rpc FetchBundle(FetchBundleRequest) returns (FetchBundleResponse); + + // ReportDeployment reports the outcome of applying a revision. + rpc ReportDeployment(ReportDeploymentRequest) returns (ReportDeploymentResponse); + + // ReportLeases sends a batch of DHCP lease observations (DHCP agents only). + rpc ReportLeases(ReportLeasesRequest) returns (ReportLeasesResponse); +} + +// Role of an agent. +enum Role { + ROLE_UNSPECIFIED = 0; + ROLE_DNS = 1; + ROLE_DHCP = 2; +} + +// OperatingMode controls when an agent applies new revisions. +enum OperatingMode { + OPERATING_MODE_UNSPECIFIED = 0; + // The agent applies new revisions on its own within the pull interval. + OPERATING_MODE_AUTO_PULL = 1; + // The agent applies revisions only when told to (push from the UI). + OPERATING_MODE_MANUAL = 2; +} + +// HealthState summarises the state of the managed service. +enum HealthState { + HEALTH_STATE_UNSPECIFIED = 0; + HEALTH_STATE_OK = 1; + HEALTH_STATE_DEGRADED = 2; + HEALTH_STATE_FAILED = 3; +} + +message EnrollRequest { + // One-time enrollment token in the form ".". + string token = 1; + // PKCS#10 certificate signing request, DER encoded. The private key never + // leaves the agent. + bytes csr_der = 2; + Role role = 3; + string hostname = 4; + string agent_version = 5; +} + +message EnrollResponse { + // Agent identifier assigned by the server (UUID). + string agent_id = 1; + // Issued client certificate, DER encoded. + bytes certificate_der = 2; + // CA chain, DER encoded, root last. + repeated bytes ca_certificates_der = 3; + // Ed25519 public key that verifies configuration bundles. + bytes bundle_signing_public_key = 4; +} + +message RenewCertificateRequest { + bytes csr_der = 1; +} + +message RenewCertificateResponse { + bytes certificate_der = 1; + repeated bytes ca_certificates_der = 2; +} + +message ConnectRequest { + oneof message { + Hello hello = 1; + Heartbeat heartbeat = 2; + CommandAck command_ack = 3; + } +} + +message ConnectResponse { + oneof message { + Welcome welcome = 1; + Command command = 2; + } +} + +// Hello is the first message an agent sends on a new stream. +message Hello { + string agent_version = 1; + // Revision currently active on the agent (0 = none). + uint64 applied_revision = 2; + // Last revision that passed its health check. + uint64 last_good_revision = 3; + HealthStatus health = 4; + // Version of the managed service, e.g. "BIND 9.20.3" or "Kea 3.2.1". + string service_version = 5; +} + +message Heartbeat { + uint64 applied_revision = 1; + HealthStatus health = 2; +} + +message HealthStatus { + HealthState state = 1; + string message = 2; + google.protobuf.Timestamp checked_at = 3; + repeated HealthCheck checks = 4; +} + +message HealthCheck { + string name = 1; + HealthState state = 2; + string message = 3; +} + +// Welcome tells the agent its current settings. +message Welcome { + OperatingMode mode = 1; + google.protobuf.Duration pull_interval = 2; + google.protobuf.Duration heartbeat_interval = 3; +} + +// Command is pushed by the server over the Connect stream. +message Command { + // Unique ID, echoed in CommandAck. + string command_id = 1; + oneof action { + ApplyRevisionCommand apply_revision = 10; + RenewCertificateCommand renew_certificate = 11; + } +} + +// ApplyRevisionCommand asks the agent to fetch and apply a revision now. +message ApplyRevisionCommand { + uint64 revision = 1; + // Correlates server, agent logs and the deployment record. + string deployment_id = 2; +} + +// RenewCertificateCommand asks the agent to renew its certificate now. +message RenewCertificateCommand {} + +// CommandAck confirms receipt of a command. The outcome of an apply is +// reported separately via ReportDeployment. +message CommandAck { + string command_id = 1; + bool accepted = 2; + // Reason if not accepted (e.g. "maintenance window closed"). + string message = 3; +} + +message GetDesiredStateRequest { + uint64 applied_revision = 1; +} + +message GetDesiredStateResponse { + // Revision the agent should run. 0 means no configuration assigned yet. + uint64 desired_revision = 1; + OperatingMode mode = 2; + google.protobuf.Duration pull_interval = 3; +} + +message FetchBundleRequest { + uint64 revision = 1; +} + +message FetchBundleResponse { + // Manifest bytes exactly as signed (JSON). Verify before parsing. + bytes manifest = 1; + // Ed25519 signature over manifest. + bytes signature = 2; + // Artifact contents; paths, modes and SHA-256 sums are in the manifest. + repeated Artifact artifacts = 3; +} + +message Artifact { + string path = 1; + bytes content = 2; +} + +// DeploymentTrigger says why an agent applied a revision. +enum DeploymentTrigger { + DEPLOYMENT_TRIGGER_UNSPECIFIED = 0; + DEPLOYMENT_TRIGGER_PULL = 1; + DEPLOYMENT_TRIGGER_PUSH = 2; +} + +// DeploymentOutcome is the result of applying a revision. +enum DeploymentOutcome { + DEPLOYMENT_OUTCOME_UNSPECIFIED = 0; + // Validated, activated and healthy. + DEPLOYMENT_OUTCOME_SUCCEEDED = 1; + // Signature or syntax check failed; nothing was changed. + DEPLOYMENT_OUTCOME_REJECTED = 2; + // Activated but unhealthy; the previous revision was restored. + DEPLOYMENT_OUTCOME_ROLLED_BACK = 3; + // Activated, unhealthy and the rollback failed as well. + DEPLOYMENT_OUTCOME_FAILED = 4; +} + +message ReportDeploymentRequest { + // Empty for pulls the server did not initiate. + string deployment_id = 1; + uint64 revision = 2; + DeploymentTrigger trigger = 3; + DeploymentOutcome outcome = 4; + // Human-readable details (English), e.g. checker output. + string message = 5; + // Revision active after this deployment. + uint64 active_revision = 6; + google.protobuf.Timestamp started_at = 7; + google.protobuf.Timestamp finished_at = 8; +} + +message ReportDeploymentResponse {} + +// LeaseState mirrors the Kea lease states relevant for address tracking. +enum LeaseState { + LEASE_STATE_UNSPECIFIED = 0; + LEASE_STATE_ACTIVE = 1; + LEASE_STATE_EXPIRED = 2; + LEASE_STATE_RELEASED = 3; + LEASE_STATE_DECLINED = 4; +} + +message Lease { + // IPv4 or IPv6 address in text form. + string ip = 1; + // Hardware address, lowercase colon-separated. + string mac = 2; + string hostname = 3; + LeaseState state = 4; + google.protobuf.Timestamp expires_at = 5; + google.protobuf.Timestamp updated_at = 6; + // Kea subnet ID as rendered by the configuration generator. + uint32 subnet_id = 7; + string client_id = 8; +} + +message ReportLeasesRequest { + // Monotonic per agent; lets the server drop duplicate batches. + uint64 sequence = 1; + // True if this batch is a full snapshot rather than a set of changes. + bool full_sync = 2; + repeated Lease leases = 3; +} + +message ReportLeasesResponse { + uint64 acknowledged_sequence = 1; +} diff --git a/proto/gen/ddi/agent/v1/agent.pb.go b/proto/gen/ddi/agent/v1/agent.pb.go new file mode 100644 index 0000000..945789b --- /dev/null +++ b/proto/gen/ddi/agent/v1/agent.pb.go @@ -0,0 +1,2244 @@ +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.12 +// protoc (unknown) +// source: ddi/agent/v1/agent.proto + +package agentv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Role of an agent. +type Role int32 + +const ( + Role_ROLE_UNSPECIFIED Role = 0 + Role_ROLE_DNS Role = 1 + Role_ROLE_DHCP Role = 2 +) + +// Enum value maps for Role. +var ( + Role_name = map[int32]string{ + 0: "ROLE_UNSPECIFIED", + 1: "ROLE_DNS", + 2: "ROLE_DHCP", + } + Role_value = map[string]int32{ + "ROLE_UNSPECIFIED": 0, + "ROLE_DNS": 1, + "ROLE_DHCP": 2, + } +) + +func (x Role) Enum() *Role { + p := new(Role) + *p = x + return p +} + +func (x Role) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Role) Descriptor() protoreflect.EnumDescriptor { + return file_ddi_agent_v1_agent_proto_enumTypes[0].Descriptor() +} + +func (Role) Type() protoreflect.EnumType { + return &file_ddi_agent_v1_agent_proto_enumTypes[0] +} + +func (x Role) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Role.Descriptor instead. +func (Role) EnumDescriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{0} +} + +// OperatingMode controls when an agent applies new revisions. +type OperatingMode int32 + +const ( + OperatingMode_OPERATING_MODE_UNSPECIFIED OperatingMode = 0 + // The agent applies new revisions on its own within the pull interval. + OperatingMode_OPERATING_MODE_AUTO_PULL OperatingMode = 1 + // The agent applies revisions only when told to (push from the UI). + OperatingMode_OPERATING_MODE_MANUAL OperatingMode = 2 +) + +// Enum value maps for OperatingMode. +var ( + OperatingMode_name = map[int32]string{ + 0: "OPERATING_MODE_UNSPECIFIED", + 1: "OPERATING_MODE_AUTO_PULL", + 2: "OPERATING_MODE_MANUAL", + } + OperatingMode_value = map[string]int32{ + "OPERATING_MODE_UNSPECIFIED": 0, + "OPERATING_MODE_AUTO_PULL": 1, + "OPERATING_MODE_MANUAL": 2, + } +) + +func (x OperatingMode) Enum() *OperatingMode { + p := new(OperatingMode) + *p = x + return p +} + +func (x OperatingMode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (OperatingMode) Descriptor() protoreflect.EnumDescriptor { + return file_ddi_agent_v1_agent_proto_enumTypes[1].Descriptor() +} + +func (OperatingMode) Type() protoreflect.EnumType { + return &file_ddi_agent_v1_agent_proto_enumTypes[1] +} + +func (x OperatingMode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use OperatingMode.Descriptor instead. +func (OperatingMode) EnumDescriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{1} +} + +// HealthState summarises the state of the managed service. +type HealthState int32 + +const ( + HealthState_HEALTH_STATE_UNSPECIFIED HealthState = 0 + HealthState_HEALTH_STATE_OK HealthState = 1 + HealthState_HEALTH_STATE_DEGRADED HealthState = 2 + HealthState_HEALTH_STATE_FAILED HealthState = 3 +) + +// Enum value maps for HealthState. +var ( + HealthState_name = map[int32]string{ + 0: "HEALTH_STATE_UNSPECIFIED", + 1: "HEALTH_STATE_OK", + 2: "HEALTH_STATE_DEGRADED", + 3: "HEALTH_STATE_FAILED", + } + HealthState_value = map[string]int32{ + "HEALTH_STATE_UNSPECIFIED": 0, + "HEALTH_STATE_OK": 1, + "HEALTH_STATE_DEGRADED": 2, + "HEALTH_STATE_FAILED": 3, + } +) + +func (x HealthState) Enum() *HealthState { + p := new(HealthState) + *p = x + return p +} + +func (x HealthState) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (HealthState) Descriptor() protoreflect.EnumDescriptor { + return file_ddi_agent_v1_agent_proto_enumTypes[2].Descriptor() +} + +func (HealthState) Type() protoreflect.EnumType { + return &file_ddi_agent_v1_agent_proto_enumTypes[2] +} + +func (x HealthState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use HealthState.Descriptor instead. +func (HealthState) EnumDescriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{2} +} + +// DeploymentTrigger says why an agent applied a revision. +type DeploymentTrigger int32 + +const ( + DeploymentTrigger_DEPLOYMENT_TRIGGER_UNSPECIFIED DeploymentTrigger = 0 + DeploymentTrigger_DEPLOYMENT_TRIGGER_PULL DeploymentTrigger = 1 + DeploymentTrigger_DEPLOYMENT_TRIGGER_PUSH DeploymentTrigger = 2 +) + +// Enum value maps for DeploymentTrigger. +var ( + DeploymentTrigger_name = map[int32]string{ + 0: "DEPLOYMENT_TRIGGER_UNSPECIFIED", + 1: "DEPLOYMENT_TRIGGER_PULL", + 2: "DEPLOYMENT_TRIGGER_PUSH", + } + DeploymentTrigger_value = map[string]int32{ + "DEPLOYMENT_TRIGGER_UNSPECIFIED": 0, + "DEPLOYMENT_TRIGGER_PULL": 1, + "DEPLOYMENT_TRIGGER_PUSH": 2, + } +) + +func (x DeploymentTrigger) Enum() *DeploymentTrigger { + p := new(DeploymentTrigger) + *p = x + return p +} + +func (x DeploymentTrigger) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (DeploymentTrigger) Descriptor() protoreflect.EnumDescriptor { + return file_ddi_agent_v1_agent_proto_enumTypes[3].Descriptor() +} + +func (DeploymentTrigger) Type() protoreflect.EnumType { + return &file_ddi_agent_v1_agent_proto_enumTypes[3] +} + +func (x DeploymentTrigger) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use DeploymentTrigger.Descriptor instead. +func (DeploymentTrigger) EnumDescriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{3} +} + +// DeploymentOutcome is the result of applying a revision. +type DeploymentOutcome int32 + +const ( + DeploymentOutcome_DEPLOYMENT_OUTCOME_UNSPECIFIED DeploymentOutcome = 0 + // Validated, activated and healthy. + DeploymentOutcome_DEPLOYMENT_OUTCOME_SUCCEEDED DeploymentOutcome = 1 + // Signature or syntax check failed; nothing was changed. + DeploymentOutcome_DEPLOYMENT_OUTCOME_REJECTED DeploymentOutcome = 2 + // Activated but unhealthy; the previous revision was restored. + DeploymentOutcome_DEPLOYMENT_OUTCOME_ROLLED_BACK DeploymentOutcome = 3 + // Activated, unhealthy and the rollback failed as well. + DeploymentOutcome_DEPLOYMENT_OUTCOME_FAILED DeploymentOutcome = 4 +) + +// Enum value maps for DeploymentOutcome. +var ( + DeploymentOutcome_name = map[int32]string{ + 0: "DEPLOYMENT_OUTCOME_UNSPECIFIED", + 1: "DEPLOYMENT_OUTCOME_SUCCEEDED", + 2: "DEPLOYMENT_OUTCOME_REJECTED", + 3: "DEPLOYMENT_OUTCOME_ROLLED_BACK", + 4: "DEPLOYMENT_OUTCOME_FAILED", + } + DeploymentOutcome_value = map[string]int32{ + "DEPLOYMENT_OUTCOME_UNSPECIFIED": 0, + "DEPLOYMENT_OUTCOME_SUCCEEDED": 1, + "DEPLOYMENT_OUTCOME_REJECTED": 2, + "DEPLOYMENT_OUTCOME_ROLLED_BACK": 3, + "DEPLOYMENT_OUTCOME_FAILED": 4, + } +) + +func (x DeploymentOutcome) Enum() *DeploymentOutcome { + p := new(DeploymentOutcome) + *p = x + return p +} + +func (x DeploymentOutcome) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (DeploymentOutcome) Descriptor() protoreflect.EnumDescriptor { + return file_ddi_agent_v1_agent_proto_enumTypes[4].Descriptor() +} + +func (DeploymentOutcome) Type() protoreflect.EnumType { + return &file_ddi_agent_v1_agent_proto_enumTypes[4] +} + +func (x DeploymentOutcome) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use DeploymentOutcome.Descriptor instead. +func (DeploymentOutcome) EnumDescriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{4} +} + +// LeaseState mirrors the Kea lease states relevant for address tracking. +type LeaseState int32 + +const ( + LeaseState_LEASE_STATE_UNSPECIFIED LeaseState = 0 + LeaseState_LEASE_STATE_ACTIVE LeaseState = 1 + LeaseState_LEASE_STATE_EXPIRED LeaseState = 2 + LeaseState_LEASE_STATE_RELEASED LeaseState = 3 + LeaseState_LEASE_STATE_DECLINED LeaseState = 4 +) + +// Enum value maps for LeaseState. +var ( + LeaseState_name = map[int32]string{ + 0: "LEASE_STATE_UNSPECIFIED", + 1: "LEASE_STATE_ACTIVE", + 2: "LEASE_STATE_EXPIRED", + 3: "LEASE_STATE_RELEASED", + 4: "LEASE_STATE_DECLINED", + } + LeaseState_value = map[string]int32{ + "LEASE_STATE_UNSPECIFIED": 0, + "LEASE_STATE_ACTIVE": 1, + "LEASE_STATE_EXPIRED": 2, + "LEASE_STATE_RELEASED": 3, + "LEASE_STATE_DECLINED": 4, + } +) + +func (x LeaseState) Enum() *LeaseState { + p := new(LeaseState) + *p = x + return p +} + +func (x LeaseState) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (LeaseState) Descriptor() protoreflect.EnumDescriptor { + return file_ddi_agent_v1_agent_proto_enumTypes[5].Descriptor() +} + +func (LeaseState) Type() protoreflect.EnumType { + return &file_ddi_agent_v1_agent_proto_enumTypes[5] +} + +func (x LeaseState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use LeaseState.Descriptor instead. +func (LeaseState) EnumDescriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{5} +} + +type EnrollRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // One-time enrollment token in the form ".". + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` + // PKCS#10 certificate signing request, DER encoded. The private key never + // leaves the agent. + CsrDer []byte `protobuf:"bytes,2,opt,name=csr_der,json=csrDer,proto3" json:"csr_der,omitempty"` + Role Role `protobuf:"varint,3,opt,name=role,proto3,enum=ddi.agent.v1.Role" json:"role,omitempty"` + Hostname string `protobuf:"bytes,4,opt,name=hostname,proto3" json:"hostname,omitempty"` + AgentVersion string `protobuf:"bytes,5,opt,name=agent_version,json=agentVersion,proto3" json:"agent_version,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EnrollRequest) Reset() { + *x = EnrollRequest{} + mi := &file_ddi_agent_v1_agent_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EnrollRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EnrollRequest) ProtoMessage() {} + +func (x *EnrollRequest) ProtoReflect() protoreflect.Message { + mi := &file_ddi_agent_v1_agent_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EnrollRequest.ProtoReflect.Descriptor instead. +func (*EnrollRequest) Descriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{0} +} + +func (x *EnrollRequest) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *EnrollRequest) GetCsrDer() []byte { + if x != nil { + return x.CsrDer + } + return nil +} + +func (x *EnrollRequest) GetRole() Role { + if x != nil { + return x.Role + } + return Role_ROLE_UNSPECIFIED +} + +func (x *EnrollRequest) GetHostname() string { + if x != nil { + return x.Hostname + } + return "" +} + +func (x *EnrollRequest) GetAgentVersion() string { + if x != nil { + return x.AgentVersion + } + return "" +} + +type EnrollResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Agent identifier assigned by the server (UUID). + AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` + // Issued client certificate, DER encoded. + CertificateDer []byte `protobuf:"bytes,2,opt,name=certificate_der,json=certificateDer,proto3" json:"certificate_der,omitempty"` + // CA chain, DER encoded, root last. + CaCertificatesDer [][]byte `protobuf:"bytes,3,rep,name=ca_certificates_der,json=caCertificatesDer,proto3" json:"ca_certificates_der,omitempty"` + // Ed25519 public key that verifies configuration bundles. + BundleSigningPublicKey []byte `protobuf:"bytes,4,opt,name=bundle_signing_public_key,json=bundleSigningPublicKey,proto3" json:"bundle_signing_public_key,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EnrollResponse) Reset() { + *x = EnrollResponse{} + mi := &file_ddi_agent_v1_agent_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EnrollResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EnrollResponse) ProtoMessage() {} + +func (x *EnrollResponse) ProtoReflect() protoreflect.Message { + mi := &file_ddi_agent_v1_agent_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EnrollResponse.ProtoReflect.Descriptor instead. +func (*EnrollResponse) Descriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{1} +} + +func (x *EnrollResponse) GetAgentId() string { + if x != nil { + return x.AgentId + } + return "" +} + +func (x *EnrollResponse) GetCertificateDer() []byte { + if x != nil { + return x.CertificateDer + } + return nil +} + +func (x *EnrollResponse) GetCaCertificatesDer() [][]byte { + if x != nil { + return x.CaCertificatesDer + } + return nil +} + +func (x *EnrollResponse) GetBundleSigningPublicKey() []byte { + if x != nil { + return x.BundleSigningPublicKey + } + return nil +} + +type RenewCertificateRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + CsrDer []byte `protobuf:"bytes,1,opt,name=csr_der,json=csrDer,proto3" json:"csr_der,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RenewCertificateRequest) Reset() { + *x = RenewCertificateRequest{} + mi := &file_ddi_agent_v1_agent_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RenewCertificateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RenewCertificateRequest) ProtoMessage() {} + +func (x *RenewCertificateRequest) ProtoReflect() protoreflect.Message { + mi := &file_ddi_agent_v1_agent_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RenewCertificateRequest.ProtoReflect.Descriptor instead. +func (*RenewCertificateRequest) Descriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{2} +} + +func (x *RenewCertificateRequest) GetCsrDer() []byte { + if x != nil { + return x.CsrDer + } + return nil +} + +type RenewCertificateResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + CertificateDer []byte `protobuf:"bytes,1,opt,name=certificate_der,json=certificateDer,proto3" json:"certificate_der,omitempty"` + CaCertificatesDer [][]byte `protobuf:"bytes,2,rep,name=ca_certificates_der,json=caCertificatesDer,proto3" json:"ca_certificates_der,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RenewCertificateResponse) Reset() { + *x = RenewCertificateResponse{} + mi := &file_ddi_agent_v1_agent_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RenewCertificateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RenewCertificateResponse) ProtoMessage() {} + +func (x *RenewCertificateResponse) ProtoReflect() protoreflect.Message { + mi := &file_ddi_agent_v1_agent_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RenewCertificateResponse.ProtoReflect.Descriptor instead. +func (*RenewCertificateResponse) Descriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{3} +} + +func (x *RenewCertificateResponse) GetCertificateDer() []byte { + if x != nil { + return x.CertificateDer + } + return nil +} + +func (x *RenewCertificateResponse) GetCaCertificatesDer() [][]byte { + if x != nil { + return x.CaCertificatesDer + } + return nil +} + +type ConnectRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Message: + // + // *ConnectRequest_Hello + // *ConnectRequest_Heartbeat + // *ConnectRequest_CommandAck + Message isConnectRequest_Message `protobuf_oneof:"message"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ConnectRequest) Reset() { + *x = ConnectRequest{} + mi := &file_ddi_agent_v1_agent_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ConnectRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConnectRequest) ProtoMessage() {} + +func (x *ConnectRequest) ProtoReflect() protoreflect.Message { + mi := &file_ddi_agent_v1_agent_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConnectRequest.ProtoReflect.Descriptor instead. +func (*ConnectRequest) Descriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{4} +} + +func (x *ConnectRequest) GetMessage() isConnectRequest_Message { + if x != nil { + return x.Message + } + return nil +} + +func (x *ConnectRequest) GetHello() *Hello { + if x != nil { + if x, ok := x.Message.(*ConnectRequest_Hello); ok { + return x.Hello + } + } + return nil +} + +func (x *ConnectRequest) GetHeartbeat() *Heartbeat { + if x != nil { + if x, ok := x.Message.(*ConnectRequest_Heartbeat); ok { + return x.Heartbeat + } + } + return nil +} + +func (x *ConnectRequest) GetCommandAck() *CommandAck { + if x != nil { + if x, ok := x.Message.(*ConnectRequest_CommandAck); ok { + return x.CommandAck + } + } + return nil +} + +type isConnectRequest_Message interface { + isConnectRequest_Message() +} + +type ConnectRequest_Hello struct { + Hello *Hello `protobuf:"bytes,1,opt,name=hello,proto3,oneof"` +} + +type ConnectRequest_Heartbeat struct { + Heartbeat *Heartbeat `protobuf:"bytes,2,opt,name=heartbeat,proto3,oneof"` +} + +type ConnectRequest_CommandAck struct { + CommandAck *CommandAck `protobuf:"bytes,3,opt,name=command_ack,json=commandAck,proto3,oneof"` +} + +func (*ConnectRequest_Hello) isConnectRequest_Message() {} + +func (*ConnectRequest_Heartbeat) isConnectRequest_Message() {} + +func (*ConnectRequest_CommandAck) isConnectRequest_Message() {} + +type ConnectResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Message: + // + // *ConnectResponse_Welcome + // *ConnectResponse_Command + Message isConnectResponse_Message `protobuf_oneof:"message"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ConnectResponse) Reset() { + *x = ConnectResponse{} + mi := &file_ddi_agent_v1_agent_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ConnectResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConnectResponse) ProtoMessage() {} + +func (x *ConnectResponse) ProtoReflect() protoreflect.Message { + mi := &file_ddi_agent_v1_agent_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConnectResponse.ProtoReflect.Descriptor instead. +func (*ConnectResponse) Descriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{5} +} + +func (x *ConnectResponse) GetMessage() isConnectResponse_Message { + if x != nil { + return x.Message + } + return nil +} + +func (x *ConnectResponse) GetWelcome() *Welcome { + if x != nil { + if x, ok := x.Message.(*ConnectResponse_Welcome); ok { + return x.Welcome + } + } + return nil +} + +func (x *ConnectResponse) GetCommand() *Command { + if x != nil { + if x, ok := x.Message.(*ConnectResponse_Command); ok { + return x.Command + } + } + return nil +} + +type isConnectResponse_Message interface { + isConnectResponse_Message() +} + +type ConnectResponse_Welcome struct { + Welcome *Welcome `protobuf:"bytes,1,opt,name=welcome,proto3,oneof"` +} + +type ConnectResponse_Command struct { + Command *Command `protobuf:"bytes,2,opt,name=command,proto3,oneof"` +} + +func (*ConnectResponse_Welcome) isConnectResponse_Message() {} + +func (*ConnectResponse_Command) isConnectResponse_Message() {} + +// Hello is the first message an agent sends on a new stream. +type Hello struct { + state protoimpl.MessageState `protogen:"open.v1"` + AgentVersion string `protobuf:"bytes,1,opt,name=agent_version,json=agentVersion,proto3" json:"agent_version,omitempty"` + // Revision currently active on the agent (0 = none). + AppliedRevision uint64 `protobuf:"varint,2,opt,name=applied_revision,json=appliedRevision,proto3" json:"applied_revision,omitempty"` + // Last revision that passed its health check. + LastGoodRevision uint64 `protobuf:"varint,3,opt,name=last_good_revision,json=lastGoodRevision,proto3" json:"last_good_revision,omitempty"` + Health *HealthStatus `protobuf:"bytes,4,opt,name=health,proto3" json:"health,omitempty"` + // Version of the managed service, e.g. "BIND 9.20.3" or "Kea 3.2.1". + ServiceVersion string `protobuf:"bytes,5,opt,name=service_version,json=serviceVersion,proto3" json:"service_version,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Hello) Reset() { + *x = Hello{} + mi := &file_ddi_agent_v1_agent_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Hello) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Hello) ProtoMessage() {} + +func (x *Hello) ProtoReflect() protoreflect.Message { + mi := &file_ddi_agent_v1_agent_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Hello.ProtoReflect.Descriptor instead. +func (*Hello) Descriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{6} +} + +func (x *Hello) GetAgentVersion() string { + if x != nil { + return x.AgentVersion + } + return "" +} + +func (x *Hello) GetAppliedRevision() uint64 { + if x != nil { + return x.AppliedRevision + } + return 0 +} + +func (x *Hello) GetLastGoodRevision() uint64 { + if x != nil { + return x.LastGoodRevision + } + return 0 +} + +func (x *Hello) GetHealth() *HealthStatus { + if x != nil { + return x.Health + } + return nil +} + +func (x *Hello) GetServiceVersion() string { + if x != nil { + return x.ServiceVersion + } + return "" +} + +type Heartbeat struct { + state protoimpl.MessageState `protogen:"open.v1"` + AppliedRevision uint64 `protobuf:"varint,1,opt,name=applied_revision,json=appliedRevision,proto3" json:"applied_revision,omitempty"` + Health *HealthStatus `protobuf:"bytes,2,opt,name=health,proto3" json:"health,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Heartbeat) Reset() { + *x = Heartbeat{} + mi := &file_ddi_agent_v1_agent_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Heartbeat) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Heartbeat) ProtoMessage() {} + +func (x *Heartbeat) ProtoReflect() protoreflect.Message { + mi := &file_ddi_agent_v1_agent_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Heartbeat.ProtoReflect.Descriptor instead. +func (*Heartbeat) Descriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{7} +} + +func (x *Heartbeat) GetAppliedRevision() uint64 { + if x != nil { + return x.AppliedRevision + } + return 0 +} + +func (x *Heartbeat) GetHealth() *HealthStatus { + if x != nil { + return x.Health + } + return nil +} + +type HealthStatus struct { + state protoimpl.MessageState `protogen:"open.v1"` + State HealthState `protobuf:"varint,1,opt,name=state,proto3,enum=ddi.agent.v1.HealthState" json:"state,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + CheckedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=checked_at,json=checkedAt,proto3" json:"checked_at,omitempty"` + Checks []*HealthCheck `protobuf:"bytes,4,rep,name=checks,proto3" json:"checks,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HealthStatus) Reset() { + *x = HealthStatus{} + mi := &file_ddi_agent_v1_agent_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *HealthStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HealthStatus) ProtoMessage() {} + +func (x *HealthStatus) ProtoReflect() protoreflect.Message { + mi := &file_ddi_agent_v1_agent_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HealthStatus.ProtoReflect.Descriptor instead. +func (*HealthStatus) Descriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{8} +} + +func (x *HealthStatus) GetState() HealthState { + if x != nil { + return x.State + } + return HealthState_HEALTH_STATE_UNSPECIFIED +} + +func (x *HealthStatus) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *HealthStatus) GetCheckedAt() *timestamppb.Timestamp { + if x != nil { + return x.CheckedAt + } + return nil +} + +func (x *HealthStatus) GetChecks() []*HealthCheck { + if x != nil { + return x.Checks + } + return nil +} + +type HealthCheck struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + State HealthState `protobuf:"varint,2,opt,name=state,proto3,enum=ddi.agent.v1.HealthState" json:"state,omitempty"` + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HealthCheck) Reset() { + *x = HealthCheck{} + mi := &file_ddi_agent_v1_agent_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *HealthCheck) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HealthCheck) ProtoMessage() {} + +func (x *HealthCheck) ProtoReflect() protoreflect.Message { + mi := &file_ddi_agent_v1_agent_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HealthCheck.ProtoReflect.Descriptor instead. +func (*HealthCheck) Descriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{9} +} + +func (x *HealthCheck) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *HealthCheck) GetState() HealthState { + if x != nil { + return x.State + } + return HealthState_HEALTH_STATE_UNSPECIFIED +} + +func (x *HealthCheck) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +// Welcome tells the agent its current settings. +type Welcome struct { + state protoimpl.MessageState `protogen:"open.v1"` + Mode OperatingMode `protobuf:"varint,1,opt,name=mode,proto3,enum=ddi.agent.v1.OperatingMode" json:"mode,omitempty"` + PullInterval *durationpb.Duration `protobuf:"bytes,2,opt,name=pull_interval,json=pullInterval,proto3" json:"pull_interval,omitempty"` + HeartbeatInterval *durationpb.Duration `protobuf:"bytes,3,opt,name=heartbeat_interval,json=heartbeatInterval,proto3" json:"heartbeat_interval,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Welcome) Reset() { + *x = Welcome{} + mi := &file_ddi_agent_v1_agent_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Welcome) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Welcome) ProtoMessage() {} + +func (x *Welcome) ProtoReflect() protoreflect.Message { + mi := &file_ddi_agent_v1_agent_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Welcome.ProtoReflect.Descriptor instead. +func (*Welcome) Descriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{10} +} + +func (x *Welcome) GetMode() OperatingMode { + if x != nil { + return x.Mode + } + return OperatingMode_OPERATING_MODE_UNSPECIFIED +} + +func (x *Welcome) GetPullInterval() *durationpb.Duration { + if x != nil { + return x.PullInterval + } + return nil +} + +func (x *Welcome) GetHeartbeatInterval() *durationpb.Duration { + if x != nil { + return x.HeartbeatInterval + } + return nil +} + +// Command is pushed by the server over the Connect stream. +type Command struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Unique ID, echoed in CommandAck. + CommandId string `protobuf:"bytes,1,opt,name=command_id,json=commandId,proto3" json:"command_id,omitempty"` + // Types that are valid to be assigned to Action: + // + // *Command_ApplyRevision + // *Command_RenewCertificate + Action isCommand_Action `protobuf_oneof:"action"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Command) Reset() { + *x = Command{} + mi := &file_ddi_agent_v1_agent_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Command) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Command) ProtoMessage() {} + +func (x *Command) ProtoReflect() protoreflect.Message { + mi := &file_ddi_agent_v1_agent_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Command.ProtoReflect.Descriptor instead. +func (*Command) Descriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{11} +} + +func (x *Command) GetCommandId() string { + if x != nil { + return x.CommandId + } + return "" +} + +func (x *Command) GetAction() isCommand_Action { + if x != nil { + return x.Action + } + return nil +} + +func (x *Command) GetApplyRevision() *ApplyRevisionCommand { + if x != nil { + if x, ok := x.Action.(*Command_ApplyRevision); ok { + return x.ApplyRevision + } + } + return nil +} + +func (x *Command) GetRenewCertificate() *RenewCertificateCommand { + if x != nil { + if x, ok := x.Action.(*Command_RenewCertificate); ok { + return x.RenewCertificate + } + } + return nil +} + +type isCommand_Action interface { + isCommand_Action() +} + +type Command_ApplyRevision struct { + ApplyRevision *ApplyRevisionCommand `protobuf:"bytes,10,opt,name=apply_revision,json=applyRevision,proto3,oneof"` +} + +type Command_RenewCertificate struct { + RenewCertificate *RenewCertificateCommand `protobuf:"bytes,11,opt,name=renew_certificate,json=renewCertificate,proto3,oneof"` +} + +func (*Command_ApplyRevision) isCommand_Action() {} + +func (*Command_RenewCertificate) isCommand_Action() {} + +// ApplyRevisionCommand asks the agent to fetch and apply a revision now. +type ApplyRevisionCommand struct { + state protoimpl.MessageState `protogen:"open.v1"` + Revision uint64 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` + // Correlates server, agent logs and the deployment record. + DeploymentId string `protobuf:"bytes,2,opt,name=deployment_id,json=deploymentId,proto3" json:"deployment_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ApplyRevisionCommand) Reset() { + *x = ApplyRevisionCommand{} + mi := &file_ddi_agent_v1_agent_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ApplyRevisionCommand) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApplyRevisionCommand) ProtoMessage() {} + +func (x *ApplyRevisionCommand) ProtoReflect() protoreflect.Message { + mi := &file_ddi_agent_v1_agent_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApplyRevisionCommand.ProtoReflect.Descriptor instead. +func (*ApplyRevisionCommand) Descriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{12} +} + +func (x *ApplyRevisionCommand) GetRevision() uint64 { + if x != nil { + return x.Revision + } + return 0 +} + +func (x *ApplyRevisionCommand) GetDeploymentId() string { + if x != nil { + return x.DeploymentId + } + return "" +} + +// RenewCertificateCommand asks the agent to renew its certificate now. +type RenewCertificateCommand struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RenewCertificateCommand) Reset() { + *x = RenewCertificateCommand{} + mi := &file_ddi_agent_v1_agent_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RenewCertificateCommand) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RenewCertificateCommand) ProtoMessage() {} + +func (x *RenewCertificateCommand) ProtoReflect() protoreflect.Message { + mi := &file_ddi_agent_v1_agent_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RenewCertificateCommand.ProtoReflect.Descriptor instead. +func (*RenewCertificateCommand) Descriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{13} +} + +// CommandAck confirms receipt of a command. The outcome of an apply is +// reported separately via ReportDeployment. +type CommandAck struct { + state protoimpl.MessageState `protogen:"open.v1"` + CommandId string `protobuf:"bytes,1,opt,name=command_id,json=commandId,proto3" json:"command_id,omitempty"` + Accepted bool `protobuf:"varint,2,opt,name=accepted,proto3" json:"accepted,omitempty"` + // Reason if not accepted (e.g. "maintenance window closed"). + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CommandAck) Reset() { + *x = CommandAck{} + mi := &file_ddi_agent_v1_agent_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CommandAck) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommandAck) ProtoMessage() {} + +func (x *CommandAck) ProtoReflect() protoreflect.Message { + mi := &file_ddi_agent_v1_agent_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CommandAck.ProtoReflect.Descriptor instead. +func (*CommandAck) Descriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{14} +} + +func (x *CommandAck) GetCommandId() string { + if x != nil { + return x.CommandId + } + return "" +} + +func (x *CommandAck) GetAccepted() bool { + if x != nil { + return x.Accepted + } + return false +} + +func (x *CommandAck) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type GetDesiredStateRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + AppliedRevision uint64 `protobuf:"varint,1,opt,name=applied_revision,json=appliedRevision,proto3" json:"applied_revision,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetDesiredStateRequest) Reset() { + *x = GetDesiredStateRequest{} + mi := &file_ddi_agent_v1_agent_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetDesiredStateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDesiredStateRequest) ProtoMessage() {} + +func (x *GetDesiredStateRequest) ProtoReflect() protoreflect.Message { + mi := &file_ddi_agent_v1_agent_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDesiredStateRequest.ProtoReflect.Descriptor instead. +func (*GetDesiredStateRequest) Descriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{15} +} + +func (x *GetDesiredStateRequest) GetAppliedRevision() uint64 { + if x != nil { + return x.AppliedRevision + } + return 0 +} + +type GetDesiredStateResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Revision the agent should run. 0 means no configuration assigned yet. + DesiredRevision uint64 `protobuf:"varint,1,opt,name=desired_revision,json=desiredRevision,proto3" json:"desired_revision,omitempty"` + Mode OperatingMode `protobuf:"varint,2,opt,name=mode,proto3,enum=ddi.agent.v1.OperatingMode" json:"mode,omitempty"` + PullInterval *durationpb.Duration `protobuf:"bytes,3,opt,name=pull_interval,json=pullInterval,proto3" json:"pull_interval,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetDesiredStateResponse) Reset() { + *x = GetDesiredStateResponse{} + mi := &file_ddi_agent_v1_agent_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetDesiredStateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDesiredStateResponse) ProtoMessage() {} + +func (x *GetDesiredStateResponse) ProtoReflect() protoreflect.Message { + mi := &file_ddi_agent_v1_agent_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDesiredStateResponse.ProtoReflect.Descriptor instead. +func (*GetDesiredStateResponse) Descriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{16} +} + +func (x *GetDesiredStateResponse) GetDesiredRevision() uint64 { + if x != nil { + return x.DesiredRevision + } + return 0 +} + +func (x *GetDesiredStateResponse) GetMode() OperatingMode { + if x != nil { + return x.Mode + } + return OperatingMode_OPERATING_MODE_UNSPECIFIED +} + +func (x *GetDesiredStateResponse) GetPullInterval() *durationpb.Duration { + if x != nil { + return x.PullInterval + } + return nil +} + +type FetchBundleRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Revision uint64 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FetchBundleRequest) Reset() { + *x = FetchBundleRequest{} + mi := &file_ddi_agent_v1_agent_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FetchBundleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FetchBundleRequest) ProtoMessage() {} + +func (x *FetchBundleRequest) ProtoReflect() protoreflect.Message { + mi := &file_ddi_agent_v1_agent_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FetchBundleRequest.ProtoReflect.Descriptor instead. +func (*FetchBundleRequest) Descriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{17} +} + +func (x *FetchBundleRequest) GetRevision() uint64 { + if x != nil { + return x.Revision + } + return 0 +} + +type FetchBundleResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Manifest bytes exactly as signed (JSON). Verify before parsing. + Manifest []byte `protobuf:"bytes,1,opt,name=manifest,proto3" json:"manifest,omitempty"` + // Ed25519 signature over manifest. + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + // Artifact contents; paths, modes and SHA-256 sums are in the manifest. + Artifacts []*Artifact `protobuf:"bytes,3,rep,name=artifacts,proto3" json:"artifacts,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FetchBundleResponse) Reset() { + *x = FetchBundleResponse{} + mi := &file_ddi_agent_v1_agent_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FetchBundleResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FetchBundleResponse) ProtoMessage() {} + +func (x *FetchBundleResponse) ProtoReflect() protoreflect.Message { + mi := &file_ddi_agent_v1_agent_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FetchBundleResponse.ProtoReflect.Descriptor instead. +func (*FetchBundleResponse) Descriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{18} +} + +func (x *FetchBundleResponse) GetManifest() []byte { + if x != nil { + return x.Manifest + } + return nil +} + +func (x *FetchBundleResponse) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +func (x *FetchBundleResponse) GetArtifacts() []*Artifact { + if x != nil { + return x.Artifacts + } + return nil +} + +type Artifact struct { + state protoimpl.MessageState `protogen:"open.v1"` + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + Content []byte `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Artifact) Reset() { + *x = Artifact{} + mi := &file_ddi_agent_v1_agent_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Artifact) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Artifact) ProtoMessage() {} + +func (x *Artifact) ProtoReflect() protoreflect.Message { + mi := &file_ddi_agent_v1_agent_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Artifact.ProtoReflect.Descriptor instead. +func (*Artifact) Descriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{19} +} + +func (x *Artifact) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *Artifact) GetContent() []byte { + if x != nil { + return x.Content + } + return nil +} + +type ReportDeploymentRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Empty for pulls the server did not initiate. + DeploymentId string `protobuf:"bytes,1,opt,name=deployment_id,json=deploymentId,proto3" json:"deployment_id,omitempty"` + Revision uint64 `protobuf:"varint,2,opt,name=revision,proto3" json:"revision,omitempty"` + Trigger DeploymentTrigger `protobuf:"varint,3,opt,name=trigger,proto3,enum=ddi.agent.v1.DeploymentTrigger" json:"trigger,omitempty"` + Outcome DeploymentOutcome `protobuf:"varint,4,opt,name=outcome,proto3,enum=ddi.agent.v1.DeploymentOutcome" json:"outcome,omitempty"` + // Human-readable details (English), e.g. checker output. + Message string `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"` + // Revision active after this deployment. + ActiveRevision uint64 `protobuf:"varint,6,opt,name=active_revision,json=activeRevision,proto3" json:"active_revision,omitempty"` + StartedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=started_at,json=startedAt,proto3" json:"started_at,omitempty"` + FinishedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=finished_at,json=finishedAt,proto3" json:"finished_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ReportDeploymentRequest) Reset() { + *x = ReportDeploymentRequest{} + mi := &file_ddi_agent_v1_agent_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ReportDeploymentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReportDeploymentRequest) ProtoMessage() {} + +func (x *ReportDeploymentRequest) ProtoReflect() protoreflect.Message { + mi := &file_ddi_agent_v1_agent_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReportDeploymentRequest.ProtoReflect.Descriptor instead. +func (*ReportDeploymentRequest) Descriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{20} +} + +func (x *ReportDeploymentRequest) GetDeploymentId() string { + if x != nil { + return x.DeploymentId + } + return "" +} + +func (x *ReportDeploymentRequest) GetRevision() uint64 { + if x != nil { + return x.Revision + } + return 0 +} + +func (x *ReportDeploymentRequest) GetTrigger() DeploymentTrigger { + if x != nil { + return x.Trigger + } + return DeploymentTrigger_DEPLOYMENT_TRIGGER_UNSPECIFIED +} + +func (x *ReportDeploymentRequest) GetOutcome() DeploymentOutcome { + if x != nil { + return x.Outcome + } + return DeploymentOutcome_DEPLOYMENT_OUTCOME_UNSPECIFIED +} + +func (x *ReportDeploymentRequest) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *ReportDeploymentRequest) GetActiveRevision() uint64 { + if x != nil { + return x.ActiveRevision + } + return 0 +} + +func (x *ReportDeploymentRequest) GetStartedAt() *timestamppb.Timestamp { + if x != nil { + return x.StartedAt + } + return nil +} + +func (x *ReportDeploymentRequest) GetFinishedAt() *timestamppb.Timestamp { + if x != nil { + return x.FinishedAt + } + return nil +} + +type ReportDeploymentResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ReportDeploymentResponse) Reset() { + *x = ReportDeploymentResponse{} + mi := &file_ddi_agent_v1_agent_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ReportDeploymentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReportDeploymentResponse) ProtoMessage() {} + +func (x *ReportDeploymentResponse) ProtoReflect() protoreflect.Message { + mi := &file_ddi_agent_v1_agent_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReportDeploymentResponse.ProtoReflect.Descriptor instead. +func (*ReportDeploymentResponse) Descriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{21} +} + +type Lease struct { + state protoimpl.MessageState `protogen:"open.v1"` + // IPv4 or IPv6 address in text form. + Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` + // Hardware address, lowercase colon-separated. + Mac string `protobuf:"bytes,2,opt,name=mac,proto3" json:"mac,omitempty"` + Hostname string `protobuf:"bytes,3,opt,name=hostname,proto3" json:"hostname,omitempty"` + State LeaseState `protobuf:"varint,4,opt,name=state,proto3,enum=ddi.agent.v1.LeaseState" json:"state,omitempty"` + ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + // Kea subnet ID as rendered by the configuration generator. + SubnetId uint32 `protobuf:"varint,7,opt,name=subnet_id,json=subnetId,proto3" json:"subnet_id,omitempty"` + ClientId string `protobuf:"bytes,8,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Lease) Reset() { + *x = Lease{} + mi := &file_ddi_agent_v1_agent_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Lease) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Lease) ProtoMessage() {} + +func (x *Lease) ProtoReflect() protoreflect.Message { + mi := &file_ddi_agent_v1_agent_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Lease.ProtoReflect.Descriptor instead. +func (*Lease) Descriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{22} +} + +func (x *Lease) GetIp() string { + if x != nil { + return x.Ip + } + return "" +} + +func (x *Lease) GetMac() string { + if x != nil { + return x.Mac + } + return "" +} + +func (x *Lease) GetHostname() string { + if x != nil { + return x.Hostname + } + return "" +} + +func (x *Lease) GetState() LeaseState { + if x != nil { + return x.State + } + return LeaseState_LEASE_STATE_UNSPECIFIED +} + +func (x *Lease) GetExpiresAt() *timestamppb.Timestamp { + if x != nil { + return x.ExpiresAt + } + return nil +} + +func (x *Lease) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +func (x *Lease) GetSubnetId() uint32 { + if x != nil { + return x.SubnetId + } + return 0 +} + +func (x *Lease) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +type ReportLeasesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Monotonic per agent; lets the server drop duplicate batches. + Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` + // True if this batch is a full snapshot rather than a set of changes. + FullSync bool `protobuf:"varint,2,opt,name=full_sync,json=fullSync,proto3" json:"full_sync,omitempty"` + Leases []*Lease `protobuf:"bytes,3,rep,name=leases,proto3" json:"leases,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ReportLeasesRequest) Reset() { + *x = ReportLeasesRequest{} + mi := &file_ddi_agent_v1_agent_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ReportLeasesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReportLeasesRequest) ProtoMessage() {} + +func (x *ReportLeasesRequest) ProtoReflect() protoreflect.Message { + mi := &file_ddi_agent_v1_agent_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReportLeasesRequest.ProtoReflect.Descriptor instead. +func (*ReportLeasesRequest) Descriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{23} +} + +func (x *ReportLeasesRequest) GetSequence() uint64 { + if x != nil { + return x.Sequence + } + return 0 +} + +func (x *ReportLeasesRequest) GetFullSync() bool { + if x != nil { + return x.FullSync + } + return false +} + +func (x *ReportLeasesRequest) GetLeases() []*Lease { + if x != nil { + return x.Leases + } + return nil +} + +type ReportLeasesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + AcknowledgedSequence uint64 `protobuf:"varint,1,opt,name=acknowledged_sequence,json=acknowledgedSequence,proto3" json:"acknowledged_sequence,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ReportLeasesResponse) Reset() { + *x = ReportLeasesResponse{} + mi := &file_ddi_agent_v1_agent_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ReportLeasesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReportLeasesResponse) ProtoMessage() {} + +func (x *ReportLeasesResponse) ProtoReflect() protoreflect.Message { + mi := &file_ddi_agent_v1_agent_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReportLeasesResponse.ProtoReflect.Descriptor instead. +func (*ReportLeasesResponse) Descriptor() ([]byte, []int) { + return file_ddi_agent_v1_agent_proto_rawDescGZIP(), []int{24} +} + +func (x *ReportLeasesResponse) GetAcknowledgedSequence() uint64 { + if x != nil { + return x.AcknowledgedSequence + } + return 0 +} + +var File_ddi_agent_v1_agent_proto protoreflect.FileDescriptor + +const file_ddi_agent_v1_agent_proto_rawDesc = "" + + "\n" + + "\x18ddi/agent/v1/agent.proto\x12\fddi.agent.v1\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa7\x01\n" + + "\rEnrollRequest\x12\x14\n" + + "\x05token\x18\x01 \x01(\tR\x05token\x12\x17\n" + + "\acsr_der\x18\x02 \x01(\fR\x06csrDer\x12&\n" + + "\x04role\x18\x03 \x01(\x0e2\x12.ddi.agent.v1.RoleR\x04role\x12\x1a\n" + + "\bhostname\x18\x04 \x01(\tR\bhostname\x12#\n" + + "\ragent_version\x18\x05 \x01(\tR\fagentVersion\"\xbf\x01\n" + + "\x0eEnrollResponse\x12\x19\n" + + "\bagent_id\x18\x01 \x01(\tR\aagentId\x12'\n" + + "\x0fcertificate_der\x18\x02 \x01(\fR\x0ecertificateDer\x12.\n" + + "\x13ca_certificates_der\x18\x03 \x03(\fR\x11caCertificatesDer\x129\n" + + "\x19bundle_signing_public_key\x18\x04 \x01(\fR\x16bundleSigningPublicKey\"2\n" + + "\x17RenewCertificateRequest\x12\x17\n" + + "\acsr_der\x18\x01 \x01(\fR\x06csrDer\"s\n" + + "\x18RenewCertificateResponse\x12'\n" + + "\x0fcertificate_der\x18\x01 \x01(\fR\x0ecertificateDer\x12.\n" + + "\x13ca_certificates_der\x18\x02 \x03(\fR\x11caCertificatesDer\"\xbe\x01\n" + + "\x0eConnectRequest\x12+\n" + + "\x05hello\x18\x01 \x01(\v2\x13.ddi.agent.v1.HelloH\x00R\x05hello\x127\n" + + "\theartbeat\x18\x02 \x01(\v2\x17.ddi.agent.v1.HeartbeatH\x00R\theartbeat\x12;\n" + + "\vcommand_ack\x18\x03 \x01(\v2\x18.ddi.agent.v1.CommandAckH\x00R\n" + + "commandAckB\t\n" + + "\amessage\"\x82\x01\n" + + "\x0fConnectResponse\x121\n" + + "\awelcome\x18\x01 \x01(\v2\x15.ddi.agent.v1.WelcomeH\x00R\awelcome\x121\n" + + "\acommand\x18\x02 \x01(\v2\x15.ddi.agent.v1.CommandH\x00R\acommandB\t\n" + + "\amessage\"\xe2\x01\n" + + "\x05Hello\x12#\n" + + "\ragent_version\x18\x01 \x01(\tR\fagentVersion\x12)\n" + + "\x10applied_revision\x18\x02 \x01(\x04R\x0fappliedRevision\x12,\n" + + "\x12last_good_revision\x18\x03 \x01(\x04R\x10lastGoodRevision\x122\n" + + "\x06health\x18\x04 \x01(\v2\x1a.ddi.agent.v1.HealthStatusR\x06health\x12'\n" + + "\x0fservice_version\x18\x05 \x01(\tR\x0eserviceVersion\"j\n" + + "\tHeartbeat\x12)\n" + + "\x10applied_revision\x18\x01 \x01(\x04R\x0fappliedRevision\x122\n" + + "\x06health\x18\x02 \x01(\v2\x1a.ddi.agent.v1.HealthStatusR\x06health\"\xc7\x01\n" + + "\fHealthStatus\x12/\n" + + "\x05state\x18\x01 \x01(\x0e2\x19.ddi.agent.v1.HealthStateR\x05state\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\x129\n" + + "\n" + + "checked_at\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\tcheckedAt\x121\n" + + "\x06checks\x18\x04 \x03(\v2\x19.ddi.agent.v1.HealthCheckR\x06checks\"l\n" + + "\vHealthCheck\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12/\n" + + "\x05state\x18\x02 \x01(\x0e2\x19.ddi.agent.v1.HealthStateR\x05state\x12\x18\n" + + "\amessage\x18\x03 \x01(\tR\amessage\"\xc4\x01\n" + + "\aWelcome\x12/\n" + + "\x04mode\x18\x01 \x01(\x0e2\x1b.ddi.agent.v1.OperatingModeR\x04mode\x12>\n" + + "\rpull_interval\x18\x02 \x01(\v2\x19.google.protobuf.DurationR\fpullInterval\x12H\n" + + "\x12heartbeat_interval\x18\x03 \x01(\v2\x19.google.protobuf.DurationR\x11heartbeatInterval\"\xd5\x01\n" + + "\aCommand\x12\x1d\n" + + "\n" + + "command_id\x18\x01 \x01(\tR\tcommandId\x12K\n" + + "\x0eapply_revision\x18\n" + + " \x01(\v2\".ddi.agent.v1.ApplyRevisionCommandH\x00R\rapplyRevision\x12T\n" + + "\x11renew_certificate\x18\v \x01(\v2%.ddi.agent.v1.RenewCertificateCommandH\x00R\x10renewCertificateB\b\n" + + "\x06action\"W\n" + + "\x14ApplyRevisionCommand\x12\x1a\n" + + "\brevision\x18\x01 \x01(\x04R\brevision\x12#\n" + + "\rdeployment_id\x18\x02 \x01(\tR\fdeploymentId\"\x19\n" + + "\x17RenewCertificateCommand\"a\n" + + "\n" + + "CommandAck\x12\x1d\n" + + "\n" + + "command_id\x18\x01 \x01(\tR\tcommandId\x12\x1a\n" + + "\baccepted\x18\x02 \x01(\bR\baccepted\x12\x18\n" + + "\amessage\x18\x03 \x01(\tR\amessage\"C\n" + + "\x16GetDesiredStateRequest\x12)\n" + + "\x10applied_revision\x18\x01 \x01(\x04R\x0fappliedRevision\"\xb5\x01\n" + + "\x17GetDesiredStateResponse\x12)\n" + + "\x10desired_revision\x18\x01 \x01(\x04R\x0fdesiredRevision\x12/\n" + + "\x04mode\x18\x02 \x01(\x0e2\x1b.ddi.agent.v1.OperatingModeR\x04mode\x12>\n" + + "\rpull_interval\x18\x03 \x01(\v2\x19.google.protobuf.DurationR\fpullInterval\"0\n" + + "\x12FetchBundleRequest\x12\x1a\n" + + "\brevision\x18\x01 \x01(\x04R\brevision\"\x85\x01\n" + + "\x13FetchBundleResponse\x12\x1a\n" + + "\bmanifest\x18\x01 \x01(\fR\bmanifest\x12\x1c\n" + + "\tsignature\x18\x02 \x01(\fR\tsignature\x124\n" + + "\tartifacts\x18\x03 \x03(\v2\x16.ddi.agent.v1.ArtifactR\tartifacts\"8\n" + + "\bArtifact\x12\x12\n" + + "\x04path\x18\x01 \x01(\tR\x04path\x12\x18\n" + + "\acontent\x18\x02 \x01(\fR\acontent\"\x8b\x03\n" + + "\x17ReportDeploymentRequest\x12#\n" + + "\rdeployment_id\x18\x01 \x01(\tR\fdeploymentId\x12\x1a\n" + + "\brevision\x18\x02 \x01(\x04R\brevision\x129\n" + + "\atrigger\x18\x03 \x01(\x0e2\x1f.ddi.agent.v1.DeploymentTriggerR\atrigger\x129\n" + + "\aoutcome\x18\x04 \x01(\x0e2\x1f.ddi.agent.v1.DeploymentOutcomeR\aoutcome\x12\x18\n" + + "\amessage\x18\x05 \x01(\tR\amessage\x12'\n" + + "\x0factive_revision\x18\x06 \x01(\x04R\x0eactiveRevision\x129\n" + + "\n" + + "started_at\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\tstartedAt\x12;\n" + + "\vfinished_at\x18\b \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "finishedAt\"\x1a\n" + + "\x18ReportDeploymentResponse\"\xa5\x02\n" + + "\x05Lease\x12\x0e\n" + + "\x02ip\x18\x01 \x01(\tR\x02ip\x12\x10\n" + + "\x03mac\x18\x02 \x01(\tR\x03mac\x12\x1a\n" + + "\bhostname\x18\x03 \x01(\tR\bhostname\x12.\n" + + "\x05state\x18\x04 \x01(\x0e2\x18.ddi.agent.v1.LeaseStateR\x05state\x129\n" + + "\n" + + "expires_at\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\texpiresAt\x129\n" + + "\n" + + "updated_at\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\x12\x1b\n" + + "\tsubnet_id\x18\a \x01(\rR\bsubnetId\x12\x1b\n" + + "\tclient_id\x18\b \x01(\tR\bclientId\"{\n" + + "\x13ReportLeasesRequest\x12\x1a\n" + + "\bsequence\x18\x01 \x01(\x04R\bsequence\x12\x1b\n" + + "\tfull_sync\x18\x02 \x01(\bR\bfullSync\x12+\n" + + "\x06leases\x18\x03 \x03(\v2\x13.ddi.agent.v1.LeaseR\x06leases\"K\n" + + "\x14ReportLeasesResponse\x123\n" + + "\x15acknowledged_sequence\x18\x01 \x01(\x04R\x14acknowledgedSequence*9\n" + + "\x04Role\x12\x14\n" + + "\x10ROLE_UNSPECIFIED\x10\x00\x12\f\n" + + "\bROLE_DNS\x10\x01\x12\r\n" + + "\tROLE_DHCP\x10\x02*h\n" + + "\rOperatingMode\x12\x1e\n" + + "\x1aOPERATING_MODE_UNSPECIFIED\x10\x00\x12\x1c\n" + + "\x18OPERATING_MODE_AUTO_PULL\x10\x01\x12\x19\n" + + "\x15OPERATING_MODE_MANUAL\x10\x02*t\n" + + "\vHealthState\x12\x1c\n" + + "\x18HEALTH_STATE_UNSPECIFIED\x10\x00\x12\x13\n" + + "\x0fHEALTH_STATE_OK\x10\x01\x12\x19\n" + + "\x15HEALTH_STATE_DEGRADED\x10\x02\x12\x17\n" + + "\x13HEALTH_STATE_FAILED\x10\x03*q\n" + + "\x11DeploymentTrigger\x12\"\n" + + "\x1eDEPLOYMENT_TRIGGER_UNSPECIFIED\x10\x00\x12\x1b\n" + + "\x17DEPLOYMENT_TRIGGER_PULL\x10\x01\x12\x1b\n" + + "\x17DEPLOYMENT_TRIGGER_PUSH\x10\x02*\xbd\x01\n" + + "\x11DeploymentOutcome\x12\"\n" + + "\x1eDEPLOYMENT_OUTCOME_UNSPECIFIED\x10\x00\x12 \n" + + "\x1cDEPLOYMENT_OUTCOME_SUCCEEDED\x10\x01\x12\x1f\n" + + "\x1bDEPLOYMENT_OUTCOME_REJECTED\x10\x02\x12\"\n" + + "\x1eDEPLOYMENT_OUTCOME_ROLLED_BACK\x10\x03\x12\x1d\n" + + "\x19DEPLOYMENT_OUTCOME_FAILED\x10\x04*\x8e\x01\n" + + "\n" + + "LeaseState\x12\x1b\n" + + "\x17LEASE_STATE_UNSPECIFIED\x10\x00\x12\x16\n" + + "\x12LEASE_STATE_ACTIVE\x10\x01\x12\x17\n" + + "\x13LEASE_STATE_EXPIRED\x10\x02\x12\x18\n" + + "\x14LEASE_STATE_RELEASED\x10\x03\x12\x18\n" + + "\x14LEASE_STATE_DECLINED\x10\x042\xf0\x04\n" + + "\fAgentService\x12C\n" + + "\x06Enroll\x12\x1b.ddi.agent.v1.EnrollRequest\x1a\x1c.ddi.agent.v1.EnrollResponse\x12a\n" + + "\x10RenewCertificate\x12%.ddi.agent.v1.RenewCertificateRequest\x1a&.ddi.agent.v1.RenewCertificateResponse\x12J\n" + + "\aConnect\x12\x1c.ddi.agent.v1.ConnectRequest\x1a\x1d.ddi.agent.v1.ConnectResponse(\x010\x01\x12^\n" + + "\x0fGetDesiredState\x12$.ddi.agent.v1.GetDesiredStateRequest\x1a%.ddi.agent.v1.GetDesiredStateResponse\x12R\n" + + "\vFetchBundle\x12 .ddi.agent.v1.FetchBundleRequest\x1a!.ddi.agent.v1.FetchBundleResponse\x12a\n" + + "\x10ReportDeployment\x12%.ddi.agent.v1.ReportDeploymentRequest\x1a&.ddi.agent.v1.ReportDeploymentResponse\x12U\n" + + "\fReportLeases\x12!.ddi.agent.v1.ReportLeasesRequest\x1a\".ddi.agent.v1.ReportLeasesResponseB;Z9git.beugsiud.de/beug.k/DDI/proto/gen/ddi/agent/v1;agentv1b\x06proto3" + +var ( + file_ddi_agent_v1_agent_proto_rawDescOnce sync.Once + file_ddi_agent_v1_agent_proto_rawDescData []byte +) + +func file_ddi_agent_v1_agent_proto_rawDescGZIP() []byte { + file_ddi_agent_v1_agent_proto_rawDescOnce.Do(func() { + file_ddi_agent_v1_agent_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ddi_agent_v1_agent_proto_rawDesc), len(file_ddi_agent_v1_agent_proto_rawDesc))) + }) + return file_ddi_agent_v1_agent_proto_rawDescData +} + +var file_ddi_agent_v1_agent_proto_enumTypes = make([]protoimpl.EnumInfo, 6) +var file_ddi_agent_v1_agent_proto_msgTypes = make([]protoimpl.MessageInfo, 25) +var file_ddi_agent_v1_agent_proto_goTypes = []any{ + (Role)(0), // 0: ddi.agent.v1.Role + (OperatingMode)(0), // 1: ddi.agent.v1.OperatingMode + (HealthState)(0), // 2: ddi.agent.v1.HealthState + (DeploymentTrigger)(0), // 3: ddi.agent.v1.DeploymentTrigger + (DeploymentOutcome)(0), // 4: ddi.agent.v1.DeploymentOutcome + (LeaseState)(0), // 5: ddi.agent.v1.LeaseState + (*EnrollRequest)(nil), // 6: ddi.agent.v1.EnrollRequest + (*EnrollResponse)(nil), // 7: ddi.agent.v1.EnrollResponse + (*RenewCertificateRequest)(nil), // 8: ddi.agent.v1.RenewCertificateRequest + (*RenewCertificateResponse)(nil), // 9: ddi.agent.v1.RenewCertificateResponse + (*ConnectRequest)(nil), // 10: ddi.agent.v1.ConnectRequest + (*ConnectResponse)(nil), // 11: ddi.agent.v1.ConnectResponse + (*Hello)(nil), // 12: ddi.agent.v1.Hello + (*Heartbeat)(nil), // 13: ddi.agent.v1.Heartbeat + (*HealthStatus)(nil), // 14: ddi.agent.v1.HealthStatus + (*HealthCheck)(nil), // 15: ddi.agent.v1.HealthCheck + (*Welcome)(nil), // 16: ddi.agent.v1.Welcome + (*Command)(nil), // 17: ddi.agent.v1.Command + (*ApplyRevisionCommand)(nil), // 18: ddi.agent.v1.ApplyRevisionCommand + (*RenewCertificateCommand)(nil), // 19: ddi.agent.v1.RenewCertificateCommand + (*CommandAck)(nil), // 20: ddi.agent.v1.CommandAck + (*GetDesiredStateRequest)(nil), // 21: ddi.agent.v1.GetDesiredStateRequest + (*GetDesiredStateResponse)(nil), // 22: ddi.agent.v1.GetDesiredStateResponse + (*FetchBundleRequest)(nil), // 23: ddi.agent.v1.FetchBundleRequest + (*FetchBundleResponse)(nil), // 24: ddi.agent.v1.FetchBundleResponse + (*Artifact)(nil), // 25: ddi.agent.v1.Artifact + (*ReportDeploymentRequest)(nil), // 26: ddi.agent.v1.ReportDeploymentRequest + (*ReportDeploymentResponse)(nil), // 27: ddi.agent.v1.ReportDeploymentResponse + (*Lease)(nil), // 28: ddi.agent.v1.Lease + (*ReportLeasesRequest)(nil), // 29: ddi.agent.v1.ReportLeasesRequest + (*ReportLeasesResponse)(nil), // 30: ddi.agent.v1.ReportLeasesResponse + (*timestamppb.Timestamp)(nil), // 31: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 32: google.protobuf.Duration +} +var file_ddi_agent_v1_agent_proto_depIdxs = []int32{ + 0, // 0: ddi.agent.v1.EnrollRequest.role:type_name -> ddi.agent.v1.Role + 12, // 1: ddi.agent.v1.ConnectRequest.hello:type_name -> ddi.agent.v1.Hello + 13, // 2: ddi.agent.v1.ConnectRequest.heartbeat:type_name -> ddi.agent.v1.Heartbeat + 20, // 3: ddi.agent.v1.ConnectRequest.command_ack:type_name -> ddi.agent.v1.CommandAck + 16, // 4: ddi.agent.v1.ConnectResponse.welcome:type_name -> ddi.agent.v1.Welcome + 17, // 5: ddi.agent.v1.ConnectResponse.command:type_name -> ddi.agent.v1.Command + 14, // 6: ddi.agent.v1.Hello.health:type_name -> ddi.agent.v1.HealthStatus + 14, // 7: ddi.agent.v1.Heartbeat.health:type_name -> ddi.agent.v1.HealthStatus + 2, // 8: ddi.agent.v1.HealthStatus.state:type_name -> ddi.agent.v1.HealthState + 31, // 9: ddi.agent.v1.HealthStatus.checked_at:type_name -> google.protobuf.Timestamp + 15, // 10: ddi.agent.v1.HealthStatus.checks:type_name -> ddi.agent.v1.HealthCheck + 2, // 11: ddi.agent.v1.HealthCheck.state:type_name -> ddi.agent.v1.HealthState + 1, // 12: ddi.agent.v1.Welcome.mode:type_name -> ddi.agent.v1.OperatingMode + 32, // 13: ddi.agent.v1.Welcome.pull_interval:type_name -> google.protobuf.Duration + 32, // 14: ddi.agent.v1.Welcome.heartbeat_interval:type_name -> google.protobuf.Duration + 18, // 15: ddi.agent.v1.Command.apply_revision:type_name -> ddi.agent.v1.ApplyRevisionCommand + 19, // 16: ddi.agent.v1.Command.renew_certificate:type_name -> ddi.agent.v1.RenewCertificateCommand + 1, // 17: ddi.agent.v1.GetDesiredStateResponse.mode:type_name -> ddi.agent.v1.OperatingMode + 32, // 18: ddi.agent.v1.GetDesiredStateResponse.pull_interval:type_name -> google.protobuf.Duration + 25, // 19: ddi.agent.v1.FetchBundleResponse.artifacts:type_name -> ddi.agent.v1.Artifact + 3, // 20: ddi.agent.v1.ReportDeploymentRequest.trigger:type_name -> ddi.agent.v1.DeploymentTrigger + 4, // 21: ddi.agent.v1.ReportDeploymentRequest.outcome:type_name -> ddi.agent.v1.DeploymentOutcome + 31, // 22: ddi.agent.v1.ReportDeploymentRequest.started_at:type_name -> google.protobuf.Timestamp + 31, // 23: ddi.agent.v1.ReportDeploymentRequest.finished_at:type_name -> google.protobuf.Timestamp + 5, // 24: ddi.agent.v1.Lease.state:type_name -> ddi.agent.v1.LeaseState + 31, // 25: ddi.agent.v1.Lease.expires_at:type_name -> google.protobuf.Timestamp + 31, // 26: ddi.agent.v1.Lease.updated_at:type_name -> google.protobuf.Timestamp + 28, // 27: ddi.agent.v1.ReportLeasesRequest.leases:type_name -> ddi.agent.v1.Lease + 6, // 28: ddi.agent.v1.AgentService.Enroll:input_type -> ddi.agent.v1.EnrollRequest + 8, // 29: ddi.agent.v1.AgentService.RenewCertificate:input_type -> ddi.agent.v1.RenewCertificateRequest + 10, // 30: ddi.agent.v1.AgentService.Connect:input_type -> ddi.agent.v1.ConnectRequest + 21, // 31: ddi.agent.v1.AgentService.GetDesiredState:input_type -> ddi.agent.v1.GetDesiredStateRequest + 23, // 32: ddi.agent.v1.AgentService.FetchBundle:input_type -> ddi.agent.v1.FetchBundleRequest + 26, // 33: ddi.agent.v1.AgentService.ReportDeployment:input_type -> ddi.agent.v1.ReportDeploymentRequest + 29, // 34: ddi.agent.v1.AgentService.ReportLeases:input_type -> ddi.agent.v1.ReportLeasesRequest + 7, // 35: ddi.agent.v1.AgentService.Enroll:output_type -> ddi.agent.v1.EnrollResponse + 9, // 36: ddi.agent.v1.AgentService.RenewCertificate:output_type -> ddi.agent.v1.RenewCertificateResponse + 11, // 37: ddi.agent.v1.AgentService.Connect:output_type -> ddi.agent.v1.ConnectResponse + 22, // 38: ddi.agent.v1.AgentService.GetDesiredState:output_type -> ddi.agent.v1.GetDesiredStateResponse + 24, // 39: ddi.agent.v1.AgentService.FetchBundle:output_type -> ddi.agent.v1.FetchBundleResponse + 27, // 40: ddi.agent.v1.AgentService.ReportDeployment:output_type -> ddi.agent.v1.ReportDeploymentResponse + 30, // 41: ddi.agent.v1.AgentService.ReportLeases:output_type -> ddi.agent.v1.ReportLeasesResponse + 35, // [35:42] is the sub-list for method output_type + 28, // [28:35] is the sub-list for method input_type + 28, // [28:28] is the sub-list for extension type_name + 28, // [28:28] is the sub-list for extension extendee + 0, // [0:28] is the sub-list for field type_name +} + +func init() { file_ddi_agent_v1_agent_proto_init() } +func file_ddi_agent_v1_agent_proto_init() { + if File_ddi_agent_v1_agent_proto != nil { + return + } + file_ddi_agent_v1_agent_proto_msgTypes[4].OneofWrappers = []any{ + (*ConnectRequest_Hello)(nil), + (*ConnectRequest_Heartbeat)(nil), + (*ConnectRequest_CommandAck)(nil), + } + file_ddi_agent_v1_agent_proto_msgTypes[5].OneofWrappers = []any{ + (*ConnectResponse_Welcome)(nil), + (*ConnectResponse_Command)(nil), + } + file_ddi_agent_v1_agent_proto_msgTypes[11].OneofWrappers = []any{ + (*Command_ApplyRevision)(nil), + (*Command_RenewCertificate)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_ddi_agent_v1_agent_proto_rawDesc), len(file_ddi_agent_v1_agent_proto_rawDesc)), + NumEnums: 6, + NumMessages: 25, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_ddi_agent_v1_agent_proto_goTypes, + DependencyIndexes: file_ddi_agent_v1_agent_proto_depIdxs, + EnumInfos: file_ddi_agent_v1_agent_proto_enumTypes, + MessageInfos: file_ddi_agent_v1_agent_proto_msgTypes, + }.Build() + File_ddi_agent_v1_agent_proto = out.File + file_ddi_agent_v1_agent_proto_goTypes = nil + file_ddi_agent_v1_agent_proto_depIdxs = nil +} diff --git a/proto/gen/ddi/agent/v1/agent_grpc.pb.go b/proto/gen/ddi/agent/v1/agent_grpc.pb.go new file mode 100644 index 0000000..8b84fff --- /dev/null +++ b/proto/gen/ddi/agent/v1/agent_grpc.pb.go @@ -0,0 +1,382 @@ +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.6.2 +// - protoc (unknown) +// source: ddi/agent/v1/agent.proto + +package agentv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + AgentService_Enroll_FullMethodName = "/ddi.agent.v1.AgentService/Enroll" + AgentService_RenewCertificate_FullMethodName = "/ddi.agent.v1.AgentService/RenewCertificate" + AgentService_Connect_FullMethodName = "/ddi.agent.v1.AgentService/Connect" + AgentService_GetDesiredState_FullMethodName = "/ddi.agent.v1.AgentService/GetDesiredState" + AgentService_FetchBundle_FullMethodName = "/ddi.agent.v1.AgentService/FetchBundle" + AgentService_ReportDeployment_FullMethodName = "/ddi.agent.v1.AgentService/ReportDeployment" + AgentService_ReportLeases_FullMethodName = "/ddi.agent.v1.AgentService/ReportLeases" +) + +// AgentServiceClient is the client API for AgentService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// AgentService is implemented by the management server and called by agents. +// Agents always connect outbound (docs/adr/0007-server-agent-grpc-mtls.md). +// Every RPC except Enroll requires a client certificate issued by the +// server's internal CA (docs/adr/0008-interne-ca-enrollment.md). +type AgentServiceClient interface { + // Enroll exchanges a one-time token and a certificate signing request for a + // client certificate. It is the only RPC allowed without client certificate. + Enroll(ctx context.Context, in *EnrollRequest, opts ...grpc.CallOption) (*EnrollResponse, error) + // RenewCertificate issues a new client certificate for a freshly generated + // key. Allowed with a certificate that expired at most 30 days ago. + RenewCertificate(ctx context.Context, in *RenewCertificateRequest, opts ...grpc.CallOption) (*RenewCertificateResponse, error) + // Connect is the long-lived control stream. The agent sends Hello first, + // then heartbeats and command acknowledgements; the server answers with + // Welcome and pushes commands. + Connect(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[ConnectRequest, ConnectResponse], error) + // GetDesiredState returns the revision the agent should run. Used for + // auto_pull and as fallback when the Connect stream is unavailable. + GetDesiredState(ctx context.Context, in *GetDesiredStateRequest, opts ...grpc.CallOption) (*GetDesiredStateResponse, error) + // FetchBundle downloads the signed configuration bundle of a revision + // (docs/adr/0009-signierte-config-bundles.md). + FetchBundle(ctx context.Context, in *FetchBundleRequest, opts ...grpc.CallOption) (*FetchBundleResponse, error) + // ReportDeployment reports the outcome of applying a revision. + ReportDeployment(ctx context.Context, in *ReportDeploymentRequest, opts ...grpc.CallOption) (*ReportDeploymentResponse, error) + // ReportLeases sends a batch of DHCP lease observations (DHCP agents only). + ReportLeases(ctx context.Context, in *ReportLeasesRequest, opts ...grpc.CallOption) (*ReportLeasesResponse, error) +} + +type agentServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAgentServiceClient(cc grpc.ClientConnInterface) AgentServiceClient { + return &agentServiceClient{cc} +} + +func (c *agentServiceClient) Enroll(ctx context.Context, in *EnrollRequest, opts ...grpc.CallOption) (*EnrollResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(EnrollResponse) + err := c.cc.Invoke(ctx, AgentService_Enroll_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *agentServiceClient) RenewCertificate(ctx context.Context, in *RenewCertificateRequest, opts ...grpc.CallOption) (*RenewCertificateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(RenewCertificateResponse) + err := c.cc.Invoke(ctx, AgentService_RenewCertificate_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *agentServiceClient) Connect(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[ConnectRequest, ConnectResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &AgentService_ServiceDesc.Streams[0], AgentService_Connect_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[ConnectRequest, ConnectResponse]{ClientStream: stream} + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type AgentService_ConnectClient = grpc.BidiStreamingClient[ConnectRequest, ConnectResponse] + +func (c *agentServiceClient) GetDesiredState(ctx context.Context, in *GetDesiredStateRequest, opts ...grpc.CallOption) (*GetDesiredStateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetDesiredStateResponse) + err := c.cc.Invoke(ctx, AgentService_GetDesiredState_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *agentServiceClient) FetchBundle(ctx context.Context, in *FetchBundleRequest, opts ...grpc.CallOption) (*FetchBundleResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(FetchBundleResponse) + err := c.cc.Invoke(ctx, AgentService_FetchBundle_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *agentServiceClient) ReportDeployment(ctx context.Context, in *ReportDeploymentRequest, opts ...grpc.CallOption) (*ReportDeploymentResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ReportDeploymentResponse) + err := c.cc.Invoke(ctx, AgentService_ReportDeployment_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *agentServiceClient) ReportLeases(ctx context.Context, in *ReportLeasesRequest, opts ...grpc.CallOption) (*ReportLeasesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ReportLeasesResponse) + err := c.cc.Invoke(ctx, AgentService_ReportLeases_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AgentServiceServer is the server API for AgentService service. +// All implementations must embed UnimplementedAgentServiceServer +// for forward compatibility. +// +// AgentService is implemented by the management server and called by agents. +// Agents always connect outbound (docs/adr/0007-server-agent-grpc-mtls.md). +// Every RPC except Enroll requires a client certificate issued by the +// server's internal CA (docs/adr/0008-interne-ca-enrollment.md). +type AgentServiceServer interface { + // Enroll exchanges a one-time token and a certificate signing request for a + // client certificate. It is the only RPC allowed without client certificate. + Enroll(context.Context, *EnrollRequest) (*EnrollResponse, error) + // RenewCertificate issues a new client certificate for a freshly generated + // key. Allowed with a certificate that expired at most 30 days ago. + RenewCertificate(context.Context, *RenewCertificateRequest) (*RenewCertificateResponse, error) + // Connect is the long-lived control stream. The agent sends Hello first, + // then heartbeats and command acknowledgements; the server answers with + // Welcome and pushes commands. + Connect(grpc.BidiStreamingServer[ConnectRequest, ConnectResponse]) error + // GetDesiredState returns the revision the agent should run. Used for + // auto_pull and as fallback when the Connect stream is unavailable. + GetDesiredState(context.Context, *GetDesiredStateRequest) (*GetDesiredStateResponse, error) + // FetchBundle downloads the signed configuration bundle of a revision + // (docs/adr/0009-signierte-config-bundles.md). + FetchBundle(context.Context, *FetchBundleRequest) (*FetchBundleResponse, error) + // ReportDeployment reports the outcome of applying a revision. + ReportDeployment(context.Context, *ReportDeploymentRequest) (*ReportDeploymentResponse, error) + // ReportLeases sends a batch of DHCP lease observations (DHCP agents only). + ReportLeases(context.Context, *ReportLeasesRequest) (*ReportLeasesResponse, error) + mustEmbedUnimplementedAgentServiceServer() +} + +// UnimplementedAgentServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedAgentServiceServer struct{} + +func (UnimplementedAgentServiceServer) Enroll(context.Context, *EnrollRequest) (*EnrollResponse, error) { + return nil, status.Error(codes.Unimplemented, "method Enroll not implemented") +} +func (UnimplementedAgentServiceServer) RenewCertificate(context.Context, *RenewCertificateRequest) (*RenewCertificateResponse, error) { + return nil, status.Error(codes.Unimplemented, "method RenewCertificate not implemented") +} +func (UnimplementedAgentServiceServer) Connect(grpc.BidiStreamingServer[ConnectRequest, ConnectResponse]) error { + return status.Error(codes.Unimplemented, "method Connect not implemented") +} +func (UnimplementedAgentServiceServer) GetDesiredState(context.Context, *GetDesiredStateRequest) (*GetDesiredStateResponse, error) { + return nil, status.Error(codes.Unimplemented, "method GetDesiredState not implemented") +} +func (UnimplementedAgentServiceServer) FetchBundle(context.Context, *FetchBundleRequest) (*FetchBundleResponse, error) { + return nil, status.Error(codes.Unimplemented, "method FetchBundle not implemented") +} +func (UnimplementedAgentServiceServer) ReportDeployment(context.Context, *ReportDeploymentRequest) (*ReportDeploymentResponse, error) { + return nil, status.Error(codes.Unimplemented, "method ReportDeployment not implemented") +} +func (UnimplementedAgentServiceServer) ReportLeases(context.Context, *ReportLeasesRequest) (*ReportLeasesResponse, error) { + return nil, status.Error(codes.Unimplemented, "method ReportLeases not implemented") +} +func (UnimplementedAgentServiceServer) mustEmbedUnimplementedAgentServiceServer() {} +func (UnimplementedAgentServiceServer) testEmbeddedByValue() {} + +// UnsafeAgentServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AgentServiceServer will +// result in compilation errors. +type UnsafeAgentServiceServer interface { + mustEmbedUnimplementedAgentServiceServer() +} + +func RegisterAgentServiceServer(s grpc.ServiceRegistrar, srv AgentServiceServer) { + // If the following call panics, it indicates UnimplementedAgentServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&AgentService_ServiceDesc, srv) +} + +func _AgentService_Enroll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EnrollRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AgentServiceServer).Enroll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AgentService_Enroll_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AgentServiceServer).Enroll(ctx, req.(*EnrollRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AgentService_RenewCertificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RenewCertificateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AgentServiceServer).RenewCertificate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AgentService_RenewCertificate_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AgentServiceServer).RenewCertificate(ctx, req.(*RenewCertificateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AgentService_Connect_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(AgentServiceServer).Connect(&grpc.GenericServerStream[ConnectRequest, ConnectResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type AgentService_ConnectServer = grpc.BidiStreamingServer[ConnectRequest, ConnectResponse] + +func _AgentService_GetDesiredState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetDesiredStateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AgentServiceServer).GetDesiredState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AgentService_GetDesiredState_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AgentServiceServer).GetDesiredState(ctx, req.(*GetDesiredStateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AgentService_FetchBundle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FetchBundleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AgentServiceServer).FetchBundle(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AgentService_FetchBundle_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AgentServiceServer).FetchBundle(ctx, req.(*FetchBundleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AgentService_ReportDeployment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReportDeploymentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AgentServiceServer).ReportDeployment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AgentService_ReportDeployment_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AgentServiceServer).ReportDeployment(ctx, req.(*ReportDeploymentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AgentService_ReportLeases_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReportLeasesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AgentServiceServer).ReportLeases(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AgentService_ReportLeases_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AgentServiceServer).ReportLeases(ctx, req.(*ReportLeasesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// AgentService_ServiceDesc is the grpc.ServiceDesc for AgentService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var AgentService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "ddi.agent.v1.AgentService", + HandlerType: (*AgentServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Enroll", + Handler: _AgentService_Enroll_Handler, + }, + { + MethodName: "RenewCertificate", + Handler: _AgentService_RenewCertificate_Handler, + }, + { + MethodName: "GetDesiredState", + Handler: _AgentService_GetDesiredState_Handler, + }, + { + MethodName: "FetchBundle", + Handler: _AgentService_FetchBundle_Handler, + }, + { + MethodName: "ReportDeployment", + Handler: _AgentService_ReportDeployment_Handler, + }, + { + MethodName: "ReportLeases", + Handler: _AgentService_ReportLeases_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Connect", + Handler: _AgentService_Connect_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "ddi/agent/v1/agent.proto", +}