Documentation
¶
Index ¶
- Variables
- func AsBool(b upcloud.Boolean) types.Bool
- func AsSDKv2Diags(diags diag.Diagnostics) sdkv2_diag.Diagnostics
- func AsUpCloudBoolean(b types.Bool) upcloud.Boolean
- func DescriptionWithDeprecationWarning(deprecationMessage, description string) string
- 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 GetClientFromProviderData(providerData any) (client *service.Service, diags diag.Diagnostics)
- func GetFirstItem[T any](ctx context.Context, list elementsAser) (*T, diag.Diagnostics)
- func HandleResourceError(resourceName string, d *schema.ResourceData, err error) diag.Diagnostics
- func IsNotFoundError(err error) bool
- func JoinSchemas(dst map[string]*schema.Schema, s ...map[string]*schema.Schema) map[string]*schema.Schema
- func LabelsAttribute(resource string, additionalPlanModifiers ...planmodifier.Map) 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 LabelsSliceToSystemLabelsMap(s []upcloud.Label) map[string]string
- func MarshalID(components ...string) string
- func NewServiceWithCredentialsFromEnv(t *testing.T) *service.Service
- func NilAsEmptyList[T any](l []T) []T
- func ReadOnlyLabelsAttribute(resource string) schema.Attribute
- func ReadTestDataFile(t *testing.T, name string) string
- func SetAsSliceOfStrings(ctx context.Context, set types.Set) ([]string, diag.Diagnostics)
- func StorageAddressFormat(address string) string
- func StorageAddressPositionFormat(address string) string
- func SystemLabelsAttribute(resource string) schema.Attribute
- func UnmarshalID(id string, components ...*string) error
- func VerifyServerStarted(ctx context.Context, startRequest request.StartServerRequest, ...) (*upcloud.ServerDetails, error)
- func VerifyServerStopped(ctx context.Context, stopRequest request.StopServerRequest, ...) error
- func WaitForResourceToBeDeleted(ctx context.Context, svc *service.Service, ...) error
- func WithRetry(fn func() (interface{}, error), retries int, delay time.Duration) (interface{}, error)
- type StaticUnknown
Constants ¶
This section is empty.
Variables ¶
var ValidateLabelsDiagFunc = validation.AllDiag( validation.MapKeyLenBetween(2, 32), validation.MapKeyMatch(validLabelKeyRegExp, invalidLabelKeyMessage), validation.MapValueLenBetween(0, 255), )
Functions ¶
func AsSDKv2Diags ¶
func AsSDKv2Diags(diags diag.Diagnostics) sdkv2_diag.Diagnostics
func DescriptionWithDeprecationWarning ¶
DescriptionWithDeprecationWarning adds deprecation message to the description in a warning box before the actual description. Remember to also define DeprecationMessage for the resource/data-source.
func EnvKeyExists ¶
func ErrorDiagnosticDetail ¶
func ExpandStrings ¶
func ExpandStrings(data interface{}) []string
ExpandStrings expands a terraform list to slice of str
func FilterNetworks ¶
func GetClientFromProviderData ¶
func GetClientFromProviderData(providerData any) (client *service.Service, diags diag.Diagnostics)
func GetFirstItem ¶
func GetFirstItem[T any](ctx context.Context, list elementsAser) (*T, diag.Diagnostics)
func HandleResourceError ¶
func HandleResourceError(resourceName string, d *schema.ResourceData, err error) diag.Diagnostics
func IsNotFoundError ¶
func JoinSchemas ¶
func LabelsAttribute ¶
func LabelsAttribute(resource string, additionalPlanModifiers ...planmodifier.Map) schema.Attribute
func LabelsSchema ¶
func LabelsSchema(resource string) *sdkv2_schema.Schema
func NilAsEmptyList ¶
func NilAsEmptyList[T any](l []T) []T
func ReadOnlyLabelsAttribute ¶
func ReadTestDataFile ¶
ReadTestDataFile reads testdata from file to a string. Fails tests with Fatal, if reading the file fails.
func SetAsSliceOfStrings ¶
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 SystemLabelsAttribute ¶
func UnmarshalID ¶
func VerifyServerStarted ¶
func VerifyServerStarted(ctx context.Context, startRequest request.StartServerRequest, client *service.Service) (*upcloud.ServerDetails, error)
func VerifyServerStopped ¶
Types ¶
type StaticUnknown ¶
type StaticUnknown struct{}
StaticUnknown sets an unknown default value. Terraform plugin framework should set null value in config to unknown value in plan, but if that does not happen, this can be used to force an unknown value to plan.
func (StaticUnknown) DefaultBool ¶
func (d StaticUnknown) DefaultBool(_ context.Context, _ defaults.BoolRequest, resp *defaults.BoolResponse)
func (StaticUnknown) Description ¶
func (d StaticUnknown) Description(_ context.Context) string
func (StaticUnknown) MarkdownDescription ¶
func (d StaticUnknown) MarkdownDescription(ctx context.Context) string