"status": {
Type: schema.TypeString,
- Optional: true,
+ Computed: true,
},
"uptime": {
Type: schema.TypeFloat,
- Optional: true,
+ Computed: true,
},
"node_locations": {
}
d.Set("test_id", fmt.Sprintf("%d", response.TestID))
+ d.Set("status", response.Status)
+ d.Set("uptime", fmt.Sprintf("%.3f", response.Uptime))
d.SetId(fmt.Sprintf("%d", response.TestID))
return ReadTest(d, meta)
if v, ok := d.GetOk("user_agent"); ok {
test.UserAgent = v.(string)
}
- if v, ok := d.GetOk("status"); ok {
- test.Status = v.(string)
- }
- if v, ok := d.GetOk("uptime"); ok {
- test.Uptime = v.(float64)
- }
if v, ok := d.GetOk("node_locations"); ok {
test.NodeLocations = v.([]string)
}
err = check(key, value, test.CustomHeader)
case "user_agent":
err = check(key, value, test.UserAgent)
- case "status":
- err = check(key, value, test.Status)
- case "uptime":
- err = check(key, value, strconv.FormatFloat(test.Uptime, 'f', -1, 64))
case "node_locations":
for _, tv := range test.NodeLocations {
err = check(key, value, tv)
trigger_rate = 20
custom_header = "{ \"Content-Type\": \"application/x-www-form-urlencoded\" }"
user_agent = "string9988"
- status = "string22117"
- uptime = 3498.27
node_locations = [ "string16045", "string19741", "string12122" ]
ping_url = "string8410"
basic_user = "string27052"