Skip to content

Commit

Permalink
Add private_ips list to gaussdb_mysql (#406)
Browse files Browse the repository at this point in the history
  • Loading branch information
niuzhenguo authored Jul 20, 2020
1 parent 25b6f26 commit 89ac2f2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions huaweicloud/resource_huaweicloud_gaussdb_cassandra_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,13 @@ func resourceGeminiDBInstanceV3() *schema.Resource {
Optional: true,
ForceNew: true,
},
"private_ips": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
"status": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -362,6 +369,7 @@ func resourceGeminiDBInstanceV3Read(d *schema.ResourceData, meta interface{}) er
dbList = append(dbList, db)
d.Set("datastore", dbList)

ipsList := []string{}
nodesList := make([]map[string]interface{}, 0, 1)
for _, group := range instance.Groups {
for _, Node := range group.Nodes {
Expand All @@ -372,9 +380,11 @@ func resourceGeminiDBInstanceV3Read(d *schema.ResourceData, meta interface{}) er
"private_ip": Node.PrivateIp,
}
nodesList = append(nodesList, node)
ipsList = append(ipsList, Node.PrivateIp)
}
}
d.Set("nodes", nodesList)
d.Set("private_ips", ipsList)

backupStrategyList := make([]map[string]interface{}, 0, 1)
backupStrategy := map[string]interface{}{
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/gaussdb_cassandra_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ In addition to the arguments listed above, the following computed attributes are
* `mode` - Indicates the instance type.
* `db_user_name` - Indicates the default username.
* `nodes` - Indicates the instance nodes information. Structure is documented below.
- `private_ips` - Indicates the IP address list of the db.

The `nodes` block contains:

Expand Down

0 comments on commit 89ac2f2

Please sign in to comment.