Documentation
¶
Index ¶
- func NewHAGroupDataSource() datasource.DataSource
- func NewHAGroupResource() resource.Resource
- func NewHAGroupsDataSource() datasource.DataSource
- func NewHAResourceDataSource() datasource.DataSource
- func NewHAResourceResource() resource.Resource
- func NewHAResourcesDataSource() datasource.DataSource
- type GroupModel
- type ResourceModel
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 ¶
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 ¶
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 ¶
func (d *ResourceModel) ToCreateRequest(resID proxmoxtypes.HAResourceID) *haresources.HAResourceCreateRequestBody
ToCreateRequest builds the request data structure for creating a new HA resource.
func (*ResourceModel) ToUpdateRequest ¶
func (d *ResourceModel) ToUpdateRequest(state *ResourceModel) *haresources.HAResourceUpdateRequestBody
ToUpdateRequest builds the request data structure for updating an existing HA resource.