hack

package
v0.14.2 Latest Latest
Warning

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

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

Documentation

Overview

Package hack contains a frontend that provides a /metadata endpoint for the rootio hub action. It is not intended to be long lived and will be removed as we migrate to exposing Hardware data to Tinkerbell templates. In doing so, we can convert the rootio action to accept its inputs via parameters instead of retrieing them from Hegel and subsequently delete this frontend.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(router gin.IRouter, client Client)

Configure configures router with a `/metadata` endpoint using client to retrieve instance data.

Types

type Client

type Client interface {
	GetHackInstance(ctx context.Context, ip string) (Instance, error)
}

Client is a backend for retrieving hack instance data.

type Instance

type Instance struct {
	Metadata struct {
		Instance struct {
			Storage struct {
				Disks []struct {
					Device     string `json:"device"`
					Partitions []struct {
						Label  string `json:"label"`
						Number int    `json:"number"`
						Size   uint64 `json:"size"`
					} `json:"partitions"`
					WipeTable bool `json:"wipe_table"`
				} `json:"disks"`
				Filesystems []struct {
					Mount struct {
						Create struct {
							Options []string `json:"options"`
						} `json:"create"`
						Device string `json:"device"`
						Format string `json:"format"`
						Point  string `json:"point"`
					} `json:"mount"`
				} `json:"filesystems"`
			} `json:"storage"`
		} `json:"instance"`
	} `json:"metadata"`
}

Instance is a representation of the instance metadata. Its based on the rooitio hub action and should have just enough information for it to work.

Jump to

Keyboard shortcuts

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