Documentation
¶
Index ¶
- Variables
- func AssignAssignmentRule(ctx context.Context, assignmentRule string, config *HostGroupResourceModel) diag.Diagnostics
- func ConvertHostGroupsToList(ctx context.Context, groups []*models.HostGroupsHostGroupV1) (basetypes.ListValue, diag.Diagnostics)
- func ConvertHostGroupsToSet(ctx context.Context, groups []*models.HostGroupsHostGroupV1) (basetypes.SetValue, diag.Diagnostics)
- func GenerateAssignmentRule(ctx context.Context, config HostGroupResourceModel) (string, diag.Diagnostics)
- func NewHostGroupResource() resource.Resource
- func RegisterSweepers()
- type HostGroupAction
- type HostGroupResourceModel
Constants ¶
This section is empty.
Variables ¶
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
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.