Documentation ¶
Index ¶
- Variables
- func AddValueSpecs(body map[string]interface{}) map[string]interface{}
- func Base64IfNot(src string) string
- func BuildComponentID(parts ...string) string
- func BuildRequest(opts interface{}, parent string) (map[string]interface{}, error)
- func CheckDeleted(d *schema.ResourceData, err error, msg string) error
- func CheckDeletedDiag(d *schema.ResourceData, err error, msg string) diag.Diagnostics
- func CheckForRetryableError(err error) *resource.RetryError
- func CheckNull(element string, d *schema.ResourceData) bool
- func CheckYamlString(yamlString interface{}) (string, error)
- func ClientFromCtx(ctx context.Context, keyClient string, fallbackFunc ContextCreatingFunction) (*golangsdk.ServiceClient, error)
- func CompareJsonTemplateAreEquivalent(tem1, tem2 string) (bool, error)
- func Contains(tagSlice []tags.ResourceTag, tag tags.ResourceTag) bool
- func CtxWithClient(parent context.Context, client *golangsdk.ServiceClient, ...) context.Context
- func ExpandResourceTags(tagMap map[string]interface{}) []tags.ResourceTag
- func ExpandToStringSlice(v []interface{}) []string
- func FirstOneSet(res map[string]interface{}, k1, k2 string) (interface{}, error)
- func FlattenStringList(list []*string) []interface{}
- func GetAllAvailableZones(d *schema.ResourceData) []string
- func GetHashOrEmpty(v interface{}) string
- func GetSetChanges(d *schema.ResourceData, key string) (removed, added *schema.Set)
- func HasFilledOpt(d *schema.ResourceData, param string) bool
- func ImportAsManaged(_ context.Context, d *schema.ResourceData, _ interface{}) ([]*schema.ResourceData, error)
- func ImportByPath(attributes ...string) schema.StateContextFunc
- func InstallScriptEncode(script string) string
- func InstallScriptHashSum(script string) string
- func IntSlice(v interface{}) []int
- func IsEmptyValue(v reflect.Value) (bool, error)
- func IsResourceNotFound(err error) bool
- func LooksLikeJsonString(s interface{}) bool
- func MapResourceProp(d *schema.ResourceData, prop string) map[string]interface{}
- func MapValueSpecs(d cfg.SchemaOrDiff) map[string]string
- func MultipleCustomizeDiffs(funcs ...schema.CustomizeDiffFunc) schema.CustomizeDiffFunc
- func NavigateValue(d interface{}, index []string, arrayIndex map[string]int) (interface{}, error)
- func NormalizeJsonString(jsonString interface{}) (string, error)
- func ReplaceVars(d *schema.ResourceData, linkTmpl string, kv map[string]string) (string, error)
- func ReplaceVarsForTest(rs *terraform.ResourceState, linkTmpl string) (string, error)
- func SetComplexID(d *schema.ResourceData, attributes ...string) error
- func SetIDComponents(d *schema.ResourceData, attributes ...string) error
- func SortVersions(src []string) []string
- func StrSlice(v interface{}) []string
- func StrSliceContains(haystack []string, needle string) bool
- func StringInSlice(str string, slice []string) bool
- func SuppressCaseInsensitive(_, old, new string, _ *schema.ResourceData) bool
- func SuppressComputedFixedWhenFloatingIp(_, old, new string, d *schema.ResourceData) bool
- func SuppressDiffAll(_, _, _ string, _ *schema.ResourceData) bool
- func SuppressEmptyStringSHA(k, old, new string, d *schema.ResourceData) bool
- func SuppressEqualZoneNames(_, old, new string, _ *schema.ResourceData) bool
- func SuppressEquivalentAwsPolicyDiffs(_, old, new string, _ *schema.ResourceData) bool
- func SuppressExternalGateway(_, old, new string, _ *schema.ResourceData) bool
- func SuppressLBWhitelistDiffs(_, old, new string, _ *schema.ResourceData) bool
- func SuppressMinDisk(_, old, new string, _ *schema.ResourceData) bool
- func SuppressRdsNameDiffs(_, old, new string, _ *schema.ResourceData) bool
- func SuppressSmartVersionDiff(_, old, new string, _ *schema.ResourceData) bool
- func SuppressStrippedNewLines(_, old, new string, _ *schema.ResourceData) bool
- func TagsSchema() *schema.Schema
- func TagsToMap(tags []tags.ResourceTag) map[string]string
- func UpdateResourceTags(client *golangsdk.ServiceClient, d *schema.ResourceData, ...) error
- func ValidateASGroupListenerID(v interface{}, k string) (ws []string, errors []error)
- func ValidateAntiDdosAppTypeID(v interface{}, k string) (ws []string, errors []error)
- func ValidateAntiDdosCleaningAccessPosID(v interface{}, k string) (ws []string, errors []error)
- func ValidateAntiDdosHttpRequestPosID(v interface{}, k string) (ws []string, errors []error)
- func ValidateAntiDdosTrafficPosID(v interface{}, k string) (ws []string, errors []error)
- func ValidateCIDR(v interface{}, k string) (ws []string, errors []error)
- func ValidateCTSEventName(v interface{}, k string) (ws []string, errors []error)
- func ValidateDDSStartTime(v interface{}, _ string) (ws []string, errors []error)
- func ValidateEmail(v interface{}, k string) (ws []string, errors []error)
- func ValidateIP(v interface{}, k string) (ws []string, errors []error)
- func ValidateIntRange(v interface{}, k string, l int, h int) (ws []string, errors []error)
- func ValidateJsonString(v interface{}, k string) (ws []string, errors []error)
- func ValidateK8sTagsMap(v interface{}, k string) (ws []string, errors []error)
- func ValidateName(v interface{}, k string) (ws []string, errors []error)
- func ValidateStackTemplate(v interface{}, k string) (ws []string, errors []error)
- func ValidateStringList(v interface{}, k string, l []string) (ws []string, errors []error)
- func ValidateSubnet(argName string) schema.CustomizeDiffFunc
- func ValidateTags(v interface{}, k string) (ws []string, errors []error)
- func ValidateTrueOnly(v interface{}, k string) (ws []string, errors []error)
- func ValidateVBSBackupName(v interface{}, k string) (ws []string, errors []error)
- func ValidateVBSPolicyFrequency(v interface{}, k string) (ws []string, errors []error)
- func ValidateVBSPolicyName(v interface{}, k string) (ws []string, errors []error)
- func ValidateVBSPolicyRetainBackup(v interface{}, k string) (ws []string, errors []error)
- func ValidateVBSPolicyRetentionNum(v interface{}, k string) (ws []string, errors []error)
- func ValidateVBSPolicyStatus(v interface{}, k string) (ws []string, errors []error)
- func ValidateVBSTagKey(v interface{}, k string) (ws []string, errors []error)
- func ValidateVBSTagValue(v interface{}, k string) (ws []string, errors []error)
- func ValidateVPC(argName string) schema.CustomizeDiffFunc
- func ValidateVolumeType(argName string) schema.CustomizeDiffFunc
- type ClientCtxKey
- type ContextCreatingFunction
- type StringSearcher
Constants ¶
This section is empty.
Variables ¶
var ( DataSourceTooFewDiag = diag.Errorf("your query returned no results. Please change your search criteria and try again.") DataSourceTooManyDiag = diag.Errorf("your query returned more than one result. Please change your search criteria and try again.") )
var Descriptions = map[string]string{
"access_key": "The access key for API operations. You can retrieve this\n" +
"from the 'My Credential' section of the console.",
"secret_key": "The secret key for API operations. You can retrieve this\n" +
"from the 'My Credential' section of the console.",
"auth_url": "The Identity authentication URL.",
"region": "The OpenTelekomCloud region to connect to.",
"user_name": "Username to login with.",
"user_id": "User ID to login with.",
"tenant_id": "The ID of the Tenant (Identity v2) or Project (Identity v3)\n" +
"to login with.",
"tenant_name": "The name of the Tenant (Identity v2) or Project (Identity v3)\n" +
"to login with.",
"password": "Password to login with.",
"token": "Authentication token to use as an alternative to username/password.",
"security_token": "Security token to use for OBS federated authentication.",
"domain_id": "The ID of the Domain to scope to (Identity v3).",
"domain_name": "The name of the Domain to scope to (Identity v3).",
"insecure": "Trust self-signed certificates.",
"cacert_file": "A Custom CA certificate.",
"endpoint_type": "The catalog endpoint type to use.",
"cert": "A client certificate to authenticate with.",
"key": "A client private key to authenticate with.",
"swauth": "Use Swift's authentication system instead of Keystone. Only used for\n" +
"interaction with Swift.",
"agency_name": "The name of agency",
"agency_domain_name": "The name of domain who created the agency (Identity v3).",
"delegated_project": "The name of delegated project (Identity v3).",
"cloud": "An entry in a `clouds.yaml` file to use.",
"max_retries": "How many times HTTP connection should be retried until giving up.",
"passcode": "One-time MFA passcode",
}
var SuccessHTTPCodes = []int{200, 201, 202, 203, 204, 205, 206, 207, 208, 226}
Functions ¶
func AddValueSpecs ¶
AddValueSpecs expands the 'value_specs' object and removes 'value_specs' from the request body.
func Base64IfNot ¶
func BuildComponentID ¶ added in v1.23.12
func BuildRequest ¶
BuildRequest takes an opts struct and builds a request body for Gophercloud to execute
func CheckDeleted ¶
func CheckDeleted(d *schema.ResourceData, err error, msg string) error
CheckDeleted checks the error to see if it's a 404 (Not Found) and, if so, sets the resource ID to the empty string instead of throwing an error.
func CheckDeletedDiag ¶ added in v1.29.0
func CheckDeletedDiag(d *schema.ResourceData, err error, msg string) diag.Diagnostics
CheckDeletedDiag checks the error to see if it's a 404 (Not Found) and, if so, sets the resource ID to the empty string instead of throwing an error.
func CheckForRetryableError ¶
func CheckForRetryableError(err error) *resource.RetryError
func CheckNull ¶ added in v1.35.2
func CheckNull(element string, d *schema.ResourceData) bool
CheckNull returns true if schema parameter is empty
func CheckYamlString ¶
Takes a value containing YAML string and passes it through the YAML parser. Returns either a parsing error or original YAML string.
func ClientFromCtx ¶ added in v1.26.0
func ClientFromCtx(ctx context.Context, keyClient string, fallbackFunc ContextCreatingFunction) (*golangsdk.ServiceClient, error)
func CompareJsonTemplateAreEquivalent ¶ added in v1.35.4
func Contains ¶ added in v1.23.11
func Contains(tagSlice []tags.ResourceTag, tag tags.ResourceTag) bool
func CtxWithClient ¶ added in v1.26.0
func CtxWithClient(parent context.Context, client *golangsdk.ServiceClient, keyClient ClientCtxKey) context.Context
func ExpandResourceTags ¶
func ExpandResourceTags(tagMap map[string]interface{}) []tags.ResourceTag
ExpandResourceTags returns the tags for the given map of data.
func ExpandToStringSlice ¶
func ExpandToStringSlice(v []interface{}) []string
func FirstOneSet ¶
FirstOneSet select first nonempty string or returns error if both are empty
func FlattenStringList ¶
func FlattenStringList(list []*string) []interface{}
Takes list of pointers to strings. Expand to an array of raw strings and returns a []interface{} to keep compatibility w/ schema.NewSetschema.NewSet
func GetAllAvailableZones ¶ added in v1.23.2
func GetAllAvailableZones(d *schema.ResourceData) []string
func GetHashOrEmpty ¶
func GetHashOrEmpty(v interface{}) string
func GetSetChanges ¶ added in v1.26.3
func GetSetChanges(d *schema.ResourceData, key string) (removed, added *schema.Set)
GetSetChanges returns a pair of sets describing removed and added items
func HasFilledOpt ¶
func HasFilledOpt(d *schema.ResourceData, param string) bool
The result may be not correct when the type of param is string and user config it to 'param=""' but, there is no other way.
func ImportAsManaged ¶
func ImportAsManaged(_ context.Context, d *schema.ResourceData, _ interface{}) ([]*schema.ResourceData, error)
func ImportByPath ¶ added in v1.24.4
func ImportByPath(attributes ...string) schema.StateContextFunc
ImportByPath can be used to import resource by complex ID (e.g. identity protocol by `<provider>/<identity>` or CCE addon by `<cluster_id>/<addon_id>`)
Usage in schema:
StateContext: common.ImportByPath("provider", "protocol"),
func InstallScriptEncode ¶
func InstallScriptHashSum ¶
func IntSlice ¶ added in v1.26.2
func IntSlice(v interface{}) []int
IntSlice is used to wrap single integer element in slice
func IsResourceNotFound ¶
func LooksLikeJsonString ¶
func LooksLikeJsonString(s interface{}) bool
func MapResourceProp ¶
func MapResourceProp(d *schema.ResourceData, prop string) map[string]interface{}
MapResourceProp converts ResourceData property into a map
func MapValueSpecs ¶
func MapValueSpecs(d cfg.SchemaOrDiff) map[string]string
MapValueSpecs converts ResourceData into a map
func MultipleCustomizeDiffs ¶
func MultipleCustomizeDiffs(funcs ...schema.CustomizeDiffFunc) schema.CustomizeDiffFunc
func NavigateValue ¶
func NormalizeJsonString ¶
Takes a value containing JSON string and passes it through the JSON parser to normalize it, returns either a parsing error or normalized JSON string.
func ReplaceVars ¶
func ReplaceVarsForTest ¶
func ReplaceVarsForTest(rs *terraform.ResourceState, linkTmpl string) (string, error)
func SetComplexID ¶ added in v1.26.1
func SetComplexID(d *schema.ResourceData, attributes ...string) error
SetComplexID setting ID from multiple attributes by names
SetComplexID(d, "provider", "protocol")
will set ID from components:
"<provider>/<protocol>"
func SetIDComponents ¶ added in v1.26.1
func SetIDComponents(d *schema.ResourceData, attributes ...string) error
SetIDComponents setting attributes from complex ID, e.g.:
SetIDComponents(d, "provider", "protocol")
will set fields from ID formatted as
<provider>/<protocol>
func SortVersions ¶
SortVersions sorts versions from newer to older. If non-version-like string will be found in the slice, slice will be sorted as string slice in reversed order (z-a)
func StrSlice ¶ added in v1.26.2
func StrSlice(v interface{}) []string
StrSlice is used to wrap single string element in slice
func StrSliceContains ¶
StrSliceContains checks if a given string is contained in a slice When anybody asks why Go needs generics, here you go.
func StringInSlice ¶ added in v1.23.8
func SuppressCaseInsensitive ¶
func SuppressCaseInsensitive(_, old, new string, _ *schema.ResourceData) bool
func SuppressComputedFixedWhenFloatingIp ¶
func SuppressComputedFixedWhenFloatingIp(_, old, new string, d *schema.ResourceData) bool
SuppressComputedFixedWhenFloatingIp suppress changes if we get a fixed ip when not expecting one, if we have a floating ip (generates fixed ip).
func SuppressDiffAll ¶
func SuppressDiffAll(_, _, _ string, _ *schema.ResourceData) bool
SuppressDiffAll suppress all changes?
func SuppressEmptyStringSHA ¶ added in v1.24.3
func SuppressEmptyStringSHA(k, old, new string, d *schema.ResourceData) bool
func SuppressEqualZoneNames ¶
func SuppressEqualZoneNames(_, old, new string, _ *schema.ResourceData) bool
func SuppressEquivalentAwsPolicyDiffs ¶
func SuppressEquivalentAwsPolicyDiffs(_, old, new string, _ *schema.ResourceData) bool
func SuppressExternalGateway ¶
func SuppressExternalGateway(_, old, new string, _ *schema.ResourceData) bool
SuppressExternalGateway suppress changes if we don't specify an external gateway, but one is specified for us
func SuppressLBWhitelistDiffs ¶
func SuppressLBWhitelistDiffs(_, old, new string, _ *schema.ResourceData) bool
func SuppressMinDisk ¶
func SuppressMinDisk(_, old, new string, _ *schema.ResourceData) bool
SuppressMinDisk suppress changes if we get a computed min_disk_gb if value is unspecified (default 0)
func SuppressRdsNameDiffs ¶
func SuppressRdsNameDiffs(_, old, new string, _ *schema.ResourceData) bool
func SuppressSmartVersionDiff ¶
func SuppressSmartVersionDiff(_, old, new string, _ *schema.ResourceData) bool
func SuppressStrippedNewLines ¶ added in v1.23.8
func SuppressStrippedNewLines(_, old, new string, _ *schema.ResourceData) bool
func TagsToMap ¶
func TagsToMap(tags []tags.ResourceTag) map[string]string
TagsToMap returns the list of tags into a map.
func UpdateResourceTags ¶
func UpdateResourceTags(client *golangsdk.ServiceClient, d *schema.ResourceData, resourceType, id string) error
UpdateResourceTags is a helper to update the tags for a resource. It expects the tags field to be named "tags"
func ValidateCIDR ¶
func ValidateCTSEventName ¶ added in v1.32.0
func ValidateDDSStartTime ¶
func ValidateEmail ¶ added in v1.31.0
func ValidateIP ¶
func ValidateIntRange ¶
ValidateIntRange Deprecated Use validation.IntBetween instead
func ValidateJsonString ¶
func ValidateK8sTagsMap ¶
func ValidateName ¶
func ValidateStackTemplate ¶
func ValidateStringList ¶
ValidateStringList Deprecated Use validation.StringInSlice instead
func ValidateSubnet ¶
func ValidateSubnet(argName string) schema.CustomizeDiffFunc
func ValidateTags ¶ added in v1.23.5
func ValidateTrueOnly ¶
func ValidateVBSBackupName ¶
func ValidateVBSPolicyName ¶
func ValidateVBSPolicyStatus ¶
func ValidateVBSTagKey ¶
func ValidateVBSTagValue ¶
func ValidateVPC ¶
func ValidateVPC(argName string) schema.CustomizeDiffFunc
func ValidateVolumeType ¶
func ValidateVolumeType(argName string) schema.CustomizeDiffFunc
Types ¶
type ClientCtxKey ¶ added in v1.26.0
type ClientCtxKey string
type ContextCreatingFunction ¶ added in v1.26.0
type ContextCreatingFunction func() (*golangsdk.ServiceClient, error)
type StringSearcher ¶
StringSearcher is string search structure with internal cache This allows single iteration from base slice for multiple string searches