(d *schema.ResourceData, key string, value string, id string)
| 44 | } |
| 45 | |
| 46 | func setValueOrID(d *schema.ResourceData, key string, value string, id string) { |
| 47 | if cloudstack.IsID(d.Get(key).(string)) { |
| 48 | // If the given id is an empty string, check if the configured value matches |
| 49 | // the UnlimitedResourceID in which case we set id to UnlimitedResourceID |
| 50 | if id == "" && d.Get(key).(string) == cloudstack.UnlimitedResourceID { |
| 51 | id = cloudstack.UnlimitedResourceID |
| 52 | } |
| 53 | |
| 54 | d.Set(key, id) |
| 55 | } else { |
| 56 | d.Set(key, value) |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | func retrieveID(cs *cloudstack.CloudStackClient, name string, value string, opts ...cloudstack.OptionFunc) (id string, e *retrieveError) { |
| 61 | // If the supplied value isn't a ID, try to retrieve the ID ourselves |
no outgoing calls