Skip to content

Commit d510fbf

Browse files
authored
Fixed errors in metrics resource doc (#139)
1 parent 98f64a6 commit d510fbf

File tree

4 files changed

+33
-33
lines changed

4 files changed

+33
-33
lines changed

docs/resources/associate_metrics_exporter_cluster.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ The resource to manage metrics export configuration for a cluster in YugabyteDB
1414
```terraform
1515
resource "ybm_associate_metrics_exporter_cluster" "metrics-srcluster" {
1616
cluster_id = ybm_cluster.single_region_cluster.cluster_id
17-
config_id = ybm_metrics_exporter.test.config_id
18-
depends_on = [ybm_cluster.single_region_cluster, ybm_metrics_exporter.test]
17+
config_id = ybm_integration.test.config_id
18+
depends_on = [ybm_cluster.single_region_cluster, ybm_integration.test]
1919
}
2020
```
2121

@@ -24,12 +24,12 @@ resource "ybm_associate_metrics_exporter_cluster" "metrics-srcluster" {
2424

2525
### Optional
2626

27-
- `cluster_id` (String) The ID of the metrics exporter config.
28-
- `cluster_name` (String) The name of the metrics exporter configuration
29-
- `config_id` (String) The ID of the metrics exporter config.
30-
- `config_name` (String) The name of the metrics exporter configuration
27+
- `cluster_id` (String) ID of the cluster with which this metrics export configuration will be associated.
28+
- `cluster_name` (String) Name of the cluster with which this metrics export configuration will be associated.
29+
- `config_id` (String) ID of the integration for this metrics export configuration.
30+
- `config_name` (String) Name of the integration for this metrics export configuration
3131

3232
### Read-Only
3333

34-
- `account_id` (String) The ID of the account this private service endpoint belongs to.
35-
- `project_id` (String) The ID of the project this private service endpoint belongs to.
34+
- `account_id` (String) ID of the account this metrics export configuration belongs to.
35+
- `project_id` (String) ID of the project this metrics export configuration belongs to.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
resource "ybm_associate_metrics_exporter_cluster" "metrics-srcluster" {
22
cluster_id = ybm_cluster.single_region_cluster.cluster_id
3-
config_id = ybm_metrics_exporter.test.config_id
4-
depends_on = [ybm_cluster.single_region_cluster, ybm_metrics_exporter.test]
5-
}
3+
config_id = ybm_integration.test.config_id
4+
depends_on = [ybm_cluster.single_region_cluster, ybm_integration.test]
5+
}

managed/resource_associate_me_cluster.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@ func (r resourceAssociateMetricsExporterClusterType) GetSchema(_ context.Context
2323
Description: `The resource to manage metrics export configuration for a cluster in YugabyteDB Aeon.`,
2424
Attributes: map[string]tfsdk.Attribute{
2525
"account_id": {
26-
Description: "The ID of the account this private service endpoint belongs to.",
26+
Description: "ID of the account this metrics export configuration belongs to.",
2727
Type: types.StringType,
2828
Computed: true,
2929
},
3030
"project_id": {
31-
Description: "The ID of the project this private service endpoint belongs to.",
31+
Description: "ID of the project this metrics export configuration belongs to.",
3232
Type: types.StringType,
3333
Computed: true,
3434
},
3535
"cluster_id": {
36-
Description: "The ID of the metrics exporter config.",
36+
Description: "ID of the cluster with which this metrics export configuration will be associated.",
3737
Type: types.StringType,
3838
Optional: true,
3939
Computed: true,
4040
},
4141
"cluster_name": {
42-
Description: "The name of the metrics exporter configuration",
42+
Description: "Name of the cluster with which this metrics export configuration will be associated.",
4343
Type: types.StringType,
4444
Optional: true,
4545
Computed: true,
@@ -48,13 +48,13 @@ func (r resourceAssociateMetricsExporterClusterType) GetSchema(_ context.Context
4848
},
4949
},
5050
"config_id": {
51-
Description: "The ID of the metrics exporter config.",
51+
Description: "ID of the integration for this metrics export configuration.",
5252
Type: types.StringType,
5353
Optional: true,
5454
Computed: true,
5555
},
5656
"config_name": {
57-
Description: "The name of the metrics exporter configuration",
57+
Description: "Name of the integration for this metrics export configuration",
5858
Type: types.StringType,
5959
Optional: true,
6060
Computed: true,

managed/resource_db_query_logging.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func (r resourceDbQueryLoggingType) GetSchema(ctx context.Context) (tfsdk.Schema
3939
Computed: true,
4040
},
4141
"cluster_id": {
42-
Description: "ID of the cluster with which this DB query logging config will be associated.",
42+
Description: "ID of the cluster with which this DB query logging configuration will be associated.",
4343
Type: types.StringType,
4444
Required: true,
4545
},
@@ -216,7 +216,7 @@ func getPgLogExporterConfig(ctx context.Context, accountId string, projectId str
216216
}
217217

218218
if len(specList.GetData()) < 1 {
219-
return nil, false, "no DB query logging config found for the cluster"
219+
return nil, false, "no DB query logging configuration found for the cluster"
220220
}
221221
return &specList.Data[0], true, ""
222222
}
@@ -284,7 +284,7 @@ func (r resourceDbQueryLogging) Update(ctx context.Context, req tfsdk.UpdateReso
284284
var planConfig DbQueryLoggingConfig
285285
resp.Diagnostics.Append(getConfigFromPlan(ctx, req.Plan, &planConfig)...)
286286
if resp.Diagnostics.HasError() {
287-
tflog.Debug(ctx, "Error while getting the plan for the Db query logging config")
287+
tflog.Debug(ctx, "Error while getting the plan for the Db query logging configuration")
288288
return
289289
}
290290
integrationName := planConfig.IntegrationName.Value
@@ -305,7 +305,7 @@ func (r resourceDbQueryLogging) Update(ctx context.Context, req tfsdk.UpdateReso
305305

306306
spec, ok, errMsg := getPgLogExporterConfig(ctx, accountId, projectId, clusterId, apiClient)
307307
if !ok {
308-
resp.Diagnostics.AddError("Unable to fetch DB query logging config", errMsg)
308+
resp.Diagnostics.AddError("Unable to fetch DB query logging configuration", errMsg)
309309
return
310310
}
311311

@@ -323,13 +323,13 @@ func (r resourceDbQueryLogging) Update(ctx context.Context, req tfsdk.UpdateReso
323323
// Use planConfig provided in tf file to build new API Pg log exporter config spec
324324
apiConfigSpec, err := buildDbQueryLoggingSpec(planConfig, integrationId, &spec.Spec.ExportConfig)
325325
if err != nil {
326-
resp.Diagnostics.AddError("Unable to update DB query logging config", GetApiErrorDetails(err))
326+
resp.Diagnostics.AddError("Unable to update DB query logging configuration", GetApiErrorDetails(err))
327327
return
328328
}
329329

330330
_, _, err = apiClient.ClusterApi.UpdatePgLogExporterConfig(ctx, accountId, projectId, clusterId, configId).PgLogExporterConfigSpec(*apiConfigSpec).Execute()
331331
if err != nil {
332-
resp.Diagnostics.AddError(fmt.Sprintf("Unable to update DB query logging config for cluster %s", clusterId), GetApiErrorDetails(err))
332+
resp.Diagnostics.AddError(fmt.Sprintf("Unable to update DB query logging configuration for cluster %s", clusterId), GetApiErrorDetails(err))
333333
return
334334
}
335335

@@ -342,25 +342,25 @@ func (r resourceDbQueryLogging) Update(ctx context.Context, req tfsdk.UpdateReso
342342
return nil
343343
}
344344
if asState == string(openapiclient.TASKACTIONSTATEENUM_FAILED) {
345-
return fmt.Errorf("failed to update DB query log config")
345+
return fmt.Errorf("failed to update DB query log configuration")
346346
}
347347
} else {
348-
return retry.RetryableError(errors.New("unable to check DB query log config update status: " + message))
348+
return retry.RetryableError(errors.New("unable to check DB query log configuration update status: " + message))
349349
}
350-
return retry.RetryableError(errors.New("DB query log config is being updated"))
350+
return retry.RetryableError(errors.New("DB query log configuration is being updated"))
351351
})
352352

353353
if err != nil {
354-
errorSummary := fmt.Sprintf("Unable to update DB query log config for cluster: %s", clusterId)
355-
resp.Diagnostics.AddError(errorSummary, "The operation timed out waiting for DB query log config update operation.")
354+
errorSummary := fmt.Sprintf("Unable to update DB query log configuration for cluster: %s", clusterId)
355+
resp.Diagnostics.AddError(errorSummary, "The operation timed out waiting for DB query log configuration update operation.")
356356
return
357357
}
358358

359359
planConfig.ConfigID.Value = configId
360360

361361
dbqlConfig, readOK, readErrMsg := resourceRead(ctx, accountId, projectId, clusterId, integrationName, apiClient)
362362
if !readOK {
363-
resp.Diagnostics.AddError("Unable to read the state of Db Query log config ", readErrMsg)
363+
resp.Diagnostics.AddError("Unable to read the state of Db Query log configuration ", readErrMsg)
364364
return
365365
}
366366

@@ -382,7 +382,7 @@ func (r resourceDbQueryLogging) Delete(ctx context.Context, req tfsdk.DeleteReso
382382

383383
_, err := apiClient.ClusterApi.RemovePgLogExporterConfig(ctx, accountId, projectId, clusterId, configId).Execute()
384384
if err != nil {
385-
resp.Diagnostics.AddError(fmt.Sprintf("Unable to remove DB query logging config for cluster: %s", clusterId), GetApiErrorDetails(err))
385+
resp.Diagnostics.AddError(fmt.Sprintf("Unable to remove DB query logging configuration for cluster: %s", clusterId), GetApiErrorDetails(err))
386386
return
387387
}
388388

@@ -404,7 +404,7 @@ func (r resourceDbQueryLogging) Delete(ctx context.Context, req tfsdk.DeleteReso
404404
})
405405

406406
if err != nil {
407-
resp.Diagnostics.AddError("Unable to remove Db Logging config from the cluster ", "The operation timed out waiting for DB Query Logging removal to complete.")
407+
resp.Diagnostics.AddError("Unable to remove Db Logging configuration from the cluster ", "The operation timed out waiting for DB Query Logging removal to complete.")
408408
return
409409
}
410410

@@ -461,7 +461,7 @@ func (r resourceDbQueryLogging) Create(ctx context.Context, req tfsdk.CreateReso
461461

462462
dbQueryLoggingConfigSpec, err := buildDbQueryLoggingSpec(config, integrationId, openapiclient.NewPgLogExportConfigWithDefaults())
463463
if err != nil {
464-
tflog.Warn(ctx, "Unable to build DB query logging config spec"+GetApiErrorDetails(err))
464+
tflog.Warn(ctx, "Unable to build DB query logging configuration spec"+GetApiErrorDetails(err))
465465
resp.Diagnostics.AddError("Encountered error while enabling DB Query Logging", GetApiErrorDetails(err))
466466
return
467467
}
@@ -502,7 +502,7 @@ func (r resourceDbQueryLogging) Create(ctx context.Context, req tfsdk.CreateReso
502502
dbQueryLoggingConfig, readOK, readErrMsg := resourceRead(ctx, accountId, projectId,
503503
clusterId, integrationName, apiClient)
504504
if !readOK {
505-
resp.Diagnostics.AddError("Unable to read the state of Db Query log config for the cluster ", readErrMsg)
505+
resp.Diagnostics.AddError("Unable to read the state of Db Query log configuration for the cluster ", readErrMsg)
506506
return
507507
}
508508

0 commit comments

Comments
 (0)