Documentation
¶
Overview ¶
Package network_segment implements the jamfplatform_pro_network_segment resource, data source, and list resource backed by the Jamf ProClassic networksegments API.
Index ¶
- func NewNetworkSegmentDataSource() datasource.DataSource
- func NewNetworkSegmentListResource() list.ListResource
- func NewNetworkSegmentResource() resource.Resource
- func NewNetworkSegmentsDataSource() datasource.DataSource
- type NetworkSegmentDataSource
- func (d *NetworkSegmentDataSource) ConfigValidators(ctx context.Context) []datasource.ConfigValidator
- func (d *NetworkSegmentDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, ...)
- func (d *NetworkSegmentDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, ...)
- func (d *NetworkSegmentDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
- func (d *NetworkSegmentDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, ...)
- type NetworkSegmentDataSourceModel
- type NetworkSegmentListResource
- func (r *NetworkSegmentListResource) Configure(ctx context.Context, req resource.ConfigureRequest, ...)
- func (r *NetworkSegmentListResource) List(ctx context.Context, req list.ListRequest, stream *list.ListResultsStream)
- func (r *NetworkSegmentListResource) ListResourceConfigSchema(ctx context.Context, req list.ListResourceSchemaRequest, ...)
- func (r *NetworkSegmentListResource) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- type NetworkSegmentListResourceModel
- type NetworkSegmentResource
- func (r *NetworkSegmentResource) Configure(ctx context.Context, req resource.ConfigureRequest, ...)
- func (r *NetworkSegmentResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *NetworkSegmentResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *NetworkSegmentResource) IdentitySchema(ctx context.Context, req resource.IdentitySchemaRequest, ...)
- func (r *NetworkSegmentResource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r *NetworkSegmentResource) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- func (r *NetworkSegmentResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, ...)
- func (r *NetworkSegmentResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *NetworkSegmentResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *NetworkSegmentResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- type NetworkSegmentResourceModel
- type NetworkSegmentsDataSource
- func (d *NetworkSegmentsDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, ...)
- func (d *NetworkSegmentsDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, ...)
- func (d *NetworkSegmentsDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
- func (d *NetworkSegmentsDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, ...)
- type NetworkSegmentsDataSourceModel
- type NetworkSegmentsDataSourceResultModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNetworkSegmentDataSource ¶
func NewNetworkSegmentDataSource() datasource.DataSource
NewNetworkSegmentDataSource returns a new instance of NetworkSegmentDataSource.
func NewNetworkSegmentListResource ¶
func NewNetworkSegmentListResource() list.ListResource
NewNetworkSegmentListResource returns a list resource for Jamf Pro network segment queries.
func NewNetworkSegmentResource ¶
NewNetworkSegmentResource returns a new instance of NetworkSegmentResource.
func NewNetworkSegmentsDataSource ¶
func NewNetworkSegmentsDataSource() datasource.DataSource
NewNetworkSegmentsDataSource returns a new instance of NetworkSegmentsDataSource.
Types ¶
type NetworkSegmentDataSource ¶
type NetworkSegmentDataSource struct {
// contains filtered or unexported fields
}
NetworkSegmentDataSource implements the Terraform data source for Jamf Pro network segments. The singular data source supports lookup by ID OR by name — exactly one of the two must be supplied.
func (*NetworkSegmentDataSource) ConfigValidators ¶
func (d *NetworkSegmentDataSource) ConfigValidators(ctx context.Context) []datasource.ConfigValidator
ConfigValidators enforces that exactly one of id / name is supplied.
func (*NetworkSegmentDataSource) Configure ¶
func (d *NetworkSegmentDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse)
Configure wires the Jamf ProClassic client into the data source via the shared providerdata.ConfigureProClassic helper.
func (*NetworkSegmentDataSource) Metadata ¶
func (d *NetworkSegmentDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse)
Metadata sets the data source type name for the Terraform provider.
func (*NetworkSegmentDataSource) Read ¶
func (d *NetworkSegmentDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
Read fetches a network segment by ID or by name and populates Terraform state.
func (*NetworkSegmentDataSource) Schema ¶
func (d *NetworkSegmentDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse)
Schema returns the data source schema.
type NetworkSegmentDataSourceModel ¶
type NetworkSegmentDataSourceModel struct {
ID types.String `tfsdk:"id"`
Name types.String `tfsdk:"name"`
StartingAddress types.String `tfsdk:"starting_address"`
EndingAddress types.String `tfsdk:"ending_address"`
Building types.String `tfsdk:"building"`
Department types.String `tfsdk:"department"`
OverrideBuildings types.Bool `tfsdk:"override_buildings"`
OverrideDepartments types.Bool `tfsdk:"override_departments"`
DistributionPoint types.String `tfsdk:"distribution_point"`
DistributionServer types.String `tfsdk:"distribution_server"`
SwuServer types.String `tfsdk:"swu_server"`
URL types.String `tfsdk:"url"`
Timeouts datasourceTimeouts.Value `tfsdk:"timeouts"`
}
NetworkSegmentDataSourceModel represents the Terraform data source model for a Jamf Pro network segment. Either id or name must be supplied (enforced by ExactlyOneOf at config validation).
type NetworkSegmentListResource ¶
type NetworkSegmentListResource struct {
// contains filtered or unexported fields
}
NetworkSegmentListResource implements Terraform query list support for Jamf Pro network segments. Classic /networksegments accepts no query parameters, so the optional `filter` block is applied client-side via filters.ApplyClassicFilter after the full list is fetched. The list-item type carries only id, name, starting_address, and ending_address, so IncludeResource hydrates each record with a singular GET rather than emitting nulls for the rest.
func (*NetworkSegmentListResource) Configure ¶
func (r *NetworkSegmentListResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
Configure wires the Jamf ProClassic client into the list resource via the shared providerdata.ConfigureProClassic helper.
func (*NetworkSegmentListResource) List ¶
func (r *NetworkSegmentListResource) List(ctx context.Context, req list.ListRequest, stream *list.ListResultsStream)
List executes the query and streams network segment identities back to Terraform.
func (*NetworkSegmentListResource) ListResourceConfigSchema ¶
func (r *NetworkSegmentListResource) ListResourceConfigSchema(ctx context.Context, req list.ListResourceSchemaRequest, resp *list.ListResourceSchemaResponse)
ListResourceConfigSchema describes the supported list filters.
func (*NetworkSegmentListResource) Metadata ¶
func (r *NetworkSegmentListResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
Metadata sets the list resource type name.
type NetworkSegmentListResourceModel ¶
type NetworkSegmentListResourceModel struct {
Filter *filters.ClassicFilterModel `tfsdk:"filter"`
Timeouts listtimeouts.Value `tfsdk:"timeouts"`
}
NetworkSegmentListResourceModel represents the config model for network segment list queries. Classic has no RSQL — the filter shape is the shared client-side substring block.
type NetworkSegmentResource ¶
type NetworkSegmentResource struct {
// contains filtered or unexported fields
}
NetworkSegmentResource implements the Terraform resource for Jamf ProClassic network segments.
func (*NetworkSegmentResource) Configure ¶
func (r *NetworkSegmentResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
Configure wires the Jamf ProClassic client into the resource via the shared providerdata.ConfigureProClassic helper.
func (*NetworkSegmentResource) Create ¶
func (r *NetworkSegmentResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
Create creates a new Jamf Pro network segment. Classic POSTs to id="0"; the server allocates the real integer ID and returns it in the response body.
func (*NetworkSegmentResource) Delete ¶
func (r *NetworkSegmentResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
Delete removes a Jamf Pro network segment.
func (*NetworkSegmentResource) IdentitySchema ¶
func (r *NetworkSegmentResource) IdentitySchema(ctx context.Context, req resource.IdentitySchemaRequest, resp *resource.IdentitySchemaResponse)
IdentitySchema defines the identifier used for import and list results.
func (*NetworkSegmentResource) ImportState ¶
func (r *NetworkSegmentResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
ImportState handles import by the Jamf Pro network segment ID.
func (*NetworkSegmentResource) Metadata ¶
func (r *NetworkSegmentResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
Metadata sets the resource type name for the Terraform provider.
func (*NetworkSegmentResource) ModifyPlan ¶ added in v1.7.0
func (r *NetworkSegmentResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse)
ModifyPlan reports a network segment name that another network segment already holds.
func (*NetworkSegmentResource) Read ¶
func (r *NetworkSegmentResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
Read refreshes the Terraform state with the latest network segment representation.
func (*NetworkSegmentResource) Schema ¶
func (r *NetworkSegmentResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
Schema returns the Terraform schema for the network segment resource.
func (*NetworkSegmentResource) Update ¶
func (r *NetworkSegmentResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
Update updates a Jamf Pro network segment. Classic UpdateNetworkSegmentByID returns 201 with an empty body — we must GET to refresh state.
type NetworkSegmentResourceModel ¶
type NetworkSegmentResourceModel struct {
ID types.String `tfsdk:"id"`
Name types.String `tfsdk:"name"`
StartingAddress types.String `tfsdk:"starting_address"`
EndingAddress types.String `tfsdk:"ending_address"`
Building types.String `tfsdk:"building"`
Department types.String `tfsdk:"department"`
OverrideBuildings types.Bool `tfsdk:"override_buildings"`
OverrideDepartments types.Bool `tfsdk:"override_departments"`
DistributionPoint types.String `tfsdk:"distribution_point"`
DistributionServer types.String `tfsdk:"distribution_server"`
SwuServer types.String `tfsdk:"swu_server"`
URL types.String `tfsdk:"url"`
Timeouts resourceTimeouts.Value `tfsdk:"timeouts"`
}
NetworkSegmentResourceModel represents the Terraform resource model for a Jamf Pro network segment.
type NetworkSegmentsDataSource ¶
type NetworkSegmentsDataSource struct {
// contains filtered or unexported fields
}
NetworkSegmentsDataSource implements the Terraform data source for Jamf Pro network segment searches.
func (*NetworkSegmentsDataSource) Configure ¶
func (d *NetworkSegmentsDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse)
Configure wires the Jamf ProClassic client into the data source via the shared providerdata.ConfigureProClassic helper.
func (*NetworkSegmentsDataSource) Metadata ¶
func (d *NetworkSegmentsDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse)
Metadata sets the data source type name for the Terraform provider.
func (*NetworkSegmentsDataSource) Read ¶
func (d *NetworkSegmentsDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
Read fetches network segments and populates state. Applies the optional client-side substring filter after the full list is retrieved.
func (*NetworkSegmentsDataSource) Schema ¶
func (d *NetworkSegmentsDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse)
Schema returns the plural data source schema. The nested object reflects exactly what the classic /networksegments list endpoint returns — id, name, and the IP range — and omits the per-item fields that require an extra GET per segment.
type NetworkSegmentsDataSourceModel ¶
type NetworkSegmentsDataSourceModel struct {
ID types.String `tfsdk:"id"`
NetworkSegments []NetworkSegmentsDataSourceResultModel `tfsdk:"network_segments"`
Filter *filters.ClassicFilterModel `tfsdk:"filter"`
Timeouts datasourceTimeouts.Value `tfsdk:"timeouts"`
}
NetworkSegmentsDataSourceModel represents the Terraform data source model for network segment searches.
type NetworkSegmentsDataSourceResultModel ¶
type NetworkSegmentsDataSourceResultModel struct {
ID types.String `tfsdk:"id"`
Name types.String `tfsdk:"name"`
StartingAddress types.String `tfsdk:"starting_address"`
EndingAddress types.String `tfsdk:"ending_address"`
}
NetworkSegmentsDataSourceResultModel represents a single network segment in the search results. Only the fields the classic list endpoint actually returns are exposed — id, name, and the IP range. Per-item fields beyond these require a singular data source lookup.