private

package
v0.0.0-...-9b598c7 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
	ContextOAuth2 = contextKey("token")

	// ContextBasicAuth takes BasicAuth as authentication for the request.
	ContextBasicAuth = contextKey("basic")

	// ContextAccessToken takes a string oauth2 access token as authentication for the request.
	ContextAccessToken = contextKey("accesstoken")

	// ContextAPIKey takes an APIKey as authentication for the request
	ContextAPIKey = contextKey("apikey")
)

Functions

func CacheExpires

func CacheExpires(r *http.Response) time.Time

CacheExpires helper function to determine remaining time before repeating a request.

Types

type APIClient

type APIClient struct {
	AgentClustersApi *AgentClustersApiService

	ObservatoriumProxyApi *ObservatoriumProxyApiService
	// contains filtered or unexported fields
}

APIClient manages communication with the Kafka Service Fleet Manager API v1.8.0 In most cases there should be only one, shared, APIClient.

func NewAPIClient

func NewAPIClient(cfg *Configuration) *APIClient

NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.

func (*APIClient) ChangeBasePath

func (c *APIClient) ChangeBasePath(path string)

ChangeBasePath changes base path to allow switching to mocks

func (*APIClient) GetConfig

func (c *APIClient) GetConfig() *Configuration

Allow modification of underlying config for alternate implementations and testing Caution: modifying the configuration while live can cause data races and potentially unwanted behavior

type APIKey

type APIKey struct {
	Key    string
	Prefix string
}

APIKey provides API key based authentication to a request passed via context using ContextAPIKey

type APIResponse

type APIResponse struct {
	*http.Response `json:"-"`
	Message        string `json:"message,omitempty"`
	// Operation is the name of the OpenAPI operation.
	Operation string `json:"operation,omitempty"`
	// RequestURL is the request URL. This value is always available, even if the
	// embedded *http.Response is nil.
	RequestURL string `json:"url,omitempty"`
	// Method is the HTTP method used for the request.  This value is always
	// available, even if the embedded *http.Response is nil.
	Method string `json:"method,omitempty"`
	// Payload holds the contents of the response body (which may be nil or empty).
	// This is provided here as the raw response.Body() reader will have already
	// been drained.
	Payload []byte `json:"-"`
}

APIResponse stores the API response returned by the server.

func NewAPIResponse

func NewAPIResponse(r *http.Response) *APIResponse

NewAPIResponse returns a new APIResonse object.

func NewAPIResponseWithError

func NewAPIResponseWithError(errorMessage string) *APIResponse

NewAPIResponseWithError returns a new APIResponse object with the provided error message.

type AgentClustersApiService

type AgentClustersApiService service

AgentClustersApiService AgentClustersApi service

func (*AgentClustersApiService) GetKafkaAgent

GetKafkaAgent Get the spec of the ManagedKafkaAgent CR spec

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id The ID of record

@return DataplaneClusterAgentConfig

func (*AgentClustersApiService) GetKafkas

GetKafkas Get the list of ManagedaKafkas for the specified agent cluster

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id The ID of record

@return ManagedKafkaList

func (*AgentClustersApiService) UpdateAgentClusterStatus

func (a *AgentClustersApiService) UpdateAgentClusterStatus(ctx _context.Context, id string, dataPlaneClusterUpdateStatusRequest DataPlaneClusterUpdateStatusRequest) (*_nethttp.Response, error)

UpdateAgentClusterStatus Update the status of an agent cluster

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id The ID of record
  • @param dataPlaneClusterUpdateStatusRequest Cluster status update data

func (*AgentClustersApiService) UpdateKafkaClusterStatus

func (a *AgentClustersApiService) UpdateKafkaClusterStatus(ctx _context.Context, id string, requestBody map[string]DataPlaneKafkaStatus) (*_nethttp.Response, error)

UpdateKafkaClusterStatus Update the status of Kafka clusters on an agent cluster

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id The ID of record
  • @param requestBody Kafka clusters status update data

type BasicAuth

type BasicAuth struct {
	UserName string `json:"userName,omitempty"`
	Password string `json:"password,omitempty"`
}

BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth

type Configuration

type Configuration struct {
	BasePath      string            `json:"basePath,omitempty"`
	Host          string            `json:"host,omitempty"`
	Scheme        string            `json:"scheme,omitempty"`
	DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
	UserAgent     string            `json:"userAgent,omitempty"`
	Debug         bool              `json:"debug,omitempty"`
	Servers       []ServerConfiguration
	HTTPClient    *http.Client
}

Configuration stores the configuration of the API client

func NewConfiguration

func NewConfiguration() *Configuration

NewConfiguration returns a new Configuration object

func (*Configuration) AddDefaultHeader

func (c *Configuration) AddDefaultHeader(key string, value string)

AddDefaultHeader adds a new HTTP header to the default header in the request

func (*Configuration) ServerUrl

func (c *Configuration) ServerUrl(index int, variables map[string]string) (string, error)

ServerUrl returns URL based on server settings

type DataPlaneClusterUpdateStatusRequest

type DataPlaneClusterUpdateStatusRequest struct {
	// A map of supported instance type to reported capacity information
	Capacity map[string]DataPlaneClusterUpdateStatusRequestCapacity `json:"capacity,omitempty"`
	// The cluster data plane conditions
	Conditions []DataPlaneClusterUpdateStatusRequestConditions `json:"conditions,omitempty"`
	Strimzi    []DataPlaneClusterUpdateStatusRequestStrimzi    `json:"strimzi,omitempty"`
}

DataPlaneClusterUpdateStatusRequest Schema for the request to update a data plane cluster's status

type DataPlaneClusterUpdateStatusRequestCapacity

type DataPlaneClusterUpdateStatusRequestCapacity struct {
	// The maximum number of units that can be placed onto the instance type machine pool
	MaxUnits int32 `json:"maxUnits,omitempty"`
	// the remaining units that can be placed onto the instance type machine pool
	RemainingUnits int32 `json:"remainingUnits,omitempty"`
}

DataPlaneClusterUpdateStatusRequestCapacity The reported capacity object

type DataPlaneClusterUpdateStatusRequestConditions

type DataPlaneClusterUpdateStatusRequestConditions struct {
	Type    string `json:"type,omitempty"`
	Reason  string `json:"reason,omitempty"`
	Message string `json:"message,omitempty"`
	Status  string `json:"status,omitempty"`
}

DataPlaneClusterUpdateStatusRequestConditions struct for DataPlaneClusterUpdateStatusRequestConditions

type DataPlaneClusterUpdateStatusRequestStrimzi

type DataPlaneClusterUpdateStatusRequestStrimzi struct {
	Ready            bool     `json:"ready"`
	Version          string   `json:"version"`
	KafkaVersions    []string `json:"kafkaVersions,omitempty"`
	KafkaIbpVersions []string `json:"kafkaIbpVersions,omitempty"`
}

DataPlaneClusterUpdateStatusRequestStrimzi struct for DataPlaneClusterUpdateStatusRequestStrimzi

type DataPlaneKafkaStatus

type DataPlaneKafkaStatus struct {
	// The status conditions of a Kafka cluster
	Conditions []DataPlaneClusterUpdateStatusRequestConditions `json:"conditions,omitempty"`
	Capacity   DataPlaneKafkaStatusCapacity                    `json:"capacity,omitempty"`
	Versions   DataPlaneKafkaStatusVersions                    `json:"versions,omitempty"`
	// Routes created for a Kafka cluster
	Routes         *[]DataPlaneKafkaStatusRoutes `json:"routes,omitempty"`
	AdminServerURI string                        `json:"adminServerURI,omitempty"`
}

DataPlaneKafkaStatus Schema of the status object for a Kafka cluster

type DataPlaneKafkaStatusCapacity

type DataPlaneKafkaStatusCapacity struct {
	IngressEgressThroughputPerSec *string `json:"ingressEgressThroughputPerSec,omitempty"`
	TotalMaxConnections           *int32  `json:"totalMaxConnections,omitempty"`
	MaxDataRetentionSize          *string `json:"maxDataRetentionSize,omitempty"`
	MaxPartitions                 *int32  `json:"maxPartitions,omitempty"`
	MaxDataRetentionPeriod        *string `json:"maxDataRetentionPeriod,omitempty"`
	MaxConnectionAttemptsPerSec   *int32  `json:"maxConnectionAttemptsPerSec,omitempty"`
}

DataPlaneKafkaStatusCapacity Capacity information of the data plane cluster

type DataPlaneKafkaStatusRoutes

type DataPlaneKafkaStatusRoutes struct {
	Name   string `json:"name,omitempty"`
	Prefix string `json:"prefix,omitempty"`
	Router string `json:"router,omitempty"`
}

DataPlaneKafkaStatusRoutes struct for DataPlaneKafkaStatusRoutes

type DataPlaneKafkaStatusVersions

type DataPlaneKafkaStatusVersions struct {
	Kafka    string `json:"kafka,omitempty"`
	Strimzi  string `json:"strimzi,omitempty"`
	KafkaIbp string `json:"kafkaIbp,omitempty"`
}

DataPlaneKafkaStatusVersions Version information related to a Kafka cluster

type DataplaneClusterAgentConfig

type DataplaneClusterAgentConfig struct {
	Spec DataplaneClusterAgentConfigSpec `json:"spec,omitempty"`
}

DataplaneClusterAgentConfig Configuration for the data plane cluster agent

type DataplaneClusterAgentConfigSpec

type DataplaneClusterAgentConfigSpec struct {
	Net DataplaneClusterAgentConfigSpecNet `json:"net,omitempty"`
	// A map of supported instance type to configured nodes size
	Capacity      map[string]DataplaneClusterAgentConfigSpecCapacity `json:"capacity,omitempty"`
	Observability DataplaneClusterAgentConfigSpecObservability       `json:"observability,omitempty"`
}

DataplaneClusterAgentConfigSpec Data plane cluster agent spec

type DataplaneClusterAgentConfigSpecCapacity

type DataplaneClusterAgentConfigSpecCapacity struct {
	// The maximum number of nodes configured for the instance type
	MaxNodes int32 `json:"maxNodes,omitempty"`
}

DataplaneClusterAgentConfigSpecCapacity The reported capacity object

type DataplaneClusterAgentConfigSpecNet

type DataplaneClusterAgentConfigSpecNet struct {
	// Indicates whether the network configuration is private or not
	Private bool `json:"private"`
}

DataplaneClusterAgentConfigSpecNet Indicates data plane cluster network configuration

type DataplaneClusterAgentConfigSpecObservability

type DataplaneClusterAgentConfigSpecObservability struct {
	AccessToken *string `json:"accessToken,omitempty"`
	Channel     string  `json:"channel,omitempty"`
	Repository  string  `json:"repository,omitempty"`
	Tag         string  `json:"tag,omitempty"`
}

DataplaneClusterAgentConfigSpecObservability Observability configurations

type Error

type Error struct {
	// Human-readable description of the error. Intended for human consumption
	Reason string `json:"reason"`
	// Relatively unique operation ID of the request associated to the error
	OperationId string `json:"operation_id,omitempty"`
	// The unique and immutable identifier of the resource
	Id string `json:"id"`
	// The kind of the resource
	Kind string `json:"kind"`
	// The absolute path of the resource
	Href string `json:"href"`
	// Code of the error
	Code string `json:"code"`
}

Error struct for Error

type GenericOpenAPIError

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

GenericOpenAPIError Provides access to the body, error and model on returned errors.

func (GenericOpenAPIError) Body

func (e GenericOpenAPIError) Body() []byte

Body returns the raw bytes of the response

func (GenericOpenAPIError) Error

func (e GenericOpenAPIError) Error() string

Error returns non-empty string if there was an error.

func (GenericOpenAPIError) Model

func (e GenericOpenAPIError) Model() interface{}

Model returns the unpacked model of the error

type ListReference

type ListReference struct {
	Kind string `json:"kind"`
}

ListReference struct for ListReference

type ManagedKafka

type ManagedKafka struct {
	Id       string                    `json:"id,omitempty"`
	Kind     string                    `json:"kind,omitempty"`
	Metadata ManagedKafkaAllOfMetadata `json:"metadata,omitempty"`
	Spec     ManagedKafkaAllOfSpec     `json:"spec,omitempty"`
}

ManagedKafka struct for ManagedKafka

type ManagedKafkaAllOfMetadata

type ManagedKafkaAllOfMetadata struct {
	Name        string                               `json:"name,omitempty"`
	Namespace   string                               `json:"namespace,omitempty"`
	Annotations ManagedKafkaAllOfMetadataAnnotations `json:"annotations,omitempty"`
	Labels      ManagedKafkaAllOfMetadataLabels      `json:"labels,omitempty"`
}

ManagedKafkaAllOfMetadata struct for ManagedKafkaAllOfMetadata

type ManagedKafkaAllOfMetadataAnnotations

type ManagedKafkaAllOfMetadataAnnotations struct {
	Bf2OrgId                              string `json:"bf2.org/id"`
	Bf2OrgPlacementId                     string `json:"bf2.org/placementId"`
	ManagedkafkaBf2OrgPauseReconciliation string `json:"managedkafka.bf2.org/pause-reconciliation,omitempty"`
}

ManagedKafkaAllOfMetadataAnnotations struct for ManagedKafkaAllOfMetadataAnnotations

type ManagedKafkaAllOfMetadataLabels

type ManagedKafkaAllOfMetadataLabels struct {
	Bf2OrgKafkaInstanceProfileType          string `json:"bf2.org/kafkaInstanceProfileType,omitempty"`
	Bf2OrgKafkaInstanceProfileQuotaConsumed string `json:"bf2.org/kafkaInstanceProfileQuotaConsumed"`
	Bf2OrgDeployment                        string `json:"bf2.org/deployment,omitempty"`
	Bf2OrgSuspended                         string `json:"bf2.org/suspended,omitempty"`
}

ManagedKafkaAllOfMetadataLabels struct for ManagedKafkaAllOfMetadataLabels

type ManagedKafkaAllOfSpec

type ManagedKafkaAllOfSpec struct {
	ServiceAccounts []ManagedKafkaAllOfSpecServiceAccounts `json:"serviceAccounts,omitempty"`
	Capacity        ManagedKafkaCapacity                   `json:"capacity,omitempty"`
	Oauth           ManagedKafkaAllOfSpecOauth             `json:"oauth,omitempty"`
	Owners          []string                               `json:"owners,omitempty"`
	Endpoint        ManagedKafkaAllOfSpecEndpoint          `json:"endpoint,omitempty"`
	Versions        ManagedKafkaVersions                   `json:"versions,omitempty"`
	Deleted         bool                                   `json:"deleted"`
}

ManagedKafkaAllOfSpec struct for ManagedKafkaAllOfSpec

type ManagedKafkaAllOfSpecEndpoint

type ManagedKafkaAllOfSpecEndpoint struct {
	BootstrapServerHost string                            `json:"bootstrapServerHost,omitempty"`
	Tls                 *ManagedKafkaAllOfSpecEndpointTls `json:"tls,omitempty"`
}

ManagedKafkaAllOfSpecEndpoint struct for ManagedKafkaAllOfSpecEndpoint

type ManagedKafkaAllOfSpecEndpointTls

type ManagedKafkaAllOfSpecEndpointTls struct {
	Cert string `json:"cert,omitempty"`
	Key  string `json:"key,omitempty"`
}

ManagedKafkaAllOfSpecEndpointTls struct for ManagedKafkaAllOfSpecEndpointTls

type ManagedKafkaAllOfSpecOauth

type ManagedKafkaAllOfSpecOauth struct {
	TokenEndpointURI       string  `json:"tokenEndpointURI,omitempty"`
	JwksEndpointURI        string  `json:"jwksEndpointURI,omitempty"`
	ValidIssuerEndpointURI string  `json:"validIssuerEndpointURI,omitempty"`
	UserNameClaim          string  `json:"userNameClaim,omitempty"`
	FallbackUserNameClaim  string  `json:"fallbackUserNameClaim,omitempty"`
	TlsTrustedCertificate  *string `json:"tlsTrustedCertificate,omitempty"`
	CustomClaimCheck       string  `json:"customClaimCheck,omitempty"`
	MaximumSessionLifetime int64   `json:"maximumSessionLifetime"`
}

ManagedKafkaAllOfSpecOauth struct for ManagedKafkaAllOfSpecOauth

type ManagedKafkaAllOfSpecServiceAccounts

type ManagedKafkaAllOfSpecServiceAccounts struct {
	Name      string `json:"name"`
	Principal string `json:"principal"`
	Password  string `json:"password"`
}

ManagedKafkaAllOfSpecServiceAccounts struct for ManagedKafkaAllOfSpecServiceAccounts

type ManagedKafkaCapacity

type ManagedKafkaCapacity struct {
	IngressPerSec               string `json:"ingressPerSec,omitempty"`
	EgressPerSec                string `json:"egressPerSec,omitempty"`
	TotalMaxConnections         int32  `json:"totalMaxConnections,omitempty"`
	MaxDataRetentionSize        string `json:"maxDataRetentionSize,omitempty"`
	MaxPartitions               int32  `json:"maxPartitions,omitempty"`
	MaxDataRetentionPeriod      string `json:"maxDataRetentionPeriod,omitempty"`
	MaxConnectionAttemptsPerSec int32  `json:"maxConnectionAttemptsPerSec,omitempty"`
}

ManagedKafkaCapacity struct for ManagedKafkaCapacity

type ManagedKafkaList

type ManagedKafkaList struct {
	Kind  string         `json:"kind"`
	Items []ManagedKafka `json:"items"`
}

ManagedKafkaList A list of ManagedKafka

type ManagedKafkaVersions

type ManagedKafkaVersions struct {
	Kafka    string `json:"kafka,omitempty"`
	KafkaIbp string `json:"kafkaIbp,omitempty"`
	Strimzi  string `json:"strimzi,omitempty"`
}

ManagedKafkaVersions struct for ManagedKafkaVersions

type ObservatoriumProxyApiService

type ObservatoriumProxyApiService service

ObservatoriumProxyApiService ObservatoriumProxyApi service

func (*ObservatoriumProxyApiService) VerifyObservatoriumProxyRequestValid

func (a *ObservatoriumProxyApiService) VerifyObservatoriumProxyRequestValid(ctx _context.Context, clusterExternalId string) (*_nethttp.Response, error)

VerifyObservatoriumProxyRequestValid Method for VerifyObservatoriumProxyRequestValid this endpoint is used to check whether a token sent from a data plane cluster matches the data plane cluster details obtained from the clusters table that correspond to the \"cluster_external_id\" value sent in the url path. If there is a match, the 200 response is sent, which indicates that the token can be used to send metrics for the corresponding data plane cluster via the observatorium proxy

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param clusterExternalId external cluster ID of a data plane cluster. It has to match the service account details stored in clusters table for that cluster

type PrivateObjectReference

type PrivateObjectReference struct {
	Id   string `json:"id,omitempty"`
	Kind string `json:"kind,omitempty"`
}

PrivateObjectReference struct for PrivateObjectReference

type ServerConfiguration

type ServerConfiguration struct {
	Url         string
	Description string
	Variables   map[string]ServerVariable
}

ServerConfiguration stores the information about a server

type ServerVariable

type ServerVariable struct {
	Description  string
	DefaultValue string
	EnumValues   []string
}

ServerVariable stores the information about a server variable

type WatchEvent

type WatchEvent struct {
	Type   string                  `json:"type"`
	Error  Error                   `json:"error,omitempty"`
	Object *map[string]interface{} `json:"object,omitempty"`
}

WatchEvent struct for WatchEvent

Jump to

Keyboard shortcuts

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