Documentation ¶
Index ¶
- func FetchPublicKeyFromURL(url string) (*jwtauth.JWTAuth, error)
- func LoadAccessToken()
- func NewParams() util.Params
- func SaveDefaultConfig(path string)
- func VerifyScope(testScopes []string, r *http.Request) (bool, error)
- func WithVerbosity() util.Option
- type BMC
- type ClientOption
- type Component
- type Config
- type EthernetInterface
- type IPAddr
- type Jwks
- type Node
- type Options
- type RedfishEndpoint
- type Server
- type SmdClient
- type Target
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchPublicKeyFromURL ¶
func LoadAccessToken ¶
func LoadAccessToken()
func SaveDefaultConfig ¶
func SaveDefaultConfig(path string)
func WithVerbosity ¶
Types ¶
type ClientOption ¶
type ClientOption func(*SmdClient)
func WithAccessToken ¶
func WithAccessToken(token string) ClientOption
func WithCertPool ¶
func WithCertPool(certPool *x509.CertPool) ClientOption
func WithCertPoolFile ¶
func WithCertPoolFile(certPath string) ClientOption
FIXME: Need to check for errors when reading from a file
func WithHost ¶
func WithHost(host string) ClientOption
func WithPort ¶
func WithPort(port int) ClientOption
type Component ¶
type Component struct { ID string `json:"ID"` Type string `json:"Type"` State string `json:"State,omitempty"` Flag string `json:"Flag,omitempty"` Enabled *bool `json:"Enabled,omitempty"` SwStatus string `json:"SoftwareStatus,omitempty"` Role string `json:"Role,omitempty"` SubRole string `json:"SubRole,omitempty"` NID json.Number `json:"NID,omitempty"` Subtype string `json:"Subtype,omitempty"` NetType string `json:"NetType,omitempty"` Arch string `json:"Arch,omitempty"` Class string `json:"Class,omitempty"` ReservationDisabled bool `json:"ReservationDisabled,omitempty"` Locked bool `json:"Locked,omitempty"` }
type Config ¶
type Config struct { Version string `yaml:"version,omitempty"` Server Server `yaml:"server,omitempty"` SmdClient SmdClient `yaml:"smd,omitempty"` AccessToken string `yaml:"access-token,omitempty"` Targets map[string]Target `yaml:"targets,omitempty"` PluginDirs []string `yaml:"plugins,omitempty"` CertPath string `yaml:"cacert,omitempty"` Options Options `yaml:"options,omitempty"` }
func LoadConfig ¶
func (*Config) SaveConfig ¶
type EthernetInterface ¶
type RedfishEndpoint ¶
type RedfishEndpoint struct { ID string `json:"ID"` Type string `json:"Type"` Name string `json:"Name,omitempty"` // user supplied descriptive name Hostname string `json:"Hostname"` Domain string `json:"Domain"` FQDN string `json:"FQDN"` Enabled bool `json:"Enabled"` UUID string `json:"UUID,omitempty"` User string `json:"User"` Password string `json:"Password"` // Temporary until more secure method UseSSDP bool `json:"UseSSDP,omitempty"` MACRequired bool `json:"MACRequired,omitempty"` MACAddr string `json:"MACAddr,omitempty"` IPAddr string `json:"IPAddress,omitempty"` }
type SmdClient ¶
type SmdClient struct { http.Client `json:"-"` Host string `yaml:"host"` Port int `yaml:"port"` AccessToken string `yaml:"access-token"` }
An struct that's meant to extend functionality of the base HTTP client by adding commonly made requests to SMD. The implemented functions are can be used in generator plugins to fetch data when it is needed to substitute values for the Jinja templates used.
func NewSmdClient ¶
func NewSmdClient(opts ...ClientOption) SmdClient
Constructor function that allows supplying ClientOption arguments to set things like the host, port, access token, etc.
func (*SmdClient) FetchComponents ¶
Fetch the components from SMD using its API. An access token may be required if the SMD service SMD_JWKS_URL envirnoment variable is set.
func (*SmdClient) FetchEthernetInterfaces ¶
func (client *SmdClient) FetchEthernetInterfaces(opts ...util.Option) ([]EthernetInterface, error)
Fetch the ethernet interfaces from SMD service using its API. An access token may be required if the SMD service SMD_JWKS_URL envirnoment variable is set.
func (*SmdClient) FetchRedfishEndpoints ¶
func (client *SmdClient) FetchRedfishEndpoints(opts ...util.Option) ([]RedfishEndpoint, error)