Documentation ¶
Index ¶
- Constants
- Variables
- func BuildObjectStorageObjectID(d *schema.ResourceData) string
- func CompareIPv6Ranges(i, v string) (bool, error)
- func CreateDatabaseEngineSlug(engine, version string) string
- func CreateRandomRootPassword() (string, error)
- func DomainSecondsDiffSuppressor() schema.SchemaDiffSuppressFunc
- func ExpandDayOfWeek(day string) (linodego.DatabaseDayOfWeek, error)
- func ExpandIntList(list []interface{}) []int
- func ExpandIntSet(set *schema.Set) []int
- func ExpandMaintenanceWindow(window map[string]interface{}) (linodego.DatabaseMaintenanceWindow, error)
- func ExpandStringList(list []interface{}) []string
- func ExpandStringSet(set *schema.Set) []string
- func FilterTypeBool(value string) (interface{}, error)
- func FilterTypeInt(value string) (interface{}, error)
- func FilterTypeString(value string) (interface{}, error)
- func FlattenDayOfWeek(day linodego.DatabaseDayOfWeek) string
- func FlattenMaintenanceWindow(window linodego.MySQLDatabaseMaintenanceWindow) map[string]interface{}
- func FlattenToInterfaceSlice[T any](list []T) []interface{}
- func GetCurrentBootedConfig(ctx context.Context, client *linodego.Client, instID int) (int, error)
- func GetDeadlineSeconds(ctx context.Context, d *schema.ResourceData) int
- func GetLatestEvent(ctx context.Context, client *linodego.Client, entityID int, ...) (*linodego.Event, error)
- func IsInstanceInBootedState(status linodego.InstanceStatus) bool
- func ListResultToInterface[T any](list []T, err error) ([]interface{}, error)
- func RebootInstance(ctx context.Context, d *schema.ResourceData, entityID int, meta interface{}, ...) diag.Diagnostics
- func ResolveValidDBEngine(ctx context.Context, client linodego.Client, engine string) (*linodego.DatabaseEngine, error)
- func S3ConnFromResourceData(d *schema.ResourceData) *s3.S3
- func TypedSliceToAny[T any](obj []T) []any
- func ValidateIPv6Range(i string) error
- func WaitForDatabaseUpdated(ctx context.Context, client linodego.Client, dbID int, ...) error
- type Config
- type FilterAttribute
- type FilterConfig
- func (f FilterConfig) ConstructFilterString(d *schema.ResourceData) (string, error)
- func (f FilterConfig) FilterDataSource(ctx context.Context, d *schema.ResourceData, meta interface{}, ...) ([]map[string]interface{}, error)
- func (f FilterConfig) FilterLatest(d *schema.ResourceData, items []map[string]interface{}) []map[string]interface{}
- func (f FilterConfig) FilterLatestVersion(d *schema.ResourceData, items []map[string]interface{}) ([]map[string]interface{}, error)
- func (f FilterConfig) FilterResults(d *schema.ResourceData, items []interface{}) ([]map[string]interface{}, error)
- func (f FilterConfig) FilterSchema() *schema.Schema
- func (f FilterConfig) GetFilterID(d *schema.ResourceData) (string, error)
- func (f FilterConfig) GetLatestCreated(data []map[string]interface{}) map[string]interface{}
- func (f FilterConfig) GetLatestVersion(data []map[string]interface{}) (map[string]interface{}, error)
- func (f FilterConfig) GetValidFilters(apiOnly bool) []string
- func (f FilterConfig) OrderBySchema() *schema.Schema
- func (f FilterConfig) OrderSchema() *schema.Schema
- func (f FilterConfig) ValidateDiagFunc(apiOnly bool) schema.SchemaValidateDiagFunc
- type FilterFlattenFunc
- type FilterListFunc
- type FilterTypeFunc
- type ProviderMeta
Constants ¶
const ( RootPassMinimumCharacters = 11 RootPassMaximumCharacters = 128 )
const DefaultLinodeURL = "https://api.linode.com"
DefaultLinodeURL is the Linode APIv4 URL to use.
const (
LinodeObjectsEndpoint = "https://%s.linodeobjects.com"
)
Variables ¶
var ValidDatabaseTypes = []string{"mongodb", "postgresql", "mysql"}
Functions ¶
func BuildObjectStorageObjectID ¶
func BuildObjectStorageObjectID(d *schema.ResourceData) string
func CompareIPv6Ranges ¶ added in v1.27.2
func CreateDatabaseEngineSlug ¶ added in v1.28.0
func CreateRandomRootPassword ¶ added in v1.29.3
func DomainSecondsDiffSuppressor ¶
func DomainSecondsDiffSuppressor() schema.SchemaDiffSuppressFunc
func ExpandDayOfWeek ¶ added in v1.28.0
func ExpandDayOfWeek(day string) (linodego.DatabaseDayOfWeek, error)
func ExpandIntList ¶
func ExpandIntList(list []interface{}) []int
func ExpandIntSet ¶
func ExpandMaintenanceWindow ¶ added in v1.28.0
func ExpandMaintenanceWindow(window map[string]interface{}) (linodego.DatabaseMaintenanceWindow, error)
func ExpandStringList ¶
func ExpandStringList(list []interface{}) []string
func ExpandStringSet ¶
func FilterTypeBool ¶ added in v1.25.2
func FilterTypeInt ¶ added in v1.25.2
func FilterTypeString ¶ added in v1.25.2
func FlattenDayOfWeek ¶ added in v1.28.0
func FlattenDayOfWeek(day linodego.DatabaseDayOfWeek) string
func FlattenMaintenanceWindow ¶ added in v1.28.0
func FlattenMaintenanceWindow(window linodego.MySQLDatabaseMaintenanceWindow) map[string]interface{}
func FlattenToInterfaceSlice ¶ added in v1.28.0
func FlattenToInterfaceSlice[T any](list []T) []interface{}
func GetCurrentBootedConfig ¶ added in v1.29.0
GetCurrentBootedConfig gets the config a linode instance is current booted to
func GetDeadlineSeconds ¶ added in v1.29.0
func GetDeadlineSeconds(ctx context.Context, d *schema.ResourceData) int
GetDeadlineSeconds gets the seconds remaining until deadline is met.
func GetLatestEvent ¶ added in v1.25.0
func GetLatestEvent(ctx context.Context, client *linodego.Client, entityID int, entityType linodego.EntityType, action linodego.EventAction, ) (*linodego.Event, error)
GetLatestEvent returns the latest Linode event with the given arguments.
func IsInstanceInBootedState ¶ added in v1.29.0
func IsInstanceInBootedState(status linodego.InstanceStatus) bool
IsInstanceInBootedState checks whether an instance is in a booted or booting state
func ListResultToInterface ¶ added in v1.28.0
func RebootInstance ¶
func RebootInstance(ctx context.Context, d *schema.ResourceData, entityID int, meta interface{}, bootConfig int, ) diag.Diagnostics
set bootConfig = 0 if using existing boot config
func ResolveValidDBEngine ¶ added in v1.28.0
func S3ConnFromResourceData ¶
func S3ConnFromResourceData(d *schema.ResourceData) *s3.S3
S3ConnFromResourceData builds an S3 client from the linode_object_storage_object resource's access_key, secret_key, and cluster fields.
func TypedSliceToAny ¶ added in v1.29.3
func ValidateIPv6Range ¶ added in v1.27.2
Types ¶
type Config ¶
type Config struct { AccessToken string APIURL string APIVersion string UAPrefix string ConfigPath string ConfigProfile string TerraformVersion string SkipInstanceReadyPoll bool SkipInstanceDeletePoll bool DisableInternalCache bool MinRetryDelayMilliseconds int MaxRetryDelayMilliseconds int EventPollMilliseconds int LKEEventPollMilliseconds int LKENodeReadyPollMilliseconds int }
Config represents the Linode provider configuration.
type FilterAttribute ¶ added in v1.25.2
type FilterAttribute struct { // Whether this field can be filtered on at an API level. // If false, this filter will be handled on the client. APIFilterable bool // Converts the filter string to the correct type. TypeFunc FilterTypeFunc }
FilterAttribute stores various configuration options about a single filterable field.
type FilterConfig ¶ added in v1.25.2
type FilterConfig map[string]FilterAttribute
FilterConfig stores a map of FilterAttributes for a resource.
func (FilterConfig) ConstructFilterString ¶ added in v1.25.2
func (f FilterConfig) ConstructFilterString(d *schema.ResourceData) (string, error)
ConstructFilterString constructs a Linode filter JSON string from each filter element in the schema
func (FilterConfig) FilterDataSource ¶ added in v1.25.2
func (f FilterConfig) FilterDataSource( ctx context.Context, d *schema.ResourceData, meta interface{}, listFunc FilterListFunc, flattenFunc FilterFlattenFunc, ) ([]map[string]interface{}, error)
FilterDataSource should be run from inside the ReadContext function of a data source.
func (FilterConfig) FilterLatest ¶ added in v1.25.2
func (f FilterConfig) FilterLatest(d *schema.ResourceData, items []map[string]interface{}) []map[string]interface{}
FilterLatest returns only the latest element in the given slice only if `latest` == true.
func (FilterConfig) FilterLatestVersion ¶ added in v1.27.0
func (f FilterConfig) FilterLatestVersion(d *schema.ResourceData, items []map[string]interface{}, ) ([]map[string]interface{}, error)
FilterLatestVersion returns only the latest element in the given slice only if `latest` == true.
func (FilterConfig) FilterResults ¶ added in v1.25.2
func (f FilterConfig) FilterResults( d *schema.ResourceData, items []interface{}, ) ([]map[string]interface{}, error)
FilterResults filters the given results on the client-side filters present in the resource.
func (FilterConfig) FilterSchema ¶ added in v1.25.2
func (f FilterConfig) FilterSchema() *schema.Schema
FilterSchema should be referenced in a schema configuration in order to enable filter functionality
func (FilterConfig) GetFilterID ¶ added in v1.25.2
func (f FilterConfig) GetFilterID(d *schema.ResourceData) (string, error)
GetFilterID creates a unique ID specific to the current filter data source
func (FilterConfig) GetLatestCreated ¶ added in v1.25.2
func (f FilterConfig) GetLatestCreated(data []map[string]interface{}) map[string]interface{}
GetLatestCreated returns only the latest element in the given slice.
func (FilterConfig) GetLatestVersion ¶ added in v1.27.0
func (f FilterConfig) GetLatestVersion(data []map[string]interface{}) (map[string]interface{}, error)
GetLatestVersion returns only the latest version string (e.g. `8.0.26`) in the given slice.
func (FilterConfig) GetValidFilters ¶ added in v1.25.2
func (f FilterConfig) GetValidFilters(apiOnly bool) []string
GetValidFilters returns a slice of valid filters for the filter config.
func (FilterConfig) OrderBySchema ¶ added in v1.25.2
func (f FilterConfig) OrderBySchema() *schema.Schema
OrderBySchema should be referenced in a schema configuration in order to enable filter ordering functionality
func (FilterConfig) OrderSchema ¶ added in v1.25.2
func (f FilterConfig) OrderSchema() *schema.Schema
func (FilterConfig) ValidateDiagFunc ¶ added in v1.25.2
func (f FilterConfig) ValidateDiagFunc(apiOnly bool) schema.SchemaValidateDiagFunc
ValidateDiagFunc should be plugged into the `filter` field of a filterable data source.
type FilterFlattenFunc ¶ added in v1.25.2
type FilterFlattenFunc func(object interface{}) map[string]interface{}
FilterFlattenFunc flattens an object into a map[string]interface{}.
type FilterListFunc ¶ added in v1.25.2
type FilterListFunc func(context.Context, *schema.ResourceData, *linodego.Client, *linodego.ListOptions) ([]interface{}, error)
FilterListFunc wraps a linodego list function.
type FilterTypeFunc ¶
FilterTypeFunc is a function that takes in a filter name and value, and returns the value converted to the correct filter type.