acctz

package
v1.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 11 Imported by: 4

README

gNSI Accounting Protocol

Objective

This proto definition serves to describe a method of transfering accounting records from a System, which may be a network device, to a remote collection service, primarily over a gRPC transport connection.

Method of Operation

Accounting Records are available at a gNSI origin: gnsi.accounting

Records may be streamed from a system either at request of the remote collector, via the AccountingPull() service/rpc, or at the request of the system to a remote collector, via the AccountingPush() service/rpc.

Configuration of the Accounting service is made through standard gNxI methods using the defined YANG model.

Records will be streamed to the receiver as individual Record messages as they are defined in the gnsi.accounting protocol buffer definition.

Each Record() message contains a timestamp element, this represents the time at which the accounted event occured, local to the system which sends the message. This could be different from the time received at the distant end, and the time the Record was emitted from the system.

Each stream method requires that acknowledgements be sent periodically in order to signal both which messages have been successfully processed and that the remote collector has not lost state relative to the connection.

Devices should maintain a history of accounting records so that they can be retrieved periodically by newly and already connected Collectors. The depth of this history should be configurable by the administrator. The default depth and configurability are subject to implementation support, but should be documented.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AuthDetail_AuthenStatus_name = map[int32]string{
		0: "AUTHEN_STATUS_UNSPECIFIED",
		1: "AUTHEN_STATUS_PERMIT",
		2: "AUTHEN_STATUS_DENY",
	}
	AuthDetail_AuthenStatus_value = map[string]int32{
		"AUTHEN_STATUS_UNSPECIFIED": 0,
		"AUTHEN_STATUS_PERMIT":      1,
		"AUTHEN_STATUS_DENY":        2,
	}
)

Enum value maps for AuthDetail_AuthenStatus.

View Source
var (
	CommandService_CmdServiceType_name = map[int32]string{
		0: "CMD_SERVICE_TYPE_UNSPECIFIED",
		1: "CMD_SERVICE_TYPE_SHELL",
		2: "CMD_SERVICE_TYPE_CLI",
		3: "CMD_SERVICE_TYPE_HTTP",
		4: "CMD_SERVICE_TYPE_RESTCONF",
		5: "CMD_SERVICE_TYPE_NETCONF",
	}
	CommandService_CmdServiceType_value = map[string]int32{
		"CMD_SERVICE_TYPE_UNSPECIFIED": 0,
		"CMD_SERVICE_TYPE_SHELL":       1,
		"CMD_SERVICE_TYPE_CLI":         2,
		"CMD_SERVICE_TYPE_HTTP":        3,
		"CMD_SERVICE_TYPE_RESTCONF":    4,
		"CMD_SERVICE_TYPE_NETCONF":     5,
	}
)

Enum value maps for CommandService_CmdServiceType.

View Source
var (
	GrpcService_GrpcServiceType_name = map[int32]string{
		0: "GRPC_SERVICE_TYPE_UNSPECIFIED",
		1: "GRPC_SERVICE_TYPE_GNMI",
		2: "GRPC_SERVICE_TYPE_GNOI",
		3: "GRPC_SERVICE_TYPE_GNSI",
		4: "GRPC_SERVICE_TYPE_GRIBI",
		5: "GRPC_SERVICE_TYPE_P4RT",
	}
	GrpcService_GrpcServiceType_value = map[string]int32{
		"GRPC_SERVICE_TYPE_UNSPECIFIED": 0,
		"GRPC_SERVICE_TYPE_GNMI":        1,
		"GRPC_SERVICE_TYPE_GNOI":        2,
		"GRPC_SERVICE_TYPE_GNSI":        3,
		"GRPC_SERVICE_TYPE_GRIBI":       4,
		"GRPC_SERVICE_TYPE_P4RT":        5,
	}
)

Enum value maps for GrpcService_GrpcServiceType.

View Source
var Acctz_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "gnsi.acctz.v1.Acctz",
	HandlerType: (*AcctzServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "RecordSubscribe",
			Handler:       _Acctz_RecordSubscribe_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "github.com/openconfig/gnsi/acctz/acctz.proto",
}

Acctz_ServiceDesc is the grpc.ServiceDesc for Acctz service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_github_com_openconfig_gnsi_acctz_acctz_proto protoreflect.FileDescriptor

Functions

func RegisterAcctzServer

func RegisterAcctzServer(s grpc.ServiceRegistrar, srv AcctzServer)

Types

type AcctzClient

type AcctzClient interface {
	RecordSubscribe(ctx context.Context, opts ...grpc.CallOption) (Acctz_RecordSubscribeClient, error)
}

AcctzClient is the client API for Acctz 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.

func NewAcctzClient

func NewAcctzClient(cc grpc.ClientConnInterface) AcctzClient

type AcctzServer

type AcctzServer interface {
	RecordSubscribe(Acctz_RecordSubscribeServer) error
	// contains filtered or unexported methods
}

AcctzServer is the server API for Acctz service. All implementations must embed UnimplementedAcctzServer for forward compatibility

type Acctz_RecordSubscribeClient

type Acctz_RecordSubscribeClient interface {
	Send(*RecordRequest) error
	Recv() (*RecordResponse, error)
	grpc.ClientStream
}

type Acctz_RecordSubscribeServer

type Acctz_RecordSubscribeServer interface {
	Send(*RecordResponse) error
	Recv() (*RecordRequest, error)
	grpc.ServerStream
}

type AuthDetail

type AuthDetail struct {
	Identity       string                  `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"`
	PrivilegeLevel uint32                  `protobuf:"varint,2,opt,name=privilege_level,json=privilegeLevel,proto3" json:"privilege_level,omitempty"`
	Status         AuthDetail_AuthenStatus `protobuf:"varint,3,opt,name=status,proto3,enum=gnsi.acctz.v1.AuthDetail_AuthenStatus" json:"status,omitempty"`
	DenyCause      string                  `protobuf:"bytes,4,opt,name=deny_cause,json=denyCause,proto3" json:"deny_cause,omitempty"`
	// contains filtered or unexported fields
}

func (*AuthDetail) Descriptor deprecated

func (*AuthDetail) Descriptor() ([]byte, []int)

Deprecated: Use AuthDetail.ProtoReflect.Descriptor instead.

func (*AuthDetail) GetDenyCause

func (x *AuthDetail) GetDenyCause() string

func (*AuthDetail) GetIdentity

func (x *AuthDetail) GetIdentity() string

func (*AuthDetail) GetPrivilegeLevel

func (x *AuthDetail) GetPrivilegeLevel() uint32

func (*AuthDetail) GetStatus

func (x *AuthDetail) GetStatus() AuthDetail_AuthenStatus

func (*AuthDetail) ProtoMessage

func (*AuthDetail) ProtoMessage()

func (*AuthDetail) ProtoReflect

func (x *AuthDetail) ProtoReflect() protoreflect.Message

func (*AuthDetail) Reset

func (x *AuthDetail) Reset()

func (*AuthDetail) String

func (x *AuthDetail) String() string

type AuthDetail_AuthenStatus

type AuthDetail_AuthenStatus int32
const (
	AuthDetail_AUTHEN_STATUS_UNSPECIFIED AuthDetail_AuthenStatus = 0
	AuthDetail_AUTHEN_STATUS_PERMIT      AuthDetail_AuthenStatus = 1
	AuthDetail_AUTHEN_STATUS_DENY        AuthDetail_AuthenStatus = 2
)

func (AuthDetail_AuthenStatus) Descriptor

func (AuthDetail_AuthenStatus) Enum

func (AuthDetail_AuthenStatus) EnumDescriptor deprecated

func (AuthDetail_AuthenStatus) EnumDescriptor() ([]byte, []int)

Deprecated: Use AuthDetail_AuthenStatus.Descriptor instead.

func (AuthDetail_AuthenStatus) Number

func (AuthDetail_AuthenStatus) String

func (x AuthDetail_AuthenStatus) String() string

func (AuthDetail_AuthenStatus) Type

type CommandService

type CommandService struct {
	ServiceType        CommandService_CmdServiceType `` /* 144-byte string literal not displayed */
	Cmd                string                        `protobuf:"bytes,2,opt,name=cmd,proto3" json:"cmd,omitempty"`
	CmdIstruncated     bool                          `protobuf:"varint,4,opt,name=cmd_istruncated,json=cmdIstruncated,proto3" json:"cmd_istruncated,omitempty"`
	CmdArgs            []string                      `protobuf:"bytes,3,rep,name=cmd_args,json=cmdArgs,proto3" json:"cmd_args,omitempty"`
	CmdArgsIstruncated bool                          `protobuf:"varint,5,opt,name=cmd_args_istruncated,json=cmdArgsIstruncated,proto3" json:"cmd_args_istruncated,omitempty"`
	// contains filtered or unexported fields
}

func (*CommandService) Descriptor deprecated

func (*CommandService) Descriptor() ([]byte, []int)

Deprecated: Use CommandService.ProtoReflect.Descriptor instead.

func (*CommandService) GetCmd

func (x *CommandService) GetCmd() string

func (*CommandService) GetCmdArgs

func (x *CommandService) GetCmdArgs() []string

func (*CommandService) GetCmdArgsIstruncated

func (x *CommandService) GetCmdArgsIstruncated() bool

func (*CommandService) GetCmdIstruncated

func (x *CommandService) GetCmdIstruncated() bool

func (*CommandService) GetServiceType

func (x *CommandService) GetServiceType() CommandService_CmdServiceType

func (*CommandService) ProtoMessage

func (*CommandService) ProtoMessage()

func (*CommandService) ProtoReflect

func (x *CommandService) ProtoReflect() protoreflect.Message

func (*CommandService) Reset

func (x *CommandService) Reset()

func (*CommandService) String

func (x *CommandService) String() string

type CommandService_CmdServiceType

type CommandService_CmdServiceType int32
const (
	CommandService_CMD_SERVICE_TYPE_UNSPECIFIED CommandService_CmdServiceType = 0
	CommandService_CMD_SERVICE_TYPE_SHELL       CommandService_CmdServiceType = 1
	CommandService_CMD_SERVICE_TYPE_CLI         CommandService_CmdServiceType = 2
	CommandService_CMD_SERVICE_TYPE_HTTP        CommandService_CmdServiceType = 3
	CommandService_CMD_SERVICE_TYPE_RESTCONF    CommandService_CmdServiceType = 4
	CommandService_CMD_SERVICE_TYPE_NETCONF     CommandService_CmdServiceType = 5
)

func (CommandService_CmdServiceType) Descriptor

func (CommandService_CmdServiceType) Enum

func (CommandService_CmdServiceType) EnumDescriptor deprecated

func (CommandService_CmdServiceType) EnumDescriptor() ([]byte, []int)

Deprecated: Use CommandService_CmdServiceType.Descriptor instead.

func (CommandService_CmdServiceType) Number

func (CommandService_CmdServiceType) String

func (CommandService_CmdServiceType) Type

type GrpcService

type GrpcService struct {
	ServiceType        GrpcService_GrpcServiceType `` /* 142-byte string literal not displayed */
	RpcName            string                      `protobuf:"bytes,2,opt,name=rpc_name,json=rpcName,proto3" json:"rpc_name,omitempty"`
	Payloads           []*anypb.Any                `protobuf:"bytes,3,rep,name=payloads,proto3" json:"payloads,omitempty"`
	PayloadIstruncated bool                        `protobuf:"varint,5,opt,name=payload_istruncated,json=payloadIstruncated,proto3" json:"payload_istruncated,omitempty"`
	// contains filtered or unexported fields
}

func (*GrpcService) Descriptor deprecated

func (*GrpcService) Descriptor() ([]byte, []int)

Deprecated: Use GrpcService.ProtoReflect.Descriptor instead.

func (*GrpcService) GetPayloadIstruncated

func (x *GrpcService) GetPayloadIstruncated() bool

func (*GrpcService) GetPayloads

func (x *GrpcService) GetPayloads() []*anypb.Any

func (*GrpcService) GetRpcName

func (x *GrpcService) GetRpcName() string

func (*GrpcService) GetServiceType

func (x *GrpcService) GetServiceType() GrpcService_GrpcServiceType

func (*GrpcService) ProtoMessage

func (*GrpcService) ProtoMessage()

func (*GrpcService) ProtoReflect

func (x *GrpcService) ProtoReflect() protoreflect.Message

func (*GrpcService) Reset

func (x *GrpcService) Reset()

func (*GrpcService) String

func (x *GrpcService) String() string

type GrpcService_GrpcServiceType

type GrpcService_GrpcServiceType int32
const (
	GrpcService_GRPC_SERVICE_TYPE_UNSPECIFIED GrpcService_GrpcServiceType = 0
	GrpcService_GRPC_SERVICE_TYPE_GNMI        GrpcService_GrpcServiceType = 1
	GrpcService_GRPC_SERVICE_TYPE_GNOI        GrpcService_GrpcServiceType = 2
	GrpcService_GRPC_SERVICE_TYPE_GNSI        GrpcService_GrpcServiceType = 3
	GrpcService_GRPC_SERVICE_TYPE_GRIBI       GrpcService_GrpcServiceType = 4
	GrpcService_GRPC_SERVICE_TYPE_P4RT        GrpcService_GrpcServiceType = 5
)

func (GrpcService_GrpcServiceType) Descriptor

func (GrpcService_GrpcServiceType) Enum

func (GrpcService_GrpcServiceType) EnumDescriptor deprecated

func (GrpcService_GrpcServiceType) EnumDescriptor() ([]byte, []int)

Deprecated: Use GrpcService_GrpcServiceType.Descriptor instead.

func (GrpcService_GrpcServiceType) Number

func (GrpcService_GrpcServiceType) String

func (GrpcService_GrpcServiceType) Type

type RecordRequest

type RecordRequest struct {
	Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// contains filtered or unexported fields
}

func (*RecordRequest) Descriptor deprecated

func (*RecordRequest) Descriptor() ([]byte, []int)

Deprecated: Use RecordRequest.ProtoReflect.Descriptor instead.

func (*RecordRequest) GetTimestamp

func (x *RecordRequest) GetTimestamp() *timestamppb.Timestamp

func (*RecordRequest) ProtoMessage

func (*RecordRequest) ProtoMessage()

func (*RecordRequest) ProtoReflect

func (x *RecordRequest) ProtoReflect() protoreflect.Message

func (*RecordRequest) Reset

func (x *RecordRequest) Reset()

func (*RecordRequest) String

func (x *RecordRequest) String() string

type RecordResponse

type RecordResponse struct {
	SessionInfo        *SessionInfo           `protobuf:"bytes,1,opt,name=session_info,json=sessionInfo,proto3" json:"session_info,omitempty"`
	Timestamp          *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	HistoryIstruncated bool                   `protobuf:"varint,3,opt,name=history_istruncated,json=historyIstruncated,proto3" json:"history_istruncated,omitempty"`
	// Types that are assignable to ServiceRequest:
	//	*RecordResponse_CmdService
	//	*RecordResponse_GrpcService
	ServiceRequest isRecordResponse_ServiceRequest `protobuf_oneof:"service_request"`
	Authen         *AuthDetail                     `protobuf:"bytes,7,opt,name=authen,proto3" json:"authen,omitempty"`
	TaskIds        []string                        `protobuf:"bytes,32,rep,name=task_ids,json=taskIds,proto3" json:"task_ids,omitempty"`
	// contains filtered or unexported fields
}

func (*RecordResponse) Descriptor deprecated

func (*RecordResponse) Descriptor() ([]byte, []int)

Deprecated: Use RecordResponse.ProtoReflect.Descriptor instead.

func (*RecordResponse) GetAuthen

func (x *RecordResponse) GetAuthen() *AuthDetail

func (*RecordResponse) GetCmdService

func (x *RecordResponse) GetCmdService() *CommandService

func (*RecordResponse) GetGrpcService

func (x *RecordResponse) GetGrpcService() *GrpcService

func (*RecordResponse) GetHistoryIstruncated

func (x *RecordResponse) GetHistoryIstruncated() bool

func (*RecordResponse) GetServiceRequest

func (m *RecordResponse) GetServiceRequest() isRecordResponse_ServiceRequest

func (*RecordResponse) GetSessionInfo

func (x *RecordResponse) GetSessionInfo() *SessionInfo

func (*RecordResponse) GetTaskIds

func (x *RecordResponse) GetTaskIds() []string

func (*RecordResponse) GetTimestamp

func (x *RecordResponse) GetTimestamp() *timestamppb.Timestamp

func (*RecordResponse) ProtoMessage

func (*RecordResponse) ProtoMessage()

func (*RecordResponse) ProtoReflect

func (x *RecordResponse) ProtoReflect() protoreflect.Message

func (*RecordResponse) Reset

func (x *RecordResponse) Reset()

func (*RecordResponse) String

func (x *RecordResponse) String() string

type RecordResponse_CmdService

type RecordResponse_CmdService struct {
	CmdService *CommandService `protobuf:"bytes,4,opt,name=cmd_service,json=cmdService,proto3,oneof"`
}

type RecordResponse_GrpcService

type RecordResponse_GrpcService struct {
	GrpcService *GrpcService `protobuf:"bytes,5,opt,name=grpc_service,json=grpcService,proto3,oneof"`
}

type SessionInfo

type SessionInfo struct {
	LocalAddress  string `protobuf:"bytes,1,opt,name=local_address,json=localAddress,proto3" json:"local_address,omitempty"`
	LocalPort     uint32 `protobuf:"varint,2,opt,name=local_port,json=localPort,proto3" json:"local_port,omitempty"`
	RemoteAddress string `protobuf:"bytes,3,opt,name=remote_address,json=remoteAddress,proto3" json:"remote_address,omitempty"`
	RemotePort    uint32 `protobuf:"varint,4,opt,name=remote_port,json=remotePort,proto3" json:"remote_port,omitempty"`
	IpProto       uint32 `protobuf:"varint,5,opt,name=ip_proto,json=ipProto,proto3" json:"ip_proto,omitempty"`
	ChannelId     string `protobuf:"bytes,6,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"`
	// contains filtered or unexported fields
}

func (*SessionInfo) Descriptor deprecated

func (*SessionInfo) Descriptor() ([]byte, []int)

Deprecated: Use SessionInfo.ProtoReflect.Descriptor instead.

func (*SessionInfo) GetChannelId

func (x *SessionInfo) GetChannelId() string

func (*SessionInfo) GetIpProto

func (x *SessionInfo) GetIpProto() uint32

func (*SessionInfo) GetLocalAddress

func (x *SessionInfo) GetLocalAddress() string

func (*SessionInfo) GetLocalPort

func (x *SessionInfo) GetLocalPort() uint32

func (*SessionInfo) GetRemoteAddress

func (x *SessionInfo) GetRemoteAddress() string

func (*SessionInfo) GetRemotePort

func (x *SessionInfo) GetRemotePort() uint32

func (*SessionInfo) ProtoMessage

func (*SessionInfo) ProtoMessage()

func (*SessionInfo) ProtoReflect

func (x *SessionInfo) ProtoReflect() protoreflect.Message

func (*SessionInfo) Reset

func (x *SessionInfo) Reset()

func (*SessionInfo) String

func (x *SessionInfo) String() string

type UnimplementedAcctzServer

type UnimplementedAcctzServer struct {
}

UnimplementedAcctzServer must be embedded to have forward compatible implementations.

func (UnimplementedAcctzServer) RecordSubscribe

type UnsafeAcctzServer

type UnsafeAcctzServer interface {
	// contains filtered or unexported methods
}

UnsafeAcctzServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AcctzServer will result in compilation errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL