hostgroups

package
v0.0.67 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: MPL-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HgDynamic    = "dynamic"
	HgStatic     = "static"
	HgStaticByID = "staticByID"
)

Functions

func AssignAssignmentRule added in v0.0.30

func AssignAssignmentRule(
	ctx context.Context,
	assignmentRule string,
	config *HostGroupResourceModel,
) diag.Diagnostics

AssignAssignmentRule takes an assignment_rule from the API and assigns it to the correct attribute.

func ConvertHostGroupsToList added in v0.0.45

func ConvertHostGroupsToList(
	ctx context.Context,
	groups []*models.HostGroupsHostGroupV1,
) (basetypes.ListValue, diag.Diagnostics)

ConvertHostGroupsToSet converts []*models.HostGroupsHostGroupV1 to a Terraform list of host group IDs. The returned types.ListValue will never be null.

func ConvertHostGroupsToSet added in v0.0.23

func ConvertHostGroupsToSet(
	ctx context.Context,
	groups []*models.HostGroupsHostGroupV1,
) (basetypes.SetValue, diag.Diagnostics)

ConvertHostGroupsToSet converts []*models.HostGroupsHostGroupV1 to a Terraform set of host group IDs. The returned types.SetValue will never be null.

func GenerateAssignmentRule added in v0.0.30

func GenerateAssignmentRule(
	ctx context.Context,
	config HostGroupResourceModel,
) (string, diag.Diagnostics)

GenerateAssignmentRule returns a valid assignment rule based on the host group type.

func NewHostGroupResource added in v0.0.30

func NewHostGroupResource() resource.Resource

NewHostGroupResource is a helper function to simplify the provider implementation.

func RegisterSweepers added in v0.0.62

func RegisterSweepers()

Types

type HostGroupAction

type HostGroupAction int

HostGroupAction action for host group action api.

const (
	RemoveHostGroup HostGroupAction = iota
	AddHostGroup
)

func (HostGroupAction) String

func (h HostGroupAction) String() string

String convert HostGroupAction to string value the api accepts.

type HostGroupResourceModel added in v0.0.30

type HostGroupResourceModel struct {
	ID             types.String `tfsdk:"id"`
	Name           types.String `tfsdk:"name"`
	AssignmentRule types.String `tfsdk:"assignment_rule"`
	Hostnames      types.Set    `tfsdk:"hostnames"`
	HostIDs        types.Set    `tfsdk:"host_ids"`
	Description    types.String `tfsdk:"description"`
	GroupType      types.String `tfsdk:"type"`
	LastUpdated    types.String `tfsdk:"last_updated"`
}

HostGroupResourceModel maps the resource schema data.

Jump to

Keyboard shortcuts

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