dto

package
v1.0.0-alpha.6 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServerAddressFormatIPv4 = 3
	ServerAddressFormatIPv6 = 4
	ServerAddressFormatURL  = 201
)

Variables

View Source
var ValidateAMTPassOrGenRan validator.Func = func(fl validator.FieldLevel) bool {
	amtPass := fl.Parent().FieldByName("AMTPassword").String()

	return amtPass == ""
}
View Source
var ValidateAuthandIEEE validator.Func = func(fl validator.FieldLevel) bool {
	authMethod, _ := fl.Parent().FieldByName("AuthenticationMethod").Interface().(int)
	profName, _ := fl.Parent().FieldByName("IEEE8021xProfileName").Interface().(*string)
	if authMethod == 5 || authMethod == 7 {
		if profName == nil || *profName == "" {
			return false
		}
	}

	if authMethod == 4 || authMethod == 6 {
		if profName != nil && *profName != "" {
			return false
		}
	}

	return true
}
View Source
var ValidateCIRAOrTLS validator.Func = func(fl validator.FieldLevel) bool {
	ciraConfigField := fl.Parent().FieldByName("CIRAConfigName")
	tlsModeField := fl.Parent().FieldByName("TLSMode")

	ciraConfigName, _ := ciraConfigField.Interface().(*string)
	tlsMode, _ := tlsModeField.Interface().(int)

	if ciraConfigName != nil && *ciraConfigName != "" && tlsMode != 0 {
		return false
	}

	return true
}
View Source
var ValidateUserConsent validator.Func = func(fl validator.FieldLevel) bool {
	userConsent := strings.ToLower(fl.Field().String())
	activation := fl.Parent().FieldByName("Activation").String()
	if activation == "ccmactivate" && userConsent != "All" {
		return false
	}

	return userConsent == "none" || userConsent == "kvm" || userConsent == "all"
}

Functions

func AuthProtocolValidator

func AuthProtocolValidator(fl validator.FieldLevel) bool

Types

type AddAlarmOutput

type AddAlarmOutput struct {
	ReturnValue int // Return code. 0 indicates success
}

type AlarmClockOccurrence

type AlarmClockOccurrence struct {
	ElementName        string    `json:"elementName" binding:"required" example:"test"`
	InstanceID         string    `json:"instanceID" binding:"" example:"test"`
	StartTime          time.Time `json:"startTime" binding:"required" example:"2024-01-01T00:00:00Z"`
	Interval           int       `json:"interval" binding:"number" example:"1"`
	DeleteOnCompletion bool      `json:"deleteOnCompletion" binding:"required" example:"true"`
}

type AuditLog

type AuditLog struct {
	TotalCount int                       `json:"totalCnt" binding:"required" example:"0"`
	Records    []auditlog.AuditLogRecord `json:"records" binding:"required"`
}

type BootSetting

type BootSetting struct {
	Action int  `json:"action" binding:"required" example:"8"`
	UseSOL bool `json:"useSOL" binding:"omitempty,required" example:"true"`
}

type CIRAConfig

type CIRAConfig struct {
	ConfigName          string `json:"configName" example:"My CIRA Config"`
	MPSAddress          string `json:"mpsServerAddress" binding:"required,url|ipv4|ipv6" example:"https://example.com"`
	MPSPort             int    `json:"mpsPort" binding:"required,gt=1024,lt=49151" example:"4433"`
	Username            string `json:"username" binding:"required,alphanum" example:"my_username"`
	Password            string `json:"password,omitempty" example:"my_password"`
	CommonName          string `json:"commonName" binding:"required_if=ServerAddressFormat 3" example:"example.com"`
	ServerAddressFormat int    `json:"serverAddressFormat" binding:"required,oneof=3 4 201" example:"201"` // 3 = IPV4, 4= IPV6, 201 = FQDN
	AuthMethod          int    `json:"authMethod" binding:"required,oneof=1 2" example:"2"`                // 1 = Mutal Auth, 2 = Username and Password
	MPSRootCertificate  string `json:"mpsRootCertificate" binding:"required" example:"-----BEGIN CERTIFICATE-----\n..."`
	ProxyDetails        string `json:"proxyDetails" example:"http://example.com"`
	TenantID            string `json:"tenantId" example:"abc123"`
	RegeneratePassword  bool   `json:"regeneratePassword,omitempty" example:"true"`
	Version             string `json:"version,omitempty" example:"1.0.0"`
}

type CertCreationResult

type CertCreationResult struct {
	H             string `json:"h:"`
	Cert          string `json:"cert"`
	PEM           string `json:"pem"`
	CertBin       string `json:"certBin"`
	PrivateKey    string `json:"privateKey"`
	PrivateKeyBin string `json:"privateKeyBin"`
	Checked       bool   `json:"checked" example:"true"`
	Key           []byte `json:"key"`
}

type DeleteAlarmOccurrenceRequest

type DeleteAlarmOccurrenceRequest struct {
	InstanceID *string `json:"instanceID" binding:"" example:"test"`
}

type Device

type Device struct {
	ConnectionStatus bool        `json:"connectionStatus"`
	MPSInstance      string      `json:"mpsInstance"`
	Hostname         string      `json:"hostname"`
	GUID             string      `json:"guid"`
	MPSUsername      string      `json:"mpsusername"`
	Tags             []string    `json:"tags"`
	TenantID         string      `json:"tenantId"`
	FriendlyName     string      `json:"friendlyName"`
	DNSSuffix        string      `json:"dnsSuffix"`
	LastConnected    *time.Time  `json:"lastConnected,omitempty"`
	LastSeen         *time.Time  `json:"lastSeen,omitempty"`
	LastDisconnected *time.Time  `json:"lastDisconnected,omitempty"`
	DeviceInfo       *DeviceInfo `json:"deviceInfo,omitempty"`
	Username         string      `json:"username"`
	Password         string      `json:"password"`
	UseTLS           bool        `json:"useTLS"`
	AllowSelfSigned  bool        `json:"allowSelfSigned"`
}

type DeviceInfo

type DeviceInfo struct {
	FWVersion   string    `json:"fwVersion"`
	FWBuild     string    `json:"fwBuild"`
	FWSku       string    `json:"fwSku"`
	CurrentMode string    `json:"currentMode"`
	Features    string    `json:"features"`
	IPAddress   string    `json:"ipAddress"`
	LastUpdated time.Time `json:"lastUpdated"`
}

type Domain

type Domain struct {
	ProfileName                   string    `json:"profileName" binding:"required,alphanum" example:"My Profile"`
	DomainSuffix                  string    `json:"domainSuffix" binding:"required" example:"example.com"`
	ProvisioningCert              string    `json:"provisioningCert,omitempty" binding:"required" example:"-----BEGIN CERTIFICATE-----\n..."`
	ProvisioningCertStorageFormat string    `json:"provisioningCertStorageFormat" binding:"required,oneof=raw string" example:"string"`
	ProvisioningCertPassword      string    `json:"provisioningCertPassword,omitempty" binding:"required,lte=64" example:"my_password"`
	ExpirationDate                time.Time `json:"expirationDate,omitempty" example:"2022-01-01T00:00:00Z"`
	TenantID                      string    `json:"tenantId" example:"abc123"`
	Version                       string    `json:"version,omitempty" example:"1.0.0"`
}

type EventLog

type EventLog struct {
	DeviceAddress   int    `json:"DeviceAddress"`
	EventSensorType int    `json:"EventSensorType"`
	EventType       int    `json:"EventType"`
	EventOffset     int    `json:"EventOffset"`
	EventSourceType int    `json:"EventSourceType"`
	EventSeverity   string `json:"EventSeverity"`
	SensorNumber    int    `json:"SensorNumber"`
	Entity          string `json:"Entity"`
	EntityInstance  int    `json:"EntityInstance"`
	EventData       []int  `json:"EventData"`
	Time            string `json:"Time"`
	EntityStr       string `json:"EntityStr"`
	Description     string `json:"Desc"`
	EventTypeDesc   string `json:"eventTypeDesc"`
}

type Explorer

type Explorer struct {
	XMLInput  string `json:"xmlInput"`
	XMLOutput string `json:"xmlOutput"`
}

type Features

type Features struct {
	UserConsent string `json:"userConsent" example:"kvm"`
	EnableSOL   bool   `json:"enableSOL" example:"true"`
	EnableIDER  bool   `json:"enableIDER" example:"true"`
	EnableKVM   bool   `json:"enableKVM" example:"true"`
	Redirection bool   `json:"redirection" example:"true"`
	OptInState  int    `json:"optInState" example:"0"`
}

type IEEE8021xConfig

type IEEE8021xConfig struct {
	ProfileName            string `json:"profileName" binding:"required,max=32,alphanum" example:"My Profile"`
	AuthenticationProtocol int    `json:"authenticationProtocol" binding:"authProtocolValidator" example:"1"`
	PXETimeout             *int   `json:"pxeTimeout" binding:"required,number,gte=0,lte=86400" example:"60"`
	WiredInterface         bool   `json:"wiredInterface" example:"false"`
	TenantID               string `json:"tenantId" example:"abc123"`
	Version                string `json:"version,omitempty" example:"1.0.0"`
}

type NotValidError

type NotValidError struct {
	Console consoleerrors.InternalError
}

func (NotValidError) Error

func (e NotValidError) Error() string

func (NotValidError) Wrap

func (e NotValidError) Wrap(function, call string, err error) error

type PowerAction

type PowerAction struct {
	Action int `json:"action" binding:"required" example:"8"`
}

type Profile

type Profile struct {
	ProfileName                string               `json:"profileName,omitempty" binding:"required" example:"My Profile"`
	AMTPassword                string               `` /* 156-byte string literal not displayed */
	CreationDate               string               `json:"creationDate,omitempty" example:"2021-07-01T00:00:00Z"`
	CreatedBy                  string               `json:"created_by,omitempty" example:"admin"`
	GenerateRandomPassword     bool                 `json:"generateRandomPassword" binding:"omitempty,genpasswordwone" example:"true"`
	CIRAConfigName             *string              `json:"ciraConfigName,omitempty" example:"My CIRA Config"`
	Activation                 string               `json:"activation" binding:"required,oneof=ccmactivate acmactivate" example:"activate"`
	MEBXPassword               string               `` /* 196-byte string literal not displayed */
	GenerateRandomMEBxPassword bool                 `json:"generateRandomMEBxPassword" example:"true"`
	CIRAConfigObject           *CIRAConfig          `json:"ciraConfigObject,omitempty"`
	Tags                       []string             `json:"tags,omitempty" example:"tag1,tag2"`
	DHCPEnabled                bool                 `json:"dhcpEnabled" example:"true"`
	IPSyncEnabled              bool                 `json:"ipSyncEnabled" example:"true"`
	LocalWiFiSyncEnabled       bool                 `json:"localWifiSyncEnabled" example:"true"`
	WiFiConfigs                []ProfileWiFiConfigs `json:"wifiConfigs,omitempty" binding:"excluded_if=DHCPEnabled false,dive"`
	TenantID                   string               `json:"tenantId" example:"abc123"`
	TLSMode                    int                  `json:"tlsMode,omitempty" binding:"omitempty,min=1,max=4,ciraortls" example:"1"`
	TLSCerts                   *TLSCerts            `json:"tlsCerts,omitempty"`
	TLSSigningAuthority        string               `json:"tlsSigningAuthority,omitempty" binding:"omitempty,oneof=SelfSigned MicrosoftCA" example:"SelfSigned"`
	UserConsent                string               `json:"userConsent,omitempty" binding:"omitempty" default:"All" example:"All"`
	IDEREnabled                bool                 `json:"iderEnabled" example:"true"`
	KVMEnabled                 bool                 `json:"kvmEnabled" example:"true"`
	SOLEnabled                 bool                 `json:"solEnabled" example:"true"`
	IEEE8021xProfileName       *string              `json:"ieee8021xProfileName,omitempty" example:"My Profile"`
	IEEE8021xProfile           *IEEE8021xConfig     `json:"ieee8021xProfile,omitempty"`
	Version                    string               `json:"version,omitempty" example:"1.0.0"`
}

type ProfileAssociation

type ProfileAssociation struct {
	Type              string      `json:"Type"`
	ProfileID         string      `json:"ProfileID"`
	RootCertificate   interface{} `json:"RootCertificate,omitempty"`
	ClientCertificate interface{} `json:"ClientCertificate,omitempty"`
	Key               interface{} `json:"PublicKey,omitempty"`
}

type ProfileWiFiConfigs

type ProfileWiFiConfigs struct {
	Priority            int    `json:"priority,omitempty" binding:"min=1,max=255" example:"1"`
	WirelessProfileName string `json:"profileName" example:"My Profile"`
	ProfileName         string `json:"profileProfileName" example:"My Wireless Profile"`
	TenantID            string `json:"tenantId" example:"abc123"`
}

type SecuritySettings

type SecuritySettings struct {
	ProfileAssociation []ProfileAssociation `json:"ProfileAssociation"`
	Certificates       interface{}          `json:"Certificates"`
	Keys               interface{}          `json:"PublicKeys"`
}

type TLSCerts

type TLSCerts struct {
	RootCertificate   CertCreationResult `json:"rootCertificate"`
	IssuedCertificate CertCreationResult `json:"issuedCertificate"`
	Version           string             `json:"version"`
}

type UserConsent

type UserConsent struct {
	ConsentCode string `json:"consentCode" binding:"required" example:"123456"`
}

type WirelessConfig

type WirelessConfig struct {
	ProfileName            string           `json:"profileName,omitempty" example:"My Profile"`
	AuthenticationMethod   int              `json:"authenticationMethod" binding:"required,oneof=4 5 6 7,authforieee8021x" example:"1"`
	EncryptionMethod       int              `json:"encryptionMethod" binding:"oneof=3 4" example:"3"`
	SSID                   string           `json:"ssid" binding:"max=32" example:"abc"`
	PSKValue               int              `json:"pskValue" example:"3"`
	PSKPassphrase          string           `json:"pskPassphrase,omitempty" binding:"omitempty,min=8,max=32" example:"abc"`
	LinkPolicy             []int            `json:"linkPolicy"`
	TenantID               string           `json:"tenantId" example:"abc123"`
	IEEE8021xProfileName   *string          `json:"ieee8021xProfileName,omitempty" example:"My Profile"`
	IEEE8021xProfileObject *IEEE8021xConfig `json:"ieee8021xProfileObject,omitempty"`
	Version                string           `json:"version"`
}

type WirelessConfigCountResponse

type WirelessConfigCountResponse struct {
	Count int              `json:"totalCount"`
	Data  []WirelessConfig `json:"data"`
}

Jump to

Keyboard shortcuts

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