Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Params)
func WithAccessToken ¶
func WithCertPool ¶
func WithCertPoolFile ¶
FIXME: Need to check for errors when reading from a file
type Params ¶
type SmdClient ¶
type SmdClient struct {
http.Client `json:"-" yaml:"-"`
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 ¶
Constructor function that allows supplying Option arguments to set things like the host, port, access token, etc.
func (*SmdClient) FetchComponents ¶
func (client *SmdClient) FetchComponents(verbose bool) ([]configurator.Component, error)
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(verbose bool) ([]configurator.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(verbose bool) ([]configurator.RedfishEndpoint, error)
TODO: improve implementation of this function