Documentation ¶
Index ¶
- Variables
- func AsBool(b upcloud.Boolean) types.Bool
- func AsUpCloudBoolean(b types.Bool) upcloud.Boolean
- func EnvKeyExists(keyPrefix string) bool
- func ErrorDiagnosticDetail(err error) string
- func ExpandStrings(data interface{}) []string
- func FilterNetworks(vs []upcloud.Network, fns ...func(upcloud.Network) (bool, error)) ([]upcloud.Network, error)
- func FilterZoneIDs(vs []upcloud.Zone, f func(upcloud.Zone) bool) []string
- func FilterZones(vs []upcloud.Zone, f func(upcloud.Zone) bool) []upcloud.Zone
- func HandleResourceError(resourceName string, d *schema.ResourceData, err error) diag.Diagnostics
- func JoinSchemas(dst map[string]*schema.Schema, s ...map[string]*schema.Schema) map[string]*schema.Schema
- func LabelSliceToMap(data upcloud.LabelSlice) map[string]string
- func LabelsAttribute(resource string) schema.Attribute
- func LabelsMapToSlice[T any](m map[string]T) []upcloud.Label
- func LabelsSchema(resource string) *sdkv2_schema.Schema
- func LabelsSliceToMap(s []upcloud.Label) map[string]string
- func MapOfStringsToLabelSlice(ctx context.Context, data interface{}) (upcloud.LabelSlice, error)
- func MarshalID(components ...string) string
- func NilAsEmptyList[T any](l []T) []T
- func ReadTestDataFile(t *testing.T, name string) string
- func SetAsSliceOfStrings(ctx context.Context, set types.Set) ([]string, diag.Diagnostics)
- func SetOfStringsToSlice(ctx context.Context, data interface{}) ([]string, error)
- func SliceOfStringToServerUUIDSlice(strs []string) upcloud.ServerUUIDSlice
- func StorageAddressFormat(address string) string
- func StorageAddressPositionFormat(address string) string
- func UnmarshalID(id string, components ...*string) error
- func VerifyServerStarted(ctx context.Context, startRequest request.StartServerRequest, meta interface{}) error
- func VerifyServerStopped(ctx context.Context, stopRequest request.StopServerRequest, meta interface{}) error
- func WaitForResourceToBeDeleted(ctx context.Context, svc *service.Service, ...) error
- func WithRetry(fn func() (interface{}, error), retries int, delay time.Duration) (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
var ValidateLabelsDiagFunc = validation.AllDiag( validation.MapKeyLenBetween(2, 32), validation.MapKeyMatch(labelKeyRegExp, ""), validation.MapValueLenBetween(0, 255), )
Functions ¶
func EnvKeyExists ¶
func ErrorDiagnosticDetail ¶
func ExpandStrings ¶
func ExpandStrings(data interface{}) []string
ExpandStrings expands a terraform list to slice of str
func FilterNetworks ¶
func HandleResourceError ¶
func HandleResourceError(resourceName string, d *schema.ResourceData, err error) diag.Diagnostics
func JoinSchemas ¶
func LabelSliceToMap ¶
func LabelSliceToMap(data upcloud.LabelSlice) map[string]string
LabelSliceToMap transorms `upcloud.LabelSlice` into a map of strings. This can be used to set labels fetched from the API into a state
func LabelsAttribute ¶
func LabelsSchema ¶
func LabelsSchema(resource string) *sdkv2_schema.Schema
func MapOfStringsToLabelSlice ¶
func MapOfStringsToLabelSlice(ctx context.Context, data interface{}) (upcloud.LabelSlice, error)
MapOfStringsToLabelSlice transforms a terraform map of strings to a LabelSlice
func NilAsEmptyList ¶
func NilAsEmptyList[T any](l []T) []T
func ReadTestDataFile ¶
ReadTestDataFile reads testdata from file to a string. Fails tests with Fatal, if reading the file fails.
func SetAsSliceOfStrings ¶
func SetOfStringsToSlice ¶
SetOfStringsToSlice transforms a terraform set of strings to a slice of strings
func SliceOfStringToServerUUIDSlice ¶
func SliceOfStringToServerUUIDSlice(strs []string) upcloud.ServerUUIDSlice
SliceOfStringToServerUUIDSlice converts slice of strings into `upcloud.ServerUUIDSlice`
func StorageAddressFormat ¶
StorageAddressFormat takes the address in any format and extracts the bus type only (ide/scsi/virtio)
func StorageAddressPositionFormat ¶
StorageAddressPositionFormat takes the address in any format and extracts the bus position only
func UnmarshalID ¶
func VerifyServerStarted ¶
func VerifyServerStarted(ctx context.Context, startRequest request.StartServerRequest, meta interface{}) error
func VerifyServerStopped ¶
func VerifyServerStopped(ctx context.Context, stopRequest request.StopServerRequest, meta interface{}) error
Types ¶
This section is empty.