Documentation ¶
Index ¶
- func GetFailToStartAndHaltXOClient(d *schema.ResourceData) (interface{}, error)
- func String(s string) int
- func Strings(strings []string) string
- func TestCheckTypeListAttrSorted(name, attr, sortOrder string) resource.TestCheckFunc
- func TestCheckTypeSetAttr(nameFirst, keyFirst, value string) resource.TestCheckFunc
- func TestCheckTypeSetElemAttrPair(nameFirst, keyFirst, nameSecond, keySecond string) resource.TestCheckFunc
- func TestCheckTypeSetElemNestedAttrs(name, attr string, values map[string]string) resource.TestCheckFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFailToStartAndHaltXOClient ¶
func GetFailToStartAndHaltXOClient(d *schema.ResourceData) (interface{}, error)
func String ¶
String hashes a string to a unique hashcode.
crc32 returns a uint32, but for our use we need and non negative integer. Here we cast to an integer and invert it if the result is negative.
func TestCheckTypeListAttrSorted ¶
func TestCheckTypeListAttrSorted(name, attr, sortOrder string) resource.TestCheckFunc
TestCheckTypeListAttrSorted is a resource.TestCheckFunc that accepts a resource name, an attribute path, which should use the sentinel value '*' for indexing into a TypeList. The function verifies that the given list is sorted in an ascending or descending fashion.
The following invocation would pass with the terraform state given below: e.g. internal.TestCheckTypeListAttrSorted("data.xenorchestra_hosts.hosts, "hosts.*.name_label", "asc"),
STATE:
data.xenorchestra_hosts.hosts:
ID = 0aea61f4-c9d1-4060-94e8-4eb2024d082c provider = provider.xenorchestra hosts.# = 3 hosts.0.name_label = R620-L1 hosts.1.name_label = R620-L3 hosts.2.name_label = R620-L2 sort_by = name_label sort_order = asc
func TestCheckTypeSetAttr ¶
func TestCheckTypeSetAttr(nameFirst, keyFirst, value string) resource.TestCheckFunc
func TestCheckTypeSetElemAttrPair ¶
func TestCheckTypeSetElemAttrPair(nameFirst, keyFirst, nameSecond, keySecond string) resource.TestCheckFunc
TestCheckTypeSetElemAttrPair is a TestCheckFunc that verifies a pair of name/key combinations are equal where the first uses the sentinel value to index into a TypeSet.
E.g., tfawsresource.TestCheckTypeSetElemAttrPair("aws_autoscaling_group.bar", "availability_zones.*", "data.aws_availability_zones.available", "names.0")
func TestCheckTypeSetElemNestedAttrs ¶
func TestCheckTypeSetElemNestedAttrs(name, attr string, values map[string]string) resource.TestCheckFunc
TestCheckTypeSetElemNestedAttrs is a resource.TestCheckFunc that accepts a resource name, an attribute path, which should use the sentinel value '*' for indexing into a TypeSet. The function verifies that an element matches the whole value map.
You may check for unset keys, however this will also match keys set to empty string. Please provide a map with at least 1 non-empty value.
map[string]string{ "key1": "value", "key2": "", }
Use this function over SDK provided TestCheckFunctions when validating a TypeSet where its elements are a nested object with their own attrs/values.
Please note, if the provided value map is not granular enough, there exists the possibility you match an element you were not intending to, in the TypeSet. Provide a full mapping of attributes to be sure the unique element exists.
Types ¶
This section is empty.