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 ExpandToIntList(v []interface{}) []int
- func ExpandToStringList(v []interface{}) []string
- func ExpandToStringListBySet(v *schema.Set) []string
- func ExpandToStringSlice(v []interface{}) []string
- func FilterSliceWithField(all interface{}, filter map[string]interface{}) ([]interface{}, error)
- 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 IsSliceContainsAnyAnotherSliceElement(sl, another []string, ignoreCase, isExcat bool) bool
- func IsStrContainsSliceElement(str string, sl []string, ignoreCase, isExcat bool) bool
- func LooksLikeJsonString(s interface{}) bool
- func MapContains(rawMap map[string]string, filterMap map[string]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 PathSearch(expression string, obj interface{}, defaultValue interface{}) interface{}
- func RemoveNil(data map[string]interface{}) map[string]interface{}
- func ReplaceVars(d *schema.ResourceData, linkTmpl string, kv map[string]string) (string, error)
- func ReplaceVarsForTest(rs *terraform.ResourceState, linkTmpl string) (string, error)
- func RetryContextWithWaitForState(param *RetryContextWithWaitForStateParam) (interface{}, error)
- func SetComplexID(d *schema.ResourceData, attributes ...string) error
- func SetIDComponents(d *schema.ResourceData, attributes ...string) error
- func SliceUnion(a, b []string) []string
- func SortVersions(src []string) []string
- func StrSlice(v interface{}) []string
- func StrSliceContains(haystack []string, needle string) bool
- func StrSliceContainsAnother(b []string, s []string) bool
- func StringInSlice(str string, slice []string) bool
- func StringToInt(i *string) *int
- 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 SuppressMinDisk(_, old, new string, _ *schema.ResourceData) bool
- func SuppressRdsNameDiffs(_, old, new string, _ *schema.ResourceData) bool
- func SuppressSmartVersionDiff(_, old, new string, _ *schema.ResourceData) bool
- func SuppressStringSepratedByCommaDiffs(_, 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 ValidateDDMName(v interface{}, k string) (ws []string, errors []error)
- func ValidateDDMSchemaName(v interface{}, k string) (ws []string, errors []error)
- func ValidateDDMUsername(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 ValidateIPRange(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 ValidateRFC3339Timestamp(v interface{}, _ 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 ValidateUTCOffset(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
- func ValueIgnoreEmpty(v interface{}) interface{}
- type ClientCtxKey
- type ContextCreatingFunction
- type RetryContextWithWaitForStateParam
- type RetryFunc
- 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.",
"max_backoff_retries": "How many times HTTP request should be retried when rate limit reached",
"backoff_retry_timeout": "Timeout in seconds for backoff retry",
"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 ¶
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 ExpandToIntList ¶ added in v1.36.10
func ExpandToIntList(v []interface{}) []int
func ExpandToStringList ¶ added in v1.36.8
func ExpandToStringList(v []interface{}) []string
ExpandToStringList takes the result for an array of strings and returns a []string
func ExpandToStringListBySet ¶ added in v1.36.7
ExpandToStringListBySet takes the result for a set of strings and returns a []string
func ExpandToStringSlice ¶
func ExpandToStringSlice(v []interface{}) []string
func FilterSliceWithField ¶ added in v1.36.3
FilterSliceWithField can filter the slice all through a map filter. If the field is a nested value, using dot(.) to split them, e.g. "SubBlock.SubField". If value in the map is zero, it will be ignored.
func FirstOneSet ¶
FirstOneSet select first nonempty string or returns error if both are empty
func FlattenStringList ¶
func FlattenStringList(list []*string) []interface{}
FlattenStringList 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 IsSliceContainsAnyAnotherSliceElement ¶ added in v1.36.8
IsSliceContainsAnyAnotherSliceElement is a method that used to determine whether a list contains any element of another list (including its fragments belonging to the current string), returns true if it contains. sl: The slice body used to determine the inclusion relationship. another: The included slice object used to determine the inclusion relationship. ignoreCase: Whether to ignore case. isExcat: Whether the inclusion relationship of string objects applies exact matching rules.
func IsStrContainsSliceElement ¶ added in v1.36.8
IsStrContainsSliceElement returns true if the string exists in given slice or contains in one of slice elements when open exact flag. Also, you can ignore case for this check.
func LooksLikeJsonString ¶
func LooksLikeJsonString(s interface{}) bool
func MapContains ¶ added in v1.36.17
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 ¶
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 PathSearch ¶ added in v1.36.16
func PathSearch(expression string, obj interface{}, defaultValue interface{}) interface{}
PathSearch evaluates a JMESPath expression against input data and returns the result.
func ReplaceVars ¶
func ReplaceVarsForTest ¶
func ReplaceVarsForTest(rs *terraform.ResourceState, linkTmpl string) (string, error)
func RetryContextWithWaitForState ¶ added in v1.36.0
func RetryContextWithWaitForState(param *RetryContextWithWaitForStateParam) (interface{}, error)
RetryContextWithWaitForState The RetryFunc will be called first if the error of the return is nil, the retry will be ended and the res of the return will be returned if the retry of the return is true, the RetryFunc will be retried, and the WaitFunc will be called if it is not nil if the retry of the return is false, the retry will be ended and the error of the retry func will be returned
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 SliceUnion ¶ added in v1.36.8
SliceUnion returns a new slice containing the union of elements from both slices, without any duplicates.
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 StrSliceContainsAnother ¶ added in v1.36.24
StrSliceContainsAnother checks whether a string slice (b) contains another string slice (s).
func StringInSlice ¶ added in v1.23.8
func StringToInt ¶ added in v1.36.7
StringToInt convert the string to int, and return the pointer of int value
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 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 SuppressStringSepratedByCommaDiffs ¶ added in v1.36.17
func SuppressStringSepratedByCommaDiffs(_, 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 ValidateDDMName ¶ added in v1.36.24
func ValidateDDMSchemaName ¶ added in v1.36.25
func ValidateDDMUsername ¶ added in v1.36.24
func ValidateDDSStartTime ¶
func ValidateEmail ¶ added in v1.31.0
func ValidateIP ¶
func ValidateIPRange ¶ added in v1.36.17
func ValidateIntRange ¶
ValidateIntRange Deprecated Use validation.IntBetween instead
func ValidateJsonString ¶
func ValidateK8sTagsMap ¶
func ValidateName ¶
func ValidateRFC3339Timestamp ¶ added in v1.35.14
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 ValidateUTCOffset ¶ added in v1.36.24
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
func ValueIgnoreEmpty ¶ added in v1.36.14
func ValueIgnoreEmpty(v interface{}) interface{}
ValueIgnoreEmpty returns to the string value. if v is empty, return nil
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 RetryContextWithWaitForStateParam ¶ added in v1.36.0
type RetryContextWithWaitForStateParam struct { Ctx context.Context // The func that need to be retried RetryFunc RetryFunc // The wait func when the retry which returned by the retry func is true WaitFunc resource.StateRefreshFunc // The target of the wait func WaitTarget []string // The pending of the wait func WaitPending []string // The timeout of the retry func and wait func Timeout time.Duration // The delay timeout of the retry func and wait func DelayTimeout time.Duration // The poll interval of the retry func and wait func PollInterval time.Duration }
type RetryFunc ¶ added in v1.36.0
RetryFunc is the function retried until it succeeds. The first return parameter is the result of the retry func. The second return parameter indicates whether a retry is required. The last return parameter is the error of the func.
type StringSearcher ¶
StringSearcher is string search structure with internal cache This allows single iteration from base slice for multiple string searches