types

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CloudInitAttributes = map[string]schema.Attribute{
	"user": schema.SingleNestedAttribute{
		Optional:   true,
		Attributes: CloudInitUserAttributes,
	},
	"ip": schema.SetNestedAttribute{
		Optional:     true,
		CustomType:   NewCloudInitIpSetType(),
		NestedObject: CloudInitIpSchema,
		Validators: []validator.Set{
			setvalidator.SizeAtLeast(1),
		},
	},
	"dns": schema.SingleNestedAttribute{
		Optional:   true,
		Attributes: CloudInitDnsAttributes,
	},
}
View Source
var CloudInitDataSourceAttributes = map[string]dschema.Attribute{
	"user": dschema.SingleNestedAttribute{
		Computed:   true,
		Attributes: CloudInitUserDataSourceAttributes,
	},
	"ip": dschema.SetNestedAttribute{
		Computed:     true,
		CustomType:   NewCloudInitIpSetType(),
		NestedObject: CloudInitIpDataSourceSchema,
	},
	"dns": dschema.SingleNestedAttribute{
		Computed:   true,
		Attributes: CloudInitDnsDataSourceAttributes,
	},
}
View Source
var CloudInitDnsAttributes = map[string]schema.Attribute{
	"nameserver": schema.StringAttribute{
		Optional:    true,
		Description: "The nameserver to use for the machine.",
	},
	"domain": schema.StringAttribute{
		Optional:    true,
		Description: "The domain to use for the machine.",
	},
}
View Source
var CloudInitDnsDataSourceAttributes = map[string]dschema.Attribute{
	"nameserver": dschema.StringAttribute{
		Computed:    true,
		Description: "The nameserver to use for the machine.",
	},
	"domain": dschema.StringAttribute{
		Computed:    true,
		Description: "The domain to use for the machine.",
	},
}
View Source
var CloudInitIp = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"position": types.Int64Type,
		"v4":       CloudInitIpConfig,
		"v6":       CloudInitIpConfig,
	},
}
View Source
var CloudInitIpConfig = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"dhcp":    types.BoolType,
		"address": types.StringType,
		"netmask": types.StringType,
		"gateway": types.StringType,
	},
}
View Source
var CloudInitIpConfigDataSourceSchema = map[string]dschema.Attribute{
	"dhcp": dschema.BoolAttribute{
		Computed:    true,
		Description: "Whether to use DHCP to get the IP address.",
	},
	"address": dschema.StringAttribute{
		Computed:    true,
		Description: "The IP address to use for the machine.",
	},
	"netmask": dschema.StringAttribute{
		Computed:    true,
		Description: "The IP address netmask to use for the machine.",
	},
	"gateway": dschema.StringAttribute{
		Computed:    true,
		Description: "The gateway to use for the machine.",
	},
}
View Source
var CloudInitIpConfigSchema = map[string]schema.Attribute{
	"dhcp": schema.BoolAttribute{
		Optional:    true,
		Computed:    true,
		Description: "Whether to use DHCP to get the IP address.",
		PlanModifiers: []planmodifier.Bool{
			boolplanmodifier.UseStateForUnknown(),
		},
	},
	"address": schema.StringAttribute{
		Optional:    true,
		Description: "The IP address to use for the machine.",
	},
	"netmask": schema.StringAttribute{
		Optional:    true,
		Description: "The IP address netmask to use for the machine.",
	},
	"gateway": schema.StringAttribute{
		Optional:    true,
		Description: "The gateway to use for the machine.",
	},
}
View Source
var CloudInitIpConfigTypes = map[string]attr.Type{
	"dhcp":    types.BoolType,
	"address": types.StringType,
	"netmask": types.StringType,
	"gateway": types.StringType,
}
View Source
var CloudInitIpDataSourceSchema = dschema.NestedAttributeObject{
	Attributes: map[string]dschema.Attribute{
		"position": dschema.Int64Attribute{
			Computed:    true,
			Description: "The position of the network interface in the VM as an int. Used to determine the interface name (net0, net1, etc).",
		},
		"v4": dschema.SingleNestedAttribute{
			Computed:   true,
			Attributes: CloudInitIpConfigDataSourceSchema,
		},
		"v6": dschema.SingleNestedAttribute{
			Computed:   true,
			Attributes: CloudInitIpConfigDataSourceSchema,
		},
	},
}
View Source
var CloudInitIpSchema = schema.NestedAttributeObject{
	Attributes: map[string]schema.Attribute{
		"position": schema.Int64Attribute{
			Required:    true,
			Description: "The position of the network interface in the VM as an int. Used to determine the interface name (net0, net1, etc).",
		},
		"v4": schema.SingleNestedAttribute{
			Optional:   true,
			Attributes: CloudInitIpConfigSchema,
		},
		"v6": schema.SingleNestedAttribute{
			Optional:   true,
			Attributes: CloudInitIpConfigSchema,
		},
	},
}
View Source
var CloudInitIpType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"position": types.Int64Type,
		"v4": types.ObjectType{
			AttrTypes: CloudInitIpConfigTypes,
		},
		"v6": types.ObjectType{
			AttrTypes: CloudInitIpConfigTypes,
		},
	},
}
View Source
var CloudInitUserAttributes = map[string]schema.Attribute{
	"name": schema.StringAttribute{
		Required:    true,
		Description: "The name of the user.",
	},
	"password": schema.StringAttribute{
		Optional:    true,
		Sensitive:   true,
		Description: "The password of the user.",
	},
	"public_keys": schema.SetAttribute{
		Optional:    true,
		Description: "The public ssh keys of the user.",
		ElementType: types.StringType,
		Validators: []validator.Set{
			setvalidator.SizeAtLeast(1),
		},
	},
}
View Source
var CloudInitUserDataSourceAttributes = map[string]dschema.Attribute{
	"name": dschema.StringAttribute{
		Computed:    true,
		Description: "The name of the user.",
	},
	"password": dschema.StringAttribute{
		Computed:    true,
		Sensitive:   true,
		Description: "The password of the user.",
	},
	"public_keys": dschema.SetAttribute{
		Computed:    true,
		Description: "The public ssh keys of the user.",
		ElementType: types.StringType,
	},
}
View Source
var VirtualMachineDataSourceType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"id":          types.Int64Type,
		"node":        types.StringType,
		"name":        types.StringType,
		"description": types.StringType,
		"tags": types.SetType{
			ElemType: types.StringType,
		},
		"agent": types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"enabled":    types.BoolType,
				"use_fstrim": types.BoolType,
				"type":       types.StringType,
			},
		},
		"bios": types.StringType,
		"cpu": types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"architecture":  types.StringType,
				"cores":         types.Int64Type,
				"sockets":       types.Int64Type,
				"emulated_type": types.StringType,
				"cpu_units":     types.Int64Type,
			},
		},
		"disks":              NewVirtualMachineDiskSetType(),
		"network_interfaces": NewVirtualMachineNetworkInterfaceSetType(),
		"pci_devices":        NewVirtualMachinePCIDeviceSetType(),
		"memory": types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"dedicated": types.Int64Type,
				"floating":  types.Int64Type,
				"shared":    types.Int64Type,
			},
		},
		"cloud_init": types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"user": types.ObjectType{
					AttrTypes: map[string]attr.Type{
						"password": types.StringType,
						"public_keys": types.SetType{
							ElemType: types.StringType,
						},
						"name": types.StringType,
					},
				},
				"ip": NewCloudInitIpSetType(),
				"dns": types.ObjectType{
					AttrTypes: map[string]attr.Type{
						"nameserver": types.StringType,
						"domain":     types.StringType,
					},
				},
			},
		},
		"machine_type":       types.StringType,
		"kvm_arguments":      types.StringType,
		"keyboard_layout":    types.StringType,
		"type":               types.StringType,
		"resource_pool":      types.StringType,
		"start_on_node_boot": types.BoolType,
	},
}
View Source
var VirtualMachineDisk = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"storage":      types.StringType,
		"file_format":  types.StringType,
		"size":         types.Int64Type,
		"name":         types.StringType,
		"use_iothread": types.BoolType,
		"speed_limits": types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"read":            types.Int64Type,
				"write":           types.Int64Type,
				"read_burstable":  types.Int64Type,
				"write_burstable": types.Int64Type,
			},
		},
		"interface_type": types.StringType,
		"position":       types.Int64Type,
		"ssd_emulation":  types.BoolType,
		"discard":        types.BoolType,
	},
}
View Source
var VirtualMachineNetworkInterface = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"bridge":       types.StringType,
		"enabled":      types.BoolType,
		"use_firewall": types.BoolType,
		"mac_address":  types.StringType,
		"model":        types.StringType,
		"rate_limit":   types.Int64Type,
		"position":     types.Int64Type,
		"vlan":         types.Int64Type,
		"mtu":          types.Int64Type,
	},
}
View Source
var VirtualMachinePCIDevice = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"name":        types.StringType,
		"id":          types.StringType,
		"pcie":        types.BoolType,
		"mdev":        types.StringType,
		"rombar":      types.BoolType,
		"rom_file":    types.StringType,
		"primary_gpu": types.BoolType,
	},
}

Functions

This section is empty.

Types

type CloudInitIpSetType

type CloudInitIpSetType struct {
	types.SetType
}

func NewCloudInitIpSetType

func NewCloudInitIpSetType() CloudInitIpSetType

func (CloudInitIpSetType) Equal

func (ci CloudInitIpSetType) Equal(o attr.Type) bool

func (CloudInitIpSetType) String

func (st CloudInitIpSetType) String() string

func (CloudInitIpSetType) ValueFromTerraform

func (c CloudInitIpSetType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

type CloudInitIpSetValue

type CloudInitIpSetValue struct {
	types.Set
	Configs []VirtualMachineCloudInitIpModel
}

type VirtualMachineAgentModel

type VirtualMachineAgentModel struct {
	Enabled   types.Bool   `tfsdk:"enabled"`
	UseFSTrim types.Bool   `tfsdk:"use_fstrim"`
	Type      types.String `tfsdk:"type"`
}

type VirtualMachineCloudInitDnsModel

type VirtualMachineCloudInitDnsModel struct {
	Nameserver types.String `tfsdk:"nameserver"`
	Domain     types.String `tfsdk:"domain"`
}

type VirtualMachineCloudInitIpConfigModel

type VirtualMachineCloudInitIpConfigModel struct {
	DHCP    types.Bool   `tfsdk:"dhcp"`
	Address types.String `tfsdk:"address"`
	Netmask types.String `tfsdk:"netmask"`
	Gateway types.String `tfsdk:"gateway"`
}

type VirtualMachineCloudInitIpModel

type VirtualMachineCloudInitIpModel struct {
	Position types.Int64                           `tfsdk:"position"`
	V4       *VirtualMachineCloudInitIpConfigModel `tfsdk:"v4"`
	V6       *VirtualMachineCloudInitIpConfigModel `tfsdk:"v6"`
}

type VirtualMachineCloudInitModel

type VirtualMachineCloudInitModel struct {
	User *VirtualMachineCloudInitUserModel `tfsdk:"user"`
	IP   CloudInitIpSetValue               `tfsdk:"ip"`
	DNS  *VirtualMachineCloudInitDnsModel  `tfsdk:"dns"`
}

type VirtualMachineCloudInitUserModel

type VirtualMachineCloudInitUserModel struct {
	Name       types.String `tfsdk:"name"`
	Password   types.String `tfsdk:"password"`
	PublicKeys types.Set    `tfsdk:"public_keys"`
}

type VirtualMachineCpuModel

type VirtualMachineCpuModel struct {
	Architecture types.String `tfsdk:"architecture"`
	Cores        types.Int64  `tfsdk:"cores"`
	Sockets      types.Int64  `tfsdk:"sockets"`
	EmulatedType types.String `tfsdk:"emulated_type"`
	CPUUnits     types.Int64  `tfsdk:"cpu_units"`
}

type VirtualMachineDataSourceModel

type VirtualMachineDataSourceModel struct {
	ID                types.Int64                            `tfsdk:"id"`
	Node              types.String                           `tfsdk:"node"`
	Name              types.String                           `tfsdk:"name"`
	Description       types.String                           `tfsdk:"description"`
	Tags              types.Set                              `tfsdk:"tags"`
	Agent             *VirtualMachineAgentModel              `tfsdk:"agent"`
	BIOS              types.String                           `tfsdk:"bios"`
	CPU               VirtualMachineCpuModel                 `tfsdk:"cpu"`
	Disks             VirtualMachineDiskSetValue             `tfsdk:"disks"`
	PCIDevices        VirtualMachinePCIDeviceSetValue        `tfsdk:"pci_devices"`
	NetworkInterfaces VirtualMachineNetworkInterfaceSetValue `tfsdk:"network_interfaces"`
	Memory            VirtualMachineMemoryModel              `tfsdk:"memory"`
	MachineType       types.String                           `tfsdk:"machine_type"`
	KVMArguments      types.String                           `tfsdk:"kvm_arguments"`
	KeyboardLayout    types.String                           `tfsdk:"keyboard_layout"`
	CloudInit         *VirtualMachineCloudInitModel          `tfsdk:"cloud_init"`
	Type              types.String                           `tfsdk:"type"`
	ResourcePool      types.String                           `tfsdk:"resource_pool"`
	StartOnNodeBoot   types.Bool                             `tfsdk:"start_on_node_boot"`
}

type VirtualMachineDataSourceSetType

type VirtualMachineDataSourceSetType struct {
	types.SetType
}

func NewVirtualMachineDataSourceType

func NewVirtualMachineDataSourceType() VirtualMachineDataSourceSetType

func (VirtualMachineDataSourceSetType) Equal

func (VirtualMachineDataSourceSetType) ValueFromTerraform

func (c VirtualMachineDataSourceSetType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

type VirtualMachineDataSourceSetValue

type VirtualMachineDataSourceSetValue struct {
	types.Set
	Vms []VirtualMachineDataSourceModel
}

type VirtualMachineDiskModel

type VirtualMachineDiskModel struct {
	Storage       types.String                        `tfsdk:"storage"`
	FileFormat    types.String                        `tfsdk:"file_format"`
	Size          types.Int64                         `tfsdk:"size"`
	UseIOThread   types.Bool                          `tfsdk:"use_iothread"`
	SpeedLimits   *VirtualMachineDiskSpeedLimitsModel `tfsdk:"speed_limits"`
	InterfaceType types.String                        `tfsdk:"interface_type"`
	SSDEmulation  types.Bool                          `tfsdk:"ssd_emulation"`
	Position      types.Int64                         `tfsdk:"position"`
	Discard       types.Bool                          `tfsdk:"discard"`
	Name          types.String                        `tfsdk:"name"`
}

type VirtualMachineDiskSetType

type VirtualMachineDiskSetType struct {
	types.SetType
}

func NewVirtualMachineDiskSetType

func NewVirtualMachineDiskSetType() VirtualMachineDiskSetType

func (VirtualMachineDiskSetType) Equal

func (VirtualMachineDiskSetType) ValueFromTerraform

func (c VirtualMachineDiskSetType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

type VirtualMachineDiskSetValue

type VirtualMachineDiskSetValue struct {
	types.Set
	Disks []VirtualMachineDiskModel
}

func VirtualMachineDiskToSetValue

func VirtualMachineDiskToSetValue(ctx context.Context, disks []vm.VirtualMachineDisk) VirtualMachineDiskSetValue

type VirtualMachineDiskSpeedLimitsModel

type VirtualMachineDiskSpeedLimitsModel struct {
	Read           types.Int64 `tfsdk:"read"`
	ReadBurstable  types.Int64 `tfsdk:"read_burstable"`
	Write          types.Int64 `tfsdk:"write"`
	WriteBurstable types.Int64 `tfsdk:"write_burstable"`
}

type VirtualMachineMemoryModel

type VirtualMachineMemoryModel struct {
	Dedicated types.Int64 `tfsdk:"dedicated"`
	Floating  types.Int64 `tfsdk:"floating"`
	Shared    types.Int64 `tfsdk:"shared"`
}

type VirtualMachineNetworkInterfaceModel

type VirtualMachineNetworkInterfaceModel struct {
	Position    types.Int64  `tfsdk:"position"`
	Bridge      types.String `tfsdk:"bridge"`
	Enabled     types.Bool   `tfsdk:"enabled"`
	UseFirewall types.Bool   `tfsdk:"use_firewall"`
	MacAddress  types.String `tfsdk:"mac_address"`
	Model       types.String `tfsdk:"model"`
	Vlan        types.Int64  `tfsdk:"vlan"`
	RateLimit   types.Int64  `tfsdk:"rate_limit"`
	MTU         types.Int64  `tfsdk:"mtu"`
}

type VirtualMachineNetworkInterfaceSetType

type VirtualMachineNetworkInterfaceSetType struct {
	types.SetType
}

func NewVirtualMachineNetworkInterfaceSetType

func NewVirtualMachineNetworkInterfaceSetType() VirtualMachineNetworkInterfaceSetType

func (VirtualMachineNetworkInterfaceSetType) Equal

func (VirtualMachineNetworkInterfaceSetType) ValueFromTerraform

type VirtualMachinePCIDeviceModel

type VirtualMachinePCIDeviceModel struct {
	Name       types.String `tfsdk:"name"`
	ID         types.String `tfsdk:"id"`
	PCIE       types.Bool   `tfsdk:"pcie"`
	MDEV       types.String `tfsdk:"mdev"`
	ROMBAR     types.Bool   `tfsdk:"rombar"`
	ROMFile    types.String `tfsdk:"rom_file"`
	PrimaryGPU types.Bool   `tfsdk:"primary_gpu"`
}

type VirtualMachinePCIDeviceSetType

type VirtualMachinePCIDeviceSetType struct {
	types.SetType
}

func NewVirtualMachinePCIDeviceSetType

func NewVirtualMachinePCIDeviceSetType() VirtualMachinePCIDeviceSetType

func (VirtualMachinePCIDeviceSetType) Equal

func (VirtualMachinePCIDeviceSetType) ValueFromTerraform

func (c VirtualMachinePCIDeviceSetType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

type VirtualMachinePCIDeviceSetValue

type VirtualMachinePCIDeviceSetValue struct {
	types.Set
	PCIDevices []VirtualMachinePCIDeviceModel
}

Jump to

Keyboard shortcuts

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