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: 23 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 {
	DefaultApi *DefaultApiService
	// contains filtered or unexported fields
}

APIClient manages communication with the Kafka Service Fleet Manager Admin APIs API v0.2.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 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 DefaultApiService

type DefaultApiService service

DefaultApiService DefaultApi service

func (*DefaultApiService) DeleteKafkaById

func (a *DefaultApiService) DeleteKafkaById(ctx _context.Context, id string, async bool) (Kafka, *_nethttp.Response, error)

DeleteKafkaById Method for DeleteKafkaById Delete a Kafka by ID

  • @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 async Perform the action in an asynchronous manner

@return Kafka

func (*DefaultApiService) GetKafkaById

func (a *DefaultApiService) GetKafkaById(ctx _context.Context, id string) (Kafka, *_nethttp.Response, error)

GetKafkaById Method for GetKafkaById Return the details of Kafka instance by id

  • @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 Kafka

func (*DefaultApiService) GetKafkas

func (a *DefaultApiService) GetKafkas(ctx _context.Context, localVarOptionals *GetKafkasOpts) (KafkaList, *_nethttp.Response, error)

GetKafkas Method for GetKafkas Returns a list of Kafkas

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param optional nil or *GetKafkasOpts - Optional Parameters:
  • @param "Page" (optional.String) - Page index
  • @param "Size" (optional.String) - Number of items in each page
  • @param "OrderBy" (optional.String) - Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the `order by` clause of an SQL statement. Each query can be ordered by any of the following `kafkaRequests` fields: * bootstrap_server_host * admin_api_server_url * cloud_provider * cluster_id * created_at * href * id * instance_type * multi_az * name * organisation_id * owner * reauthentication_enabled * region * status * updated_at * version For example, to return all Kafka instances ordered by their name, use the following syntax: ```sql name asc ``` To return all Kafka instances ordered by their name _and_ created date, use the following syntax: ```sql name asc, created_at asc ``` If the parameter isn't provided, or if the value is empty, then the results are ordered by name.
  • @param "Search" (optional.String) - Search criteria. The syntax of this parameter is similar to the syntax of the `where` clause of an SQL statement. Allowed fields in the search are `cloud_provider`, `name`, `owner`, `region`, `status`, `instance_type`, and `cluster_id`. Allowed comparators are `<>`, `=`, `IN`, `NOT IN`, `LIKE`, or `ILIKE`. Allowed joins are `AND` and `OR`. However, you can use a maximum of 10 joins in a search query. Examples: To return a Kafka instance with the name `my-kafka` and the region `aws`, use the following syntax: ``` name = my-kafka and cloud_provider = aws ``` To return a Kafka instance with a name that starts with `my`, use the following syntax: ``` name like my%25 ``` To return a Kafka instance with a name containing `test` matching any character case combinations, use the following syntax: ``` name ilike %25test%25 ``` If the parameter isn't provided, or if the value is empty, then all the Kafka instances that the user has permission to see are returned. Note. If the query is invalid, an error is returned.

@return KafkaList

func (*DefaultApiService) RevokeKafkaTLSCertificateBKafkaID

func (a *DefaultApiService) RevokeKafkaTLSCertificateBKafkaID(ctx _context.Context, id string, kafkacertificateRevocationRequest KafkacertificateRevocationRequest) (*_nethttp.Response, error)

RevokeKafkaTLSCertificateBKafkaID Method for RevokeKafkaTLSCertificateBKafkaID Revokes the automatically generated TLS wildcard certificate for the Kafka instance by id

  • @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 kafkacertificateRevocationRequest Kafka certificate revocation request payload.

func (*DefaultApiService) UpdateKafkaById

func (a *DefaultApiService) UpdateKafkaById(ctx _context.Context, id string, kafkaUpdateRequest KafkaUpdateRequest) (Kafka, *_nethttp.Response, error)

UpdateKafkaById Method for UpdateKafkaById Update a Kafka instance by id

  • @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 kafkaUpdateRequest Kafka update data

@return Kafka

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 GetKafkasOpts

type GetKafkasOpts struct {
	Page    optional.String
	Size    optional.String
	OrderBy optional.String
	Search  optional.String
}

GetKafkasOpts Optional parameters for the method 'GetKafkas'

type Kafka

type Kafka struct {
	Id   string `json:"id"`
	Kind string `json:"kind"`
	Href string `json:"href"`
	// Values: [accepted, preparing, provisioning, ready, failed, deprovision, deleting]
	Status string `json:"status,omitempty"`
	// Name of Cloud used to deploy. For example AWS
	CloudProvider string `json:"cloud_provider,omitempty"`
	MultiAz       bool   `json:"multi_az"`
	// Values will be regions of specific cloud provider. For example: us-east-1 for AWS
	Region                 string                           `json:"region,omitempty"`
	Owner                  string                           `json:"owner,omitempty"`
	Name                   string                           `json:"name,omitempty"`
	BootstrapServerHost    string                           `json:"bootstrap_server_host,omitempty"`
	CreatedAt              time.Time                        `json:"created_at,omitempty"`
	UpdatedAt              time.Time                        `json:"updated_at,omitempty"`
	FailedReason           string                           `json:"failed_reason,omitempty"`
	ActualKafkaVersion     string                           `json:"actual_kafka_version,omitempty"`
	ActualStrimziVersion   string                           `json:"actual_strimzi_version,omitempty"`
	DesiredKafkaVersion    string                           `json:"desired_kafka_version,omitempty"`
	DesiredStrimziVersion  string                           `json:"desired_strimzi_version,omitempty"`
	DesiredKafkaIbpVersion string                           `json:"desired_kafka_ibp_version,omitempty"`
	ActualKafkaIbpVersion  string                           `json:"actual_kafka_ibp_version,omitempty"`
	KafkaUpgrading         bool                             `json:"kafka_upgrading"`
	StrimziUpgrading       bool                             `json:"strimzi_upgrading"`
	KafkaIbpUpgrading      bool                             `json:"kafka_ibp_upgrading"`
	OrganisationId         string                           `json:"organisation_id,omitempty"`
	SubscriptionId         string                           `json:"subscription_id,omitempty"`
	OwnerAccountId         string                           `json:"owner_account_id,omitempty"`
	AccountNumber          string                           `json:"account_number,omitempty"`
	InstanceType           string                           `json:"instance_type,omitempty"`
	QuotaType              string                           `json:"quota_type,omitempty"`
	Routes                 []KafkaAllOfRoutes               `json:"routes,omitempty"`
	RoutesCreated          bool                             `json:"routes_created,omitempty"`
	ClusterId              string                           `json:"cluster_id,omitempty"`
	Namespace              string                           `json:"namespace,omitempty"`
	SizeId                 string                           `json:"size_id,omitempty"`
	MaxDataRetentionSize   SupportedKafkaSizeBytesValueItem `json:"max_data_retention_size,omitempty"`
}

Kafka struct for Kafka

type KafkaAllOfRoutes

type KafkaAllOfRoutes struct {
	Domain string `json:"domain,omitempty"`
	Router string `json:"router,omitempty"`
}

KafkaAllOfRoutes struct for KafkaAllOfRoutes

type KafkaList

type KafkaList struct {
	Kind  string  `json:"kind"`
	Page  int32   `json:"page"`
	Size  int32   `json:"size"`
	Total int32   `json:"total"`
	Items []Kafka `json:"items"`
}

KafkaList struct for KafkaList

type KafkaUpdateRequest

type KafkaUpdateRequest struct {
	StrimziVersion  string `json:"strimzi_version,omitempty"`
	KafkaVersion    string `json:"kafka_version,omitempty"`
	KafkaIbpVersion string `json:"kafka_ibp_version,omitempty"`
	// Maximum data storage available to this Kafka
	MaxDataRetentionSize string `json:"max_data_retention_size,omitempty"`
	// boolean value indicating whether kafka should be suspended or not depending on the value provided. Suspended kafkas have their certain resources removed and become inaccessible until fully unsuspended (restored to Ready state).
	Suspended *bool `json:"suspended,omitempty"`
}

KafkaUpdateRequest struct for KafkaUpdateRequest

type KafkacertificateRevocationRequest

type KafkacertificateRevocationRequest struct {
	// The certificate revocation reason. See https://www.rfc-editor.org/rfc/rfc5280#section-5.3.1 for the available reasons
	RevocationReason int32 `json:"revocation_reason,omitempty"`
}

KafkacertificateRevocationRequest struct for KafkacertificateRevocationRequest

type List

type List struct {
	Kind  string `json:"kind"`
	Page  int32  `json:"page"`
	Size  int32  `json:"size"`
	Total int32  `json:"total"`
}

List struct for List

type ObjectReference

type ObjectReference struct {
	Id   string `json:"id"`
	Kind string `json:"kind"`
	Href string `json:"href"`
}

ObjectReference struct for ObjectReference

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 SupportedKafkaSizeBytesValueItem

type SupportedKafkaSizeBytesValueItem struct {
	Bytes int64 `json:"bytes,omitempty"`
}

SupportedKafkaSizeBytesValueItem struct for SupportedKafkaSizeBytesValueItem

Jump to

Keyboard shortcuts

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