diff --git a/nsone/resource_record.go b/nsone/resource_record.go index 060bf3c3b744..f96b68da1ea2 100644 --- a/nsone/resource_record.go +++ b/nsone/resource_record.go @@ -55,6 +55,11 @@ func recordResource() *schema.Resource { Optional: true, ForceNew: true, }, + "use_client_subnet": &schema.Schema{ + Type: schema.TypeBool, + Optional: true, + Default: true, + }, "answers": &schema.Schema{ Type: schema.TypeSet, Optional: true, @@ -124,6 +129,10 @@ func recordResource() *schema.Resource { Type: schema.TypeString, Optional: true, }, + "up": &schema.Schema{ + Type: schema.TypeBool, + Optional: true, + }, }, }, Set: regionsToHash, @@ -163,6 +172,7 @@ func regionsToHash(v interface{}) int { buf.WriteString(fmt.Sprintf("%s-", r["georegion"].(string))) buf.WriteString(fmt.Sprintf("%s-", r["country"].(string))) buf.WriteString(fmt.Sprintf("%s-", r["us_state"].(string))) + buf.WriteString(fmt.Sprintf("%t-", r["up"].(bool))) return hashcode.String(buf.String()) } @@ -263,6 +273,11 @@ func recordToResourceData(d *schema.ResourceData, r *nsone.Record) error { if len(region.Meta.USState) > 0 { new_region["us_state"] = region.Meta.USState[0] } + if region.Meta.Up { + new_region["up"] = region.Meta.Up + } else { + new_region["up"] = false + } regions = append(regions, new_region) } log.Printf("Setting regions %+v", regions) @@ -369,6 +384,11 @@ func resourceDataToRecord(r *nsone.Record, d *schema.ResourceData) error { if v, ok := d.GetOk("link"); ok { r.LinkTo(v.(string)) } + useClientSubnetVal := d.Get("use_client_subnet").(bool) + if v := strconv.FormatBool(useClientSubnetVal); v != "" { + r.UseClientSubnet = useClientSubnetVal + } + if rawFilters := d.Get("filters").([]interface{}); len(rawFilters) > 0 { f := make([]nsone.Filter, len(rawFilters)) for i, filter_raw := range rawFilters { @@ -410,6 +430,10 @@ func resourceDataToRecord(r *nsone.Record, d *schema.ResourceData) error { if g := region["us_state"].(string); g != "" { nsone_r.Meta.USState = []string{g} } + if g := region["up"].(bool); g { + nsone_r.Meta.Up = g + } + rm[region["name"].(string)] = nsone_r } r.Regions = rm diff --git a/yelppack/Makefile b/yelppack/Makefile index af44e44b09ba..5c03f60fc0b3 100644 --- a/yelppack/Makefile +++ b/yelppack/Makefile @@ -8,7 +8,7 @@ ifdef upstream_build_number else REAL_BUILD_NUMBER?=$(BUILD_NUMBER) endif -VERSION = 0.3 +VERSION = 0.4 ITERATION = yelp$(REAL_BUILD_NUMBER) ARCH := $(shell dpkg --print-architecture)