Help us shape the future of Go! Take the 2026 Go Developer Survey

network_segment

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MPL-2.0 Imports: 33 Imported by: 0

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

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

func NewNetworkSegmentResource() resource.Resource

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

ConfigValidators enforces that exactly one of id / name is supplied.

func (*NetworkSegmentDataSource) Configure

Configure wires the Jamf ProClassic client into the data source via the shared providerdata.ConfigureProClassic helper.

func (*NetworkSegmentDataSource) Metadata

Metadata sets the data source type name for the Terraform provider.

func (*NetworkSegmentDataSource) Read

Read fetches a network segment by ID or by name and populates Terraform state.

func (*NetworkSegmentDataSource) Schema

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

Configure wires the Jamf ProClassic client into the list resource via the shared providerdata.ConfigureProClassic helper.

func (*NetworkSegmentListResource) List

List executes the query and streams network segment identities back to Terraform.

func (*NetworkSegmentListResource) ListResourceConfigSchema

ListResourceConfigSchema describes the supported list filters.

func (*NetworkSegmentListResource) Metadata

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

Configure wires the Jamf ProClassic client into the resource via the shared providerdata.ConfigureProClassic helper.

func (*NetworkSegmentResource) Create

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

Delete removes a Jamf Pro network segment.

func (*NetworkSegmentResource) IdentitySchema

IdentitySchema defines the identifier used for import and list results.

func (*NetworkSegmentResource) ImportState

ImportState handles import by the Jamf Pro network segment ID.

func (*NetworkSegmentResource) Metadata

Metadata sets the resource type name for the Terraform provider.

func (*NetworkSegmentResource) ModifyPlan added in v1.7.0

ModifyPlan reports a network segment name that another network segment already holds.

func (*NetworkSegmentResource) Read

Read refreshes the Terraform state with the latest network segment representation.

func (*NetworkSegmentResource) Schema

Schema returns the Terraform schema for the network segment resource.

func (*NetworkSegmentResource) Update

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

Configure wires the Jamf ProClassic client into the data source via the shared providerdata.ConfigureProClassic helper.

func (*NetworkSegmentsDataSource) Metadata

Metadata sets the data source type name for the Terraform provider.

func (*NetworkSegmentsDataSource) Read

Read fetches network segments and populates state. Applies the optional client-side substring filter after the full list is retrieved.

func (*NetworkSegmentsDataSource) Schema

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.

Jump to

Keyboard shortcuts

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