Skip to content

Commit

Permalink
[Style] Fix var names
Browse files Browse the repository at this point in the history
  • Loading branch information
muneeb-jan committed Oct 17, 2024
1 parent 65c9f77 commit d22b704
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions openstack/ddm/v1/schemas/Create.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ type CreateDatabaseDetail struct {
// The value ranges from 1 (min) to 64 (max) if the schema is sharded.
ShardUnit int `json:"shard_unit,omitempty"`
// RDS instances associated with the schema
UsedRds []DatabaseInstabcesParam `json:"used_rds" required:"true"`
UsedRds []DatabaseInstancesParam `json:"used_rds" required:"true"`
}

type DatabaseInstabcesParam struct {
type DatabaseInstancesParam struct {
// ID of the RDS instance associated with the schema
Id string `json:"id" required:"true"`
// Username for logging in to the associated RDS instance
Expand Down
6 changes: 3 additions & 3 deletions openstack/ddm/v1/schemas/Delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ type deleteQueryParams struct {
}

// This function is used to delete a schema to release all its resources.
// databaseName is the name of the schema to be queried, which is case-insensitive
func DeleteSchema(client *golangsdk.ServiceClient, instanceId string, databaseName string, deleteRdsData bool) (*string, error) {
// schemaName is the name of the schema to be queried, which is case-insensitive
func DeleteSchema(client *golangsdk.ServiceClient, instanceId string, schemaName string, deleteRdsData bool) (*string, error) {

deleteData := "false"
if deleteRdsData {
deleteData = "true"
}
// DELETE /v1/{project_id}/instances/{instance_id}/databases/{ddm_dbname}?delete_rds_data={delete_rds_data}
url, err := golangsdk.NewURLBuilder().WithEndpoints("instances", instanceId, "databases", databaseName).WithQueryParams(&deleteQueryParams{deleteRdsData: deleteData}).Build()
url, err := golangsdk.NewURLBuilder().WithEndpoints("instances", instanceId, "databases", schemaName).WithQueryParams(&deleteQueryParams{deleteRdsData: deleteData}).Build()
if err != nil {
return nil, err
}
Expand Down
8 changes: 4 additions & 4 deletions openstack/ddm/v1/schemas/QuerySchemaDetails.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (
)

// This API is used to query details about a schema.
// databaseName is the name of the schema to be queried, which is case-insensitive
func QuerySchemaDetails(client *golangsdk.ServiceClient, instanceId string, databaseName string) (*QuerySchemaDetailsResponse, error) {
// schemaName is the name of the schema to be queried, which is case-insensitive
func QuerySchemaDetails(client *golangsdk.ServiceClient, instanceId string, schemaName string) (*QuerySchemaDetailsResponse, error) {

// GET /v1/{project_id}/instances/{instance_id}/databases/{ddm_dbname}
raw, err := client.Get(client.ServiceURL("instances", instanceId, "databases", databaseName), nil, nil)
raw, err := client.Get(client.ServiceURL("instances", instanceId, "databases", schemaName), nil, nil)
if err != nil {
return nil, err
}
Expand All @@ -21,7 +21,7 @@ func QuerySchemaDetails(client *golangsdk.ServiceClient, instanceId string, data
}

type QuerySchemaDetailsResponse struct {
Database []GetDatabaseResponseBean `json:"database"`
Database GetDatabaseResponseBean `json:"database"`
}

// GetDatabaseResponseBean represents the response for database details
Expand Down

0 comments on commit d22b704

Please sign in to comment.