Skip to content

Commit

Permalink
Update resource_gslbvserver with 12.1 fields
Browse files Browse the repository at this point in the history
  • Loading branch information
George Nikolopoulos committed Mar 13, 2019
1 parent 6f3c580 commit 31d5f30
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions netscaler/resource_gslbvserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ func resourceNetScalerGslbvserver() *schema.Resource {
Optional: true,
Computed: true,
},
"ecs": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
},
"ecsaddrvalidation": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
},
"edr": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -314,6 +324,8 @@ func createGslbvserverFunc(d *schema.ResourceData, meta interface{}) error {
Dnsrecordtype: d.Get("dnsrecordtype").(string),
Domainname: d.Get("domainname").(string),
Dynamicweight: d.Get("dynamicweight").(string),
Ecs: d.Get("ecs").(string),
Ecsaddrvalidation: d.Get("ecsaddrvalidation").(string),
Edr: d.Get("edr").(string),
Iptype: d.Get("iptype").(string),
Lbmethod: d.Get("lbmethod").(string),
Expand Down Expand Up @@ -398,6 +410,8 @@ func readGslbvserverFunc(d *schema.ResourceData, meta interface{}) error {
d.Set("dnsrecordtype", data["dnsrecordtype"])
d.Set("domainname", data["domainname"])
d.Set("dynamicweight", data["dynamicweight"])
d.Set("ecs", data["ecs"])
d.Set("ecsaddrvalidation", data["ecsaddrvalidation"])
d.Set("edr", data["edr"])
d.Set("iptype", data["iptype"])
d.Set("lbmethod", data["lbmethod"])
Expand Down Expand Up @@ -515,6 +529,16 @@ func updateGslbvserverFunc(d *schema.ResourceData, meta interface{}) error {
gslbvserver.Dynamicweight = d.Get("dynamicweight").(string)
hasChange = true
}
if d.HasChange("ecs") {
log.Printf("[DEBUG] netscaler-provider: Ecs has changed for gslbvserver %s, starting update", gslbvserverName)
gslbvserver.Ecs = d.Get("ecs").(string)
hasChange = true
}
if d.HasChange("ecsaddrvalidation") {
log.Printf("[DEBUG] netscaler-provider: Ecsaddrvalidation has changed for gslbvserver %s, starting update", gslbvserverName)
gslbvserver.Ecsaddrvalidation = d.Get("ecsaddrvalidation").(string)
hasChange = true
}
if d.HasChange("edr") {
log.Printf("[DEBUG] netscaler-provider: Edr has changed for gslbvserver %s, starting update", gslbvserverName)
gslbvserver.Edr = d.Get("edr").(string)
Expand Down

0 comments on commit 31d5f30

Please sign in to comment.