cpu

package
v0.62.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: MPL-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataSourceSchema

func DataSourceSchema() schema.Attribute

DataSourceSchema defines the schema for the CPU datasource.

func FillCreateBody

func FillCreateBody(ctx context.Context, planValue Value, body *vms.CreateRequestBody, diags *diag.Diagnostics)

FillCreateBody fills the CreateRequestBody with the CPU settings from the Value.

In the 'create' context, v is the plan.

func FillUpdateBody

func FillUpdateBody(
	ctx context.Context,
	planValue, stateValue Value,
	updateBody *vms.UpdateRequestBody,
	isClone bool,
	diags *diag.Diagnostics,
)

FillUpdateBody fills the UpdateRequestBody with the CPU settings from the Value.

In the 'update' context, v is the plan and stateValue is the current state.

func ResourceSchema

func ResourceSchema() schema.Attribute

ResourceSchema defines the schema for the CPU resource.

Types

type Model

type Model struct {
	Affinity     types.String `tfsdk:"affinity"`
	Architecture types.String `tfsdk:"architecture"`
	Cores        types.Int64  `tfsdk:"cores"`
	Flags        types.Set    `tfsdk:"flags"`
	Hotplugged   types.Int64  `tfsdk:"hotplugged"`
	Limit        types.Int64  `tfsdk:"limit"`
	Numa         types.Bool   `tfsdk:"numa"`
	Sockets      types.Int64  `tfsdk:"sockets"`
	Type         types.String `tfsdk:"type"`
	Units        types.Int64  `tfsdk:"units"`
}

Model represents the CPU model.

type Value

type Value = types.Object

Value represents the type for CPU settings.

func NewValue

func NewValue(ctx context.Context, config *vms.GetResponseData, diags *diag.Diagnostics) Value

NewValue returns a new Value with the given CPU settings from the PVE API.

Jump to

Keyboard shortcuts

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