backup

package
v1.17.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package backup 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, params *CreateParams) (*http.Request, error)

NewCreateRequest generates requests for Create

func NewListRequest

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

NewListRequest generates requests for List

func NewRestoresCreateRequest

func NewRestoresCreateRequest(ctx context.Context, server string, projectID string, instanceID string, backupDate string, params *RestoresCreateParams) (*http.Request, error)

NewRestoresCreateRequest generates requests for RestoresCreate

func NewRetentionsListRequest

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

NewRetentionsListRequest generates requests for RetentionsList

func NewSchedulesCreateRequest

func NewSchedulesCreateRequest(ctx context.Context, server string, projectID string, instanceID string, params *SchedulesCreateParams, body SchedulesCreateJSONRequestBody) (*http.Request, error)

NewSchedulesCreateRequest calls the generic SchedulesCreate builder with application/json body

func NewSchedulesCreateRequestWithBody

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

NewSchedulesCreateRequestWithBody generates requests for SchedulesCreate with any type of body

func NewSchedulesListRequest

func NewSchedulesListRequest(ctx context.Context, server string, projectID string, instanceID string, params *SchedulesListParams) (*http.Request, error)

NewSchedulesListRequest generates requests for SchedulesList

Types

type BackupResponse

type BackupResponse struct {
	AlertConfigBackups  []string `json:"alertConfigBackups"`
	AlertRulesBackups   []string `json:"alertRulesBackups"`
	GrafanaBackups      []string `json:"grafanaBackups"`
	Message             string   `json:"message"`
	ScrapeConfigBackups []string `json:"scrapeConfigBackups"`
}

BackupResponse defines model for BackupResponse.

type BackupRetentionResponse

type BackupRetentionResponse struct {
	AlertConfigBackupRetention  string `json:"alertConfigBackupRetention"`
	AlertRulesBackupRetention   string `json:"alertRulesBackupRetention"`
	GrafanaBackupRetention      string `json:"grafanaBackupRetention"`
	Message                     string `json:"message"`
	ScrapeConfigBackupRetention string `json:"scrapeConfigBackupRetention"`
}

BackupRetentionResponse defines model for BackupRetentionResponse.

type BackupScheduleModelJson

type BackupScheduleModelJson struct {
	Schedule   string             `json:"schedule"`
	ScheduleID openapi_types.UUID `json:"scheduleId"`
}

BackupScheduleModelJson defines model for BackupScheduleModelJson.

type BackupSchedulePostResponse

type BackupSchedulePostResponse struct {
	Message  string `json:"message"`
	Schedule string `json:"schedule"`
}

BackupSchedulePostResponse defines model for BackupSchedulePostResponse.

type BackupScheduleResponse

type BackupScheduleResponse struct {
	AlertConfigBackupSchedules  *[]BackupScheduleModelJson `json:"alertConfigBackupSchedules,omitempty"`
	AlertRulesBackupSchedules   *[]BackupScheduleModelJson `json:"alertRulesBackupSchedules,omitempty"`
	GrafanaBackupSchedules      *[]BackupScheduleModelJson `json:"grafanaBackupSchedules,omitempty"`
	Message                     string                     `json:"message"`
	ScrapeConfigBackupSchedules *[]BackupScheduleModelJson `json:"scrapeConfigBackupSchedules,omitempty"`
}

BackupScheduleResponse defines model for BackupScheduleResponse.

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, params *CreateParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) List

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

func (*Client) RestoresCreate

func (c *Client) RestoresCreate(ctx context.Context, projectID string, instanceID string, backupDate string, params *RestoresCreateParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) RetentionsList

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

func (*Client) SchedulesCreate

func (c *Client) SchedulesCreate(ctx context.Context, projectID string, instanceID string, params *SchedulesCreateParams, body SchedulesCreateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) SchedulesCreateWithBody

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

func (*Client) SchedulesList

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

type ClientInterface

type ClientInterface interface {
	// RestoresCreate request
	RestoresCreate(ctx context.Context, projectID string, instanceID string, backupDate string, params *RestoresCreateParams, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	// SchedulesList request
	SchedulesList(ctx context.Context, projectID string, instanceID string, params *SchedulesListParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// SchedulesCreate request with any body
	SchedulesCreateWithBody(ctx context.Context, projectID string, instanceID string, params *SchedulesCreateParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	SchedulesCreate(ctx context.Context, projectID string, instanceID string, params *SchedulesCreateParams, body SchedulesCreateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	// Create request
	Create(ctx context.Context, projectID string, instanceID string, params *CreateParams, 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) CreateWithResponse

func (c *ClientWithResponses) CreateWithResponse(ctx context.Context, projectID string, instanceID string, params *CreateParams, reqEditors ...RequestEditorFn) (*CreateResponse, error)

CreateWithResponse request returning *CreateResponse

func (*ClientWithResponses) ListWithResponse

func (c *ClientWithResponses) ListWithResponse(ctx context.Context, projectID string, instanceID string, params *ListParams, 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) ParseListResponse

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

ParseListResponse parses an HTTP response from a ListWithResponse call

func (*ClientWithResponses) ParseRestoresCreateResponse

func (c *ClientWithResponses) ParseRestoresCreateResponse(rsp *http.Response) (*RestoresCreateResponse, error)

ParseRestoresCreateResponse parses an HTTP response from a RestoresCreateWithResponse call

func (*ClientWithResponses) ParseRetentionsListResponse

func (c *ClientWithResponses) ParseRetentionsListResponse(rsp *http.Response) (*RetentionsListResponse, error)

ParseRetentionsListResponse parses an HTTP response from a RetentionsListWithResponse call

func (*ClientWithResponses) ParseSchedulesCreateResponse

func (c *ClientWithResponses) ParseSchedulesCreateResponse(rsp *http.Response) (*SchedulesCreateResponse, error)

ParseSchedulesCreateResponse parses an HTTP response from a SchedulesCreateWithResponse call

func (*ClientWithResponses) ParseSchedulesListResponse

func (c *ClientWithResponses) ParseSchedulesListResponse(rsp *http.Response) (*SchedulesListResponse, error)

ParseSchedulesListResponse parses an HTTP response from a SchedulesListWithResponse call

func (*ClientWithResponses) RestoresCreateWithResponse

func (c *ClientWithResponses) RestoresCreateWithResponse(ctx context.Context, projectID string, instanceID string, backupDate string, params *RestoresCreateParams, reqEditors ...RequestEditorFn) (*RestoresCreateResponse, error)

RestoresCreateWithResponse request returning *RestoresCreateResponse

func (*ClientWithResponses) RetentionsListWithResponse

func (c *ClientWithResponses) RetentionsListWithResponse(ctx context.Context, projectID string, instanceID string, reqEditors ...RequestEditorFn) (*RetentionsListResponse, error)

RetentionsListWithResponse request returning *RetentionsListResponse

func (*ClientWithResponses) SchedulesCreateWithBodyWithResponse

func (c *ClientWithResponses) SchedulesCreateWithBodyWithResponse(ctx context.Context, projectID string, instanceID string, params *SchedulesCreateParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SchedulesCreateResponse, error)

SchedulesCreateWithBodyWithResponse request with arbitrary body returning *SchedulesCreateResponse

func (*ClientWithResponses) SchedulesCreateWithResponse

func (c *ClientWithResponses) SchedulesCreateWithResponse(ctx context.Context, projectID string, instanceID string, params *SchedulesCreateParams, body SchedulesCreateJSONRequestBody, reqEditors ...RequestEditorFn) (*SchedulesCreateResponse, error)

func (*ClientWithResponses) SchedulesListWithResponse

func (c *ClientWithResponses) SchedulesListWithResponse(ctx context.Context, projectID string, instanceID string, params *SchedulesListParams, reqEditors ...RequestEditorFn) (*SchedulesListResponse, error)

SchedulesListWithResponse request returning *SchedulesListResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// RestoresCreate request
	RestoresCreateWithResponse(ctx context.Context, projectID string, instanceID string, backupDate string, params *RestoresCreateParams, reqEditors ...RequestEditorFn) (*RestoresCreateResponse, error)

	// RetentionsList request
	RetentionsListWithResponse(ctx context.Context, projectID string, instanceID string, reqEditors ...RequestEditorFn) (*RetentionsListResponse, error)

	// SchedulesList request
	SchedulesListWithResponse(ctx context.Context, projectID string, instanceID string, params *SchedulesListParams, reqEditors ...RequestEditorFn) (*SchedulesListResponse, error)

	// SchedulesCreate request with any body
	SchedulesCreateWithBodyWithResponse(ctx context.Context, projectID string, instanceID string, params *SchedulesCreateParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SchedulesCreateResponse, error)

	SchedulesCreateWithResponse(ctx context.Context, projectID string, instanceID string, params *SchedulesCreateParams, body SchedulesCreateJSONRequestBody, reqEditors ...RequestEditorFn) (*SchedulesCreateResponse, error)

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

	// Create request
	CreateWithResponse(ctx context.Context, projectID string, instanceID string, params *CreateParams, reqEditors ...RequestEditorFn) (*CreateResponse, error)
}

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

type CreateParams

type CreateParams struct {
	// BackupTarget List of backup targets
	BackupTarget *[]CreateParamsBackupTarget `form:"backupTarget,omitempty" json:"backupTarget,omitempty"`
}

CreateParams defines parameters for Create.

type CreateParamsBackupTarget

type CreateParamsBackupTarget string

CreateParamsBackupTarget defines parameters for Create.

const (
	ALERT_CONFIG  CreateParamsBackupTarget = "alertConfig"
	ALERT_RULES   CreateParamsBackupTarget = "alertRules"
	GRAFANA       CreateParamsBackupTarget = "grafana"
	SCRAPE_CONFIG CreateParamsBackupTarget = "scrapeConfig"
)

Defines values for CreateParamsBackupTarget.

type CreateResponse

type CreateResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON202      *Message
	JSON400      *Error
	JSON403      *PermissionDenied
	Error        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 Error

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

Error defines model for Error.

type ListParams

type ListParams struct {
	// BackupTarget List of backup targets
	BackupTarget *[]ListParamsBackupTarget `form:"backupTarget,omitempty" json:"backupTarget,omitempty"`
}

ListParams defines parameters for List.

type ListParamsBackupTarget

type ListParamsBackupTarget string

ListParamsBackupTarget defines parameters for List.

const (
	LIST_PARAMS_BACKUP_TARGET_ALERT_CONFIG  ListParamsBackupTarget = "alertConfig"
	LIST_PARAMS_BACKUP_TARGET_ALERT_RULES   ListParamsBackupTarget = "alertRules"
	LIST_PARAMS_BACKUP_TARGET_GRAFANA       ListParamsBackupTarget = "grafana"
	LIST_PARAMS_BACKUP_TARGET_SCRAPE_CONFIG ListParamsBackupTarget = "scrapeConfig"
)

Defines values for ListParamsBackupTarget.

type ListResponse

type ListResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *BackupResponse
	JSON403      *PermissionDenied
	JSON502      *Message
	Error        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 PermissionDenied

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

PermissionDenied defines model for PermissionDenied.

type RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

type RestoresCreateParams

type RestoresCreateParams struct {
	// RestoreTarget List of restore targets
	RestoreTarget RestoresCreateParamsRestoreTarget `form:"restoreTarget" json:"restoreTarget"`
}

RestoresCreateParams defines parameters for RestoresCreate.

type RestoresCreateParamsRestoreTarget

type RestoresCreateParamsRestoreTarget string

RestoresCreateParamsRestoreTarget defines parameters for RestoresCreate.

const (
	RESTORES_CREATE_PARAMS_RESTORE_TARGET_ALERT_CONFIG  RestoresCreateParamsRestoreTarget = "alertConfig"
	RESTORES_CREATE_PARAMS_RESTORE_TARGET_ALERT_RULES   RestoresCreateParamsRestoreTarget = "alertRules"
	RESTORES_CREATE_PARAMS_RESTORE_TARGET_GRAFANA       RestoresCreateParamsRestoreTarget = "grafana"
	RESTORES_CREATE_PARAMS_RESTORE_TARGET_SCRAPE_CONFIG RestoresCreateParamsRestoreTarget = "scrapeConfig"
)

Defines values for RestoresCreateParamsRestoreTarget.

type RestoresCreateResponse

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

func (RestoresCreateResponse) Status

func (r RestoresCreateResponse) Status() string

Status returns HTTPResponse.Status

func (RestoresCreateResponse) StatusCode

func (r RestoresCreateResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RetentionsListResponse

type RetentionsListResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *BackupRetentionResponse
	JSON403      *PermissionDenied
	Error        error // Aggregated error
}

func (RetentionsListResponse) Status

func (r RetentionsListResponse) Status() string

Status returns HTTPResponse.Status

func (RetentionsListResponse) StatusCode

func (r RetentionsListResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type SchedulesCreateJSONBody

type SchedulesCreateJSONBody struct {
	// Schedule The schedule for how often to create a backup.
	// `Additional Validators:`
	// * must be a valid cronjob format
	// * must run less than hourly
	Schedule string `json:"schedule"`
}

SchedulesCreateJSONBody defines parameters for SchedulesCreate.

type SchedulesCreateJSONRequestBody

type SchedulesCreateJSONRequestBody SchedulesCreateJSONBody

SchedulesCreateJSONRequestBody defines body for SchedulesCreate for application/json ContentType.

type SchedulesCreateParams

type SchedulesCreateParams struct {
	// BackupTarget List of backup targets
	BackupTarget *[]SchedulesCreateParamsBackupTarget `form:"backupTarget,omitempty" json:"backupTarget,omitempty"`
}

SchedulesCreateParams defines parameters for SchedulesCreate.

type SchedulesCreateParamsBackupTarget

type SchedulesCreateParamsBackupTarget string

SchedulesCreateParamsBackupTarget defines parameters for SchedulesCreate.

const (
	SCHEDULES_CREATE_PARAMS_BACKUP_TARGET_ALERT_CONFIG  SchedulesCreateParamsBackupTarget = "alertConfig"
	SCHEDULES_CREATE_PARAMS_BACKUP_TARGET_ALERT_RULES   SchedulesCreateParamsBackupTarget = "alertRules"
	SCHEDULES_CREATE_PARAMS_BACKUP_TARGET_GRAFANA       SchedulesCreateParamsBackupTarget = "grafana"
	SCHEDULES_CREATE_PARAMS_BACKUP_TARGET_SCRAPE_CONFIG SchedulesCreateParamsBackupTarget = "scrapeConfig"
)

Defines values for SchedulesCreateParamsBackupTarget.

type SchedulesCreateResponse

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

func (SchedulesCreateResponse) Status

func (r SchedulesCreateResponse) Status() string

Status returns HTTPResponse.Status

func (SchedulesCreateResponse) StatusCode

func (r SchedulesCreateResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type SchedulesListParams

type SchedulesListParams struct {
	// BackupTarget List of backup targets
	BackupTarget *[]SchedulesListParamsBackupTarget `form:"backupTarget,omitempty" json:"backupTarget,omitempty"`
}

SchedulesListParams defines parameters for SchedulesList.

type SchedulesListParamsBackupTarget

type SchedulesListParamsBackupTarget string

SchedulesListParamsBackupTarget defines parameters for SchedulesList.

const (
	SCHEDULES_LIST_PARAMS_BACKUP_TARGET_ALERT_CONFIG  SchedulesListParamsBackupTarget = "alertConfig"
	SCHEDULES_LIST_PARAMS_BACKUP_TARGET_ALERT_RULES   SchedulesListParamsBackupTarget = "alertRules"
	SCHEDULES_LIST_PARAMS_BACKUP_TARGET_GRAFANA       SchedulesListParamsBackupTarget = "grafana"
	SCHEDULES_LIST_PARAMS_BACKUP_TARGET_SCRAPE_CONFIG SchedulesListParamsBackupTarget = "scrapeConfig"
)

Defines values for SchedulesListParamsBackupTarget.

type SchedulesListResponse

type SchedulesListResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *BackupScheduleResponse
	JSON403      *PermissionDenied
	Error        error // Aggregated error
}

func (SchedulesListResponse) Status

func (r SchedulesListResponse) Status() string

Status returns HTTPResponse.Status

func (SchedulesListResponse) StatusCode

func (r SchedulesListResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

Jump to

Keyboard shortcuts

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