apimodels

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AllNamespacesNamespace is a sentinel Namespace value to indicate that api should search for
	// jobs and allocations in all the namespaces the requester can access.
	AllNamespacesNamespace = "*"

	// HTTPHeaderClientID is the header used to pass the client ID to the server.
	HTTPHeaderClientID = "X-Bacalhau-Client-ID"

	// HTTPHeaderJobID is the header used to pass the job ID to the server.
	HTTPHeaderJobID = "X-Bacalhau-Job-ID"

	// HTTPHeaderAppID is the header used to pass the application ID to the server.
	HTTPHeaderAppID = "X-Bacalhau-App-ID"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseGetRequest

type BaseGetRequest struct {
	BaseRequest
}

BaseGetRequest is the base request used for all get requests

type BaseGetResponse

type BaseGetResponse struct {
	BaseResponse `json:",omitempty,inline" yaml:",omitempty,inline"`
}

type BaseListRequest

type BaseListRequest struct {
	BaseGetRequest
	Limit     uint32 `query:"limit"`
	NextToken string `query:"next_token"`
	OrderBy   string `query:"order_by"`
	Reverse   bool   `query:"reverse"`
}

BaseListRequest is the base request used for all list requests

func (*BaseListRequest) ToHTTPRequest

func (o *BaseListRequest) ToHTTPRequest() *HTTPRequest

ToHTTPRequest is used to convert the request to an HTTP request

type BaseListResponse

type BaseListResponse struct {
	BaseGetResponse `json:",omitempty,inline" yaml:",omitempty,inline"`
	NextToken       string
}

func (*BaseListResponse) GetNextToken

func (o *BaseListResponse) GetNextToken() string

type BasePutRequest

type BasePutRequest struct {
	BaseRequest
	IdempotencyToken string `query:"idempotency_token"`
}

BasePutRequest is the base request used for all put requests

func (*BasePutRequest) ToHTTPRequest

func (o *BasePutRequest) ToHTTPRequest() *HTTPRequest

ToHTTPRequest is used to convert the request to an HTTP request

type BasePutResponse

type BasePutResponse struct {
	BaseResponse `json:",omitempty,inline" yaml:",omitempty,inline"`
}

type BaseRequest

type BaseRequest struct {
	Namespace string            `query:"namespace"`
	Headers   map[string]string `query:"-"`
	Context   context.Context   `query:"-"`
}

BaseRequest is the base request used for all requests

func (*BaseRequest) ToHTTPRequest

func (o *BaseRequest) ToHTTPRequest() *HTTPRequest

ToHTTPRequest is used to convert the request to an HTTP request

type BaseResponse

type BaseResponse struct {
}

func (*BaseResponse) Normalize

func (o *BaseResponse) Normalize()

Normalize normalizes the response

type GetAgentNodeRequest

type GetAgentNodeRequest struct {
	BaseGetRequest
}

GetAgentNodeRequest is the request to get the agent node.

type GetAgentNodeResponse

type GetAgentNodeResponse struct {
	BaseGetResponse
	*models.NodeInfo
}

type GetJobRequest

type GetJobRequest struct {
	BaseGetRequest
	JobID string
}

type GetJobResponse

type GetJobResponse struct {
	BaseGetResponse
	Job *models.Job `json:"Job"`
}

func (*GetJobResponse) Normalize

func (r *GetJobResponse) Normalize()

Normalize is used to33 canonicalize fields in the GetJobResponse.

type GetNodeRequest

type GetNodeRequest struct {
	BaseGetRequest
	NodeID string
}

type GetNodeResponse

type GetNodeResponse struct {
	BaseGetResponse
	Node *models.NodeInfo
}

type GetRequest

type GetRequest interface {
	Request
}

type GetResponse

type GetResponse interface {
	Response
}

type GetVersionResponse

type GetVersionResponse struct {
	BaseGetResponse
	*models.BuildVersionInfo
}

GetVersionResponse is the response to the Version request.

type HTTPBasicAuth

type HTTPBasicAuth struct {
	// Username to use for HTTP Basic Authentication
	Username string

	// Password to use for HTTP Basic Authentication
	Password string
}

HTTPBasicAuth is used to authenticate http client with HTTP Basic Authentication

type HTTPRequest

type HTTPRequest struct {
	Params  url.Values
	Body    io.Reader
	BodyObj interface{}
	Ctx     context.Context
	Header  http.Header
}

HTTPRequest is used to help build up a request

func NewHTTPRequest

func NewHTTPRequest() *HTTPRequest

NewHTTPRequest is used to create a new request

type IsAliveResponse

type IsAliveResponse struct {
	BaseGetResponse `json:",omitempty,inline" yaml:",omitempty,inline"`
	Status          string
}

IsAliveResponse is the response to the IsAlive request.

func (*IsAliveResponse) IsReady

func (r *IsAliveResponse) IsReady() bool

type ListJobExecutionsRequest

type ListJobExecutionsRequest struct {
	BaseListRequest
	JobID string `query:"-"`
}

type ListJobExecutionsResponse

type ListJobExecutionsResponse struct {
	BaseListResponse
	Executions []*models.Execution
}

type ListJobHistoryRequest

type ListJobHistoryRequest struct {
	BaseListRequest
	JobID       string `query:"-"`
	Since       int64  `query:"since" validate:"min=0"`
	EventType   string `query:"event_type" validate:"omitempty,oneof=all job execution"`
	ExecutionID string `query:"execution_id" validate:"omitempty"`
	NodeID      string `query:"node_id" validate:"omitempty"`
}

func (*ListJobHistoryRequest) ToHTTPRequest added in v1.1.0

func (o *ListJobHistoryRequest) ToHTTPRequest() *HTTPRequest

ToHTTPRequest is used to convert the request to an HTTP request

type ListJobHistoryResponse

type ListJobHistoryResponse struct {
	BaseListResponse
	History []*models.JobHistory
}

type ListJobResultsRequest

type ListJobResultsRequest struct {
	BaseListRequest
	JobID string `query:"-"`
}

type ListJobResultsResponse

type ListJobResultsResponse struct {
	BaseListResponse
	Results []*models.SpecConfig
}

type ListJobsRequest

type ListJobsRequest struct {
	BaseListRequest
	Labels []labels.Requirement `query:"-"` // don't auto bind as it requires special handling
}

func (*ListJobsRequest) ToHTTPRequest added in v1.1.0

func (o *ListJobsRequest) ToHTTPRequest() *HTTPRequest

ToHTTPRequest is used to convert the request to an HTTP request

type ListJobsResponse

type ListJobsResponse struct {
	BaseListResponse
	Jobs []*models.Job `json:"Jobs"`
}

func (*ListJobsResponse) Normalize

func (r *ListJobsResponse) Normalize()

Normalize is used to canonicalize fields in the ListJobsResponse.

type ListNodesRequest

type ListNodesRequest struct {
	BaseListRequest
	Labels []labels.Requirement `query:"-"` // don't auto bind as it requires special handling
}

func (*ListNodesRequest) ToHTTPRequest

func (o *ListNodesRequest) ToHTTPRequest() *HTTPRequest

ToHTTPRequest is used to convert the request to an HTTP request

type ListNodesResponse

type ListNodesResponse struct {
	BaseListResponse
	Nodes []*models.NodeInfo
}

type ListRequest

type ListRequest interface {
	GetRequest
}

type ListResponse

type ListResponse interface {
	GetResponse

	// GetNextToken is the token used to indicate where to start paging
	// for queries that support paginated lists. To resume paging from
	// this point, pass this token in the next request
	GetNextToken() string
}

type PutJobRequest

type PutJobRequest struct {
	BasePutRequest
	Job *models.Job `json:"Job"`
}

func (*PutJobRequest) Normalize

func (r *PutJobRequest) Normalize()

Normalize is used to canonicalize fields in the PutJobRequest.

func (*PutJobRequest) Validate

func (r *PutJobRequest) Validate() error

Validate is used to validate fields in the PutJobRequest.

type PutJobResponse

type PutJobResponse struct {
	BasePutResponse
	JobID        string   `json:"JobID"`
	EvaluationID string   `json:"EvaluationID"`
	Warnings     []string `json:"Warnings"`
}

type PutRequest

type PutRequest interface {
	Request
}

type PutResponse

type PutResponse interface {
	Response
}

type Request

type Request interface {
	// ToHTTPRequest is used to convert the request to an HTTP request
	ToHTTPRequest() *HTTPRequest
}

type Response

type Response interface {
	// Normalize normalizes the response
	Normalize()
}

type StopJobRequest

type StopJobRequest struct {
	BasePutRequest
	JobID  string `json:"-"`
	Reason string `json:"reason"`
}

type StopJobResponse

type StopJobResponse struct {
	BasePutResponse
	EvaluationID string `json:"EvaluationID"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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