Skip to content

Commit

Permalink
add discovery endpoint (#3891) (#2414)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Aug 24, 2020
1 parent bd0d914 commit 0313dd9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/3891.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
memcached: added discovery_endpoint to `resource_memcached_instance`
```
12 changes: 12 additions & 0 deletions google-beta/resource_memcache_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ provided, all zones will be used.`,
Computed: true,
Description: `Creation timestamp in RFC3339 text format.`,
},
"discovery_endpoint": {
Type: schema.TypeString,
Computed: true,
Description: `Endpoint for Discovery API`,
},
"memcache_full_version": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -335,6 +340,9 @@ func resourceMemcacheInstanceRead(d *schema.ResourceData, meta interface{}) erro
if err := d.Set("create_time", flattenMemcacheInstanceCreateTime(res["createTime"], d, config)); err != nil {
return fmt.Errorf("Error reading Instance: %s", err)
}
if err := d.Set("discovery_endpoint", flattenMemcacheInstanceDiscoveryEndpoint(res["discoveryEndpoint"], d, config)); err != nil {
return fmt.Errorf("Error reading Instance: %s", err)
}
if err := d.Set("labels", flattenMemcacheInstanceLabels(res["labels"], d, config)); err != nil {
return fmt.Errorf("Error reading Instance: %s", err)
}
Expand Down Expand Up @@ -562,6 +570,10 @@ func flattenMemcacheInstanceCreateTime(v interface{}, d *schema.ResourceData, co
return v
}

func flattenMemcacheInstanceDiscoveryEndpoint(v interface{}, d *schema.ResourceData, config *Config) interface{} {
return v
}

func flattenMemcacheInstanceLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} {
return v
}
Expand Down
3 changes: 3 additions & 0 deletions website/docs/r/memcache_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ In addition to the arguments listed above, the following computed attributes are
* `create_time` -
Creation timestamp in RFC3339 text format.

* `discovery_endpoint` -
Endpoint for Discovery API

* `memcache_full_version` -
The full version of memcached server running on this instance.

Expand Down

0 comments on commit 0313dd9

Please sign in to comment.