logupload

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Copyright 2025 Comcast Cable Communications Management, LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const (
	EstbIp            string = "estbIP"
	EstbMacAddress    string = "estbMacAddress"
	EcmMac            string = "ecmMacAddress"
	Env               string = "env"
	Model             string = "model"
	AccountMgmt       string = "accountMgmt"
	SerialNum         string = "serialNum"
	PartnerId         string = "partnerId"
	FirmwareVersion   string = "firmwareVersion"
	ControllerId      string = "controllerId"
	ChannelMapId      string = "channelMapId"
	VodId             string = "vodId"
	UploadImmediately string = "uploadImmediately"
	Timezone          string = "timezone"
	AccountHash       string = "accountHash"
	AccountId         string = "accountId"
	ConfigSetHash     string = "configSetHash"
)
View Source
const (
	EPON = iota + 1
	PARTNER_SETTINGS
)

Enum for SettingType

View Source
const (
	MODE_TO_GET_LOG_FILES_0 = "LogFiles"
	MODE_TO_GET_LOG_FILES_1 = "LogFilesGroup"
	MODE_TO_GET_LOG_FILES_2 = "AllLogFiles"
)
View Source
const (
	WHOLE_DAY_RANDOMIZED        = "Whole Day Randomized"
	UTC                  string = "UTC"
	LOCAL_TIME           string = "Local time"
)
View Source
const (
	DEFAULT_TIME_ZONE  = "US/Eastern"
	ONE_HOUR_SECONDS   = 3600
	DEFAULT_OFFSET_ROW = -5
)
View Source
const (
	DEFAULT_LOG_UPLOAD_SETTINGS_MESSAGE = "Don't upload your logs, but check for updates on this schedule."
)
View Source
const PermanentTelemetryProfileConst = "PermanentTelemetryProfile"

Variables

View Source
var SettingTypes = [...]string{"PARTNER_SETTINGS", "EPON", "partnersettings", "epon"}

Functions

func DeleteOneLogFileList

func DeleteOneLogFileList(id string) error

func DeletePermanentTelemetryProfile

func DeletePermanentTelemetryProfile(rowKey string)

func DeleteTelemetryTwoProfile

func DeleteTelemetryTwoProfile(rowKey string) error

func DeleteTelemetryTwoRule

func DeleteTelemetryTwoRule(rowKey string) error

func GetAllTelemetryTwoProfileList

func GetAllTelemetryTwoProfileList(appType string) []*logupload.TelemetryTwoProfile

func GetOnePermanentTelemetryProfile

func GetOnePermanentTelemetryProfile(rowKey string) *logupload.PermanentTelemetryProfile

func GetOneSettingProfile

func GetOneSettingProfile(id string) *logupload.SettingProfiles

func GetOneTelemetryRule

func GetOneTelemetryRule(id string) *logupload.TelemetryRule

func GetOneTelemetryTwoProfile

func GetOneTelemetryTwoProfile(rowKey string) *logupload.TelemetryTwoProfile

func GetOneTelemetryTwoRule

func GetOneTelemetryTwoRule(rowKey string) *logupload.TelemetryTwoRule

func GetPermanentTelemetryProfileList

func GetPermanentTelemetryProfileList() []*logupload.PermanentTelemetryProfile

func GetPermanentTelemetryProfileListByApplicationType

func GetPermanentTelemetryProfileListByApplicationType(applicationType string) []*logupload.PermanentTelemetryProfile

func GetTelemetryTwoProfileListByApplicationType

func GetTelemetryTwoProfileListByApplicationType(applicationType string) []*logupload.TelemetryTwoProfile

func GetTimestampedRulesPointer

func GetTimestampedRulesPointer() []*logupload.TimestampedRule

func IsValidSettingType

func IsValidSettingType(str string) bool

func IsValidUploadProtocol

func IsValidUploadProtocol(p string) bool

func IsValidUrl

func IsValidUrl(str string) bool

func NewDeviceSettingsInf

func NewDeviceSettingsInf() interface{}

NewDeviceSettingsInf constructor

func NewEmptyPermanentTelemetryProfile

func NewEmptyPermanentTelemetryProfile() *logupload.PermanentTelemetryProfile

func NewEmptyTelemetryTwoProfile

func NewEmptyTelemetryTwoProfile() *logupload.TelemetryTwoProfile

func NewLogFileInf

func NewLogFileInf() interface{}

NewLogFileInf constructor

func NewLogFileListInf

func NewLogFileListInf() interface{}

NewLogFileListInf constructor

func NewLogFilesGroupsInf

func NewLogFilesGroupsInf() interface{}

NewLogFilesGroupsInf constructor

func NewLogUploadSettingsInf

func NewLogUploadSettingsInf() interface{}

NewLogUploadSettingsInf constructor

func NewSettingProfilesInf

func NewSettingProfilesInf() interface{}

NewSettingProfilesInf constructor

func NewSettingRulesInf

func NewSettingRulesInf() interface{}

NewSettingRulesInf constructor

func NewUploadRepositoryInf

func NewUploadRepositoryInf() interface{}

NewUploadRepositoryInf constructor

func NewVodSettingsInf

func NewVodSettingsInf() interface{}

NewVodSettingsInf constructor

func SetLogFile

func SetLogFile(id string, logFile *LogFile) error

func SetOneLogFile

func SetOneLogFile(id string, obj *LogFile) error

func SetOneLogUploadSettings

func SetOneLogUploadSettings(id string, logUploadSettings *LogUploadSettings) error

func SetOnePermanentTelemetryProfile

func SetOnePermanentTelemetryProfile(rowKey string, profile *logupload.PermanentTelemetryProfile) error

func SetOneTelemetryProfile

func SetOneTelemetryProfile(rowKey string, telemetry *logupload.TelemetryProfile)

func SetOneTelemetryTwoProfile

func SetOneTelemetryTwoProfile(profile *logupload.TelemetryTwoProfile) error

func SetOneTelemetryTwoRule

func SetOneTelemetryTwoRule(rowKey string, telemetry *logupload.TelemetryTwoRule) error

func SettingTypeEnum

func SettingTypeEnum(s string) int

Types

type ConfigurationServiceURL

type ConfigurationServiceURL struct {
	ID          string `json:"id,omitempty"`
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	URL         string `json:"url,omitempty"`
}

type DeviceSettings

type DeviceSettings struct {
	ID                      string                   `json:"id"`
	Updated                 int64                    `json:"updated"`
	Name                    string                   `json:"name"`
	CheckOnReboot           bool                     `json:"checkOnReboot"`
	ConfigurationServiceURL *ConfigurationServiceURL `json:"configurationServiceURL,omitempty"`
	SettingsAreActive       bool                     `json:"settingsAreActive"`
	Schedule                Schedule                 `json:"schedule"`
	ApplicationType         string                   `json:"applicationType"`
}

DeviceSettings DeviceSettings2 table

func GetOneDeviceSettings

func GetOneDeviceSettings(id string) *DeviceSettings

func (*DeviceSettings) Clone

func (obj *DeviceSettings) Clone() (*DeviceSettings, error)

type FormulaWithSettings

type FormulaWithSettings struct {
	Formula           *common.DCMGenericRule `json:"formula"`
	DeviceSettings    *DeviceSettings        `json:"deviceSettings"`
	LogUpLoadSettings *LogUploadSettings     `json:"logUploadSettings"`
	VodSettings       *VodSettings           `json:"vodSettings"`
}

type LogFile

type LogFile struct {
	ID             string `json:"id"`
	Updated        int64  `json:"updated"`
	Name           string `json:"name"`
	DeleteOnUpload bool   `json:"deleteOnUpload"`
}

LogFile table

func GetLogFileList

func GetLogFileList(size int) []*LogFile

func (*LogFile) Clone

func (obj *LogFile) Clone() (*LogFile, error)

type LogFileList

type LogFileList struct {
	Updated int64      `json:"updated"`
	Data    []*LogFile `json:"data"`
}

LogFileList LogFileList table

func GetAllLogFileList

func GetAllLogFileList(size int) []*LogFileList

func GetOneLogFileList

func GetOneLogFileList(id string) (*LogFileList, error)

func (*LogFileList) Clone

func (obj *LogFileList) Clone() (*LogFileList, error)

type LogFilesGroups

type LogFilesGroups struct {
	ID         string   `json:"id"`
	Updated    int64    `json:"updated"`
	GroupName  string   `json:"groupName"`
	LogFileIDs []string `json:"logFileIds"`
}

LogFilesGroups table

func GetLogFileGroupsList

func GetLogFileGroupsList(size int) ([]*LogFilesGroups, error)

func (*LogFilesGroups) Clone

func (obj *LogFilesGroups) Clone() (*LogFilesGroups, error)

type LogUploadSettings

type LogUploadSettings struct {
	ID                  string   `json:"id"`
	Updated             int64    `json:"updated"`
	Name                string   `json:"name"`
	UploadOnReboot      bool     `json:"uploadOnReboot"`
	NumberOfDays        int      `json:"numberOfDays"`
	AreSettingsActive   bool     `json:"areSettingsActive"`
	Schedule            Schedule `json:"schedule"`
	LogFileIds          []string `json:"logFileIds"`
	LogFilesGroupID     string   `json:"logFilesGroupId"`
	ModeToGetLogFiles   string   `json:"modeToGetLogFiles"`
	UploadRepositoryID  string   `json:"uploadRepositoryId"`
	ActiveDateTimeRange bool     `json:"activeDateTimeRange"`
	FromDateTime        string   `json:"fromDateTime"`
	ToDateTime          string   `json:"toDateTime"`
	ApplicationType     string   `json:"applicationType"`
}

LogUploadSettings LogUploadSettings2 table

func GetAllLogUploadSettings

func GetAllLogUploadSettings(size int) ([]*LogUploadSettings, error)

func GetOneLogUploadSettings

func GetOneLogUploadSettings(id string) *LogUploadSettings

func (*LogUploadSettings) Clone

func (obj *LogUploadSettings) Clone() (*LogUploadSettings, error)

type Schedule

type Schedule struct {
	Type              string      `json:"type,omitempty"`
	Expression        string      `json:"expression,omitempty"`
	TimeZone          string      `json:"timeZone,omitempty"`
	ExpressionL1      string      `json:"expressionL1,omitempty"`
	ExpressionL2      string      `json:"expressionL2,omitempty"`
	ExpressionL3      string      `json:"expressionL3,omitempty"`
	StartDate         string      `json:"startDate,omitempty"`
	EndDate           string      `json:"endDate,omitempty"`
	TimeWindowMinutes json.Number `json:"timeWindowMinutes,omitempty"`
}

type SettingProfiles

type SettingProfiles struct {
	ID               string            `json:"id"`
	Updated          int64             `json:"updated"`
	SettingProfileID string            `json:"settingProfileId"`
	SettingType      string            `json:"settingType"`
	Properties       map[string]string `json:"properties"`
	ApplicationType  string            `json:"applicationType"`
}

SettingProfiles table

func (*SettingProfiles) Clone

func (obj *SettingProfiles) Clone() (*SettingProfiles, error)

type SettingRule

type SettingRule struct {
	ID              string  `json:"id"`
	Updated         int64   `json:"updated"`
	Name            string  `json:"name"`
	Rule            re.Rule `json:"rule"`
	BoundSettingID  string  `json:"boundSettingId"`
	ApplicationType string  `json:"applicationType"`
}

SettingRule SettingRules table

func GetAllSettingRuleList

func GetAllSettingRuleList() []*SettingRule

func (*SettingRule) Clone

func (obj *SettingRule) Clone() (*SettingRule, error)

func (*SettingRule) GetApplicationType

func (r *SettingRule) GetApplicationType() string

func (*SettingRule) GetId

func (r *SettingRule) GetId() string

GetId XRule interface

func (*SettingRule) GetName

func (r *SettingRule) GetName() string

GetName XRule interface

func (*SettingRule) GetRule

func (r *SettingRule) GetRule() *re.Rule

GetRule XRule interface

func (*SettingRule) GetRuleType

func (r *SettingRule) GetRuleType() string

GetRuleType XRule interface

func (*SettingRule) GetTemplateId

func (r *SettingRule) GetTemplateId() string

GetTemplateId XRule interface

type Settings

type Settings struct {
	//java: Set<String> ruleIDs
	RuleIDs                           map[string]string
	SchedulerType                     string
	GroupName                         string
	CheckOnReboot                     bool
	ConfigurationServiceURL           string
	ScheduleCron                      string
	ScheduleDurationMinutes           int
	ScheduleStartDate                 string
	ScheduleEndDate                   string
	LusMessage                        string
	LusName                           string
	LusNumberOfDay                    int
	LusUploadRepositoryName           string
	LusUploadRepositoryURLNew         string
	LusUploadRepositoryUploadProtocol string
	LusUploadRepositoryURL            string
	LusUploadOnReboot                 bool
	UploadImmediately                 bool
	//Upload flag to indicate if allowed to upload logs or not.
	Upload               bool
	LusLogFiles          []*LogFile
	LusLogFilesStartDate string
	LusLogFilesEndDate   string
	//For level one logging
	LusScheduleCron            string
	LusScheduleCronL1          string
	LusScheduleCronL2          string
	LusScheduleCronL3          string
	LusScheduleDurationMinutes int
	LusScheduleStartDate       string
	LusScheduleEndDate         string
	VodSettingsName            string
	LocationUrl                string
	TelemetryProfile           *logupload.PermanentTelemetryProfile
	SrmIPList                  map[string]string
	EponSettings               map[string]string
	PartnerSettings            map[string]string
}

func NewSettings

func NewSettings(logFileLenth int) *Settings

func (*Settings) AreFull

func (s *Settings) AreFull() bool

func (*Settings) CopyDeviceSettings

func (s *Settings) CopyDeviceSettings(settings *Settings)

func (*Settings) CopyLusSetting

func (s *Settings) CopyLusSetting(settings *Settings, setLUSSettings bool)

func (*Settings) CopyVodSettings

func (s *Settings) CopyVodSettings(settings *Settings)

func (*Settings) SetSettingProfiles

func (s *Settings) SetSettingProfiles(settingProfiles []SettingProfiles)

type SettingsResponse

type SettingsResponse struct {
	GroupName                         interface{}                          `json:"urn:settings:GroupName"`
	CheckOnReboot                     bool                                 `json:"urn:settings:CheckOnReboot"`
	ScheduleCron                      interface{}                          `json:"urn:settings:CheckSchedule:cron"`
	ScheduleDurationMinutes           int                                  `json:"urn:settings:CheckSchedule:DurationMinutes"`
	LusMessage                        interface{}                          `json:"urn:settings:LogUploadSettings:Message"`
	LusName                           interface{}                          `json:"urn:settings:LogUploadSettings:Name"`
	LusNumberOfDay                    int                                  `json:"urn:settings:LogUploadSettings:NumberOfDays"`
	LusUploadRepositoryName           interface{}                          `json:"urn:settings:LogUploadSettings:UploadRepositoryName"`
	LusUploadRepositoryURLNew         string                               `json:"urn:settings:LogUploadSettings:UploadRepository:URL,omitempty"`
	LusUploadRepositoryUploadProtocol string                               `json:"urn:settings:LogUploadSettings:UploadRepository:uploadProtocol,omitempty"`
	LusUploadRepositoryURL            string                               `json:"urn:settings:LogUploadSettings:RepositoryURL,omitempty"`
	LusUploadOnReboot                 bool                                 `json:"urn:settings:LogUploadSettings:UploadOnReboot"`
	UploadImmediately                 bool                                 `json:"urn:settings:LogUploadSettings:UploadImmediately"`
	Upload                            bool                                 `json:"urn:settings:LogUploadSettings:upload"`
	LusScheduleCron                   interface{}                          `json:"urn:settings:LogUploadSettings:UploadSchedule:cron"`
	LusScheduleCronL1                 interface{}                          `json:"urn:settings:LogUploadSettings:UploadSchedule:levelone:cron"`
	LusScheduleCronL2                 interface{}                          `json:"urn:settings:LogUploadSettings:UploadSchedule:leveltwo:cron"`
	LusScheduleCronL3                 interface{}                          `json:"urn:settings:LogUploadSettings:UploadSchedule:levelthree:cron"`
	LusScheduleDurationMinutes        int                                  `json:"urn:settings:LogUploadSettings:UploadSchedule:DurationMinutes"`
	VodSettingsName                   interface{}                          `json:"urn:settings:VODSettings:Name"`
	LocationUrl                       interface{}                          `json:"urn:settings:VODSettings:LocationsURL"`
	SrmIPList                         interface{}                          `json:"urn:settings:VODSettings:SRMIPList"`
	EponSettings                      map[string]string                    `json:"urn:settings:SettingType:epon,omitempty"`
	TelemetryProfile                  *logupload.PermanentTelemetryProfile `json:"urn:settings:TelemetryProfile,omitempty"`
	PartnerSettings                   map[string]string                    `json:"urn:settings:SettingType:partnersettings,omitempty"`
}

func CreateSettingsResponseObject

func CreateSettingsResponseObject(settings *Settings) *SettingsResponse

type UploadProtocol

type UploadProtocol string

UploadProtocol enum

const (
	TFTP  UploadProtocol = "TFTP"
	SFTP  UploadProtocol = "SFTP"
	SCP   UploadProtocol = "SCP"
	HTTP  UploadProtocol = "HTTP"
	HTTPS UploadProtocol = "HTTPS"
	S3    UploadProtocol = "S3"
)

type UploadRepository

type UploadRepository struct {
	ID              string `json:"id"`
	Updated         int64  `json:"updated"`
	Name            string `json:"name"`
	Description     string `json:"description"`
	URL             string `json:"url"`
	ApplicationType string `json:"applicationType"`
	Protocol        string `json:"protocol"`
}

UploadRepository table

func GetOneUploadRepository

func GetOneUploadRepository(id string) *UploadRepository

func (*UploadRepository) Clone

func (obj *UploadRepository) Clone() (*UploadRepository, error)

type VodSettings

type VodSettings struct {
	ID              string            `json:"id"`
	Updated         int64             `json:"updated"`
	Name            string            `json:"name"`
	LocationsURL    string            `json:"locationsURL"`
	IPNames         []string          `json:"ipNames"`
	IPList          []string          `json:"ipList"`
	SrmIPList       map[string]string `json:"srmIPList"`
	ApplicationType string            `json:"applicationType"`
}

VodSettings table

func GetOneVodSettings

func GetOneVodSettings(id string) *VodSettings

func (*VodSettings) Clone

func (obj *VodSettings) Clone() (*VodSettings, error)

Jump to

Keyboard shortcuts

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