api

package
v5.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

This code is automatically generated based on the open api spec of: Lenses API, version: v5.0.0-12-g2721a0e54.

Index

Constants

This section is empty.

Variables

ACLOperations is a map which contains the allowed ACL operations(values) per resource type(key).

Based on:

View Source
var BuildVersion string

BuildVersion is the version that gets set at build time and which we need to pass to the `Agent` header

View Source
var DefaultConfigurationHomeDir = filepath.Join(HomeDir(), ".lenses")

DefaultConfigurationHomeDir is the default configuration system directory, by default it's the $HOME/.lenses directory.

View Source
var DefaultContextKey = "master"

DefaultContextKey is used to set an empty client configuration when no custom context available.

View Source
var DefaultQuotaConfigPropertiesToRemove = []string{"producer_byte_rate", "consumer_byte_rate", "request_percentage"}

DefaultQuotaConfigPropertiesToRemove is a set of hard-coded strings that the client will send on `DeleteQuotaXXX` functions. It contains the "producer_byte_rate", "consumer_byte_rate" and "request_percentage" as they're described at the `QuotaConfig` structure.

View Source
var ErrCredentialsMissing = fmt.Errorf("credentials missing or invalid")

ErrCredentialsMissing fires on login, when credentials are missing or are invalid or the specific user has no access to a specific action.

View Source
var ErrUnknownResponse = fmt.Errorf("unknown")

ErrUnknownResponse is fired when unknown error caused an empty response, usually html content with 404 status code, more information can be displayed if `ClientConfig#Debug` is enabled.

Functions

func ClientConfigMarshalJSON

func ClientConfigMarshalJSON(c ClientConfig) ([]byte, error)

ClientConfigMarshalJSON retruns the json string as bytes of the given `ClientConfig` structure.

func ClientConfigMarshalYAML

func ClientConfigMarshalYAML(c ClientConfig) ([]byte, error)

ClientConfigMarshalYAML retruns the yaml string as bytes of the given `ClientConfig` structure.

func ClientConfigUnmarshalJSON

func ClientConfigUnmarshalJSON(b []byte, c *ClientConfig) error

ClientConfigUnmarshalJSON parses the JSON-encoded `ClientConfig` and stores the result in the `ClientConfig` pointed to by "c".

func ConfigMarshalJSON

func ConfigMarshalJSON(c Config) ([]byte, error)

ConfigMarshalJSON returns the JSON encoding of "c" `Config`.

func ConfigMarshalYAML

func ConfigMarshalYAML(c Config) ([]byte, error)

ConfigMarshalYAML returns the YAML encoding of "c" `Config`.

func ConfigUnmarshalJSON

func ConfigUnmarshalJSON(b []byte, c *Config) error

ConfigUnmarshalJSON parses the JSON-encoded `Config` and stores the result in the `Config` pointed to by "c".

func ConfigUnmarshalYAML

func ConfigUnmarshalYAML(b []byte, c *Config) error

ConfigUnmarshalYAML parses the YAML-encoded `Config` and stores the result in the `Config` pointed to by "c".

func GetAvailableReplicas

func GetAvailableReplicas(esIndex Index) int

GetAvailableReplicas returns the sum of all shards' available replicas

func HomeDir

func HomeDir() (homeDir string)

HomeDir returns the home directory for the current user on this specific host machine.

func JSONAvroSchema

func JSONAvroSchema(avroSchema string) (json.RawMessage, error)

JSONAvroSchema converts and returns the json form of the "avroSchema" as []byte.

func ReadConfig

func ReadConfig(r io.Reader, unmarshaler UnmarshalFunc, outPtr *Config) error

ReadConfig reads and decodes Config from an io.Reader based on a custom unmarshaler. This can be useful to read configuration via network or files (see `ReadConfigFromFile`). Sets the `outPtr`. Retruns a non-nil error on any unmarshaler's errors.

func ReadConfigFromFile

func ReadConfigFromFile(filename string, unmarshaler UnmarshalFunc, outPtr *Config) error

ReadConfigFromFile reads and decodes Config from a file based on a custom unmarshaler, `ReadConfigFromJSON` and `ReadConfigFromYAML` are the internal users, but the end-developer can use any custom type of decoder to read a configuration file with ease using this function, but keep note that the default behavior of the fields depend on the existing unmarshalers, use these tag names to map your decoder's properties.

Accepts the absolute or the relative path of the configuration file. Sets the `outPtr`. Retruns a non-nil error if parsing or decoding the file failed or file doesn't exist.

func ReadConfigFromJSON

func ReadConfigFromJSON(filename string, outPtr *Config) error

ReadConfigFromJSON reads and decodes Config from a json file, i.e `configuration.json`.

Accepts the absolute or the relative path of the configuration file. Error may occur when the file doesn't exists or is not formatted correctly.

func ReadConfigFromYAML

func ReadConfigFromYAML(filename string, outPtr *Config) error

ReadConfigFromYAML reads and decodes Config from a yaml file, i.e `configuration.yml`.

Accepts the absolute or the relative path of the configuration file. Error may occur when the file doesn't exists or is not formatted correctly.

func TryReadConfigFromCurrentWorkingDir

func TryReadConfigFromCurrentWorkingDir(outPtr *Config) bool

TryReadConfigFromCurrentWorkingDir will try to read the `Config` from the current working directory, note that it may differs from the executable path. The lookup is based on the common configuration filename pattern: lenses-cli.json, lenses-cli.yml or lenses.json and lenses.yml.

func TryReadConfigFromExecutable

func TryReadConfigFromExecutable(outPtr *Config) bool

TryReadConfigFromExecutable will try to read the `Config` from the (client's caller's) executable path that started the current process. The lookup is based on the common configuration filename pattern: lenses-cli.json, lenses-cli.yml or lenses.json and lenses.yml.

func TryReadConfigFromFile

func TryReadConfigFromFile(filename string, outPtr *Config) (err error)

TryReadConfigFromFile will try to read a specific file and unmarshal to `Config`. It will try to read it with one of these built'n lexers/formats: 1. JSON 2. YAML

func TryReadConfigFromHome

func TryReadConfigFromHome(outPtr *Config) bool

TryReadConfigFromHome will try to read the `Config` from the current user's home directory/.lenses, the lookup is based on the common configuration filename pattern: lenses-cli.json, lenses-cli.yml or lenses.json and lenses.yml.

Types

type ACL

type ACL struct {
	PermissionType ACLPermissionType `json:"permissionType" yaml:"permissionType" header:"Permission"` // required.
	Principal      string            `json:"principal" yaml:"principal" header:"Principal"`            // required.
	Operation      ACLOperation      `json:"operation" yaml:"operation" header:"Operation"`            // required.
	ResourceType   ACLResourceType   `json:"resourceType" yaml:"resourceType" header:"Resource Type"`  // required.
	PatternType    string            `json:"patternType" yaml:"patternType" header:"Pattern type"`
	ResourceName   string            `json:"resourceName" yaml:"resourceName" header:"Name"` // required.
	Host           string            `json:"host" yaml:"host" header:"Host"`                 // required.
}

ACL is the type which defines a single Apache Access Control List.

func (*ACL) Validate

func (acl *ACL) Validate() error

Validate force validates the acl's resource type, permission type and operation. It returns an error if the operation is not valid for the resource type.

type ACLOperation

type ACLOperation string

ACLOperation is a string and it defines the valid operations for ACL.

Based on: https://github.com/apache/kafka/blob/1.0/clients/src/test/java/org/apache/kafka/common/acl/AclOperationTest.java#L38

Read through `ACLOperations` to learn what operation is valid for each of the available resource types.

const (

	// ACLOperationAny is the "ANY" ACL operation.
	ACLOperationAny ACLOperation = "ANY"
	// ACLOperationAll is the "ALL" ACL operation.
	ACLOperationAll ACLOperation = "ALL"
	// ACLOperationRead is the "READ" ACL operation.
	ACLOperationRead ACLOperation = "READ"
	// ACLOperationWrite is the "WRITE" ACL operation.
	ACLOperationWrite ACLOperation = "WRITE"
	// ACLOperationCreate is the "CREATE" ACL operation.
	ACLOperationCreate ACLOperation = "CREATE"
	// ACLOperationDelete is the "DELETE" ACL operation.
	ACLOperationDelete ACLOperation = "DELETE"
	// ACLOperationAlter is the "ALTER" ACL operation.
	ACLOperationAlter ACLOperation = "ALTER"
	// ACLOperationDescribe is the "DESCRIBE" ACL operation.
	ACLOperationDescribe ACLOperation = "DESCRIBE"
	// ACLOperationClusterAction is the "CLUSTER_ACTION" ACL operation.
	ACLOperationClusterAction ACLOperation = "CLUSTER_ACTION"
	// ACLOperationDescribeConfigs is the "DESCRIBE_CONFIGS" ACL operation.
	ACLOperationDescribeConfigs ACLOperation = "DESCRIBE_CONFIGS"
	// ACLOperationAlterConfigs is the "ALTER_CONFIGS" ACL operation.
	ACLOperationAlterConfigs ACLOperation = "ALTER_CONFIGS"
	// ACLOperationIdempotentWrite is the "IDEMPOTENT_WRITE" ACL operation.
	ACLOperationIdempotentWrite ACLOperation = "IDEMPOTENT_WRITE"
)

type ACLPermissionType

type ACLPermissionType string

ACLPermissionType is a string and it defines the valid permission types for ACL.

Based on: https://github.com/apache/kafka/blob/1.0/core/src/main/scala/kafka/security/auth/PermissionType.scala

const (
	// ACLPermissionAllow is the "Allow" ACL permission type.
	ACLPermissionAllow ACLPermissionType = "Allow"
	// ACLPermissionDeny is the "Deny" ACL permission type.
	ACLPermissionDeny ACLPermissionType = "Deny"
)

type ACLResourceType

type ACLResourceType string

ACLResourceType is a string and it defines the valid resource types for ACL.

Based on: https://github.com/apache/kafka/blob/1.0/clients/src/test/java/org/apache/kafka/common/resource/ResourceTypeTest.java#L38

const (

	// ACLResourceAny is the "ANY" ACL resource type.
	ACLResourceAny ACLResourceType = "ANY"
	// ACLResourceTopic is the "TOPIC" ACL resource type.
	ACLResourceTopic ACLResourceType = "TOPIC"
	// ACLResourceGroup is the "GROUP" ACL resource type.
	ACLResourceGroup ACLResourceType = "GROUP"
	// ACLResourceCluster is the "CLUSTER" ACL resource type.
	ACLResourceCluster ACLResourceType = "CLUSTER"
	// ACLResourceTransactionalID is the "TRANSACTIONAL_ID" ACL resource type.
	ACLResourceTransactionalID ACLResourceType = "TRANSACTIONAL_ID"
	// ACLResourceDelegationToken is the "DELEGATION_TOKEN" ACL resource type,
	// available only on kafka version 1.1+.
	ACLResourceDelegationToken ACLResourceType = "DELEGATION_TOKEN"
)

type AddConnectionResponse

type AddConnectionResponse struct {
	Name string `json:"name"` // Required. Name of the connection.
}

type Alert

type Alert struct {
	// AlertID  is a unique identifier for the setting corresponding to this alert. See the available ids via `GetAlertSettings`.
	AlertID int `json:"alertId" yaml:"alertID" header:"ID,text"`

	Category string `json:"category,omitempty" yaml:"category,omitempty" header:"Category"`
	Severity string `json:"severity" yaml:"severity,omitempty" header:"Severity"`
	Instance string `json:"instance,omitempty" yaml:"instance,omitempty" header:"Instance"`

	Summary string                 `json:"summary" yaml:"summary" header:"Summary"`
	Source  string                 `json:"source,omitempty" yaml:"source,omitempty" header:"Source,empty"`
	Docs    string                 `json:"docs,omitempty" yaml:"docs,omitempty" header:"Docs,empty"`
	Map     map[string]interface{} `json:"map,omitempty" yaml:"map,omitempty" header:"Map,empty"`
}

Alert is the request payload that is used to register an Alert via `RegisterAlert` and the response that client retrieves from the `GetAlerts`.

type AlertConditionDetails

type AlertConditionDetails struct {
	CreatedAt    string                 `json:"createdAt,omitempty"`
	CreatedBy    string                 `json:"createdBy,omitempty"`
	ModifiedAt   string                 `json:"modifiedAt,omitempty"`
	ModifiedBy   string                 `json:"modifiedBy,omitempty"`
	Channels     []Channel              `json:"channels,omitempty"`
	ConditionDsl map[string]interface{} `json:"conditionDsl,omitempty"`
}

AlertConditionDetails contains the payload for an alert's condition details

type AlertConditionDsl

type AlertConditionDsl struct {
	Group     string `json:"group,omitempty"`
	Threshold int    `json:"threshold,omitempty"`
	Topic     string `json:"topic,omitempty"`
}

AlertConditionDsl contains the paylod for the condition's details

type AlertConditionRequestv1

type AlertConditionRequestv1 struct {
	Condition DataProduced `json:"condition" yaml:"condition"`
	Channels  []string     `json:"channels" yaml:"channels"`
}

AlertConditionRequestv1 represents the schema of /api/v1/alert/settings/{alert_setting_id}/conditions payload

type AlertResult

type AlertResult struct {
	PagesCount int     `json:"pagesAmount"`
	Alerts     []Alert `json:"values"`
}

AlertResult alerts in a paging format

type AlertSetting

type AlertSetting struct {
	ID                int                              `json:"id,omitempty" header:"ID,text"`
	Description       string                           `json:"description,omitempty" header:"Desc"`
	Category          string                           `json:"category,omitempty" header:"Category"`
	Enabled           bool                             `json:"enabled,omitempty" header:"Enabled"`
	IsAvailable       bool                             `json:"isAvailable,omitempty" header:"Available"`
	Docs              string                           `json:"docs,omitempty"`
	ConditionTemplate string                           `json:"conditionTemplate,omitempty"`
	ConditionRegex    string                           `json:"conditionRegex,omitempty"`
	Conditions        map[string]string                `json:"conditions,omitempty" header:"Conds"`
	Channels          []Channel                        `json:"channels,omitempty" header:"Chan,count"`
	ConditionDetails  map[string]AlertConditionDetails `json:"conditionDetails,omitempty"`
}

AlertSetting describes the type of list entry of the `GetAlertSetting` and `CreateOrUpdateAlertSettingCondition`.

type AlertSettingCondition

type AlertSettingCondition struct {
	ID           string                 `json:"id,omitempty" header:"ID,text"`
	ConditionDsl map[string]interface{} `json:"conditionDsl" header:"conditionDsl,text"`
	Channels     []string               `json:"channels" header:"channels,text"`
}

AlertSettingCondition - used to represent alert settings,

`ConditionDsl` is generic to handle both "Consumer lag" and "Data Produced" rules

type AlertSettings

type AlertSettings struct {
	Categories AlertSettingsCategoryMap `json:"categories" header:"inline"`
}

AlertSettings describes the type of list entry of the `GetAlertSettings`.

type AlertSettingsCategoryMap

type AlertSettingsCategoryMap struct {
	Infrastructure []AlertSetting `json:"infrastructure" header:"Infrastructure"`
	Consumers      []AlertSetting `json:"consumers" header:"Consumers"`
	Producers      []AlertSetting `json:"Data Produced" header:"Producers"`
	Apps           []AlertSetting `json:"Apps" header:"Apps"`
}

AlertSettingsCategoryMap describes the type of `AlertSetting`'s Categories.

type AlertSettingsConditionPayload

type AlertSettingsConditionPayload struct {
	AlertID     string   `json:"alert,omitempty" yaml:"alert"`
	ConditionID string   `json:"conditionID,omitempty" yaml:"conditionID"`
	Condition   string   `json:"condition" yaml:"condition"`
	Channels    []string `json:"channels" yaml:"channels"`
}

AlertSettingsConditionPayload is the payload for creating alert conditions

type AlertSettingsPayload

type AlertSettingsPayload struct {
	AlertID  string   `json:"id,omitempty" yaml:"id"`
	Enable   bool     `json:"enable" yaml:"enable"`
	Channels []string `json:"channels" yaml:"channels"`
}

AlertSettingsPayload contains the alert's settings datastructure

type AuditEntry

type AuditEntry struct {
	Type      AuditEntryType    `json:"type,omitempty" yaml:"type" header:"Type"`
	Action    string            `json:"action,omitempty" yaml:"action" header:"Action"`
	Resource  string            `json:"resourceName,omitempty" yaml:"resourceName" header:"Resource"`
	User      string            `json:"user,omitempty" yaml:"user" header:"User         "` /* make it a little bigger than expected, it looks slightly better for this field*/
	Timestamp int64             `json:"timestamp,omitempty" yaml:"timestamp" header:"Date,timestamp(ms|utc|02 Jan 2006 15:04)"`
	Content   map[string]string `json:"content,omitempty" yaml:"content" header:"Content"`
}

AuditEntry describes a lenses Audit Entry, used for audit logs API.

type AuditEntryChange

type AuditEntryChange string

AuditEntryChange the go type describer for the audit entry changes, see the `AuditEntry` structure for more.

const (
	AuditEntryAdd    AuditEntryChange = "ADD"
	AuditEntryRemove AuditEntryChange = "REMOVE"
	AuditEntryUpdate AuditEntryChange = "UPDATE"
	AuditEntryInsert AuditEntryChange = "INSERT"
)

The available audit entry changes. Available types: AuditEntryAdd, AuditEntryRemove, AuditEntryUpdate, AuditEntryInsert.

type AuditEntryHandler

type AuditEntryHandler func(AuditEntry) error

AuditEntryHandler is the type of the function, the listener which is the input parameter of the `GetAuditEntriesLive` API call.

type AuditEntryType

type AuditEntryType string

AuditEntryType the go type for audit entry types, see the `AuditEntry` structure for more.

const (
	AuditEntryTopic        AuditEntryType = "TOPIC"
	AuditEntryTopicData    AuditEntryType = "TOPIC_DATA"
	AuditEntryQuotas       AuditEntryType = "QUOTAS"
	AuditEntryBrokerConfig AuditEntryType = "BROKER_CONFIG"
	AuditEntryACL          AuditEntryType = "ACL"
	AuditEntrySchema       AuditEntryType = "SCHEMA"
	AuditEntryProcessor    AuditEntryType = "PROCESSOR"
	AuditEntryConnector    AuditEntryType = "CONNECTOR"
)

The available audit entry types. Available types: AuditEntryTopic, AuditEntryTopicData, AuditEntryQuotas, AuditEntryBrokerConfig, AuditEntryACL, AuditEntrySchema, AuditEntryProcessor, AuditEntryConnector.

type AuditsV3

type AuditsV3 struct {
	Values []AuditEntry `json:"values,omitempty"`
}

AuditsV3 is the response payload for Lenses v4.3 audits endpoint

type Authentication

type Authentication interface {
	// Auth accepts the current client and returns a not-nil error if authentication failed, otherwise
	// the authentication can alter the Client to do "something" before of each request.
	Auth(c *Client) error
}

Authentication is an interface which all authentication methods should implement.

See `BasicAuthentication` and `KerberosAuthentication` too.

type AuthenticationFunc

type AuthenticationFunc func(*Client) error

AuthenticationFunc implements the Authentication, it can be used for single-line custom authentication methods.

func (AuthenticationFunc) Auth

func (auth AuthenticationFunc) Auth(c *Client) error

Auth implements the `Authentication` interface, it just calls the func.

type BasicAuthentication

type BasicAuthentication struct {
	Username string `json:"username" yaml:"Username" survey:"username"`
	Password string `json:"password,omitempty" yaml:"Password" survey:"password"`
}

BasicAuthentication for Lenses, accepts raw username and password.

Use it when Lenses setup with "BASIC" or "LDAP" authentication.

func (BasicAuthentication) Auth

func (auth BasicAuthentication) Auth(c *Client) error

Auth implements the `Authentication` for the `BasicAuthentication`.

type BoxConfig

type BoxConfig struct {
	ConnectClusters []BoxConnectClusterConfigProperty `json:"lenses.kafka.connect.clusters"`

	Version string  `json:"lenses.version" header:"Version"`
	IP      string  `json:"lenses.ip" header:"IP"`
	Port    int     `json:"lenses.port" header:"Port,text"`
	JMXPort FlexInt `json:"lenses.jmx.port,omitempty" header:"JMX Port,text"`

	KafkaBrokers string `json:"lenses.kafka.brokers"`

	KubernetesConfigFile     string `json:"lenses.kubernetes.config.file,omitempty"`
	KubernetesImageName      string `json:"lenses.kubernetes.processor.image.name,omitempty" header:"K8 Image"`
	KubernetesImageTag       string `json:"lenses.kubernetes.processor.image.tag,omitempty" header:"K8 Tag"`
	KubernetesServiceAccount string `json:"lenses.kubernetes.service.account,omitempty" header:"K8 Service Acc"`

	LicenseFile        string                 `json:"lenses.license.file"`
	RootPath           string                 `json:"lenses.root.path,omitempty"`
	SchemaRegistryURLs []BoxURLConfigProperty `json:"lenses.schema.registry.urls"`
	SecurityMode       string                 `json:"lenses.security.mode" header:"Security Mode"`
	SQLExecutionMode   ExecutionMode          `json:"lenses.sql.execution.mode" header:"SQL Execution Mode"`

	TopicsAlertsSettings   string `json:"lenses.topics.alerts.settings"`
	TopicsAlertsStorage    string `json:"lenses.topics.alerts.storage"`
	TopicsAudits           string `json:"lenses.topics.audits"`
	TopicsCluster          string `json:"lenses.topics.cluster"`
	TopicsExternalMetrics  string `json:"lenses.topics.external.metrics"`
	TopicsExternalTopology string `json:"lenses.topics.external.topology"`
	TopicsLSQLStorage      string `json:"lenses.topics.lsql.storage"`
	TopicsMetadata         string `json:"lenses.topics.metadata"`
	TopicsMetrics          string `json:"lenses.topics.metrics"`
	TopicsProcessors       string `json:"lenses.topics.processors"`
	TopicsProfiles         string `json:"lenses.topics.profiles"`

	ZookeeperChroot string                 `json:"lenses.zookeeper.chroot"`
	ZookeeperHosts  []BoxURLConfigProperty `json:"lenses.zookeeper.hosts"`
}

BoxConfig contains the structure for the lenses box configuration, see the `GetConfig` call.

Note that this structure contains only the properties that are exposed via the API's response data.

type BoxConnectClusterConfigProperty

type BoxConnectClusterConfigProperty struct {
	Configs  string                 `json:"configs"`
	Name     string                 `json:"name"`
	Offsets  string                 `json:"offsets"`
	Statuses string                 `json:"statuses"`
	URLs     []BoxURLConfigProperty `json:"urls"`
}

BoxConnectClusterConfigProperty the Box Config's embedded configuration for the Connect Clusters.

type BoxURLConfigProperty

type BoxURLConfigProperty struct {
	JMX string `json:"jmx"`
	URL string `json:"url"`
}

BoxURLConfigProperty used on the BoxConfig to describe the urls.

type BrokerConfig

type BrokerConfig struct {
	LogCleanerThreads int             `json:"log.cleaner.threads" yaml:"logCleanerThreads" header:"Log Cleaner Threads"`
	CompressionType   CompressionType `json:"compression.type" yaml:"compressionType" header:"Compression Type"`
	AdvertisedPort    int             `json:"advertised.port" yaml:"advertisedPort" header:"Advertised Port"`
}

BrokerConfig describes the kafka broker's configurations.

type Channel

type Channel struct {
	ID              string `json:"id,omitempty" yaml:"id" header:"Id,text"`
	Name            string `json:"name,omitempty" yaml:"name" header:"Name,text"`
	ConnectionName  string `json:"connectionName,omitempty" yaml:"connectionName" header:"Connection Name,text"`
	TemplateName    string `json:"templateName,omitempty" yaml:"templateName" header:"Template,text"`
	TemplateVersion int    `json:"templateVersion,omitempty" yaml:"templateVersion" header:"Template version"`
	Properties      []KV   `json:"properties,omitempty" yaml:"properties" header:"Properties,count"`
	CreatedAt       string `json:"createdAt,omitempty" yaml:"createdAt"`
	CreatedBy       string `json:"createdBy,omitempty" yaml:"createdBy"`
	UpdatedAt       string `json:"updatedAt,omitempty" yaml:"updatedAt"`
	UpdatedBy       string `json:"updatedBy,omitempty" yaml:"updatedBy"`
}

Channel describes a channel of an alert

type ChannelPayload

type ChannelPayload struct {
	Name           string `json:"name" yaml:"name"`
	ConnectionName string `json:"connectionName" yaml:"connectionName"`
	TemplateName   string `json:"templateName" yaml:"templateName"`
	Properties     []KV   `json:"properties" yaml:"properties"`
}

ChannelPayload describes a channel of an alert payload for create/update

type ChannelResponse

type ChannelResponse struct {
	PagesAmount int       `json:"pagesAmount" yaml:"pagesAmount" header:"Pages,text"`
	TotalCount  int       `json:"totalCount" yaml:"totalCount" header:"Total,text"`
	Values      []Channel `json:"values" yaml:"values" header:"Values,inline"`
}

ChannelResponse response for alert channels

type ChannelResponseWithDetails

type ChannelResponseWithDetails struct {
	PagesAmount int                  `json:"pagesAmount" yaml:"pagesAmount" header:"Pages,text"`
	TotalCount  int                  `json:"totalCount" yaml:"totalCount" header:"Total,text"`
	Values      []ChannelWithDetails `json:"values" yaml:"values" header:"Values,inline"`
}

ChannelResponseWithDetails response for alert channels

type ChannelTemplate

type ChannelTemplate struct {
	ID              int    `json:"id" yaml:"id"`
	Name            string `json:"name" yaml:"name" header:"name"`
	TemplateVersion int    `json:"templateVersion,omitempty" yaml:"templateVersion" header:"Template Version"`
	Version         string `json:"version" yaml:"version" header:"version"`
	Enabled         bool   `json:"enabled" yaml:"enabled" header:"enabled"`
	BuiltIn         bool   `json:"builtIn" yaml:"builtin" header:"builtin"`
	Metadata        struct {
		Author      string `json:"author"`
		Description string `json:"description"`
	} `json:"metadata"`
	Configuration []struct {
		ID          int    `json:"id"`
		Key         string `json:"key"`
		DisplayName string `json:"displayName"`
		Placeholder string `json:"placeholder"`
		Description string `json:"description"`
		Type        struct {
			Name        string      `json:"name"`
			DisplayName string      `json:"displayName"`
			EnumValues  interface{} `json:"enumValues"`
		} `json:"type"`
		Required bool `json:"required"`
		Provided bool `json:"provided"`
	} `json:"configuration"`
	SuitableConnections []struct {
		TemplateName string `json:"templateName"`
		Name         string `json:"name"`
	} `json:"suitableConnections"`
}

ChannelTemplate payload struct used for alert and audit

type ChannelWithDetails

type ChannelWithDetails struct {
	ID              string `json:"id" yaml:"id" header:"Id,text"`
	Name            string `json:"name" yaml:"name" header:"Name,text"`
	ConnectionName  string `json:"connectionName" yaml:"connectionName" header:"Connection Name,text"`
	TemplateName    string `json:"templateName" yaml:"templateName" header:"Template,text"`
	TemplateVersion int    `json:"templateVersion,omitempty" yaml:"templateVersion" header:"Template version"`
	Properties      []KV   `json:"properties" yaml:"properties" header:"Properties"`
	CreatedAt       string `json:"createdAt" yaml:"createdAt" header:"Created at,date"`
	CreatedBy       string `json:"createdBy" yaml:"createdBy" header:"Created by,text"`
	UpdatedAt       string `json:"updatedAt" yaml:"updatedAt" header:"Updated at,date"`
	UpdatedBy       string `json:"updatedBy" yaml:"updatedBy" header:"Updated by,text"`
}

ChannelWithDetails describes a channel of an alert with more details

type Client

type Client struct {
	Config *ClientConfig

	// PersistentRequestModifier can be used to modify the *http.Request before send it to the backend.
	PersistentRequestModifier RequestOption

	// Progress                  func(current, total int64)
	// User is generated on `lenses#OpenConnection` function based on the `Config#Authentication`.
	User User
	// contains filtered or unexported fields
}

Client is the lenses http client. It contains the necessary API calls to communicate and develop via lenses.

func OpenConnection

func OpenConnection(cfg ClientConfig, options ...ConnectionOption) (*Client, error)

OpenConnection creates & returns a new Lenses API bridge interface based on the passed `ClientConfig` and the (optional) options. OpenConnection authenticates the user and returns a valid ready-to-use `*lenses.Client`. If failed to communicate with the server then it returns a nil client and a non-nil error.

Usage: auth := lenses.BasicAuthentication{Username: "user", Password: "pass"} config := lenses.ClientConfig{Host: "domain.com", Authentication: auth, Timeout: "15s"} client, err := lenses.OpenConnection(config) // or (config, lenses.UsingClient/UsingToken) if err != nil { panic(err) } client.DeleteTopic("topicName")

Read more by navigating to the `Client` type documentation.

func (*Client) CancelQuery

func (c *Client) CancelQuery(id int64) (bool, error)

CancelQuery stops a running query based on its ID. It returns true whether it was cancelled otherwise false or/and error.

func (*Client) CloneGroup

func (c *Client) CloneGroup(currentName string, newName string) error

CloneGroup clones a group

func (*Client) CreateAlertSettingsCondition

func (c *Client) CreateAlertSettingsCondition(alertID, condition string, channels []string) error

CreateAlertSettingsCondition corresponds to `/api/v1/alerts/settings/{alert_setting_id}/condition/{condition_id}`

func (*Client) CreateChannel

func (c *Client) CreateChannel(chnl ChannelPayload, channelPath string) error

CreateChannel handles the creation of a channel

func (*Client) CreateConnection

func (c *Client) CreateConnection(connectionName string, templateName string, configString string, configArray []ConnectionConfig, tags []string) (err error)

CreateConnection creates a new Lenses connection

func (*Client) CreateConnector

func (c *Client) CreateConnector(clusterName, name string, config ConnectorConfig) (connector Connector, err error)

CreateConnector creates a new connector. It returns the current connector info if successful.

name (string) – Name of the connector to create config (map) – Config parameters for the connector. All values should be strings.

Look `UpdateConnector` too.

func (*Client) CreateGroup

func (c *Client) CreateGroup(group *Group) error

CreateGroup creates a group

func (*Client) CreateKafkaConnectConnection

func (c *Client) CreateKafkaConnectConnection(reqBody KafkaConnectConnectionAddRequest) (resp AddConnectionResponse, err error)

Adds a new connection. Tags: KafkaConnectConnections.

func (*Client) CreateKafkaConnection

func (c *Client) CreateKafkaConnection(reqBody KafkaConnectionAddRequest) (resp AddConnectionResponse, err error)

Adds a new connection. Tags: KafkaConnections.

func (*Client) CreateKerberosConnection

func (c *Client) CreateKerberosConnection(reqBody KerberosConnectionAddRequest) (resp AddConnectionResponse, err error)

Adds a new connection. Tags: KerberosConnections.

func (*Client) CreateOrUpdateACL

func (c *Client) CreateOrUpdateACL(acl ACL) error

CreateOrUpdateACL sets an Apache Kafka Access Control List. Use the defined types when needed, example: `client.CreateOrUpdateACL(lenses.ACL{lenses.ACLResourceTopic, "transactions", "principalType:principalName", lenses.ACLPermissionAllow, "*", lenses.OpRead})`

Note that on the "host" input argument you should use IP addresses as domain names are not supported at the moment by Apache Kafka.

func (*Client) CreateOrUpdateQuotaForAllClients

func (c *Client) CreateOrUpdateQuotaForAllClients(config QuotaConfig) error

CreateOrUpdateQuotaForAllClients sets the default quota for all clients. Read more at: https://docs.lenses.io/using-lenses/user-guide/quotas.html.

func (*Client) CreateOrUpdateQuotaForAllUsers

func (c *Client) CreateOrUpdateQuotaForAllUsers(config QuotaConfig) error

CreateOrUpdateQuotaForAllUsers sets the default quota for all users. Read more at: https://docs.lenses.io/using-lenses/user-guide/quotas.html.

func (*Client) CreateOrUpdateQuotaForClient

func (c *Client) CreateOrUpdateQuotaForClient(clientID string, config QuotaConfig) error

CreateOrUpdateQuotaForClient sets the quota for a specific client. Read more at: https://docs.lenses.io/using-lenses/user-guide/quotas.html.

func (*Client) CreateOrUpdateQuotaForUser

func (c *Client) CreateOrUpdateQuotaForUser(user string, config QuotaConfig) error

CreateOrUpdateQuotaForUser sets a quota for a user. Read more at: https://docs.lenses.io/using-lenses/user-guide/quotas.html.

func (*Client) CreateOrUpdateQuotaForUserAllClients

func (c *Client) CreateOrUpdateQuotaForUserAllClients(user string, config QuotaConfig) error

CreateOrUpdateQuotaForUserAllClients sets a quota for a user for all clients. Read more at: https://docs.lenses.io/using-lenses/user-guide/quotas.html.

func (*Client) CreateOrUpdateQuotaForUserClient

func (c *Client) CreateOrUpdateQuotaForUserClient(user, clientID string, config QuotaConfig) error

CreateOrUpdateQuotaForUserClient sets the quota for a user/client pair. Read more at: https://docs.lenses.io/using-lenses/user-guide/quotas.html.

func (*Client) CreateOrUpdateTopicMetadata

func (c *Client) CreateOrUpdateTopicMetadata(metadata TopicMetadata) error

CreateOrUpdateTopicMetadata adds or updates an existing topic metadata.

func (*Client) CreatePolicy

func (c *Client) CreatePolicy(policy DataPolicyRequest) error

CreatePolicy create a data policy

func (*Client) CreateProcessor

func (c *Client) CreateProcessor(name string, sql string, runners int, clusterName, namespace, pipeline string, processorID string) error

CreateProcessor creates a new LSQL processor.

func (*Client) CreateSchemaRegistryConnection

func (c *Client) CreateSchemaRegistryConnection(reqBody SchemaRegistryConnectionAddRequest) (resp AddConnectionResponse, err error)

Adds a new connection. Tags: SchemaRegistryConnections.

func (*Client) CreateServiceAccount

func (c *Client) CreateServiceAccount(serviceAccount *ServiceAccount) (token CreateSvcAccPayload, err error)

CreateServiceAccount creates a service account

func (*Client) CreateTopic

func (c *Client) CreateTopic(topicName string, replication, partitions int, configs KV) error

CreateTopic creates a topic.

topicName, string, Required. replication, int. partitions, int. configs, topic key - value.

Read more at: https://docs.lenses.io/dev/lenses-apis/rest-api/index.html#create-topic

func (*Client) CreateUser

func (c *Client) CreateUser(user *UserMember) error

CreateUser creates a user

func (*Client) CreateUserProfilePropertyValue

func (c *Client) CreateUserProfilePropertyValue(property, value string) error

CreateUserProfilePropertyValue adds a "value" to the user profile "property" entries.

func (*Client) CreateZookeeperConnection

func (c *Client) CreateZookeeperConnection(reqBody ZookeeperConnectionAddRequest) (resp AddConnectionResponse, err error)

Adds a new connection. Tags: ZookeeperConnections.

func (*Client) DeleteACL

func (c *Client) DeleteACL(acl ACL) error

DeleteACL deletes an existing Apache Kafka Access Control List.

func (*Client) DeleteAlertEvents

func (c *Client) DeleteAlertEvents(timestamp int64) (err error)

DeleteAlertEvents deletes alert events.

Deletes all the alert events older than timestamp.

func (*Client) DeleteAlertSettingCondition

func (c *Client) DeleteAlertSettingCondition(alertSettingID int, conditionUUID string) error

DeleteAlertSettingCondition deletes a condition from an alert setting.

func (*Client) DeleteAuditEntries

func (c *Client) DeleteAuditEntries(timestamp int64) (err error)

DeleteAuditEntries deletes audit logs.

Deletes all the audit logs older than timestamp.

func (*Client) DeleteChannel

func (c *Client) DeleteChannel(path, channelID string) error

DeleteChannel deletes a channel (can be used both for audit and alert channels)

func (*Client) DeleteConnection

func (c *Client) DeleteConnection(connectionName string) (err error)

DeleteConnection deletes a new Lenses connection

func (*Client) DeleteConnection1

func (c *Client) DeleteConnection1(name string) (err error)

Deletes the connection. Parameters: - name: The name of the connection. Tags: Connections.

func (*Client) DeleteConnector

func (c *Client) DeleteConnector(clusterName, name string) error

DeleteConnector deletes a connector, halting all tasks and deleting its configuration. It return a 409 (Conflict) status code error if rebalance is in process.

func (*Client) DeleteDynamicBrokerConfigs

func (c *Client) DeleteDynamicBrokerConfigs(brokerID int, configKeysToBeReseted ...string) error

DeleteDynamicBrokerConfigs deletes a configuration for a broker. Deleting a configuration dynamically reverts it to its default value.

func (*Client) DeleteDynamicClusterConfigs

func (c *Client) DeleteDynamicClusterConfigs(configKeysToBeReset ...string) error

DeleteDynamicClusterConfigs deletes cluster configuration(s) dynamically. It reverts the configuration to its default value.

func (*Client) DeleteGroup

func (c *Client) DeleteGroup(name string) error

DeleteGroup deletes a group

func (*Client) DeleteKafkaConnectConnection

func (c *Client) DeleteKafkaConnectConnection(name string) (err error)

Deletes the connection. Parameters: - name: The name of the connection. Tags: KafkaConnectConnections.

func (*Client) DeleteKafkaConnection

func (c *Client) DeleteKafkaConnection(name string) (err error)

Deletes the connection. Parameters: - name: The name of the connection. Tags: KafkaConnections.

func (*Client) DeleteKerberosConnection

func (c *Client) DeleteKerberosConnection(name string) (err error)

Deletes the connection. Parameters: - name: The name of the connection. Tags: KerberosConnections.

func (*Client) DeletePolicy

func (c *Client) DeletePolicy(id string) error

DeletePolicy deletes a policy

func (*Client) DeleteProcessor

func (c *Client) DeleteProcessor(processorNameOrID string) error

DeleteProcessor removes a processor based on its name or the full id, it depends on lenses execution mode, use the `LookupProcessorIdentifier`.

func (*Client) DeleteQuotaForAllClients

func (c *Client) DeleteQuotaForAllClients(propertiesToRemove ...string) error

DeleteQuotaForAllClients deletes the default quota for all clients.

if "propertiesToRemove" is not passed or empty then the client will send all the available keys to be removed, see `DefaultQuotaConfigPropertiesToRemove` for more.

func (*Client) DeleteQuotaForAllUsers

func (c *Client) DeleteQuotaForAllUsers(propertiesToRemove ...string) error

DeleteQuotaForAllUsers deletes the default for all users. Read more at: https://docs.lenses.io/using-lenses/user-guide/quotas.html.

if "propertiesToRemove" is not passed or empty then the client will send all the available keys to be removed, see `DefaultQuotaConfigPropertiesToRemove` for more.

func (*Client) DeleteQuotaForClient

func (c *Client) DeleteQuotaForClient(clientID string, propertiesToRemove ...string) error

DeleteQuotaForClient deletes quotas for a client id.

if "propertiesToRemove" is not passed or empty then the client will send all the available keys to be removed, see `DefaultQuotaConfigPropertiesToRemove` for more.

func (*Client) DeleteQuotaForUser

func (c *Client) DeleteQuotaForUser(user string, propertiesToRemove ...string) error

DeleteQuotaForUser deletes a quota for a user. if "propertiesToRemove" is not passed or empty then the client will send all the available keys to be removed, see `DefaultQuotaConfigPropertiesToRemove` for more.

func (*Client) DeleteQuotaForUserAllClients

func (c *Client) DeleteQuotaForUserAllClients(user string, propertiesToRemove ...string) error

DeleteQuotaForUserAllClients deletes for all client ids for a user.

if "propertiesToRemove" is not passed or empty then the client will send all the available keys to be removed, see `DefaultQuotaConfigPropertiesToRemove` for more.

func (*Client) DeleteQuotaForUserClient

func (c *Client) DeleteQuotaForUserClient(user, clientID string, propertiesToRemove ...string) error

DeleteQuotaForUserClient deletes the quota for a user/client pair.

if "propertiesToRemove" is not passed or empty then the client will send all the available keys to be removed, see `DefaultQuotaConfigPropertiesToRemove` for more.

func (*Client) DeleteSchemaRegistryConnection

func (c *Client) DeleteSchemaRegistryConnection(name string) (err error)

Deletes the connection. Parameters: - name: The name of the connection. Tags: SchemaRegistryConnections.

func (*Client) DeleteServiceAccount

func (c *Client) DeleteServiceAccount(name string) error

DeleteServiceAccount deletes a service account

func (*Client) DeleteTopic

func (c *Client) DeleteTopic(topicName string) error

DeleteTopic deletes a topic. It accepts the topicName, a required, not empty string.

Read more at: https://docs.lenses.io/dev/lenses-apis/rest-api/index.html#delete-topic

func (*Client) DeleteTopicMetadata

func (c *Client) DeleteTopicMetadata(topicName string) error

DeleteTopicMetadata removes an existing topic metadata.

func (*Client) DeleteTopicRecords

func (c *Client) DeleteTopicRecords(topicName string, fromPartition int, toOffset int64) error

DeleteTopicRecords deletes a topic's records from partition to an offset. If user has no rights for that action it returns `ErrResourceNotAccessible`, if negative value of "toOffset" then it returns `ErrResourceNotGood`.

All input arguments are required.

func (*Client) DeleteUser

func (c *Client) DeleteUser(username string) error

DeleteUser deletes a user

func (*Client) DeleteUserProfilePropertyValue

func (c *Client) DeleteUserProfilePropertyValue(property, value string) error

DeleteUserProfilePropertyValue removes the "value" from the user profile "property" entries.

func (*Client) DeleteZookeeperConnection

func (c *Client) DeleteZookeeperConnection(name string) (err error)

Deletes the connection. Parameters: - name: The name of the connection. Tags: ZookeeperConnections.

func (*Client) Do

func (c *Client) Do(method, path, contentType string, send []byte, options ...RequestOption) (*http.Response, error)

Do is the lower level of a client call, manually sends an HTTP request to the lenses box backend based on the `Client#Config` and returns an HTTP response.

func (*Client) EnableAlertSetting

func (c *Client) EnableAlertSetting(id int, enable bool) error

EnableAlertSetting enables a specific alert setting based on its "id".

func (*Client) GetACLs

func (c *Client) GetACLs() ([]ACL, error)

GetACLs returns all the available Apache Kafka Access Control Lists.

func (*Client) GetAccessToken

func (c *Client) GetAccessToken() string

GetAccessToken returns the access token that generated from the `OpenConnection` or given by the configuration.

func (*Client) GetAlertChannelTemplates

func (c *Client) GetAlertChannelTemplates() (response []ChannelTemplate, err error)

GetAlertChannelTemplates returns all alert channel templates

func (*Client) GetAlertSetting

func (c *Client) GetAlertSetting(id int) (setting AlertSetting, err error)

GetAlertSetting returns a specific alert setting based on its "id".

func (*Client) GetAlertSettingConditions

func (c *Client) GetAlertSettingConditions(id int) ([]AlertSettingCondition, error)

GetAlertSettingConditions returns alert setting's conditions as an array of `AlertSettingCondition`

func (*Client) GetAlertSettings

func (c *Client) GetAlertSettings() (AlertSettings, error)

GetAlertSettings returns all the configured alert settings. Alerts are divided into two categories:

* Infrastructure - These are out of the box alerts that be toggled on and offset. * Consumer group - These are user-defined alerts on consumer groups.

Alert notifications are the result of an `AlertSetting` Condition being met on an `AlertSetting`.

func (*Client) GetAlerts

func (c *Client) GetAlerts(pageSize int) (alerts []Alert, err error)

GetAlerts returns the registered alerts.

func (*Client) GetAuditChannelTemplates

func (c *Client) GetAuditChannelTemplates() (response []ChannelTemplate, err error)

GetAuditChannelTemplates returns all audit channel templates

func (*Client) GetAuditEntries

func (c *Client) GetAuditEntries() (entries []AuditEntry, err error)

GetAuditEntries returns the last buffered audit entries.

Retrives the last N audit entries created. See `GetAuditEntriesLive` for real-time notifications.

func (*Client) GetAuditEntriesLive

func (c *Client) GetAuditEntriesLive(handler AuditEntryHandler) error

GetAuditEntriesLive returns the live audit notifications, see `GetAuditEntries` too.

func (*Client) GetAvailableTopicConfigKeys

func (c *Client) GetAvailableTopicConfigKeys() ([]string, error)

GetAvailableTopicConfigKeys retrieves a list of available configs for topics.

func (*Client) GetChannels

func (c *Client) GetChannels(path string, page int, pageSize int, sortField, sortOrder, templateName, channelName string) (response ChannelResponse, err error)

GetChannels read channels (can be used both for audit and alert channels)

func (*Client) GetChannelsWithDetails

func (c *Client) GetChannelsWithDetails(path string, page int, pageSize int, sortField, sortOrder, templateName, channelName string) (response ChannelResponseWithDetails, err error)

GetChannelsWithDetails read channels details (can be used both for audit and alert channels)

func (*Client) GetConfig

func (c *Client) GetConfig() (cfg BoxConfig, err error)

GetConfig returns the whole configuration of the lenses box, which can be changed from box to box and it's read-only.

It returns a `BoxConfig`.

If you just need to retrieve the execution mode of the box use the `GetExecutionMode` instead.

func (*Client) GetConfigEntry

func (c *Client) GetConfigEntry(outPtr interface{}, keys ...string) error

GetConfigEntry reads the lenses back-end configuration and sets the value of a key, based on "keys", to the "outPtr".

func (*Client) GetConnectClusters

func (c *Client) GetConnectClusters() (clusters []string, err error)

GetConnectClusters Read KafkaConnect clusters via connections API

func (*Client) GetConnection

func (c *Client) GetConnection(name string) (response Connection, err error)

GetConnection returns a specific connection

func (*Client) GetConnection1

func (c *Client) GetConnection1(name string) (resp ConnectionJsonResponse, err error)

Returns the connection details. Parameters: - name: The name of the connection. Tags: Connections.

func (*Client) GetConnectionTemplates

func (c *Client) GetConnectionTemplates() (response []ConnectionTemplate, err error)

GetConnectionTemplates returns all connections

func (*Client) GetConnections

func (c *Client) GetConnections() (response []ConnectionList, err error)

GetConnections returns all connections

func (*Client) GetConnector

func (c *Client) GetConnector(clusterName, name string) (connector Connector, err error)

GetConnector returns the information about the connector. See `Connector` type

func (*Client) GetConnectorConfig

func (c *Client) GetConnectorConfig(clusterName, name string) (cfg ConnectorConfig, err error)

GetConnectorConfig returns the configuration for the connector.

func (*Client) GetConnectorPlugins

func (c *Client) GetConnectorPlugins(clusterName string) (cp []ConnectorPlugin, err error)

GetConnectorPlugins returns a list of connector plugins installed in the Kafka Connect cluster. Note that the API only checks for connectors on the worker that handles the request, which means it is possible to see inconsistent results, especially during a rolling upgrade if you add new connector jars.

func (*Client) GetConnectorStatus

func (c *Client) GetConnectorStatus(clusterName, name string) (cs ConnectorStatus, err error)

GetConnectorStatus returns the current status of the connector, including whether it is running, failed or paused, which worker it is assigned to, error information if it has failed, and the state of all its tasks.

func (*Client) GetConnectorTaskStatus

func (c *Client) GetConnectorTaskStatus(clusterName, name string, taskID int) (cst ConnectorStatusTask, err error)

GetConnectorTaskStatus returns a task’s status.

func (*Client) GetConnectorTasks

func (c *Client) GetConnectorTasks(clusterName, name string) (m []map[string]interface{}, err error)

GetConnectorTasks returns a list of tasks currently running for the connector.

func (*Client) GetConnectors

func (c *Client) GetConnectors(clusterName string) (names []string, err error)

GetConnectors returns a list of active connectors names as list of strings.

Visit https://docs.lenses.io/dev/lenses-apis/rest-api/index.html#connector-api

func (*Client) GetDeploymentTargets

func (c *Client) GetDeploymentTargets() (DeploymentTargets, error)

GetDeploymentTargets returns a list of all deployment target clusters

func (*Client) GetDynamicBrokerConfigs

func (c *Client) GetDynamicBrokerConfigs(brokerID int) (config BrokerConfig, err error)

GetDynamicBrokerConfigs returns the dynamic updated configurations for a kafka broker. Retrieves only the ones added/updated dynamically.

func (*Client) GetDynamicClusterConfigs

func (c *Client) GetDynamicClusterConfigs() (configs BrokerConfig, err error)

GetDynamicClusterConfigs returns the dynamic updated configurations for a kafka cluster. Retrieves only the ones added/updated dynamically.

func (*Client) GetExecutionMode

func (c *Client) GetExecutionMode() (ExecutionMode, error)

GetExecutionMode returns the execution mode, if not error returned then the possible values are: `ExecutionModeInProc`, `ExecutionModeConnect` or `ExecutionModeKubernetes`.

func (*Client) GetGroup

func (c *Client) GetGroup(name string) (group Group, err error)

GetGroup returns the group by the provided name

func (*Client) GetGroups

func (c *Client) GetGroups() (groups []Group, err error)

GetGroups returns the list of groups

func (*Client) GetIndex

func (c *Client) GetIndex(connectionName string, indexName string) (index Index, err error)

GetIndex fetches stuff about an index

func (*Client) GetIndexes

func (c *Client) GetIndexes(connectionName string, includeSystemIndexes bool) (indexes []Index, err error)

GetIndexes returns the list of elasticsearch indexes.

func (*Client) GetKafkaConnectConnection

func (c *Client) GetKafkaConnectConnection(name string) (resp KafkaConnectConnectionResponse, err error)

Returns the connection details. Parameters: - name: The name of the connection. Tags: KafkaConnectConnections.

func (*Client) GetKafkaConnection

func (c *Client) GetKafkaConnection(name string) (resp KafkaConnectionResponse, err error)

Returns the connection details. Parameters: - name: The name of the connection. Tags: KafkaConnections.

func (*Client) GetKerberosConnection

func (c *Client) GetKerberosConnection(name string) (resp KerberosConnectionResponse, err error)

Returns the connection details. Parameters: - name: The name of the connection. Tags: KerberosConnections.

func (*Client) GetLicenseInfo

func (c *Client) GetLicenseInfo() (LicenseInfo, error)

GetLicenseInfo returns the license information for the connected lenses box.

func (*Client) GetLogsInfo

func (c *Client) GetLogsInfo() ([]LogLine, error)

GetLogsInfo returns the latest (512) INFO log lines.

func (*Client) GetLogsMetrics

func (c *Client) GetLogsMetrics() ([]LogLine, error)

GetLogsMetrics returns the latest (512) METRICS log lines.

func (*Client) GetPolicies

func (c *Client) GetPolicies() ([]DataPolicy, error)

GetPolicies retrieves data policies from Lenses

func (*Client) GetPolicy

func (c *Client) GetPolicy(id string) (DataPolicy, error)

GetPolicy retrieves the specified policy

func (*Client) GetPolicyCategory

func (c *Client) GetPolicyCategory() ([]string, error)

GetPolicyCategory retrieves the data policy categories

func (*Client) GetPolicyImpacts

func (c *Client) GetPolicyImpacts() ([]DataImpactType, error)

GetPolicyImpacts retrieves the data policy impacts

func (*Client) GetPolicyObfuscation

func (c *Client) GetPolicyObfuscation() ([]DataObfuscationType, error)

GetPolicyObfuscation retrieves the data policy obfuscation types

func (*Client) GetProcessor

func (c *Client) GetProcessor(processorID string) (ProcessorStream, error)

GetProcessor returns a processor from Lenses for the given id

func (*Client) GetProcessors

func (c *Client) GetProcessors() (ProcessorsResult, error)

GetProcessors returns a list of all available LSQL processors.

func (*Client) GetProcessorsLogs

func (c *Client) GetProcessorsLogs(clusterName, ns, podName string, follow bool, lines int, handler func(level string, log string) error) error

GetProcessorsLogs retrieves the LSQL processor logs if in kubernetes mode.

func (*Client) GetQuotas

func (c *Client) GetQuotas() ([]Quota, error)

GetQuotas returns a list of all available quotas.

func (*Client) GetRunningQueries

func (c *Client) GetRunningQueries() ([]LSQLRunningQuery, error)

GetRunningQueries returns a list of the current sql running queries.

func (*Client) GetSchema

func (c *Client) GetSchema(name string) (response GetSchemaRes, err error)

GetSchema returns the details of a schema

func (*Client) GetSchemaRegistryConnection

func (c *Client) GetSchemaRegistryConnection(name string) (resp SchemaRegistryConnectionResponse, err error)

Returns the connection details. Parameters: - name: The name of the connection. Tags: SchemaRegistryConnections.

func (*Client) GetServiceAccount

func (c *Client) GetServiceAccount(name string) (serviceAccount ServiceAccount, err error)

GetServiceAccount returns the service account by the provided name

func (*Client) GetServiceAccounts

func (c *Client) GetServiceAccounts() (serviceAccounts []ServiceAccount, err error)

GetServiceAccounts returns the list of service accounts

func (*Client) GetSetupStatus added in v5.1.0

func (c *Client) GetSetupStatus() (resp SetupStatus, err error)

Returns the setup stage status. Tags: Internal.

func (*Client) GetSubjects

func (c *Client) GetSubjects() (subs Subjects, err error)

GetSubjects retrieves all registered subjects

func (*Client) GetSupportedConnectors

func (c *Client) GetSupportedConnectors() ([]ConnectorInfoUI, error)

GetSupportedConnectors returns the list of the supported Kafka Connectors.

func (*Client) GetTopic

func (c *Client) GetTopic(topicName string) (topic Topic, err error)

GetTopic returns a topic's information, a `lenses.Topic` value.

Read more at: https://docs.lenses.io/dev/lenses-apis/rest-api/index.html#get-topic-information

func (*Client) GetTopicExtract

func (c *Client) GetTopicExtract(id string) ([]TopicExtract, error)

GetTopicExtract returns a TopicExtract for an id

func (*Client) GetTopicMetadata

func (c *Client) GetTopicMetadata(topicName string) (TopicMetadata, error)

GetTopicMetadata retrieves and returns a topic's metadata.

func (*Client) GetTopicSettings

func (c *Client) GetTopicSettings() (settings TopicSettingsResponse, err error)

GetTopicSettings from the API

func (*Client) GetTopics

func (c *Client) GetTopics() (topics []Topic, err error)

GetTopics returns the list of topics.

func (*Client) GetTopicsMetadata

func (c *Client) GetTopicsMetadata() ([]TopicMetadata, error)

GetTopicsMetadata retrieves and returns all the topics' available metadata.

func (*Client) GetTopicsNames

func (c *Client) GetTopicsNames() ([]string, error)

GetTopicsNames returns the list of topics' names.

func (*Client) GetUser

func (c *Client) GetUser(name string) (user UserMember, err error)

GetUser returns the user by the provided name

func (*Client) GetUserProfile

func (c *Client) GetUserProfile() (UserProfile, error)

GetUserProfile returns the user-specific favourites.

func (*Client) GetUsers

func (c *Client) GetUsers() (users []UserMember, err error)

GetUsers returns the list of users

func (*Client) GetZookeeperConnection

func (c *Client) GetZookeeperConnection(name string) (resp ZookeeperConnectionResponse, err error)

Returns the connection details. Parameters: - name: The name of the connection. Tags: ZookeeperConnections.

func (*Client) ListConnectionTemplates

func (c *Client) ListConnectionTemplates() (resp []ConnectionTemplateResponse, err error)

Lists all connections templates. A connection's template defines the type of the connection, and the schema of it'sconfiguration.. Tags: Connections.

func (*Client) ListConnections

func (c *Client) ListConnections() (resp []ConnectionSummaryResponse, err error)

Returns the list of available connections. Tags: Connections.

func (*Client) ListDatasets

func (c *Client) ListDatasets(reqParams ListDatasetsParameters) (res Results, err error)

ListDatasets retrieves a list of datasets. Tags: Datasets.

func (*Client) ListDatasetsPg

func (c *Client) ListDatasetsPg(params ListDatasetsParameters, maxResults int) (vs []DatasetMatch, err error)

ListDatasetsPg hides ListDatasets' paging.

func (*Client) ListKafkaConnectConnections

func (c *Client) ListKafkaConnectConnections() (resp []ConnectionSummaryResponse, err error)

Returns the list of available connections. Tags: KafkaConnectConnections.

func (*Client) ListKafkaConnections

func (c *Client) ListKafkaConnections() (resp []ConnectionSummaryResponse, err error)

Returns the list of available connections. Tags: KafkaConnections.

func (*Client) ListKerberosConnections

func (c *Client) ListKerberosConnections() (resp []ConnectionSummaryResponse, err error)

Returns the list of available connections. Tags: KerberosConnections.

func (*Client) ListSchemaRegistryConnections

func (c *Client) ListSchemaRegistryConnections() (resp []ConnectionSummaryResponse, err error)

Returns the list of available connections. Tags: SchemaRegistryConnections.

func (*Client) ListZookeeperConnections

func (c *Client) ListZookeeperConnections() (resp []ConnectionSummaryResponse, err error)

Returns the list of available connections. Tags: ZookeeperConnections.

func (*Client) Logout

func (c *Client) Logout() error

Logout invalidates the token and revoke its access. A new Client, using `OpenConnection`, should be created in order to continue after this call.

func (*Client) LookupProcessorIdentifier

func (c *Client) LookupProcessorIdentifier(id, name, clusterName, namespace string) (string, error)

LookupProcessorIdentifier is not a direct API call, although it fires requests to get the result. It's a helper which can be used as an input argument of the `DeleteProcessor` and `StopProcessor` and `ResumeProcessor` and `UpdateProcessorRunners` functions.

Fill the id or name in any case. Fill the clusterName and namespace when in KUBERNETES execution mode.

func (*Client) PauseConnector

func (c *Client) PauseConnector(clusterName, name string) error

PauseConnector pauses the connector and its tasks, which stops message processing until the connector is resumed. This call asynchronous and the tasks will not transition to PAUSED state at the same time.

func (*Client) PolicyAsRequest

func (c *Client) PolicyAsRequest(p DataPolicy) DataPolicyRequest

PolicyAsRequest returns a data policy as a request

func (*Client) PolicyForPrint

func (c *Client) PolicyForPrint(p DataPolicy) DataPolicyTablePrint

PolicyForPrint returns a policy for table printing

func (*Client) ReadJSON

func (c *Client) ReadJSON(resp *http.Response, valuePtr interface{}) error

ReadJSON is one of the lower-level methods of the client to read the result of a `Client#Do`, it closes the body stream.

See `ReadResponseBody` lower-level of method to read a response for more details.

func (*Client) ReadResponseBody

func (c *Client) ReadResponseBody(resp *http.Response) ([]byte, error)

ReadResponseBody is the lower-level method of client to read the result of a `Client#Do`, it closes the body stream.

See `ReadJSON` too.

func (*Client) RemoveSchema

func (c *Client) RemoveSchema(name string) (err error)

RemoveSchema removes the schema and all its versions

func (*Client) RemoveSchemaVersion

func (c *Client) RemoveSchemaVersion(name string, version string) (err error)

RemoveSchemaVersion removes a particular schema version

func (*Client) RestartConnector

func (c *Client) RestartConnector(clusterName, name string) error

RestartConnector restarts the connector and its tasks. It returns a 409 (Conflict) status code error if rebalance is in process.

func (*Client) RestartConnectorTask

func (c *Client) RestartConnectorTask(clusterName, name string, taskID int) error

RestartConnectorTask restarts an individual task.

func (*Client) ResumeConnector

func (c *Client) ResumeConnector(clusterName, name string) error

ResumeConnector resumes a paused connector or do nothing if the connector is not paused. This call asynchronous and the tasks will not transition to RUNNING state at the same time.

func (*Client) ResumeProcessor

func (c *Client) ResumeProcessor(processorID string) error

ResumeProcessor resumes a processor. See `LookupProcessorIdentifier`.

func (*Client) RevokeServiceAccountToken

func (c *Client) RevokeServiceAccountToken(name string, newToken string) (token CreateSvcAccPayload, err error)

RevokeServiceAccountToken returns the service account token for the provided name

func (*Client) SetAlertSettingsConsumerCondition

func (c *Client) SetAlertSettingsConsumerCondition(alertID string, conditionID string, consumerAlert ConsumerAlertConditionRequestv1) error

SetAlertSettingsConsumerCondition handles both POST to `/api/v1/alert/settings/{alert_setting_id}/conditions` and PUT to `/api/v1/alert/settings/{alert_setting_id}/conditions/{condition_id}` that handles Consumer type of alert category payloads

func (*Client) SetAlertSettingsProducerCondition

func (c *Client) SetAlertSettingsProducerCondition(alertID, conditionID, topic string, threshold Threshold, duration string, channels []string) error

SetAlertSettingsProducerCondition handles both POST to `/api/v1/alert/settings/{alert_setting_id}/conditions` and PUT to `/api/v1/alert/settings/{alert_setting_id}/conditions/{condition_id}` that handles Producer type of alert category payloads

func (*Client) SetGlobalCompatibility

func (c *Client) SetGlobalCompatibility(request SetGlobalCompatibilityReq) (err error)

SetGlobalCompatibility set the default compatibility of the schema registry

func (*Client) SetSchemaCompatibility

func (c *Client) SetSchemaCompatibility(name string, request SetSchemaCompatibilityReq) (err error)

SetSchemaCompatibility set the compatibility of a schema

func (*Client) StopProcessor

func (c *Client) StopProcessor(processorID string) error

StopProcessor stops a running processor. See `LookupProcessorIdentifier`.

func (*Client) TestConnection

func (c *Client) TestConnection(reqBody TestConnectionAPIRequest) (err error)

Validates the connection. Tags: Connections.

func (*Client) TestConnectionV2 added in v5.1.0

func (c *Client) TestConnectionV2(reqBody TestConnectionAPIRequestV2) (err error)

Validates the connection. Tags: Connections.

func (*Client) TestKafkaConnectConnection

func (c *Client) TestKafkaConnectConnection(reqBody KafkaConnectConnectionTestRequest) (err error)

Validates the connection. Tags: KafkaConnectConnections.

func (*Client) TestKafkaConnection

func (c *Client) TestKafkaConnection(reqBody KafkaConnectionTestRequest) (err error)

Validates the connection. Tags: KafkaConnections.

func (*Client) TestKerberosConnection

func (c *Client) TestKerberosConnection(reqBody KerberosConnectionTestRequest) (err error)

Validates the connection. Tags: KerberosConnections.

func (*Client) TestSchemaRegistryConnection

func (c *Client) TestSchemaRegistryConnection(reqBody SchemaRegistryConnectionTestRequest) (err error)

Validates the connection. Tags: SchemaRegistryConnections.

func (*Client) TestZookeeperConnection

func (c *Client) TestZookeeperConnection(reqBody ZookeeperConnectionTestRequest) (err error)

Validates the connection. Tags: ZookeeperConnections.

func (*Client) UpdateAlertSettings

func (c *Client) UpdateAlertSettings(alertSettings AlertSettingsPayload) error

UpdateAlertSettings corresponds to `/api/v1/alerts/settings/{alert_setting_id}`

func (*Client) UpdateChannel

func (c *Client) UpdateChannel(chnl ChannelPayload, channelPath, channelID string) error

UpdateChannel handles...take a guess

func (*Client) UpdateConnection

func (c *Client) UpdateConnection(connectionName string, newName string, configString string, configArray []ConnectionConfig, tags []string) (err error)

UpdateConnection updates a Lenses connection

func (*Client) UpdateConnectionV1 added in v5.1.0

func (c *Client) UpdateConnectionV1(name string, reqBody UpsertConnectionAPIRequest) (resp AddConnectionResponse, err error)

Updates the connection details. Parameters: - name: The name of the connection. Tags: Connections.

func (*Client) UpdateConnectionV2 added in v5.1.0

func (c *Client) UpdateConnectionV2(name string, reqBody UpsertConnectionAPIRequestV2) (resp AddConnectionResponse, err error)

Updates the connection details. Parameters: - name: The name of the connection. Tags: Connections.

func (*Client) UpdateConnector

func (c *Client) UpdateConnector(clusterName, name string, config ConnectorConfig) (connector Connector, err error)

UpdateConnector sets the configuration of an existing connector.

It returns information about the connector after the change has been made and an indicator if that connector was created or just configuration update.

func (*Client) UpdateDatasetDescription

func (c *Client) UpdateDatasetDescription(connection, name, description string) (err error)

UpdateDatasetDescription validates that the supplied parameters are not empty note: we intenionally allow here description to be empty as that is needed in order to remove it

func (*Client) UpdateDatasetTags

func (c *Client) UpdateDatasetTags(connection, name string, tags []string) (err error)

UpdateDatasetTags sets the dataset tags from the supplied list

func (*Client) UpdateDynamicBrokerConfigs

func (c *Client) UpdateDynamicBrokerConfigs(brokerID int, toAddOrUpdate BrokerConfig) error

UpdateDynamicBrokerConfigs adds or updates broker configuration dynamically.

func (*Client) UpdateDynamicClusterConfigs

func (c *Client) UpdateDynamicClusterConfigs(toAddOrUpdate BrokerConfig) error

UpdateDynamicClusterConfigs adds or updates cluster configuration dynamically.

func (*Client) UpdateGroup

func (c *Client) UpdateGroup(group *Group) error

UpdateGroup updates a group

func (*Client) UpdateKafkaConnectConnection

func (c *Client) UpdateKafkaConnectConnection(name string, reqBody KafkaConnectConnectionUpsertRequest) (resp AddConnectionResponse, err error)

Updates the connection details. Parameters: - name: The name of the connection. Tags: KafkaConnectConnections.

func (*Client) UpdateKafkaConnection

func (c *Client) UpdateKafkaConnection(name string, reqBody KafkaConnectionUpsertRequest) (resp AddConnectionResponse, err error)

Updates the connection details. Parameters: - name: The name of the connection. Tags: KafkaConnections.

func (*Client) UpdateKerberosConnection

func (c *Client) UpdateKerberosConnection(name string, reqBody KerberosConnectionUpsertRequest) (resp AddConnectionResponse, err error)

Updates the connection details. Parameters: - name: The name of the connection. Tags: KerberosConnections.

func (*Client) UpdateLicense

func (c *Client) UpdateLicense(license License) error

UpdateLicense handles the `PUT` API call to update a license at runtime

func (*Client) UpdateMultipleTopicsOffset

func (c *Client) UpdateMultipleTopicsOffset(groupID, offsetType, target string, topics []string) error

UpdateMultipleTopicsOffset handles the Lenses API call to update all partitions of multiple topics of a consumer group.

func (*Client) UpdatePolicy

func (c *Client) UpdatePolicy(policy DataPolicyUpdateRequest) error

UpdatePolicy updates a policy

func (*Client) UpdateProcessorRunners

func (c *Client) UpdateProcessorRunners(processorID string, numberOfRunners int) error

UpdateProcessorRunners scales a processor to "numberOfRunners". See `LookupProcessorIdentifier`.

func (*Client) UpdateSchemaRegistryConnection

func (c *Client) UpdateSchemaRegistryConnection(name string, reqBody SchemaRegistryConnectionUpsertRequest) (resp AddConnectionResponse, err error)

Updates the connection details. Parameters: - name: The name of the connection. Tags: SchemaRegistryConnections.

func (*Client) UpdateServiceAccount

func (c *Client) UpdateServiceAccount(serviceAccount *ServiceAccount) error

UpdateServiceAccount updates a service account

func (*Client) UpdateSingleTopicOffset

func (c *Client) UpdateSingleTopicOffset(groupID, topic, partitionID, offsetType string, offset int) error

UpdateSingleTopicOffset handles the API call to update a signle partition of a topic.

func (*Client) UpdateTopicConfig

func (c *Client) UpdateTopicConfig(topicName string, configsSlice []KV) error

UpdateTopicConfig updates a topic's configuration. topicName, string. configsSlice, array of topic config key-values.

Read more at: https://docs.lenses.io/dev/lenses-apis/rest-api/index.html#update-topic-configuration

func (*Client) UpdateTopicPartitions

func (c *Client) UpdateTopicPartitions(topicName string, partitions int) error

UpdateTopicPartitions updates a topics partition number

func (*Client) UpdateTopicSettings

func (c *Client) UpdateTopicSettings(settings TopicSettingsRequest) error

UpdateTopicSettings from the API

func (*Client) UpdateUser

func (c *Client) UpdateUser(user *UserMember) error

UpdateUser updates a user

func (*Client) UpdateUserPassword

func (c *Client) UpdateUserPassword(username, password string) error

UpdateUserPassword updaes the password of a user

func (*Client) UpdateZookeeperConnection

func (c *Client) UpdateZookeeperConnection(name string, reqBody ZookeeperConnectionUpsertRequest) (resp AddConnectionResponse, err error)

Updates the connection details. Parameters: - name: The name of the connection. Tags: ZookeeperConnections.

func (*Client) UploadFile

func (c *Client) UploadFile(fileName string) (uuid.UUID, error)

func (*Client) UploadFileFromReader

func (c *Client) UploadFileFromReader(fileName string, r io.Reader) (uuid.UUID, error)

func (*Client) ValidateLSQL

func (c *Client) ValidateLSQL(sql string) (v LSQLValidation, err error)

ValidateLSQL validates but not executes a specific LSQL.

func (*Client) ValidateSQL

func (c *Client) ValidateSQL(sql string, caret int) (SQLValidationResponse, error)

ValidateSQL valids a Lenses sql statement

func (*Client) WriteSchema

func (c *Client) WriteSchema(name string, request WriteSchemaReq) (err error)

WriteSchema creates a schema if it doens't exist, updates it otherwise

type ClientConfig

type ClientConfig struct {
	// Host is the network shema  address and port that your lenses backend box is listening on.
	Host string `json:"host" yaml:"Host" survey:"host"`

	// Authentication, in order to gain access using different kind of options.
	//
	// See `BasicAuthentication` and `KerberosAuthentication` or the example for more.
	Authentication Authentication `json:"-" yaml:"-" survey:"-"`

	// Token is the "X-Kafka-Lenses-Token" request header's value.
	// If not empty, overrides any `Authentication` settings.
	//
	// If `Token` is expired then all the calls will result on 403 forbidden error HTTP code
	// and a manual renewal will be demanded.
	//
	// For general-purpose usecase the recommendation is to let this field empty and
	// fill the `Authentication` field instead.
	Token string `json:"token,omitempty" yaml:"Token,omitempty" survey:"-"`

	// Timeout specifies the timeout for connection establishment.
	//
	// Empty timeout value means no timeout.
	//
	// Such as "300ms", "-1.5h" or "2h45m".
	// Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
	// Example: "5s" for 5 seconds, "5m" for 5 minutes and so on.
	Timeout string `json:"timeout,omitempty" yaml:"Timeout,omitempty" survey:"timeout"`

	// Insecure tells the client to connect even if the cert is invalid.
	// Turn that to true if you get errors about invalid certifications for the specific host domain.
	//
	// Defaults to false.
	Insecure bool `json:"insecure,omitempty" yaml:"Insecure,omitempty" survey:"insecure"`
	// Debug activates the debug mode, it logs every request, the configuration (except the `Password`)
	// and its raw response before decoded but after gzip reading.
	//
	// If this is enabled then printer's contents are not predicted to the end-user.
	// The output source is always the `os.Stdout` which 99.9% of the times means the terminal,
	// so use it only for debugging.
	//
	//
	// Defaults to false.
	Debug bool `json:"debug,omitempty" yaml:"Debug,omitempty" survey:"debug"`
}

ClientConfig contains the necessary information to a client to connect to the lenses backend box.

func (*ClientConfig) Fill

func (c *ClientConfig) Fill(other ClientConfig) bool

Fill iterates over the "other" ClientConfig's fields it checks if a field is not empty, if it's then it sets the value to the "c" ClientConfig's particular field.

It returns true if the final configuration is valid by calling the `IsValid`.

func (*ClientConfig) FormatHost

func (c *ClientConfig) FormatHost()

FormatHost will try to make sure that the schema:host:port pattern is followed on the `Host` field.

func (*ClientConfig) IsBasicAuth

func (c *ClientConfig) IsBasicAuth() (BasicAuthentication, bool)

IsBasicAuth reports whether the authentication is basic.

func (*ClientConfig) IsKerberosAuth

func (c *ClientConfig) IsKerberosAuth() (KerberosAuthentication, bool)

IsKerberosAuth reports whether the authentication is kerberos-based.

func (*ClientConfig) IsValid

func (c *ClientConfig) IsValid() bool

IsValid returns true if the configuration contains the necessary fields, otherwise false.

type CompressionType

type CompressionType string

CompressionType is the go type to safety describe and set the topic config's and broker's config `CompressionType` field. The available compression types are: `Uncompressed`, `Snappy`, `LZ4`, `Gzip` and `Producer`.

const (
	Uncompressed CompressionType = "uncompressed"
	Snappy       CompressionType = "snappy"
	LZ4          CompressionType = "lz4"
	Gzip         CompressionType = "gzip"
	Producer     CompressionType = "producer"
)

The available compression types for topics configs and broker's config.

type Config

type Config struct {
	CurrentContext string
	Contexts       map[string]*ClientConfig
}

Config contains the necessary information that `OpenConnection` needs to create a new client which connects and talks to the lenses backend box.

Optionally, the `Contexts` map of string and client configuration values can be filled to map different environments. Use of `WithContext` `ConnectionOption` to select a specific `ClientConfig`, otherwise the first one is selected, this will also amend the `CurrentContext` via the top-level `OpenConnection` function.

Config can be loaded via JSON or YAML.

func (*Config) AddContext

func (c *Config) AddContext(name string, context *ClientConfig)

AddContext adds a context to the config Returns true if context is added

func (*Config) Clone

func (c *Config) Clone() Config

Clone will returns a deep clone of the this `Config`.

func (*Config) ContextExists

func (c *Config) ContextExists(name string) bool

ContextExists just checks if the `context` exists in the `Contexts` map.

func (*Config) CurrentContextExists

func (c *Config) CurrentContextExists() bool

CurrentContextExists just checks if the `CurrentContext` exists in the `Contexts` map.

func (*Config) FillCurrent

func (c *Config) FillCurrent(cfg ClientConfig)

FillCurrent fills the specific client configuration based on the `CurrentContext` if it's valid.

func (*Config) GetCurrent

func (c *Config) GetCurrent() *ClientConfig

GetCurrent returns the specific current client configuration based on the `CurrentContext`.

func (*Config) IsValid

func (c *Config) IsValid() bool

IsValid returns the result of the contexts' ClientConfig#IsValid.

func (*Config) RemoveContext

func (c *Config) RemoveContext(contextName string) bool

RemoveContext deletes a context based on its name/key. It will change if there is an available context to set as current, if can't find then the operation stops. Returns true if found and removed and can change to something valid, otherwise false.

func (*Config) RemoveTokens

func (c *Config) RemoveTokens()

RemoveTokens removes the `Token` from all client configurations.

func (*Config) SetCurrent

func (c *Config) SetCurrent(currentContextName string)

SetCurrent overrides the `CurrentContext`, just this.

type ConfigurationObjectAWS added in v5.1.0

type ConfigurationObjectAWS struct {
	AccessKeyId     string  `json:"accessKeyId"`            // Required. Access key ID of an AWS IAM account.
	SecretAccessKey string  `json:"secretAccessKey"`        // Required. Secret access key of an AWS IAM account.
	Region          *string `json:"region,omitempty"`       // Optional. AWS region to connect to. If not provided, this is deferred to client configuration.
	SessionToken    *string `json:"sessionToken,omitempty"` // Optional. Specifies the session token value that is required if you are using temporary security credentials that you retrieved directly from AWS STS operations.
}

type ConfigurationObjectDataDog

type ConfigurationObjectDataDog struct {
	APIKey         string                         `json:"apiKey"`                   // Required. The Datadog API key.
	Site           ConfigurationObjectDataDogSite `json:"site"`                     // Required. The Datadog site.
	ApplicationKey *string                        `json:"applicationKey,omitempty"` // Optional. The Datadog application key.
}

type ConfigurationObjectDataDogSite

type ConfigurationObjectDataDogSite string
const (
	ConfigurationObjectDataDogSiteEU ConfigurationObjectDataDogSite = "EU"
	ConfigurationObjectDataDogSiteUS ConfigurationObjectDataDogSite = "US"
)

type ConfigurationObjectElasticsearch

type ConfigurationObjectElasticsearch struct {
	Nodes    []string `json:"nodes"`              // Required. The nodes of the Elasticsearch cluster to connect to, e.g. https://hostname:port. Use the tab key to specify multiple nodes.
	Password *string  `json:"password,omitempty"` // Optional. The password to connect to the Elasticsearch service.
	User     *string  `json:"user,omitempty"`     // Optional. The username to connect to the Elasticsearch service.
}

type ConfigurationObjectPagerDuty

type ConfigurationObjectPagerDuty struct {
	IntegrationKey string `json:"integrationKey"` // Required. An Integration Key for PagerDuty's service with Events API v2 integration type.
}

type ConfigurationObjectPostgreSQL

type ConfigurationObjectPostgreSQL struct {
	Database string                               `json:"database"`           // Required. The database to connect to.
	Host     string                               `json:"host"`               // Required. The Postgres hostname.
	Port     int                                  `json:"port"`               // Required. The port number.
	SslMode  ConfigurationObjectPostgreSQLSslMode `json:"sslMode"`            // Required. The SSL connection mode as detailed in https://jdbc.postgresql.org/documentation/head/ssl-client.html.
	Username string                               `json:"username"`           // Required. The user name.
	Password *string                              `json:"password,omitempty"` // Optional. The password.
}

type ConfigurationObjectPostgreSQLSslMode

type ConfigurationObjectPostgreSQLSslMode string
const (
	ConfigurationObjectPostgreSQLSslModeAllow      ConfigurationObjectPostgreSQLSslMode = "allow"
	ConfigurationObjectPostgreSQLSslModeDisable    ConfigurationObjectPostgreSQLSslMode = "disable"
	ConfigurationObjectPostgreSQLSslModePrefer     ConfigurationObjectPostgreSQLSslMode = "prefer"
	ConfigurationObjectPostgreSQLSslModeRequire    ConfigurationObjectPostgreSQLSslMode = "require"
	ConfigurationObjectPostgreSQLSslModeVerifyCa   ConfigurationObjectPostgreSQLSslMode = "verify-ca"
	ConfigurationObjectPostgreSQLSslModeVerifyFull ConfigurationObjectPostgreSQLSslMode = "verify-full"
)

type ConfigurationObjectPrometheusAlertmanager

type ConfigurationObjectPrometheusAlertmanager struct {
	Endpoints []string `json:"endpoints"` // Required. Comma separated list of Alert Manager endpoints.
}

type ConfigurationObjectSlack

type ConfigurationObjectSlack struct {
	WebhookURL string `json:"webhookUrl"` // Required. The Slack endpoint to send the alert to.
}

type ConfigurationObjectSplunk

type ConfigurationObjectSplunk struct {
	Host     string `json:"host"`           // Required. The host name for the HTTP Event Collector API of the Splunk instance.
	Insecure bool   `json:"insecure"`       // Required. This is not encouraged but is required for a Splunk Cloud Trial instance.
	Token    string `json:"token"`          // Required. HTTP event collector authorization token.
	UseHTTPs bool   `json:"useHttps"`       // Required. Use SSL.
	Port     *int   `json:"port,omitempty"` // Optional. The port number for the HTTP Event Collector API of the Splunk instance.
}

type ConfigurationObjectWebhook

type ConfigurationObjectWebhook struct {
	Host     string   `json:"host"`            // Required. The host name.
	UseHTTPs bool     `json:"useHttps"`        // Required. Set to true in order to set the URL scheme to `https`. Will otherwise default to `http`.
	Creds    []string `json:"creds,omitempty"` // Optional. An array of (secret) strings to be passed over to alert channel plugins.
	Port     *int     `json:"port,omitempty"`  // Optional. An optional port number to be appended to the the hostname.
}

type ConnectCluster

type ConnectCluster struct {
	Name     string `json:"name" header:"Name"`
	URL      string `json:"url"` //header:"URL"`
	Statuses string `json:"statuses" header:"Status"`
	Config   string `json:"config" header:"Config"`
	Offsets  string `json:"offsets" header:"Offsets,count"`
}

ConnectCluster contains the connect cluster information that is returned by the `GetConnectClusters` call.

type Connection

type Connection struct {
	Name            string             `json:"name" yaml:"name" header:"Name,text"`
	TemplateName    string             `json:"templateName" yaml:"templateName" header:"Template Name,text"`
	TemplateVersion int                `json:"templateVersion" yaml:"templateVersion" header:"Template Version,int"`
	BuiltIn         bool               `json:"builtIn" yaml:"builtIn" header:"BuiltIn,text"`
	ReadOnly        bool               `json:"readOnly" yaml:"readOnly" header:"Read only"`
	Configuration   []ConnectionConfig `json:"configuration" yaml:"configuration"`
	CreatedBy       string             `json:"createdBy" yaml:"createdBy" header:"Created By,text"`
	CreatedAt       int64              `json:"createdAt" yaml:"createdAt" header:"Created At,text"`
	ModifiedBy      string             `json:"modifiedBy" yaml:"modifiedBy" header:"Modified By,text"`
	ModifiedAt      int64              `json:"modifiedAt" yaml:"modifiedAt" header:"Modified At,text"`
	Tags            []string           `json:"tags" yaml:"tags" header:"Tags,text"`
}

Connection type

type ConnectionApp

type ConnectionApp struct {
	Name   string `json:"name" yaml:"name" header:"Name,text"`
	Status string `json:"status" yaml:"status" header:"Status,text"`
}

ConnectionApp type

type ConnectionConfig

type ConnectionConfig struct {
	Key   string      `json:"key" yaml:"key"`
	Value interface{} `json:"value" yaml:"value"`
}

ConnectionConfig type

type ConnectionEntity

type ConnectionEntity struct {
	ConnectionName     string               `json:"connectionName" yaml:"connectionName"`
	ConnectionType     string               `json:"connectionType" yaml:"connectionType"`
	DatasetsWithFields []DatasetsWithFields `json:"datasetsWithFields" yaml:"datasetsWithFields"`
	Entities           []string             `json:"entities" yaml:"entities"`
}

ConnectionEntity holds the connections with their entities

type ConnectionJsonResponse

type ConnectionJsonResponse struct {
	BuiltIn             bool                             `json:"builtIn"`                 // Required.
	ConfigurationObject map[string]interface{}           `json:"configurationObject"`     // Required. The configuration of the connection. The schema of this object is defined by the [template configuration](#operation/listConnectionTemplates).
	CreatedAt           int                              `json:"createdAt"`               // Required.
	CreatedBy           string                           `json:"createdBy"`               // Required.
	Deletable           bool                             `json:"deletable"`               // Required.
	ModifiedAt          int                              `json:"modifiedAt"`              // Required.
	ModifiedBy          string                           `json:"modifiedBy"`              // Required.
	Name                string                           `json:"name"`                    // Required. Name of the connection.
	TemplateName        string                           `json:"templateName"`            // Required. The [template](#operation/listConnectionTemplates) of the connection.
	TemplateVersion     int                              `json:"templateVersion"`         // Required.
	Configuration       []ConnectionPropertyJsonResponse `json:"configuration,omitempty"` // Deprecated. Optional.
	Tags                []string                         `json:"tags,omitempty"`          // Optional.
}

type ConnectionList

type ConnectionList struct {
	Name            string   `json:"name" yaml:"name" header:"Name,text"`
	TemplateName    string   `json:"templateName" yaml:"templateName" header:"Template Name,text"`
	TemplateVersion int      `json:"templateVersion" yaml:"templateVersion" header:"Template Version,int"`
	Tags            []string `json:"tags" yaml:"tags" header:"Tags,text"`
	ReadOnly        bool     `json:"readOnly" yaml:"readOnly" header:"Read only"`
}

ConnectionList type

type ConnectionOption

type ConnectionOption func(*Client)

ConnectionOption describes an optional runtime configurator that can be passed on `OpenConnection`. Custom `ConnectionOption` can be used as well, it's just a type of `func(*lenses.Client)`.

Look `UsingClient` and `UsingToken` for use-cases.

func UsingClient

func UsingClient(httpClient *http.Client) ConnectionOption

UsingClient modifies the underline HTTP Client that lenses is using for contact with the backend server.

func UsingToken

func UsingToken(tok string) ConnectionOption

UsingToken can specify a custom token that can by-pass the "user" and "password". It may be useful for testing purposes.

func WithContext

func WithContext(contextName string) ConnectionOption

WithContext sets the current context, the environment to load configuration from.

See the `Config` structure and the `OpenConnection` function for more.

type ConnectionProperty

type ConnectionProperty struct {
	DisplayName string                 `json:"displayName"`           // Required.
	Key         string                 `json:"key"`                   // Required. The key of the property.
	Mounted     bool                   `json:"mounted"`               // Required. Denotes a file property which expects an [uploaded file reference](#operation/uploadFile) as its value.
	Provided    bool                   `json:"provided"`              // Required.
	Required    bool                   `json:"required"`              // Required.
	Type        ConnectionPropertyType `json:"type"`                  // Required.
	Description *string                `json:"description,omitempty"` // Optional.
	EnumValues  []string               `json:"enumValues,omitempty"`  // Optional. For enum properties, the set of valid values.
	Placeholder *string                `json:"placeholder,omitempty"` // Optional.
}

type ConnectionPropertyJsonResponse

type ConnectionPropertyJsonResponse struct {
	Key     string      `json:"key"`     // Required.
	Mounted bool        `json:"mounted"` // Required.
	Type    KeyDataType `json:"type"`    // Required. The data type of the property.
	Value   any         `json:"value"`   // Required.
}

type ConnectionPropertyType

type ConnectionPropertyType struct {
	DisplayName string      `json:"displayName"` // Required.
	Name        KeyDataType `json:"name"`        // Required. The data type of the property.
}

type ConnectionSummaryResponse

type ConnectionSummaryResponse struct {
	Deletable       bool     `json:"deletable"`       // Required. Can the connection be deleted.
	Name            string   `json:"name"`            // Required. Name of the connection.
	TemplateName    string   `json:"templateName"`    // Required. The [template](#operation/listConnectionTemplates) of the connection.
	TemplateVersion int      `json:"templateVersion"` // Required.
	Tags            []string `json:"tags,omitempty"`  // Optional.
}

type ConnectionTemplate

type ConnectionTemplate struct {
	Name            string                     `json:"name,omitempty" yaml:"name" header:"Name,text"`
	TemplateVersion int                        `json:"templateVersion,omitempty" yaml:"templateVersion" header:"Template Version"`
	Version         string                     `json:"version,omitempty" yaml:"version" header:"Version,text"`
	BuiltIn         bool                       `json:"builtIn,omitempty" yaml:"buildIn" header:"BuiltIn,text"`
	Enabled         bool                       `json:"enabled,omitempty" yaml:"enabled" header:"Enabled,text"`
	Category        string                     `json:"category,omitempty" yaml:"category"`
	Type            string                     `json:"type,omitempty" yaml:"type"`
	Metadata        ConnectionTemplateMetadata `json:"metadata,omitempty" yaml:"metadata"`
	Config          []ConnectionTemplateConfig `json:"configuration,omitempty" yaml:"configuration"`
}

ConnectionTemplate type

type ConnectionTemplateConfig

type ConnectionTemplateConfig struct {
	Key         string                       `json:"key" yaml:"key" header:"key,text"`
	DisplayName string                       `json:"displayName" yaml:"displayName" header:"Display Name,text"`
	Placeholder string                       `json:"placeholder" yaml:"placeholder" header:"Placeholder,text"`
	Description string                       `json:"description" yaml:"description" header:"Description,text"`
	Required    bool                         `json:"required" yaml:"required" header:"Required,text"`
	Mounted     bool                         `json:"mounted" yaml:"mounted" header:"Mounted,text"`
	Type        ConnectionTemplateConfigType `json:"type" yaml:"type" header:"Type,text"`
}

ConnectionTemplateConfig type

type ConnectionTemplateConfigType

type ConnectionTemplateConfigType struct {
	Name        string `json:"name" yaml:"name" header:"Name,text"`
	DisplayName string `json:"displayName" yaml:"DisplayName" header:"Display Name,text"`
}

ConnectionTemplateConfigType type

type ConnectionTemplateMetadata

type ConnectionTemplateMetadata struct {
	Author      string `json:"author" yaml:"author" header:"Author,text"`
	Description string `json:"description" yaml:"description" header:"Description,text"`
	DocURL      string `json:"docUrl" yaml:"docUrl" header:"Doc Url,text"`
	GitRepo     string `json:"gitRepo" yaml:"gitRepo" header:"Git Repo,text"`
	GitCommit   string `json:"gitCommit" yaml:"gitCommit" header:"Git Commit,text"`
	Image       string `json:"image" yaml:"image" header:"Image,text"`
	ImageTag    string `json:"imageTag" yaml:"imageTag" header:"Image Tag,text"`
}

ConnectionTemplateMetadata type

type ConnectionTemplateMetadata2

type ConnectionTemplateMetadata2 struct {
	Author      string  `json:"author"`                // Required.
	Description *string `json:"description,omitempty"` // Optional.
}

type ConnectionTemplateResponse

type ConnectionTemplateResponse struct {
	BuiltIn         bool                        `json:"builtIn"`                 // Required.
	Category        TemplateCategory            `json:"category"`                // Required.
	Creatable       bool                        `json:"creatable"`               // Required.
	Enabled         bool                        `json:"enabled"`                 // Required.
	JsonSchema      JsonObject                  `json:"jsonSchema"`              // Required. JSON Schema representation of the configuration properties.
	Metadata        ConnectionTemplateMetadata2 `json:"metadata"`                // Required.
	Name            string                      `json:"name"`                    // Required. The name of the template.
	TemplateVersion int                         `json:"templateVersion"`         // Required.
	Type            TemplateType                `json:"type"`                    // Required.
	Version         string                      `json:"version"`                 // Required.
	Configuration   []ConnectionProperty        `json:"configuration,omitempty"` // Optional. Array of objects describing the schema of each configuration property for connections of this type.
}

type Connector

type Connector struct {
	// Name of the created (or received) connector.
	ClusterName string `json:"clusterName,omitempty" header:"Cluster"` // internal use only, not set by response.
	Name        string `json:"name" header:"Name"`

	// Config parameters for the connector
	Config ConnectorConfig `json:"config,omitempty" header:"Configs,count"`
	// Tasks is the list of active tasks generated by the connector.
	Tasks []ConnectorTaskReadOnly `json:"tasks,omitempty" header:"Tasks,count"`
}

Connector contains the connector's information, both send and receive.

func (*Connector) ConnectorAsRequest

func (connector *Connector) ConnectorAsRequest() CreateUpdateConnectorPayload

ConnectorAsRequest returns a connector as a request

type ConnectorConfig

type ConnectorConfig map[string]interface{}

ConnectorConfig the configuration parameters for the connector.

For both send and receive:

type ConnectorInfoUI

type ConnectorInfoUI struct {
	Class       string `json:"class"` // header:"Class"`
	Name        string `json:"name" header:"Name"`
	Type        string `json:"type" header:"Type"`
	Version     string `json:"version" header:"Version"`
	Author      string `json:"author,omitempty" header:"Author"`
	Description string `json:"description,omitempty" header:"Desc"`
	Docs        string `json:"docs,omitempty"` // header:"Docs"`
	UIEnabled   bool   `json:"uiEnabled" header:"UI Enabled"`
}

ConnectorInfoUI describes a supported Kafka Connector, result type of the `GetSupportedConnectors` call.

type ConnectorPlugin

type ConnectorPlugin struct {
	// Class is the connector class name.
	Class string `json:"class" header:"Class"`

	Type string `json:"type" header:"Type"`

	Version string `json:"version" header:"Version"`
}

ConnectorPlugin describes the entry data of the list that are being received from the `GetConnectorPlugins`.

type ConnectorState

type ConnectorState string

ConnectorState indicates the connector status task's state and connector's state.

const (
	// UNASSIGNED state indicates that the connector/task has not yet been assigned to a worker.
	UNASSIGNED ConnectorState = "UNASSIGNED"
	// RUNNING state indicates that the connector/task is running.
	RUNNING ConnectorState = "RUNNING"
	// PAUSED state indicates that the connector/task has been administratively paused.
	PAUSED ConnectorState = "PAUSED"
	// FAILED state indicates that the connector/task has failed
	// (usually by raising an exception, which is reported in the status output).
	FAILED ConnectorState = "FAILED"
)

type ConnectorStatus

type ConnectorStatus struct {
	// Name is the name of the connector.
	Name      string                        `json:"name" header:"Name"`
	Connector ConnectorStatusConnectorField `json:"connector" header:"inline"`
	Tasks     []ConnectorStatusTask         `json:"tasks,omitempty" header:"Tasks,count"`
}

ConnectorStatus describes the data that are being received from the `GetConnectorStatus`.

type ConnectorStatusConnectorField

type ConnectorStatusConnectorField struct {
	State    string `json:"state" header:"State"`      // i.e RUNNING
	WorkerID string `json:"worker_id" header:"Worker"` // i.e fakehost:8083
}

ConnectorStatusConnectorField describes a connector's status, see `ConnectorStatus`.

type ConnectorStatusTask

type ConnectorStatusTask struct {
	ID       int    `json:"id" header:"ID,text"`                  // i.e 1
	State    string `json:"state" header:"State"`                 // i.e FAILED
	WorkerID string `json:"worker_id" header:"Worker"`            // i.e fakehost:8083
	Trace    string `json:"trace,omitempty" header:"Trace,empty"` // i.e org.apache.kafka.common.errors.RecordTooLargeException\n
}

ConnectorStatusTask describes a connector task's status, see `ConnectorStatus`.

type ConnectorTaskReadOnly

type ConnectorTaskReadOnly struct {
	// Connector is the name of the connector the task belongs to.
	Connector string `json:"connector"`
	// Task is the Task ID within the connector.
	Task int `json:"task"`
}

ConnectorTaskReadOnly is the type that returned as "tasks" from the connector, it's for read-only access, it contains the basic information about the connector's task. It usually returned as a slice of ConnectorTaskReadOnly.

See `Connector` type for more.

type Consumer

type Consumer struct {
	Topic                     string `json:"topic"`
	CurrentOffset             int64  `json:"currentOffset"`
	LogEndOffset              int64  `json:"longEndOffset"`
	Lag                       int64  `json:"lag"`
	ConsumerID                string `json:"consumerId"`
	Host                      string `json:"host"`
	ClientID                  string `json:"clientId"`
	MessagesPerSecond         int64  `json:"messagesPerSecond"`
	ProducerMessagesPerSecond int64  `json:"producerMessagesPerSecond"`
}

Consumer describes the consumer valid response data.

type ConsumerAlertConditionRequestv1

type ConsumerAlertConditionRequestv1 struct {
	Condition ConsumerConditionDsl `json:"condition" yaml:"condition"`
	Channels  []string             `json:"channels" yaml:"channels"`
}

ConsumerAlertConditionRequestv1 represents the schema of /api/v1/alert/settings/{alert_setting_id}/conditions payload for consumer

type ConsumerAlertSettings

type ConsumerAlertSettings struct {
	ID               int                               `json:"alert" yaml:"alert"`
	Description      string                            `json:"description" yaml:"description"`
	ConditionDetails []ConsumerAlertConditionRequestv1 `json:"conditions" yaml:"conditions"`
}

ConsumerAlertSettings is the struct used for importing/exporting consumer alert settings

type ConsumerConditionDsl

type ConsumerConditionDsl struct {
	Group     string                `json:"group"`
	Threshold int                   `json:"threshold"`
	Topic     string                `json:"topic"`
	Mode      ConsumerConditionMode `json:"mode"`
}

ConsumerConditionDsl represents the consumer specific payload expected at /api/v1/alert/settings/{alert_setting_id}/conditions

type ConsumerConditionMode

type ConsumerConditionMode string

ConsumerConditionMode represents the consumer lag alert rule mode

const (
	PerPartitionMode ConsumerConditionMode = "PerPartitionMode"
	PerTopicMode     ConsumerConditionMode = "PerTopicMode"
)

Consumer lag alert rule modes

type ConsumerCoordinator

type ConsumerCoordinator struct {
	ID   int    `json:"id"`
	Host string `json:"host"`
	Port int    `json:"port"`
	Rack string `json:"rack"`
}

ConsumerCoordinator describes the consumer coordinator's valid response data.

type ConsumerGroupState

type ConsumerGroupState string

ConsumerGroupState describes the valid values of a `ConsumerGroupState`: `StateUnknown`,`StateStable`,`StateRebalancing`,`StateDead`,`StateNoActiveMembers`,`StateExistsNot`,`StateCoordinatorNotFound`.

const (
	// StateUnknown is a valid `ConsumerGroupState` value of "Unknown".
	StateUnknown ConsumerGroupState = "Unknown"
	// StateStable is a valid `ConsumerGroupState` value of "Stable".
	StateStable ConsumerGroupState = "Stable"
	// StateRebalancing is a valid `ConsumerGroupState` value of "Rebalancing".
	StateRebalancing ConsumerGroupState = "Rebalancing"
	// StateDead is a valid `ConsumerGroupState` value of "Dead".
	StateDead ConsumerGroupState = "Dead"
	// StateNoActiveMembers is a valid `ConsumerGroupState` value of "NoActiveMembers".
	StateNoActiveMembers ConsumerGroupState = "NoActiveMembers"
	// StateExistsNot is a valid `ConsumerGroupState` value of "ExistsNot".
	StateExistsNot ConsumerGroupState = "ExistsNot"
	// StateCoordinatorNotFound is a valid `ConsumerGroupState` value of "CoordinatorNotFound".
	StateCoordinatorNotFound ConsumerGroupState = "CoordinatorNotFound"
)

type ConsumersGroup

type ConsumersGroup struct {
	ID          string              `json:"id"`
	Coordinator ConsumerCoordinator `json:"coordinator"`
	// On consumers not active/committing offsets - we don't get any of the following info
	Active               bool               `json:"active"`
	State                ConsumerGroupState `json:"state"`
	Consumers            []string           `json:"consumers"`
	ConsumersCount       int                `json:"consumersCount,omitempty"`
	TopicPartitionsCount int                `json:"topicPartitionsCount,omitempty"`
	MinLag               int64              `json:"minLag,omitempty"`
	MaxLag               int64              `json:"maxLag,omitempty"`
}

ConsumersGroup describes the data that the `Topic`'s `ConsumersGroup` field contains.

type CreateConnectionPayload

type CreateConnectionPayload struct {
	Name          string             `json:"name" yaml:"name"`
	TemplateName  string             `json:"templateName" yaml:"templateName"`
	Configuration []ConnectionConfig `json:"configuration" yaml:"configuration"`
	Tags          []string           `json:"tags" yaml:"tags"`
}

CreateConnectionPayload type

type CreateProcessorFilePayload

type CreateProcessorFilePayload struct {
	Name        string `json:"name" yaml:"name"` // required
	SQL         string `json:"sql" yaml:"sql"`   // required
	Runners     int    `json:"runnerCount" yaml:"runnerCount"`
	ClusterName string `json:"cluster,omitempty" yaml:"cluster"`
	Namespace   string `json:"namespace,omitempty" yaml:"namespace"`
	Pipeline    string `json:"pipeline,omitempty" yaml:"pipeline"`       // not required
	ProcessorID string `json:"processorId,omitempty" yaml:"processorId"` // not required
}

CreateProcessorFilePayload holds the data to be sent from `CreateProcessor`.

type CreateProcessorRequestPayload

type CreateProcessorRequestPayload struct {
	Name        string `json:"name" yaml:"name"` // required
	SQL         string `json:"sql" yaml:"sql"`   // required
	Runners     int    `json:"runnerCount" yaml:"runnerCount"`
	ClusterName string `json:"cluster,omitempty" yaml:"cluster"`
	Namespace   string `json:"namespace,omitempty" yaml:"namespace"`
	Pipeline    string `json:"pipeline,omitempty" yaml:"pipeline"` // not required
	AppID       string `json:"appId,omitempty" yaml:"appId"`       // not required
}

CreateProcessorRequestPayload holds the data to be sent from `CreateProcessor`.

type CreateQuotaPayload

type CreateQuotaPayload struct {
	QuotaType string      `yaml:"type" json:"type"`
	Config    QuotaConfig `yaml:"config" json:"config"`
	// for specific user and/or client.
	User string `yaml:"user" json:"user"`
	// if "all" or "*" then means all clients.
	// Minor note On quota clients set/create/update the Config and Client field are used only.
	ClientID string `yaml:"client" json:"client"`
}

CreateQuotaPayload returns a quota as a payload

type CreateSvcAccPayload

type CreateSvcAccPayload struct {
	Token string `json:"token,omitempty"`
}

CreateSvcAccPayload the data transfer object when we create a new service account

type CreateTopicPayload

type CreateTopicPayload struct {
	TopicName   string `json:"topicName" yaml:"name"`
	Replication int    `json:"replication" yaml:"replication"`
	Partitions  int    `json:"partitions" yaml:"partitions"`
	Description string `json:"description" yaml:"description"`
	Configs     KV     `json:"configs" yaml:"configs"`
}

CreateTopicPayload contains the data that the `CreateTopic` accepts, as a single structure.

type CreateUpdateConnectorPayload

type CreateUpdateConnectorPayload struct {
	ClusterName string          `yaml:"clusterName"`
	Name        string          `yaml:"name"`
	Config      ConnectorConfig `yaml:"config"`
}

CreateUpdateConnectorPayload can be used to hold the data for creating or updating a connector.

func (*CreateUpdateConnectorPayload) ApplyAndValidateName

func (c *CreateUpdateConnectorPayload) ApplyAndValidateName() error

ApplyAndValidateName applies some rules to make sure that the connector's data are setup correctly.

type DataImpactType

type DataImpactType struct {
	ImpactType string `json:"type" yaml:"type" header:"Type"`
}

DataImpactType holds the impact type for a policy

type DataObfuscationType

type DataObfuscationType struct {
	RedactionType string `json:"type" yaml:"type" header:"Type"`
}

DataObfuscationType holds the obfuscation type for a policy

type DataPolicy

type DataPolicy struct {
	ID              string    `json:"id" yaml:"id" header:"ID,text"`
	Name            string    `json:"name" yaml:"name" header:"Name,text"`
	LastUpdated     string    `json:"lastUpdated" yaml:"lastUpdated" header:"Last update,text"`
	Versions        int       `json:"versions" yaml:"versions" header:"Version,text"`
	ImpactType      string    `json:"impactType" yaml:"impactType" header:"Impact Type,text"`
	Impact          Impacts   `json:"impact" yaml:"impact" header:"Impact,text"`
	Category        string    `json:"category" yaml:"category" header:"Category,text"`
	Datasets        *[]string `json:"datasets" yaml:"datasets"`
	Fields          []string  `json:"fields" yaml:"fields" header:"Fields,text"`
	Obfuscation     string    `json:"obfuscation" yaml:"obfuscation" header:"Redaction,text"`
	LastUpdatedUser string    `json:"lastUpdatedUser" yaml:"lastUpdatedUser" header:"Updated By,text"`
}

DataPolicy holds a Lenses data policy

type DataPolicyFields

type DataPolicyFields struct {
	Fields map[string][]string `json:"fields" yaml:"fields"`
}

DataPolicyFields holds fields impacted by a Lenses data policy

type DataPolicyRequest

type DataPolicyRequest struct {
	Name            string    `json:"name" yaml:"name" header:"Name,text"`
	LastUpdated     string    `json:"lastUpdated" yaml:"lastUpdated" header:"Last update,text"`
	Versions        int       `json:"versions" yaml:"versions" header:"Version,text"`
	ImpactType      string    `json:"impactType" yaml:"impactType" header:"ImpactType,text"`
	Impacts         Impacts   `json:"impact" yaml:"impact" header:"Impacts,text"`
	Category        string    `json:"category" yaml:"category" header:"Category,text"`
	Datasets        *[]string `json:"datasets" yaml:"datasets" header:"Datasets,text"`
	Fields          []string  `json:"fields" yaml:"fields" header:"Fields,text"`
	Obfuscation     string    `json:"obfuscation" yaml:"obfuscation" header:"Redaction,text"`
	LastUpdatedUser string    `json:"lastUpdatedUser" yaml:"lastUpdatedUser" header:"Updated By,text"`
}

DataPolicyRequest is a Lenses data policy as a request

type DataPolicyTablePrint

type DataPolicyTablePrint struct {
	ID              string           `json:"id" yaml:"id" header:"ID"`
	Name            string           `json:"name" yaml:"name" header:"Name"`
	LastUpdated     string           `json:"lastUpdated" yaml:"lastUpdated" header:"Last update"`
	Versions        int              `json:"versions" yaml:"versions" header:"Version"`
	ImpactType      string           `json:"impactType" yaml:"impactType" header:"Impact Type"`
	Category        string           `json:"category" yaml:"category" header:"Category"`
	Fields          []string         `json:"fields" yaml:"fields" header:"Fields"`
	Obfuscation     string           `json:"obfuscation" yaml:"obfuscation" header:"Redaction"`
	LastUpdatedUser string           `json:"lastUpdatedUser" yaml:"lastUpdatedUser" header:"Updated By"`
	Processors      []ImpactsDetails `json:"processors" yaml:"processors" header:"Processors"`
	Connectors      []ImpactsDetails `json:"connectors,omitempty" yaml:"connectors" header:"Connectors"`
	Apps            []ImpactsDetails `json:"apps" yaml:"apps" header:"Apps"`
}

DataPolicyTablePrint holds a data policy for bit table printing

type DataPolicyUpdateRequest

type DataPolicyUpdateRequest struct {
	ID          string    `json:"id" yaml:"id"`
	Name        string    `json:"name" yaml:"name"`
	Category    string    `json:"category" yaml:"category"`
	ImpactType  string    `json:"impactType" yaml:"impactType"`
	Obfuscation string    `json:"obfuscation" yaml:"obfuscation"`
	Datasets    *[]string `json:"datasets" yaml:"datasets"`
	Fields      []string  `json:"fields" yaml:"fields"`
}

DataPolicyUpdateRequest is a data policy as an update

type DataProduced

type DataProduced struct {
	ConnectionName string    `json:"connectionName" yaml:"connectionName"`
	DatasetName    string    `json:"datasetName" yaml:"datasetName"`
	Threshold      Threshold `json:"threshold" yaml:"threshold"`
	Duration       string    `json:"duration" yaml:"duration"`
}

DataProduced is the payload for Producer's alert type category

type DatasetField

type DatasetField string

DatasetField is part of the dataset api query params.

const (
	DatasetFieldName             DatasetField = "name"
	DatasetFieldRecords          DatasetField = "records"
	DatasetFieldConnectionName   DatasetField = "connectionName"
	DatasetFieldSourceType       DatasetField = "sourceType"
	DatasetFieldIsSystemEntity   DatasetField = "isSystemEntity"
	DatasetFieldRecordsPerSecond DatasetField = "recordsPerSecond"
	DatasetFieldKeyType          DatasetField = "keyType"
	DatasetFieldValueType        DatasetField = "valueType"
	DatasetFieldReplication      DatasetField = "replication"
	DatasetFieldConsumers        DatasetField = "consumers"
	DatasetFieldPartitions       DatasetField = "partitions"
	DatasetFieldRetentionBytes   DatasetField = "retentionBytes"
	DatasetFieldRetentionMs      DatasetField = "retentionMs"
	DatasetFieldSizeBytes        DatasetField = "sizeBytes"
	DatasetFieldReplicas         DatasetField = "replicas"
	DatasetFieldShard            DatasetField = "shard"
	DatasetFieldVersion          DatasetField = "version"
	DatasetFieldFormat           DatasetField = "format"
	DatasetFieldCompatibility    DatasetField = "compatibility"
)

DatasetField enum values.

type DatasetMatch

type DatasetMatch interface{}

DatasetMatch either one of the following types: Elastic, Kafka, Postgres, SchemaRegistrySubject.

type DatasetTag

type DatasetTag struct {
	Name string `json:"name"` // Required.
}

DatasetTag is part of the datasets DTOs.

type DatasetsResp

type DatasetsResp struct {
	Datasets struct {
		Values []struct {
			Name          string `json:"name"`
			Format        string `json:"format"`
			Version       int    `json:"version"`
			Compatibility string `json:"compatibility"`
		} `json:"values"`
		PagesAmount int `json:"pagesAmount"`
		TotalCount  int `json:"totalCount"`
	} `json:"datasets"`
	SourceTypes []string `json:"sourceTypes"`
}

DatasetsResp struct maps to the `api/v1/datasets` response payload

type DatasetsWithFields

type DatasetsWithFields struct {
	DatasetName         string           `json:"datasetName" yaml:"datasetName"`
	MatchingKeyFields   []MatchingFields `json:"matchingKeyFields" yaml:"matchingKeyFields"`
	MatchingValueFields []MatchingFields `json:"matchingValueFields" yaml:"matchingValueFields"`
}

DatasetsWithFields holds the dataset fields

type DefaultMax

type DefaultMax struct {
	Default int64 `json:"default,omitempty" yaml:"default,omitempty"`
	Max     int64 `json:"max" yaml:"max"`
}

DefaultMax contains Default and Max keys

type DeploymentTargets

type DeploymentTargets struct {
	Kubernetes []KubernetesTarget   `json:"kubernetes"`
	Connect    []KafkaConnectTarget `json:"connect"`
}

DeploymentTargets describes the deployment cluster targets

type Elastic

type Elastic struct {
	ConnectionName string               `json:"connectionName"`        // Required.
	IsSystemEntity bool                 `json:"isSystemEntity"`        // Required.
	Name           string               `json:"name"`                  // Required.
	Permissions    []string             `json:"permissions"`           // Required.
	Replicas       int                  `json:"replicas"`              // Required.
	Shard          int                  `json:"shard"`                 // Required.
	Description    *string              `json:"description,omitempty"` // Optional.
	Fields         *Fields              `json:"fields,omitempty"`      // Optional.
	Highlights     []Highlight          `json:"highlights,omitempty"`  // Optional.
	Policies       []PolicyMatchDetails `json:"policies,omitempty"`    // Optional.
	Records        *int                 `json:"records,omitempty"`     // Optional.
	SizeBytes      *int                 `json:"sizeBytes,omitempty"`   // Optional.
	Tags           []DatasetTag         `json:"tags,omitempty"`        // Optional.
}

Elastic is part of the datasets DTOs.

type ExecutionMode

type ExecutionMode string

ExecutionMode is the type for the config's execution modes, valid values are: IN_PROC/CONNECT/KUBERNETES.

const (
	// ExecutionModeInvalid represents no mode, this is here for invalid executions mode that
	// maybe returned from the server, maybe useful for the future.
	ExecutionModeInvalid ExecutionMode = "INVALID"
	// ExecutionModeInProcess represents the execution mode IN_PROC.
	ExecutionModeInProcess ExecutionMode = "IN_PROC"
	// ExecutionModeConnect represents the execution mode CONNECT.
	ExecutionModeConnect ExecutionMode = "CONNECT"
	// ExecutionModeKubernetes represents the execution mode KUBERNETES.
	ExecutionModeKubernetes ExecutionMode = "KUBERNETES"
)

func MatchExecutionMode

func MatchExecutionMode(modeStr string) (ExecutionMode, bool)

MatchExecutionMode returns the mode based on the string represetantion of it and a boolean if that mode is exist or not, the mode will always return in uppercase, the input argument is not case sensitive.

The value is just a string but we do this to protect users from mistakes or future releases maybe remove/change or replace a string will be much easier.

type Field

type Field struct {
	IsNullable  bool             `json:"isNullable"`            // Required.
	Name        string           `json:"name"`                  // Required.
	TypeDetails FieldTypeDetails `json:"typeDetails"`           // Required.
	Ancestors   []string         `json:"ancestors,omitempty"`   // Optional.
	Default     *string          `json:"default,omitempty"`     // Optional.
	Description *string          `json:"description,omitempty"` // Optional.
	Highlights  []Highlight      `json:"highlights,omitempty"`  // Optional.
}

Field is part of the datasets DTOs.

type FieldTypeDetails

type FieldTypeDetails interface{}

FieldTypeDetails is either one of the following types: Lenses, Native.

type Fields

type Fields struct {
	Key   []Field `json:"key,omitempty"`   // Optional.
	Value []Field `json:"value,omitempty"` // Optional.
}

Fields is part of the datasets DTOs.

type FileMetadataEntity

type FileMetadataEntity struct {
	Filename    string    `json:"filename"`              // Required.
	ID          uuid.UUID `json:"id"`                    // Required.
	Size        int       `json:"size"`                  // Required.
	UploadedAt  time.Time `json:"uploadedAt"`            // Required.
	UploadedBy  string    `json:"uploadedBy"`            // Required.
	ContentType *string   `json:"contentType,omitempty"` // Optional.
}

type FlexInt

type FlexInt int

FlexInt is a custom type to accomodate JMXPort special case where its value can range be either int or empty string e.g. ""

func (*FlexInt) UnmarshalJSON

func (fi *FlexInt) UnmarshalJSON(b []byte) error

UnmarshalJSON is the custom unmarshaller for JMXPort

type GetSchemaRes

type GetSchemaRes struct {
	Name           string   `json:"name"`
	ConnectionName string   `json:"connectionName"`
	IsSystemEntity bool     `json:"isSystemEntity"`
	Permissions    []string `json:"permissions"`
	Description    string   `json:"description"`
	Tags           []Tags   `json:"tags"`
	Format         string   `json:"format"`
	Schema         string   `json:"schema"`
	Version        int      `json:"version"`
	SchemaID       int      `json:"schemaId"`
	Compatibility  string   `json:"compatibility"`
	SourceType     string   `json:"sourceType"`
}

GetSchemaRes Struct

type Group

type Group struct {
	Name                       string      `json:"name" yaml:"name" header:"Name"`
	Description                string      `json:"description,omitempty" yaml:"description" header:"Description"`
	Namespaces                 []Namespace `json:"namespaces,omitempty" yaml:"dataNamespaces" header:"Namespaces,count"`
	ScopedPermissions          []string    `json:"scopedPermissions" yaml:"applicationPermissions" header:"Application Permissions,count"`
	AdminPermissions           []string    `json:"adminPermissions" yaml:"adminPermissions" header:"Admin Permissions,count"`
	UserAccountsCount          int         `json:"userAccounts" yaml:"userAccounts" header:"User Accounts"`
	ServiceAccountsCount       int         `json:"serviceAccounts" yaml:"serviceAccounts" header:"Service Accounts"`
	ConnectClustersPermissions []string    `json:"connectClustersPermissions" yaml:"connectClustersPermissions" header:"Connect clusters access"`
}

Group the payload object

type Highlight

type Highlight struct {
	ArrayIndex int    `json:"arrayIndex"` // Required.
	EndIndex   int    `json:"endIndex"`   // Required.
	FieldName  string `json:"fieldName"`  // Required.
	StartIndex int    `json:"startIndex"` // Required.
}

Highlight is part of the datasets DTOs.

type Impacts

type Impacts struct {
	ConnectionEntities []ConnectionEntity `json:"connectionEntities" yaml:"connectionEntities"`
	Processors         []ImpactsDetails   `json:"processors" yaml:"processors"`
	Connectors         []ImpactsDetails   `json:"connectors" yaml:"connectors"`
	Apps               []ImpactsDetails   `json:"apps" yaml:"apps"`
}

Impacts holds the impact response from Lenses for DataPolicies

type ImpactsDetails

type ImpactsDetails struct {
	ID   string `json:"id" yaml:"id"`
	Name string `json:"name" yaml:"name"`
	Type string `json:"type" yaml:"type"`
}

ImpactsDetails holds impact details

type Index

type Index struct {
	IndexName      string       `json:"indexName" header:"Name"`
	ConnectionName string       `json:"connectionName" header:"Connection"`
	KeyType        string       `json:"keyType"`
	ValueType      string       `json:"valueType"`
	KeySchema      string       `json:"keySchema,omitempty"`
	ValueSchema    string       `json:"valueSchema,omitempty"`
	Size           int          `json:"size" header:"Size"`
	TotalRecords   int          `json:"totalMessages" header:"Records"`
	Description    string       `json:"description" yaml:"description"`
	Tags           []DatasetTag `json:"tags" yaml:"tags"`
	Status         string       `json:"status" header:"Status"`
	Shards         []Shard      `json:"shards"`
	ShardsCount    int          `json:"shardsCount" header:"Shards"`
	Replicas       int          `json:"replicas" header:"Replicas"`
	Permission     []string     `json:"permissions"`
}

Index is Elasticsearch index type

type Json

type Json map[string]interface{}

type JsonObject

type JsonObject map[string]interface{}

type KV

type KV map[string]interface{}

KV shouldn't be the case now that have the `TopicConfig` but the API returns different values for fetching and different for creation of topic or topics configs update.

type Kafka

type Kafka struct {
	ConnectionName      string               `json:"connectionName"`           // Required.
	Consumers           int                  `json:"consumers"`                // Required.
	IsCompacted         bool                 `json:"isCompacted"`              // Required.
	IsMarkedForDeletion bool                 `json:"isMarkedForDeletion"`      // Required.
	IsSystemEntity      bool                 `json:"isSystemEntity"`           // Required.
	KeyType             string               `json:"keyType"`                  // Required.
	Name                string               `json:"name"`                     // Required.
	Partitions          int                  `json:"partitions"`               // Required.
	Permissions         []string             `json:"permissions"`              // Required.
	RecordsPerSecond    int                  `json:"recordsPerSecond"`         // Required.
	Replication         int                  `json:"replication"`              // Required.
	ValueType           string               `json:"valueType"`                // Required.
	Description         *string              `json:"description,omitempty"`    // Optional.
	Fields              *Fields              `json:"fields,omitempty"`         // Optional.
	Highlights          []Highlight          `json:"highlights,omitempty"`     // Optional.
	Policies            []PolicyMatchDetails `json:"policies,omitempty"`       // Optional.
	Records             *int                 `json:"records,omitempty"`        // Optional.
	RetentionBytes      *int                 `json:"retentionBytes,omitempty"` // Optional.
	RetentionMs         *int                 `json:"retentionMs,omitempty"`    // Optional.
	SizeBytes           *int                 `json:"sizeBytes,omitempty"`      // Optional.
	Tags                []DatasetTag         `json:"tags,omitempty"`           // Optional.
}

Kafka is part of the datasets DTOs.

type KafkaConnectConnectionAddRequest

type KafkaConnectConnectionAddRequest struct {
	ConfigurationObject KafkaConnectConnectionConfiguration `json:"configurationObject"` // Required.
	Name                string                              `json:"name"`                // Required. Name of the connection.
	Tags                []string                            `json:"tags"`                // Optional.
}

type KafkaConnectConnectionConfiguration

type KafkaConnectConnectionConfiguration struct {
	Workers                   []string          `json:"workers"`                             // Required. List of Kafka Connect worker URLs.
	Aes256Key                 *string           `json:"aes256Key,omitempty"`                 // Optional. AES256 Key used to encrypt secret properties when deploying Connectors to this ConnectCluster.
	MetricsCustomPortMappings map[string]string `json:"metricsCustomPortMappings,omitempty"` // Optional. DEPRECATED.
	MetricsCustomURLMappings  map[string]string `json:"metricsCustomUrlMappings,omitempty"`  // Optional. Mapping from node URL to metrics URL, allows overriding metrics target on a per-node basis.
	MetricsHTTPSuffix         *string           `json:"metricsHttpSuffix,omitempty"`         // Optional. HTTP URL suffix for Jolokia metrics.
	MetricsHTTPTimeout        *int              `json:"metricsHttpTimeout,omitempty"`        // Optional. HTTP Request timeout (ms) for Jolokia metrics.
	MetricsPassword           *string           `json:"metricsPassword,omitempty"`           // Optional. The password for metrics connections.
	MetricsPort               *int              `json:"metricsPort,omitempty"`               // Optional. Default port number for metrics connection (JMX and JOLOKIA).
	MetricsSsl                *bool             `json:"metricsSsl,omitempty"`                // Optional. Flag to enable SSL for metrics connections.
	MetricsType               *string           `json:"metricsType,omitempty"`               // Optional. Metrics type.
	MetricsUsername           *string           `json:"metricsUsername,omitempty"`           // Optional. The username for metrics connections.
	Password                  *string           `json:"password,omitempty"`                  // Optional. Password for HTTP Basic Authentication.
	SslAlgorithm              *string           `json:"sslAlgorithm,omitempty"`              // Optional. Name of the ssl algorithm. If empty default one will be used (X509).
	SslKeyPassword            *string           `json:"sslKeyPassword,omitempty"`            // Optional. Key password for the keystore.
	SslKeystore               *struct {
		FileId uuid.UUID `json:"fileId"` // Required.
	} `json:"sslKeystore,omitempty"` // Optional. SSL keystore file.
	SslKeystorePassword *string `json:"sslKeystorePassword,omitempty"` // Optional. Password to the keystore.
	SslTruststore       *struct {
		FileId uuid.UUID `json:"fileId"` // Required.
	} `json:"sslTruststore,omitempty"` // Optional. SSL truststore file.
	SslTruststorePassword *string `json:"sslTruststorePassword,omitempty"` // Optional. Password to the truststore.
	Username              *string `json:"username,omitempty"`              // Optional. Username for HTTP Basic Authentication.
}

type KafkaConnectConnectionResponse

type KafkaConnectConnectionResponse struct {
	BuiltIn             bool                                `json:"builtIn"`             // Required.
	ConfigurationObject KafkaConnectConnectionConfiguration `json:"configurationObject"` // Required.
	CreatedAt           int                                 `json:"createdAt"`           // Required.
	CreatedBy           string                              `json:"createdBy"`           // Required.
	Deletable           bool                                `json:"deletable"`           // Required.
	ModifiedAt          int                                 `json:"modifiedAt"`          // Required.
	ModifiedBy          string                              `json:"modifiedBy"`          // Required.
	Name                string                              `json:"name"`                // Required. Name of the connection.
	TemplateName        string                              `json:"templateName"`        // Required. The [template](#operation/listConnectionTemplates) of the connection.
	TemplateVersion     int                                 `json:"templateVersion"`     // Required.
	Tags                []string                            `json:"tags,omitempty"`      // Optional.
}

type KafkaConnectConnectionTestRequest

type KafkaConnectConnectionTestRequest struct {
	ConfigurationObject KafkaConnectConnectionConfiguration `json:"configurationObject"` // Required.
	Name                string                              `json:"name"`                // Required. Name of the connection.
	Update              *bool                               `json:"update,omitempty"`    // Optional. *true* if testing an update to an existing connection, *false* if testing a new connection.
}

type KafkaConnectConnectionUpsertRequest

type KafkaConnectConnectionUpsertRequest struct {
	ConfigurationObject KafkaConnectConnectionConfiguration `json:"configurationObject"` // Required.
	Tags                []string                            `json:"tags"`
}

type KafkaConnectTarget

type KafkaConnectTarget struct {
	Cluster string `json:"cluster"`
	Version string `json:"version,omitempty"`
}

KafkaConnectTarget describes a Kafka Connect deployment target

type KafkaConnectionAddRequest

type KafkaConnectionAddRequest struct {
	ConfigurationObject KafkaConnectionConfiguration `json:"configurationObject"` // Required.
	Name                string                       `json:"name"`                // Required. Name of the connection.
	Tags                []string                     `json:"tags"`
}

type KafkaConnectionConfiguration

type KafkaConnectionConfiguration struct {
	KafkaBootstrapServers []string          `json:"kafkaBootstrapServers"`          // Required. Comma separated list of protocol://host:port to use for initial connection to Kafka.
	AdditionalProperties  map[string]string `json:"additionalProperties,omitempty"` // Optional.
	Keytab                *struct {
		FileId uuid.UUID `json:"fileId"` // Required.
	} `json:"keytab,omitempty"` // Optional. Kerberos keytab file.
	MetricsCustomPortMappings map[string]string `json:"metricsCustomPortMappings,omitempty"` // Optional. DEPRECATED.
	MetricsCustomURLMappings  map[string]string `json:"metricsCustomUrlMappings,omitempty"`  // Optional. Mapping from node URL to metrics URL, allows overriding metrics target on a per-node basis.
	MetricsHTTPSuffix         *string           `json:"metricsHttpSuffix,omitempty"`         // Optional. HTTP URL suffix for Jolokia or AWS metrics.
	MetricsHTTPTimeout        *int              `json:"metricsHttpTimeout,omitempty"`        // Optional. HTTP Request timeout (ms) for Jolokia or AWS metrics.
	MetricsPassword           *string           `json:"metricsPassword,omitempty"`           // Optional. The password for metrics connections.
	MetricsPort               *int              `json:"metricsPort,omitempty"`               // Optional. Default port number for metrics connection (JMX and JOLOKIA).
	MetricsSsl                *bool             `json:"metricsSsl,omitempty"`                // Optional. Flag to enable SSL for metrics connections.
	MetricsType               *string           `json:"metricsType,omitempty"`               // Optional. Metrics type.
	MetricsUsername           *string           `json:"metricsUsername,omitempty"`           // Optional. The username for metrics connections.
	Protocol                  *string           `json:"protocol,omitempty"`                  // Optional. Kafka security protocol.
	SaslJaasConfig            *string           `json:"saslJaasConfig,omitempty"`            // Optional. JAAS Login module configuration for SASL.
	SaslMechanism             *string           `json:"saslMechanism,omitempty"`             // Optional. Mechanism to use when authenticated using SASL.
	SslKeyPassword            *string           `json:"sslKeyPassword,omitempty"`            // Optional. Key password for the keystore.
	SslKeystore               *struct {
		FileId uuid.UUID `json:"fileId"` // Required.
	} `json:"sslKeystore,omitempty"` // Optional. SSL keystore file.
	SslKeystorePassword *string `json:"sslKeystorePassword,omitempty"` // Optional. Password to the keystore.
	SslTruststore       *struct {
		FileId uuid.UUID `json:"fileId"` // Required.
	} `json:"sslTruststore,omitempty"` // Optional. SSL truststore file.
	SslTruststorePassword *string `json:"sslTruststorePassword,omitempty"` // Optional. Password to the truststore.
}

type KafkaConnectionResponse

type KafkaConnectionResponse struct {
	BuiltIn             bool                         `json:"builtIn"`             // Required.
	ConfigurationObject KafkaConnectionConfiguration `json:"configurationObject"` // Required.
	CreatedAt           int                          `json:"createdAt"`           // Required.
	CreatedBy           string                       `json:"createdBy"`           // Required.
	Deletable           bool                         `json:"deletable"`           // Required.
	ModifiedAt          int                          `json:"modifiedAt"`          // Required.
	ModifiedBy          string                       `json:"modifiedBy"`          // Required.
	Name                string                       `json:"name"`                // Required. Name of the connection.
	TemplateName        string                       `json:"templateName"`        // Required. The [template](#operation/listConnectionTemplates) of the connection.
	TemplateVersion     int                          `json:"templateVersion"`     // Required.
	Tags                []string                     `json:"tags,omitempty"`      // Optional.
}

type KafkaConnectionTestRequest

type KafkaConnectionTestRequest struct {
	ConfigurationObject KafkaConnectionConfiguration `json:"configurationObject"` // Required.
	Name                string                       `json:"name"`                // Required. Name of the connection.
	Update              *bool                        `json:"update,omitempty"`    // Optional. *true* if testing an update to an existing connection, *false* if testing a new connection.
}

type KafkaConnectionUpsertRequest

type KafkaConnectionUpsertRequest struct {
	ConfigurationObject KafkaConnectionConfiguration `json:"configurationObject"` // Required.
	Tags                []string                     `json:"tags"`
}

type KerberosAuthentication

type KerberosAuthentication struct {
	ConfFile string                       `json:"confFile" yaml:"ConfFile" survey:"-"` // keep those, useful for marshal.
	Method   KerberosAuthenticationMethod `json:"-" yaml:"-" survey:"-"`
}

KerberosAuthentication can be used as alternative option of the `BasicAuthentication` for a more secure way to connect to the lenses backend box.

func (KerberosAuthentication) Auth

func (auth KerberosAuthentication) Auth(c *Client) error

Auth implements the `Authentication` for the `KerberosAuthentication`.

func (KerberosAuthentication) FromCCache

func (auth KerberosAuthentication) FromCCache() (KerberosFromCCache, bool)

FromCCache reports whether the kerberos authentication is loaded from a ccache file.

func (KerberosAuthentication) WithKeytab

func (auth KerberosAuthentication) WithKeytab() (KerberosWithKeytab, bool)

WithKeytab reports whether the kerberos authentication is with a keytab file, username (and realm).

func (KerberosAuthentication) WithPassword

func (auth KerberosAuthentication) WithPassword() (KerberosWithPassword, bool)

WithPassword reports whether the kerberos authentication is with username, password (and realm).

type KerberosAuthenticationMethod

type KerberosAuthenticationMethod interface {
	NewClient() (client.Client, error)
}

KerberosAuthenticationMethod is the interface which all available kerberos authentication methods are implement.

See `KerberosWithPassword`, `KerberosWithKeytab` and `KerberosFromCCache` for more.

type KerberosConnectionAddRequest

type KerberosConnectionAddRequest struct {
	ConfigurationObject KerberosConnectionConfiguration `json:"configurationObject"` // Required.
	Name                string                          `json:"name"`                // Required. Name of the connection.
	Tags                []string                        `json:"tags"`
}

type KerberosConnectionConfiguration

type KerberosConnectionConfiguration struct {
	KerberosKrb5 struct {
		FileId uuid.UUID `json:"fileId"` // Required.
	} `json:"kerberosKrb5"` // Required. Kerberos krb5.conf file.
}

type KerberosConnectionResponse

type KerberosConnectionResponse struct {
	BuiltIn             bool                            `json:"builtIn"`             // Required.
	ConfigurationObject KerberosConnectionConfiguration `json:"configurationObject"` // Required.
	CreatedAt           int                             `json:"createdAt"`           // Required.
	CreatedBy           string                          `json:"createdBy"`           // Required.
	Deletable           bool                            `json:"deletable"`           // Required.
	ModifiedAt          int                             `json:"modifiedAt"`          // Required.
	ModifiedBy          string                          `json:"modifiedBy"`          // Required.
	Name                string                          `json:"name"`                // Required. Name of the connection.
	TemplateName        string                          `json:"templateName"`        // Required. The [template](#operation/listConnectionTemplates) of the connection.
	TemplateVersion     int                             `json:"templateVersion"`     // Required.
	Tags                []string                        `json:"tags,omitempty"`      // Optional.
}

type KerberosConnectionTestRequest

type KerberosConnectionTestRequest struct {
	ConfigurationObject KerberosConnectionConfiguration `json:"configurationObject"` // Required.
	Name                string                          `json:"name"`                // Required. Name of the connection.
	Update              *bool                           `json:"update,omitempty"`    // Optional. *true* if testing an update to an existing connection, *false* if testing a new connection.
}

type KerberosConnectionUpsertRequest

type KerberosConnectionUpsertRequest struct {
	ConfigurationObject KerberosConnectionConfiguration `json:"configurationObject"` // Required.
	Tags                []string                        `json:"tags"`
}

type KerberosFromCCache

type KerberosFromCCache struct {
	// CCacheFile should be filled with the ccache file path.
	CCacheFile string `json:"ccacheFile" yaml:"CCacheFile" survey:"ccache"`
}

KerberosFromCCache is a `KerberosAuthenticationMethod` using a ccache file path.

The `KerberosAuthentication` calls its `NewClient`.

func (KerberosFromCCache) NewClient

func (m KerberosFromCCache) NewClient() (client.Client, error)

NewClient implements the `KerberosAuthenticationMethod` for the `KerberosFromCCache`.

type KerberosWithKeytab

type KerberosWithKeytab struct {
	Username string `json:"username" yaml:"Username" survey:"username"`

	// Realm is optional, if empty then default is used.
	Realm string `json:"realm" yaml:"Realm" survey:"realm"`
	// KeytabFile the keytab file path.
	KeytabFile string `json:"keytabFile" yaml:"KeytabFile" survey:"keytab"`
}

KerberosWithKeytab is a `KerberosAuthenticationMethod` using a username and a keytab file path and optionally a realm.

The `KerberosAuthentication` calls its `NewClient`.

func (KerberosWithKeytab) NewClient

func (m KerberosWithKeytab) NewClient() (client.Client, error)

NewClient implements the `KerberosAuthenticationMethod` for the `KerberosWithKeytab`.

type KerberosWithPassword

type KerberosWithPassword struct {
	Username string `json:"username" yaml:"Username" survey:"username"`
	Password string `json:"password,omitempty" yaml:"Password" survey:"password"`

	// Realm is optional, if empty then default is used.
	Realm string `json:"realm" yaml:"Realm" survey:"realm"`
}

KerberosWithPassword is a `KerberosAuthenticationMethod` using a username, password and optionally a realm.

The `KerberosAuthentication` calls its `NewClient`.

func (KerberosWithPassword) NewClient

func (m KerberosWithPassword) NewClient() (client.Client, error)

NewClient implements the `KerberosAuthenticationMethod` for the `KerberosWithPassword`.

type KeyDataType

type KeyDataType string

type KeyVal

type KeyVal struct {
	Key   string `json:"key" yaml:"key"`
	Value string `json:"value" yaml:"value"`
}

KeyVal contains the data configs to send for a topic update.

type KubernetesTarget

type KubernetesTarget struct {
	Cluster    string   `json:"cluster"`
	Namespaces []string `json:"namespaces"`
	Version    string   `json:"version,omitempty"`
}

KubernetesTarget describes a kubernetes deployment target

type LSQLRunningQuery

type LSQLRunningQuery struct {
	ID        int64  `json:"id" header:"ID,text"`
	SQL       string `json:"sql" header:"SQL"`
	User      string `json:"user"  header:"User"`
	Timestamp int64  `json:"ts" header:"Timestamp,timestamp(ms|utc|02 Jan 2006 15:04)"`
}

LSQLRunningQuery is the form of the data that the `GetRunningQueries` returns.

type LSQLValidation

type LSQLValidation struct {
	IsValid bool   `json:"isValid"`
	Line    int    `json:"line"`
	Column  int    `json:"column"`
	Message string `json:"message"`
}

LSQLValidation contains the necessary information about an invalid lenses query, see `ValidateLSQL`. Example Error:

{
    "IsValid": false,
    "Line": 4,
    "Column": 1,
    "Message": "Invalid syntax.Encountered \"LIIT\" at line 4, column 1.\nWas expecting one of:\n    <EOF> ... "
}

type LegacyTopicName

type LegacyTopicName struct {
	Name  string `json:"name"`
	Key   string `json:"key"`
	Value string `json:"value"`
}

LegacyTopicName contains the legacy format of input/output topics returned by lenses <= 4.2

type Lenses

type Lenses struct {
	LensesDataType string `json:"lensesDataType"` // Required.
}

Lenses is part of the datasets DTOs.

type License

type License struct {
	Source   string `json:"source"`
	ClientID string `json:"clientId"`
	Details  string `json:"details"`
	Key      string `json:"key"`
}

License is the JSON payload for updating a license.

type LicenseInfo

type LicenseInfo struct {
	ClientID    string `json:"clientId" header:"ID,text"`
	IsRespected bool   `json:"isRespected" header:"Respected"`
	MaxBrokers  int    `json:"maxBrokers" header:"Max Brokers"`
	MaxMessages int    `json:"maxMessages,omitempty" header:"/ Messages"`
	Expiry      int64  `json:"expiry" header:"Expires,timestamp(ms|02 Jan 2006 15:04)"`

	// ExpiresAt is the time.Time expiration datetime (unix).
	ExpiresAt time.Time `json:"-"`

	// ExpiresDur is the duration that expires from now.
	ExpiresDur time.Duration `json:"-"`

	// YearsToExpire is the length of years that expires from now.
	YearsToExpire int `json:"yearsToExpire,omitempty"`
	// MonthsToExpire is the length of months that expires from now.
	MonthsToExpire int `json:"monthsToExpire,omitempty"`
	// DaysToExpire is the length of days that expires from now.
	DaysToExpire int `json:"daysToExpire,omitempty"`
}

LicenseInfo describes the data received from the `GetLicenseInfo`.

type ListDatasetsParameters

type ListDatasetsParameters struct {
	Page                  *int         // Optional. The page number to be returned, must be greater than zero. Defaults to 1.
	PageSize              int          // Required. The elements amount on a single page, must be greater than zero.
	Query                 *string      // Optional. A search keyword to match dataset, fields and description against.
	Connections           []string     // Optional. A list of connection names to filter by. All connections will be included when no value is supplied.
	Tags                  []string     // Optional. A list of tag names to filter by. All tags will be included when no value is supplied.
	SortBy                DatasetField // Optional. The field to sort results by.
	SortingOrder          Order        // Optional. Sorting order. Defaults to ascending.
	IncludeSystemEntities *bool        // Optional. A flag to include in the search also system entities (e.g. Kafka's `__consumer_offsets` topic).
	IncludeMetadata       *bool        // Optional. Whether to search only by table name, or also to include field names/documentation (defaults to true).
	Format                []string     // Optional. Schema format. Relevant only when sourceType is `ScheamRegistrySubject`.
	HasRecords            *bool        // Optional. TODO.
	Compacted             *bool        // Optional. TODO.
}

ListDatasetsParameters contain the query parameters for ListDatasets.

type LogLine

type LogLine struct {
	Level      string `json:"level" header:"Level"`
	Thread     string `json:"thread"`
	Logger     string `json:"logger"`
	Message    string `json:"message" header:"Message"`
	Stacktrace string `json:"stacktrace"`
	Timestamp  int64  `json:"timestamp"`
	Time       string `json:"time" header:"Time"`
}

LogLine represents the return value(s) of the `GetLogsInfo` and `GetLogsMetrics` calls.

type MatchingFields

type MatchingFields struct {
	Name    string   `json:"name" yaml:"name"`
	Parents []string `json:"parents" yaml:"parents"`
}

MatchingFields holds the matching fields

type MinMax

type MinMax struct {
	Min int `json:"min" yaml:"min"`
	Max int `json:"max,omitempty" yaml:"max,omitempty"`
}

MinMax contains Min and Max keys

type MultipleTopicOffsets

type MultipleTopicOffsets struct {
	Type   string   `json:"type" yaml:"type"`
	Target string   `json:"target,omitempty" yaml:"type"`
	Topics []string `json:"topics,omitempty" yaml:"topics"`
}

MultipleTopicOffsets represent the payload structure of the API for updating all partitions of multiple topics.

type Namespace

type Namespace struct {
	Wildcards   []string `json:"wildcards" yaml:"wildcards" header:"Wildcards"`
	Permissions []string `json:"permissions" yaml:"permissions" header:"Permissions"`
	System      string   `json:"system" yaml:"system" header:"system"`
	Instance    string   `json:"instance" yaml:"instance" header:"instance"`
}

Namespace the payload object for namespaces

type Naming

type Naming struct {
	Description string `json:"description" yaml:"description"`
	Pattern     string `json:"pattern" yaml:"pattern"`
}

Naming contains Description and Pattern

type Native

type Native struct {
	LensesDataType string `json:"lensesDataType"` // Required.
	Native         string `json:"native"`         // Required.
}

Native is part of the datasets DTOs.

type Order

type Order string

Order is part of the dataset api query params.

const (
	OrderAsc  Order = "asc"
	OrderDesc Order = "desc"
)

Order enum values.

type PageDatasetMatch

type PageDatasetMatch struct {
	PagesAmount int            `json:"pagesAmount"`      // Required.
	TotalCount  int            `json:"totalCount"`       // Required.
	Values      []DatasetMatch `json:"values,omitempty"` // Optional.
}

PageDatasetMatch is part of the datasets DTOs.

func (*PageDatasetMatch) UnmarshalJSON

func (pdm *PageDatasetMatch) UnmarshalJSON(data []byte) error

UnmarshalJSON is a custom unmarshaller to deal with "polymorphic" types.

type PartitionMessage

type PartitionMessage struct {
	Partition int   `json:"partition"`
	Messages  int64 `json:"messages"`
	Begin     int64 `json:"begin"`
	End       int64 `json:"end"`
}

PartitionMessage describes a partition's message response data.

type PolicyFieldMatch

type PolicyFieldMatch struct {
	Name    string   `json:"name"`              // Required.
	Parents []string `json:"parents,omitempty"` // Optional.
}

PolicyFieldMatch is part of the datasets DTOs.

type PolicyMatchDetails

type PolicyMatchDetails struct {
	Obfuscation         string             `json:"obfuscation"`                   // Required.
	PolicyCategory      string             `json:"policyCategory"`                // Required.
	PolicyID            string             `json:"policyId"`                      // Required.
	PolicyName          string             `json:"policyName"`                    // Required.
	MatchingKeyFields   []PolicyFieldMatch `json:"matchingKeyFields,omitempty"`   // Optional.
	MatchingValueFields []PolicyFieldMatch `json:"matchingValueFields,omitempty"` // Optional.
}

PolicyMatchDetails is part of the datasets DTOs.

type Postgres

type Postgres struct {
	ConnectionName string               `json:"connectionName"`        // Required.
	IsSystemEntity bool                 `json:"isSystemEntity"`        // Required.
	IsView         bool                 `json:"isView"`                // Required.
	Name           string               `json:"name"`                  // Required.
	Permissions    []string             `json:"permissions"`           // Required.
	Description    *string              `json:"description,omitempty"` // Optional.
	Fields         *Fields              `json:"fields,omitempty"`      // Optional.
	Highlights     []Highlight          `json:"highlights,omitempty"`  // Optional.
	Policies       []PolicyMatchDetails `json:"policies,omitempty"`    // Optional.
	Records        *int                 `json:"records,omitempty"`     // Optional.
	SizeBytes      *int                 `json:"sizeBytes,omitempty"`   // Optional.
	Tags           []DatasetTag         `json:"tags,omitempty"`        // Optional.
}

Postgres is part of the datasets DTOs.

type ProcessorAppState

type ProcessorAppState struct {
	DeploymentStatus string                          `json:"deploymentStatus"`
	DeploymentError  string                          `json:"deploymentError,omitempty"`
	RunnerStataus    map[string]ProcessorRunnerState `json:"runnerStatus"`
}

ProcessorAppState contains the details about the processor deployment

type ProcessorLastAction

type ProcessorLastAction struct {
	Action  string `json:"action"`
	Message string `json:"msg"`
}

ProcessorLastAction contains the information about the last change on the SQL processor

type ProcessorRunnerState

type ProcessorRunnerState struct {
	ID           string `json:"id"`
	Worker       string `json:"worker"`
	State        string `json:"status"`
	ErrorMessage string `json:"errorMsg,omitempty"`
}

ProcessorRunnerState describes the processor stream, see `ProcessorStream` and `ProcessorResult.

type ProcessorStream

type ProcessorStream struct {
	ID              string `json:"id" header:"ID,text" yaml:"id"`
	ProcessorID     string `json:"processorId" header:"ProcessorID,text" yaml:"processorId"`
	Name            string `json:"name" header:"Name" yaml:"name"`
	DeploymentState string `json:"deploymentState" header:"State" yaml:"deploymentState"`
	Runners         int    `json:"runners" header:"Runners" yaml:"runners"`
	User            string `json:"user" header:"Created By" yaml:"user"`
	StartTimestamp  int64  `json:"startTs" header:"Started at,timestamp(ms|02 Jan 2006 15:04)" yaml:"startTs"`
	StopTimestamp   int64  `json:"stopTs,omitempty" header:"Stopped,timestamp(ms|02 Jan 2006 15:04),No" yaml:"stopTs"`
	Uptime          int64  `json:"uptime" header:"Up time,unixduration" yaml:"uptime"`

	Namespace   string `json:"namespace" header:"Namespace" yaml:"namespace"`
	ClusterName string `json:"clusterName" header:"Cluster" yaml:"clusterName"`

	SQL string `json:"sql" yaml:"sql"` // header:"SQL"`

	InputTopics  []TopicName `json:"inputTopics" yaml:"inputTopics"`
	OutputTopics []TopicName `json:"outputTopics" yaml:"outputTopics"` // header:"Topic Decoder"`
	Pipeline     string      `json:"pipeline" yaml:"pipeline"`         // header:"Pipeline"`

	ToTopics   []string            `json:"toTopics,omitempty" yaml:"toTopics"` // header:"To Topics"`
	FromTopics []string            `json:"fromTopics,omitempty" yaml:"fromTopics"`
	LastAction ProcessorLastAction `json:"lastAction,omitempty" yaml:"lastAction"`

	RunnerState ProcessorAppState `json:"state" yaml:"state"`
	Settings    map[string]string `json:"settings" yaml:"settings"`
}

ProcessorStream describes the processor stream, see `ProcessorResult`.

func (*ProcessorStream) ProcessorAsFile

func (p *ProcessorStream) ProcessorAsFile() CreateProcessorFilePayload

ProcessorAsFile returns a proccessor as a CreateProcessorFilePayload

type ProcessorsResult

type ProcessorsResult struct {
	Streams []ProcessorStream `json:"streams"`
}

ProcessorsResult describes the data that are being received from the `GetProcessors`.

type ProducerAlertSettings

type ProducerAlertSettings struct {
	ID               int                       `json:"alert" yaml:"alert"`
	Description      string                    `json:"description" yaml:"description"`
	ConditionDetails []AlertConditionRequestv1 `json:"conditions" yaml:"conditions"`
}

ProducerAlertSettings is the struct used for importing/exporting alert settings

type QueryFiltering

type QueryFiltering struct {
	PageSize     int
	Page         int
	Name         string
	SortBy       string
	SortingOrder string
}

QueryFiltering used to add query params in an API request

type Quota

type Quota struct {
	// Entityname is the Kafka client id for "CLIENT"
	// and "CLIENTS" and user name for "USER", "USER" and "USERCLIENT", the `QuotaEntityXXX`.
	EntityName string `json:"entityName" yaml:"entityName" header:"Name"`
	// EntityType can be either `QuotaEntityClient`, `QuotaEntityClients`,
	// `QuotaEntityClientsDefault`, `QuotaEntityUser`, `QuotaEntityUsers`, `QuotaEntityUserClient`
	// or `QuotaEntityUsersDefault`.
	EntityType QuotaEntityType `json:"entityType" yaml:"entityType" header:"Type"`
	// Child is optional and only present for entityType `QuotaEntityUserClient` and is the client id.
	Child string `json:"child,omitempty" yaml:"Child"` // header:"Child"`
	// Properties  is a map of the quota constraints, the `QuotaConfig`.
	Properties QuotaConfig `json:"properties" yaml:"properties" header:"inline"`
	// URL is the url from this quota in Lenses.
	URL string `json:"url" yaml:"URL"`

	IsAuthorized bool `json:"isAuthorized" yaml:"isAuthorized"`
}

Quota is the type which defines a single Quota.

func (*Quota) GetQuotaAsRequest

func (q *Quota) GetQuotaAsRequest() CreateQuotaPayload

GetQuotaAsRequest returns a quota as a request

type QuotaConfig

type QuotaConfig struct {
	// header note:
	// if "number" and no default value, then it will add "0", we use the empty space between commas to tell that the default value is space.
	ProducerByteRate  string `json:"producer_byte_rate,omitempty" yaml:"producerByteRate" header:"Produce/sec, ,number"`
	ConsumerByteRate  string `json:"consumer_byte_rate,omitempty" yaml:"consumerByteRate" header:"Consume/sec, ,number"`
	RequestPercentage string `json:"request_percentage,omitempty" yaml:"requestPercentage" header:"Request Percentage, ,number"`
}

QuotaConfig is a typed struct which defines the map of the quota constraints, producer_byte_rate, consumer_byte_rate and request_percentage.

type QuotaEntityType

type QuotaEntityType string

QuotaEntityType is a string and it defines the valid entity types for a single Quota.

const (
	// QuotaEntityClient is the "CLIENT" Quota entity type.
	QuotaEntityClient QuotaEntityType = "CLIENT"
	// QuotaEntityClients is the "CLIENTS" Quota entity type.
	QuotaEntityClients QuotaEntityType = "CLIENTS"
	// QuotaEntityClientsDefault is the "CLIENTS DEFAULT" Quota entity type.
	QuotaEntityClientsDefault QuotaEntityType = "CLIENTS DEFAULT"
	// QuotaEntityUser is the "USER" Quota entity type.
	QuotaEntityUser QuotaEntityType = "USER"
	// QuotaEntityUsers is the "USERS" Quota entity type.
	QuotaEntityUsers QuotaEntityType = "USERS"
	// QuotaEntityUserClient is the "USERCLIENT" Quota entity type.
	QuotaEntityUserClient QuotaEntityType = "USERCLIENT"
	// QuotaEntityUsersDefault is the "USERS DEFAULT" Quota entity type.
	QuotaEntityUsersDefault QuotaEntityType = "USERS DEFAULT"
)

type RecordCount

type RecordCount string

RecordCount is part of the dataset api query params.

const (
	RecordCountEmpty    RecordCount = "empty"
	RecordCountNonEmpty RecordCount = "nonEmpty"
	RecordCountAll      RecordCount = "all"
)

RecordCount enum values.

type RequestOption

type RequestOption func(r *http.Request) error

RequestOption is just a func which receives the current HTTP request and alters it, if the return value of the error is not nil then `Client#Do` fails with that error.

type ResourceError

type ResourceError struct {
	StatusCode int    `json:"statusCode" header:"Status Code"`
	Method     string `json:"method" header:"Method"`
	URI        string `json:"uri" header:"Target"`
	Body       string `json:"message" header:"Message"`
}

ResourceError is being fired from all API calls when an error code is received.

func NewResourceError

func NewResourceError(statusCode int, uri, method, body string) ResourceError

NewResourceError is just a helper to create a new `ResourceError` to return from custom calls, it's "cli-compatible".

func (ResourceError) Code

func (err ResourceError) Code() int

Code returns the status code.

func (ResourceError) Error

func (err ResourceError) Error() string

Error returns the error's message body. The result's first letter is lowercase when the above rule is applied and it never ends with examination points '.' or '!'.

func (ResourceError) String

func (err ResourceError) String() string

String returns the detailed cause of the error.

type Results

type Results struct {
	Datasets    PageDatasetMatch `json:"datasets"`              // Required.
	SourceTypes []SourceType     `json:"sourceTypes,omitempty"` // Optional.
}

Results is part of the datasets DTOs.

type Retention

type Retention struct {
	Size DefaultMax `json:"size" yaml:"size"`
	Time DefaultMax `json:"time" yaml:"time"`
}

Retention contains Size and Time keys

type SQLValidationRequest

type SQLValidationRequest struct {
	SQL   string `json:"sql"`
	Caret int    `json:"caret"`
}

SQLValidationRequest is a Lenses SQL Validation request

type SQLValidationResponse

type SQLValidationResponse struct {
	Input       string            `json:"input"`
	Caret       int               `json:"caret"`
	Lints       []ValidationLints `json:"lints"`
	Highlights  []ValidationLints `json:"highlights"`
	Suggestions []Suggestions     `json:"suggestions"`
}

SQLValidationResponse is a the validation response from Lenses

type SchemaReference

type SchemaReference struct {
	SchemaName  string `json:"schemaName"`  // Required.
	SubjectName string `json:"subjectName"` // Required.
	Version     int    `json:"version"`     // Required.
}

SchemaReference is part of the datasets DTOs.

type SchemaRegistryConnectionAddRequest

type SchemaRegistryConnectionAddRequest struct {
	ConfigurationObject SchemaRegistryConnectionConfiguration `json:"configurationObject"` // Required.
	Name                string                                `json:"name"`                // Required. Name of the connection.
	Tags                []string                              `json:"tags"`                // Optional.
}

type SchemaRegistryConnectionConfiguration

type SchemaRegistryConnectionConfiguration struct {
	SchemaRegistryURLs        []string          `json:"schemaRegistryUrls"`                  // Required. List of schema registry urls.
	AdditionalProperties      map[string]string `json:"additionalProperties,omitempty"`      // Optional.
	MetricsCustomPortMappings map[string]string `json:"metricsCustomPortMappings,omitempty"` // Optional. DEPRECATED.
	MetricsCustomURLMappings  map[string]string `json:"metricsCustomUrlMappings,omitempty"`  // Optional. Mapping from node URL to metrics URL, allows overriding metrics target on a per-node basis.
	MetricsHTTPSuffix         *string           `json:"metricsHttpSuffix,omitempty"`         // Optional. HTTP URL suffix for Jolokia metrics.
	MetricsHTTPTimeout        *int              `json:"metricsHttpTimeout,omitempty"`        // Optional. HTTP Request timeout (ms) for Jolokia metrics.
	MetricsPassword           *string           `json:"metricsPassword,omitempty"`           // Optional. The password for metrics connections.
	MetricsPort               *int              `json:"metricsPort,omitempty"`               // Optional. Default port number for metrics connection (JMX and JOLOKIA).
	MetricsSsl                *bool             `json:"metricsSsl,omitempty"`                // Optional. Flag to enable SSL for metrics connections.
	MetricsType               *string           `json:"metricsType,omitempty"`               // Optional. Metrics type.
	MetricsUsername           *string           `json:"metricsUsername,omitempty"`           // Optional. The username for metrics connections.
	Password                  *string           `json:"password,omitempty"`                  // Optional. Password for HTTP Basic Authentication.
	SslKeyPassword            *string           `json:"sslKeyPassword,omitempty"`            // Optional. Key password for the keystore.
	SslKeystore               *struct {
		FileId uuid.UUID `json:"fileId"` // Required.
	} `json:"sslKeystore,omitempty"` // Optional. SSL keystore file.
	SslKeystorePassword *string `json:"sslKeystorePassword,omitempty"` // Optional. Password to the keystore.
	SslTruststore       *struct {
		FileId uuid.UUID `json:"fileId"` // Required.
	} `json:"sslTruststore,omitempty"` // Optional. SSL truststore file.
	SslTruststorePassword *string `json:"sslTruststorePassword,omitempty"` // Optional. Password to the truststore.
	Username              *string `json:"username,omitempty"`              // Optional. Username for HTTP Basic Authentication.
}

type SchemaRegistryConnectionResponse

type SchemaRegistryConnectionResponse struct {
	BuiltIn             bool                                  `json:"builtIn"`             // Required.
	ConfigurationObject SchemaRegistryConnectionConfiguration `json:"configurationObject"` // Required.
	CreatedAt           int                                   `json:"createdAt"`           // Required.
	CreatedBy           string                                `json:"createdBy"`           // Required.
	Deletable           bool                                  `json:"deletable"`           // Required.
	ModifiedAt          int                                   `json:"modifiedAt"`          // Required.
	ModifiedBy          string                                `json:"modifiedBy"`          // Required.
	Name                string                                `json:"name"`                // Required. Name of the connection.
	TemplateName        string                                `json:"templateName"`        // Required. The [template](#operation/listConnectionTemplates) of the connection.
	TemplateVersion     int                                   `json:"templateVersion"`     // Required.
	Tags                []string                              `json:"tags,omitempty"`      // Optional.
}

type SchemaRegistryConnectionTestRequest

type SchemaRegistryConnectionTestRequest struct {
	ConfigurationObject SchemaRegistryConnectionConfiguration `json:"configurationObject"` // Required.
	Name                string                                `json:"name"`                // Required. Name of the connection.
	Update              *bool                                 `json:"update,omitempty"`    // Optional. *true* if testing an update to an existing connection, *false* if testing a new connection.
}

type SchemaRegistryConnectionUpsertRequest

type SchemaRegistryConnectionUpsertRequest struct {
	ConfigurationObject SchemaRegistryConnectionConfiguration `json:"configurationObject"` // Required.
	Tags                []string                              `json:"tags"`
}

type SchemaRegistrySubject

type SchemaRegistrySubject struct {
	ConnectionName string               `json:"connectionName"`          // Required.
	Format         string               `json:"format"`                  // Required.
	IsSystemEntity bool                 `json:"isSystemEntity"`          // Required.
	Name           string               `json:"name"`                    // Required.
	Permissions    []string             `json:"permissions"`             // Required.
	Schema         string               `json:"schema"`                  // Required.
	SchemaID       int                  `json:"schemaId"`                // Required.
	Version        int                  `json:"version"`                 // Required.
	Compatibility  *string              `json:"compatibility,omitempty"` // Optional.
	Description    *string              `json:"description,omitempty"`   // Optional.
	Fields         *Fields              `json:"fields,omitempty"`        // Optional.
	Highlights     []Highlight          `json:"highlights,omitempty"`    // Optional.
	Policies       []PolicyMatchDetails `json:"policies,omitempty"`      // Optional.
	Records        *int                 `json:"records,omitempty"`       // Optional.
	References     []SchemaReference    `json:"references,omitempty"`    // Optional.
	SizeBytes      *int                 `json:"sizeBytes,omitempty"`     // Optional.
	Tags           []DatasetTag         `json:"tags,omitempty"`          // Optional.
	Versions       []SchemaVersion      `json:"versions,omitempty"`      // Optional.
}

SchemaRegistrySubject is part of the datasets DTOs.

type SchemaVersion

type SchemaVersion struct {
	Format     string            `json:"format"`               // Required.
	ID         int               `json:"id"`                   // Required.
	Schema     string            `json:"schema"`               // Required.
	Version    int               `json:"version"`              // Required.
	References []SchemaReference `json:"references,omitempty"` // Optional.
}

SchemaVersion is part of the datasets DTOs.

type ServiceAccount

type ServiceAccount struct {
	Name   string   `json:"name" yaml:"name" header:"Name"`
	Owner  string   `json:"owner,omitempty" yaml:"owner,omitempty" header:"Owner"`
	Groups []string `json:"groups" yaml:"groups" header:"Groups"`
	Token  string   `json:"token,omitempty" yaml:"token,omitempty"`
}

ServiceAccount the service account data transfer object

type SetGlobalCompatibilityReq

type SetGlobalCompatibilityReq struct {
	Compatibility string `json:"compatibility"`
}

SetGlobalCompatibilityReq Struct

type SetSchemaCompatibilityReq

type SetSchemaCompatibilityReq struct {
	Compatibility string `json:"compatibility"`
}

SetSchemaCompatibilityReq Struct

type SetupStatus added in v5.1.0

type SetupStatus struct {
	IsCompleted bool `json:"isCompleted"` // Required.
	IsLicensed  bool `json:"isLicensed"`  // Required.
}

type Shard

type Shard struct {
	Shard             string `json:"shard"`
	Records           int    `json:"records"`
	Replicas          int    `json:"replicas"`
	AvailableReplicas int    `json:"availableReplicas"`
}

Shard type for elasticsearch shards

type SingleTopicOffset

type SingleTopicOffset struct {
	Type   string `json:"type" yaml:"type"`
	Offset int    `json:"offset,omitempty" yaml:"offset"`
}

SingleTopicOffset represent the payload structure of the API for updating a single partition of a single topic.

type SourceType

type SourceType string

SourceType is part of the datasets DTOs.

const (
	SourceTypeKafka                 SourceType = "Kafka"
	SourceTypeElastic               SourceType = "Elastic"
	SourceTypePostgres              SourceType = "Postgres"
	SourceTypeSchemaRegistrySubject SourceType = "SchemaRegistrySubject"
)

SourceType enum values.

type Subjects

type Subjects []struct {
	Name          string `json:"name" yaml:"name" header:"name"`
	Format        string `json:"format" yaml:"format" header:"format"`
	Version       int    `json:"version" yaml:"version" header:"latest version"`
	Compatibility string `json:"compatibility" yaml:"compatibility" header:"compatibility"`
}

Subjects struct is used at 'schema-registy subjects' cmd

type Suggestions

type Suggestions struct {
	Display string `json:"display"`
	Text    string `json:"text"`
}

Suggestions holds the Lenses validation susggestions

type Tags

type Tags struct {
	Name string `json:"name"`
}

Tags Struct

type TemplateCategory

type TemplateCategory string
const (
	TemplateCategoryConnection  TemplateCategory = "Connection"
	TemplateCategoryApplication TemplateCategory = "Application"
	TemplateCategoryChannel     TemplateCategory = "Channel"
	TemplateCategoryDeployment  TemplateCategory = "Deployment"
)

type TemplateType

type TemplateType string
const (
	TemplateTypeNotApplicable TemplateType = "Not Applicable"
	TemplateTypeSQLRunner     TemplateType = "SQLRunner"
	TemplateTypeKubernetes    TemplateType = "Kubernetes"
	TemplateTypeInProc        TemplateType = "InProc"
	TemplateTypeConnect       TemplateType = "Connect"
	TemplateTypeAlertChannel  TemplateType = "Alert Channel"
	TemplateTypeAuditChannel  TemplateType = "Audit Channel"
)

type TestConnectionAPIRequest

type TestConnectionAPIRequest struct {
	Name                string `json:"name"`                          // Required.
	TemplateName        string `json:"templateName"`                  // Required. The [template](#operation/listConnectionTemplates) of the connection.
	ConfigurationObject any    `json:"configurationObject,omitempty"` // Optional. The configuration of the connection. The schema of this object is defined by the [template configuration](#operation/listConnectionTemplates).
	Update              *bool  `json:"update,omitempty"`              // Optional. *true* if testing an update to an existing connection, *false* if testing a new connection.
}

type TestConnectionAPIRequestV2 added in v5.1.0

type TestConnectionAPIRequestV2 struct {
	Name          string `json:"name"`                    // Required.
	TemplateName  string `json:"templateName"`            // Required. The [template](#operation/listConnectionTemplates) of the connection.
	Configuration any    `json:"configuration,omitempty"` // Optional. The configuration of the connection. The schema of this object is defined by the [template configuration](#operation/listConnectionTemplates).
	Update        *bool  `json:"update,omitempty"`        // Optional. *true* if testing an update to an existing connection, *false* if testing a new connection.
}

type Threshold

type Threshold struct {
	Type     string `json:"type" yaml:"type"`
	Messages int    `json:"messages" yaml:"messages"`
}

Threshold corresponds to AlertSettingCondition DataProduced Threshold data structure

type Topic

type Topic struct {
	TopicName            string             `json:"topicName" header:"Name"`
	KeyType              string             `json:"keyType" header:"Key /,NULL"`        // maybe string-based enum?
	ValueType            string             `json:"valueType" header:"Value Type,NULL"` // maybe string-based enum?
	Partitions           int                `json:"partitions" header:"Part"`
	Replication          int                `json:"replication" header:"Repl"`
	IsControlTopic       bool               `json:"isControlTopic"`
	KeySchema            string             `json:"keySchema,omitempty"`
	ValueSchema          string             `json:"valueSchema,omitempty"`
	MessagesPerSecond    int64              `json:"messagesPerSecond" header:"msg/sec"`
	TotalMessages        int64              `json:"totalMessages" header:"Total Msg"`
	Description          string             `json:"description" yaml:"description"`
	Tags                 []DatasetTag       `json:"tags" yaml:"tags"`
	Timestamp            int64              `json:"timestamp"`
	Configs              []KV               `json:"config" header:"Configs,count"`
	ConsumersGroup       []ConsumersGroup   `json:"consumers"`
	MessagesPerPartition []PartitionMessage `json:"messagesPerPartition"`
	IsMarkedForDeletion  bool               `json:"isMarkedForDeletion" header:"Marked Del"`
}

Topic describes the data that the `GetTopic` returns.

func (*Topic) GetTopicAsRequest

func (topic *Topic) GetTopicAsRequest(config KV) CreateTopicPayload

GetTopicAsRequest takes a topic returned from Lenses and transforms to a request

type TopicCleanupPolicy

type TopicCleanupPolicy string

TopicCleanupPolicy is the go type to safety describe the topic config's `CleanupPolicy` field. The available policies are: `TopicDeletePolicy` and `TopicCompactPolicy`.

const (
	TopicDeletePolicy  TopicCleanupPolicy = "delete"
	TopicCompactPolicy TopicCleanupPolicy = "compact"
)

The available cleanup policies for topics.

type TopicConfig

type TopicConfig struct {
	// KV contains all the available topic configs keys as they sent by the backend,
	// even if not declared into the struct,
	// useful for debugging mostly, if somehow the available topic configs keys changed but structured data are not.
	// Another use case is use them to accomplish custom formats, not really necessary for end-users.
	// It's used by the CLI to make sure that no invalid config key is passed into flags as well.
	KV KV

	// The maximum difference allowed between the timestamp when a broker receives a message
	// and the timestamp specified in the message.
	// If MessageTimestampType=CreateTime, a message will be rejected if the difference in timestamp exceeds this threshold.
	// This configuration is ignored if MessageTimestampType=LogAppendTime (see below).
	//
	// Defaults to 9223372036854775807.
	MessageTimestampDifferenceMaxMs int64 `json:"message.timestamp.difference.max.ms"`
	// This is largest message size Kafka will allow to be appended.
	// Note that if you increase this size you must also increase your consumer's fetch size so they can fetch messages this large.
	//
	// Defaults to 1000012.
	MaxMessageBytes int64 `json:"max.message.bytes"`
	// This configuration controls the size of the index that maps offsets to file positions.
	// We preallocate this index file and shrink it only after log rolls. You generally should not need to change this setting.
	//
	// Defaults to 10485760.
	SegmentIndexBytes int64 `json:"segment.index.bytes"`
	// The maximum random jitter subtracted from the scheduled segment roll time to avoid thundering herds of segment rolling.
	//
	// Defaults to 10485760.
	SegmentJitterMs int64 `json:"segment.jitter.ms"`
	// This configuration controls how frequently the log compactor will attempt to clean the log (assuming log compaction is enabled).
	// By default we will avoid cleaning a log where more than 50% of the log has been compacted.
	// This ratio bounds the maximum space wasted in the log by duplicates (at 50% at most 50% of the log could be duplicates).
	// A higher ratio will mean fewer, more efficient cleanings but will mean more wasted space in the log.
	//
	// Defaults to 0.5.
	MinCleanableDirtyRatio float32 `json:"min.cleanable.dirty.ratio"`
	// This configuration controls the maximum size a log can grow to before we will discard old log segments to free up space
	// if we are using the "delete" retention policy. By default there is no size limit only a time limit.
	//
	// Defaults to -1.
	RetentionBytes int64 `json:"retention.bytes"`
	// A list of replicas for which log replication should be throttled on the follower side.
	// The list should describe a set of replicas in the form [PartitionId]:[BrokerId],[PartitionId]:[BrokerId]:...
	// or alternatively the wildcard '*' can be used to throttle all replicas for this topic.
	//
	// Empty by default, use "*" for wildcard.
	FollowerReplicationThrottledReplicas string `json:"follower.replication.throttled.replicas"`
	// The time to wait before deleting a file from the filesystem.
	//
	// Defaults to 60000.
	FileDeleteDelayMs int64 `json:"file.delete.delay.ms"`
	// Specify the final compression type for a given topic.
	// This configuration accepts the standard compression codecs (`Gzip`, `Snappy`, `LZ4`).
	// It additionally accepts 'uncompressed' which is equivalent to no compression;
	// and `Producer` which means retain the original compression codec set by the producer.
	//
	// Defaults to `Producer` ("producer").
	CompressionType CompressionType `json:"compression.type"`
	// The minimum time a message will remain uncompacted in the log.
	// Only applicable for logs that are being compacted.
	//
	// Defaults to 0.
	MinCompactionLagMs int64 `json:"min.compaction.lag.ms"`
	// This setting allows specifying a time interval at which we will force an fsync of data written to the log.
	//  For example if this was set to 1000 we would fsync after 1000 ms had passed.
	// In general we recommend you not set this and use replication for durability and
	// allow the operating system's background flush capabilities as it is more efficient.
	//
	// Defaults to 9223372036854775807.
	FlushMs int64 `json:"flush.ms"`
	// A string that is either  `TopicDeletePolicy` or `TopicCompactPolicy`.
	// This string designates the retention policy to use on old log segments.
	// The default policy `TopicDeletePolicy` ("delete") will discard old segments when their retention time or size limit has been reached.
	// The `TopicCompactPolicy` ("compact") setting will enable log compaction on the topic.
	//
	// Defaults to `TopicDeletePolicy` ("delete").
	CleanupPolicy TopicCleanupPolicy `json:"cleanup.policy"`
	// Define whether the timestamp in the message is message create time or log append time.
	// The value should be either `TopicMessageCreateTime` ("CreateTime") or `TopicMessageLogAppendTime` ("LogAppendTime").
	//
	// Defaults to `TopicMessageCreateTime`.
	MessageTimestampType TopicMessageTimestampType `json:"message.timestamp.type"`
	// Indicates whether to enable replicas not in the ISR set to be elected as leader as a last resort,
	// even though doing so may result in data loss.
	//
	// Defaults to true.
	UncleanLeaderElectionEnable bool `json:"unclean.leader.election.enable"`
	// This setting allows specifying an interval at which we will force an fsync of data written to the log.
	// For example if this was set to 1 we would fsync after every message;
	// if it were 5 we would fsync after every five messages.
	// In general we recommend you not set this and use replication for durability and
	// allow the operating system's background flush capabilities as it is more efficient.
	//
	// Note: this setting can be overridden on a per-topic basis.
	//
	// Defaults to 9223372036854775807.
	FlushMessages int64 `json:"flush.messages"`
	// This configuration controls the maximum time we will retain a log before we will discard old log segments
	// to free up space if you are using the "delete" retention policy.
	// This represents an SLA on how soon consumers must read their data.
	//
	// Defaults to 604800000.
	RetentionMs int64 `json:"retention.ms"`
	// When a producer sets acks to \"all\" (or \"-1\"), min.insync.replicas specifies the minimum number of replicas that must acknowledge a write for the write to be considered successful. If this minimum cannot be met, then the producer will raise an exception (either NotEnoughReplicas or NotEnoughReplicasAfterAppend). When used together, min.insync.replicas and acks allow you to enforce greater durability guarantees. A typical scenario would be to create a topic with a replication factor of 3, set min.insync.replicas to 2, and produce with acks of \"all\". This will ensure that the producer raises an exception if a majority of replicas do not receive a write.
	//
	// Defaults to 1.
	MinInsyncReplicas int `json:"min.insync.replicas"`
	// Specify the message format version the broker will use to append messages to the logs.
	// The value should be a valid ApiVersion. Some examples are: 0.8.2, 0.9.0.0, 0.10.0, check ApiVersion for more details.
	// By setting a particular message format version, the user is certifying that all the existing messages on disk are smaller or equal than the specified version.
	// Setting this value incorrectly will cause consumers with older versions to break as they will receive messages with a format that they don't understand.
	//
	// Defaults to the relative to broker version.
	MessageFormatVersion string `json:"message.format.version"`
	// A list of replicas for which log replication should be throttled on the leader side.
	// The list should describe a set of replicas in the form [PartitionId]:[BrokerId],[PartitionId]:[BrokerId]:...
	// or alternatively the wildcard '*' can be used to throttle all replicas for this topic.
	//
	// Empty by default.
	LeaderReplicationThrottledReplicas string `json:"leader.replication.throttled.replicas"`
	// The amount of time to retain delete tombstone markers for log compacted topics.
	// This setting also gives a bound on the time in which a consumer must
	// complete a read if they begin from offset 0 to ensure that they get a valid snapshot of
	// the final stage (otherwise delete tombstones may be collected before they complete their scan).
	//
	// Defaults to 86400000 (24 hours).
	DeleteRetentionMs int64 `json:"delete.retention.ms"`
	// Indicates if should pre allocate file when create new segment.
	//
	// Defaults to false.
	Preallocate bool `json:"preallocate"`
	// This setting controls how frequently Kafka adds an index entry to it's offset index.
	// The default setting ensures that we index a message roughly every 4096 bytes.
	// More indexing allows reads to jump closer to the exact position in the log but makes the index larger.
	// You probably don't need to change this.
	//
	// Defaults to 4096.
	IndexIntervalBytes int64 `json:"index.interval.bytes"`
	// This configuration controls the segment file size for the log.
	// Retention and cleaning is always done a file at a time so a larger segment size means fewer files but less granular control over retention.
	//
	// Defaults to 1073741824.
	SegmentBytes int64 `json:"segment.bytes"`
	// This configuration controls the period of time after which Kafka will force the log to roll
	// even if the segment file isn't full to ensure that retention can delete or compact old data.
	//
	// Defaults to 604800000.
	SegmentMs int64 `json:"segment.ms"`
}

TopicConfig describes the topic's `Config` field.

type TopicConfiguration

type TopicConfiguration struct {
	Partitions  MinMax    `json:"partitions" yaml:"partitions"`
	Replication MinMax    `json:"replication" yaml:"replication"`
	Retention   Retention `json:"retention" yaml:"retention"`
}

TopicConfiguration contains Partitions, Replication and Retention keys

type TopicExtract

type TopicExtract struct {
	Parents     []string `json:"parents" yaml:"parents" header:"Parents"`
	Descendants []string `json:"descendants" yaml:"descendants" header:"descendants"`
}

TopicExtract a topics parents and descendants from a Lenses topology

type TopicMessageTimestampType

type TopicMessageTimestampType string

TopicMessageTimestampType is the type to safety describe the topic's config's `MessageTimestampType` field. The available message timestamp types are: `TopicMessageCreateTime` and `TopicMessageLogAppendTime`.

const (
	TopicMessageCreateTime    TopicMessageTimestampType = "CreateTime"
	TopicMessageLogAppendTime TopicMessageTimestampType = "LogAppendTime"
)

The available timestamp types for topic's messages.

type TopicMetadata

type TopicMetadata struct {
	TopicName string `json:"topicName" yaml:"topicName" header:"Topic"`
	KeyType   string `json:"keyType,omitempty" yaml:"keyType" header:"Key /,NULL"`
	ValueType string `json:"valueType,omitempty" yaml:"valueType" header:"Value Type,NULL"`

	ValueSchemaRaw string `json:"valueSchema,omitempty" yaml:"valueSchema,omitempty"` // for response read.
	KeySchemaRaw   string `json:"keySchema,omitempty" yaml:"keySchema,omitempty"`     // for response read.
}

TopicMetadata describes the data received from the `GetTopicsMetadata` and the payload to send on the `CreateTopicMetadata`.

type TopicName

type TopicName struct {
	Name string `json:"name"`
}

TopicName contains the information about the topic names of input/output topics

func (*TopicName) UnmarshalJSON

func (topicName *TopicName) UnmarshalJSON(data []byte) error

UnmarshalJSON makes unmarshaling compatible with lenses >= 4.3 and lenses <= 4.2

type TopicSettingsRequest

type TopicSettingsRequest struct {
	Config TopicConfiguration `json:"config" yaml:"config"`
	Naming *Naming            `json:"naming" yaml:"naming"`
}

TopicSettingsRequest contains Config and Naming keys

type TopicSettingsResponse

type TopicSettingsResponse struct {
	Config       TopicConfiguration `json:"config" yaml:"config"`
	Naming       *Naming            `json:"naming,omitempty" yaml:"naming,omitempty"`
	IsApplicable bool               `json:"isApplicable,omitempty" yaml:"isApplicable,omitempty"`
}

TopicSettingsResponse contains Config, Naming and IsApplicable keys

type UnmarshalFunc

type UnmarshalFunc func(in []byte, outPtr *Config) error

UnmarshalFunc is the most standard way to declare a Decoder/Unmarshaler to read the configurations and more. See `ReadConfig` and `ReadConfigFromFile` for more.

type UpdateConfigs

type UpdateConfigs struct {
	Configs []KeyVal `json:"configs"  yaml:"configs"`
}

UpdateConfigs is a struct holding a topic configuration for update

type UpdateConnectionPayload

type UpdateConnectionPayload struct {
	Name          string             `json:"name" yaml:"name"`
	Configuration []ConnectionConfig `json:"configuration" yaml:"configuration"`
	Tags          []string           `json:"tags" yaml:"tags"`
}

UpdateConnectionPayload type

type UpdateDatasetDescription

type UpdateDatasetDescription struct {
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
}

UpdateDatasetDescription Struct

type UpdateDatasetTags

type UpdateDatasetTags struct {
	Tags []DatasetTag `json:"tags" yaml:"tags"`
}

UpdateDatasetTags struct

type UpsertConnectionAPIRequest

type UpsertConnectionAPIRequest struct {
	ConfigurationObject any      `json:"configurationObject,omitempty"` // Optional. The configuration of the connection. The schema of this object is defined by the [template configuration](#operation/listConnectionTemplates).
	Tags                []string `json:"tags"`                          // Optional.
	TemplateName        *string  `json:"templateName,omitempty"`        // Optional. The [template](#operation/listConnectionTemplates) of the connection.
}

type UpsertConnectionAPIRequestV2 added in v5.1.0

type UpsertConnectionAPIRequestV2 struct {
	Configuration any      `json:"configuration,omitempty"` // Optional. The configuration of the connection. The schema of this object is defined by the [template configuration](#operation/listConnectionTemplates).
	Tags          []string `json:"tags"`                    // Optional.
	TemplateName  *string  `json:"templateName,omitempty"`  // Optional. The [template](#operation/listConnectionTemplates) of the connection.
}

type User

type User struct {
	Token                string   `json:"token"`
	Name                 string   `json:"user" header:"Name"`
	SchemaRegistryDelete bool     `json:"schemaRegistryDelete" header:"Schema Registry Delete"`
	Permissions          []string `json:"permissions" header:"permissions"`
}

User represents the user of the client.

type UserMember

type UserMember struct {
	Username string   `json:"username" yaml:"username" header:"Username"`
	Email    string   `json:"email,omitempty" yaml:"email" header:"Email"`
	Groups   []string `json:"groups" yaml:"groups" header:"Groups"`
	Password string   `json:"password,omitempty" yaml:"password"`
	Type     string   `json:"type,omitempty" yaml:"security" header:"Security Type"`
}

UserMember Lenses user

type UserProfile

type UserProfile struct {
	Topics       []string `json:"topics" header:"Topics"`
	Schemas      []string `json:"schemas" header:"Schemas"`
	Transformers []string `json:"transformers" header:"Transformers"`
}

UserProfile contains all the user-specific favourites, only kafka related info.

type ValidationLints

type ValidationLints struct {
	Start int    `json:"start"`
	End   int    `json:"end"`
	Text  string `json:"text"`
	Type  string `json:"type"`
}

ValidationLints holds the validation lints returned by Lenses

type Version

type Version struct {
	ID      int    `json:"id"`
	Version int    `json:"version"`
	Schema  string `json:"schema"`
	Format  string `json:"format"`
}

Version Struct

type WriteSchemaReq

type WriteSchemaReq struct {
	Format string `json:"format"`
	Schema string `json:"schema"`
}

WriteSchemaReq Struct

type ZookeeperConnectionAddRequest

type ZookeeperConnectionAddRequest struct {
	ConfigurationObject ZookeeperConnectionConfiguration `json:"configurationObject"` // Required.
	Name                string                           `json:"name"`                // Required. Name of the connection.
	Tags                []string                         `json:"tags"`                // Optional.
}

type ZookeeperConnectionConfiguration

type ZookeeperConnectionConfiguration struct {
	ZookeeperConnectionTimeout int               `json:"zookeeperConnectionTimeout"`          // Required. Zookeeper connection timeout.
	ZookeeperSessionTimeout    int               `json:"zookeeperSessionTimeout"`             // Required. Zookeeper connection session timeout.
	ZookeeperURLs              []string          `json:"zookeeperUrls"`                       // Required. List of zookeeper urls.
	MetricsCustomPortMappings  map[string]string `json:"metricsCustomPortMappings,omitempty"` // Optional. DEPRECATED.
	MetricsCustomURLMappings   map[string]string `json:"metricsCustomUrlMappings,omitempty"`  // Optional. Mapping from node URL to metrics URL, allows overriding metrics target on a per-node basis.
	MetricsHTTPSuffix          *string           `json:"metricsHttpSuffix,omitempty"`         // Optional. HTTP URL suffix for Jolokia metrics.
	MetricsHTTPTimeout         *int              `json:"metricsHttpTimeout,omitempty"`        // Optional. HTTP Request timeout (ms) for Jolokia metrics.
	MetricsPassword            *string           `json:"metricsPassword,omitempty"`           // Optional. The password for metrics connections.
	MetricsPort                *int              `json:"metricsPort,omitempty"`               // Optional. Default port number for metrics connection (JMX and JOLOKIA).
	MetricsSsl                 *bool             `json:"metricsSsl,omitempty"`                // Optional. Flag to enable SSL for metrics connections.
	MetricsType                *string           `json:"metricsType,omitempty"`               // Optional. Metrics type.
	MetricsUsername            *string           `json:"metricsUsername,omitempty"`           // Optional. The username for metrics connections.
	ZookeeperChrootPath        *string           `json:"zookeeperChrootPath,omitempty"`       // Optional. Zookeeper /znode path.
}

type ZookeeperConnectionResponse

type ZookeeperConnectionResponse struct {
	BuiltIn             bool                             `json:"builtIn"`             // Required.
	ConfigurationObject ZookeeperConnectionConfiguration `json:"configurationObject"` // Required.
	CreatedAt           int                              `json:"createdAt"`           // Required.
	CreatedBy           string                           `json:"createdBy"`           // Required.
	Deletable           bool                             `json:"deletable"`           // Required.
	ModifiedAt          int                              `json:"modifiedAt"`          // Required.
	ModifiedBy          string                           `json:"modifiedBy"`          // Required.
	Name                string                           `json:"name"`                // Required. Name of the connection.
	TemplateName        string                           `json:"templateName"`        // Required. The [template](#operation/listConnectionTemplates) of the connection.
	TemplateVersion     int                              `json:"templateVersion"`     // Required.
	Tags                []string                         `json:"tags,omitempty"`      // Optional.
}

type ZookeeperConnectionTestRequest

type ZookeeperConnectionTestRequest struct {
	ConfigurationObject ZookeeperConnectionConfiguration `json:"configurationObject"` // Required.
	Name                string                           `json:"name"`                // Required. Name of the connection.
	Update              *bool                            `json:"update,omitempty"`    // Optional. *true* if testing an update to an existing connection, *false* if testing a new connection.
}

type ZookeeperConnectionUpsertRequest

type ZookeeperConnectionUpsertRequest struct {
	ConfigurationObject ZookeeperConnectionConfiguration `json:"configurationObject"` // Required.
	Tags                []string                         `json:"tags"`
}

Jump to

Keyboard shortcuts

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