Documentation
¶
Index ¶
- func NewRulesDataSource() datasource.DataSource
- type OSInfoModel
- type OsVersionModel
- type RuleModel
- type RulesDataSource
- func (d *RulesDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, ...)
- func (d *RulesDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, ...)
- func (d *RulesDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
- func (d *RulesDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, ...)
- type RulesDataSourceModel
- type SourceModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRulesDataSource ¶
func NewRulesDataSource() datasource.DataSource
NewRulesDataSource returns a new instance of RulesDataSource.
Types ¶
type OSInfoModel ¶
type OSInfoModel struct {
OSType types.String `tfsdk:"os_type"`
OSVersion types.Int64 `tfsdk:"os_version"`
ManagementType types.String `tfsdk:"management_type"`
}
OSInfoModel represents supported OS information for a rule.
type OsVersionModel ¶
type OsVersionModel struct {
OsType types.String `tfsdk:"os_type"`
OsVersion types.Int64 `tfsdk:"os_version"`
}
OsVersionModel represents an operating-system type and major version pair.
type RuleModel ¶
type RuleModel struct {
ID types.String `tfsdk:"id"`
SectionName types.String `tfsdk:"section_name"`
Enabled types.Bool `tfsdk:"enabled"`
Title types.String `tfsdk:"title"`
Description types.String `tfsdk:"description"`
References []types.String `tfsdk:"references"`
ODVValue types.String `tfsdk:"odv_value"`
ODVHint types.String `tfsdk:"odv_hint"`
ODVPlaceholder types.String `tfsdk:"odv_placeholder"`
ODVType types.String `tfsdk:"odv_type"`
ODVValidationMin types.Int64 `tfsdk:"odv_validation_min"`
ODVValidationMax types.Int64 `tfsdk:"odv_validation_max"`
ODVValidationEnumValues []types.String `tfsdk:"odv_validation_enum_values"`
ODVValidationRegex types.String `tfsdk:"odv_validation_regex"`
SupportedOS []OSInfoModel `tfsdk:"supported_os"`
OSSpecificDefaults types.Map `tfsdk:"os_specific_defaults"`
DependsOn []types.String `tfsdk:"depends_on"`
Reportable types.Bool `tfsdk:"reportable"`
SmartCard types.Bool `tfsdk:"smart_card"`
}
RuleModel represents a rule in the data source, including ODV and computed fields.
type RulesDataSource ¶
type RulesDataSource struct {
// contains filtered or unexported fields
}
RulesDataSource implements the Terraform data source for mSCP rules.
func (*RulesDataSource) Configure ¶
func (d *RulesDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse)
Configure sets up the API client for the data source from the provider configuration.
func (*RulesDataSource) Metadata ¶
func (d *RulesDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse)
Metadata sets the data source type name for the Terraform provider.
func (*RulesDataSource) Read ¶
func (d *RulesDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
Read implements datasource.DataSource for RulesDataSource. It fetches the list of rules from the API and sets the state.
func (*RulesDataSource) Schema ¶
func (d *RulesDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse)
Schema sets the Terraform schema for the data source.
type RulesDataSourceModel ¶
type RulesDataSourceModel struct {
BaselineID types.String `tfsdk:"baseline_id"`
Sources []SourceModel `tfsdk:"sources"`
AvailableOsVersions []OsVersionModel `tfsdk:"available_os_versions"`
Rules []RuleModel `tfsdk:"rules"`
Timeouts timeouts.Value `tfsdk:"timeouts"`
}
RulesDataSourceModel represents the Terraform data source model for mSCP rules.