Documentation ¶
Overview ¶
nolint Package secureagent implements the secure agent
Package secureagent implements the secure agent ¶
Package secureagent implements the secure agent ¶
Package secureagent implements the secure agent ¶
nolint Package secureagent implements the secure agent
Package secureagent implements the secure agent ¶
Package secureagent implements the secure agent ¶
Package secureagent implements the secure agent ¶
Package secureagent implements the secure agent
Index ¶
- Constants
- func GetSerialNumber(givenSerialNumber string) string
- func NewHTTPClient(bootstrapTrustAnchorCert string, deviceEndEntityCert string, ...) http.Client
- type Agent
- func (a *Agent) GetBootstrapTrustAnchorCert() string
- func (a *Agent) GetBootstrapURL() string
- func (a *Agent) GetContentTypeReq() string
- func (a *Agent) GetDeviceEndEntityCert() string
- func (a *Agent) GetDevicePassword() string
- func (a *Agent) GetDevicePrivateKey() string
- func (a *Agent) GetInputJSONContent() string
- func (a *Agent) GetProgressJSON() ProgressJSON
- func (a *Agent) GetSerialNumber() string
- func (a *Agent) RunCommand() error
- func (a *Agent) RunCommandDaemon() error
- func (a *Agent) RunCommandDisable() error
- func (a *Agent) RunCommandEnable() error
- func (a *Agent) RunCommandStatus() error
- func (a *Agent) SetBootstrapTrustAnchorCert(cacert string)
- func (a *Agent) SetBootstrapURL(url string)
- func (a *Agent) SetContentTypeReq(ct string)
- func (a *Agent) SetDeviceEndEntityCert(cert string)
- func (a *Agent) SetDevicePassword(pass string)
- func (a *Agent) SetDevicePrivateKey(key string)
- func (a *Agent) SetProgressJSON(p ProgressJSON)
- func (a *Agent) SetSerialNumber(serialNumber string)
- type BootstrapServerErrorOutput
- type BootstrapServerOnboardingInfo
- type BootstrapServerPostOutput
- type BootstrapServerRedirectInfo
- type HttpClient
- type InputJSON
- type ProgressJSON
- type ProgressType
Constants ¶
View Source
const ( CONTENT_TYPE_YANG = "application/yang-data+json" OS_RELEASE_FILE = "/etc/os-release" SZTP_REDIRECT_URL = "sztp-redirect-urls" ARTIFACTS_PATH = "/tmp/" )
View Source
const ( // PRE nolint:var-naming PRE = "pre" // POST nolint:var-naming POST = "post" )
Variables ¶
This section is empty.
Functions ¶
func GetSerialNumber ¶
GetSerialNumber returns the serial number of the device
Types ¶
type Agent ¶
type Agent struct { InputBootstrapURL string // Bootstrap complete URL given by USER BootstrapURL string // Bootstrap complete URL SerialNumber string // Device's Serial Number DevicePassword string // Device's Password DevicePrivateKey string // Device's private key DeviceEndEntityCert string // Device's end-entity cert BootstrapTrustAnchorCert string // the trusted bootstrap server's trust-anchor certificate (PEM) ContentTypeReq string // The content type for the request to the Server InputJSONContent string // The input.json file serialized DhcpLeaseFile string // The dhcpfile ProgressJSON ProgressJSON // ProgressJson structure BootstrapServerOnboardingInfo BootstrapServerOnboardingInfo // BootstrapServerOnboardingInfo structure BootstrapServerRedirectInfo BootstrapServerRedirectInfo // BootstrapServerRedirectInfo structure HttpClient HttpClient }
Agent is the basic structure to define an agent instance
func NewAgent ¶
func NewAgent(bootstrapURL, serialNumber, dhcpLeaseFile, devicePassword, devicePrivateKey, deviceEndEntityCert, bootstrapTrustAnchorCert string, httpClient HttpClient) *Agent
func (*Agent) GetBootstrapTrustAnchorCert ¶
func (*Agent) GetBootstrapURL ¶
func (*Agent) GetContentTypeReq ¶
func (*Agent) GetDeviceEndEntityCert ¶
func (*Agent) GetDevicePassword ¶
func (*Agent) GetDevicePrivateKey ¶
func (*Agent) GetInputJSONContent ¶
func (*Agent) GetProgressJSON ¶
func (a *Agent) GetProgressJSON() ProgressJSON
func (*Agent) GetSerialNumber ¶
func (*Agent) RunCommand ¶
RunCommand runs the command in the background
func (*Agent) RunCommandDaemon ¶
RunCommandDaemon runs the command in the background
func (*Agent) RunCommandDisable ¶
RunCommandDisable runs the command in the background
func (*Agent) RunCommandEnable ¶
RunCommandEnable runs the command in the background
func (*Agent) RunCommandStatus ¶
RunCommandStatus runs the command in the background
func (*Agent) SetBootstrapTrustAnchorCert ¶
func (*Agent) SetBootstrapURL ¶
func (*Agent) SetContentTypeReq ¶
func (*Agent) SetDeviceEndEntityCert ¶
func (*Agent) SetDevicePassword ¶
func (*Agent) SetDevicePrivateKey ¶
func (*Agent) SetProgressJSON ¶
func (a *Agent) SetProgressJSON(p ProgressJSON)
func (*Agent) SetSerialNumber ¶
type BootstrapServerOnboardingInfo ¶
type BootstrapServerOnboardingInfo struct { IetfSztpConveyedInfoOnboardingInformation struct { InfoTimestampReference string // [not received in json] This is the reference to know exactly the time file downloaded and reference to the artifacts of a specific request BootImage struct { DownloadURI []string `json:"download-uri"` ImageVerification []struct { HashAlgorithm string `json:"hash-algorithm"` HashValue string `json:"hash-value"` } `json:"image-verification"` } `json:"boot-image"` PreConfigurationScript string `json:"pre-configuration-script"` ConfigurationHandling string `json:"configuration-handling"` Configuration string `json:"configuration"` PostConfigurationScript string `json:"post-configuration-script"` } `json:"ietf-sztp-conveyed-info:onboarding-information"` }
type BootstrapServerPostOutput ¶
type BootstrapServerPostOutput struct { IetfSztpBootstrapServerOutput struct { ConveyedInformation string `json:"conveyed-information"` } `json:"ietf-sztp-bootstrap-server:output"` }
type HttpClient ¶
type ProgressJSON ¶
type ProgressJSON struct { IetfSztpBootstrapServerInput struct { ProgressType string `json:"progress-type"` Message string `json:"message"` SSHHostKeys struct { SSHHostKey []struct { Algorithm string `json:"algorithm"` KeyData string `json:"key-data"` } `json:"ssh-host-key,omitempty"` } `json:"ssh-host-keys,omitempty"` TrustAnchorCerts struct { TrustAnchorCert []string `json:"trust-anchor-cert,omitempty"` } `json:"trust-anchor-certs,omitempty"` } `json:"ietf-sztp-bootstrap-server:input"` }
type ProgressType ¶
type ProgressType int64
const ( ProgressTypeBootstrapInitiated ProgressType = iota ProgressTypeParsingInitiated ProgressTypeParsingWarning ProgressTypeParsingError ProgressTypeParsingComplete ProgressTypeBootImageInitiated ProgressTypeBootImageWarning ProgressTypeBootImageError ProgressTypeBootImageMismatch ProgressTypeBootImageInstalledRebooting ProgressTypeBootImageComplete ProgressTypePreScriptInitiated ProgressTypePreScriptWarning ProgressTypePreScriptError ProgressTypePreScriptComplete ProgressTypeConfigInitiated ProgressTypeConfigWarning ProgressTypeConfigError ProgressTypeConfigComplete ProgressTypePostScriptInitiated ProgressTypePostScriptWarning ProgressTypePostScriptError ProgressTypePostScriptComplete ProgressTypeBootstrapWarning ProgressTypeBootstrapError ProgressTypeBootstrapComplete ProgressTypeInformational )
func (ProgressType) String ¶
func (s ProgressType) String() string
Click to show internal directories.
Click to hide internal directories.