Skip to content

Commit

Permalink
feat(kafka_quota): added support for kafka quota
Browse files Browse the repository at this point in the history
  • Loading branch information
vmyroslav committed Dec 27, 2024
1 parent 36e9921 commit b828277
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions internal/sdkprovider/service/kafka/kafka_quota.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package kafka
import (
"context"
"fmt"

avngen "github.com/aiven/go-client-codegen"
"github.com/aiven/go-client-codegen/handler/kafka"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
Expand Down Expand Up @@ -163,21 +162,18 @@ func resourceKafkaQuotaRead(ctx context.Context, d *schema.ResourceData, client
params = append(params, kafka.ServiceKafkaQuotaDescribeClientId(clientID))
}

if len(params) == 0 {
return fmt.Errorf("invalid resource ID: %q, either user or client_id must be set", d.Id())
}

resp, err := client.ServiceKafkaQuotaDescribe(
ctx,
project,
serviceName,
params...,
)
if err != nil {
return fmt.Errorf(
"cannot get Kafka quota for project %q, service %q:, client_id %q, user %q: %w",
project,
serviceName,
clientID,
user,
err,
)
return err
}

return schemautil.ResourceDataSet(
Expand Down

0 comments on commit b828277

Please sign in to comment.