Documentation ¶
Index ¶
- Constants
- Variables
- func WithDecoration(description string, contentType string, httpStatus int) func(cu *openapi.ContentUnit)
- func WriteResponse(logger logr.Logger, writer http.ResponseWriter, response string)
- func WriteResponseBytes(logger logr.Logger, writer http.ResponseWriter, response []byte)
- type Authenticator
- type BootstrapGetRequest
- type BootstrapResponse
- type DeleteElementalHostHandler
- type GetElementalHostBootstrapHandler
- type GetElementalRegistrationHandler
- type HostCreateRequest
- type HostDeleteRequest
- type HostPatchRequest
- type HostResponse
- type OpenAPIDecoratedHandler
- type PatchElementalHostHandler
- type PostElementalHostHandler
- type RegistrationGetRequest
- type RegistrationResponse
- type Server
- type WriteFile
Constants ¶
View Source
const ( Prefix = "/elemental" PrefixV1 = "/v1" )
Prefixes.
Variables ¶
Functions ¶
func WithDecoration ¶
func WriteResponse ¶
func WriteResponse(logger logr.Logger, writer http.ResponseWriter, response string)
WriteResponse is the same wrapper as WriteResponseBytes, but accepts []byte as input.
func WriteResponseBytes ¶
func WriteResponseBytes(logger logr.Logger, writer http.ResponseWriter, response []byte)
WriteResponseBytes is a wrapper to handle HTTP response writing errors with logging.
Types ¶
type Authenticator ¶ added in v0.2.0
type Authenticator interface { ValidateHostRequest(*http.Request, http.ResponseWriter, *v1beta1.ElementalHost, *v1beta1.ElementalRegistration) error ValidateRegistrationRequest(*http.Request, http.ResponseWriter, *v1beta1.ElementalRegistration) error }
func NewAuthenticator ¶ added in v0.2.0
func NewAuthenticator(k8sClient client.Client, logger logr.Logger) Authenticator
type BootstrapGetRequest ¶
type BootstrapResponse ¶
type DeleteElementalHostHandler ¶
type DeleteElementalHostHandler struct {
// contains filtered or unexported fields
}
func NewDeleteElementalHostHandler ¶
func NewDeleteElementalHostHandler(logger logr.Logger, k8sClient client.Client) *DeleteElementalHostHandler
func (*DeleteElementalHostHandler) ServeHTTP ¶
func (h *DeleteElementalHostHandler) ServeHTTP(response http.ResponseWriter, request *http.Request)
func (*DeleteElementalHostHandler) SetupOpenAPIOperation ¶
func (h *DeleteElementalHostHandler) SetupOpenAPIOperation(oc openapi.OperationContext) error
type GetElementalHostBootstrapHandler ¶
type GetElementalHostBootstrapHandler struct {
// contains filtered or unexported fields
}
func NewGetElementalHostBootstrapHandler ¶
func NewGetElementalHostBootstrapHandler(logger logr.Logger, k8sClient client.Client) *GetElementalHostBootstrapHandler
func (*GetElementalHostBootstrapHandler) ServeHTTP ¶
func (h *GetElementalHostBootstrapHandler) ServeHTTP(response http.ResponseWriter, request *http.Request)
func (*GetElementalHostBootstrapHandler) SetupOpenAPIOperation ¶
func (h *GetElementalHostBootstrapHandler) SetupOpenAPIOperation(oc openapi.OperationContext) error
type GetElementalRegistrationHandler ¶
type GetElementalRegistrationHandler struct {
// contains filtered or unexported fields
}
func NewGetElementalRegistrationHandler ¶
func NewGetElementalRegistrationHandler(logger logr.Logger, k8sClient client.Client) *GetElementalRegistrationHandler
func (*GetElementalRegistrationHandler) ServeHTTP ¶
func (h *GetElementalRegistrationHandler) ServeHTTP(response http.ResponseWriter, request *http.Request)
func (*GetElementalRegistrationHandler) SetupOpenAPIOperation ¶
func (h *GetElementalRegistrationHandler) SetupOpenAPIOperation(oc openapi.OperationContext) error
type HostCreateRequest ¶
type HostCreateRequest struct { Auth string `header:"Authorization"` RegAuth string `header:"Registration-Authorization"` Namespace string `path:"namespace"` RegistrationName string `path:"registrationName"` Name string `json:"name,omitempty"` Annotations map[string]string `json:"annotations,omitempty"` Labels map[string]string `json:"labels,omitempty"` PubKey string `json:"pubKey,omitempty"` }
type HostDeleteRequest ¶
type HostPatchRequest ¶
type HostPatchRequest struct { Auth string `header:"Authorization"` Namespace string `path:"namespace"` RegistrationName string `path:"registrationName"` HostName string `path:"hostName"` Annotations map[string]string `json:"annotations,omitempty"` Labels map[string]string `json:"labels,omitempty"` Bootstrapped *bool `json:"bootstrapped,omitempty"` Installed *bool `json:"installed,omitempty"` Reset *bool `json:"reset,omitempty"` }
type HostResponse ¶
type HostResponse struct { Name string `json:"name,omitempty"` Annotations map[string]string `json:"annotations,omitempty"` Labels map[string]string `json:"labels,omitempty"` BootstrapReady bool `json:"bootstrapReady,omitempty"` Bootstrapped bool `json:"bootstrapped,omitempty"` Installed bool `json:"installed,omitempty"` NeedsReset bool `json:"needsReset,omitempty"` }
type OpenAPIDecoratedHandler ¶
type OpenAPIDecoratedHandler interface { SetupOpenAPIOperation(oc openapi.OperationContext) error ServeHTTP(w http.ResponseWriter, r *http.Request) }
type PatchElementalHostHandler ¶
type PatchElementalHostHandler struct {
// contains filtered or unexported fields
}
func NewPatchElementalHostHandler ¶
func NewPatchElementalHostHandler(logger logr.Logger, k8sClient client.Client) *PatchElementalHostHandler
func (*PatchElementalHostHandler) ServeHTTP ¶
func (h *PatchElementalHostHandler) ServeHTTP(response http.ResponseWriter, request *http.Request)
func (*PatchElementalHostHandler) SetupOpenAPIOperation ¶
func (h *PatchElementalHostHandler) SetupOpenAPIOperation(oc openapi.OperationContext) error
type PostElementalHostHandler ¶
type PostElementalHostHandler struct {
// contains filtered or unexported fields
}
func NewPostElementalHostHandler ¶
func NewPostElementalHostHandler(logger logr.Logger, k8sClient client.Client) *PostElementalHostHandler
func (*PostElementalHostHandler) ServeHTTP ¶
func (h *PostElementalHostHandler) ServeHTTP(response http.ResponseWriter, request *http.Request)
func (*PostElementalHostHandler) SetupOpenAPIOperation ¶
func (h *PostElementalHostHandler) SetupOpenAPIOperation(oc openapi.OperationContext) error
type RegistrationGetRequest ¶
type RegistrationResponse ¶
type RegistrationResponse struct { // HostLabels are labels propagated to each ElementalHost object linked to this registration. // +optional HostLabels map[string]string `json:"hostLabels,omitempty"` // HostAnnotations are labels propagated to each ElementalHost object linked to this registration. // +optional HostAnnotations map[string]string `json:"hostAnnotations,omitempty"` // Config points to Elemental machine configuration. // +optional Config infrastructurev1beta1.Config `json:"config,omitempty"` }
Click to show internal directories.
Click to hide internal directories.