api

package
Version: v0.0.0-...-a69e935 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	V0      = Version("v0")
	V1Alpha = Version("v1alpha")
	V1      = Version("v1")
)

These constants are the string representations of the different API versions.

Variables

View Source
var ErrInvalidVersion = yarpcerrors.InvalidArgumentErrorf("invalid version")

ErrInvalidVersion is returned when user configures an invalid api version.

Functions

func ConvertCreateSpecToUpdateConfig

func ConvertCreateSpecToUpdateConfig(spec *stateless.CreateSpec) *update.UpdateConfig

ConvertCreateSpecToUpdateConfig converts create spec to update config

func ConvertJobConfigToJobSpec

func ConvertJobConfigToJobSpec(config *job.JobConfig) *stateless.JobSpec

ConvertJobConfigToJobSpec converts v0 job.JobConfig to v1alpha stateless.JobSpec

func ConvertJobSpecToJobConfig

func ConvertJobSpecToJobConfig(spec *stateless.JobSpec) (*job.JobConfig, error)

ConvertJobSpecToJobConfig converts stateless job spec to job config

func ConvertJobSummary

func ConvertJobSummary(
	summary *job.JobSummary,
	updateInfo *models.UpdateModel) *stateless.JobSummary

ConvertJobSummary converts v0 job.JobSummary and private UpdateModel to v1alpha stateless.JobSummary

func ConvertLabels

func ConvertLabels(labels []*peloton.Label) []*v1alphapeloton.Label

ConvertLabels converts v0 peloton.Label array to v1alpha peloton.Label array

func ConvertMesosCommandToPodSpec

func ConvertMesosCommandToPodSpec(
	commandInfo *mesosv1.CommandInfo,
	spec *pod.PodSpec,
	container *pod.ContainerSpec,
)

ConvertMesosCommandToPodSpec converts the mesos command info to pod spec

func ConvertMesosContainerToPodSpec

func ConvertMesosContainerToPodSpec(
	containerInfo *mesosv1.ContainerInfo,
	spec *pod.PodSpec,
	container *pod.ContainerSpec,
)

ConvertMesosContainerToPodSpec converts the mesos container info to PodSpec

func ConvertMesosExecutorInfoToPodSpec

func ConvertMesosExecutorInfoToPodSpec(
	executorInfo *mesosv1.ExecutorInfo,
	spec *pod.PodSpec,
	container *pod.ContainerSpec,
)

ConvertMesosExecutorInfoToPodSpec converts mesos executor info to pod spec

func ConvertPodConstraintsToTaskConstraints

func ConvertPodConstraintsToTaskConstraints(
	constraints []*pod.Constraint,
) []*task.Constraint

ConvertPodConstraintsToTaskConstraints converts pod constraints to task constraints

func ConvertPodQuerySpecToTaskQuerySpec

func ConvertPodQuerySpecToTaskQuerySpec(spec *pod.QuerySpec) *task.QuerySpec

ConvertPodQuerySpecToTaskQuerySpec converts v1alpha pod.QuerySpec to v0 task.QuerySpec

func ConvertPodSpecToMesosCommand

func ConvertPodSpecToMesosCommand(spec *pod.PodSpec) *mesosv1.CommandInfo

ConvertPodSpecToMesosCommand converts pod spec to mesos command info

func ConvertPodSpecToMesosContainer

func ConvertPodSpecToMesosContainer(spec *pod.PodSpec) *mesosv1.ContainerInfo

ConvertPodSpecToMesosContainer converts pod spec to mesos container info

func ConvertPodSpecToMesosExecutorInfo

func ConvertPodSpecToMesosExecutorInfo(spec *pod.PodSpec) *mesosv1.ExecutorInfo

ConvertPodSpecToMesosExecutorInfo converts pod spec to mesos executor info

func ConvertPodSpecToTaskConfig

func ConvertPodSpecToTaskConfig(spec *pod.PodSpec) (*task.TaskConfig, error)

ConvertPodSpecToTaskConfig converts a pod spec to task config

func ConvertPodStateToTaskState

func ConvertPodStateToTaskState(state pod.PodState) task.TaskState

ConvertPodStateToTaskState converts v0 task.TaskState to v1alpha pod.PodState

func ConvertPortConfigsToPortSpecs

func ConvertPortConfigsToPortSpecs(ports []*task.PortConfig) []*pod.PortSpec

ConvertPortConfigsToPortSpecs converts v0 task.PortConfig array to v1alpha pod.PortSpec array

func ConvertRuntimeInfoToJobStatus

func ConvertRuntimeInfoToJobStatus(
	runtime *job.RuntimeInfo,
	updateInfo *models.UpdateModel,
) *stateless.JobStatus

ConvertRuntimeInfoToJobStatus converts v0 job.RuntimeInfo and private UpdateModel to v1alpha stateless.JobStatus

func ConvertSLAConfigToSLASpec

func ConvertSLAConfigToSLASpec(slaConfig *job.SlaConfig) *stateless.SlaSpec

ConvertSLAConfigToSLASpec convert job's sla config to sla spec

func ConvertSLASpecToSLAConfig

func ConvertSLASpecToSLAConfig(slaSpec *stateless.SlaSpec) *job.SlaConfig

ConvertSLASpecToSLAConfig converts job's sla spec to sla config

func ConvertStatelessQuerySpecToJobQuerySpec

func ConvertStatelessQuerySpecToJobQuerySpec(spec *stateless.QuerySpec) *job.QuerySpec

ConvertStatelessQuerySpecToJobQuerySpec converts query spec for stateless svc to job query spec

func ConvertTaskConfigToPodSpec

func ConvertTaskConfigToPodSpec(taskConfig *task.TaskConfig, jobID string, instanceID uint32) *pod.PodSpec

ConvertTaskConfigToPodSpec converts v0 task.TaskConfig to v1alpha pod.PodSpec

func ConvertTaskConstraintsToPodConstraints

func ConvertTaskConstraintsToPodConstraints(constraints []*task.Constraint) []*pod.Constraint

ConvertTaskConstraintsToPodConstraints converts v0 task.Constraint array to v1alpha pod.Constraint array

func ConvertTaskInfosToPodInfos

func ConvertTaskInfosToPodInfos(taskInfos []*task.TaskInfo) []*pod.PodInfo

ConvertTaskInfosToPodInfos converts a list of v0 task info to a list of v1alpha pod info

func ConvertTaskRuntimeToPodStatus

func ConvertTaskRuntimeToPodStatus(runtime *task.RuntimeInfo) *pod.PodStatus

ConvertTaskRuntimeToPodStatus converts v0 task.RuntimeInfo to v1alpha pod.PodStatus

func ConvertTaskStateToPodState

func ConvertTaskStateToPodState(state task.TaskState) pod.PodState

ConvertTaskStateToPodState converts v0 task.TaskState to v1alpha pod.PodState

func ConvertTaskStatsToPodStats

func ConvertTaskStatsToPodStats(taskStats map[string]uint32) map[string]uint32

ConvertTaskStatsToPodStats converts v0 task stats to v1alpha pod stats

func ConvertUpdateModelToWorkflowInfo

func ConvertUpdateModelToWorkflowInfo(
	runtime *job.RuntimeInfo,
	updateInfo *models.UpdateModel,
	workflowEvents []*stateless.WorkflowEvent,
	instanceWorkflowEvents []*stateless.WorkflowInfoInstanceWorkflowEvents,
) *stateless.WorkflowInfo

ConvertUpdateModelToWorkflowInfo converts private UpdateModel to v1alpha stateless.WorkflowInfo

func ConvertUpdateModelToWorkflowStatus

func ConvertUpdateModelToWorkflowStatus(
	runtime *job.RuntimeInfo,
	updateInfo *models.UpdateModel,
) *stateless.WorkflowStatus

ConvertUpdateModelToWorkflowStatus converts private UpdateModel to v1alpha stateless.WorkflowStatus

func ConvertUpdateSpecToUpdateConfig

func ConvertUpdateSpecToUpdateConfig(spec *stateless.UpdateSpec) *update.UpdateConfig

ConvertUpdateSpecToUpdateConfig converts update spec to update config

func ConvertV0SecretsToV1Secrets

func ConvertV0SecretsToV1Secrets(secrets []*peloton.Secret) []*v1alphapeloton.Secret

ConvertV0SecretsToV1Secrets converts v0 peloton.Secret to v1alpha peloton.Secret

func ConvertV1InstanceRangeToV0InstanceRange

func ConvertV1InstanceRangeToV0InstanceRange(
	instanceRange []*pod.InstanceIDRange) []*task.InstanceRange

ConvertV1InstanceRangeToV0InstanceRange converts from array of v1 pod.InstanceIDRange to array of v0 task.InstanceRange

func ConvertV1SecretsToV0Secrets

func ConvertV1SecretsToV0Secrets(secrets []*v1alphapeloton.Secret) []*peloton.Secret

ConvertV1SecretsToV0Secrets converts v1alpha peloton.Secret to v0 peloton.Secret

func FindVolumeInPodSpec

func FindVolumeInPodSpec(spec *pod.PodSpec, name string) *volume.VolumeSpec

FindVolumeInPodSpec finds a volume of given name in the volume spec present in the pod spec

Types

type Version

type Version string

Version is the type of API versions.

func ParseVersion

func ParseVersion(str string) (Version, error)

ParseVersion parses version from string.

func (Version) IsV1

func (v Version) IsV1() bool

IsV1 returns whether the API version is for v1.

func (Version) String

func (v Version) String() string

String returns the string representation of the version.

Jump to

Keyboard shortcuts

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