Protocol Documentation

February 28, 2019 · View on GitHub

Table of Contents

Top

peloton.proto

EntityVersion

An opaque token associated with an entity object used to implement optimistic concurrency control.

FieldTypeLabelDescription
valuestring

HostOfferID

A unique ID assigned to offers from a host.

FieldTypeLabelDescription
valuestring

JobID

A unique ID assigned to a Job. This is a UUID in RFC4122 format.

FieldTypeLabelDescription
valuestring

Label

Key, value pair used to store free form user-data.

FieldTypeLabelDescription
keystring
valuestring

OpaqueData

Opaque data passed to Peloton from the client. Passing an empty string in the structure will unset the existing data.

FieldTypeLabelDescription
datastring

PodID

A unique ID assigned to a pod. It should be treated as an opaque token.

FieldTypeLabelDescription
valuestring

PodName

A unique name assigned to a pod. By default, the pod name is in the format of JobID-<InstanceID>.

FieldTypeLabelDescription
valuestring

ResourcePoolID

A unique ID assigned to a Resource Pool. This is a UUID in RFC4122 format.

FieldTypeLabelDescription
valuestring

Revision

Revision of an entity info, such as JobSpec etc.

FieldTypeLabelDescription
versionuint64Version number of the entity info which is monotonically increasing. Clients can use this to guide against race conditions using MVCC.
created_atuint64The timestamp when the entity info is created
updated_atuint64The timestamp when the entity info is updated
updated_bystringThe user or service that updated the entity info

Secret

Secret is used to store secrets per job and contains ID, absolute container mount path and base64 encoded secret data

FieldTypeLabelDescription
secret_idSecretIDUUID of the secret
pathstringPath at which the secret file will be mounted in the container
valueSecret.ValueSecret value

Secret.Value

FieldTypeLabelDescription
databytesSecret data as byte array

SecretID

A unique ID assigned to a Secret. This is a UUID in RFC4122 format.

FieldTypeLabelDescription
valuestring

TimeRange

Time range specified by min and max timestamps. Time range is left closed and right open: [min, max)

FieldTypeLabelDescription
min.google.protobuf.Timestamp
max.google.protobuf.Timestamp

VolumeID

A unique ID assigned to a Volume. This is a UUID in RFC4122 format.

FieldTypeLabelDescription
valuestring

Top

query.proto

OrderBy

Order by clause of a query

FieldTypeLabelDescription
orderOrderBy.Order
propertyPropertyPath

Pagination

Generic pagination for a list of records to be returned by a query

FieldTypeLabelDescription
offsetuint32Offset of the pagination for a query result
limituint32Limit of the pagination for a query result
totaluint32Total number of records for a query result

PaginationSpec

Pagination query spec used as argument to queries that returns a Pagination result.

FieldTypeLabelDescription
offsetuint32Offset of the query for pagination
limituint32Limit per page of the query for pagination
order_byOrderByrepeatedList of fields to be order by in sequence
max_limituint32Max limit of the pagination result.

PropertyPath

A dot separated path to a object property such as config.name or runtime.creationTime for a job object.

FieldTypeLabelDescription
valuestring

OrderBy.Order

NameNumberDescription
ORDER_BY_INVALID0
ORDER_BY_ASC1
ORDER_BY_DESC2

Top

pod.proto

AndConstraint

AndConstraint represents a logical 'and' of constraints.

FieldTypeLabelDescription
constraintsConstraintrepeated

Constraint

Constraint represents a host label constraint or a related pods label constraint. This is used to require that a host have certain label constraints or to require that the pods already running on the host have certain label constraints.

FieldTypeLabelDescription
typeConstraint.Type
label_constraintLabelConstraint
and_constraintAndConstraint
or_constraintOrConstraint

ContainerSpec

A single application container running inside a pod

FieldTypeLabelDescription
namestringName of the container. Each container in a pod must have a unique name. Cannot be updated.
resourceResourceSpecResource config of the container
container.mesos.v1.ContainerInfoContainer config of the container
command.mesos.v1.CommandInfoCommand line config of the container
executor.mesos.v1.ExecutorInfoCustom executor config of the task.
liveness_checkHealthCheckSpecLiveness health check config of the container
readiness_checkHealthCheckSpecReadiness health check config of the container This is currently not supported.
portsPortSpecrepeatedList of network ports to be allocated for the pod

ContainerStatus

Runtime status of a container in a pod

FieldTypeLabelDescription
namestringName of the container
stateContainerStateRuntime state of the container
portsContainerStatus.PortsEntryrepeatedDynamic ports reserved on the host while this container is running
messagestringThe message that explains the current state of a container such as why the container is failed. Only track the latest one if the container has been retried and failed multiple times.
reasonstringThe reason that explains the current state of a container. Only track the latest one if the container has been retried and failed multiple times.
failure_countuint32The number of times the container has failed after retries.
healthyHealthStatusThe result of the health check
imagestringThe image the container is running
start_timestringThe time when the container starts to run. Will be unset if the pod hasn't started running yet. The time is represented in RFC3339 form with UTC timezone.
completion_timestringThe time when the container terminated. Will be unset if the pod hasn't completed yet. The time is represented in RFC3339 form with UTC timezone.
terminationStatusTerminationStatusTermination status of the task. Set only if the task is in a non-successful terminal state such as CONTAINER_STATE_FAILED or CONTAINER_STATE_KILLED.

ContainerStatus.PortsEntry

FieldTypeLabelDescription
keystring
valueuint32

HealthCheckSpec

Health check configuration for a container

FieldTypeLabelDescription
enabledboolWhether the health check is enabled.
initial_interval_secsuint32Start time wait in seconds. Zero or empty value would use default value of 15 from Mesos.
interval_secsuint32Interval in seconds between two health checks. Zero or empty value would use default value of 10 from Mesos.
max_consecutive_failuresuint32Max number of consecutive failures before failing health check. Zero or empty value would use default value of 3 from Mesos.
timeout_secsuint32Health check command timeout in seconds. Zero or empty value would use default value of 20 from Mesos.
typeHealthCheckSpec.HealthCheckType
command_checkHealthCheckSpec.CommandCheckOnly applicable when type is COMMAND.

HealthCheckSpec.CommandCheck

FieldTypeLabelDescription
commandstringHealth check command to be executed. Note that this command by default inherits all environment varibles from the container it's monitoring, unless unshare_environments is set to true.
unshare_environmentsboolIf set, this check will not share the environment variables of the container.

HealthStatus

The result of the health check

FieldTypeLabelDescription
stateHealthStateThe health check state
outputstringThe output of the health check run

InstanceIDRange

Pod InstanceID range [from, to)

FieldTypeLabelDescription
fromuint32
touint32

LabelConstraint

LabelConstraint represents a constraint on the number of occurrences of a given label from the set of host labels or pod labels present on the host.

FieldTypeLabelDescription
kindLabelConstraint.KindDetermines which labels the constraint should apply to.
conditionLabelConstraint.ConditionDetermines which constraint there should be on the number of occurrences of the label.
label.peloton.api.v1alpha.peloton.LabelThe label which this defines a constraint on: For Kind == HOST, each attribute on Mesos agent is transformed to a label, with hostname as a special label which is always inferred from agent hostname and set.
requirementuint32A limit on the number of occurrences of the label.

OrConstraint

OrConstraint represents a logical 'or' of constraints.

FieldTypeLabelDescription
constraintsConstraintrepeated

PersistentVolumeSpec

Persistent volume configuration for a pod.

FieldTypeLabelDescription
container_pathstringVolume mount path inside container.
size_mbuint32Volume size in MB.

PodEvent

Pod events of a particular run of a job instance.

FieldTypeLabelDescription
pod_id.peloton.api.v1alpha.peloton.PodIDThe current pod ID
actual_statestringActual state of a pod
desired_statestringGoal State of a pod
timestampstringThe time when the event was created. The time is represented in RFC3339 form with UTC timezone.
version.peloton.api.v1alpha.peloton.EntityVersionThe entity version currently used by the pod.
desired_version.peloton.api.v1alpha.peloton.EntityVersionThe desired entity version that should be used by the pod.
agent_idstringThe agentID for the pod
hostnamestringThe host on which the pod is running
messagestringShort human friendly message explaining state.
reasonstringThe short reason for the pod event
prev_pod_id.peloton.api.v1alpha.peloton.PodIDThe previous pod ID
healthystringThe health check result of the pod
desired_pod_id.peloton.api.v1alpha.peloton.PodIDThe desired pod ID

PodInfo

Info of a pod in a Job

FieldTypeLabelDescription
specPodSpecConfiguration of the pod
statusPodStatusRuntime status of the pod

PodSpec

Pod configuration for a given job instance Note that only add string/slice/ptr type into PodConfig directly due to the limitation of go reflection inside our pod specific config logic.

FieldTypeLabelDescription
pod_name.peloton.api.v1alpha.peloton.PodNameName of the pod
labels.peloton.api.v1alpha.peloton.LabelrepeatedList of user-defined labels for the pod
init_containersContainerSpecrepeatedList of initialization containers belonging to the pod. These containers are assumed to run to completion and are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed. Init containers cannot be configured to have readiness or liveness health checks.
containersContainerSpecrepeatedList of containers belonging to the pod. These will be started in parallel after init containers terminate. There must be at least one container in a pod.
constraintConstraintConstraint on the attributes of the host or labels on pods on the host that this pod should run on. Use AndConstraint/OrConstraint to compose multiple constraints if necessary.
restart_policyRestartPolicyPod restart policy on failures
volumePersistentVolumeSpecPersistent volume config of the pod.
preemption_policyPreemptionPolicyPreemption policy of the pod
controllerboolWhether this is a controller pod. A controller is a special batch pod which controls other pods inside a job. E.g. spark driver pods in a spark job will be a controller pod.
kill_grace_period_secondsuint32This is used to set the amount of time between when the executor sends the SIGTERM message to gracefully terminate a pod and when it kills it by sending SIGKILL. If you do not set the grace period duration the default is 30 seconds.
revocableboolrevocable represents pod to use physical or slack resources.

PodStatus

Runtime status of a pod instance in a Job

FieldTypeLabelDescription
statePodStateRuntime state of the pod
pod_id.peloton.api.v1alpha.peloton.PodIDThe current pod ID for this pod
start_timestringThe time when the pod starts to run. Will be unset if the pod hasn't started running yet. The time is represented in RFC3339 form with UTC timezone.
completion_timestringThe time when the pod is completed. Will be unset if the pod hasn't completed yet. The time is represented in RFC3339 form with UTC timezone.
hoststringThe name of the host where the pod is running
init_containers_statusContainerStatusrepeatedStatus of the init containers.
containers_statusContainerStatusrepeatedStatus of the containers.
desired_statePodStateThe desired state of the pod which should be eventually reached by the system.
messagestringThe message that explains the current state of a pod.
reasonstringThe reason that explains the current state of a pod. See Mesos TaskStatus.Reason for more details.
failure_countuint32The number of times the pod has failed after retries.
volume_id.peloton.api.v1alpha.peloton.VolumeIDpersistent volume id
version.peloton.api.v1alpha.peloton.EntityVersionThe entity version currently used by the pod. TODO Avoid leaking job abstractions into public pod APIs. Remove after internal protobuf structures are defined.
desired_version.peloton.api.v1alpha.peloton.EntityVersionThe desired entity version that should be used by the pod. TODO Avoid leaking job abstractions into public pod APIs. Remove after internal protobuf structures are defined.
agent_id.mesos.v1.AgentIDthe id of mesos agent on the host to be launched.
revision.peloton.api.v1alpha.peloton.RevisionRevision of the current pod status.
prev_pod_id.peloton.api.v1alpha.peloton.PodIDThe pod id of the previous pod.
resource_usagePodStatus.ResourceUsageEntryrepeatedThe resource usage for this pod. The map key is each resource kind in string format and the map value is the number of unit-seconds of that resource used by the job. Example: if a pod that uses 1 CPU and finishes in 10 seconds, this map will contain <"cpu":10>
desired_pod_id.peloton.api.v1alpha.peloton.PodIDThe desired pod ID for this pod
desiredHoststringThe name of the host where the pod should be running on upon restart. It is used for best effort in-place update/restart.

PodStatus.ResourceUsageEntry

FieldTypeLabelDescription
keystring
valuedouble

PodSummary

Summary information about a pod

FieldTypeLabelDescription
pod_name.peloton.api.v1alpha.peloton.PodNameName of the pod
statusPodStatusRuntime status of the pod

PortSpec

Network port configuration for a container

FieldTypeLabelDescription
namestringName of the network port, e.g. http, tchannel. Required field.
valueuint32Static port number if any. If unset, will be dynamically allocated by the scheduler
env_namestringEnvironment variable name to be exported when running a container for this port. Required field for dynamic port.

PreemptionPolicy

Preemption policy for a pod

FieldTypeLabelDescription
kill_on_preemptboolThis policy defines if the pod should be restarted after it is preempted. If set to true the pod will not be rescheduled after it is preempted. If set to false the pod will be rescheduled. Defaults to false

QuerySpec

QuerySpec specifies the list of query criteria for pods. All indexed fields should be part of this message. And all fields in this message have to be indexed too.

FieldTypeLabelDescription
pagination.peloton.api.v1alpha.query.PaginationSpecThe spec of how to do pagination for the query results.
pod_statesPodStaterepeatedList of pod states to query the pods. Will match all pods if the list is empty.
names.peloton.api.v1alpha.peloton.PodNamerepeatedList of pod names to query the pods. Will match all names if the list is empty.
hostsstringrepeatedList of hosts to query the pods. Will match all hosts if the list is empty.

ResourceSpec

Resource configuration for a container.

FieldTypeLabelDescription
cpu_limitdoubleCPU limit in number of CPU cores
mem_limit_mbdoubleMemory limit in MB
disk_limit_mbdoubleDisk limit in MB
fd_limituint32File descriptor limit
gpu_limitdoubleGPU limit in number of GPUs

RestartPolicy

Restart policy for a pod.

FieldTypeLabelDescription
max_failuresuint32Max number of pod failures can occur before giving up scheduling retry, no backoff for now. Default 0 means no retry on failures.

TerminationStatus

TerminationStatus contains details about termination of a task. It mainly contains Peloton-specific reasons for termination.

FieldTypeLabelDescription
reasonTerminationStatus.ReasonReason for termination.
exit_codeuint32If non-zero, exit status when the container terminated.
signalstringName of signal received by the container when it terminated.

Constraint.Type

NameNumberDescription
CONSTRAINT_TYPE_INVALID0Reserved for compatibility.
CONSTRAINT_TYPE_LABEL1
CONSTRAINT_TYPE_AND2
CONSTRAINT_TYPE_OR3

ContainerState

Runtime states of a container in a pod

NameNumberDescription
CONTAINER_STATE_INVALID0Invalid state.
CONTAINER_STATE_PENDING1The container has not been created yet
CONTAINER_STATE_LAUNCHED2The container has been launched
CONTAINER_STATE_STARTING3The container is being started on a host
CONTAINER_STATE_RUNNING4The container is running on a host
CONTAINER_STATE_SUCCEEDED5The container terminated with an exit code of zero
CONTAINER_STATE_FAILED6The container terminated with a non-zero exit code
CONTAINER_STATE_KILLING7The container is being killed
CONTAINER_STATE_KILLED8Execution of the container was terminated by the system

HealthCheckSpec.HealthCheckType

NameNumberDescription
HEALTH_CHECK_TYPE_UNKNOWN0Reserved for future compatibility of new types.
HEALTH_CHECK_TYPE_COMMAND1Command line based health check
HEALTH_CHECK_TYPE_HTTP2HTTP endpoint based health check
HEALTH_CHECK_TYPE_GRPC3gRPC based health check

HealthState

HealthState is the health check state of a container

NameNumberDescription
HEALTH_STATE_INVALID0Default value.
HEALTH_STATE_DISABLED1If the health check config is not enabled in the container config, then the health state is DISABLED.
HEALTH_STATE_UNKNOWN2If the health check config is enabled in the container config, but the container has not reported the output of the health check yet, then the health state is UNKNOWN.
HEALTH_STATE_HEALTHY3In a Mesos event, If the healthy field is true and the reason field is REASON_TASK_HEALTH_CHECK_STATUS_UPDATED the health state of the container is HEALTHY
HEALTH_STATE_UNHEALTHY4In a Mesos event, If the healthy field is false and the reason field is REASON_TASK_HEALTH_CHECK_STATUS_UPDATED the health state of the container is UNHEALTHY

LabelConstraint.Condition

Condition represents a constraint on the number of occurrences of the label.

NameNumberDescription
LABEL_CONSTRAINT_CONDITION_INVALID0
LABEL_CONSTRAINT_CONDITION_LESS_THAN1
LABEL_CONSTRAINT_CONDITION_EQUAL2
LABEL_CONSTRAINT_CONDITION_GREATER_THAN3

LabelConstraint.Kind

Kind represents whatever the constraint applies to the labels on the host or to the labels of the pods that are located on the host.

NameNumberDescription
LABEL_CONSTRAINT_KIND_INVALID0
LABEL_CONSTRAINT_KIND_POD1
LABEL_CONSTRAINT_KIND_HOST2

PodState

Runtime states of a pod instance

NameNumberDescription
POD_STATE_INVALID0Invalid state.
POD_STATE_INITIALIZED1The pod is being initialized
POD_STATE_PENDING2The pod is pending and waiting for resources
POD_STATE_READY3The pod has been allocated with resources and ready for placement
POD_STATE_PLACING4The pod is being placed to a host based on its resource requirements and constraints
POD_STATE_PLACED5The pod has been assigned to a host matching the resource requirements and constraints
POD_STATE_LAUNCHING6The pod is taken from resmgr to be launched
POD_STATE_LAUNCHED7The pod is being launched in Job manager
POD_STATE_STARTING8Either init containers are starting/running or the main containers in the pod are being started by Mesos agent
POD_STATE_RUNNING9All containers in the pod are running
POD_STATE_SUCCEEDED10All containers in the pod terminated with an exit code of zero
POD_STATE_FAILED11At least on container in the pod terminated with a non-zero exit code
POD_STATE_LOST12The pod is lost
POD_STATE_KILLING13The pod is being killed
POD_STATE_KILLED14At least one of the containers in the pod was terminated by the system
POD_STATE_PREEMPTING15The pod is being preempted by another one on the node
POD_STATE_DELETED16The pod is to be deleted after termination

TerminationStatus.Reason

Reason lists various causes for a task termination

NameNumberDescription
TERMINATION_STATUS_REASON_INVALID0Default value.
TERMINATION_STATUS_REASON_KILLED_ON_REQUEST1Task was killed because a stop request was received from a client.
TERMINATION_STATUS_REASON_FAILED2Task failed. See also TerminationStatus.exit_code, TerminationStatus.signal and ContainerStatus.message.
TERMINATION_STATUS_REASON_KILLED_HOST_MAINTENANCE3Task was killed to put the host in to maintenance.
TERMINATION_STATUS_REASON_PREEMPTED_RESOURCES4Tasked was killed to reclaim resources allocated to it.

Top

host.proto

HostInfo

FieldTypeLabelDescription
hostnamestringThe hostname of the host
ipstringThe IP address of the host
stateHostStateThe current state of the host

HostState

NameNumberDescription
HOST_STATE_INVALID0
HOST_STATE_UNKNOWN1Reserved for future compatibility of new states.
HOST_STATE_UP2The host is healthy
HOST_STATE_DRAINING3The tasks running on the host are being rescheduled. There will be no further placement of tasks on the host
HOST_STATE_DRAINED4There are no tasks running on the host and is ready to be put into maintenance.
HOST_STATE_DOWN5The host is in maintenance.

Top

respool.proto

ControllerLimit

The max limit of resources CONTROLLER(see TaskType) tasks can use in this resource pool. This is defined as a percentage of the resource pool's reservation. If undefined there is no maximum limit for controller tasks i.e. controller tasks will not be treated differently. For eg if the resource pool's reservation is defined as:

cpu:100 mem:1000 disk:1000 gpu:10

And the ControllerLimit = 10 ,Then the maximum resources the controller tasks can use is 10% of the reservation, i.e.

cpu:10 mem:100 disk:100 gpu:1

FieldTypeLabelDescription
max_percentdouble

ResourcePoolInfo

FieldTypeLabelDescription
respool_id.peloton.api.v1alpha.peloton.ResourcePoolIDResource Pool Id
specResourcePoolSpecResourcePool spec
parent.peloton.api.v1alpha.peloton.ResourcePoolIDResource Pool's parent TODO: parent duplicated from ResourcePoolConfig
children.peloton.api.v1alpha.peloton.ResourcePoolIDrepeatedResource Pool's children
usagesResourceUsagerepeatedResource usage for each resource kind
pathResourcePoolPathResource Pool Path

ResourcePoolPath

A fully qualified path to a resource pool in a resource pool hierrarchy. The path to a resource pool can be defined as an absolute path, starting from the root node and separated by a slash.

The resource hierarchy is anchored at a node called the root, designated by a slash "/".

For the below resource hierarchy ; the "compute" resource pool would be desgignated by path: /infrastructure/compute root ├─ infrastructure │ └─ compute └─ marketplace

FieldTypeLabelDescription
valuestring

ResourcePoolSpec

Resource Pool configuration

FieldTypeLabelDescription
revision.peloton.api.v1alpha.peloton.RevisionRevision of the Resource Pool config
namestringName of the resource pool
owning_teamstringOwning team of the pool
ldap_groupsstringrepeatedLDAP groups of the pool
descriptionstringDescription of the resource pool
resourcesResourceSpecrepeatedResource config of the Resource Pool
parent.peloton.api.v1alpha.peloton.ResourcePoolIDResource Pool's parent
policySchedulingPolicyTask Scheduling policy
controller_limitControllerLimitThe controller limit for this resource pool
slack_limitSlackLimitCap on max non-slack resources[mem,disk] in percentage that can be used by revocable task.

ResourceSpec

Resource configuration for a resource

FieldTypeLabelDescription
kindstringType of the resource
reservationdoubleReservation/min of the resource
limitdoubleLimit of the resource
sharedoubleShare on the resource pool
typeReservationTypeReservationType indicates the the type of reservation There are two kind of reservation 1. ELASTIC 2. STATIC

ResourceUsage

FieldTypeLabelDescription
kindstringType of the resource
allocationdoubleAllocation of the resource
slackdoubleslack is the resource which is allocated but not used and mesos will give those resources as revocable offers

SlackLimit

The max limit of resources REVOCABLE(see TaskType) tasks can use in this resource pool. This is defined as a percentage of the resource pool's reservation. If undefined there is no maximum limit for revocable tasks i.e. revocable tasks will not be treated differently. For eg if the resource pool's reservation is defined as:

cpu:100 mem:1000 disk:1000

And the SlackLimit = 10 ,Then the maximum resources the revocable tasks can use is 10% of the reservation, i.e.

mem:100 disk:100

For cpu, it will use revocable resources.

FieldTypeLabelDescription
maxPercentdouble

ReservationType

ReservationType indicates reservation type for the resourcepool

NameNumberDescription
RESERVATION_TYPE_INVALID0
RESERVATION_TYPE_ELASTIC1ELASTIC reservation enables resource pool to be elastic in reservation , which means other resource pool can take resources from this resource pool as well as this resource pool also can take resources from any other resource pool. This is the by default behavior for the resource pool
RESERVATION_TYPE_STATIC2STATIC reservation enables resource pool to be static in reservation , which means irrespective of the demand this resource pool will have atleast reservation as entitlement value. No other resource pool can take resources from this resource pool. If demand for this resource pool is high it can take resources from other resource pools. By default value for reservation type ELASTIC.

SchedulingPolicy

Scheduling policy for Resource Pool.

NameNumberDescription
SCHEDULING_POLICY_INVALID0
SCHEDULING_POLICY_PRIORITY_FIFO1This scheduling policy will return item for highest priority in FIFO order

Top

watch.proto

PodFilter

PodFilter specifies the pod(s) to watch. Watch on pods is restricted to a single job.

FieldTypeLabelDescription
job_id.peloton.api.v1alpha.peloton.JobIDThe JobID of the pods that will be monitored. Mandatory.
pod_names.peloton.api.v1alpha.peloton.PodNamerepeatedNames of the pods to watch. If empty, all pods in the job will be monitored.

StatelessJobFilter

StatelessJobFilter specifies the job(s) to watch.

FieldTypeLabelDescription
job_ids.peloton.api.v1alpha.peloton.JobIDrepeatedThe IDs of the jobs to watch. If unset, all jobs will be monitored.

Top

volume.proto

PersistentVolumeInfo

Persistent volume information.

FieldTypeLabelDescription
volume_id.peloton.api.v1alpha.peloton.VolumeIDID of the persistent volume.
pod_name.peloton.api.v1alpha.peloton.PodNameID of the pod that owns the volume.
hostnamestringHostname of the persisted volume.
stateVolumeStateCurrent state of the volume.
desired_stateVolumeStateGoal state of the volume.
size_mbuint32Volume size in MB.
container_pathstringVolume mount path inside container.
create_timestringVolume creation time.
update_timestringVolume info last update time.

VolumeState

States of a persistent volume

NameNumberDescription
VOLUME_STATE_INVALID0Reserved for future compatibility of new states.
VOLUME_STATE_INITIALIZED1The persistent volume is being initialized.
VOLUME_STATE_CREATED2The persistent volume is created successfully.
VOLUME_STATE_DELETED3The persistent volume is deleted.

Top

pod_svc.proto

BrowsePodSandboxRequest

Request message for PodService.BrowsePodSandbox method

FieldTypeLabelDescription
pod_name.peloton.api.v1alpha.peloton.PodNameThe pod name.
pod_id.peloton.api.v1alpha.peloton.PodIDGet the sandbox path of a particular pod identified using the pod identifier. If not provided, the sandbox path for the latest pod is returned.

BrowsePodSandboxResponse

Response message for PodService.BrowsePodSandbox method Return errors: NOT_FOUND: if the pod is not found. ABORT: if the pod has not been run.

FieldTypeLabelDescription
hostnamestringThe hostname of the sandbox.
portstringThe port of the sandbox.
pathsstringrepeatedThe list of sandbox file paths. TODO: distinguish files and directories in the sandbox
mesos_master_hostnamestringMesos Master hostname and port.
mesos_master_portstring

DeletePodEventsRequest

Request message for PodService.DeletePodEvents method

FieldTypeLabelDescription
pod_name.peloton.api.v1alpha.peloton.PodNameThe pod name.
pod_id.peloton.api.v1alpha.peloton.PodIDDelete the events of a particular pod identified using the pod identifier.

DeletePodEventsResponse

Response message for PodService.DeletePodEvents method Return errors: NOT_FOUND: if the pod is not found.

GetPodCacheRequest

Request message for PodService.GetPodCache method

FieldTypeLabelDescription
pod_name.peloton.api.v1alpha.peloton.PodNameThe pod name.

GetPodCacheResponse

Response message for PodService.GetPodCache method Return errors: NOT_FOUND: if the pod is not found.

FieldTypeLabelDescription
status.peloton.api.v1alpha.pod.PodStatusThe runtime status of the pod.

GetPodEventsRequest

Request message for PodService.GetPodEvents method

FieldTypeLabelDescription
pod_name.peloton.api.v1alpha.peloton.PodNameThe pod name.
pod_id.peloton.api.v1alpha.peloton.PodIDGet the events of a particular pod identified using the pod identifier. If not provided, events for the latest pod are returned.

GetPodEventsResponse

Response message for PodService.GetPodEvents method Return errors: NOT_FOUND: if the pod is not found.

FieldTypeLabelDescription
events.peloton.api.v1alpha.pod.PodEventrepeated

GetPodRequest

Request message for PodService.GetPod method

FieldTypeLabelDescription
pod_name.peloton.api.v1alpha.peloton.PodNameThe pod name.
status_onlyboolIf set to true, only return the pod status and not the configuration.

GetPodResponse

Response message for PodService.GetPod method Return errors: NOT_FOUND: if the pod is not found.

FieldTypeLabelDescription
current.peloton.api.v1alpha.pod.PodInfoReturns the status and configuration (if requested) for the current run of the pod.
previous.peloton.api.v1alpha.pod.PodInforepeatedReturns the status and configuration (if requested) for previous runs of the pod.

RefreshPodRequest

Request message for PodService.RefreshPod method

FieldTypeLabelDescription
pod_name.peloton.api.v1alpha.peloton.PodNameThe pod name.

RefreshPodResponse

Response message for PodService.RefreshPod method Return errors: NOT_FOUND: if the pod is not found.

RestartPodRequest

Request message for PodService.RestartPod method

FieldTypeLabelDescription
pod_name.peloton.api.v1alpha.peloton.PodNameThe pod name.

RestartPodResponse

Response message for PodService.RestartPod method Return errors: NOT_FOUND: if the pod is not found.

StartPodRequest

Request message for PodService.StartPod method

FieldTypeLabelDescription
pod_name.peloton.api.v1alpha.peloton.PodNameThe pod name.

StartPodResponse

Response message for PodService.StartPod method Return errors: NOT_FOUND: if the pod is not found.

StopPodRequest

Request message for PodService.StopPod method

FieldTypeLabelDescription
pod_name.peloton.api.v1alpha.peloton.PodNameThe pod name.

StopPodResponse

Response message for PodService.StopPod method Return errors: NOT_FOUND: if the pod is not found.

PodService

Pod service defines the pod related methods.

Methods which mutate the state of the pod.

Method NameRequest TypeResponse TypeDescription
StartPodStartPodRequestStartPodResponseStart the pod. Will be a no-op for pod that is currently running. The pod is started asynchronously after the API call returns.
StopPodStopPodRequestStopPodResponseStop the pod. Will be no-op for a pod that is currently stopped. The pod is stopped asynchronously after the API call returns.
RestartPodRestartPodRequestRestartPodResponseRestart a the pod. Will start a pod that is currently stopped. Will first stop the pod that is currently running and then start it again. This is an asynchronous call.
GetPodGetPodRequestGetPodResponseGet the info of a pod in a job. Return the current run as well as the terminal state of previous runs.
GetPodEventsGetPodEventsRequestGetPodEventsResponseGet the state transitions for a pod (pod events) for a given run of the pod.
BrowsePodSandboxBrowsePodSandboxRequestBrowsePodSandboxResponseReturn the list of file paths inside the sandbox for a given run of a pod. The client can use the Mesos Agent HTTP endpoints to read and download the files. http://mesos.apache.org/documentation/latest/endpoints
RefreshPodRefreshPodRequestRefreshPodResponseAllows user to load pod runtime state from DB and re-execute the action associated with current state.
GetPodCacheGetPodCacheRequestGetPodCacheResponseGet the cache of a pod stored in Peloton.
DeletePodEventsDeletePodEventsRequestDeletePodEventsResponseDelete the events of a given run of a pod. This is used to prevent the events for a given pod from growing without bounds.

Top

host_svc.proto

CompleteMaintenanceRequest

Request message for HostService.CompleteMaintenance method.

FieldTypeLabelDescription
hostnamesstringrepeatedList of hosts put be brought back up

CompleteMaintenanceResponse

Response message for HostService.CompleteMaintenance method. Return errors: NOT_FOUND: if the hosts are not found.

QueryHostsRequest

Request message for HostService.QueryHosts method.

FieldTypeLabelDescription
host_states.peloton.api.v1alpha.host.HostStaterepeatedList of host states to query the hosts. Will return all hosts if the list is empty.

QueryHostsResponse

Response message for HostService.QueryHosts method. Return errors:

FieldTypeLabelDescription
host_infos.peloton.api.v1alpha.host.HostInforepeatedList of hosts that match the host query criteria.

StartMaintenanceRequest

Request message for HostService.StartMaintenance method.

FieldTypeLabelDescription
hostnamesstringrepeatedList of hosts to be put into maintenance

StartMaintenanceResponse

Response message for HostService.StartMaintenance method. Return errors: NOT_FOUND: if the hosts are not found.

HostService

HostService defines the host related methods such as query hosts, start maintenance, complete maintenance etc.

Method NameRequest TypeResponse TypeDescription
QueryHostsQueryHostsRequestQueryHostsResponseGet hosts which are in one of the specified states
StartMaintenanceStartMaintenanceRequestStartMaintenanceResponseStart maintenance on the specified hosts
CompleteMaintenanceCompleteMaintenanceRequestCompleteMaintenanceResponseComplete maintenance on the specified hosts

Top

respool_svc.proto

CreateResourcePoolRequest

Request message for ResourcePoolService.CreateResourcePool method.

FieldTypeLabelDescription
respool_id.peloton.api.v1alpha.peloton.ResourcePoolIDThe unique resource pool UUID specified by the client. This can be used by the client to re-create a failed resource pool without the side-effect of creating duplicated resource pool. If unset, the server will create a new UUID for the resource pool.
specResourcePoolSpecThe detailed configuration of the resource pool be to created.

CreateResourcePoolResponse

Response message for ResourcePoolService.CreateResourcePool method. Return errors: ALREADY_EXISTS: if the resource pool already exists. INVALID_ARGUMENT: if the resource pool config is invalid.

FieldTypeLabelDescription
respool_id.peloton.api.v1alpha.peloton.ResourcePoolIDThe ID of the newly created resource pool.

DeleteResourcePoolRequest

Request message for ResourcePoolService.DeleteResourcePool method.

FieldTypeLabelDescription
respool_id.peloton.api.v1alpha.peloton.ResourcePoolIDThe ID of the resource pool to be deleted.

DeleteResourcePoolResponse

Response message for ResourcePoolService.DeleteResourcePool method. Return errors: NOT_FOUND: if the resource pool is not found. INVALID_ARGUMENT: if the resource pool is not leaf node. FAILED_PRECONDITION: if the resource pool is busy. INTERNAL: if the resource pool fail to delete for internal errors.

GetResourcePoolRequest

Request message for ResourcePoolService.GetResourcePool method.

FieldTypeLabelDescription
respool_id.peloton.api.v1alpha.peloton.ResourcePoolIDThe ID of the resource pool to get the detailed information.
include_child_poolsboolWhether or not to include the resource pool info of the direct children

GetResourcePoolResponse

Response message for ResourcePoolService.GetResourcePool method. Return errors: NOT_FOUND: if the resource pool is not found.

FieldTypeLabelDescription
respoolResourcePoolInfoThe detailed information of the resource pool.
child_respoolsResourcePoolInforepeatedThe list of child resource pools.

LookupResourcePoolIDRequest

Request message for ResourcePoolService.LookupResourcePoolID method.

FieldTypeLabelDescription
pathResourcePoolPathThe resource pool path to look up the resource pool ID.

LookupResourcePoolIDResponse

Response message for ResourcePoolService.LookupResourcePoolID method. Response message for ResourcePoolService.UpdateResourcePool method. Return errors: NOT_FOUND: if the resource pool is not found. INVALID_ARGUMENT: if the resource pool path is invalid.

FieldTypeLabelDescription
respool_id.peloton.api.v1alpha.peloton.ResourcePoolIDThe resource pool ID for the given resource pool path.

QueryResourcePoolsRequest

Request message for ResourcePoolService.QueryResourcePools method.

TODO Filters

QueryResourcePoolsResponse

Response message for ResourcePoolService.QueryResourcePools method. Return errors:

FieldTypeLabelDescription
respoolsResourcePoolInforepeated

UpdateResourcePoolRequest

Request message for ResourcePoolService.UpdateResourcePool method.

FieldTypeLabelDescription
respool_id.peloton.api.v1alpha.peloton.ResourcePoolIDThe ID of the resource pool to update the configuration.
specResourcePoolSpecThe configuration of the resource pool to be updated.

UpdateResourcePoolResponse

Response message for ResourcePoolService.UpdateResourcePool method. Return errors: NOT_FOUND: if the resource pool is not found.

ResourcePoolService

ResourcePoolService defines the resource pool related methods such as create, get, delete and upgrade resource pools.

Method NameRequest TypeResponse TypeDescription
CreateResourcePoolCreateResourcePoolRequestCreateResourcePoolResponseCreate a resource pool entity for a given config
GetResourcePoolGetResourcePoolRequestGetResourcePoolResponseGet the resource pool entity
DeleteResourcePoolDeleteResourcePoolRequestDeleteResourcePoolResponseDelete a resource pool entity
UpdateResourcePoolUpdateResourcePoolRequestUpdateResourcePoolResponseModify a resource pool entity
LookupResourcePoolIDLookupResourcePoolIDRequestLookupResourcePoolIDResponseLookup the resource pool ID for a given resource pool path
QueryResourcePoolsQueryResourcePoolsRequestQueryResourcePoolsResponseQuery the resource pools.

Top

stateless.proto

CreateSpec

Configuration of a job creation.

FieldTypeLabelDescription
batch_sizeuint32Batch size for the creation which controls how many instances may be created at the same time.
max_instance_retriesuint32Maximum number of times a failing instance will be retried during the creation. If the value is 0, the instance can be retried for infinite times.
max_tolerable_instance_failuresuint32Maximum number of instance failures before the creation is declared to be failed. If the value is 0, there is no limit for max failure instances and the creation is marked successful even if all of the instances fail.
start_pausedboolIf set to true, indicates that the creation should start in the paused state, requiring an explicit resume to roll forward.

JobInfo

Information of a job, such as job spec and status

FieldTypeLabelDescription
job_id.peloton.api.v1alpha.peloton.JobIDJob ID
specJobSpecJob configuration
statusJobStatusJob runtime status

JobSpec

Stateless job configuration.

FieldTypeLabelDescription
revision.peloton.api.v1alpha.peloton.RevisionRevision of the job config
namestringName of the job
ownerstringOwner of the job
owning_teamstringOwning team of the job
ldap_groupsstringrepeatedLDAP groups of the job
descriptionstringDescription of the job
labels.peloton.api.v1alpha.peloton.LabelrepeatedList of user-defined labels for the job
instance_countuint32Number of instances of the job
slaSlaSpecSLA config of the job
default_spec.peloton.api.v1alpha.pod.PodSpecDefault pod configuration of the job
instance_specJobSpec.InstanceSpecEntryrepeatedInstance specific pod config which overwrites the default one
respool_id.peloton.api.v1alpha.peloton.ResourcePoolIDResource Pool ID where this job belongs to

JobSpec.InstanceSpecEntry

FieldTypeLabelDescription
keyuint32
value.peloton.api.v1alpha.pod.PodSpec

JobStatus

The current runtime status of a Job.

FieldTypeLabelDescription
revision.peloton.api.v1alpha.peloton.RevisionRevision of the current job status. Version in the revision is incremented every time job status changes. Thus, it can be used to order the different job status updates.
stateJobStateState of the job
creation_timestringThe time when the job was created. The time is represented in RFC3339 form with UTC timezone.
pod_statsJobStatus.PodStatsEntryrepeatedThe number of pods grouped by each pod state. The map key is the pod.PodState in string format and the map value is the number of tasks in the particular state.
desired_stateJobStateGoal state of the job.
version.peloton.api.v1alpha.peloton.EntityVersionThe current version of the job. It is used to implement optimistic concurrency control for all job write APIs. The current job configuration can be fetched based on the current resource version.
workflow_statusWorkflowStatusStatus of ongoing update/restart workflow.
pod_configuration_version_statsJobStatus.PodConfigurationVersionStatsEntryrepeatedThe number of tasks grouped by which configuration version they are on. The map key is the job configuration version and the map value is the number of tasks using that particular job configuration version. The job configuration version in the map key can be fed as the value of the entity version in the GetJobRequest to fetch the job configuration.

JobStatus.PodConfigurationVersionStatsEntry

FieldTypeLabelDescription
keystring
valueuint32

JobStatus.PodStatsEntry

FieldTypeLabelDescription
keystring
valueuint32

JobSummary

Summary of job spec and status. The summary will be returned by List or Query API calls. These calls will return a large number of jobs, so the content in the job summary has to be kept minimal.

FieldTypeLabelDescription
job_id.peloton.api.v1alpha.peloton.JobIDJob ID
namestringName of the job
ownerstringOwner of the job
owning_teamstringOwning team of the job
labels.peloton.api.v1alpha.peloton.LabelrepeatedList of user-defined labels for the job
instance_countuint32Number of instances of the job
respool_id.peloton.api.v1alpha.peloton.ResourcePoolIDResource Pool ID where this job belongs to
statusJobStatusJob runtime status

QuerySpec

QuerySpec specifies the list of query criteria for jobs. All indexed fields should be part of this message. And all fields in this message have to be indexed too.

FieldTypeLabelDescription
pagination.peloton.api.v1alpha.query.PaginationSpecThe spec of how to do pagination for the query results.
labels.peloton.api.v1alpha.peloton.LabelrepeatedList of labels to query the jobs. Will match all jobs if the list is empty.
keywordsstringrepeatedList of keywords to query the jobs. Will match all jobs if the list is empty. When set, will do a wildcard match on owner, name, labels, description.
job_statesJobStaterepeatedList of job states to query the jobs. Will match all jobs if the list is empty.
respool.peloton.api.v1alpha.respool.ResourcePoolPathThe resource pool to query the jobs. Will match jobs from all resource pools if unset.
ownerstringQuery jobs by owner. This is case sensitive and will look for jobs with owner matching the exact owner string. Will match all jobs if owner is unset.
namestringQuery jobs by name. This is case sensitive and will look for jobs with name matching the name string. Will support partial name match. Will match all jobs if name is unset.
creation_time_range.peloton.api.v1alpha.peloton.TimeRangeQuery jobs by creation time range. This will look for all jobs that were created within a specified time range. This search will operate based on job creation time.
completion_time_range.peloton.api.v1alpha.peloton.TimeRangeQuery jobs by completion time range. This will look for all jobs that were completed within a specified time range. This search will operate based on job completion time.

SlaSpec

SLA configuration for a stateless job

FieldTypeLabelDescription
priorityuint32Priority of a job. Higher value takes priority over lower value when making scheduling decisions as well as preemption decisions.
preemptibleboolWhether all the job instances are preemptible. If so, it might be scheduled elastic resources from other resource pools and subject to preemption when the demands of other resource pools increase. For stateless jobs, this field will overrule preemptible configuration in the pod spec.
revocableboolWhether all the job instances are revocable. If so, it might be scheduled using revocable resources and subject to preemption when there is resource contention on the host. For stateless jobs, this field will overrule revocable configuration in the pod spec.
maximum_unavailable_instancesuint32Maximum number of job instances which can be unavailable at a given time.

UpdateSpec

Configuration of a job update.

FieldTypeLabelDescription
batch_sizeuint32Batch size for the update which controls how many instances may be updated at the same time.
rollback_on_failureboolIf configured, the update be automatically rolled back to the previous job configuration on failure.
max_instance_retriesuint32Maximum number of times a failing instance will be retried during the update. If the value is 0, the instance can be retried for infinite times.
max_tolerable_instance_failuresuint32Maximum number of instance failures before the update is declared to be failed. If the value is 0, there is no limit for max failure instances and the update is marked successful even if all of the instances fail.
start_pausedboolIf set to true, indicates that the update should start in the paused state, requiring an explicit resume to roll forward.
in_placeboolIf set to true, peloton would try to place the task restarted/updated on the host it previously run on. It is best effort, and has no guarantee of success.

WorkflowEvent

WorkflowEvents are workflow state change events for a job or pod on workflow operations

FieldTypeLabelDescription
typeWorkflowTypeWorkflow type.
timestampstringTimestamp of the event represented in RFC3339 form with UTC timezone.
stateWorkflowStateCurrent runtime state of the workflow.

WorkflowInfo

Information about a workflow including its status and specification

FieldTypeLabelDescription
statusWorkflowStatusWorkflow status
update_specUpdateSpecUpdate specification for update workflow
restart_batch_sizeuint32Batch size provided for restart workflow
restart_ranges.peloton.api.v1alpha.pod.InstanceIDRangerepeatedInstance ranges provided for restart workflow
opaque_data.peloton.api.v1alpha.peloton.OpaqueDataOpaque data supplied by the client
eventsWorkflowEventrepeatedjob workflow events represents update state changes
instances_added.peloton.api.v1alpha.pod.InstanceIDRangerepeatedInstances added by update workflow
instances_removed.peloton.api.v1alpha.pod.InstanceIDRangerepeatedInstances removed by update workflow
instances_updated.peloton.api.v1alpha.pod.InstanceIDRangerepeatedInstances updated by update workflow

WorkflowStatus

Runtime status of a job workflow.

FieldTypeLabelDescription
typeWorkflowTypeWorkflow type.
stateWorkflowStateCurrent runtime state of the workflow.
num_instances_completeduint32Number of instances completed.
num_instances_remaininguint32Number of instances remaining.
num_instances_faileduint32Number of instances which failed to come up after the workflow.
instances_currentuint32repeatedCurrent instances being operated on.
version.peloton.api.v1alpha.peloton.EntityVersionJob version the workflow moved the job object to.
prev_version.peloton.api.v1alpha.peloton.EntityVersionPrevious job version of the job object.
creation_timestringThe time when the workflow was created. The time is represented in RFC3339 form with UTC timezone.
update_timestringThe time when the workflow was last updated. The time is represented in RFC3339 form with UTC timezone.
prev_stateWorkflowStatePrevious runtime state of the workflow.

JobState

Runtime states of a Job.

NameNumberDescription
JOB_STATE_INVALID0Invalid job state.
JOB_STATE_INITIALIZED1The job has been initialized and persisted in DB.
JOB_STATE_PENDING2All tasks have been created and persisted in DB, but no task is RUNNING yet.
JOB_STATE_RUNNING3Any of the tasks in the job is in RUNNING state.
JOB_STATE_SUCCEEDED4All tasks in the job are in SUCCEEDED state.
JOB_STATE_FAILED5All tasks in the job are in terminated state and one or more tasks is in FAILED state.
JOB_STATE_KILLED6All tasks in the job are in terminated state and one or more tasks in the job is killed by the user.
JOB_STATE_KILLING7All tasks in the job have been requested to be killed by the user.
JOB_STATE_UNINITIALIZED8The job is partially created and is not ready to be scheduled
JOB_STATE_DELETED9The job has been deleted.

WorkflowState

Runtime state of a job workflow.

NameNumberDescription
WORKFLOW_STATE_INVALID0Invalid protobuf value
WORKFLOW_STATE_INITIALIZED1The operation has been created but not started yet.
WORKFLOW_STATE_ROLLING_FORWARD2The workflow is rolling forward
WORKFLOW_STATE_PAUSED3The workflow has been paused
WORKFLOW_STATE_SUCCEEDED4The workflow has completed successfully
WORKFLOW_STATE_ABORTED5The update was aborted/cancelled
WORKFLOW_STATE_FAILED6The workflow has failed to complete.
WORKFLOW_STATE_ROLLING_BACKWARD7The update is rolling backward
WORKFLOW_STATE_ROLLED_BACK8The update was rolled back due to failure

WorkflowType

The different types of job rolling workflows supported.

NameNumberDescription
WORKFLOW_TYPE_INVALID0Invalid protobuf value.
WORKFLOW_TYPE_UPDATE1Job update workflow.
WORKFLOW_TYPE_RESTART2Restart pods in a job.

Top

watch_svc.proto

CancelRequest

CancelRequest is request for method WatchService.Cancel

FieldTypeLabelDescription
watch_iduint64ID of the watch session to cancel.

CancelResponse

CancelRequest is response for method WatchService.Cancel Return errors: NOT_FOUND: Watch ID not found

WatchRequest

WatchRequest is request for method WatchService.Watch. It specifies the objects that should be monitored for changes.

FieldTypeLabelDescription
start_revisionuint64The revision from which to start getting changes. If unspecified, the server will return changes after the current revision. The server may choose to maintain only a limited number of historical revisions; a start revision older than the oldest revision available at the server will result in an error and the watch stream will be closed. Note: Initial implementations will not support historical revisions, so if the client sets a value for this field, it will receive an OUT_OF_RANGE error immediately.
stateless_job_filter.peloton.api.v1alpha.watch.StatelessJobFilterCriteria to select the stateless jobs to watch. If unset, no jobs will be watched.
pod_filter.peloton.api.v1alpha.watch.PodFilterCriteria to select the pods to watch. If unset, no pods will be watched.

WatchResponse

WatchResponse is response method for WatchService.Watch. It contains the objects that have changed. Return errors: OUT_OF_RANGE: Requested start-revision is too old INVALID_ARGUMENT: Requested start-revision is newer than server revision RESOURCE_EXHAUSTED: Number of concurrent watches exceeded CANCELLED: Watch cancelled

FieldTypeLabelDescription
watch_iduint64Unique identifier for the watch session
revisionuint64Server revision when the response results were created
stateless_jobs.peloton.api.v1alpha.job.stateless.JobSummaryrepeatedStateless jobs that have changed.
stateless_jobs_not_found.peloton.api.v1alpha.peloton.JobIDrepeatedStateless job IDs that were not found.
pods.peloton.api.v1alpha.pod.PodSummaryrepeatedPods that have changed.
pods_not_found.peloton.api.v1alpha.peloton.PodNamerepeatedNames of pods that were not found.

WatchService

Watch service defines the methods for getting notifications on changes to Peloton objects. A watch is long-running request where a client specifies the kind of objects that it is interested in as well as a revision, either current or historical. The server continuously streams back changes from that revision till the client cancels the watch (or the connection is lost). The server may support only a limited amount of historical revisions to keep the load on the server reasonable. Historical revisions are mainly provided for clients to recover from transient errors without having to rebuild a snapshot of the system (which can be expensive for both sides). Also, implementations may limit the number of concurrent watch requests that can be serviced so that the server is not overloaded.

Method NameRequest TypeResponse TypeDescription
WatchWatchRequestWatchResponseCreate a watch to get notified about changes to Peloton objects. Changed objects are streamed back to the caller till the watch is cancelled.
CancelCancelRequestCancelResponseCancel a watch. The watch stream will get an error indicating watch was cancelled and the stream will be closed.

Top

volume_svc.proto

DeleteVolumeRequest

Request message for VolumeService.DeleteVolume method.

FieldTypeLabelDescription
volume_id.peloton.api.v1alpha.peloton.VolumeIDvolume id for the delete request.

DeleteVolumeResponse

Response message for VolumeService.DeleteVolume method. Return errors: NOT_FOUND: if the volume is not found.

GetVolumeRequest

Request message for VolumeService.GetVolumes method.

FieldTypeLabelDescription
volume_id.peloton.api.v1alpha.peloton.VolumeIDthe volume id.

GetVolumeResponse

Response message for VolumeService.GetVolumes method. Return errors: NOT_FOUND: if the volume is not found.

FieldTypeLabelDescription
result.peloton.api.v1alpha.volume.PersistentVolumeInfovolume info result.

ListVolumesRequest

Request message for VolumeService.ListVolumes method.

FieldTypeLabelDescription
job_id.peloton.api.v1alpha.peloton.JobIDjob ID for the volumes.

ListVolumesResponse

Response message for VolumeService.ListVolumes method. Return errors: NOT_FOUND: if the job is not found.

FieldTypeLabelDescription
volumesListVolumesResponse.VolumesEntryrepeatedvolumes result map from volume uuid to volume info.

ListVolumesResponse.VolumesEntry

FieldTypeLabelDescription
keystring
value.peloton.api.v1alpha.volume.PersistentVolumeInfo

VolumeService

Volume Manager service interface

Method NameRequest TypeResponse TypeDescription
ListVolumesListVolumesRequestListVolumesResponseList associated volumes for given job.
GetVolumeGetVolumeRequestGetVolumeResponseGet volume data.
DeleteVolumeDeleteVolumeRequestDeleteVolumeResponseDelete a persistent volume.

Top

stateless_svc.proto

AbortJobWorkflowRequest

Request message for JobService.AbortJobWorkflow method.

FieldTypeLabelDescription
job_id.peloton.api.v1alpha.peloton.JobIDThe job identifier.
version.peloton.api.v1alpha.peloton.EntityVersionThe current version of the job.
opaque_data.peloton.api.v1alpha.peloton.OpaqueDataOpaque data supplied by the client

AbortJobWorkflowResponse

Response message for JobService.AbortJobWorkflow method. Response message for JobService.RestartJob method. Return errors: NOT_FOUND: if the job ID is not found. ABORTED: if the job version is invalid.

FieldTypeLabelDescription
version.peloton.api.v1alpha.peloton.EntityVersionThe new version of the job.

CreateJobRequest

Request message for JobService.CreateJob method.

FieldTypeLabelDescription
job_id.peloton.api.v1alpha.peloton.JobIDThe unique job UUID specified by the client. This can be used by the client to re-create a deleted job. If unset, the server will create a new UUID for the job for each invocation.
spec.peloton.api.v1alpha.job.stateless.JobSpecThe configuration of the job to be created.
secrets.peloton.api.v1alpha.peloton.SecretrepeatedExperimental: This is a batch feature. The implementation is subject to change (or removal) from stateless. The list of secrets for this job
create_spec.peloton.api.v1alpha.job.stateless.CreateSpecThe creation SLA specification.
opaque_data.peloton.api.v1alpha.peloton.OpaqueDataOpaque data supplied by the client

CreateJobResponse

Response message for JobService.CreateJob method. Return errors: ALREADY_EXISTS: if the job ID already exists INVALID_ARGUMENT: if the job ID or job config is invalid. NOT_FOUND: if the resource pool is not found.

FieldTypeLabelDescription
job_id.peloton.api.v1alpha.peloton.JobIDThe job ID of the newly created job. Will be the same as the one in CreateJobRequest if provided. Otherwise, a new job ID will be generated by the server.
version.peloton.api.v1alpha.peloton.EntityVersionThe current version of the job.

DeleteJobRequest

Request message for JobService.DeleteJob method.

FieldTypeLabelDescription
job_id.peloton.api.v1alpha.peloton.JobIDThe job to be deleted.
version.peloton.api.v1alpha.peloton.EntityVersionThe current version of the job. It is used to implement optimistic concurrency control.
forceboolIf set to true, it will force a delete of the job even if it is running. The job will be first stopped and deleted. This step cannot be undone, and the job cannot be re-created (with same uuid) till the delete is complete. So, it is recommended to not set force to true.

DeleteJobResponse

Response message for JobService.DeleteJob method. Response message for JobService.RestartJob method. Return errors: NOT_FOUND: if the job ID is not found. ABORTED: if the job version is invalid or job is still running. FailedPrecondition: if the job has not been stopped before delete.

GetJobCacheRequest

Request message for JobService.GetJobCache method.

FieldTypeLabelDescription
job_id.peloton.api.v1alpha.peloton.JobIDThe job ID to look up the job.

GetJobCacheResponse

Response message for JobService.GetJobCache method. Return errors: NOT_FOUND: if the job ID is not found.

FieldTypeLabelDescription
spec.peloton.api.v1alpha.job.stateless.JobSpecThe job configuration in cache of the matching job.
status.peloton.api.v1alpha.job.stateless.JobStatusThe job runtime in cache of the matching job.

GetJobIDFromJobNameRequest

Request message for JobService.GetJobIDFromJobName method.

FieldTypeLabelDescription
job_namestringJob name to lookup for job UUID.

GetJobIDFromJobNameResponse

Response message for JobService.GetJobIDFromJobName method. Return errors: NOT_FOUND: if the job name is not found.

FieldTypeLabelDescription
job_id.peloton.api.v1alpha.peloton.JobIDrepeatedThe job UUIDs for the job name. Job UUIDs are sorted by descending create timestamp.

GetJobRequest

Request message for JobService.GetJob method.

FieldTypeLabelDescription
job_id.peloton.api.v1alpha.peloton.JobIDThe job ID to look up the job.
version.peloton.api.v1alpha.peloton.EntityVersionThe version of the job object to fetch. If not provided, then the latest job configuration specification and runtime status are returned. If provided, only the job configuration specification (and no runtime) at a given version is returned.
summary_onlyboolIf set to true, only return the job summary.

GetJobResponse

Response message for JobService.GetJob method. Return errors: NOT_FOUND: if the job ID is not found.

FieldTypeLabelDescription
job_info.peloton.api.v1alpha.job.stateless.JobInfoThe configuration specification and runtime status of the job.
summary.peloton.api.v1alpha.job.stateless.JobSummaryThe job summary.
secrets.peloton.api.v1alpha.peloton.SecretrepeatedThe list of secrets for this job, secret.Value will be empty. SecretID and path will be populated, so that caller can identify which secret is associated with this job.
workflow_info.peloton.api.v1alpha.job.stateless.WorkflowInfoInformation about the current/last completed workflow including its state and specification.

GetReplaceJobDiffRequest

Request message for JobService.GetReplaceJobDiffRequest method.

FieldTypeLabelDescription
job_id.peloton.api.v1alpha.peloton.JobIDThe job ID to be updated.
version.peloton.api.v1alpha.peloton.EntityVersionThe current version of the job.
spec.peloton.api.v1alpha.job.stateless.JobSpecThe new job configuration to be applied.

GetReplaceJobDiffResponse

Response message for JobService.GetReplaceJobDiff method. Return errors: INVALID_ARGUMENT: if the job ID or job config is invalid. NOT_FOUND: if the job ID is not found. ABORTED: if the job version is invalid.

FieldTypeLabelDescription
instances_added.peloton.api.v1alpha.pod.InstanceIDRangerepeatedInstances which are being added
instances_removed.peloton.api.v1alpha.pod.InstanceIDRangerepeatedInstances which are being removed
instances_updated.peloton.api.v1alpha.pod.InstanceIDRangerepeatedInstances which are being updated
instances_unchanged.peloton.api.v1alpha.pod.InstanceIDRangerepeatedInstances which are unchanged

GetWorkflowEventsRequest

Request message for JobService.GetWorkflowEvents

FieldTypeLabelDescription
job_id.peloton.api.v1alpha.peloton.JobIDThe job ID to look up the job.
instance_iduint32The instance to get workflow events.

GetWorkflowEventsResponse

Response message for JobService.GetWorkflowEvents Return errors: NOT_FOUND: if the job ID is not found.

FieldTypeLabelDescription
events.peloton.api.v1alpha.job.stateless.WorkflowEventrepeatedWorkflow events for the given workflow

ListJobUpdatesRequest

Request message for JobService.ListJobUpdates method.

FieldTypeLabelDescription
job_id.peloton.api.v1alpha.peloton.JobIDThe job identifier.

ListJobUpdatesResponse

Response message for JobService.ListJobUpdates method. Return errors: NOT_FOUND: if the job ID is not found.

FieldTypeLabelDescription
workflow_infos.peloton.api.v1alpha.job.stateless.WorkflowInforepeated

ListJobsRequest

Request message for JobService.ListJobs method.

ListJobsResponse

Response message for JobService.ListJobs method.

FieldTypeLabelDescription
jobs.peloton.api.v1alpha.job.stateless.JobSummaryrepeatedList of all jobs.

ListPodsRequest

Request message for JobService.ListPods method.

FieldTypeLabelDescription
job_id.peloton.api.v1alpha.peloton.JobIDThe job identifier of the pods to list.
range.peloton.api.v1alpha.pod.InstanceIDRangeThe instance ID range of the pods to list. If unset, all pods in the job will be returned.

ListPodsResponse

Response message for JobService.ListPods method. Return errors: NOT_FOUND: if the job ID is not found.

FieldTypeLabelDescription
pods.peloton.api.v1alpha.pod.PodSummaryrepeatedPod summary for all matching pods.

PatchJobRequest

Request message for JobService.PatchJob method.

FieldTypeLabelDescription
job_id.peloton.api.v1alpha.peloton.JobIDThe job ID to be updated.
version.peloton.api.v1alpha.peloton.EntityVersionThe current version of the job. It is used to implement optimistic concurrency control.
spec.peloton.api.v1alpha.job.stateless.JobSpecThe new job configuration to be patched.
secrets.peloton.api.v1alpha.peloton.SecretrepeatedThe list of secrets for this job
update_spec.peloton.api.v1alpha.job.stateless.UpdateSpecThe update SLA specification.
opaque_data.peloton.api.v1alpha.peloton.OpaqueDataOpaque data supplied by the client

PatchJobResponse

Response message for JobService.PatchJob method. Return errors: INVALID_ARGUMENT: if the job ID or job config is invalid. NOT_FOUND: if the job ID is not found. ABORTED: if the job version is invalid.

FieldTypeLabelDescription
version.peloton.api.v1alpha.peloton.EntityVersionThe new version of the job.

PauseJobWorkflowRequest

Request message for JobService.PauseJobWorkflow method.

FieldTypeLabelDescription
job_id.peloton.api.v1alpha.peloton.JobIDThe job identifier.
version.peloton.api.v1alpha.peloton.EntityVersionThe current version of the job.
opaque_data.peloton.api.v1alpha.peloton.OpaqueDataOpaque data supplied by the client

PauseJobWorkflowResponse

Response message for JobService.PauseJobWorkflow method. Response message for JobService.RestartJob method. Return errors: NOT_FOUND: if the job ID is not found. ABORTED: if the job version is invalid.

FieldTypeLabelDescription
version.peloton.api.v1alpha.peloton.EntityVersionThe new version of the job.

QueryJobsRequest

Request message for JobService.QueryJobs method.

FieldTypeLabelDescription
spec.peloton.api.v1alpha.job.stateless.QuerySpecThe spec of query criteria for the jobs.

QueryJobsResponse

Response message for JobService.QueryJobs method. Return errors: INVALID_ARGUMENT: if the resource pool path or job states are invalid.

FieldTypeLabelDescription
records.peloton.api.v1alpha.job.stateless.JobSummaryrepeatedList of jobs that match the job query criteria.
pagination.peloton.api.v1alpha.query.PaginationPagination result of the job query.
spec.peloton.api.v1alpha.job.stateless.QuerySpecReturn the spec of query criteria from the request.

QueryPodsRequest

Request message for JobService.QueryPods method.

FieldTypeLabelDescription
job_id.peloton.api.v1alpha.peloton.JobIDThe job identifier of the pods to query.
spec.peloton.api.v1alpha.pod.QuerySpecThe spec of query criteria for the pods.
pagination.peloton.api.v1alpha.query.PaginationSpecThe spec of how to do pagination for the query results.
summary_onlyboolIf set to true, only return the pod status and not the configuration.

QueryPodsResponse

Response message for JobService.QueryPods method. Return errors: NOT_FOUND: if the job ID is not found.

FieldTypeLabelDescription
pods.peloton.api.v1alpha.pod.PodInforepeatedList of pods that match the pod query criteria.
pagination.peloton.api.v1alpha.query.PaginationPagination result of the pod query.

RefreshJobRequest

Request message for JobService.RefreshJob method.

FieldTypeLabelDescription
job_id.peloton.api.v1alpha.peloton.JobIDThe job ID to look up the job.

RefreshJobResponse

Response message for JobService.RefreshJob method. Return errors: NOT_FOUND: if the job ID is not found.

ReplaceJobRequest

Request message for JobService.ReplaceJob method.

FieldTypeLabelDescription
job_id.peloton.api.v1alpha.peloton.JobIDThe job ID to be updated.
version.peloton.api.v1alpha.peloton.EntityVersionThe current version of the job. It is used to implement optimistic concurrency control.
spec.peloton.api.v1alpha.job.stateless.JobSpecThe new job configuration to be applied.
secrets.peloton.api.v1alpha.peloton.SecretrepeatedThe list of secrets for this job
update_spec.peloton.api.v1alpha.job.stateless.UpdateSpecThe update SLA specification.
opaque_data.peloton.api.v1alpha.peloton.OpaqueDataOpaque data supplied by the client

ReplaceJobResponse

Response message for JobService.ReplaceJob method. Return errors: INVALID_ARGUMENT: if the job ID or job config is invalid. NOT_FOUND: if the job ID is not found. ABORTED: if the job version is invalid.

FieldTypeLabelDescription
version.peloton.api.v1alpha.peloton.EntityVersionThe new version of the job.

RestartJobRequest

Request message for JobService.RestartJob method.

FieldTypeLabelDescription
job_id.peloton.api.v1alpha.peloton.JobIDThe job to restart.
version.peloton.api.v1alpha.peloton.EntityVersionThe current version of the job. It is used to implement optimistic concurrency control.
batch_sizeuint32Batch size for the restart request which controls how many instances may be restarted at the same time.
ranges.peloton.api.v1alpha.pod.InstanceIDRangerepeatedThe pods to restart, default to all.
opaque_data.peloton.api.v1alpha.peloton.OpaqueDataOpaque data supplied by the client

RestartJobResponse

Response message for JobService.RestartJob method. Return errors: NOT_FOUND: if the job ID is not found. ABORTED: if the job version is invalid.

FieldTypeLabelDescription
version.peloton.api.v1alpha.peloton.EntityVersionThe new version of the job.

ResumeJobWorkflowRequest

Request message for JobService.ResumeJobWorkflow method.

FieldTypeLabelDescription
job_id.peloton.api.v1alpha.peloton.JobIDThe job identifier.
version.peloton.api.v1alpha.peloton.EntityVersionThe current version of the job.
opaque_data.peloton.api.v1alpha.peloton.OpaqueDataOpaque data supplied by the client

ResumeJobWorkflowResponse

Response message for JobService.ResumeJobWorkflow method. Response message for JobService.RestartJob method. Return errors: NOT_FOUND: if the job ID is not found. ABORTED: if the job version is invalid.

FieldTypeLabelDescription
version.peloton.api.v1alpha.peloton.EntityVersionThe new version of the job.

StartJobRequest

Request message for JobService.StartJob method.

FieldTypeLabelDescription
job_id.peloton.api.v1alpha.peloton.JobIDThe job to start
version.peloton.api.v1alpha.peloton.EntityVersionThe current version of the job. It is used to implement optimistic concurrency control.

StartJobResponse

Response message for JobService.StartJob method. Response message for JobService.RestartJob method. Return errors: NOT_FOUND: if the job ID is not found. ABORTED: if the job version is invalid.

FieldTypeLabelDescription
version.peloton.api.v1alpha.peloton.EntityVersionThe new version of the job.

StopJobRequest

Request message for JobService.StopJob method.

FieldTypeLabelDescription
job_id.peloton.api.v1alpha.peloton.JobIDThe job to stop
version.peloton.api.v1alpha.peloton.EntityVersionThe current version of the job. It is used to implement optimistic concurrency control.

StopJobResponse

Response message for JobService.StopJob method. Response message for JobService.RestartJob method. Return errors: NOT_FOUND: if the job ID is not found. ABORTED: if the job version is invalid.

FieldTypeLabelDescription
version.peloton.api.v1alpha.peloton.EntityVersionThe new version of the job.

JobService

Job service defines the job related methods such as create, get, query and kill jobs.

Methods which mutate the state of the job.

Method NameRequest TypeResponse TypeDescription
CreateJobCreateJobRequestCreateJobResponseCreate a new job with the given configuration.
ReplaceJobReplaceJobRequestReplaceJobResponseReplace the configuration of an existing job with the new configuration. The caller is expected to provide the entire job configuration including the fields which are unchanged.
PatchJobPatchJobRequestPatchJobResponsePatch the configuration of an existing job. The caller is not expected to provide all the configuration fields and can provide only subset (e.g. provide only the fields which have changed). This is not supported yet.
RestartJobRestartJobRequestRestartJobResponseRestart the pods specified in the request.
PauseJobWorkflowPauseJobWorkflowRequestPauseJobWorkflowResponsePause the current running workflow. If there is no current running workflow, or the current workflow is already paused, then the method is a no-op.
ResumeJobWorkflowResumeJobWorkflowRequestResumeJobWorkflowResponseResume the current running workflow. If there is no current running workflow, or the current workflow is not paused, then the method is a no-op.
AbortJobWorkflowAbortJobWorkflowRequestAbortJobWorkflowResponseAbort the current running workflow. If there is no current running workflow, then the method is a no-op.
StartJobStartJobRequestStartJobResponseStart the pods specified in the request.
StopJobStopJobRequestStopJobResponseStop the pods specified in the request.
DeleteJobDeleteJobRequestDeleteJobResponseDelete a job and all related state.
GetJobGetJobRequestGetJobResponseGet the configuration and runtime status of a job.
GetJobIDFromJobNameGetJobIDFromJobNameRequestGetJobIDFromJobNameResponseGet the job UUID from job name.
GetWorkflowEventsGetWorkflowEventsRequestGetWorkflowEventsResponseGet the events of the current / last completed workflow of a job
ListPodsListPodsRequestListPodsResponseList all pods in a job for a given range of pod IDs.
QueryPodsQueryPodsRequestQueryPodsResponseQuery pod info in a job using a set of filters.
QueryJobsQueryJobsRequestQueryJobsResponseQuery the jobs using a set of filters. TODO find the appropriate service to put this method in.
ListJobsListJobsRequestListJobsResponseGet summary for all jobs. Results are streamed back to the caller in batches and the stream is closed once all results have been sent.
ListJobUpdatesListJobUpdatesRequestListJobUpdatesResponseList all updates (including current and previously completed) for a given job.
GetReplaceJobDiffGetReplaceJobDiffRequestGetReplaceJobDiffResponseGet the list of instances which will be added/removed/updated if the given job specification is applied via the ReplaceJob API.
RefreshJobRefreshJobRequestRefreshJobResponseAllows user to load job runtime status from the database and re-execute the action associated with current state.
GetJobCacheGetJobCacheRequestGetJobCacheResponseGet the job state in the cache.

Scalar Value Types

.proto TypeNotesC++ TypeJava TypePython Type
doubledoubledoublefloat
floatfloatfloatfloat
int32Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.int32intint
int64Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.int64longint/long
uint32Uses variable-length encoding.uint32intint/long
uint64Uses variable-length encoding.uint64longint/long
sint32Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.int32intint
sint64Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.int64longint/long
fixed32Always four bytes. More efficient than uint32 if values are often greater than 2282^{28}.uint32intint
fixed64Always eight bytes. More efficient than uint64 if values are often greater than 2562^{56}.uint64longint/long
sfixed32Always four bytes.int32intint
sfixed64Always eight bytes.int64longint/long
boolboolbooleanboolean
stringA string must always contain UTF-8 encoded or 7-bit ASCII text.stringStringstr/unicode
bytesMay contain any arbitrary sequence of bytes.stringByteStringstr