Netpulse_SasS/gen/go/netpulse/v1/ncm.pb.go
byrsapty ddaae60fa0 Етап 8: реєстрація зонда одноразовим запрошенням
Найбільше вузьке місце до запуску: агент заводився INSERT-ом у базу, а
токен вписувався в командний рядок руками. Поставити зонд у клієнта було
неможливо.

core.agent_enrollments тримає sha256 одноразового токена; сам токен
повертається рівно один раз. Видача під FOR UPDATE в одній транзакції:
два агенти з однієї скопійованої команди інакше створили б два зонди з
одного запрошення. Відповідь на «немає», «згоріло» і «використано»
однакова — розрізняти їх означає підказувати тому, хто підбирає токени.

Токен зонда їде окремим полем agent_token, а не в certificate:
сертифікат відповідає на інше питання й живе за іншим циклом.

Агент зберігає посвідчення в /etc/netpulse/agent.json з правами 0600,
через тимчасовий файл і перейменування — обрив живлення посеред запису
інакше лишив би половину токена.

Знайдено живим прогоном: реєстрація не проходила автентифікацію, бо
інтерсептор стоїть на всьому сервері, а не на окремому сервісі — мій же
коментар стверджував протилежне. І запуск із самим посвідченням падав:
validate() вимагав -agent-id, не знаючи про файл.

Сторінка зондів: команда встановлення з токеном, відкликання
запрошень, керування модулями й лімітами, видалення.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-25 00:50:57 +03:00

1094 lines
35 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// =====================================================================
// NetPulse :: ncm.proto
// Збір конфігурацій (SSH/Telnet/API) та застосування відкату.
//
// Розподіл відповідальності:
// Агент — відкриває сесію, виконує команди, віддає сирий текст.
// Сервер — scrub/redact, хешування, коміт у Git, diff, compliance.
//
// Це навмисно: правила очищення живуть у ncm.profiles і мають
// змінюватись без оновлення агентів у полі.
// =====================================================================
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.12
// protoc (unknown)
// source: netpulse/v1/ncm.proto
package netpulsev1
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)
)
type ConfigJob struct {
state protoimpl.MessageState `protogen:"open.v1"`
JobId string `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"`
Device *DeviceTarget `protobuf:"bytes,2,opt,name=device,proto3" json:"device,omitempty"`
Credential *Credential `protobuf:"bytes,3,opt,name=credential,proto3" json:"credential,omitempty"`
Transport Transport `protobuf:"varint,4,opt,name=transport,proto3,enum=netpulse.v1.Transport" json:"transport,omitempty"`
Port uint32 `protobuf:"varint,5,opt,name=port,proto3" json:"port,omitempty"`
// Команди по черзі: ["terminal length 0", "show running-config"].
// Вивід останньої команди вважається тілом конфігу; вивід попередніх
// (підготовчих) відкидається.
Commands []string `protobuf:"bytes,6,rep,name=commands,proto3" json:"commands,omitempty"`
// Регекс запрошення командного рядка — за ним агент розуміє,
// що команда відпрацювала.
PromptRegex string `protobuf:"bytes,7,opt,name=prompt_regex,json=promptRegex,proto3" json:"prompt_regex,omitempty"`
// Потрібен enable/privileged режим перед виконанням.
EnableRequired bool `protobuf:"varint,8,opt,name=enable_required,json=enableRequired,proto3" json:"enable_required,omitempty"`
EnablePromptRegex string `protobuf:"bytes,9,opt,name=enable_prompt_regex,json=enablePromptRegex,proto3" json:"enable_prompt_regex,omitempty"`
// running | startup | vlan | license | inventory
ConfigType string `protobuf:"bytes,10,opt,name=config_type,json=configType,proto3" json:"config_type,omitempty"`
Timeout *durationpb.Duration `protobuf:"bytes,11,opt,name=timeout,proto3" json:"timeout,omitempty"`
// Ліміт розміру: захист від пристрою, що віддає гігабайт сміття.
MaxBytes uint64 `protobuf:"varint,12,opt,name=max_bytes,json=maxBytes,proto3" json:"max_bytes,omitempty"`
// Записувати повний транскрипт сесії (для діагностики prompt_regex).
CaptureTranscript bool `protobuf:"varint,13,opt,name=capture_transcript,json=captureTranscript,proto3" json:"capture_transcript,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ConfigJob) Reset() {
*x = ConfigJob{}
mi := &file_netpulse_v1_ncm_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ConfigJob) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ConfigJob) ProtoMessage() {}
func (x *ConfigJob) ProtoReflect() protoreflect.Message {
mi := &file_netpulse_v1_ncm_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 ConfigJob.ProtoReflect.Descriptor instead.
func (*ConfigJob) Descriptor() ([]byte, []int) {
return file_netpulse_v1_ncm_proto_rawDescGZIP(), []int{0}
}
func (x *ConfigJob) GetJobId() string {
if x != nil {
return x.JobId
}
return ""
}
func (x *ConfigJob) GetDevice() *DeviceTarget {
if x != nil {
return x.Device
}
return nil
}
func (x *ConfigJob) GetCredential() *Credential {
if x != nil {
return x.Credential
}
return nil
}
func (x *ConfigJob) GetTransport() Transport {
if x != nil {
return x.Transport
}
return Transport_TRANSPORT_UNSPECIFIED
}
func (x *ConfigJob) GetPort() uint32 {
if x != nil {
return x.Port
}
return 0
}
func (x *ConfigJob) GetCommands() []string {
if x != nil {
return x.Commands
}
return nil
}
func (x *ConfigJob) GetPromptRegex() string {
if x != nil {
return x.PromptRegex
}
return ""
}
func (x *ConfigJob) GetEnableRequired() bool {
if x != nil {
return x.EnableRequired
}
return false
}
func (x *ConfigJob) GetEnablePromptRegex() string {
if x != nil {
return x.EnablePromptRegex
}
return ""
}
func (x *ConfigJob) GetConfigType() string {
if x != nil {
return x.ConfigType
}
return ""
}
func (x *ConfigJob) GetTimeout() *durationpb.Duration {
if x != nil {
return x.Timeout
}
return nil
}
func (x *ConfigJob) GetMaxBytes() uint64 {
if x != nil {
return x.MaxBytes
}
return 0
}
func (x *ConfigJob) GetCaptureTranscript() bool {
if x != nil {
return x.CaptureTranscript
}
return false
}
type ConfigUpload struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Types that are valid to be assigned to Part:
//
// *ConfigUpload_Header
// *ConfigUpload_Chunk
// *ConfigUpload_Trailer
Part isConfigUpload_Part `protobuf_oneof:"part"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ConfigUpload) Reset() {
*x = ConfigUpload{}
mi := &file_netpulse_v1_ncm_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ConfigUpload) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ConfigUpload) ProtoMessage() {}
func (x *ConfigUpload) ProtoReflect() protoreflect.Message {
mi := &file_netpulse_v1_ncm_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 ConfigUpload.ProtoReflect.Descriptor instead.
func (*ConfigUpload) Descriptor() ([]byte, []int) {
return file_netpulse_v1_ncm_proto_rawDescGZIP(), []int{1}
}
func (x *ConfigUpload) GetPart() isConfigUpload_Part {
if x != nil {
return x.Part
}
return nil
}
func (x *ConfigUpload) GetHeader() *ConfigHeader {
if x != nil {
if x, ok := x.Part.(*ConfigUpload_Header); ok {
return x.Header
}
}
return nil
}
func (x *ConfigUpload) GetChunk() *ConfigChunk {
if x != nil {
if x, ok := x.Part.(*ConfigUpload_Chunk); ok {
return x.Chunk
}
}
return nil
}
func (x *ConfigUpload) GetTrailer() *ConfigTrailer {
if x != nil {
if x, ok := x.Part.(*ConfigUpload_Trailer); ok {
return x.Trailer
}
}
return nil
}
type isConfigUpload_Part interface {
isConfigUpload_Part()
}
type ConfigUpload_Header struct {
Header *ConfigHeader `protobuf:"bytes,1,opt,name=header,proto3,oneof"`
}
type ConfigUpload_Chunk struct {
Chunk *ConfigChunk `protobuf:"bytes,2,opt,name=chunk,proto3,oneof"`
}
type ConfigUpload_Trailer struct {
Trailer *ConfigTrailer `protobuf:"bytes,3,opt,name=trailer,proto3,oneof"`
}
func (*ConfigUpload_Header) isConfigUpload_Part() {}
func (*ConfigUpload_Chunk) isConfigUpload_Part() {}
func (*ConfigUpload_Trailer) isConfigUpload_Part() {}
type ConfigHeader struct {
state protoimpl.MessageState `protogen:"open.v1"`
JobId string `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"`
AgentId string `protobuf:"bytes,2,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"`
DeviceId string `protobuf:"bytes,3,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"`
ConfigType string `protobuf:"bytes,4,opt,name=config_type,json=configType,proto3" json:"config_type,omitempty"`
CollectedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=collected_at,json=collectedAt,proto3" json:"collected_at,omitempty"`
// gzip | none — агент стискає, бо конфіги добре жмуться,
// а канал може бути вузьким.
Encoding string `protobuf:"bytes,6,opt,name=encoding,proto3" json:"encoding,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ConfigHeader) Reset() {
*x = ConfigHeader{}
mi := &file_netpulse_v1_ncm_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ConfigHeader) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ConfigHeader) ProtoMessage() {}
func (x *ConfigHeader) ProtoReflect() protoreflect.Message {
mi := &file_netpulse_v1_ncm_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 ConfigHeader.ProtoReflect.Descriptor instead.
func (*ConfigHeader) Descriptor() ([]byte, []int) {
return file_netpulse_v1_ncm_proto_rawDescGZIP(), []int{2}
}
func (x *ConfigHeader) GetJobId() string {
if x != nil {
return x.JobId
}
return ""
}
func (x *ConfigHeader) GetAgentId() string {
if x != nil {
return x.AgentId
}
return ""
}
func (x *ConfigHeader) GetDeviceId() string {
if x != nil {
return x.DeviceId
}
return ""
}
func (x *ConfigHeader) GetConfigType() string {
if x != nil {
return x.ConfigType
}
return ""
}
func (x *ConfigHeader) GetCollectedAt() *timestamppb.Timestamp {
if x != nil {
return x.CollectedAt
}
return nil
}
func (x *ConfigHeader) GetEncoding() string {
if x != nil {
return x.Encoding
}
return ""
}
type ConfigChunk struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Номер чанка з 0; сервер збирає в порядку зростання.
Sequence uint32 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"`
Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ConfigChunk) Reset() {
*x = ConfigChunk{}
mi := &file_netpulse_v1_ncm_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ConfigChunk) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ConfigChunk) ProtoMessage() {}
func (x *ConfigChunk) ProtoReflect() protoreflect.Message {
mi := &file_netpulse_v1_ncm_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 ConfigChunk.ProtoReflect.Descriptor instead.
func (*ConfigChunk) Descriptor() ([]byte, []int) {
return file_netpulse_v1_ncm_proto_rawDescGZIP(), []int{3}
}
func (x *ConfigChunk) GetSequence() uint32 {
if x != nil {
return x.Sequence
}
return 0
}
func (x *ConfigChunk) GetData() []byte {
if x != nil {
return x.Data
}
return nil
}
type ConfigTrailer struct {
state protoimpl.MessageState `protogen:"open.v1"`
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
Error *Error `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
// sha256 ПОВНОГО тіла ДО стиснення. Сервер звіряє й лише потім комітить.
ContentSha256 []byte `protobuf:"bytes,3,opt,name=content_sha256,json=contentSha256,proto3" json:"content_sha256,omitempty"`
SizeBytes uint64 `protobuf:"varint,4,opt,name=size_bytes,json=sizeBytes,proto3" json:"size_bytes,omitempty"`
LineCount uint32 `protobuf:"varint,5,opt,name=line_count,json=lineCount,proto3" json:"line_count,omitempty"`
ChunkCount uint32 `protobuf:"varint,6,opt,name=chunk_count,json=chunkCount,proto3" json:"chunk_count,omitempty"`
Duration *durationpb.Duration `protobuf:"bytes,7,opt,name=duration,proto3" json:"duration,omitempty"`
// Транскрипт сесії, якщо capture_transcript = true.
Transcript string `protobuf:"bytes,8,opt,name=transcript,proto3" json:"transcript,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ConfigTrailer) Reset() {
*x = ConfigTrailer{}
mi := &file_netpulse_v1_ncm_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ConfigTrailer) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ConfigTrailer) ProtoMessage() {}
func (x *ConfigTrailer) ProtoReflect() protoreflect.Message {
mi := &file_netpulse_v1_ncm_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 ConfigTrailer.ProtoReflect.Descriptor instead.
func (*ConfigTrailer) Descriptor() ([]byte, []int) {
return file_netpulse_v1_ncm_proto_rawDescGZIP(), []int{4}
}
func (x *ConfigTrailer) GetSuccess() bool {
if x != nil {
return x.Success
}
return false
}
func (x *ConfigTrailer) GetError() *Error {
if x != nil {
return x.Error
}
return nil
}
func (x *ConfigTrailer) GetContentSha256() []byte {
if x != nil {
return x.ContentSha256
}
return nil
}
func (x *ConfigTrailer) GetSizeBytes() uint64 {
if x != nil {
return x.SizeBytes
}
return 0
}
func (x *ConfigTrailer) GetLineCount() uint32 {
if x != nil {
return x.LineCount
}
return 0
}
func (x *ConfigTrailer) GetChunkCount() uint32 {
if x != nil {
return x.ChunkCount
}
return 0
}
func (x *ConfigTrailer) GetDuration() *durationpb.Duration {
if x != nil {
return x.Duration
}
return nil
}
func (x *ConfigTrailer) GetTranscript() string {
if x != nil {
return x.Transcript
}
return ""
}
type ConfigReceipt struct {
state protoimpl.MessageState `protogen:"open.v1"`
JobId string `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"`
Accepted bool `protobuf:"varint,2,opt,name=accepted,proto3" json:"accepted,omitempty"`
// Сервер порівняв content_hash із попередньою версією: конфіг не змінився,
// нового коміту не буде. Агенту корисно знати для локальної статистики.
Unchanged bool `protobuf:"varint,3,opt,name=unchanged,proto3" json:"unchanged,omitempty"`
// Заповнюється, якщо коміт відбувся.
CommitSha string `protobuf:"bytes,4,opt,name=commit_sha,json=commitSha,proto3" json:"commit_sha,omitempty"`
ConfigId string `protobuf:"bytes,5,opt,name=config_id,json=configId,proto3" json:"config_id,omitempty"`
Error *Error `protobuf:"bytes,6,opt,name=error,proto3" json:"error,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ConfigReceipt) Reset() {
*x = ConfigReceipt{}
mi := &file_netpulse_v1_ncm_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ConfigReceipt) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ConfigReceipt) ProtoMessage() {}
func (x *ConfigReceipt) ProtoReflect() protoreflect.Message {
mi := &file_netpulse_v1_ncm_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 ConfigReceipt.ProtoReflect.Descriptor instead.
func (*ConfigReceipt) Descriptor() ([]byte, []int) {
return file_netpulse_v1_ncm_proto_rawDescGZIP(), []int{5}
}
func (x *ConfigReceipt) GetJobId() string {
if x != nil {
return x.JobId
}
return ""
}
func (x *ConfigReceipt) GetAccepted() bool {
if x != nil {
return x.Accepted
}
return false
}
func (x *ConfigReceipt) GetUnchanged() bool {
if x != nil {
return x.Unchanged
}
return false
}
func (x *ConfigReceipt) GetCommitSha() string {
if x != nil {
return x.CommitSha
}
return ""
}
func (x *ConfigReceipt) GetConfigId() string {
if x != nil {
return x.ConfigId
}
return ""
}
func (x *ConfigReceipt) GetError() *Error {
if x != nil {
return x.Error
}
return nil
}
type ConfigApplyJob struct {
state protoimpl.MessageState `protogen:"open.v1"`
RollbackId string `protobuf:"bytes,1,opt,name=rollback_id,json=rollbackId,proto3" json:"rollback_id,omitempty"`
Device *DeviceTarget `protobuf:"bytes,2,opt,name=device,proto3" json:"device,omitempty"`
Credential *Credential `protobuf:"bytes,3,opt,name=credential,proto3" json:"credential,omitempty"`
Transport Transport `protobuf:"varint,4,opt,name=transport,proto3,enum=netpulse.v1.Transport" json:"transport,omitempty"`
// Рядки конфігу, які треба виконати послідовно.
Commands []string `protobuf:"bytes,5,rep,name=commands,proto3" json:"commands,omitempty"`
PromptRegex string `protobuf:"bytes,6,opt,name=prompt_regex,json=promptRegex,proto3" json:"prompt_regex,omitempty"`
EnableRequired bool `protobuf:"varint,7,opt,name=enable_required,json=enableRequired,proto3" json:"enable_required,omitempty"`
// Команда збереження після успіху ("write memory", "/system backup save").
CommitCommand string `protobuf:"bytes,8,opt,name=commit_command,json=commitCommand,proto3" json:"commit_command,omitempty"`
// Якщо пристрій підтримує confirmed commit — відкотиться сам,
// коли агент не підтвердить у цей строк. Найкращий захист від
// втрати керування після помилкового правила фаєрвола.
ConfirmTimeout *durationpb.Duration `protobuf:"bytes,9,opt,name=confirm_timeout,json=confirmTimeout,proto3" json:"confirm_timeout,omitempty"`
// Зупинитись на першій помилці (за замовчуванням) чи виконати все.
ContinueOnError bool `protobuf:"varint,10,opt,name=continue_on_error,json=continueOnError,proto3" json:"continue_on_error,omitempty"`
Timeout *durationpb.Duration `protobuf:"bytes,11,opt,name=timeout,proto3" json:"timeout,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ConfigApplyJob) Reset() {
*x = ConfigApplyJob{}
mi := &file_netpulse_v1_ncm_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ConfigApplyJob) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ConfigApplyJob) ProtoMessage() {}
func (x *ConfigApplyJob) ProtoReflect() protoreflect.Message {
mi := &file_netpulse_v1_ncm_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 ConfigApplyJob.ProtoReflect.Descriptor instead.
func (*ConfigApplyJob) Descriptor() ([]byte, []int) {
return file_netpulse_v1_ncm_proto_rawDescGZIP(), []int{6}
}
func (x *ConfigApplyJob) GetRollbackId() string {
if x != nil {
return x.RollbackId
}
return ""
}
func (x *ConfigApplyJob) GetDevice() *DeviceTarget {
if x != nil {
return x.Device
}
return nil
}
func (x *ConfigApplyJob) GetCredential() *Credential {
if x != nil {
return x.Credential
}
return nil
}
func (x *ConfigApplyJob) GetTransport() Transport {
if x != nil {
return x.Transport
}
return Transport_TRANSPORT_UNSPECIFIED
}
func (x *ConfigApplyJob) GetCommands() []string {
if x != nil {
return x.Commands
}
return nil
}
func (x *ConfigApplyJob) GetPromptRegex() string {
if x != nil {
return x.PromptRegex
}
return ""
}
func (x *ConfigApplyJob) GetEnableRequired() bool {
if x != nil {
return x.EnableRequired
}
return false
}
func (x *ConfigApplyJob) GetCommitCommand() string {
if x != nil {
return x.CommitCommand
}
return ""
}
func (x *ConfigApplyJob) GetConfirmTimeout() *durationpb.Duration {
if x != nil {
return x.ConfirmTimeout
}
return nil
}
func (x *ConfigApplyJob) GetContinueOnError() bool {
if x != nil {
return x.ContinueOnError
}
return false
}
func (x *ConfigApplyJob) GetTimeout() *durationpb.Duration {
if x != nil {
return x.Timeout
}
return nil
}
type ConfigApplyResult struct {
state protoimpl.MessageState `protogen:"open.v1"`
RollbackId string `protobuf:"bytes,1,opt,name=rollback_id,json=rollbackId,proto3" json:"rollback_id,omitempty"`
Success bool `protobuf:"varint,2,opt,name=success,proto3" json:"success,omitempty"`
// Результат кожної команди — саме тут видно, на якій усе стало.
Outcomes []*CommandOutcome `protobuf:"bytes,3,rep,name=outcomes,proto3" json:"outcomes,omitempty"`
Committed bool `protobuf:"varint,4,opt,name=committed,proto3" json:"committed,omitempty"`
Transcript string `protobuf:"bytes,5,opt,name=transcript,proto3" json:"transcript,omitempty"`
Error *Error `protobuf:"bytes,6,opt,name=error,proto3" json:"error,omitempty"`
Duration *durationpb.Duration `protobuf:"bytes,7,opt,name=duration,proto3" json:"duration,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ConfigApplyResult) Reset() {
*x = ConfigApplyResult{}
mi := &file_netpulse_v1_ncm_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ConfigApplyResult) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ConfigApplyResult) ProtoMessage() {}
func (x *ConfigApplyResult) ProtoReflect() protoreflect.Message {
mi := &file_netpulse_v1_ncm_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 ConfigApplyResult.ProtoReflect.Descriptor instead.
func (*ConfigApplyResult) Descriptor() ([]byte, []int) {
return file_netpulse_v1_ncm_proto_rawDescGZIP(), []int{7}
}
func (x *ConfigApplyResult) GetRollbackId() string {
if x != nil {
return x.RollbackId
}
return ""
}
func (x *ConfigApplyResult) GetSuccess() bool {
if x != nil {
return x.Success
}
return false
}
func (x *ConfigApplyResult) GetOutcomes() []*CommandOutcome {
if x != nil {
return x.Outcomes
}
return nil
}
func (x *ConfigApplyResult) GetCommitted() bool {
if x != nil {
return x.Committed
}
return false
}
func (x *ConfigApplyResult) GetTranscript() string {
if x != nil {
return x.Transcript
}
return ""
}
func (x *ConfigApplyResult) GetError() *Error {
if x != nil {
return x.Error
}
return nil
}
func (x *ConfigApplyResult) GetDuration() *durationpb.Duration {
if x != nil {
return x.Duration
}
return nil
}
type CommandOutcome struct {
state protoimpl.MessageState `protogen:"open.v1"`
Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
Command string `protobuf:"bytes,2,opt,name=command,proto3" json:"command,omitempty"`
Output string `protobuf:"bytes,3,opt,name=output,proto3" json:"output,omitempty"`
Success bool `protobuf:"varint,4,opt,name=success,proto3" json:"success,omitempty"`
ErrorLine string `protobuf:"bytes,5,opt,name=error_line,json=errorLine,proto3" json:"error_line,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CommandOutcome) Reset() {
*x = CommandOutcome{}
mi := &file_netpulse_v1_ncm_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CommandOutcome) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CommandOutcome) ProtoMessage() {}
func (x *CommandOutcome) ProtoReflect() protoreflect.Message {
mi := &file_netpulse_v1_ncm_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 CommandOutcome.ProtoReflect.Descriptor instead.
func (*CommandOutcome) Descriptor() ([]byte, []int) {
return file_netpulse_v1_ncm_proto_rawDescGZIP(), []int{8}
}
func (x *CommandOutcome) GetIndex() uint32 {
if x != nil {
return x.Index
}
return 0
}
func (x *CommandOutcome) GetCommand() string {
if x != nil {
return x.Command
}
return ""
}
func (x *CommandOutcome) GetOutput() string {
if x != nil {
return x.Output
}
return ""
}
func (x *CommandOutcome) GetSuccess() bool {
if x != nil {
return x.Success
}
return false
}
func (x *CommandOutcome) GetErrorLine() string {
if x != nil {
return x.ErrorLine
}
return ""
}
var File_netpulse_v1_ncm_proto protoreflect.FileDescriptor
const file_netpulse_v1_ncm_proto_rawDesc = "" +
"\n" +
"\x15netpulse/v1/ncm.proto\x12\vnetpulse.v1\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x18netpulse/v1/common.proto\"\x92\x04\n" +
"\tConfigJob\x12\x15\n" +
"\x06job_id\x18\x01 \x01(\tR\x05jobId\x121\n" +
"\x06device\x18\x02 \x01(\v2\x19.netpulse.v1.DeviceTargetR\x06device\x127\n" +
"\n" +
"credential\x18\x03 \x01(\v2\x17.netpulse.v1.CredentialR\n" +
"credential\x124\n" +
"\ttransport\x18\x04 \x01(\x0e2\x16.netpulse.v1.TransportR\ttransport\x12\x12\n" +
"\x04port\x18\x05 \x01(\rR\x04port\x12\x1a\n" +
"\bcommands\x18\x06 \x03(\tR\bcommands\x12!\n" +
"\fprompt_regex\x18\a \x01(\tR\vpromptRegex\x12'\n" +
"\x0fenable_required\x18\b \x01(\bR\x0eenableRequired\x12.\n" +
"\x13enable_prompt_regex\x18\t \x01(\tR\x11enablePromptRegex\x12\x1f\n" +
"\vconfig_type\x18\n" +
" \x01(\tR\n" +
"configType\x123\n" +
"\atimeout\x18\v \x01(\v2\x19.google.protobuf.DurationR\atimeout\x12\x1b\n" +
"\tmax_bytes\x18\f \x01(\x04R\bmaxBytes\x12-\n" +
"\x12capture_transcript\x18\r \x01(\bR\x11captureTranscript\"\xb5\x01\n" +
"\fConfigUpload\x123\n" +
"\x06header\x18\x01 \x01(\v2\x19.netpulse.v1.ConfigHeaderH\x00R\x06header\x120\n" +
"\x05chunk\x18\x02 \x01(\v2\x18.netpulse.v1.ConfigChunkH\x00R\x05chunk\x126\n" +
"\atrailer\x18\x03 \x01(\v2\x1a.netpulse.v1.ConfigTrailerH\x00R\atrailerB\x06\n" +
"\x04part\"\xd9\x01\n" +
"\fConfigHeader\x12\x15\n" +
"\x06job_id\x18\x01 \x01(\tR\x05jobId\x12\x19\n" +
"\bagent_id\x18\x02 \x01(\tR\aagentId\x12\x1b\n" +
"\tdevice_id\x18\x03 \x01(\tR\bdeviceId\x12\x1f\n" +
"\vconfig_type\x18\x04 \x01(\tR\n" +
"configType\x12=\n" +
"\fcollected_at\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\vcollectedAt\x12\x1a\n" +
"\bencoding\x18\x06 \x01(\tR\bencoding\"=\n" +
"\vConfigChunk\x12\x1a\n" +
"\bsequence\x18\x01 \x01(\rR\bsequence\x12\x12\n" +
"\x04data\x18\x02 \x01(\fR\x04data\"\xb0\x02\n" +
"\rConfigTrailer\x12\x18\n" +
"\asuccess\x18\x01 \x01(\bR\asuccess\x12(\n" +
"\x05error\x18\x02 \x01(\v2\x12.netpulse.v1.ErrorR\x05error\x12%\n" +
"\x0econtent_sha256\x18\x03 \x01(\fR\rcontentSha256\x12\x1d\n" +
"\n" +
"size_bytes\x18\x04 \x01(\x04R\tsizeBytes\x12\x1d\n" +
"\n" +
"line_count\x18\x05 \x01(\rR\tlineCount\x12\x1f\n" +
"\vchunk_count\x18\x06 \x01(\rR\n" +
"chunkCount\x125\n" +
"\bduration\x18\a \x01(\v2\x19.google.protobuf.DurationR\bduration\x12\x1e\n" +
"\n" +
"transcript\x18\b \x01(\tR\n" +
"transcript\"\xc6\x01\n" +
"\rConfigReceipt\x12\x15\n" +
"\x06job_id\x18\x01 \x01(\tR\x05jobId\x12\x1a\n" +
"\baccepted\x18\x02 \x01(\bR\baccepted\x12\x1c\n" +
"\tunchanged\x18\x03 \x01(\bR\tunchanged\x12\x1d\n" +
"\n" +
"commit_sha\x18\x04 \x01(\tR\tcommitSha\x12\x1b\n" +
"\tconfig_id\x18\x05 \x01(\tR\bconfigId\x12(\n" +
"\x05error\x18\x06 \x01(\v2\x12.netpulse.v1.ErrorR\x05error\"\x87\x04\n" +
"\x0eConfigApplyJob\x12\x1f\n" +
"\vrollback_id\x18\x01 \x01(\tR\n" +
"rollbackId\x121\n" +
"\x06device\x18\x02 \x01(\v2\x19.netpulse.v1.DeviceTargetR\x06device\x127\n" +
"\n" +
"credential\x18\x03 \x01(\v2\x17.netpulse.v1.CredentialR\n" +
"credential\x124\n" +
"\ttransport\x18\x04 \x01(\x0e2\x16.netpulse.v1.TransportR\ttransport\x12\x1a\n" +
"\bcommands\x18\x05 \x03(\tR\bcommands\x12!\n" +
"\fprompt_regex\x18\x06 \x01(\tR\vpromptRegex\x12'\n" +
"\x0fenable_required\x18\a \x01(\bR\x0eenableRequired\x12%\n" +
"\x0ecommit_command\x18\b \x01(\tR\rcommitCommand\x12B\n" +
"\x0fconfirm_timeout\x18\t \x01(\v2\x19.google.protobuf.DurationR\x0econfirmTimeout\x12*\n" +
"\x11continue_on_error\x18\n" +
" \x01(\bR\x0fcontinueOnError\x123\n" +
"\atimeout\x18\v \x01(\v2\x19.google.protobuf.DurationR\atimeout\"\xa6\x02\n" +
"\x11ConfigApplyResult\x12\x1f\n" +
"\vrollback_id\x18\x01 \x01(\tR\n" +
"rollbackId\x12\x18\n" +
"\asuccess\x18\x02 \x01(\bR\asuccess\x127\n" +
"\boutcomes\x18\x03 \x03(\v2\x1b.netpulse.v1.CommandOutcomeR\boutcomes\x12\x1c\n" +
"\tcommitted\x18\x04 \x01(\bR\tcommitted\x12\x1e\n" +
"\n" +
"transcript\x18\x05 \x01(\tR\n" +
"transcript\x12(\n" +
"\x05error\x18\x06 \x01(\v2\x12.netpulse.v1.ErrorR\x05error\x125\n" +
"\bduration\x18\a \x01(\v2\x19.google.protobuf.DurationR\bduration\"\x91\x01\n" +
"\x0eCommandOutcome\x12\x14\n" +
"\x05index\x18\x01 \x01(\rR\x05index\x12\x18\n" +
"\acommand\x18\x02 \x01(\tR\acommand\x12\x16\n" +
"\x06output\x18\x03 \x01(\tR\x06output\x12\x18\n" +
"\asuccess\x18\x04 \x01(\bR\asuccess\x12\x1d\n" +
"\n" +
"error_line\x18\x05 \x01(\tR\terrorLineB\xa4\x01\n" +
"\x0fcom.netpulse.v1B\bNcmProtoP\x01Z:github.com/netpulse/netpulse/gen/go/netpulse/v1;netpulsev1\xa2\x02\x03NXX\xaa\x02\vNetpulse.V1\xca\x02\vNetpulse\\V1\xe2\x02\x17Netpulse\\V1\\GPBMetadata\xea\x02\fNetpulse::V1b\x06proto3"
var (
file_netpulse_v1_ncm_proto_rawDescOnce sync.Once
file_netpulse_v1_ncm_proto_rawDescData []byte
)
func file_netpulse_v1_ncm_proto_rawDescGZIP() []byte {
file_netpulse_v1_ncm_proto_rawDescOnce.Do(func() {
file_netpulse_v1_ncm_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_netpulse_v1_ncm_proto_rawDesc), len(file_netpulse_v1_ncm_proto_rawDesc)))
})
return file_netpulse_v1_ncm_proto_rawDescData
}
var file_netpulse_v1_ncm_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
var file_netpulse_v1_ncm_proto_goTypes = []any{
(*ConfigJob)(nil), // 0: netpulse.v1.ConfigJob
(*ConfigUpload)(nil), // 1: netpulse.v1.ConfigUpload
(*ConfigHeader)(nil), // 2: netpulse.v1.ConfigHeader
(*ConfigChunk)(nil), // 3: netpulse.v1.ConfigChunk
(*ConfigTrailer)(nil), // 4: netpulse.v1.ConfigTrailer
(*ConfigReceipt)(nil), // 5: netpulse.v1.ConfigReceipt
(*ConfigApplyJob)(nil), // 6: netpulse.v1.ConfigApplyJob
(*ConfigApplyResult)(nil), // 7: netpulse.v1.ConfigApplyResult
(*CommandOutcome)(nil), // 8: netpulse.v1.CommandOutcome
(*DeviceTarget)(nil), // 9: netpulse.v1.DeviceTarget
(*Credential)(nil), // 10: netpulse.v1.Credential
(Transport)(0), // 11: netpulse.v1.Transport
(*durationpb.Duration)(nil), // 12: google.protobuf.Duration
(*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp
(*Error)(nil), // 14: netpulse.v1.Error
}
var file_netpulse_v1_ncm_proto_depIdxs = []int32{
9, // 0: netpulse.v1.ConfigJob.device:type_name -> netpulse.v1.DeviceTarget
10, // 1: netpulse.v1.ConfigJob.credential:type_name -> netpulse.v1.Credential
11, // 2: netpulse.v1.ConfigJob.transport:type_name -> netpulse.v1.Transport
12, // 3: netpulse.v1.ConfigJob.timeout:type_name -> google.protobuf.Duration
2, // 4: netpulse.v1.ConfigUpload.header:type_name -> netpulse.v1.ConfigHeader
3, // 5: netpulse.v1.ConfigUpload.chunk:type_name -> netpulse.v1.ConfigChunk
4, // 6: netpulse.v1.ConfigUpload.trailer:type_name -> netpulse.v1.ConfigTrailer
13, // 7: netpulse.v1.ConfigHeader.collected_at:type_name -> google.protobuf.Timestamp
14, // 8: netpulse.v1.ConfigTrailer.error:type_name -> netpulse.v1.Error
12, // 9: netpulse.v1.ConfigTrailer.duration:type_name -> google.protobuf.Duration
14, // 10: netpulse.v1.ConfigReceipt.error:type_name -> netpulse.v1.Error
9, // 11: netpulse.v1.ConfigApplyJob.device:type_name -> netpulse.v1.DeviceTarget
10, // 12: netpulse.v1.ConfigApplyJob.credential:type_name -> netpulse.v1.Credential
11, // 13: netpulse.v1.ConfigApplyJob.transport:type_name -> netpulse.v1.Transport
12, // 14: netpulse.v1.ConfigApplyJob.confirm_timeout:type_name -> google.protobuf.Duration
12, // 15: netpulse.v1.ConfigApplyJob.timeout:type_name -> google.protobuf.Duration
8, // 16: netpulse.v1.ConfigApplyResult.outcomes:type_name -> netpulse.v1.CommandOutcome
14, // 17: netpulse.v1.ConfigApplyResult.error:type_name -> netpulse.v1.Error
12, // 18: netpulse.v1.ConfigApplyResult.duration:type_name -> google.protobuf.Duration
19, // [19:19] is the sub-list for method output_type
19, // [19:19] is the sub-list for method input_type
19, // [19:19] is the sub-list for extension type_name
19, // [19:19] is the sub-list for extension extendee
0, // [0:19] is the sub-list for field type_name
}
func init() { file_netpulse_v1_ncm_proto_init() }
func file_netpulse_v1_ncm_proto_init() {
if File_netpulse_v1_ncm_proto != nil {
return
}
file_netpulse_v1_common_proto_init()
file_netpulse_v1_ncm_proto_msgTypes[1].OneofWrappers = []any{
(*ConfigUpload_Header)(nil),
(*ConfigUpload_Chunk)(nil),
(*ConfigUpload_Trailer)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_netpulse_v1_ncm_proto_rawDesc), len(file_netpulse_v1_ncm_proto_rawDesc)),
NumEnums: 0,
NumMessages: 9,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_netpulse_v1_ncm_proto_goTypes,
DependencyIndexes: file_netpulse_v1_ncm_proto_depIdxs,
MessageInfos: file_netpulse_v1_ncm_proto_msgTypes,
}.Build()
File_netpulse_v1_ncm_proto = out.File
file_netpulse_v1_ncm_proto_goTypes = nil
file_netpulse_v1_ncm_proto_depIdxs = nil
}