Client for alert API
type Client struct {
// contains filtered or unexported fields
}
func (a *Client) GetAlerts(params *GetAlertsParams, opts ...ClientOption) (*GetAlertsOK, error)
GetAlerts Get a list of alerts
func (a *Client) PostAlerts(params *PostAlertsParams, opts ...ClientOption) (*PostAlertsOK, error)
PostAlerts Create new Alerts
func (a *Client) SetTransport(transport runtime.ClientTransport)
SetTransport changes the transport on the client
ClientOption is the option for Client methods
type ClientOption func(*runtime.ClientOperation)
ClientService is the interface for Client methods
type ClientService interface { GetAlerts(params *GetAlertsParams, opts ...ClientOption) (*GetAlertsOK, error) PostAlerts(params *PostAlertsParams, opts ...ClientOption) (*PostAlertsOK, error) SetTransport(transport runtime.ClientTransport) }
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService
New creates a new alert API client.
GetAlertsBadRequest describes a response with status code 400, with default header values.
Bad request
type GetAlertsBadRequest struct { Payload string }
func NewGetAlertsBadRequest() *GetAlertsBadRequest
NewGetAlertsBadRequest creates a GetAlertsBadRequest with default headers values
func (o *GetAlertsBadRequest) Error() string
func (o *GetAlertsBadRequest) GetPayload() string
func (o *GetAlertsBadRequest) IsClientError() bool
IsClientError returns true when this get alerts bad request response has a 4xx status code
func (o *GetAlertsBadRequest) IsCode(code int) bool
IsCode returns true when this get alerts bad request response a status code equal to that given
func (o *GetAlertsBadRequest) IsRedirect() bool
IsRedirect returns true when this get alerts bad request response has a 3xx status code
func (o *GetAlertsBadRequest) IsServerError() bool
IsServerError returns true when this get alerts bad request response has a 5xx status code
func (o *GetAlertsBadRequest) IsSuccess() bool
IsSuccess returns true when this get alerts bad request response has a 2xx status code
func (o *GetAlertsBadRequest) String() string
GetAlertsInternalServerError describes a response with status code 500, with default header values.
Internal server error
type GetAlertsInternalServerError struct { Payload string }
func NewGetAlertsInternalServerError() *GetAlertsInternalServerError
NewGetAlertsInternalServerError creates a GetAlertsInternalServerError with default headers values
func (o *GetAlertsInternalServerError) Error() string
func (o *GetAlertsInternalServerError) GetPayload() string
func (o *GetAlertsInternalServerError) IsClientError() bool
IsClientError returns true when this get alerts internal server error response has a 4xx status code
func (o *GetAlertsInternalServerError) IsCode(code int) bool
IsCode returns true when this get alerts internal server error response a status code equal to that given
func (o *GetAlertsInternalServerError) IsRedirect() bool
IsRedirect returns true when this get alerts internal server error response has a 3xx status code
func (o *GetAlertsInternalServerError) IsServerError() bool
IsServerError returns true when this get alerts internal server error response has a 5xx status code
func (o *GetAlertsInternalServerError) IsSuccess() bool
IsSuccess returns true when this get alerts internal server error response has a 2xx status code
func (o *GetAlertsInternalServerError) String() string
GetAlertsOK describes a response with status code 200, with default header values.
Get alerts response
type GetAlertsOK struct { Payload models.GettableAlerts }
func NewGetAlertsOK() *GetAlertsOK
NewGetAlertsOK creates a GetAlertsOK with default headers values
func (o *GetAlertsOK) Error() string
func (o *GetAlertsOK) GetPayload() models.GettableAlerts
func (o *GetAlertsOK) IsClientError() bool
IsClientError returns true when this get alerts o k response has a 4xx status code
func (o *GetAlertsOK) IsCode(code int) bool
IsCode returns true when this get alerts o k response a status code equal to that given
func (o *GetAlertsOK) IsRedirect() bool
IsRedirect returns true when this get alerts o k response has a 3xx status code
func (o *GetAlertsOK) IsServerError() bool
IsServerError returns true when this get alerts o k response has a 5xx status code
func (o *GetAlertsOK) IsSuccess() bool
IsSuccess returns true when this get alerts o k response has a 2xx status code
func (o *GetAlertsOK) String() string
GetAlertsParams contains all the parameters to send to the API endpoint
for the get alerts operation. Typically these are written to a http.Request.
type GetAlertsParams struct { /* Active. Show active alerts Default: true */ Active *bool /* Filter. A list of matchers to filter alerts by */ Filter []string /* Inhibited. Show inhibited alerts Default: true */ Inhibited *bool /* Receiver. A regex matching receivers to filter alerts by */ Receiver *string /* Silenced. Show silenced alerts Default: true */ Silenced *bool /* Unprocessed. Show unprocessed alerts Default: true */ Unprocessed *bool Context context.Context HTTPClient *http.Client // contains filtered or unexported fields }
func NewGetAlertsParams() *GetAlertsParams
NewGetAlertsParams creates a new GetAlertsParams 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 NewGetAlertsParamsWithContext(ctx context.Context) *GetAlertsParams
NewGetAlertsParamsWithContext creates a new GetAlertsParams object with the ability to set a context for a request.
func NewGetAlertsParamsWithHTTPClient(client *http.Client) *GetAlertsParams
NewGetAlertsParamsWithHTTPClient creates a new GetAlertsParams object with the ability to set a custom HTTPClient for a request.
func NewGetAlertsParamsWithTimeout(timeout time.Duration) *GetAlertsParams
NewGetAlertsParamsWithTimeout creates a new GetAlertsParams object with the ability to set a timeout on a request.
func (o *GetAlertsParams) SetActive(active *bool)
SetActive adds the active to the get alerts params
func (o *GetAlertsParams) SetContext(ctx context.Context)
SetContext adds the context to the get alerts params
func (o *GetAlertsParams) SetDefaults()
SetDefaults hydrates default values in the get alerts params (not the query body).
All values with no default are reset to their zero value.
func (o *GetAlertsParams) SetFilter(filter []string)
SetFilter adds the filter to the get alerts params
func (o *GetAlertsParams) SetHTTPClient(client *http.Client)
SetHTTPClient adds the HTTPClient to the get alerts params
func (o *GetAlertsParams) SetInhibited(inhibited *bool)
SetInhibited adds the inhibited to the get alerts params
func (o *GetAlertsParams) SetReceiver(receiver *string)
SetReceiver adds the receiver to the get alerts params
func (o *GetAlertsParams) SetSilenced(silenced *bool)
SetSilenced adds the silenced to the get alerts params
func (o *GetAlertsParams) SetTimeout(timeout time.Duration)
SetTimeout adds the timeout to the get alerts params
func (o *GetAlertsParams) SetUnprocessed(unprocessed *bool)
SetUnprocessed adds the unprocessed to the get alerts params
func (o *GetAlertsParams) WithActive(active *bool) *GetAlertsParams
WithActive adds the active to the get alerts params
func (o *GetAlertsParams) WithContext(ctx context.Context) *GetAlertsParams
WithContext adds the context to the get alerts params
func (o *GetAlertsParams) WithDefaults() *GetAlertsParams
WithDefaults hydrates default values in the get alerts params (not the query body).
All values with no default are reset to their zero value.
func (o *GetAlertsParams) WithFilter(filter []string) *GetAlertsParams
WithFilter adds the filter to the get alerts params
func (o *GetAlertsParams) WithHTTPClient(client *http.Client) *GetAlertsParams
WithHTTPClient adds the HTTPClient to the get alerts params
func (o *GetAlertsParams) WithInhibited(inhibited *bool) *GetAlertsParams
WithInhibited adds the inhibited to the get alerts params
func (o *GetAlertsParams) WithReceiver(receiver *string) *GetAlertsParams
WithReceiver adds the receiver to the get alerts params
func (o *GetAlertsParams) WithSilenced(silenced *bool) *GetAlertsParams
WithSilenced adds the silenced to the get alerts params
func (o *GetAlertsParams) WithTimeout(timeout time.Duration) *GetAlertsParams
WithTimeout adds the timeout to the get alerts params
func (o *GetAlertsParams) WithUnprocessed(unprocessed *bool) *GetAlertsParams
WithUnprocessed adds the unprocessed to the get alerts params
func (o *GetAlertsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error
WriteToRequest writes these params to a swagger request
GetAlertsReader is a Reader for the GetAlerts structure.
type GetAlertsReader struct {
// contains filtered or unexported fields
}
func (o *GetAlertsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error)
ReadResponse reads a server response into the received o.
PostAlertsBadRequest describes a response with status code 400, with default header values.
Bad request
type PostAlertsBadRequest struct { Payload string }
func NewPostAlertsBadRequest() *PostAlertsBadRequest
NewPostAlertsBadRequest creates a PostAlertsBadRequest with default headers values
func (o *PostAlertsBadRequest) Error() string
func (o *PostAlertsBadRequest) GetPayload() string
func (o *PostAlertsBadRequest) IsClientError() bool
IsClientError returns true when this post alerts bad request response has a 4xx status code
func (o *PostAlertsBadRequest) IsCode(code int) bool
IsCode returns true when this post alerts bad request response a status code equal to that given
func (o *PostAlertsBadRequest) IsRedirect() bool
IsRedirect returns true when this post alerts bad request response has a 3xx status code
func (o *PostAlertsBadRequest) IsServerError() bool
IsServerError returns true when this post alerts bad request response has a 5xx status code
func (o *PostAlertsBadRequest) IsSuccess() bool
IsSuccess returns true when this post alerts bad request response has a 2xx status code
func (o *PostAlertsBadRequest) String() string
PostAlertsInternalServerError describes a response with status code 500, with default header values.
Internal server error
type PostAlertsInternalServerError struct { Payload string }
func NewPostAlertsInternalServerError() *PostAlertsInternalServerError
NewPostAlertsInternalServerError creates a PostAlertsInternalServerError with default headers values
func (o *PostAlertsInternalServerError) Error() string
func (o *PostAlertsInternalServerError) GetPayload() string
func (o *PostAlertsInternalServerError) IsClientError() bool
IsClientError returns true when this post alerts internal server error response has a 4xx status code
func (o *PostAlertsInternalServerError) IsCode(code int) bool
IsCode returns true when this post alerts internal server error response a status code equal to that given
func (o *PostAlertsInternalServerError) IsRedirect() bool
IsRedirect returns true when this post alerts internal server error response has a 3xx status code
func (o *PostAlertsInternalServerError) IsServerError() bool
IsServerError returns true when this post alerts internal server error response has a 5xx status code
func (o *PostAlertsInternalServerError) IsSuccess() bool
IsSuccess returns true when this post alerts internal server error response has a 2xx status code
func (o *PostAlertsInternalServerError) String() string
PostAlertsOK describes a response with status code 200, with default header values.
Create alerts response
type PostAlertsOK struct { }
func NewPostAlertsOK() *PostAlertsOK
NewPostAlertsOK creates a PostAlertsOK with default headers values
func (o *PostAlertsOK) Error() string
func (o *PostAlertsOK) IsClientError() bool
IsClientError returns true when this post alerts o k response has a 4xx status code
func (o *PostAlertsOK) IsCode(code int) bool
IsCode returns true when this post alerts o k response a status code equal to that given
func (o *PostAlertsOK) IsRedirect() bool
IsRedirect returns true when this post alerts o k response has a 3xx status code
func (o *PostAlertsOK) IsServerError() bool
IsServerError returns true when this post alerts o k response has a 5xx status code
func (o *PostAlertsOK) IsSuccess() bool
IsSuccess returns true when this post alerts o k response has a 2xx status code
func (o *PostAlertsOK) String() string
PostAlertsParams contains all the parameters to send to the API endpoint
for the post alerts operation. Typically these are written to a http.Request.
type PostAlertsParams struct { /* Alerts. The alerts to create */ Alerts models.PostableAlerts Context context.Context HTTPClient *http.Client // contains filtered or unexported fields }
func NewPostAlertsParams() *PostAlertsParams
NewPostAlertsParams creates a new PostAlertsParams 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 NewPostAlertsParamsWithContext(ctx context.Context) *PostAlertsParams
NewPostAlertsParamsWithContext creates a new PostAlertsParams object with the ability to set a context for a request.
func NewPostAlertsParamsWithHTTPClient(client *http.Client) *PostAlertsParams
NewPostAlertsParamsWithHTTPClient creates a new PostAlertsParams object with the ability to set a custom HTTPClient for a request.
func NewPostAlertsParamsWithTimeout(timeout time.Duration) *PostAlertsParams
NewPostAlertsParamsWithTimeout creates a new PostAlertsParams object with the ability to set a timeout on a request.
func (o *PostAlertsParams) SetAlerts(alerts models.PostableAlerts)
SetAlerts adds the alerts to the post alerts params
func (o *PostAlertsParams) SetContext(ctx context.Context)
SetContext adds the context to the post alerts params
func (o *PostAlertsParams) SetDefaults()
SetDefaults hydrates default values in the post alerts params (not the query body).
All values with no default are reset to their zero value.
func (o *PostAlertsParams) SetHTTPClient(client *http.Client)
SetHTTPClient adds the HTTPClient to the post alerts params
func (o *PostAlertsParams) SetTimeout(timeout time.Duration)
SetTimeout adds the timeout to the post alerts params
func (o *PostAlertsParams) WithAlerts(alerts models.PostableAlerts) *PostAlertsParams
WithAlerts adds the alerts to the post alerts params
func (o *PostAlertsParams) WithContext(ctx context.Context) *PostAlertsParams
WithContext adds the context to the post alerts params
func (o *PostAlertsParams) WithDefaults() *PostAlertsParams
WithDefaults hydrates default values in the post alerts params (not the query body).
All values with no default are reset to their zero value.
func (o *PostAlertsParams) WithHTTPClient(client *http.Client) *PostAlertsParams
WithHTTPClient adds the HTTPClient to the post alerts params
func (o *PostAlertsParams) WithTimeout(timeout time.Duration) *PostAlertsParams
WithTimeout adds the timeout to the post alerts params
func (o *PostAlertsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error
WriteToRequest writes these params to a swagger request
PostAlertsReader is a Reader for the PostAlerts structure.
type PostAlertsReader struct {
// contains filtered or unexported fields
}
func (o *PostAlertsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error)
ReadResponse reads a server response into the received o.