lexicons and xrpc
lexicon
computer.socialweb.k8s.getJob
The gateway reads the status of one batch/v1 Job in the named cluster of the calling account, with the pods it owns and the tail of each container's log, without a kubeconfig. Pairs with kubectlApplyServerSide: apply a Job, then poll this until phase is Succeeded or Failed. Read as the account's own ServiceAccount in that cluster. Requires a service-auth JWT from the caller's own PDS whose lxm is this method.
definitions: #condition #pod #container
parameters
| parameter | type | description |
|---|---|---|
cluster * | string | The cluster label of the calling account. |
namespace * | string | The Job's namespace. |
name * | string | The Job's name. |
tailLines | integer | How many log lines to return per container, from the end. Default 100; 0 returns no logs. Each log is also capped at 64 KiB. minimum 0 maximum 5000 |
output
| field | type | description |
|---|---|---|
namespace * | string | |
name * | string | |
uid * | string | |
phase * | string | Succeeded: the Complete (or SuccessCriteriaMet) condition is True. Failed: the Failed (or FailureTarget) condition is True. Running: at least one pod is active. Pending otherwise, which includes waiting for a node: a tenant cluster at zero nodes rents a market VM for the Job's pod first. knownValues ["Pending","Running","Succeeded","Failed"] |
active * | integer | |
succeeded * | integer | |
failed * | integer | |
startTime | string datetime | |
completionTime | string datetime | |
conditions * | array of #condition | |
pods * | array of #pod |
errors
| error | description |
|---|---|
InvalidRequest | A parameter is missing or out of range. |
Unauthorized | Missing or invalid service-auth token, or its aud or lxm does not match. |
IdentityRevoked | The caller's identity carries a deny record. |
ClusterNotFound | This account has no cluster of that name. |
ClusterNotRunning | The control plane is stopped (409). Call controlPlaneUp first. |
ClusterInitializing | The control plane is coming up (429, Retry-After). Retry. |
ClusterDraining | The cluster is being deleted (409). |
ClusterUnavailable | The gateway could not get a credential for the cluster or the cluster did not answer (503). |
ObjectNotFound | No Job of that name in that namespace (404). |
ApplyConflict | The apiserver answered 409 for the read (409); the gateway maps it as for an apply. |
KubernetesError | The apiserver refused the read; message is the apiserver's message. |
InternalError | 500: a failure the gateway maps to no named error. |
#condition object
| field | type | description |
|---|---|---|
type * | string | |
status * | string | |
reason | string | |
message | string |
#pod object
| field | type | description |
|---|---|---|
name * | string | |
phase * | string | |
node | string | |
containers * | array of #container |
#container object
| field | type | description |
|---|---|---|
name * | string | |
state * | string | knownValues ["Waiting","Running","Terminated"] |
reason | string | |
exitCode | integer | |
log | string | The last tailLines lines of the container's log (at most 64 KiB). |
logError | string | Why the log could not be read, when it could not. |
used in
no page of these docs names it yet.
raw schema: lexicons/computer/socialweb/k8s/getJob.json
{
"lexicon": 1,
"id": "computer.socialweb.k8s.getJob",
"defs": {
"main": {
"type": "query",
"description": "The gateway reads the status of one batch/v1 Job in the named cluster of the calling account, with the pods it owns and the tail of each container's log, without a kubeconfig. Pairs with kubectlApplyServerSide: apply a Job, then poll this until phase is Succeeded or Failed. Read as the account's own ServiceAccount in that cluster. Requires a service-auth JWT from the caller's own PDS whose lxm is this method.",
"parameters": {
"type": "params",
"required": [
"cluster",
"namespace",
"name"
],
"properties": {
"cluster": {
"type": "string",
"description": "The cluster label of the calling account."
},
"namespace": {
"type": "string",
"description": "The Job's namespace."
},
"name": {
"type": "string",
"description": "The Job's name."
},
"tailLines": {
"type": "integer",
"minimum": 0,
"maximum": 5000,
"description": "How many log lines to return per container, from the end. Default 100; 0 returns no logs. Each log is also capped at 64 KiB."
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": [
"namespace",
"name",
"uid",
"phase",
"active",
"succeeded",
"failed",
"conditions",
"pods"
],
"properties": {
"namespace": {
"type": "string"
},
"name": {
"type": "string"
},
"uid": {
"type": "string"
},
"phase": {
"type": "string",
"knownValues": [
"Pending",
"Running",
"Succeeded",
"Failed"
],
"description": "Succeeded: the Complete (or SuccessCriteriaMet) condition is True. Failed: the Failed (or FailureTarget) condition is True. Running: at least one pod is active. Pending otherwise, which includes waiting for a node: a tenant cluster at zero nodes rents a market VM for the Job's pod first."
},
"active": {
"type": "integer"
},
"succeeded": {
"type": "integer"
},
"failed": {
"type": "integer"
},
"startTime": {
"type": "string",
"format": "datetime"
},
"completionTime": {
"type": "string",
"format": "datetime"
},
"conditions": {
"type": "array",
"items": {
"type": "ref",
"ref": "#condition"
}
},
"pods": {
"type": "array",
"items": {
"type": "ref",
"ref": "#pod"
}
}
}
}
},
"errors": [
{
"name": "InvalidRequest",
"description": "A parameter is missing or out of range."
},
{
"name": "Unauthorized",
"description": "Missing or invalid service-auth token, or its aud or lxm does not match."
},
{
"name": "IdentityRevoked",
"description": "The caller's identity carries a deny record."
},
{
"name": "ClusterNotFound",
"description": "This account has no cluster of that name."
},
{
"name": "ClusterNotRunning",
"description": "The control plane is stopped (409). Call controlPlaneUp first."
},
{
"name": "ClusterInitializing",
"description": "The control plane is coming up (429, Retry-After). Retry."
},
{
"name": "ClusterDraining",
"description": "The cluster is being deleted (409)."
},
{
"name": "ClusterUnavailable",
"description": "The gateway could not get a credential for the cluster or the cluster did not answer (503)."
},
{
"name": "ObjectNotFound",
"description": "No Job of that name in that namespace (404)."
},
{
"name": "ApplyConflict",
"description": "The apiserver answered 409 for the read (409); the gateway maps it as for an apply."
},
{
"name": "KubernetesError",
"description": "The apiserver refused the read; message is the apiserver's message."
},
{
"name": "InternalError",
"description": "500: a failure the gateway maps to no named error."
}
]
},
"condition": {
"type": "object",
"required": [
"type",
"status"
],
"properties": {
"type": {
"type": "string"
},
"status": {
"type": "string"
},
"reason": {
"type": "string"
},
"message": {
"type": "string"
}
}
},
"pod": {
"type": "object",
"required": [
"name",
"phase",
"containers"
],
"properties": {
"name": {
"type": "string"
},
"phase": {
"type": "string"
},
"node": {
"type": "string"
},
"containers": {
"type": "array",
"items": {
"type": "ref",
"ref": "#container"
}
}
}
},
"container": {
"type": "object",
"required": [
"name",
"state"
],
"properties": {
"name": {
"type": "string"
},
"state": {
"type": "string",
"knownValues": [
"Waiting",
"Running",
"Terminated"
]
},
"reason": {
"type": "string"
},
"exitCode": {
"type": "integer"
},
"log": {
"type": "string",
"description": "The last tailLines lines of the container's log (at most 64 KiB)."
},
"logError": {
"type": "string",
"description": "Why the log could not be read, when it could not."
}
}
}
}
}