Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Discovery endpoint to Memcached Instance #2414

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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