alertrules

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package alertrules provides primitives to interact with the openapi HTTP API.

Code generated by github.com/do87/oapi-codegen version v0.5.1 DO NOT EDIT.

Index

Constants

View Source
const (
	BearerAuthScopes = "bearerAuth.Scopes"
)

Variables

This section is empty.

Functions

func NewCreateRequest

func NewCreateRequest(ctx context.Context, server string, projectID string, instanceID string, groupName string, body CreateJSONRequestBody) (*http.Request, error)

NewCreateRequest calls the generic Create builder with application/json body

func NewCreateRequestWithBody

func NewCreateRequestWithBody(ctx context.Context, server string, projectID string, instanceID string, groupName string, contentType string, body io.Reader) (*http.Request, error)

NewCreateRequestWithBody generates requests for Create with any type of body

func NewDeleteRequest

func NewDeleteRequest(ctx context.Context, server string, projectID string, instanceID string, groupName string, params *DeleteParams) (*http.Request, error)

NewDeleteRequest generates requests for Delete

func NewDeleteRulesRequest

func NewDeleteRulesRequest(ctx context.Context, server string, projectID string, instanceID string, groupName string, alertName string) (*http.Request, error)

NewDeleteRulesRequest generates requests for DeleteRules

func NewListRequest

func NewListRequest(ctx context.Context, server string, projectID string, instanceID string, groupName string) (*http.Request, error)

NewListRequest generates requests for List

func NewPartialUpdateRequest

func NewPartialUpdateRequest(ctx context.Context, server string, projectID string, instanceID string, groupName string, body PartialUpdateJSONRequestBody) (*http.Request, error)

NewPartialUpdateRequest calls the generic PartialUpdate builder with application/json body

func NewPartialUpdateRequestWithBody

func NewPartialUpdateRequestWithBody(ctx context.Context, server string, projectID string, instanceID string, groupName string, contentType string, body io.Reader) (*http.Request, error)

NewPartialUpdateRequestWithBody generates requests for PartialUpdate with any type of body

func NewReadRequest

func NewReadRequest(ctx context.Context, server string, projectID string, instanceID string, groupName string, alertName string) (*http.Request, error)

NewReadRequest generates requests for Read

func NewUpdateRequest

func NewUpdateRequest(ctx context.Context, server string, projectID string, instanceID string, groupName string, alertName string, body UpdateJSONRequestBody) (*http.Request, error)

NewUpdateRequest calls the generic Update builder with application/json body

func NewUpdateRequestWithBody

func NewUpdateRequestWithBody(ctx context.Context, server string, projectID string, instanceID string, groupName string, alertName string, contentType string, body io.Reader) (*http.Request, error)

NewUpdateRequestWithBody generates requests for Update with any type of body

Types

type AlertRule

type AlertRule struct {
	Alert       string             `json:"alert"`
	Annotations *map[string]string `json:"annotations,omitempty"`
	Expr        string             `json:"expr"`
	For         *string            `json:"for,omitempty"`
	Labels      *map[string]string `json:"labels,omitempty"`
}

AlertRule defines model for AlertRule.

type AlertRuleResponse

type AlertRuleResponse struct {
	Data    AlertRule `json:"data"`
	Message string    `json:"message"`
}

AlertRuleResponse defines model for AlertRuleResponse.

type AlertRulesResponse

type AlertRulesResponse struct {
	Data    []AlertRule `json:"data"`
	Message string      `json:"message"`
}

AlertRulesResponse defines model for AlertRulesResponse.

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client common.Client
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, httpClient common.Client) *Client

Creates a new Client, with reasonable defaults

func (*Client) Create

func (c *Client) Create(ctx context.Context, projectID string, instanceID string, groupName string, body CreateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) CreateWithBody

func (c *Client) CreateWithBody(ctx context.Context, projectID string, instanceID string, groupName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, projectID string, instanceID string, groupName string, params *DeleteParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) DeleteRules

func (c *Client) DeleteRules(ctx context.Context, projectID string, instanceID string, groupName string, alertName string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) List

func (c *Client) List(ctx context.Context, projectID string, instanceID string, groupName string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PartialUpdate

func (c *Client) PartialUpdate(ctx context.Context, projectID string, instanceID string, groupName string, body PartialUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PartialUpdateWithBody

func (c *Client) PartialUpdateWithBody(ctx context.Context, projectID string, instanceID string, groupName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) Read

func (c *Client) Read(ctx context.Context, projectID string, instanceID string, groupName string, alertName string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) Update

func (c *Client) Update(ctx context.Context, projectID string, instanceID string, groupName string, alertName string, body UpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UpdateWithBody

func (c *Client) UpdateWithBody(ctx context.Context, projectID string, instanceID string, groupName string, alertName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// Delete request
	Delete(ctx context.Context, projectID string, instanceID string, groupName string, params *DeleteParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// List request
	List(ctx context.Context, projectID string, instanceID string, groupName string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PartialUpdate request with any body
	PartialUpdateWithBody(ctx context.Context, projectID string, instanceID string, groupName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	PartialUpdate(ctx context.Context, projectID string, instanceID string, groupName string, body PartialUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Create request with any body
	CreateWithBody(ctx context.Context, projectID string, instanceID string, groupName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	Create(ctx context.Context, projectID string, instanceID string, groupName string, body CreateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteRules request
	DeleteRules(ctx context.Context, projectID string, instanceID string, groupName string, alertName string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Read request
	Read(ctx context.Context, projectID string, instanceID string, groupName string, alertName string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Update request with any body
	UpdateWithBody(ctx context.Context, projectID string, instanceID string, groupName string, alertName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	Update(ctx context.Context, projectID string, instanceID string, groupName string, alertName string, body UpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, httpClient common.Client) *ClientWithResponses

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) CreateWithBodyWithResponse

func (c *ClientWithResponses) CreateWithBodyWithResponse(ctx context.Context, projectID string, instanceID string, groupName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateResponse, error)

CreateWithBodyWithResponse request with arbitrary body returning *CreateResponse

func (*ClientWithResponses) CreateWithResponse

func (c *ClientWithResponses) CreateWithResponse(ctx context.Context, projectID string, instanceID string, groupName string, body CreateJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateResponse, error)

func (*ClientWithResponses) DeleteRulesWithResponse

func (c *ClientWithResponses) DeleteRulesWithResponse(ctx context.Context, projectID string, instanceID string, groupName string, alertName string, reqEditors ...RequestEditorFn) (*DeleteRulesResponse, error)

DeleteRulesWithResponse request returning *DeleteRulesResponse

func (*ClientWithResponses) DeleteWithResponse

func (c *ClientWithResponses) DeleteWithResponse(ctx context.Context, projectID string, instanceID string, groupName string, params *DeleteParams, reqEditors ...RequestEditorFn) (*DeleteResponse, error)

DeleteWithResponse request returning *DeleteResponse

func (*ClientWithResponses) ListWithResponse

func (c *ClientWithResponses) ListWithResponse(ctx context.Context, projectID string, instanceID string, groupName string, reqEditors ...RequestEditorFn) (*ListResponse, error)

ListWithResponse request returning *ListResponse

func (*ClientWithResponses) ParseCreateResponse

func (c *ClientWithResponses) ParseCreateResponse(rsp *http.Response) (*CreateResponse, error)

ParseCreateResponse parses an HTTP response from a CreateWithResponse call

func (*ClientWithResponses) ParseDeleteResponse

func (c *ClientWithResponses) ParseDeleteResponse(rsp *http.Response) (*DeleteResponse, error)

ParseDeleteResponse parses an HTTP response from a DeleteWithResponse call

func (*ClientWithResponses) ParseDeleteRulesResponse

func (c *ClientWithResponses) ParseDeleteRulesResponse(rsp *http.Response) (*DeleteRulesResponse, error)

ParseDeleteRulesResponse parses an HTTP response from a DeleteRulesWithResponse call

func (*ClientWithResponses) ParseListResponse

func (c *ClientWithResponses) ParseListResponse(rsp *http.Response) (*ListResponse, error)

ParseListResponse parses an HTTP response from a ListWithResponse call

func (*ClientWithResponses) ParsePartialUpdateResponse

func (c *ClientWithResponses) ParsePartialUpdateResponse(rsp *http.Response) (*PartialUpdateResponse, error)

ParsePartialUpdateResponse parses an HTTP response from a PartialUpdateWithResponse call

func (*ClientWithResponses) ParseReadResponse

func (c *ClientWithResponses) ParseReadResponse(rsp *http.Response) (*ReadResponse, error)

ParseReadResponse parses an HTTP response from a ReadWithResponse call

func (*ClientWithResponses) ParseUpdateResponse

func (c *ClientWithResponses) ParseUpdateResponse(rsp *http.Response) (*UpdateResponse, error)

ParseUpdateResponse parses an HTTP response from a UpdateWithResponse call

func (*ClientWithResponses) PartialUpdateWithBodyWithResponse

func (c *ClientWithResponses) PartialUpdateWithBodyWithResponse(ctx context.Context, projectID string, instanceID string, groupName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PartialUpdateResponse, error)

PartialUpdateWithBodyWithResponse request with arbitrary body returning *PartialUpdateResponse

func (*ClientWithResponses) PartialUpdateWithResponse

func (c *ClientWithResponses) PartialUpdateWithResponse(ctx context.Context, projectID string, instanceID string, groupName string, body PartialUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*PartialUpdateResponse, error)

func (*ClientWithResponses) ReadWithResponse

func (c *ClientWithResponses) ReadWithResponse(ctx context.Context, projectID string, instanceID string, groupName string, alertName string, reqEditors ...RequestEditorFn) (*ReadResponse, error)

ReadWithResponse request returning *ReadResponse

func (*ClientWithResponses) UpdateWithBodyWithResponse

func (c *ClientWithResponses) UpdateWithBodyWithResponse(ctx context.Context, projectID string, instanceID string, groupName string, alertName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateResponse, error)

UpdateWithBodyWithResponse request with arbitrary body returning *UpdateResponse

func (*ClientWithResponses) UpdateWithResponse

func (c *ClientWithResponses) UpdateWithResponse(ctx context.Context, projectID string, instanceID string, groupName string, alertName string, body UpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// Delete request
	DeleteWithResponse(ctx context.Context, projectID string, instanceID string, groupName string, params *DeleteParams, reqEditors ...RequestEditorFn) (*DeleteResponse, error)

	// List request
	ListWithResponse(ctx context.Context, projectID string, instanceID string, groupName string, reqEditors ...RequestEditorFn) (*ListResponse, error)

	// PartialUpdate request with any body
	PartialUpdateWithBodyWithResponse(ctx context.Context, projectID string, instanceID string, groupName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PartialUpdateResponse, error)

	PartialUpdateWithResponse(ctx context.Context, projectID string, instanceID string, groupName string, body PartialUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*PartialUpdateResponse, error)

	// Create request with any body
	CreateWithBodyWithResponse(ctx context.Context, projectID string, instanceID string, groupName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateResponse, error)

	CreateWithResponse(ctx context.Context, projectID string, instanceID string, groupName string, body CreateJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateResponse, error)

	// DeleteRules request
	DeleteRulesWithResponse(ctx context.Context, projectID string, instanceID string, groupName string, alertName string, reqEditors ...RequestEditorFn) (*DeleteRulesResponse, error)

	// Read request
	ReadWithResponse(ctx context.Context, projectID string, instanceID string, groupName string, alertName string, reqEditors ...RequestEditorFn) (*ReadResponse, error)

	// Update request with any body
	UpdateWithBodyWithResponse(ctx context.Context, projectID string, instanceID string, groupName string, alertName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateResponse, error)

	UpdateWithResponse(ctx context.Context, projectID string, instanceID string, groupName string, alertName string, body UpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type CreateJSONBody

type CreateJSONBody struct {
	// Alert The name of the alert.
	// `Additional Validators:`
	// * is the identifier and so unique in the group
	// * should only include the characters: a-zA-Z0-9-
	Alert string `json:"alert"`

	// Annotations map of key:value. Annotations to add to each alert.
	// `Additional Validators:`
	// * should not contain more than 5 keys
	// * each key and value should not be longer than 200 characters
	Annotations *map[string]interface{} `json:"annotations,omitempty"`

	// Expr The PromQL expression to evaluate. Every evaluation cycle this is evaluated at the current time, and all resultant time series become pending/firing alerts.
	Expr string `json:"expr"`

	// For Alerts are considered firing once they have been returned for this long. Alerts which have not yet fired for long enough are considered pending.
	// `Additional Validators:`
	// * must be a valid time string
	For *string `json:"for,omitempty"`

	// Labels map of key:value. Labels to add or overwrite for each alert.
	// `Additional Validators:`
	// * should not contain more than 10 keys
	// * each key and value should not be longer than 200 characters
	Labels *map[string]interface{} `json:"labels,omitempty"`
}

CreateJSONBody defines parameters for Create.

type CreateJSONRequestBody

type CreateJSONRequestBody CreateJSONBody

CreateJSONRequestBody defines body for Create for application/json ContentType.

type CreateResponse

type CreateResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON202      *AlertRulesResponse
	JSON400      *Error
	JSON403      *PermissionDenied
	HasError     error // Aggregated error
}

func (CreateResponse) Status

func (r CreateResponse) Status() string

Status returns HTTPResponse.Status

func (CreateResponse) StatusCode

func (r CreateResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteParams

type DeleteParams struct {
	// AlertName Name of the alert rules that should be deleted
	AlertName []string `form:"alertName" json:"alertName"`
}

DeleteParams defines parameters for Delete.

type DeleteResponse

type DeleteResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON202      *AlertRulesResponse
	JSON403      *PermissionDenied
	HasError     error // Aggregated error
}

func (DeleteResponse) Status

func (r DeleteResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteResponse) StatusCode

func (r DeleteResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteRulesResponse

type DeleteRulesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON202      *AlertRulesResponse
	JSON400      *Error
	JSON403      *PermissionDenied
	JSON404      *Message
	HasError     error // Aggregated error
}

func (DeleteRulesResponse) Status

func (r DeleteRulesResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteRulesResponse) StatusCode

func (r DeleteRulesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Error

type Error struct {
	Errors  *[]map[string]string `json:"errors,omitempty"`
	Message string               `json:"message"`
}

Error defines model for Error.

type ListResponse

type ListResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *AlertRulesResponse
	JSON403      *PermissionDenied
	HasError     error // Aggregated error
}

func (ListResponse) Status

func (r ListResponse) Status() string

Status returns HTTPResponse.Status

func (ListResponse) StatusCode

func (r ListResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Message

type Message struct {
	Message string `json:"message"`
}

Message defines model for Message.

type PartialUpdateJSONBody

type PartialUpdateJSONBody = []struct {
	// Alert The name of the alert.
	// `Additional Validators:`
	// * is the identifier and so unique in the group
	// * should only include the characters: a-zA-Z0-9-
	Alert string `json:"alert"`

	// Annotations map of key:value. Annotations to add to each alert.
	// `Additional Validators:`
	// * should not contain more than 5 keys
	// * each key and value should not be longer than 200 characters
	Annotations *map[string]interface{} `json:"annotations,omitempty"`

	// Expr The PromQL expression to evaluate. Every evaluation cycle this is evaluated at the current time, and all resultant time series become pending/firing alerts.
	Expr string `json:"expr"`

	// For Alerts are considered firing once they have been returned for this long. Alerts which have not yet fired for long enough are considered pending.
	// `Additional Validators:`
	// * must be a valid time string
	For *string `json:"for,omitempty"`

	// Labels map of key:value. Labels to add or overwrite for each alert.
	// `Additional Validators:`
	// * should not contain more than 10 keys
	// * each key and value should not be longer than 200 characters
	Labels *map[string]interface{} `json:"labels,omitempty"`
}

PartialUpdateJSONBody defines parameters for PartialUpdate.

type PartialUpdateJSONRequestBody

type PartialUpdateJSONRequestBody = PartialUpdateJSONBody

PartialUpdateJSONRequestBody defines body for PartialUpdate for application/json ContentType.

type PartialUpdateResponse

type PartialUpdateResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON202      *AlertRulesResponse
	JSON400      *Error
	JSON403      *PermissionDenied
	HasError     error // Aggregated error
}

func (PartialUpdateResponse) Status

func (r PartialUpdateResponse) Status() string

Status returns HTTPResponse.Status

func (PartialUpdateResponse) StatusCode

func (r PartialUpdateResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PermissionDenied

type PermissionDenied struct {
	Detail string `json:"detail"`
}

PermissionDenied defines model for PermissionDenied.

type ReadResponse

type ReadResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *AlertRuleResponse
	JSON403      *PermissionDenied
	JSON404      *Message
	HasError     error // Aggregated error
}

func (ReadResponse) Status

func (r ReadResponse) Status() string

Status returns HTTPResponse.Status

func (ReadResponse) StatusCode

func (r ReadResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type UpdateJSONBody

type UpdateJSONBody struct {
	// Annotations map of key:value. Annotations to add to each alert.
	// `Additional Validators:`
	// * should not contain more than 5 keys
	// * each key and value should not be longer than 200 characters
	Annotations *map[string]interface{} `json:"annotations,omitempty"`

	// Expr The PromQL expression to evaluate. Every evaluation cycle this is evaluated at the current time, and all resultant time series become pending/firing alerts.
	Expr string `json:"expr"`

	// For Alerts are considered firing once they have been returned for this long. Alerts which have not yet fired for long enough are considered pending.
	// `Additional Validators:`
	// * must be a valid time string
	For *string `json:"for,omitempty"`

	// Labels map of key:value. Labels to add or overwrite for each alert.
	// `Additional Validators:`
	// * should not contain more than 5 keys
	// * each key and value should not be longer than 200 characters
	Labels *map[string]interface{} `json:"labels,omitempty"`
}

UpdateJSONBody defines parameters for Update.

type UpdateJSONRequestBody

type UpdateJSONRequestBody UpdateJSONBody

UpdateJSONRequestBody defines body for Update for application/json ContentType.

type UpdateResponse

type UpdateResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON202      *AlertRulesResponse
	JSON400      *Error
	JSON403      *PermissionDenied
	JSON404      *Message
	HasError     error // Aggregated error
}

func (UpdateResponse) Status

func (r UpdateResponse) Status() string

Status returns HTTPResponse.Status

func (UpdateResponse) StatusCode

func (r UpdateResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

Jump to

Keyboard shortcuts

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