File tree 1 file changed +10
-5
lines changed
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -139,13 +139,18 @@ func dataSourceIpLoadbalancing() *schema.Resource {
139
139
140
140
func dataSourceIpLoadbalancingRead (d * schema.ResourceData , meta interface {}) error {
141
141
config := meta .(* Config )
142
- log .Printf ("[DEBUG] Will list available iploadbalancing services" )
143
142
144
143
response := []string {}
145
- err := config .OVHClient .Get ("/ipLoadbalancing" , & response )
146
-
147
- if err != nil {
148
- return fmt .Errorf ("Error calling /ipLoadbalancing:\n \t %q" , err )
144
+ v , exists := d .GetOk ("service_name" )
145
+ if exists {
146
+ log .Printf ("[DEBUG] Will use provided iploadbalancing service" )
147
+ response = append (response , v .(string ))
148
+ } else {
149
+ log .Printf ("[DEBUG] Will list available iploadbalancing services" )
150
+ err := config .OVHClient .Get ("/ipLoadbalancing" , & response )
151
+ if err != nil {
152
+ return fmt .Errorf ("Error calling /ipLoadbalancing:\n \t %q" , err )
153
+ }
149
154
}
150
155
151
156
filtered_iplbs := []* IpLoadbalancing {}
You can’t perform that action at this time.
0 commit comments