templates

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Overview

Package templates implements API functions residing under /provisioning/templates. This path contains methods for querying available VM templates.

Index

Constants

View Source
const (
	// TemplateTypeTemplates are templates that already contain a distribution.
	TemplateTypeTemplates string = "templates"
	// TemplateTypeFromScratch are templates that need to have distribution added to work.
	TemplateTypeFromScratch string = "from_scratch"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	List(ctx context.Context, locationID string, templateType string, page, limit int) ([]Template, error)
}

API contains methods for template querying.

func NewAPI

func NewAPI(c client.Client) API

NewAPI creates a new template API instance with the given client.

type BoolParameter

type BoolParameter struct {
	Required bool   `json:"required"`
	Label    string `json:"label"`
	Default  bool   `json:"defaultValue"`
}

BoolParameter is a bool parameter for a template.

type IntParameter

type IntParameter struct {
	Minimum  int    `json:"minValue"`
	Maximum  int    `json:"maxValue"`
	Required bool   `json:"required"`
	Label    string `json:"label"`
	Default  int    `json:"defaultValue"`
}

IntParameter is an int parameter for a template.

type NIC

type NIC struct {
	ID      int    `json:"id"`
	Name    string `json:"name"`
	Default bool   `json:"default"`
}

NIC is a single NIC in NICParameter.

type NICParameter

type NICParameter struct {
	Required bool   `json:"required"`
	Label    string `json:"label"`
	Default  int    `json:"defaultValue"`
	NICs     []NIC  `json:"data"`
}

NICParameter is a network interface card parameter for a template.

type Parameters

type Parameters struct {
	Hostname         StringParameter `json:"hostname"`
	CPUs             IntParameter    `json:"cpus"`
	MemoryMB         IntParameter    `json:"memoryMB"`
	DiskGB           IntParameter    `json:"diskGB"`
	DNS0             StringParameter `json:"dns0"`
	DNS1             StringParameter `json:"dns1"`
	DNS2             StringParameter `json:"dns2"`
	DNS3             StringParameter `json:"dns3"`
	NICs             NICParameter    `json:"nics"`
	VLAN             StringParameter `json:"vlan"`
	IPs              StringParameter `json:"ips"`
	BootDelaySeconds IntParameter    `json:"bootDelaySeconds"`
	EnterBIOSSetup   BoolParameter   `json:"enterBIOSSetup"`
	Password         StringParameter `json:"password"`
	User             StringParameter `json:"user"`
	DiskType         StringParameter `json:"disk_type"`
}

Parameters set of a VM.

type StringParameter

type StringParameter struct {
	Required bool   `json:"required"`
	Label    string `json:"label"`
	Default  string `json:"defaultValue"`
}

StringParameter is a string parameter for a template.

type Template

type Template struct {
	ID         string     `json:"id"`
	Name       string     `json:"name"`
	WordSize   string     `json:"bit"`
	Build      string     `json:"build"`
	Parameters Parameters `json:"param"`
}

Template contains a summary about the state of a template.

type TemplateType

type TemplateType string

TemplateType defines which type of template is selected.

Jump to

Keyboard shortcuts

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