provider

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: MPL-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(version string) func() provider.Provider

func NewSubnetResource

func NewSubnetResource() resource.Resource

func NewSubnetsResource added in v0.1.0

func NewSubnetsResource() resource.Resource

Types

type NetcalcProvider added in v0.1.0

type NetcalcProvider struct {
	// contains filtered or unexported fields
}

NetcalcProvider defines the provider implementation.

func (*NetcalcProvider) Configure added in v0.1.0

func (*NetcalcProvider) DataSources added in v0.1.0

func (p *NetcalcProvider) DataSources(ctx context.Context) []func() datasource.DataSource

func (*NetcalcProvider) Metadata added in v0.1.0

func (*NetcalcProvider) Resources added in v0.1.0

func (p *NetcalcProvider) Resources(ctx context.Context) []func() resource.Resource

func (*NetcalcProvider) Schema added in v0.1.0

type SubnetCalculator added in v0.3.0

type SubnetCalculator interface {
	AddPool(prefix netip.Prefix)
	AddAllocatedPrefix(prefix netip.Prefix)
	NextAvailableIPv4Subnet(numBits int) (netip.Prefix, error)
	NextAvailableIPv6Subnet(numBits int) (netip.Prefix, error)
	DeleteAllocatedPrefix(prefix netip.Prefix)
	PrefixInPools(prefix netip.Prefix) bool
}

type SubnetCalculatorProviderModel

type SubnetCalculatorProviderModel struct {
	PoolCIDRBlocks    types.List `tfsdk:"pool_cidr_blocks"`
	ClaimedCIDRBlocks types.List `tfsdk:"claimed_cidr_blocks"`
}

SubnetCalculatorProviderModel describes the provider data model.

type SubnetResource

type SubnetResource struct {
	// contains filtered or unexported fields
}

SubnetResource defines the resource implementation.

func (*SubnetResource) Configure

func (*SubnetResource) Create

func (*SubnetResource) Delete

func (*SubnetResource) ImportState

func (*SubnetResource) Metadata

func (*SubnetResource) Read

func (*SubnetResource) Schema

func (*SubnetResource) Update

type SubnetResourceModel

type SubnetResourceModel struct {
	IPFamily       types.String `tfsdk:"ip_family"`
	CIDRMaskLength types.Int64  `tfsdk:"cidr_mask_length"`
	CIDRBlock      types.String `tfsdk:"cidr_block"`
	ID             types.String `tfsdk:"id"`
}

SubnetResourceModel describes the resource data model.

type SubnetsResource added in v0.1.0

type SubnetsResource struct {
}

SubnetsResource defines the resource implementation.

func (*SubnetsResource) AvailableCIDRBlocksNoLongerContainsResourceCIDR added in v0.1.0

func (r *SubnetsResource) AvailableCIDRBlocksNoLongerContainsResourceCIDR(ctx context.Context, req planmodifier.SetRequest, resp *setplanmodifier.RequiresReplaceIfFuncResponse)

AvailableCIDRBlocksNoLongerContainsResourceCIDR checks the existing calculated CIDR block (if it exists in the current state) against the list of available CIDR blocks in the configuration. If the calculated CIDR no longer belongs to one of the available blocks, it will require replacement.

func (*SubnetsResource) Configure added in v0.1.0

func (*SubnetsResource) Create added in v0.1.0

func (*SubnetsResource) Delete added in v0.1.0

func (*SubnetsResource) ImportState added in v0.1.0

func (*SubnetsResource) LoadCIDRBlocks added in v0.1.0

func (r *SubnetsResource) LoadCIDRBlocks(ctx context.Context, s SubnetsResourceModel, calculator *subnet.Calculator, diagnostics *diag.Diagnostics) mode

func (*SubnetsResource) Metadata added in v0.1.0

func (*SubnetsResource) Read added in v0.1.0

func (*SubnetsResource) Schema added in v0.1.0

func (*SubnetsResource) Update added in v0.1.0

type SubnetsResourceModel added in v0.1.0

type SubnetsResourceModel struct {
	PoolCIDRBlocks     types.Set    `tfsdk:"pool_cidr_blocks"`
	ExistingCIDRBlocks types.Set    `tfsdk:"existing_cidr_blocks"`
	CIDRMaskLength     types.Int64  `tfsdk:"cidr_mask_length"`
	CIDRCount          types.Int64  `tfsdk:"cidr_count"`
	CIDRBlocks         types.List   `tfsdk:"cidr_blocks"`
	ID                 types.String `tfsdk:"id"`
}

SubnetsResourceModel describes the resource data model.

Jump to

Keyboard shortcuts

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