Documentation ¶
Index ¶
- func ImportStateContextUppercaseWrapper(wrappedFunc schema.StateContextFunc) schema.StateContextFunc
- func ImportUppercaseWrapper(wrappedFunc importStateFunc) importStateFunc
- func MikrotikStructToTerraformModel(ctx context.Context, src client.Resource, dest interface{}) error
- func ParseBool(v string) (bool, error)
- func TerraformModelToMikrotikStruct(ctx context.Context, src interface{}, dest client.Resource) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImportStateContextUppercaseWrapper ¶
func ImportStateContextUppercaseWrapper(wrappedFunc schema.StateContextFunc) schema.StateContextFunc
ImportStateContextUppercaseWrapper changes the ID of the resource to upper case before passing it to wrappedFunction
This wrapper is useful when resource ID is MikroTik's .id. Due to wierd behavior, listing via MikroTik's CLI reports lowercase .id, but find request with this id via API fails as it expects upper case string.
Usage in resource definition.
SDKv2
schema.Resource{ Importer: &schema.ResourceImporter{ StateContext: utils.ImportStateContextUppercaseWrapper(schema.ImportStatePassthroughContext), } }
func ImportUppercaseWrapper ¶ added in v0.15.0
func ImportUppercaseWrapper(wrappedFunc importStateFunc) importStateFunc
ImportUppercaseWrapper is ImportStateContextUppercaseWrapper equivalent for PluginFramework.
func MikrotikStructToTerraformModel ¶ added in v0.12.0
func MikrotikStructToTerraformModel(ctx context.Context, src client.Resource, dest interface{}) error
MikrotikStructToTerraformModel is a wrapper for copyStruct() to ensure proper src/dest typing
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.