ha

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: 27 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHAGroupDataSource

func NewHAGroupDataSource() datasource.DataSource

NewHAGroupDataSource is a helper function to simplify the provider implementation.

func NewHAGroupResource

func NewHAGroupResource() resource.Resource

NewHAGroupResource creates a new resource for managing Linux Bridge network interfaces.

func NewHAGroupsDataSource

func NewHAGroupsDataSource() datasource.DataSource

NewHAGroupsDataSource is a helper function to simplify the provider implementation.

func NewHAResourceDataSource

func NewHAResourceDataSource() datasource.DataSource

NewHAResourceDataSource is a helper function to simplify the provider implementation.

func NewHAResourceResource

func NewHAResourceResource() resource.Resource

NewHAResourceResource returns a new resource for managing High Availability resources.

func NewHAResourcesDataSource

func NewHAResourcesDataSource() datasource.DataSource

NewHAResourcesDataSource is a helper function to simplify the provider implementation.

Types

type GroupModel

type GroupModel struct {
	ID         types.String `tfsdk:"id"`          // Identifier used by Terraform
	Group      types.String `tfsdk:"group"`       // HA group name
	Comment    types.String `tfsdk:"comment"`     // Comment, if present
	Nodes      types.Map    `tfsdk:"nodes"`       // Map of member nodes associated with their priorities
	NoFailback types.Bool   `tfsdk:"no_failback"` // Flag that disables failback
	Restricted types.Bool   `tfsdk:"restricted"`  // Flag that prevents execution on other member nodes
}

GroupModel is the model used to represent a High Availability group.

func (*GroupModel) ImportFromAPI

func (m *GroupModel) ImportFromAPI(group hagroups.HAGroupGetResponseData) diag.Diagnostics

ImportFromAPI imports the contents of a HA group model from the API's response data.

type ResourceModel

type ResourceModel struct {
	// The Terraform resource identifier
	ID types.String `tfsdk:"id"`
	// The Proxmox HA resource identifier
	ResourceID types.String `tfsdk:"resource_id"`
	// The type of HA resources to fetch. If unset, all resources will be fetched.
	Type types.String `tfsdk:"type"`
	// The desired state of the resource.
	State types.String `tfsdk:"state"`
	// The comment associated with this resource.
	Comment types.String `tfsdk:"comment"`
	// The identifier of the High Availability group this resource is a member of.
	Group types.String `tfsdk:"group"`
	// The maximal number of relocation attempts.
	MaxRelocate types.Int64 `tfsdk:"max_relocate"`
	// The maximal number of restart attempts.
	MaxRestart types.Int64 `tfsdk:"max_restart"`
}

ResourceModel maps the schema data for the High Availability resource data source.

func (*ResourceModel) ImportFromAPI

func (d *ResourceModel) ImportFromAPI(data *haresources.HAResourceGetResponseData)

ImportFromAPI imports the contents of a HA resource model from the API's response data.

func (*ResourceModel) ToCreateRequest

ToCreateRequest builds the request data structure for creating a new HA resource.

func (*ResourceModel) ToUpdateRequest

ToUpdateRequest builds the request data structure for updating an existing HA resource.

Jump to

Keyboard shortcuts

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