schemas

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DiskObjectDataSourceSchema = dschema.NestedAttributeObject{
	Attributes: map[string]dschema.Attribute{
		"storage": dschema.StringAttribute{
			Computed:    true,
			Description: "The storage the disk is on.",
		},
		"file_format": dschema.StringAttribute{
			Computed:    true,
			Description: "The file format of the disk.",
		},
		"size": dschema.Int64Attribute{
			Computed:    true,
			Description: "The size of the disk in GiB.",
		},
		"use_iothread": dschema.BoolAttribute{
			Computed:    true,
			Description: "Whether to use an iothread for the disk.",
		},
		"name": dschema.StringAttribute{
			Computed:    true,
			Description: "The disks generated name",
		},
		"speed_limits": dschema.SingleNestedAttribute{
			Computed:    true,
			Description: "The speed limits of the disk. If not set, no speed limitations are applied.",
			Attributes: map[string]dschema.Attribute{
				"read": dschema.Int64Attribute{
					Computed:    true,
					Description: "The read speed limit in bytes per second.",
				},
				"write": dschema.Int64Attribute{
					Computed:    true,
					Description: "The write speed limit in bytes per second.",
				},
				"write_burstable": dschema.Int64Attribute{
					Computed:    true,
					Description: "The write burstable speed limit in bytes per second.",
				},
				"read_burstable": dschema.Int64Attribute{
					Computed:    true,
					Description: "The read burstable speed limit in bytes per second.",
				},
			},
		},
		"interface_type": dschema.StringAttribute{
			Computed:    true,
			Description: "The type of the disk.",
		},
		"ssd_emulation": dschema.BoolAttribute{
			Computed:    true,
			Description: "Whether to use SSD emulation. conflicts with virtio disk type.",
		},
		"position": dschema.Int64Attribute{
			Computed:    true,
			Description: "The position of the disk. (0, 1, 2, etc.) This is combined with the `interface_type` to determine the disk name.",
		},
		"discard": dschema.BoolAttribute{
			Computed:    true,
			Description: "Whether the disk has discard enabled.",
		},
	},
}
View Source
var DiskObjectSchema = schema.NestedAttributeObject{
	PlanModifiers: []planmodifier.Object{
		objectplanmodifier.UseStateForUnknown(),
	},
	Attributes: map[string]schema.Attribute{
		"storage": schema.StringAttribute{
			Required:    true,
			Description: "The storage the disk is on.",
		},
		"file_format": schema.StringAttribute{
			Optional:    true,
			Description: "The file format of the disk.",
			Validators: []validator.String{
				stringvalidator.OneOf(
					"raw",
					"qcow2",
					"vmdk",
				),
			},
		},
		"size": schema.Int64Attribute{
			Required:    true,
			Description: "The size of the disk in GiB.",
		},
		"use_iothread": schema.BoolAttribute{
			Optional:    true,
			Computed:    true,
			Description: "Whether to use an iothread for the disk.",
			PlanModifiers: []planmodifier.Bool{
				defaults.DefaultBool(false),
				boolplanmodifier.UseStateForUnknown(),
			},
		},
		"speed_limits": schema.SingleNestedAttribute{
			Optional:    true,
			Description: "The speed limits of the disk. If not set, no speed limitations are applied.",
			Attributes: map[string]schema.Attribute{
				"read": schema.Int64Attribute{
					Optional:    true,
					Description: "The read speed limit in bytes per second.",
				},
				"write": schema.Int64Attribute{
					Optional:    true,
					Description: "The write speed limit in bytes per second.",
				},
				"write_burstable": schema.Int64Attribute{
					Optional:    true,
					Description: "The write burstable speed limit in bytes per second.",
				},
				"read_burstable": schema.Int64Attribute{
					Optional:    true,
					Description: "The read burstable speed limit in bytes per second.",
				},
			},
		},
		"interface_type": schema.StringAttribute{
			Required:    true,
			Description: "The type of the disk.",
			Validators: []validator.String{
				stringvalidator.OneOf(
					"scsi",
					"sata",
					"virtio",
				),
			},
		},
		"name": schema.StringAttribute{
			Computed:    true,
			Description: "The disks generated name",
			PlanModifiers: []planmodifier.String{
				stringplanmodifier.UseStateForUnknown(),
			},
		},

		"ssd_emulation": schema.BoolAttribute{
			Computed:    true,
			Optional:    true,
			Description: "Whether to use SSD emulation. conflicts with virtio disk type.",
			PlanModifiers: []planmodifier.Bool{
				defaults.DefaultBool(false),
				boolplanmodifier.UseStateForUnknown(),
			},
		},
		"position": schema.Int64Attribute{
			Required:    true,
			Description: "The position of the disk. (0, 1, 2, etc.) This is combined with the `interface_type` to determine the disk name.",
		},
		"discard": schema.BoolAttribute{
			Computed:    true,
			Optional:    true,
			Description: "Whether the disk has discard enabled.",
			PlanModifiers: []planmodifier.Bool{
				defaults.DefaultBool(true),
				boolplanmodifier.UseStateForUnknown(),
			},
		},
	},
}
View Source
var NetworkInterfaceObjectDataSourceSchema = dschema.NestedAttributeObject{
	Attributes: map[string]dschema.Attribute{
		"bridge": dschema.StringAttribute{
			Computed:    true,
			Description: "The bridge the network interface is on.",
		},
		"enabled": dschema.BoolAttribute{
			Computed:    true,
			Description: "Whether the network interface is enabled.",
		},
		"use_firewall": dschema.BoolAttribute{
			Computed:    true,
			Description: "Whether the firewall for the network interface is enabled.",
		},
		"mac_address": dschema.StringAttribute{
			Computed:    true,
			Description: "The MAC address of the network interface.",
		},
		"model": dschema.StringAttribute{
			Computed:    true,
			Description: "The model of the network interface.",
		},
		"rate_limit": dschema.Int64Attribute{
			Computed:    true,
			Description: "The rate limit of the network interface in megabytes per second.",
		},
		"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).",
		},
		"vlan": dschema.Int64Attribute{
			Computed:    true,
			Description: "The VLAN tag of the network interface.",
		},
		"mtu": dschema.Int64Attribute{
			Computed:    true,
			Description: "The MTU of the network interface. Only valid for virtio.",
		},
	},
}
View Source
var NetworkInterfaceObjectSchema = schema.NestedAttributeObject{
	PlanModifiers: []planmodifier.Object{
		objectplanmodifier.UseStateForUnknown(),
	},
	Attributes: map[string]schema.Attribute{
		"bridge": schema.StringAttribute{
			Required:    true,
			Description: "The bridge the network interface is on.",
			Validators: []validator.String{
				stringvalidator.RegexMatches(regexp.MustCompile("vmbr[0-9]$"), "name must follow scheme `vmbr<n>`"),
			},
		},
		"enabled": schema.BoolAttribute{
			Optional:    true,
			Computed:    true,
			Description: "Whether the network interface is enabled.",
			PlanModifiers: []planmodifier.Bool{
				defaults.DefaultBool(true),
				boolplanmodifier.UseStateForUnknown(),
			},
		},
		"use_firewall": schema.BoolAttribute{
			Optional:    true,
			Computed:    true,
			Description: "Whether the firewall for the network interface is enabled.",
			PlanModifiers: []planmodifier.Bool{
				defaults.DefaultBool(false),
				boolplanmodifier.UseStateForUnknown(),
			},
		},
		"mac_address": schema.StringAttribute{
			Computed:    true,
			Optional:    true,
			Description: "The MAC address of the network interface.",
			Validators: []validator.String{
				stringvalidator.RegexMatches(regexp.MustCompile("^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$"), "must be a valid MAC address"),
			},
			PlanModifiers: []planmodifier.String{
				stringplanmodifier.UseStateForUnknown(),
			},
		},
		"model": schema.StringAttribute{
			Computed:    true,
			Optional:    true,
			Description: "The model of the network interface.",
			PlanModifiers: []planmodifier.String{
				defaults.DefaultString("virtio"),
				stringplanmodifier.UseStateForUnknown(),
			},
			Validators: []validator.String{
				stringvalidator.OneOf(
					"virtio",
					"e1000",
					"rtl8139",
					"vmxnet3",
				),
			},
		},
		"rate_limit": schema.Int64Attribute{
			Optional:    true,
			Description: "The rate limit of the network interface in megabytes per second.",
		},
		"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).",
		},
		"vlan": schema.Int64Attribute{
			Optional:    true,
			Description: "The VLAN tag of the network interface.",
		},
		"mtu": schema.Int64Attribute{
			Optional:    true,
			Description: "The MTU of the network interface. Only valid for virtio.",
		},
	},
}
View Source
var PCIDeviceObjectDataSourceSchema = dschema.NestedAttributeObject{
	Attributes: map[string]dschema.Attribute{
		"name": dschema.StringAttribute{
			Computed:    true,
			Description: "The device name of the PCI device.",
		},
		"id": dschema.StringAttribute{
			Computed:    true,
			Description: "The device ID of the PCI device.",
		},
		"pcie": dschema.BoolAttribute{
			Computed:    true,
			Description: "Whether the PCI device is PCIe.",
		},
		"primary_gpu": dschema.BoolAttribute{
			Computed:    true,
			Description: "Whether the PCI device is the primary GPU.",
		},
		"mdev": dschema.StringAttribute{
			Computed:    true,
			Description: "The mediated device name.",
		},
		"rombar": dschema.BoolAttribute{
			Computed:    true,
			Description: "Make the firmware room visible to the VM.",
		},
		"rom_file": dschema.StringAttribute{
			Computed:    true,
			Description: "The relative path to the ROM for the device.",
		},
	},
}
View Source
var PCIDeviceObjectSchema = schema.NestedAttributeObject{
	Attributes: map[string]schema.Attribute{
		"name": schema.StringAttribute{
			Required:    true,
			Description: "The device name of the PCI device.",
		},
		"id": schema.StringAttribute{
			Required:    true,
			Description: "The device ID of the PCI device.",
		},
		"pcie": schema.BoolAttribute{
			Optional:    true,
			Computed:    true,
			Description: "Whether the PCI device is PCIe.",
			PlanModifiers: []planmodifier.Bool{
				defaults.DefaultBool(false),
			},
		},
		"primary_gpu": schema.BoolAttribute{
			Optional:    true,
			Computed:    true,
			Description: "Whether the PCI device is the primary GPU.",
			PlanModifiers: []planmodifier.Bool{
				defaults.DefaultBool(false),
			},
		},
		"mdev": schema.StringAttribute{
			Optional:    true,
			Description: "The mediated device name.",
		},
		"rombar": schema.BoolAttribute{
			Optional:    true,
			Computed:    true,
			Description: "Make the firmware room visible to the VM.",
			PlanModifiers: []planmodifier.Bool{
				defaults.DefaultBool(true),
			},
		},
		"rom_file": schema.StringAttribute{
			Optional:    true,
			Description: "The relative path to the ROM for the device.",
		},
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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