Skip to content

Commit

Permalink
fix: delete database and edge gateway helper service
Browse files Browse the repository at this point in the history
  • Loading branch information
thainh20 committed Oct 3, 2024
1 parent fccf395 commit c652736
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 92 deletions.
29 changes: 0 additions & 29 deletions fptcloud/database/database_service.go

This file was deleted.

12 changes: 1 addition & 11 deletions fptcloud/database/resource_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ var (
)

type resourceDatabase struct {
client *common.Client
databaseClient *databaseApiClient
client *common.Client
}

type databaseResourceModel struct {
Expand Down Expand Up @@ -357,15 +356,6 @@ func (r *resourceDatabase) Configure(ctx context.Context, request resource.Confi
}

r.client = client
a, err := newDatabaseApiClient(client)
if err != nil {
response.Diagnostics.AddError(
"Error configuring API client",
fmt.Sprintf("%s", err.Error()),
)
return
}
r.databaseClient = a
}

// Get resource data from API, then update to terrafrom state
Expand Down
22 changes: 11 additions & 11 deletions fptcloud/database/resource_database_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ var (
)

type resourceDatabaseStatus struct {
client *common.Client
databaseClient *databaseApiClient
client *common.Client
}

func NewResourceDatabaseStatus() resource.Resource {
Expand Down Expand Up @@ -183,15 +182,16 @@ func (r *resourceDatabaseStatus) Configure(ctx context.Context, request resource
}

r.client = client
a, err := newDatabaseApiClient(client)
if err != nil {
response.Diagnostics.AddError(
"Error configuring API client",
fmt.Sprintf("%s", err.Error()),
)
return
}
r.databaseClient = a

//a, err := newDatabaseApiClient(client)
//if err != nil {
// response.Diagnostics.AddError(
// "Error configuring API client",
// fmt.Sprintf("%s", err.Error()),
// )
// return
//}
//r.databaseClient = a
}

// Get current status of database (running, stopped, failed)
Expand Down
13 changes: 1 addition & 12 deletions fptcloud/edge_gateway/datasource_edge_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ var (
)

type datasourceEdgeGateway struct {
client *common.Client
edgeGatewayClient *edgeGatewayApiClient
client *common.Client
}

func NewDataSourceEdgeGateway() datasource.DataSource {
Expand Down Expand Up @@ -111,16 +110,6 @@ func (d *datasourceEdgeGateway) Configure(ctx context.Context, request datasourc
}

d.client = client
a, err := newEdgeGatewayApiClient(client)
if err != nil {
response.Diagnostics.AddError(
"Error configuring API client",
fmt.Sprintf("%s", err.Error()),
)
return
}

d.edgeGatewayClient = a
}

func (d *datasourceEdgeGateway) internalRead(ctx context.Context, state *edge_gateway) (*[]edgeGatewayData, error) {
Expand Down
29 changes: 0 additions & 29 deletions fptcloud/edge_gateway/edge_gateway_service.go

This file was deleted.

0 comments on commit c652736

Please sign in to comment.