Documentation ¶
Index ¶
- func New(version string) func() provider.Provider
- func NewSubnetResource() resource.Resource
- func NewSubnetsResource() resource.Resource
- type NetcalcProvider
- func (p *NetcalcProvider) Configure(ctx context.Context, req provider.ConfigureRequest, ...)
- func (p *NetcalcProvider) DataSources(ctx context.Context) []func() datasource.DataSource
- func (p *NetcalcProvider) Metadata(ctx context.Context, req provider.MetadataRequest, ...)
- func (p *NetcalcProvider) Resources(ctx context.Context) []func() resource.Resource
- func (p *NetcalcProvider) Schema(ctx context.Context, req provider.SchemaRequest, resp *provider.SchemaResponse)
- type SubnetCalculator
- type SubnetCalculatorProviderModel
- type SubnetResource
- func (r *SubnetResource) Configure(ctx context.Context, req resource.ConfigureRequest, ...)
- func (r *SubnetResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *SubnetResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *SubnetResource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r *SubnetResource) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- func (r *SubnetResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *SubnetResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *SubnetResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- type SubnetResourceModel
- type SubnetsResource
- func (r *SubnetsResource) AvailableCIDRBlocksNoLongerContainsResourceCIDR(ctx context.Context, req planmodifier.SetRequest, ...)
- func (r *SubnetsResource) Configure(ctx context.Context, req resource.ConfigureRequest, ...)
- func (r *SubnetsResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *SubnetsResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *SubnetsResource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r *SubnetsResource) LoadCIDRBlocks(ctx context.Context, s SubnetsResourceModel, calculator *subnet.Calculator, ...) mode
- func (r *SubnetsResource) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- func (r *SubnetsResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *SubnetsResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *SubnetsResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- type SubnetsResourceModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSubnetResource ¶
func NewSubnetsResource ¶ added in v0.1.0
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 (p *NetcalcProvider) Configure(ctx context.Context, req provider.ConfigureRequest, resp *provider.ConfigureResponse)
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 (p *NetcalcProvider) Metadata(ctx context.Context, req provider.MetadataRequest, resp *provider.MetadataResponse)
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
func (p *NetcalcProvider) Schema(ctx context.Context, req provider.SchemaRequest, resp *provider.SchemaResponse)
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 (r *SubnetResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
func (*SubnetResource) Create ¶
func (r *SubnetResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
func (*SubnetResource) Delete ¶
func (r *SubnetResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
func (*SubnetResource) ImportState ¶
func (r *SubnetResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
func (*SubnetResource) Metadata ¶
func (r *SubnetResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
func (*SubnetResource) Read ¶
func (r *SubnetResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
func (*SubnetResource) Schema ¶
func (r *SubnetResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
func (*SubnetResource) Update ¶
func (r *SubnetResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
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 (r *SubnetsResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
func (*SubnetsResource) Create ¶ added in v0.1.0
func (r *SubnetsResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
func (*SubnetsResource) Delete ¶ added in v0.1.0
func (r *SubnetsResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
func (*SubnetsResource) ImportState ¶ added in v0.1.0
func (r *SubnetsResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
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 (r *SubnetsResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
func (*SubnetsResource) Read ¶ added in v0.1.0
func (r *SubnetsResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
func (*SubnetsResource) Schema ¶ added in v0.1.0
func (r *SubnetsResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
func (*SubnetsResource) Update ¶ added in v0.1.0
func (r *SubnetsResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
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.
Click to show internal directories.
Click to hide internal directories.