Skip to content

Commit b3c0e1a

Browse files
author
Matthieu Berthomé
committed
regions_attributes
1 parent 5193409 commit b3c0e1a

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

ovh/resource_ovh_cloud_project_network_private.go

+26
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,28 @@ func resourceCloudProjectNetworkPrivate() *schema.Resource {
8383
},
8484
},
8585
},
86+
"regions_attributes": {
87+
Type: schema.TypeSet,
88+
Computed: true,
89+
Elem: &schema.Resource{
90+
Schema: map[string]*schema.Schema{
91+
"status": {
92+
Type: schema.TypeString,
93+
Required: true,
94+
},
95+
96+
"region": {
97+
Type: schema.TypeString,
98+
Computed: true,
99+
},
100+
101+
"openstackid": {
102+
Type: schema.TypeString,
103+
Computed: true,
104+
},
105+
},
106+
},
107+
},
86108
"status": {
87109
Type: schema.TypeString,
88110
Computed: true,
@@ -162,15 +184,19 @@ func resourceCloudProjectNetworkPrivateRead(d *schema.ResourceData, meta interfa
162184
d.Set("vlan_id", r.Vlanid)
163185

164186
regions_status := make([]map[string]interface{}, 0)
187+
regions_attributes := make([]map[string]interface{}, 0)
165188
regions := make([]string, 0)
166189

167190
for i := range r.Regions {
168191
region := make(map[string]interface{})
169192
region["region"] = r.Regions[i].Region
170193
region["status"] = r.Regions[i].Status
194+
region["openstackid"] = r.Regions[i].OpenStackId
195+
regions_attributes = append(regions_attributes, region)
171196
regions_status = append(regions_status, region)
172197
regions = append(regions, fmt.Sprintf(r.Regions[i].Region))
173198
}
199+
d.Set("regions_attributes", regions_attributes)
174200
d.Set("regions_status", regions_status)
175201
d.Set("regions", regions)
176202

ovh/types_cloud.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ type CloudProjectNetworkPrivateUpdateOpts struct {
2626
}
2727

2828
type CloudProjectNetworkPrivateRegion struct {
29-
Status string `json:"status"`
30-
Region string `json:"region"`
29+
Status string `json:"status"`
30+
Region string `json:"region"`
31+
OpenStackId string `json:"openstackId"`
3132
}
3233

3334
func (p *CloudProjectNetworkPrivateRegion) String() string {

0 commit comments

Comments
 (0)