Documentation
¶
Index ¶
- Constants
- Variables
- func Base64EncodeString(str string) string
- func Bool(v bool) *bool
- func BuildNewFormatByConfig(format string) string
- func BuildSysTags(enterpriseProjectID string) (enterpriseProjectTags []tags.ResourceTag)
- func CalculateNextWholeHourAfterFewTime(inputTimeStr string, interval time.Duration, customOutputFormat ...string) string
- func CompareJsonTemplateAreEquivalent(tem1, tem2 string) (bool, error)
- func ComposeAnySchemaDiffSuppressFunc(fs ...schema.SchemaDiffSuppressFunc) schema.SchemaDiffSuppressFunc
- func ContainsAllKeyValues(objA, objB map[string]interface{}) bool
- func ConvertMemoryUnit(memory interface{}, diffLevel int) int
- func ConvertStructToMap(obj interface{}, nameMap map[string]string) (map[string]interface{}, error)
- func ConvertTimeStrToNanoTimestamp(timeStr string, customFormat ...string) int64
- func CreateResourceTags(client *golangsdk.ServiceClient, d *schema.ResourceData, ...) error
- func DecodeHashAndHexEncode(v interface{}) string
- func DeleteResourceTagsWithKeys(client *golangsdk.ServiceClient, tagKeys []string, resourceType, id string) error
- func EqualFloat(a, b float64) bool
- func ExpandResourceTags(tagmap map[string]interface{}) []tags.ResourceTag
- func ExpandResourceTagsMap(tagmap map[string]interface{}, keepEmpty ...bool) []map[string]interface{}
- func ExpandToInt32List(v []interface{}) []int32
- func ExpandToInt32ListPointer(v []interface{}) *[]int32
- func ExpandToIntList(v []interface{}) []int
- func ExpandToStringList(v []interface{}) []string
- func ExpandToStringListBySet(v *schema.Set) []string
- func ExpandToStringListPointer(v []interface{}) *[]string
- func ExpandToStringMap(v map[string]interface{}) map[string]string
- func FilterMapWithSameKey(rawMap, filterMap map[string]interface{}) map[string]interface{}
- func FilterSliceWithField(all interface{}, filter map[string]interface{}) ([]interface{}, error)
- func FilterSliceWithZeroField(all interface{}, filter map[string]interface{}) ([]interface{}, error)
- func FindDecreaseKeys(objA, objB map[string]interface{}) map[string]interface{}
- func FindSliceExtraElems(source, target []interface{}) []interface{}
- func FlattenResponse(resp *http.Response) (interface{}, error)
- func FlattenSameKeyTagsToMap(d *schema.ResourceData, remoteTags interface{}) map[string]interface{}
- func FlattenTagsToMap(tags interface{}) map[string]interface{}
- func Float64(v float64) *float64
- func FormatTimeStampRFC3339(timestamp int64, isUTC bool, customFormat ...string) string
- func FormatTimeStampUTC(timestamp int64) string
- func FormatUTCTimeStamp(utcTime string) (int64, error)
- func GetBeforeOrAfterDate(inputTime time.Time, day int, customFormat ...string) string
- func GetCurrentTime(isUTC bool, customFormat ...string) string
- func GetDNSRecordSetTagType(zoneType string) (string, error)
- func GetDNSZoneTagType(zoneType string) (string, error)
- func GetTimezoneCode() int
- func Green(str interface{}) string
- func HasMapContains(rawMap map[string]string, filterMap map[string]interface{}) bool
- func HashAndHexEncode(v interface{}) string
- func Int(v int) *int
- func Int32(v int32) *int32
- func Int32IgnoreEmpty(v int32) *int32
- func Int64IgnoreEmpty(v int64) *int64
- func IntIgnoreEmpty(v int) *int
- func IsDebugOrHigher() bool
- func IsIPv4Address(addr string) bool
- 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 IsUUID(uuid string) bool
- func IsUUIDWithHyphens(uuid string) bool
- func JSONStringsEqual(s1, s2 string) bool
- func JsonMarshal(t interface{}) ([]byte, error)
- func JsonToString(jsonObj interface{}) string
- func MarshalValue(i interface{}) string
- func NormalizeJsonString(jsonString interface{}) (string, error)
- func ParseEnterpriseProjectIdFromSysTags(value []tags.ResourceTag) (enterpriseProjectId string)
- func PasswordEncrypt(password string) (string, error)
- func PathSearch(expression string, obj interface{}, defaultValue interface{}) interface{}
- func Power(base int, exponent int) int
- func RandomString(n int, allowedChars ...[]rune) (result string)
- func RefreshObjectParamOriginValues(d *schema.ResourceData, objectParamKeys []string) error
- func RemoveDuplicateElem(s []string) []string
- func RemoveNil(data map[string]interface{}) map[string]interface{}
- func Reverse(s string) string
- func Round(num float64, precision int) float64
- func Salt(size int) ([]byte, error)
- func SchemaDesc(description string, schemaDescInput SchemaDescInput) string
- func SetResourceTagsToState(d *schema.ResourceData, client *golangsdk.ServiceClient, ...) error
- func SliceContains(slice []interface{}, target interface{}) bool
- func StrSliceContains(haystack []string, needle string) bool
- func StrSliceContainsAnother(b []string, s []string) bool
- func String(v string) *string
- func StringIgnoreEmpty(v string) *string
- func StringToBool(v interface{}) *bool
- func StringToInt(i *string) *int
- func StringToJson(jsonStrObj string, defaultVal ...interface{}) interface{}
- func StringToJsonArray(jsonStrArray string) []map[string]interface{}
- func StringValue(v *string) string
- func SuppressCaseDiffs() schema.SchemaDiffSuppressFunc
- func SuppressDiffAll(k, old, new string, d *schema.ResourceData) bool
- func SuppressEquivalentAwsPolicyDiffs(k, old, new string, d *schema.ResourceData) bool
- func SuppressEquivilentTimeDiffs(k, old, new string, d *schema.ResourceData) bool
- func SuppressLBWhitelistDiffs(k, old, new string, d *schema.ResourceData) bool
- func SuppressMapDiffs() schema.SchemaDiffSuppressFunc
- func SuppressMinDisk(k, old, new string, d *schema.ResourceData) bool
- func SuppressNewLineDiffs(k, old, new string, d *schema.ResourceData) bool
- func SuppressObjectDiffs() schema.SchemaDiffSuppressFunc
- func SuppressSnatFiplistDiffs(k, old, new string, d *schema.ResourceData) bool
- func SuppressStringSepratedByCommaDiffs(_, old, new string, _ *schema.ResourceData) bool
- func SuppressTrimSpace(_, old, new string, _ *schema.ResourceData) bool
- func SuppressUserData(k, old, new string, d *schema.ResourceData) bool
- func SuppressVersionDiffs(k, old, new string, d *schema.ResourceData) bool
- func TagsToMap(tags []tags.ResourceTag) map[string]string
- func TakeObjectsDifferent(objA, objB map[string]interface{}) map[string]interface{}
- func TryBase64EncodeString(str string) string
- func TryMapValueAnalysis(v interface{}) map[string]interface{}
- func TryPasswordEncrypt(password string) (string, error)
- func UpdateResourceTags(conn *golangsdk.ServiceClient, d *schema.ResourceData, resourceType, id string) error
- func ValidateCIDR(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 ValidateJsonString(v interface{}, k string) (ws []string, errors []error)
- func ValidateName(v interface{}, k string) (ws []string, errors []error)
- func ValidateString64WithChinese(v interface{}, k string) (ws []string, errors []error)
- func ValidateTrueOnly(v interface{}, k string) (ws []string, errors []error)
- func ValidateVBSBackupDescription(v interface{}, k string) (ws []string, errors []error)
- func ValidateVBSBackupName(v interface{}, k string) (ws []string, errors []error)
- func ValidateVBSPolicyName(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 ValueIgnoreEmpty(v interface{}) interface{}
- func WriteToPemFile(path, privateKey string) (err error)
- func Yellow(str interface{}) string
- type SchemaDescInput
Constants ¶
const REPLACE_REG = "(?i)huaweicloud"
const SysTagKeyEnterpriseProjectId = "_sys_enterprise_project_id"
Variables ¶
var PackageName string
var ValidateSubnetV2IPv6Mode = validation.StringInSlice([]string{ "slaac", "dhcpv6-stateful", "dhcpv6-stateless", }, false)
Functions ¶
func Base64EncodeString ¶ added in v1.44.1
Base64EncodeString is used to encode a string by base64.
func BuildNewFormatByConfig ¶ added in v1.26.0
func BuildSysTags ¶ added in v1.34.0
func BuildSysTags(enterpriseProjectID string) (enterpriseProjectTags []tags.ResourceTag)
func CalculateNextWholeHourAfterFewTime ¶ added in v1.67.1
func CalculateNextWholeHourAfterFewTime(inputTimeStr string, interval time.Duration, customOutputFormat ...string) string
CalculateNextWholeHourAfterFewTime method is used to calculate the minimum whole hour after X (interval, unit: hours/minutes/seconds) time. + inputTimeStr: UTC input time, not timestamp. For example: 2024-08-01T02:10:35Z + interval: Time interval + customOutputFormat: Custom output time format, the default output format is RFC3339 time
func ComposeAnySchemaDiffSuppressFunc ¶ added in v1.73.4
func ComposeAnySchemaDiffSuppressFunc(fs ...schema.SchemaDiffSuppressFunc) schema.SchemaDiffSuppressFunc
ComposeAnySchemaDiffSuppressFunc allows parameters to determine multiple Diff methods. When any method (SchemaDiffSuppressFunc) returns true, this compose function will return true. It will only return false when all methods (SchemaDiffSuppressFunc) return false.
func ContainsAllKeyValues ¶ added in v1.73.4
ContainsAllKeyValues checks whether object A (type map[string]interface{}) recursively contains all the keys and corresponding values of object B (type map[string]interface{}). If the key-value pair in object B exists in object A and the values are equal (recursively processing nested maps), return true; otherwise return false.
func ConvertMemoryUnit ¶ added in v1.58.0
ConvertMemoryUnit is a method that used to convert the memory unit. Parameters: + memory: The memory size of the current unit, only supports int value or string corresponding to int value. + diffLevel: Difference level between units before and after conversion. diffLevel greater than 0 means that the unit is converted to a higher level, and vice versa to a lower level, e.g. the unit of memory input is MB, -2 means it is converted from MB to B, and 2 means it is converted from MB to TB.
func ConvertStructToMap ¶
ConvertStructToMap converts an instance of struct to a map object, and changes each key of fileds to the value of 'nameMap' if the key in it or to its corresponding lowercase.
func ConvertTimeStrToNanoTimestamp ¶ added in v1.63.1
ConvertTimeStrToNanoTimestamp is a method that used to convert the time string into the corresponding timestamp (in nanosecond), e.g. The supported time formats are as follows:
- RFC3339 format: 2006-01-02T15:04:05Z (default time format, if you are missing customFormat input) 2006-01-02T15:04:05.000000Z 2006-01-02T15:04:05Z08:00
- Other time formats: 2006-01-02 15:04:05 2006-01-02 15:04:05+08:00 2006-01-02T15:04:05 ...
Two common uses are shown below: - ConvertTimeStrToNanoTimestamp("2024-01-01T00:00:00Z") - ConvertTimeStrToNanoTimestamp("2024-01-01T00:00:00+08:00", "2006-01-02T15:04:05Z08:00")
func CreateResourceTags ¶ added in v1.46.0
func CreateResourceTags(client *golangsdk.ServiceClient, d *schema.ResourceData, resourceType, id string) error
CreateResourceTags is a helper to create the tags for a resource. It expects the schema name must be "tags"
func DecodeHashAndHexEncode ¶ added in v1.31.1
func DecodeHashAndHexEncode(v interface{}) string
DecodeHashAndHexEncode is one of the implementations of SchemaStateFunc. The function tries to decode v if it is in base64 format, then gets the hash of decode string and returns the hexadecimal encoding string. If the type of v is not string, just returns an empty string.
func DeleteResourceTagsWithKeys ¶ added in v1.46.0
func DeleteResourceTagsWithKeys(client *golangsdk.ServiceClient, tagKeys []string, resourceType, id string) error
DeleteResourceTagsWithKeys is a helper to delete the tags with tagKeys for a resource.
func EqualFloat ¶ added in v1.73.4
EqualFloat is a method that used to compare two floating point numbers for equality (accounting for precision).
func ExpandResourceTags ¶
func ExpandResourceTags(tagmap map[string]interface{}) []tags.ResourceTag
ExpandResourceTags returns the tags for the given map of data.
func ExpandResourceTagsMap ¶ added in v1.44.0
func ExpandResourceTagsMap(tagmap map[string]interface{}, keepEmpty ...bool) []map[string]interface{}
ExpandResourceTagsMap returns the tags in format of list of maps for the given map of data. Parameters: + tagmap: tags input with the map structure format. + keepEmpty: whether to keep the empty list return instead of the nil.
func ExpandToInt32List ¶ added in v1.38.0
func ExpandToInt32List(v []interface{}) []int32
ExpandToInt32List takes the result for an array of intgers and returns a []int32
func ExpandToInt32ListPointer ¶ added in v1.38.0
func ExpandToInt32ListPointer(v []interface{}) *[]int32
ExpandToInt32ListPointer takes the result for an array of in32 and returns a pointer of the array
func ExpandToIntList ¶ added in v1.29.0
func ExpandToIntList(v []interface{}) []int
ExpandToIntList takes the result for an array of intgers and returns a []int
func ExpandToStringList ¶
func ExpandToStringList(v []interface{}) []string
ExpandToStringList takes the result for an array of strings and returns a []string
func ExpandToStringListBySet ¶ added in v1.29.0
ExpandToStringListBySet takes the result for a set of strings and returns a []string
func ExpandToStringListPointer ¶ added in v1.36.0
func ExpandToStringListPointer(v []interface{}) *[]string
ExpandToStringListPointer takes the result for an array of strings and returns a pointer of the array
func ExpandToStringMap ¶ added in v1.53.0
ExpandToStringMap takes the result for a map of string and returns a map[string]string
func FilterMapWithSameKey ¶ added in v1.73.0
FilterMapWithSameKey using to filter the value of `filterMap` by the key of `rawMap`, and return the filtered map. Example: Parameters rawMap = {"a":"b"}, filterMap = {"a":"d"}; Return {"a":"d"} Parameters rawMap = {"a":"b"}, filterMap = {"a":"d", "m":"n"}; Return {"a":"d"} Parameters rawMap = {"a":"b", "c":"d"}, filterMap = {"a":"d", "m":"n"}; Return {"a":"d"} Parameters rawMap = {"a":"b", "c":"d"}, filterMap = {"a":"d", "c":"a", "m":"n"}; Return {"a":"d", "c":"a"} Parameters rawMap = {"a":"b"}, filterMap = {}; Return {} Parameters rawMap = {}, filterMap = {"m":"n"}; Return {} Parameters rawMap = {}, filterMap = {}; Return {}
func FilterSliceWithField ¶ added in v1.30.0
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 FilterSliceWithZeroField ¶ added in v1.30.0
func FilterSliceWithZeroField(all interface{}, filter map[string]interface{}) ([]interface{}, error)
FilterSliceWithZeroField can filter the slice all through a map filter.
func FindDecreaseKeys ¶ added in v1.73.4
FindDecreaseKeys is a method that used to find out the key that objB is missing compared to objA. Will ignore the increase parts.
func FindSliceExtraElems ¶ added in v1.73.9
func FindSliceExtraElems(source, target []interface{}) []interface{}
FindSliceExtraElems returns a list containing the extra keys in source compared to target. In math, means source-target(A-B).
func FlattenResponse ¶ added in v1.39.0
FlattenResponse returns the api response body if it's not empty
func FlattenSameKeyTagsToMap ¶ added in v1.73.0
func FlattenSameKeyTagsToMap(d *schema.ResourceData, remoteTags interface{}) map[string]interface{}
FlattenSameKeyTagsToMap using to flatten remote tag list and filter tag map with same key. Parameters: + d : It is required that there is a `tags` field of map type in the parameter. + remoteTags: It is required that the parameter is a tag list, for example: [{"key":"key1","value":"value1"}].
func FlattenTagsToMap ¶ added in v1.41.0
func FlattenTagsToMap(tags interface{}) map[string]interface{}
FlattenTagsToMap returns the list of tags into a map.
func FormatTimeStampRFC3339 ¶ added in v1.26.0
FormatTimeStampRFC3339 is used to unify the time format to RFC-3339 and return a time string. We can use "isUTC" parameter to reset the timezone. If omitted, the method will return local time. Parameter "customFormat" allows you to use a custom RFC3339 format, such as: "2006-01-02T15:04:05.000Z", this parameter can be omitted.
func FormatTimeStampUTC ¶ added in v1.35.0
FormatTimeStampUTC is used to unify the unix second time to UTC time string, format: YYYY-MM-DD HH:MM:SS.
func FormatUTCTimeStamp ¶ added in v1.38.0
FormatTimeStampUTC is used to unify the unix second time to UTC time string, format: YYYY-MM-DD HH:MM:SS.
func GetBeforeOrAfterDate ¶ added in v1.69.0
GetBeforeOrAfterDate is used to get a few days ago or a few days after. + day: The number of days forward or backward, `-` indicates backward. + customFormat: Custom output time format, default RFC3339 format
func GetCurrentTime ¶ added in v1.67.1
GetCurrentTime is used to get the current time. + isUTC: Whether to generate UTC time + customFormat: Custom output time format, default RFC3339 format
func GetDNSRecordSetTagType ¶
GetDNSRecordSetTagType returns resource tag type of DNS record set by zoneType
func GetDNSZoneTagType ¶
GetDNSZoneTagType returns resource tag type of DNS zone by zoneType
func GetTimezoneCode ¶ added in v1.42.0
func GetTimezoneCode() int
GetTimezoneCode calculates the time zone code and returns a signed number. For example, the time zone code for 'Asia/Shanghai' is 8, and the time zone code for 'America/Alaska' is -4.
func HasMapContains ¶ added in v1.32.0
This function compares whether there is a containment relationship between two maps, that is, whether map A (rawMap) contains map B (filterMap).
Map A is {'foo': 'bar'} and filter map B is {'foo': 'bar'} or {'foo': 'bar,dor'} will return true. Map A is {'foo': 'bar'} and filter map B is {'foo': 'dor'} or {'foo1': 'bar'} will return false. Map A is {'foo': 'bar'} and filter map B is {'foo': ''} will return true. Map A is {'foo': 'bar'} and filter map B is {'': 'bar'} or {'': ''} will return false.
The value of filter map 'bar,for' means that the object value can be either 'bar' or 'dor'. Note: There is no spaces before and after the delimiter (,).
func HashAndHexEncode ¶ added in v1.31.1
func HashAndHexEncode(v interface{}) string
HashAndHexEncode is one of the implementations of SchemaStateFunc. The function gets the hash of v then returns the hexadecimal encoding string. If the type of v is not string, just returns an empty string.
func Int32IgnoreEmpty ¶ added in v1.38.0
Int32 returns a pointer to the int32 value. if v is empty, return nil
func Int64IgnoreEmpty ¶ added in v1.38.0
Int32 returns a pointer to the int32 value
func IntIgnoreEmpty ¶ added in v1.39.0
Int returns a pointer to the int value. if v is empty, return nil
func IsDebugOrHigher ¶ added in v1.39.0
func IsDebugOrHigher() bool
func IsIPv4Address ¶ added in v1.32.0
IsIPv4Address is used to check whether the addr string is IPv4 format
func IsResourceNotFound ¶
func IsSliceContainsAnyAnotherSliceElement ¶ added in v1.64.2
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.38.0
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 IsUUID ¶ added in v1.61.0
IsUUID is a method used to determine whether a string is in UUID format.
func IsUUIDWithHyphens ¶ added in v1.73.2
IsUUIDWithHyphens is a method used to determine whether a string is in UUID format with hyphens.
func JSONStringsEqual ¶ added in v1.49.0
JSONStringsEqual is the function for comparing the contents of two json strings regardless of their formatting. Tabs (\r \n \t) and the order of elements are not included in the comparison. These json strings are same: + "{\n\"key1\":\"value1\",\n\"key2\":\"value2\"\n}" + "{\"key1\":\"value1\",\"key2\":\"value2\"}" + "{\"key2\":\"value2\",\"key1\":\"value1\"}"
func JsonMarshal ¶
func JsonToString ¶ added in v1.69.1
func JsonToString(jsonObj interface{}) string
Try to convert the JSON object to the string value, if the operation failed, returns an empty string.
func MarshalValue ¶ added in v1.37.0
func MarshalValue(i interface{}) string
MarshalValue is used to marshal the value of struct in huaweicloud-sdk-go-v3, like this: type Xxxx struct { value string }
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 ParseEnterpriseProjectIdFromSysTags ¶ added in v1.34.0
func ParseEnterpriseProjectIdFromSysTags(value []tags.ResourceTag) (enterpriseProjectId string)
func PasswordEncrypt ¶ added in v1.33.0
PasswordEncrypt encrypts given password with sha512
func PathSearch ¶ added in v1.39.0
func PathSearch(expression string, obj interface{}, defaultValue interface{}) interface{}
PathSearch evaluates a JMESPath expression against input data and returns the result.
func Power ¶ added in v1.58.0
Power is a method for calculating powers of exponents. The result is base^exponent (^ is the exponential operator).
func RandomString ¶ added in v1.38.0
RandomString returns a random string with a fixed length. You can also define a custom random character set. Note: make sure the number is not a negative integer or a big integer.
func RefreshObjectParamOriginValues ¶ added in v1.73.4
func RefreshObjectParamOriginValues(d *schema.ResourceData, objectParamKeys []string) error
func RemoveDuplicateElem ¶
RemoveDuplicateElem removes duplicate elements from slice
func Reverse ¶ added in v1.48.0
Reverse is a function that used to reverse the order of the characters in the given string.
func Round ¶ added in v1.73.4
Round is a method that used to round a floating point number to a specified number of decimal places. Argument inputs: + num: the number to be rounded. + precision: the number of decimal places to be retained.
func SchemaDesc ¶ added in v1.56.0
func SchemaDesc(description string, schemaDescInput SchemaDescInput) string
func SetResourceTagsToState ¶ added in v1.29.0
func SetResourceTagsToState(d *schema.ResourceData, client *golangsdk.ServiceClient, resourceType, id string) error
SetResourceTagsToState is a helper to query tags of resource, then set to state. The schema argument name must be: tags
func SliceContains ¶ added in v1.70.0
func SliceContains(slice []interface{}, target interface{}) bool
SliceContains checks if a target object is present in a slice (the type of the elemetes which same as the target object).
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.38.1
StrSliceContainsAnother checks whether a string slice (b) contains another string slice (s).
func StringIgnoreEmpty ¶ added in v1.37.0
returns a pointer to the string value. if v is empty, return nil
func StringToBool ¶ added in v1.50.0
func StringToBool(v interface{}) *bool
StringToBool convert the string to boolean, and return the pointer of boolean value
func StringToInt ¶ added in v1.37.0
StringToInt convert the string to int, and return the pointer of int value
func StringToJson ¶ added in v1.69.1
func StringToJson(jsonStrObj string, defaultVal ...interface{}) interface{}
Try to parse the string value as the JSON format, if the operation failed, returns an empty map result.
func StringToJsonArray ¶ added in v1.72.2
Try to parse the string value as the JSON array format, if the operation failed, returns an empty list result.
func StringValue ¶ added in v1.38.0
StringValue returns the string value
func SuppressCaseDiffs ¶
func SuppressCaseDiffs() schema.SchemaDiffSuppressFunc
The SuppressCaseDiffs method compares the old and new values of the current parameter to determine if their contents are consistent while ignoring the case format.
func SuppressDiffAll ¶
func SuppressDiffAll(k, old, new string, d *schema.ResourceData) bool
Suppress all changes
func SuppressEquivalentAwsPolicyDiffs ¶
func SuppressEquivalentAwsPolicyDiffs(k, old, new string, d *schema.ResourceData) bool
func SuppressEquivilentTimeDiffs ¶
func SuppressEquivilentTimeDiffs(k, old, new string, d *schema.ResourceData) bool
func SuppressLBWhitelistDiffs ¶
func SuppressLBWhitelistDiffs(k, old, new string, d *schema.ResourceData) bool
func SuppressMapDiffs ¶ added in v1.73.7
func SuppressMapDiffs() schema.SchemaDiffSuppressFunc
func SuppressMinDisk ¶
func SuppressMinDisk(k, old, new string, d *schema.ResourceData) bool
Suppress changes if we get a computed min_disk_gb if value is unspecified (default 0)
func SuppressNewLineDiffs ¶
func SuppressNewLineDiffs(k, old, new string, d *schema.ResourceData) bool
Suppress changes if we get a string with or without new line
func SuppressObjectDiffs ¶ added in v1.73.4
func SuppressObjectDiffs() schema.SchemaDiffSuppressFunc
SuppressObjectDiffs is a method that make the JSON string type parameter ignore the changes made on the console and only allow the local script to take effect.
func SuppressSnatFiplistDiffs ¶
func SuppressSnatFiplistDiffs(k, old, new string, d *schema.ResourceData) bool
func SuppressStringSepratedByCommaDiffs ¶ added in v1.61.1
func SuppressStringSepratedByCommaDiffs(_, old, new string, _ *schema.ResourceData) bool
func SuppressTrimSpace ¶ added in v1.57.0
func SuppressTrimSpace(_, old, new string, _ *schema.ResourceData) bool
func SuppressUserData ¶ added in v1.43.0
func SuppressUserData(k, old, new string, d *schema.ResourceData) bool
Suppress changes if we get a base64 format or plaint text user_data
func SuppressVersionDiffs ¶ added in v1.35.0
func SuppressVersionDiffs(k, old, new string, d *schema.ResourceData) bool
func TagsToMap ¶
func TagsToMap(tags []tags.ResourceTag) map[string]string
TagsToMap returns the list of tags into a map.
func TakeObjectsDifferent ¶ added in v1.73.4
TakeObjectsDifferent is a method that used to recursively get the complement of object A (objA) compared to object B (objB) (including nested differences). In Math, it means A-B, also A\B or {x | x∈A,x∉B}.
func TryBase64EncodeString ¶ added in v1.44.1
TryBase64EncodeString will encode a string with base64. If the string is already base64 encoded, returns it directly.
func TryMapValueAnalysis ¶ added in v1.73.4
func TryMapValueAnalysis(v interface{}) map[string]interface{}
func TryPasswordEncrypt ¶ added in v1.33.0
TryPasswordEncrypt tries to encrypt given password if it's not encrypted
func UpdateResourceTags ¶
func UpdateResourceTags(conn *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 ValidateIP ¶
func ValidateIPRange ¶
func ValidateJsonString ¶
func ValidateName ¶
lintignore:V001
func ValidateString64WithChinese ¶
lintignore:V001
func ValidateTrueOnly ¶
func ValidateVBSBackupDescription ¶
lintignore:V001
func ValidateVBSBackupName ¶
lintignore:V001
func ValidateVBSPolicyName ¶
lintignore:V001
func ValidateVBSTagKey ¶
lintignore:V001
func ValidateVBSTagValue ¶
lintignore:V001
func ValueIgnoreEmpty ¶ added in v1.65.1
func ValueIgnoreEmpty(v interface{}) interface{}
ValueIgnoreEmpty returns to the string value. if v is empty, return nil
func WriteToPemFile ¶ added in v1.37.0
WriteToPemFile is used to write the keypair to Pem file.
Types ¶
type SchemaDescInput ¶ added in v1.56.0
type SchemaDescInput struct { Internal bool `json:"Internal,omitempty"` Deprecated bool `json:"Deprecated,omitempty"` Required bool `json:"Required,omitempty"` Computed bool `json:"Computed,omitempty"` ForceNew bool `json:"ForceNew,omitempty"` Unscope []string `json:"Unscope,omitempty"` UsedBy []string `json:"UsedBy,omitempty"` }