network

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: MPL-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNetworkAclResource added in v0.1.3

func NewNetworkAclResource() resource.Resource

func NewNetworkForwardResource added in v0.1.3

func NewNetworkForwardResource() resource.Resource

func NewNetworkLBResource

func NewNetworkLBResource() resource.Resource

NewNetworkLBResource returns a new network load balancer resource.

func NewNetworkResource

func NewNetworkResource() resource.Resource

NewNetworkResource returns a new network resource.

func NewNetworkZoneRecordResource

func NewNetworkZoneRecordResource() resource.Resource

NewNetworkZoneRecordResource returns a new network zone record resource.

func NewNetworkZoneResource

func NewNetworkZoneResource() resource.Resource

NewNetworkZoneResource returns a new network zone resource.

func ToLBBackendList

func ToLBBackendList(ctx context.Context, backendsSet types.Set) ([]api.NetworkLoadBalancerBackend, diag.Diagnostics)

ToLBBackendList converts network LB backend from types.Set into list of API backends.

func ToLBBackendSetType

func ToLBBackendSetType(ctx context.Context, backends []api.NetworkLoadBalancerBackend) (types.Set, diag.Diagnostics)

ToLBBackendList converts list of API network LB backends into types.Set.

func ToLBPortList

func ToLBPortList(ctx context.Context, portSet types.Set) ([]api.NetworkLoadBalancerPort, diag.Diagnostics)

ToLBPortList converts network LB backend from types.Set into list of API ports.

func ToLBPortSetType

func ToLBPortSetType(ctx context.Context, ports []api.NetworkLoadBalancerPort) (types.Set, diag.Diagnostics)

ToLBPortList converts list of API network LB ports into types.Set.

func ToNetworkAclRules added in v0.1.3

func ToNetworkAclRules(ctx context.Context, aclRuleList types.Set) ([]api.NetworkACLRule, diag.Diagnostics)

func ToNetworkAclRulesListType added in v0.1.3

func ToNetworkAclRulesListType(networkACLRules []api.NetworkACLRule) (types.Set, diag.Diagnostics)

func ToNetworkForwardPortList added in v0.1.3

func ToNetworkForwardPortList(ctx context.Context, portsSet types.Set) ([]api.NetworkForwardPort, diag.Diagnostics)

func ToNetworkForwardPortSetType added in v0.1.3

func ToNetworkForwardPortSetType(ctx context.Context, ports []api.NetworkForwardPort) (types.Set, diag.Diagnostics)

func ToZoneRecordEntryList

func ToZoneRecordEntryList(ctx context.Context, entrySet types.Set) ([]api.NetworkZoneRecordEntry, diag.Diagnostics)

ToZoneRecordMap converts network zone record of type types.Map into []IncusNetworkZoneEntryModel.

func ToZoneRecordEntrySetType

func ToZoneRecordEntrySetType(ctx context.Context, entries []api.NetworkZoneRecordEntry) (types.Set, diag.Diagnostics)

ToZoneRecordEntrySetType converts list of network zone records into set of type types.Set.

Types

type IncusNetworkLBBackendModel

type IncusNetworkLBBackendModel struct {
	Name          types.String `tfsdk:"name"`
	Description   types.String `tfsdk:"description"`
	TargetAddress types.String `tfsdk:"target_address"`
	TargetPort    types.String `tfsdk:"target_port"`
}

type IncusNetworkLBResource

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

IncusNetworkLBResource represent Incus network load balancer resource.

func (*IncusNetworkLBResource) Configure

func (IncusNetworkLBResource) Create

func (IncusNetworkLBResource) Delete

func (IncusNetworkLBResource) Metadata

func (IncusNetworkLBResource) Read

func (IncusNetworkLBResource) Schema

func (IncusNetworkLBResource) SyncState

func (r IncusNetworkLBResource) SyncState(ctx context.Context, tfState *tfsdk.State, server incus.InstanceServer, m NetworkLBModel) diag.Diagnostics

SyncState fetches the server's current state for an network load balancer and updates the provided model. It then applies this updated model as the new state in Terraform.

func (IncusNetworkLBResource) Update

type NetworkAclModel added in v0.1.3

type NetworkAclModel struct {
	Name        types.String `tfsdk:"name"`
	Description types.String `tfsdk:"description"`
	Project     types.String `tfsdk:"project"`
	Remote      types.String `tfsdk:"remote"`
	Config      types.Map    `tfsdk:"config"`
	Egress      types.Set    `tfsdk:"egress"`
	Ingress     types.Set    `tfsdk:"ingress"`
}

NetworkAclModel resource data model that matches the schema.

type NetworkAclResource added in v0.1.3

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

NetworkAclResource represent Incus network ACL resource.

func (*NetworkAclResource) Configure added in v0.1.3

func (*NetworkAclResource) Create added in v0.1.3

func (*NetworkAclResource) Delete added in v0.1.3

func (*NetworkAclResource) ImportState added in v0.1.3

func (*NetworkAclResource) Metadata added in v0.1.3

func (*NetworkAclResource) Read added in v0.1.3

func (*NetworkAclResource) Schema added in v0.1.3

func (*NetworkAclResource) SyncState added in v0.1.3

func (r *NetworkAclResource) SyncState(ctx context.Context, tfState *tfsdk.State, server incus.InstanceServer, m NetworkAclModel) diag.Diagnostics

func (*NetworkAclResource) Update added in v0.1.3

type NetworkAclRuleModel added in v0.1.3

type NetworkAclRuleModel struct {
	Action          types.String `tfsdk:"action"`
	Destination     types.String `tfsdk:"destination"`
	DestinationPort types.String `tfsdk:"destination_port"`
	Protocol        types.String `tfsdk:"protocol"`
	Description     types.String `tfsdk:"description"`
	State           types.String `tfsdk:"state"`
	Source          types.String `tfsdk:"source"`
	ICMPType        types.String `tfsdk:"icmp_type"`
	ICMPCode        types.String `tfsdk:"icmp_code"`
}

NetworkAclRuleModel resource data model that matches the schema.

type NetworkForwardModel added in v0.1.3

type NetworkForwardModel struct {
	Network       types.String `tfsdk:"network"`
	ListenAddress types.String `tfsdk:"listen_address"`
	Ports         types.Set    `tfsdk:"ports"`
	Description   types.String `tfsdk:"description"`
	Project       types.String `tfsdk:"project"`
	Remote        types.String `tfsdk:"remote"`
	Config        types.Map    `tfsdk:"config"`
}

NetworkForwardModel resource data model that matches the schema.

type NetworkForwardPortModel added in v0.1.3

type NetworkForwardPortModel struct {
	Description   types.String `tfsdk:"description"`
	Protocol      types.String `tfsdk:"protocol"`
	ListenPort    types.String `tfsdk:"listen_port"`
	TargetPort    types.String `tfsdk:"target_port"`
	TargetAddress types.String `tfsdk:"target_address"`
}

NetworkForwardModel resource data model that matches the schema.

type NetworkForwardResource added in v0.1.3

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

NetworkForwardResource represent network forward resource.

func (*NetworkForwardResource) Configure added in v0.1.3

func (*NetworkForwardResource) Create added in v0.1.3

func (*NetworkForwardResource) Delete added in v0.1.3

func (*NetworkForwardResource) ImportState added in v0.1.3

func (*NetworkForwardResource) Metadata added in v0.1.3

func (*NetworkForwardResource) Read added in v0.1.3

func (*NetworkForwardResource) Schema added in v0.1.3

func (*NetworkForwardResource) SyncState added in v0.1.3

func (r *NetworkForwardResource) SyncState(ctx context.Context, tfState *tfsdk.State, server incus.InstanceServer, m NetworkForwardModel) diag.Diagnostics

func (*NetworkForwardResource) Update added in v0.1.3

type NetworkLBModel

type NetworkLBModel struct {
	Network       types.String `tfsdk:"network"`
	ListenAddress types.String `tfsdk:"listen_address"`
	Ports         types.Set    `tfsdk:"port"`
	Backends      types.Set    `tfsdk:"backend"`
	Description   types.String `tfsdk:"description"`
	Project       types.String `tfsdk:"project"`
	Remote        types.String `tfsdk:"remote"`
	Config        types.Map    `tfsdk:"config"`
}

NetworkLBModel resource data model that matches the schema.

type NetworkLBPortModel

type NetworkLBPortModel struct {
	Description   types.String `tfsdk:"description"`
	Protocol      types.String `tfsdk:"protocol"`
	ListenPort    types.String `tfsdk:"listen_port"`
	TargetBackend types.Set    `tfsdk:"target_backend"`
}

type NetworkModel

type NetworkModel struct {
	Name        types.String `tfsdk:"name"`
	Description types.String `tfsdk:"description"`
	Type        types.String `tfsdk:"type"`
	Project     types.String `tfsdk:"project"`
	Remote      types.String `tfsdk:"remote"`
	Target      types.String `tfsdk:"target"`
	Managed     types.Bool   `tfsdk:"managed"`
	Config      types.Map    `tfsdk:"config"`
}

NetworkModel resource data model that matches the schema.

func (NetworkModel) ComputedKeys

func (_ NetworkModel) ComputedKeys() []string

ComputedKeys returns list of computed Incus config keys.

type NetworkResource

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

NetworkResource represent Incus network resource.

func (*NetworkResource) Configure

func (NetworkResource) Create

func (NetworkResource) Delete

func (NetworkResource) ImportState

func (NetworkResource) Metadata

Metadata for network resource.

func (NetworkResource) Read

func (NetworkResource) Schema

Schema for network resource.

func (NetworkResource) SyncState

func (r NetworkResource) SyncState(ctx context.Context, tfState *tfsdk.State, server incus.InstanceServer, m NetworkModel) diag.Diagnostics

SyncState fetches the server's current state for a network and updates the provided model. It then applies this updated model as the new state in Terraform.

func (NetworkResource) Update

type NetworkZoneModel

type NetworkZoneModel struct {
	Name        types.String `tfsdk:"name"`
	Description types.String `tfsdk:"description"`
	Project     types.String `tfsdk:"project"`
	Remote      types.String `tfsdk:"remote"`
	Config      types.Map    `tfsdk:"config"`
}

NetworkZoneModel resource data model that matches the schema.

type NetworkZoneRecordEntryModel

type NetworkZoneRecordEntryModel struct {
	Type  types.String `tfsdk:"type"`
	Value types.String `tfsdk:"value"`
	TTL   types.Int64  `tfsdk:"ttl"`
}

type NetworkZoneRecordModel

type NetworkZoneRecordModel struct {
	Name        types.String `tfsdk:"name"`
	Zone        types.String `tfsdk:"zone"`
	Description types.String `tfsdk:"description"`
	Entries     types.Set    `tfsdk:"entry"`
	Project     types.String `tfsdk:"project"`
	Remote      types.String `tfsdk:"remote"`
	Config      types.Map    `tfsdk:"config"`
}

NetworkZoneRecordModel resource data model that matches the schema.

type NetworkZoneRecordResource

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

NetworkZoneRecordResource represent Incus network zone record resource.

func (*NetworkZoneRecordResource) Configure

func (NetworkZoneRecordResource) Create

func (NetworkZoneRecordResource) Delete

func (NetworkZoneRecordResource) ImportState

func (NetworkZoneRecordResource) Metadata

func (NetworkZoneRecordResource) Read

func (NetworkZoneRecordResource) Schema

func (NetworkZoneRecordResource) SyncState

func (r NetworkZoneRecordResource) SyncState(ctx context.Context, tfState *tfsdk.State, server incus.InstanceServer, m NetworkZoneRecordModel) diag.Diagnostics

SyncState fetches the server's current state for a network zone record and updates the provided model. It then applies this updated model as the new state in Terraform.

func (NetworkZoneRecordResource) Update

type NetworkZoneResource

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

NetworkZoneResource represent Incus network zone resource.

func (*NetworkZoneResource) Configure

func (NetworkZoneResource) Create

func (NetworkZoneResource) Delete

func (NetworkZoneResource) ImportState

func (NetworkZoneResource) Metadata

func (NetworkZoneResource) Read

func (NetworkZoneResource) Schema

func (NetworkZoneResource) SyncState

func (r NetworkZoneResource) SyncState(ctx context.Context, tfState *tfsdk.State, server incus.InstanceServer, m NetworkZoneModel) diag.Diagnostics

SyncState fetches the server's current state for a network zone and updates the provided model. It then applies this updated model as the new state in Terraform.

func (NetworkZoneResource) Update

Jump to

Keyboard shortcuts

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