kafka

package
v0.73.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KafkaAclPermissionTypeChoices added in v0.63.0

func KafkaAclPermissionTypeChoices() []string

func OperationTypeChoices added in v0.63.0

func OperationTypeChoices() []string

func PatternTypeChoices added in v0.63.0

func PatternTypeChoices() []string

func PermissionTypeChoices

func PermissionTypeChoices() []string

func ResourceTypeChoices added in v0.63.0

func ResourceTypeChoices() []string

func ServiceKafkaNativeAclAddPermissionTypeChoices added in v0.63.0

func ServiceKafkaNativeAclAddPermissionTypeChoices() []string

func ServiceKafkaNativeAclGetPermissionTypeChoices added in v0.63.0

func ServiceKafkaNativeAclGetPermissionTypeChoices() []string

func ServiceKafkaQuotaDeleteClientId added in v0.70.0

func ServiceKafkaQuotaDeleteClientId(clientId string) [2]string

ServiceKafkaQuotaDeleteClientId Client ID.

func ServiceKafkaQuotaDeleteUser added in v0.70.0

func ServiceKafkaQuotaDeleteUser(user string) [2]string

ServiceKafkaQuotaDeleteUser Username.

func ServiceKafkaQuotaDescribeClientId added in v0.72.0

func ServiceKafkaQuotaDescribeClientId(clientId string) [2]string

ServiceKafkaQuotaDescribeClientId

func ServiceKafkaQuotaDescribeUser added in v0.72.0

func ServiceKafkaQuotaDescribeUser(user string) [2]string

ServiceKafkaQuotaDescribeUser

Types

type AclOut

type AclOut struct {
	Id         *string        `json:"id,omitempty"` // ID
	Permission PermissionType `json:"permission"`   // Kafka permission
	Topic      string         `json:"topic"`        // Topic name pattern
	Username   string         `json:"username"`
}

type Handler

type Handler interface {
	// ServiceKafkaAclAdd add Aiven Kafka ACL entry
	// POST /v1/project/{project}/service/{service_name}/acl
	// https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaAclAdd
	ServiceKafkaAclAdd(ctx context.Context, project string, serviceName string, in *ServiceKafkaAclAddIn) ([]AclOut, error)

	// ServiceKafkaAclDelete delete a Kafka ACL entry
	// DELETE /v1/project/{project}/service/{service_name}/acl/{kafka_acl_id}
	// https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaAclDelete
	ServiceKafkaAclDelete(ctx context.Context, project string, serviceName string, kafkaAclId string) ([]AclOut, error)

	// ServiceKafkaAclList list Aiven ACL entries for Kafka service
	// GET /v1/project/{project}/service/{service_name}/acl
	// https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaAclList
	ServiceKafkaAclList(ctx context.Context, project string, serviceName string) ([]AclOut, error)

	// ServiceKafkaNativeAclAdd add a Kafka-native ACL entry
	// POST /v1/project/{project}/service/{service_name}/kafka/acl
	// https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaNativeAclAdd
	ServiceKafkaNativeAclAdd(ctx context.Context, project string, serviceName string, in *ServiceKafkaNativeAclAddIn) (*ServiceKafkaNativeAclAddOut, error)

	// ServiceKafkaNativeAclDelete delete a Kafka-native ACL entry
	// DELETE /v1/project/{project}/service/{service_name}/kafka/acl/{kafka_acl_id}
	// https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaNativeAclDelete
	ServiceKafkaNativeAclDelete(ctx context.Context, project string, serviceName string, kafkaAclId string) error

	// ServiceKafkaNativeAclGet get single Kafka-native ACL entry
	// GET /v1/project/{project}/service/{service_name}/kafka/acl/{kafka_acl_id}
	// https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaNativeAclGet
	ServiceKafkaNativeAclGet(ctx context.Context, project string, serviceName string, kafkaAclId string) (*ServiceKafkaNativeAclGetOut, error)

	// ServiceKafkaNativeAclList list Kafka-native ACL entries
	// GET /v1/project/{project}/service/{service_name}/kafka/acl
	// https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaNativeAclList
	ServiceKafkaNativeAclList(ctx context.Context, project string, serviceName string) (*ServiceKafkaNativeAclListOut, error)

	// ServiceKafkaQuotaCreate create Kafka quota
	// POST /v1/project/{project}/service/{service_name}/quota
	// https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaQuotaCreate
	ServiceKafkaQuotaCreate(ctx context.Context, project string, serviceName string, in *ServiceKafkaQuotaCreateIn) error

	// ServiceKafkaQuotaDelete delete Kafka quota
	// DELETE /v1/project/{project}/service/{service_name}/quota
	// https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaQuotaDelete
	ServiceKafkaQuotaDelete(ctx context.Context, project string, serviceName string, query ...[2]string) error

	// ServiceKafkaQuotaDescribe get service quota configuration
	// GET /v1/project/{project}/service/{service_name}/quota/describe
	// https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaQuotaDescribe
	ServiceKafkaQuotaDescribe(ctx context.Context, project string, serviceName string, query ...[2]string) (*ServiceKafkaQuotaDescribeOut, error)

	// ServiceKafkaQuotaList list Kafka quotas
	// GET /v1/project/{project}/service/{service_name}/quota
	// https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaQuotaList
	ServiceKafkaQuotaList(ctx context.Context, project string, serviceName string) ([]QuotaOut, error)

	// ServiceKafkaTieredStorageStorageUsageByTopic get the Kafka tiered storage object storage usage by topic
	// GET /v1/project/{project}/service/{service_name}/kafka/tiered-storage/storage-usage/by-topic
	// https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaTieredStorageStorageUsageByTopic
	ServiceKafkaTieredStorageStorageUsageByTopic(ctx context.Context, project string, serviceName string) (map[string]any, error)

	// ServiceKafkaTieredStorageStorageUsageTotal get the Kafka tiered storage total object storage usage
	// GET /v1/project/{project}/service/{service_name}/kafka/tiered-storage/storage-usage/total
	// https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaTieredStorageStorageUsageTotal
	ServiceKafkaTieredStorageStorageUsageTotal(ctx context.Context, project string, serviceName string) (int, error)

	// ServiceKafkaTieredStorageSummary get the Kafka tiered storage summary
	// GET /v1/project/{project}/service/{service_name}/kafka/tiered-storage/summary
	// https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaTieredStorageSummary
	ServiceKafkaTieredStorageSummary(ctx context.Context, project string, serviceName string) (*ServiceKafkaTieredStorageSummaryOut, error)
}

type HourlyOut

type HourlyOut struct {
	EstimatedCost   *string `json:"estimated_cost,omitempty"` // The estimated cost in USD of tiered storage for this hour
	HourStart       string  `json:"hour_start"`               // Timestamp in ISO 8601 format, always in UTC
	PeakStoredBytes int     `json:"peak_stored_bytes"`        // Peak bytes stored on object storage at this hour
}

type KafkaAclOut added in v0.63.0

type KafkaAclOut struct {
	Host           string                 `json:"host"`            // the host or * for all hosts
	Id             string                 `json:"id"`              // ID
	Operation      OperationType          `json:"operation"`       // Kafka ACL operation represents an operation which an ACL grants or denies permission to perform
	PatternType    PatternType            `json:"pattern_type"`    // Kafka ACL pattern type of resource name
	PermissionType KafkaAclPermissionType `json:"permission_type"` // Kafka ACL permission type
	Principal      string                 `json:"principal"`       // principal is in 'principalType:name' format
	ResourceName   string                 `json:"resource_name"`   // Resource pattern used to match specified resources
	ResourceType   ResourceType           `json:"resource_type"`   // Kafka ACL resource type represents a type of resource which an ACL can be applied to
}

type KafkaAclPermissionType added in v0.63.0

type KafkaAclPermissionType string
const (
	KafkaAclPermissionTypeAllow KafkaAclPermissionType = "ALLOW"
	KafkaAclPermissionTypeDeny  KafkaAclPermissionType = "DENY"
)

type KafkaHandler

type KafkaHandler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(doer doer) KafkaHandler

func (*KafkaHandler) ServiceKafkaAclAdd

func (h *KafkaHandler) ServiceKafkaAclAdd(ctx context.Context, project string, serviceName string, in *ServiceKafkaAclAddIn) ([]AclOut, error)

func (*KafkaHandler) ServiceKafkaAclDelete

func (h *KafkaHandler) ServiceKafkaAclDelete(ctx context.Context, project string, serviceName string, kafkaAclId string) ([]AclOut, error)

func (*KafkaHandler) ServiceKafkaAclList

func (h *KafkaHandler) ServiceKafkaAclList(ctx context.Context, project string, serviceName string) ([]AclOut, error)

func (*KafkaHandler) ServiceKafkaNativeAclAdd added in v0.63.0

func (h *KafkaHandler) ServiceKafkaNativeAclAdd(ctx context.Context, project string, serviceName string, in *ServiceKafkaNativeAclAddIn) (*ServiceKafkaNativeAclAddOut, error)

func (*KafkaHandler) ServiceKafkaNativeAclDelete added in v0.63.0

func (h *KafkaHandler) ServiceKafkaNativeAclDelete(ctx context.Context, project string, serviceName string, kafkaAclId string) error

func (*KafkaHandler) ServiceKafkaNativeAclGet added in v0.63.0

func (h *KafkaHandler) ServiceKafkaNativeAclGet(ctx context.Context, project string, serviceName string, kafkaAclId string) (*ServiceKafkaNativeAclGetOut, error)

func (*KafkaHandler) ServiceKafkaNativeAclList added in v0.63.0

func (h *KafkaHandler) ServiceKafkaNativeAclList(ctx context.Context, project string, serviceName string) (*ServiceKafkaNativeAclListOut, error)

func (*KafkaHandler) ServiceKafkaQuotaCreate

func (h *KafkaHandler) ServiceKafkaQuotaCreate(ctx context.Context, project string, serviceName string, in *ServiceKafkaQuotaCreateIn) error

func (*KafkaHandler) ServiceKafkaQuotaDelete

func (h *KafkaHandler) ServiceKafkaQuotaDelete(ctx context.Context, project string, serviceName string, query ...[2]string) error

func (*KafkaHandler) ServiceKafkaQuotaDescribe

func (h *KafkaHandler) ServiceKafkaQuotaDescribe(ctx context.Context, project string, serviceName string, query ...[2]string) (*ServiceKafkaQuotaDescribeOut, error)

func (*KafkaHandler) ServiceKafkaQuotaList

func (h *KafkaHandler) ServiceKafkaQuotaList(ctx context.Context, project string, serviceName string) ([]QuotaOut, error)

func (*KafkaHandler) ServiceKafkaTieredStorageStorageUsageByTopic

func (h *KafkaHandler) ServiceKafkaTieredStorageStorageUsageByTopic(ctx context.Context, project string, serviceName string) (map[string]any, error)

func (*KafkaHandler) ServiceKafkaTieredStorageStorageUsageTotal

func (h *KafkaHandler) ServiceKafkaTieredStorageStorageUsageTotal(ctx context.Context, project string, serviceName string) (int, error)

func (*KafkaHandler) ServiceKafkaTieredStorageSummary

func (h *KafkaHandler) ServiceKafkaTieredStorageSummary(ctx context.Context, project string, serviceName string) (*ServiceKafkaTieredStorageSummaryOut, error)

type OperationType added in v0.63.0

type OperationType string
const (
	OperationTypeAll             OperationType = "All"
	OperationTypeAlter           OperationType = "Alter"
	OperationTypeAlterConfigs    OperationType = "AlterConfigs"
	OperationTypeClusterAction   OperationType = "ClusterAction"
	OperationTypeCreate          OperationType = "Create"
	OperationTypeCreateTokens    OperationType = "CreateTokens"
	OperationTypeDelete          OperationType = "Delete"
	OperationTypeDescribe        OperationType = "Describe"
	OperationTypeDescribeConfigs OperationType = "DescribeConfigs"
	OperationTypeDescribeTokens  OperationType = "DescribeTokens"
	OperationTypeIdempotentWrite OperationType = "IdempotentWrite"
	OperationTypeRead            OperationType = "Read"
	OperationTypeWrite           OperationType = "Write"
)

type PatternType added in v0.63.0

type PatternType string
const (
	PatternTypeLiteral  PatternType = "LITERAL"
	PatternTypePrefixed PatternType = "PREFIXED"
)

type PermissionType

type PermissionType string
const (
	PermissionTypeAdmin     PermissionType = "admin"
	PermissionTypeRead      PermissionType = "read"
	PermissionTypeReadwrite PermissionType = "readwrite"
	PermissionTypeWrite     PermissionType = "write"
)

type QuotaOut

type QuotaOut struct {
	ClientId          string  `json:"client-id"`          // client-id
	ConsumerByteRate  float64 `json:"consumer_byte_rate"` // consumer network throttle
	ProducerByteRate  float64 `json:"producer_byte_rate"` // producer network throttle
	RequestPercentage float64 `json:"request_percentage"` // cpu percentage throttle
	User              string  `json:"user"`               // user
}

type ResourceType added in v0.63.0

type ResourceType string
const (
	ResourceTypeTopic           ResourceType = "Topic"
	ResourceTypeGroup           ResourceType = "Group"
	ResourceTypeCluster         ResourceType = "Cluster"
	ResourceTypeTransactionalId ResourceType = "TransactionalId"
	ResourceTypeDelegationToken ResourceType = "DelegationToken"
	ResourceTypeUser            ResourceType = "User"
)

type ServiceKafkaAclAddIn

type ServiceKafkaAclAddIn struct {
	Permission PermissionType `json:"permission"` // Kafka permission
	Topic      string         `json:"topic"`      // Topic name pattern
	Username   string         `json:"username"`
}

ServiceKafkaAclAddIn ServiceKafkaAclAddRequestBody

type ServiceKafkaNativeAclAddIn added in v0.63.0

type ServiceKafkaNativeAclAddIn struct {
	Host           *string                                `json:"host,omitempty"`  // the host or * for all hosts
	Operation      OperationType                          `json:"operation"`       // Kafka ACL operation represents an operation which an ACL grants or denies permission to perform
	PatternType    PatternType                            `json:"pattern_type"`    // Kafka ACL pattern type of resource name
	PermissionType ServiceKafkaNativeAclAddPermissionType `json:"permission_type"` // Kafka ACL permission type
	Principal      string                                 `json:"principal"`       // principal is in 'PrincipalType:name' format
	ResourceName   string                                 `json:"resource_name"`   // Resource pattern used to match specified resources
	ResourceType   ResourceType                           `json:"resource_type"`   // Kafka ACL resource type represents a type of resource which an ACL can be applied to
}

ServiceKafkaNativeAclAddIn ServiceKafkaNativeAclAddRequestBody

type ServiceKafkaNativeAclAddOut added in v0.63.0

type ServiceKafkaNativeAclAddOut struct {
	Host           string                                 `json:"host"`            // the host or * for all hosts
	Id             string                                 `json:"id"`              // ID
	Operation      OperationType                          `json:"operation"`       // Kafka ACL operation represents an operation which an ACL grants or denies permission to perform
	PatternType    PatternType                            `json:"pattern_type"`    // Kafka ACL pattern type of resource name
	PermissionType ServiceKafkaNativeAclAddPermissionType `json:"permission_type"` // Kafka ACL permission type
	Principal      string                                 `json:"principal"`       // principal is in 'principalType:name' format
	ResourceName   string                                 `json:"resource_name"`   // Resource pattern used to match specified resources
	ResourceType   ResourceType                           `json:"resource_type"`   // Kafka ACL resource type represents a type of resource which an ACL can be applied to
}

ServiceKafkaNativeAclAddOut Kafka-native ACL entry for Kafka service

type ServiceKafkaNativeAclAddPermissionType added in v0.63.0

type ServiceKafkaNativeAclAddPermissionType string
const (
	ServiceKafkaNativeAclAddPermissionTypeAllow ServiceKafkaNativeAclAddPermissionType = "ALLOW"
	ServiceKafkaNativeAclAddPermissionTypeDeny  ServiceKafkaNativeAclAddPermissionType = "DENY"
)

type ServiceKafkaNativeAclGetOut added in v0.63.0

type ServiceKafkaNativeAclGetOut struct {
	Host           string                                 `json:"host"`            // the host or * for all hosts
	Id             string                                 `json:"id"`              // ID
	Operation      OperationType                          `json:"operation"`       // Kafka ACL operation represents an operation which an ACL grants or denies permission to perform
	PatternType    PatternType                            `json:"pattern_type"`    // Kafka ACL pattern type of resource name
	PermissionType ServiceKafkaNativeAclGetPermissionType `json:"permission_type"` // Kafka ACL permission type
	Principal      string                                 `json:"principal"`       // principal is in 'principalType:name' format
	ResourceName   string                                 `json:"resource_name"`   // Resource pattern used to match specified resources
	ResourceType   ResourceType                           `json:"resource_type"`   // Kafka ACL resource type represents a type of resource which an ACL can be applied to
}

ServiceKafkaNativeAclGetOut Kafka-native ACL entry for Kafka service

type ServiceKafkaNativeAclGetPermissionType added in v0.63.0

type ServiceKafkaNativeAclGetPermissionType string
const (
	ServiceKafkaNativeAclGetPermissionTypeAllow ServiceKafkaNativeAclGetPermissionType = "ALLOW"
	ServiceKafkaNativeAclGetPermissionTypeDeny  ServiceKafkaNativeAclGetPermissionType = "DENY"
)

type ServiceKafkaNativeAclListOut added in v0.63.0

type ServiceKafkaNativeAclListOut struct {
	Acl      []AclOut      `json:"acl"`       // List of Aiven ACL entries for Kafka service
	KafkaAcl []KafkaAclOut `json:"kafka_acl"` // List of Kafka-native ACL entries
}

ServiceKafkaNativeAclListOut ServiceKafkaNativeAclListResponse

type ServiceKafkaQuotaCreateIn

type ServiceKafkaQuotaCreateIn struct {
	ClientId          *string  `json:"client-id,omitempty"`          // client-id
	ConsumerByteRate  *float64 `json:"consumer_byte_rate,omitempty"` // consumer network throttle
	ProducerByteRate  *float64 `json:"producer_byte_rate,omitempty"` // producer network throttle
	RequestPercentage *float64 `json:"request_percentage,omitempty"` // cpu percentage throttle
	User              *string  `json:"user,omitempty"`               // user
}

ServiceKafkaQuotaCreateIn ServiceKafkaQuotaCreateRequestBody

type ServiceKafkaQuotaDescribeOut

type ServiceKafkaQuotaDescribeOut struct {
	ClientId          string  `json:"client-id"`          // client-id
	ConsumerByteRate  float64 `json:"consumer_byte_rate"` // consumer network throttle
	ProducerByteRate  float64 `json:"producer_byte_rate"` // producer network throttle
	RequestPercentage float64 `json:"request_percentage"` // cpu percentage throttle
	User              string  `json:"user"`               // user
}

ServiceKafkaQuotaDescribeOut kafka quota

type ServiceKafkaTieredStorageSummaryOut

type ServiceKafkaTieredStorageSummaryOut struct {
	CurrentCost         string                 `json:"current_cost"`              // The current cost in USD of tiered storage since the beginning of the billing period
	ForecastedCost      string                 `json:"forecasted_cost"`           // The forecasted cost in USD of tiered storage in the billing period
	ForecastedRate      *string                `json:"forecasted_rate,omitempty"` // The rate on GBs/hour used to calculate the forecasted cost
	StorageUsageHistory StorageUsageHistoryOut `json:"storage_usage_history"`     // History of usage and cumulative costs in the billing period
	TotalStorageUsage   int                    `json:"total_storage_usage"`       // Total storage usage by tiered storage, in bytes
}

ServiceKafkaTieredStorageSummaryOut ServiceKafkaTieredStorageSummaryResponse

type StorageUsageHistoryOut

type StorageUsageHistoryOut struct {
	Hourly []HourlyOut `json:"hourly"` // History by hour
}

StorageUsageHistoryOut History of usage and cumulative costs in the billing period

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL