@@ -73,36 +73,36 @@ func dataSourceCloudProjectDatabasePostgresqlConnectionPool() *schema.Resource {
73
73
func dataSourceCloudProjectDatabasePostgresqlConnectionPoolRead (ctx context.Context , d * schema.ResourceData , meta interface {}) diag.Diagnostics {
74
74
config := meta .(* Config )
75
75
serviceName := d .Get ("service_name" ).(string )
76
- clusterId := d .Get ("cluster_id" ).(string )
76
+ clusterID := d .Get ("cluster_id" ).(string )
77
77
name := d .Get ("name" ).(string )
78
78
79
79
listEndpoint := fmt .Sprintf ("/cloud/project/%s/database/postgresql/%s/connectionPool" ,
80
80
url .PathEscape (serviceName ),
81
- url .PathEscape (clusterId ),
81
+ url .PathEscape (clusterID ),
82
82
)
83
83
84
84
listRes := make ([]string , 0 )
85
85
86
- log .Printf ("[DEBUG] Will read connectionPools from cluster %s from project %s" , clusterId , serviceName )
86
+ log .Printf ("[DEBUG] Will read connectionPools from cluster %s from project %s" , clusterID , serviceName )
87
87
if err := config .OVHClient .GetWithContext (ctx , listEndpoint , & listRes ); err != nil {
88
88
return diag .Errorf ("Error calling GET %s:\n \t %q" , listEndpoint , err )
89
89
}
90
90
91
91
for _ , id := range listRes {
92
92
endpoint := fmt .Sprintf ("/cloud/project/%s/database/postgresql/%s/connectionPool/%s" ,
93
93
url .PathEscape (serviceName ),
94
- url .PathEscape (clusterId ),
94
+ url .PathEscape (clusterID ),
95
95
url .PathEscape (id ),
96
96
)
97
97
res := & CloudProjectDatabasePostgresqlConnectionPoolResponse {}
98
98
99
- log .Printf ("[DEBUG] Will read connectionPool %s from cluster %s from project %s" , id , clusterId , serviceName )
99
+ log .Printf ("[DEBUG] Will read connectionPool %s from cluster %s from project %s" , id , clusterID , serviceName )
100
100
if err := config .OVHClient .GetWithContext (ctx , endpoint , res ); err != nil {
101
101
return diag .Errorf ("Error calling GET %s:\n \t %q" , endpoint , err )
102
102
}
103
103
104
104
if res .Name == name {
105
- for k , v := range res .ToMap () {
105
+ for k , v := range res .toMap () {
106
106
if k != "id" {
107
107
d .Set (k , v )
108
108
} else {
@@ -114,5 +114,5 @@ func dataSourceCloudProjectDatabasePostgresqlConnectionPoolRead(ctx context.Cont
114
114
}
115
115
}
116
116
117
- return diag .Errorf ("ConnectionPool name %s not found for cluster %s from project %s" , name , clusterId , serviceName )
117
+ return diag .Errorf ("ConnectionPool name %s not found for cluster %s from project %s" , name , clusterID , serviceName )
118
118
}
0 commit comments