server

package
v1.61.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MPL-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PoweronActionType  = "hcloud_server_poweron"
	PoweroffActionType = "hcloud_server_poweroff"
	RebootActionType   = "hcloud_server_reboot"
	ResetActionType    = "hcloud_server_reset"
)
View Source
const (
	// DataSourceType is the type name of the Hetzner Cloud server resource.
	DataSourceType = "hcloud_server"

	// DataSourceListType is the type name to receive a list of Hetzner Cloud server resources.
	DataSourceListType = "hcloud_servers"
)
View Source
const ChangeDeprecatedServerTypeMessage = `Existing servers of that plan will ` +
	`continue to work as before and no action is required on your part. ` +
	`It is possible to migrate this Server to another Server Type by using ` +
	`the "hcloud server change-type" command.`
View Source
const NetworkResourceType = "hcloud_server_network"
View Source
const ResourceType = "hcloud_server"

ResourceType is the type name of the Hetzner Cloud Server resource.

Variables

This section is empty.

Functions

func ByID

func ByID(t *testing.T, srv *hcloud.Server) func(*hcloud.Client, int64) bool

ByID returns a function that obtains a server by its ID.

func DataSource added in v1.24.1

func DataSource() *schema.Resource

DataSource creates a new Terraform schema for the hcloud_server resource.

func DataSourceList added in v1.31.0

func DataSourceList() *schema.Resource

DataSourceList creates a new Terraform schema for the hcloud_servers resource.

func GetAPIResource added in v1.61.0

func GetAPIResource() testsupport.GetAPIResourceFunc[hcloud.Server]

GetAPIResource returns a testsupport.GetAPIResourceFunc for hcloud.Server.

func NewNetworkResource added in v1.56.0

func NewNetworkResource() resource.Resource

func NewPoweroffAction added in v1.61.0

func NewPoweroffAction() action.Action

func NewPoweronAction added in v1.61.0

func NewPoweronAction() action.Action

func NewRebootAction added in v1.61.0

func NewRebootAction() action.Action

func NewResetAction added in v1.61.0

func NewResetAction() action.Action

func Resource added in v1.24.1

func Resource() *schema.Resource

Resource creates a Terraform schema for the hcloud_server resource.

func ToPublicNetField added in v1.50.0

func ToPublicNetField[V int | bool](field map[string]interface{}, key string) (V, error)

Types

type AData added in v1.61.0

type AData struct {
	testtemplate.DataCommon

	Type     string
	ServerID string
}

AData defines the fields for the "testdata/a/hcloud_server" template.

func (*AData) TFID added in v1.61.0

func (d *AData) TFID() string

TFID returns the resource identifier.

type DData

type DData struct {
	testtemplate.DataCommon

	ServerID      string
	ServerName    string
	LabelSelector string
}

DData defines the fields for the "testdata/d/hcloud_server" template.

func (*DData) TFID

func (d *DData) TFID() string

TFID returns the data source identifier.

type DDataList added in v1.31.0

type DDataList struct {
	testtemplate.DataCommon

	LabelSelector string
}

DDataList defines the fields for the "testdata/d/hcloud_servers" template.

func (*DDataList) TFID added in v1.31.0

func (d *DDataList) TFID() string

TFID DDataList the data source identifier.

type NetworkResource added in v1.24.1

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

func (*NetworkResource) ConfigValidators added in v1.56.0

func (r *NetworkResource) ConfigValidators(context.Context) []resource.ConfigValidator

func (*NetworkResource) Configure added in v1.56.0

func (*NetworkResource) Create added in v1.56.0

func (*NetworkResource) Delete added in v1.56.0

func (*NetworkResource) ImportState added in v1.56.0

func (*NetworkResource) Metadata added in v1.56.0

func (*NetworkResource) ModifyPlan added in v1.56.0

func (*NetworkResource) ParseID added in v1.56.0

func (r *NetworkResource) ParseID(s string) (*hcloud.Server, *hcloud.Network, error)

func (*NetworkResource) ParseSubnetID added in v1.56.0

func (r *NetworkResource) ParseSubnetID(s string) (*hcloud.Network, *net.IPNet, error)

func (*NetworkResource) Read added in v1.56.0

func (*NetworkResource) Schema added in v1.56.0

func (*NetworkResource) Update added in v1.56.0

type RData

type RData struct {
	testtemplate.DataCommon

	Name                   string
	Type                   string
	Image                  string
	LocationName           string
	Datacenter             string
	PublicNet              map[string]interface{}
	SSHKeys                []string
	KeepDisk               bool
	Rescue                 string
	Backups                bool
	ISO                    string
	Labels                 map[string]string
	UserData               string
	Networks               []RDataInlineNetwork
	FirewallIDs            []string
	DependsOn              []string
	PlacementGroupID       string
	DeleteProtection       bool
	RebuildProtection      bool
	AllowDeprecatedImages  bool
	ShutdownBeforeDeletion bool

	Raw string
}

RData defines the fields for the "testdata/r/hcloud_server" template.

func (*RData) TFID

func (d *RData) TFID() string

TFID returns the resource identifier.

type RDataInlineNetwork added in v1.24.0

type RDataInlineNetwork struct {
	NetworkID string
	IP        string
	AliasIPs  []string
}

RDataInlineNetwork defines the information required to attach a server to a network directly in the server resource.

type RDataNetwork

type RDataNetwork struct {
	testtemplate.DataCommon

	Name      string
	ServerID  string
	NetworkID string
	SubNetID  string
	IP        string
	AliasIPs  []string
	DependsOn []string
}

RDataNetwork defines the fields for the "testdata/r/hcloud_server_network" template.

func (*RDataNetwork) TFID added in v1.55.0

func (d *RDataNetwork) TFID() string

TFID returns the resource identifier.

Jump to

Keyboard shortcuts

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