metrics

package
v1.20.2 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client for metrics API.

func (*Client) GetMetrics

func (a *Client) GetMetrics(params *GetMetricsParams, opts ...ClientOption) (*GetMetricsOK, error)

GetMetricsretrieves cilium operator metrics.

Returns the metrics exposed by the Cilium operator..

This method does not support injected context. However, timeout and opentracing contexts are honored whenever enabled.

If you need to pass a specific context, use Client.GetMetricsContext instead.

func (*Client) GetMetricsContext added in v1.20.0

func (a *Client) GetMetricsContext(ctx context.Context, params *GetMetricsParams, opts ...ClientOption) (*GetMetricsOK, error)

GetMetricsContextretrieves cilium operator metrics.

Returns the metrics exposed by the Cilium operator..

Do not use the deprecated [GetMetricsParams.Context] with this method: it would be ignored.

func (*Client) SetTransport

func (a *Client) SetTransport(transport runtime.ContextualTransport)

SetTransport changes the transport on the client

type ClientOption

type ClientOption func(*runtime.ClientOperation)

ClientOption may be used to customize the behavior of Client methods.

type ClientService

type ClientService interface {

	// GetMetrics retrieve cilium operator metrics.
	GetMetrics(params *GetMetricsParams, opts ...ClientOption) (*GetMetricsOK, error)

	// GetMetricsContext retrieve cilium operator metrics.
	GetMetricsContext(ctx context.Context, params *GetMetricsParams, opts ...ClientOption) (*GetMetricsOK, error)

	SetTransport(transport runtime.ContextualTransport)
}

ClientService is the interface for Client methods.

func New

New creates a new metrics API client.

func NewClientWithBasicAuth added in v1.16.5

func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService

New creates a new metrics API client with basic auth credentials.

It takes the following parameters: - host: http host (github.com). - basePath: any base path for the API client ("/v1", "/v3"). - scheme: http scheme ("http", "https"). - user: user for basic authentication header. - password: password for basic authentication header.

func NewClientWithBearerToken added in v1.16.5

func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService

New creates a new metrics API client with a bearer token for authentication.

It takes the following parameters: - host: http host (github.com). - basePath: any base path for the API client ("/v1", "/v3"). - scheme: http scheme ("http", "https"). - bearerToken: bearer token for Bearer authentication header.

type GetMetricsFailed

type GetMetricsFailed struct {
}

GetMetricsFailed describes a response with status code 500, with default header values.

Metrics cannot be retrieved

func NewGetMetricsFailed

func NewGetMetricsFailed() *GetMetricsFailed

NewGetMetricsFailed creates a GetMetricsFailed with default headers values

func (*GetMetricsFailed) Code added in v1.16.0

func (o *GetMetricsFailed) Code() int

Code gets the status code for the get metrics failed response

func (*GetMetricsFailed) Error

func (o *GetMetricsFailed) Error() string

func (*GetMetricsFailed) IsClientError

func (o *GetMetricsFailed) IsClientError() bool

IsClientError returns true when this get metrics failed response has a 4xx status code

func (*GetMetricsFailed) IsCode

func (o *GetMetricsFailed) IsCode(code int) bool

IsCode returns true when this get metrics failed response a status code equal to that given

func (*GetMetricsFailed) IsRedirect

func (o *GetMetricsFailed) IsRedirect() bool

IsRedirect returns true when this get metrics failed response has a 3xx status code

func (*GetMetricsFailed) IsServerError

func (o *GetMetricsFailed) IsServerError() bool

IsServerError returns true when this get metrics failed response has a 5xx status code

func (*GetMetricsFailed) IsSuccess

func (o *GetMetricsFailed) IsSuccess() bool

IsSuccess returns true when this get metrics failed response has a 2xx status code

func (*GetMetricsFailed) String

func (o *GetMetricsFailed) String() string

type GetMetricsOK

type GetMetricsOK struct {
	Payload []*models.Metric
}

GetMetricsOK describes a response with status code 200, with default header values.

Success

func NewGetMetricsOK

func NewGetMetricsOK() *GetMetricsOK

NewGetMetricsOK creates a GetMetricsOK with default headers values

func (*GetMetricsOK) Code added in v1.16.0

func (o *GetMetricsOK) Code() int

Code gets the status code for the get metrics o k response

func (*GetMetricsOK) Error

func (o *GetMetricsOK) Error() string

func (*GetMetricsOK) GetPayload

func (o *GetMetricsOK) GetPayload() []*models.Metric

func (*GetMetricsOK) IsClientError

func (o *GetMetricsOK) IsClientError() bool

IsClientError returns true when this get metrics o k response has a 4xx status code

func (*GetMetricsOK) IsCode

func (o *GetMetricsOK) IsCode(code int) bool

IsCode returns true when this get metrics o k response a status code equal to that given

func (*GetMetricsOK) IsRedirect

func (o *GetMetricsOK) IsRedirect() bool

IsRedirect returns true when this get metrics o k response has a 3xx status code

func (*GetMetricsOK) IsServerError

func (o *GetMetricsOK) IsServerError() bool

IsServerError returns true when this get metrics o k response has a 5xx status code

func (*GetMetricsOK) IsSuccess

func (o *GetMetricsOK) IsSuccess() bool

IsSuccess returns true when this get metrics o k response has a 2xx status code

func (*GetMetricsOK) String

func (o *GetMetricsOK) String() string

type GetMetricsParams

type GetMetricsParams struct {
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

GetMetricsParams contains all the parameters to send to the API endpoint

for the get metrics operation.

Typically these are written to a http.Request.

func NewGetMetricsParams

func NewGetMetricsParams() *GetMetricsParams

NewGetMetricsParams creates a new GetMetricsParams object, with the default timeout for this client.

Default values are not hydrated, since defaults are normally applied by the API server side.

To enforce default values in parameter, use SetDefaults or WithDefaults.

func NewGetMetricsParamsWithContext deprecated

func NewGetMetricsParamsWithContext(ctx context.Context) *GetMetricsParams

NewGetMetricsParamsWithContext creates a new GetMetricsParams object with the ability to set a context for a request.

Deprecated: use the operation call with context to pass the context instead of GetMetricsParams.

func NewGetMetricsParamsWithHTTPClient

func NewGetMetricsParamsWithHTTPClient(client *http.Client) *GetMetricsParams

NewGetMetricsParamsWithHTTPClient creates a new GetMetricsParams object with the ability to set a custom HTTPClient for a request.

func NewGetMetricsParamsWithTimeout

func NewGetMetricsParamsWithTimeout(timeout time.Duration) *GetMetricsParams

NewGetMetricsParamsWithTimeout creates a new GetMetricsParams object with the ability to set a timeout on a request.

func (*GetMetricsParams) SetContext deprecated

func (o *GetMetricsParams) SetContext(ctx context.Context)

SetContext adds the context to the get metrics params.

Deprecated: use the operation call with context to pass the context instead of GetMetricsParams.

func (*GetMetricsParams) SetDefaults

func (o *GetMetricsParams) SetDefaults()

SetDefaults hydrates default values in the get metrics params (not the query body).

All values with no default are reset to their zero value.

func (*GetMetricsParams) SetHTTPClient

func (o *GetMetricsParams) SetHTTPClient(client *http.Client)

SetHTTPClient adds the HTTPClient to the get metrics params.

func (*GetMetricsParams) SetTimeout

func (o *GetMetricsParams) SetTimeout(timeout time.Duration)

SetTimeout adds the timeout to the get metrics params.

func (*GetMetricsParams) WithContext deprecated

func (o *GetMetricsParams) WithContext(ctx context.Context) *GetMetricsParams

WithContext adds the context to the get metrics params.

Deprecated: use the operation call with context to pass the context instead of GetMetricsParams.

func (*GetMetricsParams) WithDefaults

func (o *GetMetricsParams) WithDefaults() *GetMetricsParams

WithDefaults hydrates default values in the get metrics params (not the query body).

All values with no default are reset to their zero value.

func (*GetMetricsParams) WithHTTPClient

func (o *GetMetricsParams) WithHTTPClient(client *http.Client) *GetMetricsParams

WithHTTPClient adds the HTTPClient to the get metrics params.

func (*GetMetricsParams) WithTimeout

func (o *GetMetricsParams) WithTimeout(timeout time.Duration) *GetMetricsParams

WithTimeout adds the timeout to the get metrics params.

func (*GetMetricsParams) WriteToRequest

func (o *GetMetricsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error

WriteToRequest writes these params to a runtime.ClientRequest.

type GetMetricsReader

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

GetMetricsReader is a Reader for the GetMetrics structure.

func (*GetMetricsReader) ReadResponse

func (o *GetMetricsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error)

ReadResponse reads a server response into the received o.

Jump to

Keyboard shortcuts

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