schedulerapi

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package schedulerapi contains request definitions for the Scheduler API. The definitions are not complete and can be extended as needed. Requests can be sent by any HTTP client that implements the client.Sender interface. It is necessary to set API host and "X-StorageApi-Token" header in the HTTP client, see the ClientWithHostAndToken function.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActivateScheduleRequest

func ActivateScheduleRequest(configID storageapi.ConfigID, configurationVersionID string) client.APIRequest[*Schedule]

ActivateScheduleRequest https://app.swaggerhub.com/apis/odinuv/scheduler/1.0.0#/schedules/activate

func CleanAllSchedulesRequest

func CleanAllSchedulesRequest() client.APIRequest[client.NoResult]

CleanAllSchedulesRequest cleans all schedules in whole project. Useful for E2E tests.

func ClientWithHostAndToken

func ClientWithHostAndToken(c client.Client, apiHost, apiToken string) client.Client

ClientWithHostAndToken returns HTTP client with api host set.

Types

type ConfigID

type ConfigID = storageapi.ConfigID

ConfigID is ID of a configuration in Storage API.

type Error

type Error struct {
	Message     string `json:"error"`
	ErrCode     int    `json:"code"`
	ExceptionID string `json:"exceptionId"`
	// contains filtered or unexported fields
}

Error represents the structure Scheduler API error.

func (Error) Error

func (e Error) Error() string

func (Error) ErrorExceptionID

func (e Error) ErrorExceptionID() string

ErrorExceptionID returns exception ID to find details in logs.

func (Error) ErrorName

func (e Error) ErrorName() string

ErrorName returns a human-readable name of the error.

func (Error) ErrorUserMessage

func (e Error) ErrorUserMessage() string

ErrorUserMessage returns error message for end user.

func (*Error) SetRequest

func (e *Error) SetRequest(request *http.Request)

SetRequest method allows injection of HTTP request to the error, it implements client.errorWithRequest.

func (*Error) SetResponse

func (e *Error) SetResponse(response *http.Response)

SetResponse method allows injection of HTTP response to the error, it implements client.errorWithResponse.

func (Error) StatusCode

func (e Error) StatusCode() int

StatusCode returns HTTP status code.

type Schedule

type Schedule struct {
	ScheduleKey
	ConfigID ConfigID `json:"configurationId"`
}

Schedule - https://app.swaggerhub.com/apis/odinuv/scheduler/1.0.0#/schedules/get_schedules

type ScheduleID

type ScheduleID string

ScheduleID is ID of a schedule in Scheduler API.

func (ScheduleID) String

func (v ScheduleID) String() string

type ScheduleKey

type ScheduleKey struct {
	ID ScheduleID `json:"id" validate:"required"`
}

ScheduleKey is a unique identifier of a schedule.

Jump to

Keyboard shortcuts

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