models

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: MIT Imports: 14 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Env

type Env struct {
	UseSwagger                                   bool
	RadixComponentName                           string
	RadixDeploymentName                          string
	RadixDeploymentNamespace                     string
	RadixJobSchedulersPerEnvironmentHistoryLimit int
	RadixPort                                    string
}

Env instance variables

func NewEnv

func NewEnv() *Env

NewEnv Constructor

type JobScheduleDescription

type JobScheduleDescription struct {
	// Payload holding json data to be mapped to component
	//
	// required: false
	// example: {'data':'value'}
	Payload string `json:"payload"`
	// Payload holding data realating to resource configuration
	//
	// required: false
	RadixJobComponentConfig `json:",inline"`
}

JobScheduleDescription holds description about scheduling job swagger:model JobScheduleDescription

type JobStatus

type JobStatus struct {
	// Name of the job
	// required: true
	// example: calculator
	Name string `json:"name"`

	// Created timestamp
	//
	// required: true
	// example: 2006-01-02T15:04:05Z
	Created string `json:"created"`

	// Started timestamp
	//
	// required: false
	// example: 2006-01-02T15:04:05Z
	Started string `json:"started"`

	// Ended timestamp
	//
	// required: false
	// example: 2006-01-02T15:04:05Z
	Ended string `json:"ended"`

	// Status of the job
	//
	// required: false
	// Enum: Waiting,Running,Succeeded,Stopping,Stopped,Failed
	// example: Waiting
	Status string `json:"status"`

	// Status message, if any, of the job
	//
	// required: false
	// example: "Error occurred"
	Message string `json:"message"`
}

JobStatus holds general information about job status swagger:model JobStatus

func GetJobStatusFromJob

func GetJobStatusFromJob(kubeClient kubernetes.Interface, job *v1.Job, jobPods []corev1.Pod) *JobStatus

GetJobStatusFromJob Gets job from a k8s job

type ProgressStatus

type ProgressStatus int

ProgressStatus Enumeration of the statuses of a job or step

const (
	// Running Active
	Running ProgressStatus = iota

	// Succeeded JobStatus/step succeeded
	Succeeded

	// Failed JobStatus/step failed
	Failed

	// Waiting JobStatus/step pending
	Waiting

	// Stopping job
	Stopping

	// Stopped job
	Stopped
)

func GetStatusFromJobStatus

func GetStatusFromJobStatus(jobStatus v1.JobStatus) ProgressStatus

GetStatusFromJobStatus Gets status from kubernetes job status

func (ProgressStatus) String

func (p ProgressStatus) String() string

type RadixJobComponentConfig added in v1.1.0

type RadixJobComponentConfig struct {
	// Resource describes the compute resource requirements.
	//
	// required: false
	Resources *v1.ResourceRequirements `json:"resources,omitempty"`
	// Node defines node attributes, where container should be scheduled
	//
	// required: false
	Node *v1.RadixNode `json:"node,omitempty"`
}

type Status

type Status struct {

	// Status of the operation.
	// One of: "Success" or "Failure".
	// example: Failure
	Status string `json:"status,omitempty"`
	// A human-readable description of the status of this operation.
	// required: false
	// example: job job123 is not found
	Message string `json:"message,omitempty"`
	// A machine-readable description of why this operation is in the
	// "Failure" status. If this value is empty there
	// is no information available. A Reason clarifies an HTTP status
	// code but does not override it.
	// required: false
	// example: NotFound
	Reason StatusReason `json:"reason,omitempty"`

	// Suggested HTTP return code for this status, 0 if not set.
	// required: false
	// example: 404
	Code int `json:"code,omitempty"`
}

Status is a return value for calls that don't return other objects or when a request returns an error swagger:model Status

type StatusReason

type StatusReason string
const (
	StatusSuccess = "Success"
	StatusFailure = "Failure"
	// StatusReasonUnknown means the server has declined to indicate a specific reason.
	// Status code 500.
	StatusReasonUnknown StatusReason = "InternalError"
	// StatusReasonNotFound means one or more resources required for this operation
	// could not be found.
	// Status code 404
	StatusReasonNotFound StatusReason = "NotFound"
	// StatusReasonInvalid means the requested create or update operation cannot be
	// completed due to invalid data provided as part of the request. The client may
	// need to alter the request.
	// Status code 422
	StatusReasonInvalid StatusReason = "Invalid"
)

Jump to

Keyboard shortcuts

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